76 fZSliceHeaderMerged(0),
146 z = 6.0, a = 12.011 *
g/
mole );
149 z = 1.0, a = 1.008 *
g/
mole );
152 z = 7.0, a = 14.007 *
g/
mole );
155 z = 8.0, a = 16.00 *
g/
mole );
158 z= 11.0, a = 22.98977*
g/
mole );
161 z = 12.0, a = 24.3050*
g/
mole );
164 z = 15.0, a = 30.973976*
g/
mole );
167 z = 16.0,a = 32.065*
g/
mole );
170 z = 17.0, a = 35.453*
g/
mole );
173 z = 19.0, a = 30.0983*
g/
mole );
177 z = 26, a = 56.845*
g/
mole );
181 z = 20.0, a = 40.078*
g/
mole );
185 z = 30.0,a = 65.382*
g/
mole );
188 G4int numberofElements;
193 numberofElements = 2 );
200 numberofElements = 13);
217 density = 0.217*
g/
cm3,
218 numberofElements = 9);
231 density = 0.508*
g/
cm3,
232 numberofElements = 9 );
245 density = 0.967*
g/
cm3,
246 numberofElements = 7);
257 numberofElements = 13);
275 density = 0.990*
g/
cm3,
276 numberofElements = 8 );
288 numberofElements = 8);
302 numberofElements = 2 );
308 density = 1.061*
g/
cm3,
309 numberofElements = 9 );
322 density = 1.071*
g/
cm3,
323 numberofElements = 9);
336 numberofElements = 10);
351 density = 1.159*
g/
cm3,
352 numberofElements = 12 );
370 numberofElements = 12);
386 density = 1.575*
g/
cm3,
387 numberofElements = 11 );
402 numberofElements = 9);
416 numberofElements = 10);
428 #ifdef DICOM_USE_HEAD
438 G4cout <<
"The materials of the DICOM Head have been used" <<
G4endl;
450 G4cout <<
"Default materials of the DICOM Extended examples have been used"
461 std::ifstream
fin(fileName);
462 std::vector<G4String> wl;
471 if( mateName[0] ==
'"' && mateName[mateName.length()-1] ==
'"' ) {
472 mateName = mateName.substr(1,mateName.length()-2);
474 G4cout <<
"GmReadPhantomG4Geometry::ReadPhantomData reading nmate "
475 << ii <<
" = " << nmate
476 <<
" mate " << mateName <<
G4endl;
478 G4Exception(
"GmReadPhantomG4Geometry::ReadPhantomData",
480 "Material number should be in increasing order:wrong material number");
484 for(
auto matite = matTab->cbegin(); matite != matTab->cend(); ++matite )
486 if( (*matite)->GetName() == mateName ) {
493 if( !mate )
G4Exception(
"GmReadPhantomG4Geometry::ReadPhantomData",
496 (
"Material not found" + mateName).c_str());
501 G4cout <<
"GmReadPhantomG4Geometry::ReadPhantomData fNVoxel X/Y/Z "
511 G4cout <<
" Extension in X " <<
fMinX <<
" " << fMaxX << G4endl
512 <<
" Extension in Y " <<
fMinY <<
" " << fMaxY << G4endl
513 <<
" Extension in Z " <<
fMinZ <<
" " << fMaxZ <<
G4endl;
523 if( mateID < 0 || mateID >= nMaterials ) {
524 G4Exception(
"GmReadPhantomG4Geometry::ReadPhantomData",
525 "Wrong index in phantom file",
527 G4String(
"It should be between 0 and "
548 std::map<G4int, std::pair<G4double,G4double> > densiMinMax;
549 std::map<G4int, std::pair<G4double,G4double> >::iterator mpite;
555 char*
part = std::getenv(
"DICOM_CHANGE_MATERIAL_DENSITY" );
559 std::map<G4int,G4double> densityDiffs;
562 densityDiffs[ii] = densityDiff;
567 std::map< std::pair<G4Material*,G4int>,
matInfo* > newMateDens;
577 if( densityDiff != -1. )
continue;
581 if( dens < (*mpite).second.first ) (*mpite).second.first = dens;
582 if( dens > (*mpite).second.second ) (*mpite).second.second = dens;
585 std::map<G4int,G4Material*>::const_iterator imite =
593 G4int densityBin = (
G4int(dens/densityDiffs[mateID]));
595 G4String mateName = (*imite).second->GetName()
598 std::pair<G4Material*,G4int> matdens((*imite).second, densityBin );
600 auto mppite = newMateDens.find( matdens );
601 if( mppite != newMateDens.cend() ){
602 matInfo* mi = (*mppite).second;
610 mi->
fId =
G4int(newMateDens.size()+1);
611 newMateDens[matdens] = mi;
618 if( densityDiff != -1. ) {
619 for( mpite = densiMinMax.begin(); mpite != densiMinMax.end(); ++mpite )
622 G4cout <<
"DicomDetectorConstruction::ReadVoxelDensities"
623 <<
" ORIG MATERIALS DENSITY "
624 << (*mpite).first <<
" MIN " << (*mpite).second.first <<
" MAX "
625 << (*mpite).second.second <<
G4endl;
639 for(
auto mppite= newMateDens.cbegin(); mppite!=newMateDens.cend(); ++mppite )
641 G4double averdens = (*mppite).second->fSumdens/(*mppite).second->fNvoxels;
644 G4cout <<
"DicomDetectorConstruction::ReadVoxelDensities AVER DENS "
645 << averdens <<
" -> "
646 << saverdens <<
" -> " <<
G4int(1000*averdens) <<
" "
647 <<
G4int(1000*averdens)/1000
651 G4String mateName = ((*mppite).first).first->GetName() +
"_"
654 (*mppite).first.first,
G4float(averdens), mateName ) );
662 std::ifstream finDF(dataFile.c_str());
665 if(finDF.good() != 1 )
667 G4String descript =
"Problem reading data file: "+dataFile;
668 G4Exception(
" DicomDetectorConstruction::ReadPhantomData",
" ",
673 finDF >> compression;
695 G4cout <<
" DicomDetectorConstruction::ReadPhantomDataFile opening file "
699 G4cout <<
" DicomDetectorConstruction::ReadPhantomDataFile opening file "
704 if( !
fin.is_open() ) {
705 G4Exception(
"DicomDetectorConstruction::ReadPhantomDataFile",
708 G4String(
"File not found " + fname ).c_str());
712 char*
part = std::getenv(
"DICOM_CHANGE_MATERIAL_DENSITY" );
715 if( densityDiff != -1. )
750 for(
G4int ii = 0; ii < nVoxels; ++ii, voxelCopyNo++ )
762 for(
G4int ii = 0; ii < nVoxels; ++ii, voxelCopyNo++ )
767 mateID = unsigned(
fMateIDs[voxelCopyNo]);
774 if( densityDiff != -1.) {
786 if(
fMaterials[im]->GetName() == newMateName ) {
795 if( densityDiff != -1.) {
797 densityBin, newMateName ) );
802 G4Exception(
"DicomDetectorConstruction::ReadPhantomDataFile",
805 "Wrong index in material");
831 for(
G4int ii = 0; ii < nelem; ++ii )
835 mate->AddElement( elem, frac );
881 G4cout <<
" placing voxel container volume at " << posCentreVoxels <<
G4endl;
923 G4cout <<
" placing voxel container volume at " << posCentreVoxels <<
G4endl;
967 G4String concreteSDname =
"phantomSD";
968 std::vector<G4String> scorer_names;
969 scorer_names.push_back(concreteSDname);