67 CheckCopyNo( copyNo );
69 std::size_t nx, ny, nz;
70 ComputeVoxelIndices( copyNo, nx, ny, nz );
83 CheckCopyNo( copyNo );
94 CheckCopyNo( copyNo );
113GetMaterial( std::size_t nx, std::size_t ny, std::size_t nz)
const
128void G4PartialPhantomParameterisation::
129ComputeVoxelIndices(
const G4int copyNo, std::size_t& nx,
130 std::size_t& ny, std::size_t& nz )
const
132 CheckCopyNo( copyNo );
134 auto ite = fFilledIDs.lower_bound(copyNo);
135 G4long dist = std::distance( fFilledIDs.cbegin(), ite );
139 G4int ifmin = (*ite).second;
144 nvoxXprev = (*ite).first;
151 nx = ifmin+copyNo-nvoxXprev-1;
189 if( localDir.
x() < 0 )
206 if( localDir.
y() < 0 )
223 if( localDir.
z() < 0 )
274 std::ostringstream message;
275 message <<
"Corrected the copy number! It was negative or too big."
277 <<
" LocalPoint: " << localPoint <<
G4endl
278 <<
" LocalDir: " << localDir <<
G4endl
281 <<
" LocalPoint - wall: "
285 G4Exception(
"G4PartialPhantomParameterisation::GetReplicaNo()",
290 auto ite = fFilledIDs.cbegin();
300 auto iteant = ite; iteant--;
301 G4int copyNo = (*iteant).first + 1 + ( nx - (*ite).second );
316void G4PartialPhantomParameterisation::CheckCopyNo(
const G4long copyNo )
const
320 std::ostringstream message;
321 message <<
"Copy number is negative or too big!" <<
G4endl
322 <<
" Copy number: " << copyNo <<
G4endl
323 <<
" Total number of voxels: " <<
fNoVoxels;
324 G4Exception(
"G4PartialPhantomParameterisation::CheckCopyNo()",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4PartialPhantomParameterisation()
std::size_t GetMaterialIndex(std::size_t nx, std::size_t ny, std::size_t nz) const
void ComputeTransformation(const G4int, G4VPhysicalVolume *) const override
G4Material * GetMaterial(std::size_t nx, std::size_t ny, std::size_t nz) const
~G4PartialPhantomParameterisation() override
G4int GetReplicaNo(const G4ThreeVector &localPoint, const G4ThreeVector &localDir) override
G4Material * ComputeMaterial(const G4int repNo, G4VPhysicalVolume *currentVol, const G4VTouchable *parentTouch=nullptr) override
void BuildContainerWalls()
G4ThreeVector GetTranslation(const G4int copyNo) const
std::size_t * fMaterialIndices
std::vector< G4Material * > fMaterials
void SetTranslation(const G4ThreeVector &v)