forked from rjones30/HDGeant4
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add header files from the G4ROOT/source/geometry/divisions/include
source tree into G4.10.07.p03fixes to make sure that all instances of #include "G4VDivisionParameterisation.hh" pick up the modified version of that file. [rtj]
- Loading branch information
Richard T. Jones
committed
Nov 30, 2023
1 parent
964e259
commit d995e08
Showing
9 changed files
with
1,838 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
// | ||
// ******************************************************************** | ||
// * License and Disclaimer * | ||
// * * | ||
// * The Geant4 software is copyright of the Copyright Holders of * | ||
// * the Geant4 Collaboration. It is provided under the terms and * | ||
// * conditions of the Geant4 Software License, included in the file * | ||
// * LICENSE and available at http://cern.ch/geant4/license . These * | ||
// * include a list of copyright holders. * | ||
// * * | ||
// * Neither the authors of this software system, nor their employing * | ||
// * institutes,nor the agencies providing financial support for this * | ||
// * work make any representation or warranty, express or implied, * | ||
// * regarding this software system or assume any liability for its * | ||
// * use. Please see the license in the file LICENSE and URL above * | ||
// * for the full disclaimer and the limitation of liability. * | ||
// * * | ||
// * This code implementation is the result of the scientific and * | ||
// * technical work of the GEANT4 collaboration. * | ||
// * By using, copying, modifying or distributing the software (or * | ||
// * any work based on the software) you agree to acknowledge its * | ||
// * use in resulting scientific publications, and indicate your * | ||
// * acceptance of all terms of the Geant4 Software license. * | ||
// ******************************************************************** | ||
// | ||
// G4PVDivision | ||
// | ||
// Class description: | ||
// | ||
// Represents many touchable detector elements differing only in their | ||
// positioning. The elements' positions are calculated by means of a simple | ||
// linear formula. | ||
// | ||
// G4PVDivision(const G4String& pName, | ||
// G4LogicalVolume* pLogical, | ||
// G4LogicalVolume* pMother, | ||
// const EAxis pAxis, | ||
// const G4int nReplicas, | ||
// const G4double width, | ||
// const G4double offset=0) | ||
// | ||
// Division may occur along: | ||
// | ||
// o Cartesian axes (kXAxis,kYAxis,kZAxis) | ||
// | ||
// The divisions, of specified width have coordinates of | ||
// form (-width*(nReplicas-1)*0.5+n*width,0,0) where n=0.. nReplicas-1 | ||
// for the case of kXAxis, and are unrotated. | ||
// | ||
// o Radial axis (cylindrical polar) (kRho) | ||
// | ||
// The divisions are cons/tubs sections, centred on the origin | ||
// and are unrotated. | ||
// They have radii of width*n+offset to width*(n+1)+offset | ||
// where n=0..nReplicas-1 | ||
// | ||
// o Phi axis (cylindrical polar) (kPhi) | ||
// The divisions are `phi sections' or wedges, and of cons/tubs form | ||
// They have phi of offset+n*width to offset+(n+1)*width where | ||
// n=0..nReplicas-1 | ||
|
||
// 09.05.01 - P.Arce, Initial version | ||
// ---------------------------------------------------------------------- | ||
#ifndef G4PVDIVISION_HH | ||
#define G4PVDIVISION_HH | ||
|
||
#include "geomdefs.hh" | ||
#include "G4PVReplica.hh" | ||
#include "G4VDivisionParameterisation.hh" | ||
|
||
class G4LogicalVolume; | ||
class G4VSolid; | ||
|
||
class G4PVDivision : public G4PVReplica | ||
{ | ||
public: // with description | ||
|
||
G4PVDivision(const G4String& pName, | ||
G4LogicalVolume* pLogical, | ||
G4LogicalVolume* pMother, | ||
const EAxis pAxis, | ||
const G4int nReplicas, | ||
const G4double width, | ||
const G4double offset ); | ||
// Constructor with number of divisions and width | ||
|
||
G4PVDivision(const G4String& pName, | ||
G4LogicalVolume* pLogical, | ||
G4LogicalVolume* pMotherLogical, | ||
const EAxis pAxis, | ||
const G4int nReplicas, | ||
const G4double offset ); | ||
// Constructor with number of divisions | ||
|
||
G4PVDivision(const G4String& pName, | ||
G4LogicalVolume* pLogical, | ||
G4LogicalVolume* pMotherLogical, | ||
const EAxis pAxis, | ||
const G4double width, | ||
const G4double offset ); | ||
// Constructor with width | ||
|
||
G4PVDivision(const G4String& pName, | ||
G4LogicalVolume* pLogical, | ||
G4VPhysicalVolume* pMother, | ||
const EAxis pAxis, | ||
const G4int nReplicas, | ||
const G4double width, | ||
const G4double offset); | ||
// Constructor in mother physical volume (same as first constructor) | ||
|
||
virtual ~G4PVDivision(); | ||
|
||
G4PVDivision(const G4PVDivision&) = delete; | ||
G4PVDivision& operator=(const G4PVDivision&) = delete; | ||
|
||
virtual G4bool IsMany() const; | ||
virtual G4bool IsReplicated() const; | ||
virtual G4int GetMultiplicity() const; | ||
virtual G4VPVParameterisation* GetParameterisation() const; | ||
virtual void GetReplicationData( EAxis& axis, | ||
G4int& nReplicas, | ||
G4double& width, | ||
G4double& offset, | ||
G4bool& consuming ) const; | ||
EAxis GetDivisionAxis() const; | ||
G4bool IsParameterised() const; | ||
|
||
virtual EVolume VolumeType() const; | ||
// Characterise the type of volume - normal/replicated/parameterised. | ||
|
||
G4bool IsRegularStructure() const; | ||
G4int GetRegularStructureId() const; | ||
// Methods to identify volume that can have revised 'regular' navigation. | ||
// Currently divisions do not qualify for this. | ||
|
||
private: | ||
|
||
void CheckAndSetParameters( const EAxis pAxis, | ||
const G4int nDivs, | ||
const G4double width, | ||
const G4double offset, | ||
DivisionType divType, | ||
const G4LogicalVolume* pMotherLogical ); | ||
|
||
void SetParameterisation( G4LogicalVolume* motherLogical, | ||
const EAxis pAxis, | ||
const G4int nReplicas, | ||
const G4double width, | ||
const G4double offset, | ||
DivisionType divType ); | ||
void ErrorInAxis( EAxis axis, G4VSolid* solid ); | ||
|
||
protected: | ||
|
||
EAxis faxis; // axis of optimisation | ||
EAxis fdivAxis; // axis of division | ||
G4int fnReplicas = 0; | ||
G4double fwidth = 0.0, foffset = 0.0; | ||
G4VDivisionParameterisation* fparam = nullptr; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
// | ||
// ******************************************************************** | ||
// * License and Disclaimer * | ||
// * * | ||
// * The Geant4 software is copyright of the Copyright Holders of * | ||
// * the Geant4 Collaboration. It is provided under the terms and * | ||
// * conditions of the Geant4 Software License, included in the file * | ||
// * LICENSE and available at http://cern.ch/geant4/license . These * | ||
// * include a list of copyright holders. * | ||
// * * | ||
// * Neither the authors of this software system, nor their employing * | ||
// * institutes,nor the agencies providing financial support for this * | ||
// * work make any representation or warranty, express or implied, * | ||
// * regarding this software system or assume any liability for its * | ||
// * use. Please see the license in the file LICENSE and URL above * | ||
// * for the full disclaimer and the limitation of liability. * | ||
// * * | ||
// * This code implementation is the result of the scientific and * | ||
// * technical work of the GEANT4 collaboration. * | ||
// * By using, copying, modifying or distributing the software (or * | ||
// * any work based on the software) you agree to acknowledge its * | ||
// * use in resulting scientific publications, and indicate your * | ||
// * acceptance of all terms of the Geant4 Software license. * | ||
// ******************************************************************** | ||
// | ||
// G4ParameterisationBox[X/Y/Z] | ||
// | ||
// Class description: | ||
// | ||
// These classes represent the parameterised positioning equivalent to | ||
// dividing a G4Box along one of each axis X, Y, Z. | ||
|
||
// 09.05.01 - P.Arce, Initial version | ||
// 08.04.04 - I.Hrivnacova, Implemented reflection | ||
// -------------------------------------------------------------------- | ||
#ifndef G4PARAMETERISATIONBOX_HH | ||
#define G4PARAMETERISATIONBOX_HH 1 | ||
|
||
#include "G4VDivisionParameterisation.hh" | ||
|
||
class G4VSolid; | ||
class G4VPhysicalVolume; | ||
|
||
// Dummy declarations to get rid of warnings ... | ||
// | ||
class G4Cons; | ||
class G4Trd; | ||
class G4Sphere; | ||
class G4Orb; | ||
class G4Ellipsoid; | ||
class G4Torus; | ||
class G4Para; | ||
class G4Hype; | ||
class G4Tubs; | ||
class G4Polycone; | ||
class G4Polyhedra; | ||
|
||
class G4VParameterisationBox : public G4VDivisionParameterisation | ||
{ | ||
public: // with description | ||
|
||
G4VParameterisationBox( EAxis axis, G4int nCopies, | ||
G4double offset, G4double step, | ||
G4VSolid* msolid, DivisionType divType ); | ||
|
||
virtual ~G4VParameterisationBox(); | ||
}; | ||
|
||
class G4ParameterisationBoxX : public G4VParameterisationBox | ||
{ | ||
public: // with description | ||
|
||
G4ParameterisationBoxX( EAxis axis, G4int nCopies, | ||
G4double offset, G4double step, | ||
G4VSolid* msolid, DivisionType divType ); | ||
~G4ParameterisationBoxX(); | ||
|
||
G4double GetMaxParameter() const; | ||
|
||
void ComputeTransformation( const G4int copyNo, | ||
G4VPhysicalVolume* physVol ) const; | ||
void ComputeDimensions(G4Box& box, const G4int copyNo, | ||
const G4VPhysicalVolume* physVol) const; | ||
|
||
private: // Dummy declarations to get rid of warnings ... | ||
|
||
void ComputeDimensions (G4Cons&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Trd&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Sphere&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Orb&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Ellipsoid&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Torus&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Para&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Trap&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Hype&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Tubs&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Polycone&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Polyhedra&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
}; | ||
|
||
class G4ParameterisationBoxY : public G4VParameterisationBox | ||
{ | ||
public: // with description | ||
|
||
G4ParameterisationBoxY( EAxis axis, G4int nCopies, | ||
G4double offset, G4double step, | ||
G4VSolid* msolid, DivisionType divType ); | ||
~G4ParameterisationBoxY(); | ||
|
||
G4double GetMaxParameter() const; | ||
|
||
void ComputeTransformation( const G4int copyNo, | ||
G4VPhysicalVolume* physVol ) const; | ||
|
||
void ComputeDimensions(G4Box& box, const G4int copyNo, | ||
const G4VPhysicalVolume* physVol) const; | ||
|
||
private: // Dummy declarations to get rid of warnings ... | ||
|
||
void ComputeDimensions (G4Cons&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Trd&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Sphere&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Orb&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Ellipsoid&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Torus&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Para&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Trap&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Hype&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Tubs&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Polycone&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Polyhedra&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
}; | ||
|
||
class G4ParameterisationBoxZ : public G4VParameterisationBox | ||
{ | ||
public: // with description | ||
|
||
G4ParameterisationBoxZ( EAxis axis, G4int nCopies, | ||
G4double offset, G4double step, | ||
G4VSolid* msolid, DivisionType divType ); | ||
~G4ParameterisationBoxZ(); | ||
|
||
G4double GetMaxParameter() const; | ||
|
||
void ComputeTransformation( const G4int copyNo, | ||
G4VPhysicalVolume* physVol ) const; | ||
void ComputeDimensions(G4Box& box, const G4int copyNo, | ||
const G4VPhysicalVolume* physVol) const; | ||
|
||
private: // Dummy declarations to get rid of warnings ... | ||
|
||
void ComputeDimensions (G4Cons&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Trd&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Sphere&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Orb&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Ellipsoid&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Torus&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Para&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Trap&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Hype&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Tubs&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Polycone&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
void ComputeDimensions (G4Polyhedra&,const G4int, | ||
const G4VPhysicalVolume*) const {} | ||
}; | ||
|
||
#endif |
Oops, something went wrong.