Geant4 Cross Reference |
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