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 // This is the first version of Flash, a Geant 27 // 28 // 29 ////////////////////////////////////////////// 30 31 #include "FlashApplicator.hh" 32 #include "FlashDetectorConstruction.hh" 33 #include "G4Box.hh" 34 #include "G4Colour.hh" 35 #include "G4Cons.hh" 36 #include "G4LogicalVolume.hh" 37 #include "G4NistElementBuilder.hh" 38 #include "G4NistManager.hh" 39 #include "G4PVPlacement.hh" 40 #include "G4RotationMatrix.hh" 41 #include "G4RunManager.hh" 42 #include "G4SubtractionSolid.hh" 43 #include "G4SystemOfUnits.hh" 44 #include "G4Tubs.hh" 45 #include "G4VisAttributes.hh" 46 #include "globals.hh" 47 48 FlashApplicator::FlashApplicator(G4VPhysicalVo 49 : fMotherPhys(physicalTreatmentRoom), 50 51 52 solidFTFlash(0), physiFTFlash(0) { 53 ConstructCollimator(fMotherPhys); 54 55 56 57 } 58 59 FlashApplicator::~FlashApplicator() {} 60 61 void FlashApplicator::ConstructCollimator(G4VP 62 // Sets default geometry and materials 63 SetDefaultDimensions(); 64 SetOuterRadius(55*mm); 65 SetApplicatorLength(365*mm); 66 // Construct the whole Applicator Beam Line 67 ConstructApplicator(); 68 } 69 70 void FlashApplicator::SetDefaultDimensions() { 71 72 white = new G4VisAttributes(G4Colour()); 73 white->SetVisibility(true); 74 75 blue = new G4VisAttributes(G4Colour(0., 0., 76 blue->SetVisibility(true); 77 78 gray = new G4VisAttributes(G4Colour(0.5, 0.5 79 gray->SetVisibility(true); 80 81 red = new G4VisAttributes(G4Colour(1., 0., 0 82 red->SetVisibility(true); 83 84 yellow = new G4VisAttributes(G4Colour(1., 1. 85 yellow->SetVisibility(true); 86 87 green = new G4VisAttributes(G4Colour(25 / 25 88 green->SetVisibility(true); 89 90 darkGreen = new G4VisAttributes(G4Colour(0 / 91 darkGreen->SetVisibility(true); 92 93 darkOrange3 = 94 new G4VisAttributes(G4Colour(205 / 255., 95 darkOrange3->SetVisibility(true); 96 97 skyBlue = new G4VisAttributes(G4Colour(135 / 98 skyBlue->SetVisibility(true); 99 100 magenta = new G4VisAttributes(G4Colour(255 / 101 magenta->SetVisibility(true); 102 103 104 fInitial_pos = -113*cm; //set the same posit 105 // Geometry APPLICATOR DEFAULTS 106 107 108 109 G4double defaultinnerRadiusFirstApplicatorFl 110 fOuterRadiusFirstApplicatorFlash - 5. * 111 fInnerRadiusFirstApplicatorFlash = defaulti 112 113 // DEFAULT DEFINITION OF THE MATERIALS 114 115 // ELEMENTS 116 G4double density; 117 G4int ncomponents; 118 G4bool isotopes = false; 119 aluminumNist = 120 G4NistManager::Instance()->FindOrBuildMa 121 122 123 Fe = G4NistManager::Instance()->FindOrBuildM 124 125 PVDF = new G4Material("PVDF", density=1780 126 127 128 129 PVDF->AddElement(G4NistManager::Instance()-> 130 PVDF->AddElement(G4NistManager::Instance()-> 131 PVDF->AddElement(G4NistManager::Instance()-> 132 133 134 135 FILM= new G4Material("FILM", density=1430 *k 136 137 FILM->AddElement(G4NistManager::Instance()-> 138 FILM->AddElement(G4NistManager::Instance()-> 139 FILM->AddElement(G4NistManager::Instance()-> 140 FILM->AddElement(G4NistManager::Instance()-> 141 142 143 144 145 G4Material *galacticNist = 146 G4NistManager::Instance()->FindOrBuildMa 147 PMMA = 148 G4NistManager::Instance()->FindOrBuildMa 149 150 G4Material *titanioNist = 151 G4NistManager::Instance()->FindOrBuildMa 152 153 154 // MATERIAL ASSIGNMENT 155 156 // Material of the APPLICATOR Flash 157 fFirstApplicatorMaterialFlash = PMMA; 158 159 // Titanium window 160 FTFlashMaterialFlash = titanioNist; 161 162 // Vacuum Source 163 VSFlashMaterialFlash = galacticNist; 164 } 165 166 void FlashApplicator::ConstructApplicator() { 167 168 // Components of the Applicator 169 170 FlashBeamLineVacuumSource(); 171 FlashBeamLineTitaniumWindows(); 172 FlashVWAlcover(); 173 FlashAlCover2(); 174 FlashExitBit(); 175 FlashToroid(); 176 OverCover(); 177 178 MonitorChamber(); 179 Flash_connector(); 180 Bigconnector(); 181 Bigconnector2(); 182 FlashBeamLineApplicator();//modify this func 183 184 185 186 } 187 188 void FlashApplicator::FlashBeamLineVacuumSourc 189 // ----------------------------------------- 190 // Vacuum Source 191 // ----------------------------------------- 192 193 G4double phi1 = 90. * deg; 194 195 G4RotationMatrix rm1; 196 rm1.rotateY(phi1); 197 198 fOutRadiusVSFlash = 20 * mm; 199 const G4double innRadiusVSFlash = 0. * mm; 200 fHightVSFlash = 8 * mm; 201 const G4double startAngleVSFlash = 0. * deg; 202 const G4double spanningAngleVSFlash = 360. * 203 fXPositionVSFlash = fInitial_pos-fHightVSFla 204 205 solidVSFlash = 206 new G4Tubs("VSFlash", innRadiusVSFlash, 207 startAngleVSFlash, spanningAn 208 209 G4LogicalVolume *logVSFlash = new G4LogicalV 210 solidVSFlash, VSFlashMaterialFlash, "VSF 211 212 physiVSFlash = new G4PVPlacement( 213 G4Transform3D(rm1, G4ThreeVector((fXPosi 214 logVSFlash, fMotherPhys, false, 0); 215 216 logVSFlash->SetVisAttributes(green); 217 } 218 219 void FlashApplicator::FlashBeamLineTitaniumWin 220 // ----------------------------------------- 221 // Titanium Window 222 // ----------------------------------------- 223 // with just this piece ssd=1.6cm 224 G4double phi2 = 90. * deg; 225 226 G4RotationMatrix rm2; 227 rm2.rotateY(phi2); 228 229 fOutRadiusFTFlash = fOutRadiusVSFlash; 230 const G4double innRadiusFTFlash = 19 * mm; 231 fHightFTFlash = 0.055/2 * mm; 232 const G4double startAngleFTFlash = 0. * deg; 233 const G4double spanningAngleFTFlash = 360. * 234 const G4double XPositionFTFlash = fInitial_p 235 236 solidFTFlash = 237 new G4Tubs("FTFlash", innRadiusFTFlash, 238 startAngleFTFlash, spanningAn 239 240 G4LogicalVolume *logFTFlash = new G4LogicalV 241 solidFTFlash, FTFlashMaterialFlash, "FTF 242 243 physiFTFlash = new G4PVPlacement( 244 G4Transform3D(rm2, G4ThreeVector((XPosit 245 logFTFlash, fMotherPhys, false, 0); 246 247 logFTFlash->SetVisAttributes(yellow); 248 } 249 void FlashApplicator::FlashVWAlcover(){ 250 251 G4double phi2 = 90. * deg; 252 253 G4RotationMatrix rm2; 254 rm2.rotateY(phi2); 255 256 257 const G4double innRadius = fOutRadiusVSFlash 258 fOutRadius = innRadius+8*mm; 259 const G4double hight = fHightVSFlash; 260 const G4double startAngle = 0. * deg; 261 const G4double spanningAngle = 360. * deg; 262 const G4double XPosition = fXPositionVSFlash 263 264 G4VSolid * solid = 265 new G4Tubs("cover1", innRadius, fOutRadi 266 startAngle, spanningAngle); 267 268 G4LogicalVolume *log = new G4LogicalVolume( 269 solid, aluminumNist, "cover1log", 0, 0, 270 271 new G4PVPlacement( 272 G4Transform3D(rm2, G4ThreeVector((XPosit 273 log, fMotherPhys, false, 0); 274 275 log->SetVisAttributes(white); 276 277 278 } 279 void FlashApplicator::FlashAlCover2(){ 280 281 G4double phi2 = 90. * deg; 282 283 G4RotationMatrix rm2; 284 rm2.rotateY(phi2); 285 286 287 const G4double innRadius = fOutRadiusVSFlash 288 289 const G4double hight = fHightVSFlash+fHightF 290 const G4double startAngle = 0. * deg; 291 const G4double spanningAngle = 360. * deg; 292 const G4double XPosition = fInitial_pos+high 293 294 G4VSolid * solid = 295 new G4Tubs("cover1", innRadius, fOutRadi 296 startAngle, spanningAngle); 297 298 G4LogicalVolume *log = new G4LogicalVolume( 299 solid, aluminumNist, "cover1log", 0, 0, 300 301 new G4PVPlacement( 302 G4Transform3D(rm2, G4ThreeVector((XPosit 303 log, fMotherPhys, false, 0); 304 305 log->SetVisAttributes(red); 306 307 fInitial_pos=fInitial_pos + fHightFTFlash; 308 } 309 void FlashApplicator::FlashExitBit(){ 310 311 G4double phi2 = 90. * deg; 312 313 G4RotationMatrix rm2; 314 rm2.rotateY(phi2); 315 316 317 const G4double innRadius = 0*mm; 318 fOutRadius = fOutRadiusVSFlash; 319 const G4double hight = 16/2*mm; 320 const G4double startAngle = 0. * deg; 321 const G4double spanningAngle = 360. * deg; 322 const G4double XPosition = fInitial_pos+high 323 324 325 G4VSolid *t1 = new G4Tubs("t1", innRadius, 326 startAngle, spanningAngle); 327 328 G4VSolid *t2 = new G4Cons("t2", 0*mm,13/2* 329 330 G4RotationMatrix rotm_t2 = G4RotationMatri 331 rotm_t2.rotateX(0 * deg); 332 G4ThreeVector zTrans(0, 0, 0); 333 334 G4SubtractionSolid *hollowcover = 335 new G4SubtractionSolid("hollowcover_lo 336 337 338 G4LogicalVolume *logic = 339 new G4LogicalVolume(hollowcover, alumi 340 341 new G4PVPlacement( 342 G4Transform3D(rm2, G4ThreeVector((XPosit 343 logic, fMotherPhys, false, 0); 344 345 logic->SetVisAttributes(darkOrange3); 346 fInitial_pos=XPosition+hight; 347 } 348 void FlashApplicator::FlashToroid(){ 349 350 G4double phi2 = 90. * deg; 351 352 G4RotationMatrix rm2; 353 rm2.rotateY(phi2); 354 355 356 const G4double innRadius = 50.8/2*mm; 357 fToroid_outRadius = innRadius + 45*mm; 358 fToroid_hight = 50.8/2*mm; 359 const G4double startAngle = 0. * deg; 360 const G4double spanningAngle = 360. * deg; 361 fToroid_XPosition = fInitial_pos+fToroid_hig 362 363 G4VSolid * solid = 364 new G4Tubs("toroid", innRadius, fToroid_ 365 startAngle, spanningAngle); 366 367 G4LogicalVolume *log = new G4LogicalVolume( 368 solid, Fe, "toroidlog", 0, 0, 0); 369 370 new G4PVPlacement( 371 G4Transform3D(rm2, G4ThreeVector((fToroi 372 log, fMotherPhys, false, 0); 373 374 log->SetVisAttributes(blue); 375 376 fInitial_pos=fToroid_XPosition+fToroid_hight; 377 } 378 void FlashApplicator::OverCover(){ 379 380 G4double phi2 = 90. * deg; 381 382 G4RotationMatrix rm2; 383 rm2.rotateY(phi2); 384 385 386 const G4double innRadius = fOutRadius; 387 const G4double out_Radius = 5*fOutRadius ; 388 fBigcover_hight = 7.5*mm; 389 const G4double startAngle = 0. * deg; 390 const G4double spanningAngle = 360. * deg; 391 fBigcover_XPosition = fXPositionVSFlash - f 392 393 G4VSolid * solid = 394 new G4Tubs("coverbig", innRadius, out_Ra 395 startAngle, spanningAngle); 396 397 G4LogicalVolume *log = new G4LogicalVolume( 398 solid, aluminumNist, "coverbig_log", 0, 399 400 new G4PVPlacement( 401 G4Transform3D(rm2, G4ThreeVector((fBigco 402 log, fMotherPhys, false, 0); 403 404 log->SetVisAttributes(skyBlue); 405 406 407 const G4double innRadius_2 = fToroid_outRadi 408 const G4double out_Radius_2 = innRadius_2 + 409 const G4double fBigcover_hight_2 = 30*mm; 410 const G4double startAngle_2 = 0. * deg; 411 const G4double spanningAngle_2 = 360. * deg; 412 const double fBigcover_XPosition_2 = fBigco 413 414 G4VSolid * solid_2 = 415 new G4Tubs("coverbig_2", innRadius_2, ou 416 startAngle_2, spanningAngle_2 417 418 G4LogicalVolume *log_2 = new G4LogicalVolume 419 solid_2, aluminumNist, "coverbig_log", 0 420 421 new G4PVPlacement( 422 G4Transform3D(rm2, G4ThreeVector((fBigco 423 log_2, fMotherPhys, false, 0); 424 425 log_2->SetVisAttributes(green); 426 427 428 } 429 430 void FlashApplicator::OverCover2() { 431 432 G4double phi2 = 90. * deg; 433 434 G4RotationMatrix rm2; 435 rm2.rotateY(phi2); 436 437 438 const G4double innRadius = fToroid_outRadius 439 const G4double out_Radius = innRadius+40*mm 440 const G4double hight = 34*mm; 441 const G4double startAngle = 0. * deg; 442 const G4double spanningAngle = 360. * deg; 443 const G4double XPosition = fBigcover_XPositi 444 445 G4VSolid * solid = 446 new G4Tubs("coverbig", innRadius, out_Ra 447 startAngle, spanningAngle); 448 449 G4LogicalVolume *log = new G4LogicalVolume( 450 solid, aluminumNist, "coverbig_log", 0, 451 452 new G4PVPlacement( 453 G4Transform3D(rm2, G4ThreeVector((XPosit 454 log, fMotherPhys, false, 0); 455 456 log->SetVisAttributes(yellow); 457 458 } 459 460 void FlashApplicator::MonitorChamber(){ 461 462 G4double phi2 = 90. * deg; 463 464 G4RotationMatrix rm2; 465 rm2.rotateY(phi2); 466 467 468 const G4double innRadius = 20*mm; 469 const G4double out_Radius = innRadius+1.7*mm 470 const G4double hight = 3*mm; 471 const G4double startAngle = 0. * deg; 472 const G4double spanningAngle = 360. * deg; 473 G4double XPosition = fInitial_pos+hight; 474 475 G4VSolid * solid = 476 new G4Tubs("first", innRadius, out_Radiu 477 startAngle, spanningAngle); 478 479 480 481 G4LogicalVolume *log = new G4LogicalVolume( 482 solid, PVDF, "chamberfirst_log", 0, 0, 0 483 484 new G4PVPlacement( 485 G4Transform3D(rm2, G4ThreeVector((XPosit 486 log, fMotherPhys, false, 0); 487 488 log->SetVisAttributes(red); 489 490 G4VSolid * solid_pvdf= 491 new G4Tubs("s_pvdf", innRadius, out_Radi 492 startAngle, spanningAngle); 493 494 495 G4LogicalVolume *log_pvdf= new G4Logical 496 solid_pvdf, PVDF, "pvdf_log", 0, 0, 0); 497 498 G4VSolid * solid_film = 499 new G4Tubs("s_film", innRadius, out_Radi 500 startAngle, spanningAngle); 501 G4LogicalVolume *log_film = new G4LogicalVo 502 solid_film, FILM, "ka_log", 0, 0, 0); 503 504 G4VSolid * solid_al = 505 new G4Tubs("s_al", innRadius, out_Radius 506 startAngle, spanningAngle); 507 508 G4LogicalVolume *log_al = new G4LogicalVolum 509 solid_al, aluminumNist, "al_log", 0, 0, 510 XPosition=XPosition+hight; 511 512 G4int j=0; 513 for(G4int i = 0;i<3;i++){ 514 XPosition=XPosition+(i+1)*0.05/2*mm; 515 new G4PVPlacement( 516 G4Transform3D(rm2, G4ThreeVector((XPosit 517 log_film, fMotherPhys, false, j); 518 XPosition=XPosition+(i+1)*0.005/2*mm; 519 new G4PVPlacement( 520 G4Transform3D(rm2, G4ThreeVector((XPosit 521 log_al, fMotherPhys, false, j); 522 523 XPosition=XPosition+(i+1)*1/2*mm; 524 new G4PVPlacement( 525 G4Transform3D(rm2, G4ThreeVector((XPosit 526 log_pvdf, fMotherPhys, false, j); 527 528 529 530 } 531 fChamberpos = XPosition +1/2*mm; 532 log_film->SetVisAttributes(green); 533 log_al->SetVisAttributes(blue); 534 log_pvdf->SetVisAttributes(yellow); 535 536 537 } 538 539 void FlashApplicator::Flash_connector(){ 540 541 G4double phi2 = 90. * deg; 542 543 G4RotationMatrix rm2; 544 rm2.rotateY(phi2); 545 546 547 const G4double innRadius = 10*cm; 548 const G4double out_Radius = innRadius+2.5*cm 549 const G4double hight = 15*mm; 550 const G4double startAngle = 0. * deg; 551 const G4double spanningAngle = 360. * deg; 552 const G4double XPosition = fChamberpos+hight 553 554 G4VSolid * solid = 555 new G4Tubs("cover", innRadius, out_Radiu 556 startAngle, spanningAngle); 557 558 G4LogicalVolume *log = new G4LogicalVolume( 559 solid, aluminumNist, "coverbig_log", 0, 560 561 new G4PVPlacement( 562 G4Transform3D(rm2, G4ThreeVector((XPosit 563 log, fMotherPhys, false, 0); 564 565 log->SetVisAttributes(magenta); 566 567 568 G4VSolid * solid_ = 569 new G4Tubs("littlecover", 22*mm, innRadi 570 startAngle, spanningAngle); 571 G4LogicalVolume *log_ = new G4LogicalVolume( 572 solid_, aluminumNist, "covers_log", 0, 0 573 574 new G4PVPlacement( 575 G4Transform3D(rm2, G4ThreeVector((fChamb 576 log_, fMotherPhys, false, 0); 577 log_->SetVisAttributes(green); 578 579 fInitial_pos=XPosition+hight; 580 } 581 582 void FlashApplicator::Bigconnector() { 583 584 G4double phi2 = 90. * deg; 585 586 G4RotationMatrix rm2; 587 rm2.rotateY(phi2); 588 589 590 const G4double innRadius = 10*cm; 591 const G4double out_Radius = innRadius+30*mm 592 const G4double hight = 7.05*cm + 0.0075/2*mm 593 const G4double startAngle = 0. * deg; 594 const G4double spanningAngle = 360. * deg; 595 const G4double XPosition = fInitial_pos+high 596 597 G4VSolid * solid = 598 new G4Tubs("coverbig", innRadius, out_Ra 599 startAngle, spanningAngle); 600 601 G4LogicalVolume *log = new G4LogicalVolume( 602 solid, aluminumNist, "coverbig_log", 0, 603 604 new G4PVPlacement( 605 G4Transform3D(rm2, G4ThreeVector((XPosit 606 log, fMotherPhys, false, 0); 607 608 log->SetVisAttributes(red); 609 fInitial_pos=XPosition+hight; 610 } 611 void FlashApplicator::Bigconnector2() { 612 613 G4double phi2 = 90. * deg; 614 615 G4RotationMatrix rm2; 616 rm2.rotateY(phi2); 617 618 619 const G4double innRadius = 6*cm; 620 const G4double out_Radius = innRadius+70*mm 621 const G4double hight = 4.4*cm-12/4*mm; 622 const G4double startAngle = 0. * deg; 623 const G4double spanningAngle = 360. * deg; 624 const G4double XPosition = fInitial_pos+high 625 626 G4VSolid * solid = 627 new G4Tubs("coverbig", innRadius, out_Ra 628 startAngle, spanningAngle); 629 630 631 632 633 G4LogicalVolume *log = new G4LogicalVolu 634 solid, PVDF, "coverbig_log", 0, 0, 0); 635 636 new G4PVPlacement( 637 G4Transform3D(rm2, G4ThreeVector((XPosit 638 log, fMotherPhys, false, 0); 639 640 log->SetVisAttributes(blue); 641 fInitial_pos=XPosition+hight; 642 } 643 644 void FlashApplicator::Bigconnector3() {//this 645 646 G4double phi2 = 90. * deg; 647 648 G4RotationMatrix rm2; 649 rm2.rotateY(phi2); 650 651 652 const G4double innRadius = 6*cm; 653 const G4double out_Radius = innRadius+60*mm 654 const G4double hight = 3.4*cm-11/4*mm; 655 const G4double startAngle = 0. * deg; 656 const G4double spanningAngle = 360. * deg; 657 const G4double XPosition = fInitial_pos+high 658 659 660 661 G4VSolid *t1 = new G4Tubs("t1_", 0*mm, out_R 662 startAngle, spanningAngle); 663 664 G4VSolid *t2 = new G4Cons("t2_", 0*mm,60*m 665 666 667 G4ThreeVector zTrans(0, 0, 0); 668 669 G4SubtractionSolid *hollowcover = 670 new G4SubtractionSolid("hollowcover_lo 671 672 G4LogicalVolume *log = new G4LogicalVolume( 673 hollowcover, PMMA, "coverbig_log_", 0, 0 674 675 new G4PVPlacement( 676 G4Transform3D(rm2, G4ThreeVector((XPosit 677 log, fMotherPhys, false, 0); 678 679 log->SetVisAttributes(yellow); 680 fInitial_pos=XPosition+hight; 681 } 682 683 void FlashApplicator::FlashBeamLineApplicator( 684 685 686 687 688 // hightFinalApplicatorFlash = 300 * mm;//mo 689 if (fHightFinalApplicatorFlash != 0*mm){//s 690 Bigconnector3(); //comment this line to r 691 const G4double startAngleFirstApplicatorFlas 692 const G4double spanningAngleFirstApplicatorF 693 fFinalApplicatorXPositionFlash = fInitial_p 694 695 G4double phi6 = 90. * deg; 696 697 G4RotationMatrix rm6; 698 rm6.rotateY(phi6); 699 700 fSolidFirstApplicatorFlash = new G4Tubs( 701 "FirstApplicatorFlash", fInnerRadiusFirs 702 fOuterRadiusFirstApplicatorFlash, fHight 703 startAngleFirstApplicatorFlash, spanning 704 705 G4LogicalVolume *logFirstApplicatorFlash = n 706 fSolidFirstApplicatorFlash, fFirstApplic 707 "FirstApplicatorFlash", 0, 0, 0); 708 709 fPhysiFirstApplicatorFlash = new G4PVPlaceme 710 G4Transform3D(rm6, 711 G4ThreeVector((fFinalAppli 712 "FirstApplicatorFlash", logFirstApplicat 713 714 logFirstApplicatorFlash->SetVisAttributes(ma 715 } 716 717 718 void FlashApplicator::SetOuterRadius(G4double 719 { 720 721 fOuterRadiusFirstApplicatorFlash=radius; 722 fInnerRadiusFirstApplicatorFlash= fOuterRadi 723 724 } 725 726 void FlashApplicator::SetApplicatorLength(G4do 727 { 728 fHightFinalApplicatorFlash=length; 729 730 } 731 732 733 734 735 736