Warning, file /include/Geant4/G4PhantomParameterisation.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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
0038 #ifndef G4PhantomParameterisation_HH
0039 #define G4PhantomParameterisation_HH
0040
0041 #include <vector>
0042
0043 #include "G4Types.hh"
0044 #include "G4VPVParameterisation.hh"
0045 #include "G4AffineTransform.hh"
0046 #include "G4VTouchable.hh"
0047
0048 class G4VPhysicalVolume;
0049 class G4VSolid;
0050 class G4Material;
0051
0052
0053
0054 class G4Box;
0055 class G4Tubs;
0056 class G4Trd;
0057 class G4Trap;
0058 class G4Cons;
0059 class G4Orb;
0060 class G4Sphere;
0061 class G4Ellipsoid;
0062 class G4Torus;
0063 class G4Para;
0064 class G4Hype;
0065 class G4Polycone;
0066 class G4Polyhedra;
0067
0068 class G4PhantomParameterisation : public G4VPVParameterisation
0069 {
0070 public:
0071
0072 G4PhantomParameterisation();
0073 ~G4PhantomParameterisation() override;
0074
0075 void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override;
0076
0077 G4VSolid* ComputeSolid(const G4int, G4VPhysicalVolume *) override;
0078
0079 G4Material* ComputeMaterial(const G4int repNo,
0080 G4VPhysicalVolume* currentVol,
0081 const G4VTouchable* parentTouch=nullptr) override;
0082
0083
0084 void ComputeDimensions (G4Box &, const G4int,
0085 const G4VPhysicalVolume*) const override {}
0086 void ComputeDimensions (G4Tubs&, const G4int,
0087 const G4VPhysicalVolume*) const override {}
0088 void ComputeDimensions (G4Trd&, const G4int,
0089 const G4VPhysicalVolume*) const override {}
0090 void ComputeDimensions (G4Trap&, const G4int,
0091 const G4VPhysicalVolume*) const override {}
0092 void ComputeDimensions (G4Cons&, const G4int,
0093 const G4VPhysicalVolume*) const override {}
0094 void ComputeDimensions (G4Orb&, const G4int,
0095 const G4VPhysicalVolume*) const override {}
0096 void ComputeDimensions (G4Sphere&, const G4int,
0097 const G4VPhysicalVolume*) const override {}
0098 void ComputeDimensions (G4Ellipsoid&,const G4int,
0099 const G4VPhysicalVolume*) const override {}
0100 void ComputeDimensions (G4Torus&, const G4int,
0101 const G4VPhysicalVolume*) const override {}
0102 void ComputeDimensions (G4Para&, const G4int,
0103 const G4VPhysicalVolume*) const override {}
0104 void ComputeDimensions (G4Hype&, const G4int,
0105 const G4VPhysicalVolume*) const override {}
0106 void ComputeDimensions (G4Polycone&, const G4int,
0107 const G4VPhysicalVolume*) const override {}
0108 void ComputeDimensions (G4Polyhedra&, const G4int,
0109 const G4VPhysicalVolume*) const override {}
0110
0111 void BuildContainerSolid( G4VPhysicalVolume* pPhysicalVol );
0112 void BuildContainerSolid( G4VSolid* pMotherSolid );
0113
0114
0115
0116 virtual G4int GetReplicaNo( const G4ThreeVector& localPoint,
0117 const G4ThreeVector& localDir );
0118
0119
0120
0121
0122
0123 inline void SetMaterials(std::vector<G4Material*>& mates );
0124
0125 inline void SetMaterialIndices( std::size_t* matInd );
0126
0127 void SetVoxelDimensions( G4double halfx, G4double halfy, G4double halfz );
0128 void SetNoVoxels( std::size_t nx, std::size_t ny, std::size_t nz );
0129
0130 inline G4double GetVoxelHalfX() const;
0131 inline G4double GetVoxelHalfY() const;
0132 inline G4double GetVoxelHalfZ() const;
0133 inline std::size_t GetNoVoxelsX() const;
0134 inline std::size_t GetNoVoxelsY() const;
0135 inline std::size_t GetNoVoxelsZ() const;
0136 inline std::size_t GetNoVoxels() const;
0137
0138 inline std::vector<G4Material*> GetMaterials() const;
0139 inline std::size_t* GetMaterialIndices() const;
0140 inline G4VSolid* GetContainerSolid() const;
0141
0142 G4ThreeVector GetTranslation(const G4int copyNo ) const;
0143
0144 G4bool SkipEqualMaterials() const;
0145 void SetSkipEqualMaterials( G4bool skip );
0146
0147 std::size_t GetMaterialIndex( std::size_t nx, std::size_t ny, std::size_t nz) const;
0148 std::size_t GetMaterialIndex( std::size_t copyNo) const;
0149
0150 G4Material* GetMaterial( std::size_t nx, std::size_t ny, std::size_t nz) const;
0151 G4Material* GetMaterial( std::size_t copyNo ) const;
0152
0153 void CheckVoxelsFillContainer( G4double contX, G4double contY,
0154 G4double contZ ) const;
0155
0156
0157 private:
0158
0159 void ComputeVoxelIndices(const G4int copyNo, std::size_t& nx,
0160 std::size_t& ny, std::size_t& nz ) const;
0161
0162
0163 void CheckCopyNo( const G4long copyNo ) const;
0164
0165
0166 protected:
0167
0168 G4double fVoxelHalfX = 0.0, fVoxelHalfY = 0.0, fVoxelHalfZ = 0.0;
0169
0170 std::size_t fNoVoxelsX = 0, fNoVoxelsY = 0, fNoVoxelsZ = 0;
0171
0172 std::size_t fNoVoxelsXY = 0;
0173
0174 std::size_t fNoVoxels = 0;
0175
0176
0177 std::vector<G4Material*> fMaterials;
0178
0179 std::size_t* fMaterialIndices = nullptr;
0180
0181
0182 G4VSolid* fContainerSolid = nullptr;
0183
0184
0185
0186 G4double fContainerWallX=0.0, fContainerWallY=0.0, fContainerWallZ=0.0;
0187
0188
0189 G4double kCarTolerance;
0190
0191
0192 G4bool bSkipEqualMaterials = true;
0193
0194 };
0195
0196 #include "G4PhantomParameterisation.icc"
0197
0198 #endif