00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef G4PhantomParameterisation_HH
00044 #define G4PhantomParameterisation_HH
00045
00046 #include <vector>
00047
00048 #include "G4Types.hh"
00049 #include "G4VPVParameterisation.hh"
00050 #include "G4AffineTransform.hh"
00051
00052 class G4VPhysicalVolume;
00053 class G4VTouchable;
00054 class G4VSolid;
00055 class G4Material;
00056
00057
00058
00059 class G4Box;
00060 class G4Tubs;
00061 class G4Trd;
00062 class G4Trap;
00063 class G4Cons;
00064 class G4Orb;
00065 class G4Sphere;
00066 class G4Torus;
00067 class G4Para;
00068 class G4Hype;
00069 class G4Polycone;
00070 class G4Polyhedra;
00071
00072 class G4PhantomParameterisation : public G4VPVParameterisation
00073 {
00074 public:
00075
00076 G4PhantomParameterisation();
00077 ~G4PhantomParameterisation();
00078
00079 virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const;
00080
00081 virtual G4VSolid* ComputeSolid(const G4int, G4VPhysicalVolume *);
00082
00083 virtual G4Material* ComputeMaterial(const G4int repNo,
00084 G4VPhysicalVolume *currentVol,
00085 const G4VTouchable *parentTouch=0);
00086
00087
00088 void ComputeDimensions (G4Box &, const G4int,
00089 const G4VPhysicalVolume*) const {}
00090 void ComputeDimensions (G4Tubs&, const G4int,
00091 const G4VPhysicalVolume*) const {}
00092 void ComputeDimensions (G4Trd&, const G4int,
00093 const G4VPhysicalVolume*) const {}
00094 void ComputeDimensions (G4Trap&, const G4int,
00095 const G4VPhysicalVolume*) const {}
00096 void ComputeDimensions (G4Cons&, const G4int,
00097 const G4VPhysicalVolume*) const {}
00098 void ComputeDimensions (G4Orb&, const G4int,
00099 const G4VPhysicalVolume*) const {}
00100 void ComputeDimensions (G4Sphere&, const G4int,
00101 const G4VPhysicalVolume*) const {}
00102 void ComputeDimensions (G4Torus&, const G4int,
00103 const G4VPhysicalVolume*) const {}
00104 void ComputeDimensions (G4Para&, const G4int,
00105 const G4VPhysicalVolume*) const {}
00106 void ComputeDimensions (G4Hype&, const G4int,
00107 const G4VPhysicalVolume*) const {}
00108 void ComputeDimensions (G4Polycone&, const G4int,
00109 const G4VPhysicalVolume*) const {}
00110 void ComputeDimensions (G4Polyhedra&, const G4int,
00111 const G4VPhysicalVolume*) const {}
00112
00113 void BuildContainerSolid( G4VPhysicalVolume *pPhysicalVol );
00114 void BuildContainerSolid( G4VSolid *pMotherSolid );
00115
00116
00117
00118 virtual G4int GetReplicaNo( const G4ThreeVector& localPoint,
00119 const G4ThreeVector& localDir );
00120
00121
00122
00123
00124
00125 inline void SetMaterials(std::vector<G4Material*>& mates );
00126
00127 inline void SetMaterialIndices( size_t* matInd );
00128
00129 void SetVoxelDimensions( G4double halfx, G4double halfy, G4double halfz );
00130 void SetNoVoxel( size_t nx, size_t ny, size_t nz );
00131
00132 inline G4double GetVoxelHalfX() const;
00133 inline G4double GetVoxelHalfY() const;
00134 inline G4double GetVoxelHalfZ() const;
00135 inline size_t GetNoVoxelX() const;
00136 inline size_t GetNoVoxelY() const;
00137 inline size_t GetNoVoxelZ() const;
00138 inline size_t GetNoVoxel() const;
00139
00140 inline std::vector<G4Material*> GetMaterials() const;
00141 inline size_t* GetMaterialIndices() const;
00142 inline G4VSolid* GetContainerSolid() const;
00143
00144 G4ThreeVector GetTranslation(const G4int copyNo ) const;
00145
00146 G4bool SkipEqualMaterials() const;
00147 void SetSkipEqualMaterials( G4bool skip );
00148
00149 size_t GetMaterialIndex( size_t nx, size_t ny, size_t nz) const;
00150 size_t GetMaterialIndex( size_t copyNo) const;
00151
00152 G4Material* GetMaterial( size_t nx, size_t ny, size_t nz) const;
00153 G4Material* GetMaterial( size_t copyNo ) const;
00154
00155 void CheckVoxelsFillContainer( G4double contX, G4double contY,
00156 G4double contZ ) const;
00157
00158
00159 private:
00160
00161 void ComputeVoxelIndices(const G4int copyNo, size_t& nx,
00162 size_t& ny, size_t& nz ) const;
00163
00164
00165 void CheckCopyNo( const G4int copyNo ) const;
00166
00167
00168 protected:
00169
00170 G4double fVoxelHalfX,fVoxelHalfY,fVoxelHalfZ;
00171
00172 size_t fNoVoxelX,fNoVoxelY,fNoVoxelZ;
00173
00174 size_t fNoVoxelXY;
00175
00176 size_t fNoVoxel;
00177
00178
00179 std::vector<G4Material*> fMaterials;
00180
00181 size_t* fMaterialIndices;
00182
00183
00184 G4VSolid* fContainerSolid;
00185
00186
00187
00188 G4double fContainerWallX, fContainerWallY, fContainerWallZ;
00189
00190
00191 G4double kCarTolerance;
00192
00193
00194 G4bool bSkipEqualMaterials;
00195
00196 };
00197
00198 #include "G4PhantomParameterisation.icc"
00199
00200 #endif