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] [ 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/human_phantom/src/G4HumanPhantomConstruction.cc (Version 11.3.0) and /examples/advanced/human_phantom/src/G4HumanPhantomConstruction.cc (Version 3.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 // Previous authors: G. Guerrieri, S. Guatelli    
 27 // Authors (since 2007): S. Guatelli, Universi    
 28 //                                                
 29                                                   
 30 #include <map>                                    
 31                                                   
 32 #include "globals.hh"                             
 33                                                   
 34 #include "G4HumanPhantomConstruction.hh"          
 35                                                   
 36 #include "G4SystemOfUnits.hh"                     
 37 #include "G4HumanPhantomSD.hh"                    
 38 #include "G4SDManager.hh"                         
 39                                                   
 40 //#include "G4VBodyFactory.hh"                    
 41 //#include "G4MIRDBodyFactory.hh"                 
 42 //#include "G4ORNLBodyFactory.hh"                 
 43                                                   
 44 #include "G4PhantomBuilder.hh"                    
 45 #include "G4FemaleBuilder.hh"                     
 46 #include "G4MaleBuilder.hh"                       
 47 #include "G4PhantomHeadBuilder.hh"                
 48 #include "G4RunManager.hh"                        
 49 #include "G4HumanPhantomMaterial.hh"              
 50 #include "G4Box.hh"                               
 51 #include "G4LogicalVolume.hh"                     
 52 #include "G4VPhysicalVolume.hh"                   
 53 #include "G4VisAttributes.hh"                     
 54 #include "G4Colour.hh"                            
 55 #include "G4PVPlacement.hh"                       
 56                                                   
 57 G4HumanPhantomConstruction::G4HumanPhantomCons    
 58 {                                                 
 59   fMessenger = new G4HumanPhantomMessenger(thi    
 60   fMaterial = new G4HumanPhantomMaterial();       
 61 }                                                 
 62                                                   
 63 G4HumanPhantomConstruction::~G4HumanPhantomCon    
 64 {                                                 
 65   delete fMaterial;                               
 66   delete fMessenger;                              
 67 }                                                 
 68                                                   
 69 G4VPhysicalVolume* G4HumanPhantomConstruction:    
 70 {                                                 
 71   fMaterial -> DefineMaterials();                 
 72                                                   
 73   G4BasePhantomBuilder*  builder = nullptr;       
 74                                                   
 75   if (fModel == "MIRDHead" || fModel == "ORNLH    
 76     {                                             
 77       G4cout << "HeadBuilder instantiated" <<     
 78       builder = new G4PhantomHeadBuilder;         
 79       if (fModel ==  "MIRDHead") builder->SetM    
 80       else if (fModel ==  "ORNLHead") builder-    
 81     }                                             
 82   else                                            
 83     {                                             
 84       if (fSex =="Female")                        
 85   {                                               
 86     builder = new G4FemaleBuilder;                
 87     builder->SetModel(fModel);                    
 88     G4cout << fModel << " "<< fSex << G4endl;     
 89   }                                               
 90       else if (fSex == "Male")                    
 91   {                                               
 92     builder = new G4MaleBuilder;                  
 93     builder->SetModel(fModel);                    
 94   }                                               
 95     }                                             
 96                                                   
 97   builder->SetMotherVolume(ConstructWorld());     
 98                                                   
 99   // the argument indicates the sensitivity of    
100                                                   
101   builder->BuildHead("black", false, fSensitiv    
102   builder->BuildSkull("orange", false, fSensit    
103   builder->BuildBrain("yellow", true, fSensiti    
104                                                   
105   if (fModel != "MIRDHead" && fModel != "ORNLH    
106     {                                             
107       //  builder->SetModel(model);               
108       builder->BuildTrunk("yellow", false, fSe    
109                                                   
110       builder->BuildLeftLeg("yellow", false, f    
111       builder->BuildRightLeg("yellow", false,     
112                                                   
113       builder->BuildLeftArmBone("grey", true,     
114       builder->BuildRightArmBone("grey", true,    
115                                                   
116       builder->BuildLeftLegBone("grey", true,     
117       builder ->BuildRightLegBone("grey", true    
118                                                   
119       builder->BuildUpperSpine("yellow", true,    
120                                                   
121       if (fModel == "MIRD")                       
122   {                                               
123     builder->BuildLeftScapula("grey", true, fS    
124     builder->BuildRightScapula("grey", true, f    
125     builder->BuildLeftAdrenal("yellow", true,     
126     builder->BuildRightAdrenal("yellow", true,    
127     builder->BuildThymus("orange", true, fSens    
128     builder->BuildLeftClavicle("grey", true, f    
129     builder->BuildRightClavicle("grey", true,     
130     builder->BuildSmallIntestine("orange", tru    
131     builder->BuildRibCage("grey", true, fSensi    
132   }                                               
133                                                   
134       builder->BuildMiddleLowerSpine("yellow",    
135                                                   
136       builder->BuildPelvis("grey", true, fSens    
137                                                   
138       builder->BuildStomach("orange", true, fS    
139       builder->BuildUpperLargeIntestine("light    
140       builder->BuildLowerLargeIntestine("light    
141       builder->BuildSpleen("green", true, fSen    
142       builder->BuildPancreas("purple", true, f    
143       //builder->BuildLiver("orange", true,sen    
144                                                   
145       builder->BuildLeftKidney("green", true,     
146       builder->BuildRightKidney("green", true,    
147       builder->BuildUrinaryBladder("green", tr    
148                                                   
149       //builder->BuildHeart("red", true,fSensi    
150      // builder->BuildLeftLung("blue", true, f    
151       //builder->BuildRightLung("blue", true,     
152      // builder->BuildThyroid("orange", true,     
153                                                   
154       if(fSex=="Female"){                         
155                                                   
156   builder->BuildLeftOvary("purple", true, fSen    
157   builder->BuildRightOvary("purple", true, fSe    
158   builder->BuildUterus("purple", true, fSensit    
159                                                   
160   if (fModel == "ORNLFemale" || fModel == "MIR    
161     {                                             
162       builder->BuildLeftBreast("purple", true,    
163       builder->BuildRightBreast("purple", true    
164     }                                             
165       }                                           
166                                                   
167       if(fSex=="Male"){                           
168                                                   
169   if (fModel == "MIRD"){                          
170     builder -> BuildMaleGenitalia("yellow",fal    
171     builder -> BuildLeftTeste("purple",true, f    
172     builder -> BuildRightTeste("purple",true,     
173   }                                               
174   else G4cout <<  "ORNL does not have model fo    
175       }                                           
176                                                   
177     }                                             
178   G4VPhysicalVolume* result=builder->GetPhanto    
179   delete builder;                                 
180   return result;                                  
181 }                                                 
182                                                   
183 void  G4HumanPhantomConstruction::SetBodyPartS    
184 {                                                 
185   G4cout << "This method is not currently work    
186 }                                                 
187                                                   
188 G4VPhysicalVolume* G4HumanPhantomConstruction:    
189 {                                                 
190   G4Material* air = fMaterial -> GetMaterial("    
191                                                   
192   // World Volume                                 
193   // G4double worldSize = 1.*m ;                  
194   G4double worldSize = 1.5 *m ;                   
195   G4Box* world = new G4Box("world", worldSize,    
196                                                   
197   auto* logicWorld = new G4LogicalVolume(world    
198                   air,                            
199                   "logicalWorld", nullptr, nul    
200                                                   
201   G4VPhysicalVolume* motherVolume = new G4PVPl    
202                   "physicalWorld",                
203                   logicWorld,                     
204                   nullptr,                        
205                   false,                          
206                   0);                             
207                                                   
208   // Visualization Attributes                     
209   auto* WorldVisAtt = new G4VisAttributes(G4Co    
210                                                   
211   WorldVisAtt->SetForceSolid(false);              
212   logicWorld->SetVisAttributes(G4VisAttributes    
213                                                   
214   return motherVolume;                            
215 }                                                 
216                                                   
217 void G4HumanPhantomConstruction::SetPhantomSex    
218 {                                                 
219   fSex=newSex;                                    
220                                                   
221   if (fSex == "Male")                             
222     {                                             
223       G4cout << ">> Male Phantom will be built    
224     }                                             
225   if (fSex == "Female")                           
226     {                                             
227       G4cout << ">> Female Phantom will be bui    
228     }                                             
229   if ((fSex != "Female") && (fSex != "Male"))     
230     G4cout << fSex << " can not be defined!" <    
231 }                                                 
232                                                   
233 void G4HumanPhantomConstruction::SetPhantomMod    
234 {                                                 
235   fModel = newModel;                              
236                                                   
237   if (fModel == "MIRD")                           
238     {                                             
239       G4cout<<" >> Phantom " << fModel << " wi    
240     }                                             
241   if (fModel == "ORNLFemale")                     
242     {                                             
243       G4cout<<" >> Phantom " << fModel << " wi    
244     }                                             
245                                                   
246   if (fModel == "ORNLMale")                       
247     {                                             
248       G4cout<<" >> Phantom " << fModel << " wi    
249     }                                             
250                                                   
251   if (fModel == "MIRDHead")                       
252     {                                             
253       G4cout<<" >> Phantom " << fModel << " wi    
254     }                                             
255                                                   
256   if (fModel == "ORNLHead")                       
257     {                                             
258       G4cout<<" >> Phantom " << fModel << " wi    
259     }                                             
260 }                                                 
261                                                   
262 void G4HumanPhantomConstruction::ConstructSDan    
263 {                                                 
264    auto* SD = new G4HumanPhantomSD("SD", "Huma    
265    G4SDManager::GetSDMpointer()->AddNewDetecto    
266                                                   
267 if (fModel != "ORNLMale" && fModel != "ORNLFem    
268 {                                                 
269   SetSensitiveDetector("logicalHead",SD);         
270   SetSensitiveDetector("logicalSkull",SD);        
271   SetSensitiveDetector("logicalBrain",SD);        
272   if (fModel != "MIRDHead")                       
273     {                                             
274       SetSensitiveDetector("logicalTrunk",SD);    
275       SetSensitiveDetector("logicalLeftLeg",SD    
276       SetSensitiveDetector("logicalRightLeg",S    
277       SetSensitiveDetector("logicalLeftArmBone    
278       SetSensitiveDetector("logicalRightArmBon    
279       SetSensitiveDetector("logicalLeftLegBone    
280       SetSensitiveDetector("logicalRightLegBon    
281       SetSensitiveDetector("logicalUpperSpine"    
282       SetSensitiveDetector("logicalLeftScapula    
283       SetSensitiveDetector("logicalRightScapul    
284       SetSensitiveDetector("logicalLeftAdrenal    
285       SetSensitiveDetector("logicalRightAdrena    
286       SetSensitiveDetector("logicalThymus",SD)    
287       SetSensitiveDetector("logicalLeftClavicl    
288       SetSensitiveDetector("logicalRightClavic    
289       SetSensitiveDetector("logicalSmallIntest    
290       SetSensitiveDetector("logicalRibCage",SD    
291       SetSensitiveDetector("logicalMiddleLower    
292       SetSensitiveDetector("logicalStomach",SD    
293       SetSensitiveDetector("logicalUpperLargeI    
294       SetSensitiveDetector("logicalLowerLargeI    
295       SetSensitiveDetector("logicalSpleen",SD)    
296       SetSensitiveDetector("logicalPancreas",S    
297       SetSensitiveDetector("logicalLeftKidney"    
298       SetSensitiveDetector("logicalRightKidney    
299       SetSensitiveDetector("logicalUrinaryBlad    
300                                                   
301       if(fSex=="Female"){                         
302   SetSensitiveDetector("logicalLeftOvary",SD);    
303         SetSensitiveDetector("logicalRightOvar    
304         SetSensitiveDetector("logicalUterus",S    
305         SetSensitiveDetector("logicalLeftBreas    
306         SetSensitiveDetector("logicalRightBrea    
307   }                                               
308       else if(fSex=="Male"){                      
309     SetSensitiveDetector("logicalMaleGenitalia    
310           SetSensitiveDetector("logicalLeftTes    
311     SetSensitiveDetector("logicalRightTeste",S    
312   }                                               
313       }                                           
314   }else                                           
315  {                                                
316   SetSensitiveDetector("HeadVolume",SD);          
317   SetSensitiveDetector("SkullVolume",SD);         
318   SetSensitiveDetector("BrainVolume",SD);         
319   G4cout <<"ORNL model!!!! Head is sensitive o    
320 }                                                 
321 }                                                 
322