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)
174 size_t& ny,
size_t& nz )
const
178 ny = size_t( (copyNo/fNoVoxelX)%
fNoVoxelY );
203 message <<
"Voxels do not fully fill the container: "
208 <<
" Maximum difference is: " << toleranceForError;
209 G4Exception(
"G4PhantomParameterisation::CheckVoxelsFillContainer()",
213 else if( std::fabs(contX-
fNoVoxelX*fVoxelHalfX) >= toleranceForWarning
214 || std::fabs(contY-
fNoVoxelY*fVoxelHalfY) >= toleranceForWarning
215 || std::fabs(contZ-
fNoVoxelZ*fVoxelHalfZ) >= toleranceForWarning )
218 message <<
"Voxels do not fully fill the container: "
223 <<
" Maximum difference is: " << toleranceForWarning;
224 G4Exception(
"G4PhantomParameterisation::CheckVoxelsFillContainer()",
240 message <<
"Point outside voxels!" <<
G4endl
241 <<
" localPoint - " << localPoint
242 <<
" - is outside container solid: "
244 <<
"DIFFERENCE WITH PHANTOM WALLS X: "
248 G4Exception(
"G4PhantomParameterisation::GetReplicaNo()",
"GeomNav0003",
282 if( localDir.
x() < 0 )
299 if( localDir.
y() < 0 )
316 if( localDir.
z() < 0 )
370 message <<
"Corrected the copy number! It was negative or too big" <<
G4endl
371 <<
" LocalPoint: " << localPoint <<
G4endl
372 <<
" LocalDir: " << localDir <<
G4endl
373 <<
" Voxel container size: " << fContainerWallX
374 <<
" " << fContainerWallY <<
" " << fContainerWallZ <<
G4endl
375 <<
" LocalPoint - wall: "
376 << localPoint.
x()-fContainerWallX <<
" "
377 << localPoint.
y()-fContainerWallY <<
" "
379 G4Exception(
"G4PhantomParameterisation::GetReplicaNo()",
398 message <<
"Copy number is negative or too big!" <<
G4endl
399 <<
" Copy number: " << copyNo <<
G4endl
400 <<
" Total number of voxels: " <<
fNoVoxel;
401 G4Exception(
"G4PhantomParameterisation::CheckCopyNo()",
std::vector< G4Material * > fMaterials
void CheckCopyNo(const G4int copyNo) const
G4LogicalVolume * GetLogicalVolume() const
G4VSolid * fContainerSolid
virtual G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=0)
~G4PhantomParameterisation()
G4PhantomParameterisation()
void ComputeVoxelIndices(const G4int copyNo, size_t &nx, size_t &ny, size_t &nz) const
void message(RunManager *runmanager)
void SetTranslation(const G4ThreeVector &v)
G4Material * GetMaterial(size_t nx, size_t ny, size_t nz) const
size_t * fMaterialIndices
virtual EInside Inside(const G4ThreeVector &p) const =0
virtual G4int GetReplicaNo(const G4ThreeVector &localPoint, const G4ThreeVector &localDir)
size_t GetMaterialIndex(size_t nx, size_t ny, size_t nz) const
G4ThreeVector GetTranslation(const G4int copyNo) const
void CheckVoxelsFillContainer(G4double contX, G4double contY, G4double contZ) const
void BuildContainerSolid(G4VPhysicalVolume *pPhysicalVol)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual void ComputeTransformation(const G4int, G4VPhysicalVolume *) const
G4VSolid * GetSolid() const
static G4GeometryTolerance * GetInstance()
virtual G4VSolid * ComputeSolid(const G4int, G4VPhysicalVolume *)
G4double GetSurfaceTolerance() const