File indexing completed on 2025-01-18 09:59:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 #ifndef G4VDIVISIONPARAMETERISATION_HH
0038 #define G4VDIVISIONPARAMETERISATION_HH 1
0039
0040 #include "G4Types.hh"
0041 #include "geomdefs.hh"
0042 #include "G4VPVParameterisation.hh"
0043 #include "G4RotationMatrix.hh"
0044
0045 enum DivisionType { DivNDIVandWIDTH, DivNDIV, DivWIDTH };
0046
0047 class G4VPhysicalVolume;
0048 class G4VSolid;
0049
0050 class G4VDivisionParameterisation : public G4VPVParameterisation
0051 {
0052 public:
0053
0054 G4VDivisionParameterisation( EAxis axis, G4int nDiv, G4double width,
0055 G4double offset, DivisionType divType,
0056 G4VSolid* motherSolid = nullptr);
0057 ~G4VDivisionParameterisation() override;
0058
0059 G4VSolid* ComputeSolid(const G4int, G4VPhysicalVolume*) override;
0060
0061 void ComputeTransformation(const G4int copyNo,
0062 G4VPhysicalVolume *physVol) const override = 0;
0063
0064 inline const G4String& GetType() const;
0065 inline EAxis GetAxis() const;
0066 inline G4int GetNoDiv() const;
0067 inline G4double GetWidth() const;
0068 inline G4double GetOffset() const;
0069 inline G4VSolid* GetMotherSolid() const;
0070 inline void SetType(const G4String& type);
0071 inline G4int VolumeFirstCopyNo() const;
0072 inline void SetHalfGap(G4double hg);
0073 inline G4double GetHalfGap() const;
0074
0075 protected:
0076
0077 void ChangeRotMatrix( G4VPhysicalVolume* physVol,
0078 G4double rotZ = 0.0 ) const;
0079
0080 G4int CalculateNDiv( G4double motherDim, G4double width,
0081 G4double offset ) const;
0082 G4double CalculateWidth( G4double motherDim, G4int nDiv,
0083 G4double offset ) const;
0084
0085 virtual void CheckParametersValidity();
0086 void CheckOffset( G4double maxPar );
0087 void CheckNDivAndWidth( G4double maxPar );
0088 virtual G4double GetMaxParameter() const = 0;
0089 G4double OffsetZ() const;
0090
0091 protected:
0092
0093 G4String ftype;
0094 EAxis faxis;
0095 G4int fnDiv = 0;
0096 G4double fwidth = 0.0;
0097 G4double foffset = 0.0;
0098 DivisionType fDivisionType;
0099 G4VSolid* fmotherSolid = nullptr;
0100 G4bool fReflectedSolid = false;
0101 G4bool fDeleteSolid = false;
0102
0103 static G4ThreadLocal G4RotationMatrix* fRot;
0104
0105 static const G4int verbose;
0106 G4int theVoluFirstCopyNo = 1;
0107
0108 G4double kCarTolerance;
0109
0110 G4double fhgap = 0.0;
0111 };
0112
0113 #include "G4VDivisionParameterisation.icc"
0114
0115 #endif