70 CheckCopyNo( copyNo );
72 std::size_t nx, ny, nz;
73 ComputeVoxelIndices( copyNo, nx, ny, nz );
86 CheckCopyNo( copyNo );
97 CheckCopyNo( copyNo );
116GetMaterial( std::size_t nx, std::size_t ny, std::size_t nz)
const
131void G4PartialPhantomParameterisation::
132ComputeVoxelIndices(
const G4int copyNo, std::size_t& nx,
133 std::size_t& ny, std::size_t& nz )
const
135 CheckCopyNo( copyNo );
137 auto ite = fFilledIDs.lower_bound(copyNo);
138 G4long dist = std::distance( fFilledIDs.cbegin(), ite );
142 G4int ifmin = (*ite).second;
147 nvoxXprev = (*ite).first;
154 nx = ifmin+copyNo-nvoxXprev-1;
192 if( localDir.
x() < 0 )
209 if( localDir.
y() < 0 )
226 if( localDir.
z() < 0 )
277 std::ostringstream message;
278 message <<
"Corrected the copy number! It was negative or too big."
280 <<
" LocalPoint: " << localPoint <<
G4endl
281 <<
" LocalDir: " << localDir <<
G4endl
284 <<
" LocalPoint - wall: "
288 G4Exception(
"G4PartialPhantomParameterisation::GetReplicaNo()",
293 auto ite = fFilledIDs.cbegin();
303 auto iteant = ite; iteant--;
304 G4int copyNo = (*iteant).first + 1 + ( nx - (*ite).second );
319void G4PartialPhantomParameterisation::CheckCopyNo(
const G4long copyNo )
const
323 std::ostringstream message;
324 message <<
"Copy number is negative or too big!" <<
G4endl
325 <<
" Copy number: " << copyNo <<
G4endl
326 <<
" Total number of voxels: " <<
fNoVoxels;
327 G4Exception(
"G4PartialPhantomParameterisation::CheckCopyNo()",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr)
G4PartialPhantomParameterisation()
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const
std::size_t GetMaterialIndex(std::size_t nx, std::size_t ny, std::size_t nz) const
G4Material * GetMaterial(std::size_t nx, std::size_t ny, std::size_t nz) const
G4int GetReplicaNo(const G4ThreeVector &localPoint, const G4ThreeVector &localDir)
void BuildContainerWalls()
G4ThreeVector GetTranslation(const G4int copyNo) const
~G4PartialPhantomParameterisation()
std::size_t * fMaterialIndices
std::vector< G4Material * > fMaterials
void SetTranslation(const G4ThreeVector &v)