Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/ICRP110_HumanPhantoms/src/ICRP110PhantomConstruction.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/ICRP110_HumanPhantoms/src/ICRP110PhantomConstruction.cc (Version 11.3.0) and /examples/advanced/ICRP110_HumanPhantoms/src/ICRP110PhantomConstruction.cc (Version 8.2)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 // Code developed by:                             
 27 // S.Guatelli, M. Large and A. Malaroda, Unive    
 28 //                                                
 29 #include "ICRP110PhantomConstruction.hh"          
 30 #include "ICRP110PhantomNestedParameterisation    
 31 #include "ICRP110PhantomMaterial_Female.hh"       
 32 #include "ICRP110PhantomMaterial_Male.hh"         
 33 #include "globals.hh"                             
 34 #include "G4SystemOfUnits.hh"                     
 35 #include "G4Box.hh"                               
 36 #include "G4Colour.hh"                            
 37 #include "G4LogicalVolume.hh"                     
 38 #include "G4PVPlacement.hh"                       
 39 #include "G4PVParameterised.hh"                   
 40 #include "G4VPhysicalVolume.hh"                   
 41 #include "G4PVPlacement.hh"                       
 42 #include "G4PVParameterised.hh"                   
 43 #include "G4RunManager.hh"                        
 44 #include "G4VisAttributes.hh"                     
 45 #include <map>                                    
 46 #include <cstdlib>                                
 47                                                   
 48 ICRP110PhantomConstruction::ICRP110PhantomCons    
 49    fMotherVolume(nullptr), fPhantomContainer(n    
 50    fNVoxelX(0), fNVoxelY(0), fNVoxelZ(0),         
 51    fVoxelHalfDimX(0), fVoxelHalfDimY(0), fVoxe    
 52    fMinX(0),fMaxX(0), fMinY(0), fMaxY(0),         
 53    fMinZ(0), fMaxZ(0), fNoFiles(0), fNVoxels(0    
 54    fMateIDs(nullptr)                              
 55 {                                                 
 56   fMessenger = new ICRP110PhantomMessenger(thi    
 57   // the messenger allows to set the sex of th    
 58   // interactively                                
 59   fMaterial_Female = new ICRP110PhantomMateria    
 60   fMaterial_Male = new ICRP110PhantomMaterial_    
 61   fSex = "female"; // Female phantom is the de    
 62   fSection = "head"; // Head partial phantom i    
 63 }                                                 
 64                                                   
 65 ICRP110PhantomConstruction::~ICRP110PhantomCon    
 66 {                                                 
 67   delete fMaterial_Female;                        
 68   delete fMaterial_Male;                          
 69   delete fMessenger;                              
 70 }                                                 
 71                                                   
 72 G4VPhysicalVolume* ICRP110PhantomConstruction:    
 73 {                                                 
 74   // Define Material Air                          
 75   G4double A;  // atomic mass                     
 76   G4double Z;  // atomic number                   
 77   G4double d;  // density                         
 78                                                   
 79   A = 14.01*g/mole;                               
 80   auto elN = new G4Element("Nitrogen","N",Z =     
 81   A = 16.00*g/mole;                               
 82   auto elO = new G4Element("Oxygen","O",Z = 8.    
 83                                                   
 84   d = 0.001 *g/cm3;                               
 85   auto matAir = new G4Material("Air",d,2);        
 86   matAir -> AddElement(elN,0.8);                  
 87   matAir -> AddElement(elO,0.2);                  
 88                                                   
 89  std::vector<G4Material*> pMaterials;             
 90                                                   
 91  if(fSex == "female"){                            
 92                                                   
 93   fMaterial_Female -> DefineMaterials();          
 94 //----- Store materials in a vector               
 95     pMaterials.push_back(matAir);                 
 96     pMaterials.push_back(fMaterial_Female -> G    
 97     pMaterials.push_back(fMaterial_Female -> G    
 98     pMaterials.push_back(fMaterial_Female -> G    
 99     pMaterials.push_back(fMaterial_Female -> G    
100     pMaterials.push_back(fMaterial_Female -> G    
101     pMaterials.push_back(fMaterial_Female -> G    
102     pMaterials.push_back(fMaterial_Female -> G    
103     pMaterials.push_back(fMaterial_Female -> G    
104     pMaterials.push_back(fMaterial_Female -> G    
105     pMaterials.push_back(fMaterial_Female -> G    
106     pMaterials.push_back(fMaterial_Female -> G    
107     pMaterials.push_back(fMaterial_Female -> G    
108     pMaterials.push_back(fMaterial_Female -> G    
109     pMaterials.push_back(fMaterial_Female -> G    
110     pMaterials.push_back(fMaterial_Female -> G    
111     pMaterials.push_back(fMaterial_Female -> G    
112     pMaterials.push_back(fMaterial_Female -> G    
113     pMaterials.push_back(fMaterial_Female -> G    
114     pMaterials.push_back(fMaterial_Female -> G    
115     pMaterials.push_back(fMaterial_Female -> G    
116     pMaterials.push_back(fMaterial_Female -> G    
117     pMaterials.push_back(fMaterial_Female -> G    
118     pMaterials.push_back(fMaterial_Female -> G    
119     pMaterials.push_back(fMaterial_Female -> G    
120     pMaterials.push_back(fMaterial_Female -> G    
121     pMaterials.push_back(fMaterial_Female -> G    
122     pMaterials.push_back(fMaterial_Female -> G    
123     pMaterials.push_back(fMaterial_Female -> G    
124     pMaterials.push_back(fMaterial_Female -> G    
125     pMaterials.push_back(fMaterial_Female -> G    
126     pMaterials.push_back(fMaterial_Female -> G    
127     pMaterials.push_back(fMaterial_Female -> G    
128     pMaterials.push_back(fMaterial_Female -> G    
129     pMaterials.push_back(fMaterial_Female -> G    
130     pMaterials.push_back(fMaterial_Female -> G    
131     pMaterials.push_back(fMaterial_Female -> G    
132     pMaterials.push_back(fMaterial_Female -> G    
133     pMaterials.push_back(fMaterial_Female -> G    
134     pMaterials.push_back(fMaterial_Female -> G    
135     pMaterials.push_back(fMaterial_Female -> G    
136     pMaterials.push_back(fMaterial_Female -> G    
137     pMaterials.push_back(fMaterial_Female -> G    
138     pMaterials.push_back(fMaterial_Female -> G    
139     pMaterials.push_back(fMaterial_Female -> G    
140     pMaterials.push_back(fMaterial_Female -> G    
141     pMaterials.push_back(fMaterial_Female -> G    
142     pMaterials.push_back(fMaterial_Female -> G    
143     pMaterials.push_back(fMaterial_Female -> G    
144     pMaterials.push_back(fMaterial_Female -> G    
145     pMaterials.push_back(fMaterial_Female -> G    
146     pMaterials.push_back(fMaterial_Female -> G    
147     pMaterials.push_back(fMaterial_Female -> G    
148  }                                                
149  else if (fSex == "male"){                        
150  // MATT do the same here                         
151     fMaterial_Male -> DefineMaterials();          
152                                                   
153 //----- Store materials in a vector               
154     pMaterials.push_back(matAir);                 
155     pMaterials.push_back(fMaterial_Male -> Get    
156     pMaterials.push_back(fMaterial_Male -> Get    
157     pMaterials.push_back(fMaterial_Male -> Get    
158     pMaterials.push_back(fMaterial_Male -> Get    
159     pMaterials.push_back(fMaterial_Male -> Get    
160     pMaterials.push_back(fMaterial_Male -> Get    
161     pMaterials.push_back(fMaterial_Male -> Get    
162     pMaterials.push_back(fMaterial_Male -> Get    
163     pMaterials.push_back(fMaterial_Male -> Get    
164     pMaterials.push_back(fMaterial_Male -> Get    
165     pMaterials.push_back(fMaterial_Male -> Get    
166     pMaterials.push_back(fMaterial_Male -> Get    
167     pMaterials.push_back(fMaterial_Male -> Get    
168     pMaterials.push_back(fMaterial_Male -> Get    
169     pMaterials.push_back(fMaterial_Male -> Get    
170     pMaterials.push_back(fMaterial_Male -> Get    
171     pMaterials.push_back(fMaterial_Male -> Get    
172     pMaterials.push_back(fMaterial_Male -> Get    
173     pMaterials.push_back(fMaterial_Male -> Get    
174     pMaterials.push_back(fMaterial_Male -> Get    
175     pMaterials.push_back(fMaterial_Male -> Get    
176     pMaterials.push_back(fMaterial_Male -> Get    
177     pMaterials.push_back(fMaterial_Male -> Get    
178     pMaterials.push_back(fMaterial_Male -> Get    
179     pMaterials.push_back(fMaterial_Male -> Get    
180     pMaterials.push_back(fMaterial_Male -> Get    
181     pMaterials.push_back(fMaterial_Male -> Get    
182     pMaterials.push_back(fMaterial_Male -> Get    
183     pMaterials.push_back(fMaterial_Male -> Get    
184     pMaterials.push_back(fMaterial_Male -> Get    
185     pMaterials.push_back(fMaterial_Male -> Get    
186     pMaterials.push_back(fMaterial_Male -> Get    
187     pMaterials.push_back(fMaterial_Male -> Get    
188     pMaterials.push_back(fMaterial_Male -> Get    
189     pMaterials.push_back(fMaterial_Male -> Get    
190     pMaterials.push_back(fMaterial_Male -> Get    
191     pMaterials.push_back(fMaterial_Male -> Get    
192     pMaterials.push_back(fMaterial_Male -> Get    
193     pMaterials.push_back(fMaterial_Male -> Get    
194     pMaterials.push_back(fMaterial_Male -> Get    
195     pMaterials.push_back(fMaterial_Male -> Get    
196     pMaterials.push_back(fMaterial_Male -> Get    
197     pMaterials.push_back(fMaterial_Male -> Get    
198     pMaterials.push_back(fMaterial_Male -> Get    
199     pMaterials.push_back(fMaterial_Male -> Get    
200     pMaterials.push_back(fMaterial_Male -> Get    
201     pMaterials.push_back(fMaterial_Male -> Get    
202     pMaterials.push_back(fMaterial_Male -> Get    
203     pMaterials.push_back(fMaterial_Male -> Get    
204     pMaterials.push_back(fMaterial_Male -> Get    
205     pMaterials.push_back(fMaterial_Male -> Get    
206     pMaterials.push_back(fMaterial_Male -> Get    
207                                                   
208 }                                                 
209                                                   
210   // World Volume                                 
211   G4double worldSize = 2.*m ;                     
212   G4Box* world = new G4Box("world", worldSize,    
213                                                   
214   auto logicWorld = new G4LogicalVolume(world,    
215                        matAir,                    
216                  "logicalWorld", nullptr, null    
217                                                   
218   fMotherVolume = new G4PVPlacement(nullptr,G4    
219             "physicalWorld",                      
220             logicWorld,                           
221             nullptr,                              
222             false,                                
223             0);                                   
224                                                   
225   logicWorld -> SetVisAttributes(G4VisAttribut    
226                                                   
227   G4cout << "World has been built" << G4endl;     
228                                                   
229   G4cout << "Phantom Sex: " << fSex << G4endl;    
230   G4cout << "Phantom Section: " << fSection <<    
231   ReadPhantomData(fSex, fSection);                
232                                                   
233   G4cout << "Number of X,Y,Z voxels = " << fNV    
234                                                   
235 //----- Define the volume that contains all th    
236   G4Box* fContainer_solid = new G4Box("phantom    
237                                fNVoxelY*fVoxel    
238                                fNVoxelZ*fVoxel    
239                                                   
240   auto fContainer_logic = new G4LogicalVolume(    
241                                                   
242                                                   
243                                                   
244                                                   
245   fMaxX = fNVoxelX*fVoxelHalfDimX*mm; // Max X    
246   fMaxY = fNVoxelY*fVoxelHalfDimY*mm; // Max Y    
247   fMaxZ = fNVoxelZ*fVoxelHalfDimZ*mm; // Max Z    
248                                                   
249   fMinX = -fNVoxelX*fVoxelHalfDimX*mm;// Min X    
250   fMinY = -fNVoxelY*fVoxelHalfDimY*mm;// Min Y    
251   fMinZ = -fNVoxelZ*fVoxelHalfDimZ*mm;// Min Z    
252                                                   
253   G4ThreeVector posCentreVoxels((fMinX+fMaxX)/    
254                                                   
255   G4cout << " placing voxel container volume a    
256                                                   
257                                                   
258   fPhantomContainer                               
259   = new G4PVPlacement(nullptr,                    
260                       posCentreVoxels,            
261                       fContainer_logic,     //    
262                       "phantomContainer",  //     
263                       logicWorld,         // M    
264                       false,            // No     
265                       1);              // Copy    
266                                                   
267   fContainer_logic -> SetVisAttributes(new G4V    
268                                                   
269                                                   
270 // Define the voxelised phantom here              
271 // Replication of air Phantom Volume.             
272                                                   
273 //--- Slice the phantom along Y axis              
274    G4String yRepName("RepY");                     
275    G4VSolid* solYRep = new G4Box(yRepName,fNVo    
276                                   fVoxelHalfDi    
277    auto logYRep = new G4LogicalVolume(solYRep,    
278    new G4PVReplica(yRepName,logYRep,fContainer    
279                                                   
280    logYRep -> SetVisAttributes(new G4VisAttrib    
281                                                   
282 //--- Slice the phantom along X axis              
283    G4String xRepName("RepX");                     
284    G4VSolid* solXRep = new G4Box(xRepName,fVox    
285                                   fNVoxelZ*fVo    
286    auto logXRep = new G4LogicalVolume(solXRep,    
287    new G4PVReplica(xRepName,logXRep,logYRep,kX    
288                                                   
289    logXRep -> SetVisAttributes(new G4VisAttrib    
290                                                   
291    //----- Voxel solid and logical volumes        
292    //--- Slice along Z axis                       
293    G4VSolid* solidVoxel = new G4Box("phantom",    
294    auto logicVoxel = new G4LogicalVolume(solid    
295                                                   
296    logicVoxel -> SetVisAttributes(new G4VisAtt    
297                                                   
298    // Parameterisation to define the material     
299    G4ThreeVector halfVoxelSize(fVoxelHalfDimX,    
300                                                   
301    auto param =  new ICRP110PhantomNestedParam    
302                                                   
303    new G4PVParameterised("phantom",    // thei    
304                           logicVoxel, // their    
305                           logXRep,      // Mot    
306                           kZAxis,       // Are    
307                           fNVoxelZ,      // Nu    
308                           param);       // Par    
309                                                   
310     param -> SetMaterialIndices(fMateIDs); //     
311     param -> SetNoVoxel(fNVoxelX,fNVoxelY,fNVo    
312                                                   
313   return fMotherVolume;                           
314 }                                                 
315                                                   
316 void ICRP110PhantomConstruction::ReadPhantomDa    
317 {                                                 
318                                                   
319   // This method reads the information of ICRP    
320   // ICRPdata/MaleData.data depending on the s    
321                                                   
322 fSex = sex;                                       
323 fSection = section;                               
324                                                   
325 G4String dataFile;                                
326                                                   
327     if (fSex == "female")                         
328     {                                             
329         if (fSection == "head")                   
330         {                                         
331           dataFile = "ICRPdata/FemaleHead.dat"    
332         }                                         
333         else if (fSection == "trunk")             
334         {                                         
335           dataFile = "ICRPdata/FemaleTrunk.dat    
336         }                                         
337         else if (fSection == "full")              
338         {                                         
339           dataFile = "ICRPdata/FemaleData.dat"    
340         }                                         
341     }                                             
342     if (fSex == "male")                           
343     {                                             
344         if (fSection == "head")                   
345         {                                         
346           dataFile = "ICRPdata/MaleHead.dat";     
347         }                                         
348         else if (fSection == "trunk")             
349         {                                         
350           dataFile = "ICRPdata/MaleTrunk.dat";    
351         }                                         
352         else if (fSection == "full")              
353         {                                         
354           dataFile = "ICRPdata/MaleData.dat";     
355         }                                         
356     }                                             
357                                                   
358     G4cout << "Data file " << dataFile << " is    
359                                                   
360 // The data.dat file in directory/build/ICRPda    
361 // to build the phantoms. For more details loo    
362                                                   
363   //input file named finDF which consists of d    
364   std::ifstream finDF(dataFile.c_str());          
365                                                   
366                                                   
367   G4String fname;                                 
368                                                   
369 if(finDF.good() != 1 ) //check that the file i    
370  {                                                
371   G4String descript = "Problem reading data fi    
372   G4Exception(" HumanPhantomConstruction::Read    
373               FatalException,descript);           
374   }                                               
375                                                   
376   finDF >> fNoFiles;                              
377   G4cout << "Number of files = " << fNoFiles <    
378   finDF >> fNVoxelX;      //Inputs number of X    
379   finDF >> fNVoxelY;      //Y-Voxels              
380   fNVoxelZ = fNoFiles;    //Z-Voxels (equal to    
381   finDF >> fVoxelHalfDimX;                        
382   finDF >> fVoxelHalfDimY;                        
383   finDF >> fVoxelHalfDimZ;                        
384   G4cout << "Number of X,Y,Z voxels = " << fNV    
385                                                   
386   fNVoxels = fNVoxelX*fNVoxelY*fNVoxelZ;          
387   G4cout << "Total Number of Voxels = " << fNV    
388                                                   
389   G4int nMaterials;                               
390   finDF >> nMaterials;                            
391   G4String mateName;                              
392   G4int nmate;                                    
393                                                   
394 //-----Read materials and associate with mater    
395                                                   
396   for( G4int ii = 0; ii < nMaterials; ii++ ){     
397     finDF >> nmate;                               
398     finDF >> mateName;                            
399                                                   
400     // This allows to skip empty spaces and ta    
401     if( mateName[0] == '"' && mateName[mateNam    
402     {                                             
403       mateName = mateName.substr(1,mateName.le    
404     }                                             
405                                                   
406     // To uncomment for eventual debugging        
407     /* G4cout << "GmReadPhantomG4Geometry::Rea    
408            << ii << " = " << nmate                
409            << " mate " << mateName << G4endl;*    
410                                                   
411     if( ii != nmate ) {                           
412     G4Exception("GmReadPhantomG4Geometry::Read    
413                 "Wrong argument",                 
414                 FatalErrorInArgument,             
415                 "Material number should be in     
416                 }                                 
417       }                                           
418                                                   
419 fMateIDs = new size_t[fNVoxels]; //Array with     
420                                                   
421 G4cout << "ICRP110PhantomConstruction::ReadPha    
422                                                   
423 for(G4int i = 0; i < fNoFiles; i++ )              
424   {                                               
425     finDF >> fname;                               
426     ReadPhantomDataFile(fSex, fname, i);          
427   }                                               
428                                                   
429 finDF.close();                                    
430 }                                                 
431                                                   
432 //----------------Opens phantom ASCII slice fi    
433                                                   
434 void ICRP110PhantomConstruction::ReadPhantomDa    
435 {                                                 
436 G4cout << fileName << G4endl;                     
437                                                   
438 fSex = sex;                                       
439                                                   
440 G4String slice;                                   
441                                                   
442     if (fSex == "female")                         
443     {                                             
444       slice = "ICRPdata/ICRP110_g4dat/AF/"+fil    
445     }                                             
446     if (fSex == "male")                           
447     {                                             
448       slice = "ICRPdata/ICRP110_g4dat/AM/"+fil    
449     }                                             
450                                                   
451   std::ifstream fin(slice.c_str(), std::ios_ba    
452                                                   
453   if( !fin.is_open() ) {                          
454     G4Exception("HumanPhantomConstruction::Rea    
455                 "",                               
456                 FatalErrorInArgument,             
457                 G4String("File not found " + f    
458   }                                               
459                                                   
460     for( G4int iy = 0; iy < fNVoxelY; iy++ ) {    
461       for( G4int ix = 0; ix < fNVoxelX; ix++ )    
462       if (ix == 0 && iy == 0)                     
463         {                                         
464           G4int dudX,dudY,dudZ;                   
465           fin >> dudX >> dudY >> dudZ ;           
466           // Dummy method to skip the first th    
467           // which are not used here              
468         }                                         
469                                                   
470         G4int nnew = ix + (iy)*fNVoxelX + numb    
471         G4int OrgID;                              
472         fin >> OrgID;                             
473                                                   
474         G4int mateID_out;                         
475                                                   
476 // The code below associates organ ID numbers     
477 // files with material ID numbers (called here    
478 // Material and Organ IDs are associated as st    
479 // the sex of the phantom (male and female, re    
480                                                   
481   if (OrgID==128)                                 
482   {                                               
483   mateID_out=1;                                   
484   }                                               
485                                                   
486   else if (OrgID==13 || OrgID==16 || OrgID==19    
487   {                                               
488   mateID_out=2;                                   
489   }                                               
490                                                   
491   else if (OrgID==14)                             
492   {                                               
493   mateID_out=3;                                   
494   }                                               
495                                                   
496   else if (OrgID==17)                             
497   {                                               
498   mateID_out=4;                                   
499   }                                               
500                                                   
501   else if (OrgID==20)                             
502   {                                               
503   mateID_out=5;                                   
504   }                                               
505                                                   
506   else if (OrgID==23)                             
507   {                                               
508   mateID_out=6;                                   
509   }                                               
510                                                   
511   else if (OrgID==25)                             
512   {                                               
513   mateID_out=7;                                   
514   }                                               
515                                                   
516   else if (OrgID==27)                             
517   {                                               
518   mateID_out=8;                                   
519   }                                               
520                                                   
521   else if (OrgID==29)                             
522   {                                               
523   mateID_out=9;                                   
524   }                                               
525                                                   
526   else if (OrgID==32)                             
527   {                                               
528   mateID_out=10;                                  
529   }                                               
530                                                   
531   else if (OrgID==35)                             
532   {                                               
533   mateID_out=11;                                  
534   }                                               
535                                                   
536   else if (OrgID==38)                             
537   {                                               
538   mateID_out=12;                                  
539   }                                               
540                                                   
541   else if (OrgID==40)                             
542   {                                               
543   mateID_out=13;                                  
544   }                                               
545                                                   
546   else if (OrgID==42)                             
547   {                                               
548   mateID_out=14;                                  
549   }                                               
550                                                   
551   else if (OrgID==44)                             
552   {                                               
553   mateID_out=15;                                  
554   }                                               
555                                                   
556   else if (OrgID==46)                             
557   {                                               
558   mateID_out=16;                                  
559   }                                               
560                                                   
561   else if (OrgID==48)                             
562   {                                               
563   mateID_out=17;                                  
564   }                                               
565                                                   
566   else if (OrgID==50)                             
567   {                                               
568   mateID_out=18;                                  
569   }                                               
570                                                   
571   else if (OrgID==52)                             
572   {                                               
573   mateID_out=19;                                  
574   }                                               
575                                                   
576   else if (OrgID==54)                             
577   {                                               
578   mateID_out=20;                                  
579   }                                               
580                                                   
581   else if (OrgID==56)                             
582   {                                               
583   mateID_out=21;                                  
584   }                                               
585                                                   
586   else if (OrgID==15 || OrgID==30)                
587   {                                               
588   mateID_out=22;                                  
589   }                                               
590                                                   
591   else if (OrgID==18 || OrgID==33)                
592   {                                               
593   mateID_out=23;                                  
594   }                                               
595                                                   
596   else if (OrgID==21)                             
597   {                                               
598   mateID_out=24;                                  
599   }                                               
600                                                   
601   else if (OrgID==36)                             
602   {                                               
603   mateID_out=25;                                  
604   }                                               
605                                                   
606   else if (OrgID==57 || OrgID==58 || OrgID==59    
607   {                                               
608   mateID_out=26;                                  
609   }                                               
610                                                   
611   else if (OrgID==122 || OrgID==123 || OrgID==    
612   {                                               
613   mateID_out=27;                                  
614   }                                               
615                                                   
616   else if (OrgID==9 || OrgID==10 || OrgID==11     
617   {                                               
618   mateID_out=28;                                  
619   }                                               
620                                                   
621   else if (OrgID==5 || OrgID==6 || OrgID==106     
622   {                                               
623   mateID_out=29;                                  
624   }                                               
625                                                   
626   else if (OrgID==95)                             
627   {                                               
628   mateID_out=30;                                  
629   }                                               
630                                                   
631   else if (OrgID==113)                            
632   {                                               
633   mateID_out=31;                                  
634   }                                               
635                                                   
636   else if (OrgID==61)                             
637   {                                               
638   mateID_out=32;                                  
639   }                                               
640                                                   
641   else if (OrgID==87)                             
642   {                                               
643   mateID_out=33;                                  
644   }                                               
645                                                   
646   else if (OrgID==66 || OrgID==67 || OrgID==68    
647   {                                               
648   mateID_out=34;                                  
649   }                                               
650                                                   
651   else if (OrgID==89 || OrgID==90 || OrgID==91    
652   {                                               
653   mateID_out=35;                                  
654   }                                               
655                                                   
656   else if (OrgID==72)                             
657   {                                               
658   mateID_out=36;                                  
659   }                                               
660                                                   
661   else if (OrgID==74)                             
662   {                                               
663   mateID_out=37;                                  
664   }                                               
665                                                   
666   else if (OrgID==76 || OrgID==78 || OrgID==80    
667   {                                               
668   mateID_out=38;                                  
669   }                                               
670                                                   
671   else if (OrgID==127)                            
672   {                                               
673   mateID_out=39;                                  
674   }                                               
675                                                   
676   else if (OrgID==132)                            
677   {                                               
678   mateID_out=40;                                  
679   }                                               
680                                                   
681   else if (OrgID==137)                            
682   {                                               
683   mateID_out=41;                                  
684   }                                               
685                                                   
686   else if (OrgID==111 || OrgID==112 || OrgID==    
687   {                                               
688   mateID_out=42;                                  
689   }                                               
690                                                   
691   else if (OrgID==1 || OrgID==2)                  
692   {                                               
693   mateID_out=43;                                  
694   }                                               
695                                                   
696   else if (OrgID==110)                            
697   {                                               
698   mateID_out=44;                                  
699   }                                               
700                                                   
701   else if (OrgID==3 || OrgID==4 || OrgID==7 ||    
702   {                                               
703   mateID_out=45;                                  
704   }                                               
705                                                   
706   else if (OrgID==115 || OrgID==139)              
707   {                                               
708   mateID_out=46;                                  
709   }                                               
710                                                   
711   else if (OrgID==100 || OrgID==101 || OrgID==    
712   {                                               
713   mateID_out=47;                                  
714   }                                               
715                                                   
716   else if (OrgID==63 || OrgID==65)                
717   {                                               
718   mateID_out=48;                                  
719   }                                               
720                                                   
721   else if (OrgID==62 || OrgID==64 || OrgID==11    
722   {                                               
723   mateID_out=49;                                  
724   }                                               
725                                                   
726   else if (OrgID==97 || OrgID==99)                
727   {                                               
728   mateID_out=50;                                  
729   }                                               
730                                                   
731   else if (OrgID==73 || OrgID==75 || OrgID==77    
732   {                                               
733   mateID_out=51;                                  
734   }                                               
735                                                   
736   else if (OrgID==138)                            
737   {                                               
738   mateID_out=52;                                  
739   }                                               
740                                                   
741   else if (OrgID==0 || OrgID==140)                
742   {                                               
743   mateID_out=0;                                   
744   }                                               
745                                                   
746   else                                            
747   {                                               
748   mateID_out=OrgID;                               
749   }                                               
750                                                   
751         G4int nMaterials = 53;                    
752         if( mateID_out < 0 || mateID_out >= nM    
753           G4Exception("GmReadPhantomG4Geometry    
754                       "Wrong index in phantom     
755                       FatalException,             
756                       G4String("It should be b    
757                               + G4UIcommand::C    
758                               + ", while it is    
759                               + G4UIcommand::C    
760                                                   
761 //-------------Store Material IDs and position    
762    }                                              
763                                                   
764           fMateIDs[nnew] = mateID_out;            
765                                                   
766                                                   
767       }                                           
768    }                                              
769 }                                                 
770                                                   
771 //-----------Define phantom sex (male or femal    
772 void ICRP110PhantomConstruction::SetPhantomSex    
773 {                                                 
774   fSex = newSex;                                  
775                                                   
776   if (fSex == "male")                             
777     {                                             
778       G4cout << ">> Male Phantom will be built    
779     }                                             
780   if (fSex == "female")                           
781     {                                             
782       G4cout << ">> Female Phantom will be bui    
783     }                                             
784   if ((fSex != "female") && (fSex != "male"))     
785     G4cout << fSex << " is not defined!" << G4    
786 }                                                 
787                                                   
788 //-----------Define phantom section to be cons    
789 void ICRP110PhantomConstruction::SetPhantomSec    
790 {                                                 
791   fSection = newSection;                          
792   if (fSection == "head")                         
793     {                                             
794       G4cout << ">> Partial Head Phantom will     
795     }                                             
796   if (fSection == "trunk")                        
797     {                                             
798       G4cout << ">> Partial Trunk Phantom will    
799     }                                             
800   if (fSection == "full")                         
801     {                                             
802       G4cout << ">> Full/Custom Phantom will b    
803     }                                             
804   if ((fSection != "head") && (fSection != "tr    
805     G4cout << fSection << " is not defined!" <    
806                                                   
807 }                                                 
808