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 10.7.p1)


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