47 : fVoxelHalfX(0.), fVoxelHalfY(0.), fVoxelHalfZ(0.),
48 fNoVoxelX(0), fNoVoxelY(0), fNoVoxelZ(0), fNoVoxelXY(0), fNoVoxel(0),
49 fMaterialIndices(0), fContainerSolid(0),
50 fContainerWallX(0.), fContainerWallY(0.), fContainerWallZ(0.),
51 bSkipEqualMaterials(true)
104 CheckCopyNo( copyNo );
110 ComputeVoxelIndices( copyNo, nx, ny, nz );
131 CheckCopyNo( copyNo );
142 CheckCopyNo( copyNo );
171 void G4PhantomParameterisation::
172 ComputeVoxelIndices(
const G4int copyNo,
size_t& nx,
173 size_t& ny,
size_t& nz )
const
175 CheckCopyNo( copyNo );
201 std::ostringstream message;
202 message <<
"Voxels do not fully fill the container: "
207 <<
" Maximum difference is: " << toleranceForError;
208 G4Exception(
"G4PhantomParameterisation::CheckVoxelsFillContainer()",
212 else if( std::fabs(contX-
fNoVoxelX*fVoxelHalfX) >= toleranceForWarning
213 || std::fabs(contY-
fNoVoxelY*fVoxelHalfY) >= toleranceForWarning
214 || std::fabs(contZ-
fNoVoxelZ*fVoxelHalfZ) >= toleranceForWarning )
216 std::ostringstream message;
217 message <<
"Voxels do not fully fill the container: "
222 <<
" Maximum difference is: " << toleranceForWarning;
223 G4Exception(
"G4PhantomParameterisation::CheckVoxelsFillContainer()",
238 std::ostringstream message;
239 message <<
"Point outside voxels!" <<
G4endl
240 <<
" localPoint - " << localPoint
241 <<
" - is outside container solid: "
243 G4Exception(
"G4PhantomParameterisation::GetReplicaNo()",
"GeomNav0003",
277 if( localDir.
x() < 0 )
294 if( localDir.
y() < 0 )
311 if( localDir.
z() < 0 )
364 std::ostringstream message;
365 message <<
"Corrected the copy number! It was negative or too big" <<
G4endl
366 <<
" LocalPoint: " << localPoint <<
G4endl
367 <<
" LocalDir: " << localDir <<
G4endl
370 <<
" LocalPoint - wall: "
374 G4Exception(
"G4PhantomParameterisation::GetReplicaNo()",
386 void G4PhantomParameterisation::CheckCopyNo(
const G4int copyNo )
const
390 std::ostringstream message;
391 message <<
"Copy number is negative or too big!" <<
G4endl
392 <<
" Copy number: " << copyNo <<
G4endl
393 <<
" Total number of voxels: " <<
fNoVoxel;
394 G4Exception(
"G4PhantomParameterisation::CheckCopyNo()",
~G4PhantomParameterisation()
G4double GetSurfaceTolerance() const
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
size_t GetMaterialIndex(size_t nx, size_t ny, size_t nz) const
virtual G4int GetReplicaNo(const G4ThreeVector &localPoint, const G4ThreeVector &localDir)
void BuildContainerSolid(G4VPhysicalVolume *pPhysicalVol)
size_t * fMaterialIndices
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
G4PhantomParameterisation()
void SetTranslation(const G4ThreeVector &v)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void CheckVoxelsFillContainer(G4double contX, G4double contY, G4double contZ) const
G4Material * GetMaterial(size_t nx, size_t ny, size_t nz) const
G4LogicalVolume * GetLogicalVolume() const
G4VSolid * fContainerSolid
std::vector< G4Material * > fMaterials
static G4GeometryTolerance * GetInstance()
G4VSolid * GetSolid() const
G4ThreeVector GetTranslation(const G4int copyNo) const