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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/G4PhantomBuilder.cc (Version 11.3.0) and /examples/advanced/human_phantom/src/G4PhantomBuilder.cc (Version 5.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 "G4PhantomBuilder.hh"                    
 31 #include "G4VBodyFactory.hh"                      
 32 #include "G4MIRDBodyFactory.hh"                   
 33 #include "G4ORNLFemaleBodyFactory.hh"             
 34 #include "G4ORNLMaleBodyFactory.hh"               
 35 #include "G4RunManager.hh"                        
 36 #include "G4Element.hh"                           
 37 #include "G4Material.hh"                          
 38 #include "G4Box.hh"                               
 39 #include "G4LogicalVolume.hh"                     
 40 #include "G4PVPlacement.hh"                       
 41 #include "G4Colour.hh"                            
 42 #include "G4VisAttributes.hh"                     
 43                                                   
 44 G4PhantomBuilder::G4PhantomBuilder(): fModel("    
 45 {                                                 
 46   // sex can be "female" or "male"                
 47   fBody = nullptr;                                
 48   fMotherVolume = nullptr;                        
 49   fHeadVolume = nullptr;                          
 50   fTrunkVolume = nullptr;                         
 51   fLeftLegVolume =nullptr;                        
 52   fRightLegVolume = nullptr;                      
 53   fMaleGenitaliaVolume = nullptr;                 
 54 }                                                 
 55                                                   
 56 void G4PhantomBuilder::BuildTrunk(const G4Stri    
 57 {                                                 
 58   if (fMotherVolume == nullptr)                   
 59     G4Exception("G4PhantomBuilder::BuildTrunk(    
 60                                                   
 61   G4cout <<"MotherVolume: " <<  fMotherVolume     
 62   G4cout << "sensitivity : "<< sensitivity <<     
 63   fTrunkVolume = fBody -> CreateOrgan("Trunk",    
 64 }                                                 
 65                                                   
 66 void G4PhantomBuilder::BuildLeftLeg(const G4St    
 67 {                                                 
 68   if (fMotherVolume == nullptr)                   
 69     G4Exception("G4PhantomBuilder::BuildLeftLe    
 70                                                   
 71   G4cout <<"MotherVolume: " <<  fMotherVolume     
 72   G4cout << "sensitivity : "<< sensitivity <<     
 73   fLeftLegVolume = fBody -> CreateOrgan("LeftL    
 74 }                                                 
 75 void G4PhantomBuilder::BuildRightLeg(const G4S    
 76 {                                                 
 77   if (fMotherVolume == nullptr)                   
 78     G4Exception("G4PhantomBuilder::BuildRightL    
 79                                                   
 80   G4cout <<"MotherVolume: " <<  fMotherVolume     
 81   G4cout << "sensitivity : "<< sensitivity <<     
 82   fRightLegVolume = fBody -> CreateOrgan("Righ    
 83 }                                                 
 84                                                   
 85 void G4PhantomBuilder::BuildLeftLegBone(const     
 86 {                                                 
 87   if (fLeftLegVolume == nullptr)                  
 88     G4Exception("G4PhantomBuilder::BuildLeftLe    
 89                                                   
 90   G4cout <<"MotherVolume: " <<  fLeftLegVolume    
 91   G4cout << "sensitivity : "<< sensitivity <<     
 92   fBody -> CreateOrgan("LeftLegBone", fLeftLeg    
 93 }                                                 
 94                                                   
 95 void G4PhantomBuilder::BuildRightLegBone(const    
 96 {                                                 
 97   if (fTrunkVolume == nullptr)                    
 98     G4Exception("G4PhantomBuilder::BuildRightL    
 99                                                   
100   G4cout <<"MotherVolume: " << fRightLegVolume    
101   G4cout << "sensitivity : "<< sensitivity <<     
102   fBody -> CreateOrgan("RightLegBone", fRightL    
103 }                                                 
104                                                   
105 void G4PhantomBuilder::BuildLeftArmBone(const     
106 {                                                 
107   if (fTrunkVolume == nullptr)                    
108     G4Exception("G4PhantomBuilder::BuildLeftAr    
109                                                   
110   G4cout <<"MotherVolume: " << fTrunkVolume ->    
111   G4cout << "sensitivity : "<< sensitivity <<     
112   fBody -> CreateOrgan("LeftArmBone", fTrunkVo    
113 }                                                 
114 void G4PhantomBuilder::BuildRightArmBone(const    
115 {                                                 
116   if (fTrunkVolume == nullptr)                    
117     G4Exception("G4PhantomBuilder::BuildRightA    
118                                                   
119   G4cout <<"MotherVolume: " << fTrunkVolume ->    
120   G4cout << "sensitivity : "<< sensitivity <<     
121   fBody -> CreateOrgan("RightArmBone", fTrunkV    
122 }                                                 
123                                                   
124 void G4PhantomBuilder::BuildLeftScapula(const     
125 {                                                 
126   if (fTrunkVolume == nullptr)                    
127     G4Exception("G4PhantomBuilder::BuildLeftSc    
128                                                   
129   G4cout <<"MotherVolume: " << fTrunkVolume ->    
130   G4cout << "sensitivity : "<< sensitivity <<     
131   fBody -> CreateOrgan("LeftScapula",fTrunkVol    
132 }                                                 
133                                                   
134 void G4PhantomBuilder::BuildRightScapula(const    
135 {                                                 
136   if (fTrunkVolume == nullptr)                    
137     G4Exception("G4PhantomBuilder::BuildRightS    
138                                                   
139   G4cout <<"MotherVolume: " <<  fTrunkVolume -    
140   G4cout << "sensitivity : "<< sensitivity <<     
141   fBody -> CreateOrgan("RightScapula",fTrunkVo    
142 }                                                 
143                                                   
144 void G4PhantomBuilder::BuildLeftClavicle(const    
145 {                                                 
146   if (fTrunkVolume == nullptr)                    
147     G4Exception("G4PhantomBuilder::BuildLeftCl    
148                                                   
149   G4cout <<"MotherVolume: " <<  fTrunkVolume -    
150   G4cout << "sensitivity : "<< sensitivity <<     
151   fBody -> CreateOrgan("LeftClavicle", fTrunkV    
152 }                                                 
153                                                   
154 void G4PhantomBuilder::BuildRightClavicle(cons    
155 {                                                 
156   if (fTrunkVolume == nullptr)                    
157     G4Exception("G4PhantomBuilder::BuildRightC    
158                                                   
159   G4cout <<"MotherVolume: " << fTrunkVolume ->    
160   G4cout << "sensitivity : "<< sensitivity <<     
161   fBody -> CreateOrgan("RightClavicle",fTrunkV    
162 }                                                 
163                                                   
164 void G4PhantomBuilder::BuildHead(const G4Strin    
165 {                                                 
166   if (fMotherVolume == nullptr)                   
167     G4Exception("G4PhantomBuilder::BuildHead()    
168                                                   
169   G4cout <<"MotherVolume: " <<  fMotherVolume     
170   G4cout << "sensitivity : "<< sensitivity <<     
171   fHeadVolume = fBody -> CreateOrgan("Head", f    
172 }                                                 
173                                                   
174 void G4PhantomBuilder::BuildSkull(const G4Stri    
175 {                                                 
176   if (fHeadVolume == nullptr)                     
177     G4Exception("G4PhantomBuilder::BuildSkull(    
178                                                   
179   G4cout <<"MotherVolume: " << fHeadVolume ->     
180   G4cout << "sensitivity : "<< sensitivity <<     
181   fBody -> CreateOrgan( "Skull", fHeadVolume,     
182 }                                                 
183                                                   
184 void G4PhantomBuilder::BuildUpperSpine(const G    
185 {                                                 
186   if (fHeadVolume == nullptr)                     
187     G4Exception("G4PhantomBuilder::BuildUpperS    
188                                                   
189   G4cout <<"MotherVolume: " << fHeadVolume ->     
190   G4cout << "sensitivity : "<< sensitivity <<     
191   fBody -> CreateOrgan("UpperSpine", fHeadVolu    
192 }                                                 
193                                                   
194 void G4PhantomBuilder::BuildMiddleLowerSpine(c    
195 {                                                 
196   if (fTrunkVolume == nullptr)                    
197     G4Exception("G4PhantomBuilder::BuildMiddle    
198                                                   
199   G4cout <<"MotherVolume: " << fTrunkVolume ->    
200   G4cout << "sensitivity : "<< sensitivity <<     
201   fBody -> CreateOrgan("MiddleLowerSpine",fTru    
202 }                                                 
203                                                   
204 void G4PhantomBuilder::BuildPelvis(const G4Str    
205 {                                                 
206   if (fTrunkVolume == nullptr)                    
207     G4Exception("G4PhantomBuilder::BuildPelvis    
208                                                   
209   fBody -> CreateOrgan( "Pelvis", fTrunkVolume    
210 }                                                 
211                                                   
212 void G4PhantomBuilder::BuildBrain(const G4Stri    
213 {                                                 
214   if (fHeadVolume == nullptr)                     
215     G4Exception("G4PhantomBuilder::BuildBrain(    
216                                                   
217   fBody -> CreateOrgan("Brain", fHeadVolume, c    
218 }                                                 
219                                                   
220 void G4PhantomBuilder::BuildHeart(const G4Stri    
221 {                                                 
222   if (fTrunkVolume == nullptr)                    
223     G4Exception("G4PhantomBuilder::BuildHeart(    
224   fBody -> CreateOrgan("Heart", fTrunkVolume,c    
225 }                                                 
226                                                   
227 void G4PhantomBuilder::BuildLeftLung(const G4S    
228 {                                                 
229   if (fTrunkVolume == nullptr)                    
230     G4Exception("G4PhantomBuilder::BuildLeftLu    
231                                                   
232   fBody -> CreateOrgan("LeftLung", fTrunkVolum    
233 }                                                 
234                                                   
235 void G4PhantomBuilder::BuildRightLung(const G4    
236 {                                                 
237   if (fTrunkVolume == nullptr)                    
238     G4Exception("G4PhantomBuilder::BuildRightL    
239                                                   
240   fBody -> CreateOrgan("RightLung", fTrunkVolu    
241 }                                                 
242                                                   
243 void G4PhantomBuilder::BuildStomach(const G4St    
244 {                                                 
245   if (fTrunkVolume == nullptr)                    
246     G4Exception("G4PhantomBuilder::BuildStomac    
247                                                   
248   fBody -> CreateOrgan("Stomach", fTrunkVolume    
249 }                                                 
250                                                   
251 void G4PhantomBuilder::BuildRibCage(const G4St    
252 {                                                 
253   if (fTrunkVolume == nullptr)                    
254     G4Exception("G4PhantomBuilder::BuildRibCag    
255                                                   
256   fBody -> CreateOrgan("RibCage", fTrunkVolume    
257 }                                                 
258                                                   
259 void G4PhantomBuilder::BuildSpleen(const G4Str    
260 {                                                 
261   if (fTrunkVolume == nullptr)                    
262     G4Exception("G4PhantomBuilder::BuildSpleen    
263                                                   
264   fBody -> CreateOrgan("Spleen", fTrunkVolume,    
265 }                                                 
266                                                   
267 void G4PhantomBuilder::BuildUpperLargeIntestin    
268 {                                                 
269   if (fTrunkVolume == nullptr)                    
270     G4Exception("G4PhantomBuilder::BuildUpperL    
271                                                   
272   fBody -> CreateOrgan("UpperLargeIntestine",     
273 }                                                 
274                                                   
275 void G4PhantomBuilder::BuildLowerLargeIntestin    
276 {                                                 
277   if (fTrunkVolume == nullptr)                    
278     G4Exception("G4PhantomBuilder::BuildLowerL    
279                                                   
280   fBody -> CreateOrgan("LowerLargeIntestine",     
281 }                                                 
282                                                   
283 void G4PhantomBuilder::BuildSmallIntestine(con    
284 {                                                 
285   if (fTrunkVolume == nullptr)                    
286     G4Exception("G4PhantomBuilder::BuildSamllI    
287                                                   
288   fBody -> CreateOrgan("SmallIntestine", fTrun    
289 }                                                 
290                                                   
291 void G4PhantomBuilder::BuildLeftKidney(const G    
292 {                                                 
293   if (fTrunkVolume == nullptr)                    
294     G4Exception("G4PhantomBuilder::BuildLeftKi    
295                                                   
296   fBody -> CreateOrgan("LeftKidney", fTrunkVol    
297 }                                                 
298 void G4PhantomBuilder::BuildRightKidney(const     
299 {                                                 
300   if (fTrunkVolume == nullptr)                    
301     G4Exception("G4PhantomBuilder::BuildRightK    
302                                                   
303   fBody -> CreateOrgan("RightKidney", fTrunkVo    
304 }                                                 
305                                                   
306 void G4PhantomBuilder::BuildLeftAdrenal(const     
307 {                                                 
308   if (fTrunkVolume == nullptr)                    
309     G4Exception("G4PhantomBuilder::BuildLeftAd    
310                                                   
311   fBody -> CreateOrgan("LeftAdrenal", fTrunkVo    
312 }                                                 
313                                                   
314 void G4PhantomBuilder::BuildRightAdrenal(const    
315 {                                                 
316   if (fTrunkVolume == nullptr)                    
317     G4Exception("G4PhantomBuilder::BuildRightA    
318                                                   
319   fBody -> CreateOrgan("RightAdrenal", fTrunkV    
320 }                                                 
321                                                   
322 void G4PhantomBuilder::BuildLiver(const G4Stri    
323 {                                                 
324   if (fTrunkVolume == nullptr)                    
325     G4Exception("G4PhantomBuilder::BuildLiver(    
326                                                   
327   fBody -> CreateOrgan("Liver", fTrunkVolume,c    
328 }                                                 
329 void G4PhantomBuilder::BuildPancreas(const G4S    
330 {                                                 
331   if (fTrunkVolume == nullptr)                    
332     G4Exception("G4PhantomBuilder::BuildPancre    
333                                                   
334   fBody -> CreateOrgan("Pancreas", fTrunkVolum    
335 }                                                 
336                                                   
337 void G4PhantomBuilder::BuildUrinaryBladder(con    
338 {                                                 
339   if (fTrunkVolume == nullptr)                    
340     G4Exception("G4PhantomBuilder::BuildUrinar    
341                                                   
342   fBody -> CreateOrgan("UrinaryBladder", fTrun    
343 }                                                 
344                                                   
345 void G4PhantomBuilder::BuildThyroid(const G4St    
346 {                                                 
347   if (fHeadVolume == nullptr)                     
348     G4Exception("G4PhantomBuilder::BuildThyroi    
349                                                   
350   fBody -> CreateOrgan("Thyroid", fHeadVolume,    
351 }                                                 
352                                                   
353 void G4PhantomBuilder::BuildThymus(const G4Str    
354 {                                                 
355   if (fTrunkVolume == nullptr)                    
356     G4Exception("G4PhantomBuilder::BuildThymus    
357                                                   
358   fBody -> CreateOrgan("Thymus",fTrunkVolume,     
359 }                                                 
360                                                   
361 G4VPhysicalVolume* G4PhantomBuilder::GetPhanto    
362 {                                                 
363   return fMotherVolume;                           
364 }                                                 
365                                                   
366 void G4PhantomBuilder::SetMotherVolume(G4VPhys    
367 {                                                 
368   fMotherVolume = mother;                         
369 }                                                 
370                                                   
371 void G4PhantomBuilder::SetModel(G4String model    
372 {                                                 
373   fModel = modelFlag;                             
374                                                   
375   if(fModel=="MIRD") fBody = new G4MIRDBodyFac    
376   else if(fModel=="ORNLFemale")                   
377   {                                               
378 #ifdef G4LIB_USE_GDML                             
379     fBody = new G4ORNLFemaleBodyFactory();        
380 #else                                             
381     G4cout << fModel << " Working with GDML on    
382 #endif                                            
383   }                                               
384   else if(fModel=="ORNLMale")                     
385   {                                               
386 #ifdef G4LIB_USE_GDML                             
387     fBody = new G4ORNLMaleBodyFactory();          
388 #else                                             
389     G4cout << fModel << " Working with GDML on    
390 #endif                                            
391   }                                               
392 }                                                 
393