Geant4  10.00.p02
PassiveCarbonBeamLine.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // **************************************************************************************
27 //
28 // HADRONTHERAPY: a Geant4-based application for proton/ion-therapy studies
29 // _________________________________________________________________________
30 //
31 // This is the FULL version of the Hadrontherapy application.
32 // It is based on the Geant4 toolkit classes and released under the GPL3 license.
33 //
34 // Its basic version is released and maintained inside the Geant4 code
35 // as Advanced Example.
36 //
37 // To compile and run Hadrontherapy you only require the installation of Geant4 and,
38 // if you wish, the ROOT ananlysis program.
39 //
40 // For more information see the documentation at http://sites.google.com/site/hadrontherapy/
41 // or contact cirrone@lns.infn.it
42 //
43 // **************************************************************************************
44 
45 
46 #include "G4Box.hh"
47 #include "G4Tubs.hh"
48 #include "G4VisAttributes.hh"
49 #include "G4Colour.hh"
50 #include "globals.hh"
51 #include "G4RunManager.hh"
52 #include "G4LogicalVolume.hh"
53 #include "G4PVPlacement.hh"
54 #include "G4RotationMatrix.hh"
55 #include "G4NistManager.hh"
56 #include "G4NistElementBuilder.hh"
59 #include "PassiveCarbonBeamLine.hh"
60 #include "G4SystemOfUnits.hh"
61 
62 
63 
64 
67 physicalTreatmentRoom(0), hadrontherapyDetectorConstruction(0),
68 physiBeamLineSupport(0), physiBeamLineCover(0), physiBeamLineCover2(0),
69 physiKaptonWindow(0),
70 physiFirstMonitorLayer1(0), physiFirstMonitorLayer2(0),
71 physiFirstMonitorLayer3(0), physiFirstMonitorLayer4(0),
72 physiNozzleSupport(0), physiHoleNozzleSupport(0),
73 physiSecondHoleNozzleSupport(0),
74 solidFinalCollimator(0),
75 physiFinalCollimator(0)
76 {
77  // Messenger to change parameters of the passiveProtonBeamLine geometry
78  //passiveMessenger = new PassiveProtonBeamLineMessenger(this);
79 
80 //***************************** PW ***************************************
81 
82  static G4String ROGeometryName = "DetectorROGeometry";
83  RO = new HadrontherapyDetectorROGeometry(ROGeometryName);
84 
85 
86 
87  G4cout << "Going to register Parallel world...";
89  G4cout << "... done" << G4endl;
90 //***************************** PW ***************************************
91 
92 
93 
94 }
95 
98 {
99  //delete passiveMessenger;
101 }
102 
105 {
106  // Sets default geometry and materials
108 
109  // Construct the whole CarbonPassive Beam Line
111 
112 
113 //***************************** PW ***************************************
115 
116 //***************************** PW ***************************************
117 
118  // HadrontherapyDetectorConstruction builds ONLY the phantom and the detector with its associated ROGeometry
120 
121 //***************************** PW ***************************************
122 
124 
125 //***************************** PW ***************************************
126 
127 
128  return physicalTreatmentRoom;
129 }
130 
131 // In the following method the DEFAULTS used in the geometry of
132 // passive beam line are provided
133 // HERE THE USER CAN CHANGE THE GEOMETRY CHARACTERISTICS OF BEAM
134 // LINE ELEMENTS, ALTERNATIVELY HE/SHE CAN USE THE MACRO FILE (IF A
135 // MESSENGER IS PROVIDED)
136 //
137 // DEFAULT MATERIAL ARE ALSO PROVIDED
138 // and COLOURS ARE ALSO DEFINED
139 // ----------------------------------------------------------
142 {
143  // Set of coulors that can be used
144  white = new G4VisAttributes( G4Colour());
145  white -> SetVisibility(true);
146  white -> SetForceSolid(true);
147 
148  blue = new G4VisAttributes(G4Colour(0. ,0. ,1.));
149  blue -> SetVisibility(true);
150  blue -> SetForceSolid(true);
151 
152  gray = new G4VisAttributes( G4Colour(0.5, 0.5, 0.5 ));
153  gray-> SetVisibility(true);
154  gray-> SetForceSolid(true);
155 
156  red = new G4VisAttributes(G4Colour(1. ,0. ,0.));
157  red-> SetVisibility(true);
158  red-> SetForceSolid(true);
159 
160  yellow = new G4VisAttributes(G4Colour(1., 1., 0. ));
161  yellow-> SetVisibility(true);
162  yellow-> SetForceSolid(true);
163 
164  green = new G4VisAttributes( G4Colour(25/255. , 255/255. , 25/255. ));
165  green -> SetVisibility(true);
166  green -> SetForceSolid(true);
167 
168  darkGreen = new G4VisAttributes( G4Colour(0/255. , 100/255. , 0/255. ));
169  darkGreen -> SetVisibility(true);
170  darkGreen -> SetForceSolid(true);
171 
172  darkOrange3 = new G4VisAttributes( G4Colour(205/255. , 102/255. , 000/255. ));
173  darkOrange3 -> SetVisibility(true);
174  darkOrange3 -> SetForceSolid(true);
175 
176  skyBlue = new G4VisAttributes( G4Colour(135/255. , 206/255. , 235/255. ));
177  skyBlue -> SetVisibility(true);
178  skyBlue -> SetForceSolid(true);
179 
180 
181  // VACUUM PIPE: first track of the beam line is inside vacuum;
182  // The PIPE contains KAPTON WINDOW
183  G4double defaultVacuumZoneXSize = 80.5325 *mm;
184  vacuumZoneXSize = defaultVacuumZoneXSize;
185 
186  G4double defaultVacuumZoneYSize = 52.5 *mm;
187  vacuumZoneYSize = defaultVacuumZoneYSize;
188 
189  G4double defaultVacuumZoneZSize = 52.5 *mm;
190  vacuumZoneZSize = defaultVacuumZoneZSize;
191 
192  // XXX -1775 mm (xKapton to WORLD) - 80.5075 (xKapton to vacuumZone)
193  G4double defaultVacuumZoneXPosition = -1855.5075 *mm;
194  vacuumZoneXPosition = defaultVacuumZoneXPosition;
195 
196 
197  // KAPTON WINDOW: it permits the passage of the beam from vacuum to air
198  G4double defaultKaptonWindowXSize = 0.025*mm;
199  kaptonWindowXSize = defaultKaptonWindowXSize;
200 
201  G4double defaultKaptonWindowYSize = 5.25*cm;
202  kaptonWindowYSize = defaultKaptonWindowYSize;
203 
204  G4double defaultKaptonWindowZSize = 5.25*cm;
205  kaptonWindowZSize = defaultKaptonWindowZSize;
206 
207  G4double defaultKaptonWindowXPosition = 80.5075*mm;
208  kaptonWindowXPosition = defaultKaptonWindowXPosition;
209 
210  // FIRST SCATTERING FOIL: a thin foil performing a first scattering
211  // of the original beam
212  G4double defaultFirstScatteringFoilXSize = 0.025 *mm;
213  firstScatteringFoilXSize = defaultFirstScatteringFoilXSize;
214 
215  G4double defaultFirstScatteringFoilYSize = 105.0 *mm;
216  firstScatteringFoilYSize = defaultFirstScatteringFoilYSize;
217 
218  G4double defaultFirstScatteringFoilZSize = 105 *mm;
219  firstScatteringFoilZSize = defaultFirstScatteringFoilZSize;
220 
221  G4double defaultFirstScatteringFoilXPosition = 0.0 *mm;
222  firstScatteringFoilXPosition = defaultFirstScatteringFoilXPosition;
223 
224 
225 
226  // STOPPER AND SCATTERING FOIL SIMULATED TO TEST THEIR EFFECT
227  // IN THE LATERAL DOSE DISTRIBUTION
228  // STOPPER: is a small cylinder able to stop the central component
229  // of the beam (having a gaussian shape). It is connected to the SECON SCATTERING FOIL
230  // and represent the second element of the scattering system
231  G4double defaultInnerRadiusStopper = 0.*cm;
232  innerRadiusStopper = defaultInnerRadiusStopper;
233 
234  G4double defaultHeightStopper = 7.0 *mm;
235  heightStopper = defaultHeightStopper;
236 
237  G4double defaultStartAngleStopper = 0.*deg;
238  startAngleStopper = defaultStartAngleStopper;
239 
240  G4double defaultSpanningAngleStopper = 360.*deg;
241  spanningAngleStopper = defaultSpanningAngleStopper;
242 
243  G4double defaultStopperXPosition = -1675.0 *mm;
244  stopperXPosition = defaultStopperXPosition;
245 
246  G4double defaultStopperYPosition = 0.*m;
247  stopperYPosition = defaultStopperYPosition;
248 
249  G4double defaultStopperZPosition = 0.*m;
250  stopperZPosition = defaultStopperZPosition;
251 
252  G4double defaultOuterRadiusStopper = 2 *mm;
253  outerRadiusStopper = defaultOuterRadiusStopper;
254 
255  // SECOND SCATTERING FOIL: it is another thin foil and provides the
256  // final diffusion of the beam. It represents the third element of the scattering
257  // system;
258  G4double defaultSecondScatteringFoilXSize = 0.025 *mm;
259  secondScatteringFoilXSize = defaultSecondScatteringFoilXSize;
260 
261  G4double defaultSecondScatteringFoilYSize = 105.0 *mm;
262  secondScatteringFoilYSize = defaultSecondScatteringFoilYSize;
263 
264  G4double defaultSecondScatteringFoilZSize = 105.0 *mm;
265  secondScatteringFoilZSize = defaultSecondScatteringFoilZSize;
266 
267  G4double defaultSecondScatteringFoilXPosition = defaultStopperXPosition + defaultHeightStopper + defaultSecondScatteringFoilXSize/2;
268  secondScatteringFoilXPosition = defaultSecondScatteringFoilXPosition;
269 
270  G4double defaultSecondScatteringFoilYPosition = 0 *mm;
271  secondScatteringFoilYPosition = defaultSecondScatteringFoilYPosition;
272 
273  G4double defaultSecondScatteringFoilZPosition = 0 *mm;
274  secondScatteringFoilZPosition = defaultSecondScatteringFoilZPosition;
275 
276 
277  // FINAL COLLIMATOR: is the collimator giving the final transversal shape
278  // of the beam
279  G4double defaultinnerRadiusFinalCollimator = 12.5 *mm;
280  innerRadiusFinalCollimator = defaultinnerRadiusFinalCollimator;
281 
282  // DEFAULT DEFINITION OF THE MATERIALS
283  // All elements and compound definition follows the NIST database
284 
285  // ELEMENTS
286  G4bool isotopes = false;
287  G4Material* aluminumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al", isotopes);
288  G4Material* copperNistAsMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Cu", isotopes);
291  G4Material* tantalumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ta", isotopes);
292 
293  // COMPOUND
294  G4Material* airNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
295  G4Material* kaptonNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON", isotopes);
296  G4Material* galacticNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic", isotopes);
297  G4Material* PMMANist = G4NistManager::Instance()->FindOrBuildMaterial("G4_PLEXIGLASS", isotopes);
298 
299  G4double d; // Density
300  G4int nComponents;// Number of components
301  G4double fractionmass; // Fraction in mass of an element in a material
302 
303  d = 8.40*g/cm3;
304  nComponents = 2;
305  G4Material* brass = new G4Material("Brass", d, nComponents);
306  brass -> AddElement(zincNist, fractionmass = 30 *perCent);
307  brass -> AddElement(copperNist, fractionmass = 70 *perCent);
308 
309 //***************************** PW ***************************************
310 
311 // DetectorROGeometry Material
312  new G4Material("dummyMat", 1., 1.*g/mole, 1.*g/cm3);
313 
314 //***************************** PW ***************************************
315 
316 
317  // MATERIAL ASSIGNMENT
318  // Support of the beam line
319  beamLineSupportMaterial = aluminumNist;
320 
321  // Vacuum pipe
322  vacuumZoneMaterial = galacticNist;
323 
324  // Material of the firt scattering foil
325  firstScatteringFoilMaterial = tantalumNist;
326 
327  // Material of kapton window
328  kaptonWindowMaterial = kaptonNist;
329 
330  // Material of the stopper
331  stopperMaterial = brass;
332 
333  // Material of the second scattering foil
334  secondScatteringFoilMaterial = tantalumNist;
335 
336  // Materials of the monitor chamber
337  layer1MonitorChamberMaterial = kaptonNist;
338  layer2MonitorChamberMaterial = copperNistAsMaterial;
340  layer4MonitorChamberMaterial = copperNistAsMaterial;
341 
342 
343  // material of the final nozzle
344  nozzleSupportMaterial = PMMANist;
347 
348  // Material of the final collimator
349  finalCollimatorMaterial = brass;
350 }
351 
354 {
355  // -----------------------------
356  // Treatment room - World volume
357  //------------------------------
358  // Treatment room sizes
359  const G4double worldX = 400.0 *cm;
360  const G4double worldY = 400.0 *cm;
361  const G4double worldZ = 400.0 *cm;
362  G4bool isotopes = false;
363 
364  G4Material* airNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
365  G4Box* treatmentRoom = new G4Box("TreatmentRoom",worldX,worldY,worldZ);
366  G4LogicalVolume* logicTreatmentRoom = new G4LogicalVolume(treatmentRoom,
367  airNist,
368  "logicTreatmentRoom",
369  0,0,0);
371  G4ThreeVector(),
372  "physicalTreatmentRoom",
373  logicTreatmentRoom,
374  0,false,0);
375 
376 
377  // The treatment room is invisible in the Visualisation
378  logicTreatmentRoom -> SetVisAttributes (G4VisAttributes::Invisible);
379 
380  // Components of the Passive Carbon Beam Line
387 }
388 
391 {
392  // ------------------//
393  // BEAM LINE SUPPORT //
394  //-------------------//
395  const G4double beamLineSupportXSize = 1.5*m;
396  const G4double beamLineSupportYSize = 20.*mm;
397  const G4double beamLineSupportZSize = 600.*mm;
398 
399  const G4double beamLineSupportXPosition = -1745.09 *mm;
400  const G4double beamLineSupportYPosition = -230. *mm;
401  const G4double beamLineSupportZPosition = 0.*mm;
402 
403  G4Box* beamLineSupport = new G4Box("BeamLineSupport",
404  beamLineSupportXSize,
405  beamLineSupportYSize,
406  beamLineSupportZSize);
407 
408  G4LogicalVolume* logicBeamLineSupport = new G4LogicalVolume(beamLineSupport,
410  "BeamLineSupport");
411  physiBeamLineSupport = new G4PVPlacement(0, G4ThreeVector(beamLineSupportXPosition,
412  beamLineSupportYPosition,
413  beamLineSupportZPosition),
414  "BeamLineSupport",
415  logicBeamLineSupport,
416  physicalTreatmentRoom, false, 0);
417 
418  // Visualisation attributes of the beam line support
419 
420  logicBeamLineSupport -> SetVisAttributes(gray);
421 
422  //---------------------------------//
423  // Beam line cover 1 (left panel) //
424  //---------------------------------//
425  const G4double beamLineCoverXSize = 1.5*m;
426  const G4double beamLineCoverYSize = 750.*mm;
427  const G4double beamLineCoverZSize = 10.*mm;
428 
429  const G4double beamLineCoverXPosition = -1745.09 *mm;
430  const G4double beamLineCoverYPosition = -980.*mm;
431  const G4double beamLineCoverZPosition = 600.*mm;
432 
433  G4Box* beamLineCover = new G4Box("BeamLineCover",
434  beamLineCoverXSize,
435  beamLineCoverYSize,
436  beamLineCoverZSize);
437 
438  G4LogicalVolume* logicBeamLineCover = new G4LogicalVolume(beamLineCover,
440  "BeamLineCover");
441 
442  physiBeamLineCover = new G4PVPlacement(0, G4ThreeVector(beamLineCoverXPosition,
443  beamLineCoverYPosition,
444  beamLineCoverZPosition),
445  "BeamLineCover",
446  logicBeamLineCover,
448  false,
449  0);
450 
451  // ---------------------------------//
452  // Beam line cover 2 (rigth panel) //
453  // ---------------------------------//
454  // It has the same characteristic of beam line cover 1 but set in a different position
455  physiBeamLineCover2 = new G4PVPlacement(0, G4ThreeVector(beamLineCoverXPosition,
456  beamLineCoverYPosition,
457  - beamLineCoverZPosition),
458  "BeamLineCover2",
459  logicBeamLineCover,
461  false,
462  0);
463 
464 
465  logicBeamLineCover -> SetVisAttributes(blue);
466 }
467 
470 {
471  // ------------//
472  // VACUUM PIPE //
473  //-------------//
474  //
475  // First track of the beam line is inside vacuum;
476  // The PIPE contains the FIRST SCATTERING FOIL and the KAPTON WINDOW
477  G4Box* vacuumZone = new G4Box("VacuumZone",
481 
482  G4LogicalVolume* logicVacuumZone = new G4LogicalVolume(vacuumZone,
484  "VacuumZone");
485 
486  G4VPhysicalVolume* physiVacuumZone = new G4PVPlacement(0,
488  "VacuumZone",
489  logicVacuumZone,
491  false,
492  0);
493 
494 
495 
496 
497 
498  // --------------------------//
499  // THE FIRST SCATTERING FOIL //
500  // --------------------------//
501  // A thin foil performing a first scattering
502  // of the original beam
503 
504  firstScatteringFoil = new G4Box("FirstScatteringFoil",
508 
509  G4LogicalVolume* logicFirstScatteringFoil = new G4LogicalVolume(firstScatteringFoil,
511  "FirstScatteringFoil");
512 
515  "FirstScatteringFoil",
516  logicFirstScatteringFoil,
517  physiVacuumZone,
518  false, 0);
519 
520  logicFirstScatteringFoil -> SetVisAttributes(skyBlue);
521 
522 
523 
524  // -------------------//
525  // THE KAPTON WINDOWS //
526  //--------------------//
527  //It permits the passage of the beam from vacuum to air
528 
529  G4Box* solidKaptonWindow = new G4Box("KaptonWindow",
533 
534  G4LogicalVolume* logicKaptonWindow = new G4LogicalVolume(solidKaptonWindow,
536  "KaptonWindow");
537 
539  "KaptonWindow", logicKaptonWindow,
540  physiVacuumZone, false, 0);
541 
542  logicKaptonWindow -> SetVisAttributes(darkOrange3);
543 }
544 
547 {
548  // ------------//
549  // THE STOPPER //
550  //-------------//
551  // Is a small cylinder able to stop the central component
552  // of the beam (having a gaussian shape). It is connected to the SECON SCATTERING FOIL
553  // and represent the second element of the scattering system
554 
555  G4double phi = 90. *deg;
556  // Matrix definition for a 90 deg rotation with respect to Y axis
557  G4RotationMatrix rm;
558  rm.rotateY(phi);
559 
560  solidStopper = new G4Tubs("Stopper",
563  heightStopper/2,
566 
569  "Stopper",
570  0, 0, 0);
571 
575  "Stopper",
576  logicStopper,
578  false,
579  0);
580 
581  logicStopper -> SetVisAttributes(red);
582 
583  // ---------------------------//
584  // THE SECOND SCATTERING FOIL //
585  // ---------------------------//
586  // It is another thin foil and provides the
587  // final diffusion of the beam. It represents the third element of the scattering
588  // system;
589 
590  secondScatteringFoil = new G4Box("SecondScatteringFoil",
594 
595  G4LogicalVolume* logicSecondScatteringFoil = new G4LogicalVolume(secondScatteringFoil,
597  "SecondScatteringFoil");
598 
602  "SeconScatteringFoil",
603  logicSecondScatteringFoil,
605  false,
606  0);
607 
608  logicSecondScatteringFoil -> SetVisAttributes(skyBlue);
609 
610 }
611 
614 {
615  // ----------------------------
616  // THE FIRST MONITOR CHAMBER
617  // ----------------------------
618  // A monitor chamber is a free-air ionisation chamber
619  // able to measure do carbon fluence during the treatment.
620  // Here its responce is not simulated in terms of produced
621  // charge but only the energy losses are taked into account.
622  // Each chamber consist of 9 mm of air in a box
623  // that has two layers one of kapton and one
624  // of copper
625  const G4double monitor1XSize = 4.525022*mm;
626  const G4double monitor2XSize = 0.000011*mm;
627  const G4double monitor3XSize = 4.5*mm;
628  const G4double monitorYSize = 10.*cm;
629  const G4double monitorZSize = 10.*cm;
630  // XXX (Camera monitor size = 9.050088 mm)
631  const G4double monitor1XPosition = -1450.474956 *mm;
632  const G4double monitor2XPosition = -4.500011*mm;
633  const G4double monitor4XPosition = 4.500011*mm;
634 
635  G4Box* solidFirstMonitorLayer1 = new G4Box("FirstMonitorLayer1",
636  monitor1XSize,
637  monitorYSize,
638  monitorZSize);
639 
640  G4LogicalVolume* logicFirstMonitorLayer1 = new G4LogicalVolume(solidFirstMonitorLayer1,
642  "FirstMonitorLayer1");
643 
645  G4ThreeVector(monitor1XPosition,0.*cm,0.*cm),
646  "FirstMonitorLayer1",
647  logicFirstMonitorLayer1,
649  false,
650  0);
651 
652  G4Box* solidFirstMonitorLayer2 = new G4Box("FirstMonitorLayer2",
653  monitor2XSize,
654  monitorYSize,
655  monitorZSize);
656 
657  G4LogicalVolume* logicFirstMonitorLayer2 = new G4LogicalVolume(solidFirstMonitorLayer2,
659  "FirstMonitorLayer2");
660 
661  physiFirstMonitorLayer2 = new G4PVPlacement(0, G4ThreeVector(monitor2XPosition,0.*cm,0.*cm),
662  "FirstMonitorLayer2",
663  logicFirstMonitorLayer2,
665  false,
666  0);
667 
668  G4Box* solidFirstMonitorLayer3 = new G4Box("FirstMonitorLayer3",
669  monitor3XSize,
670  monitorYSize,
671  monitorZSize);
672 
673  G4LogicalVolume* logicFirstMonitorLayer3 = new G4LogicalVolume(solidFirstMonitorLayer3,
675  "FirstMonitorLayer3");
676 
678  G4ThreeVector(0.*mm,0.*cm,0.*cm),
679  "MonitorLayer3",
680  logicFirstMonitorLayer3,
682  false,
683  0);
684 
685  G4Box* solidFirstMonitorLayer4 = new G4Box("FirstMonitorLayer4",
686  monitor2XSize,
687  monitorYSize,
688  monitorZSize);
689 
690  G4LogicalVolume* logicFirstMonitorLayer4 = new G4LogicalVolume(solidFirstMonitorLayer4,
692  "FirstMonitorLayer4");
693 
694  physiFirstMonitorLayer4 = new G4PVPlacement(0, G4ThreeVector(monitor4XPosition,0.*cm,0.*cm),
695  "FirstMonitorLayer4",
696  logicFirstMonitorLayer4,
697  physiFirstMonitorLayer1, false, 0);
698 
699  logicFirstMonitorLayer3 -> SetVisAttributes(white);
700 
701 }
702 
706 {
707  // ------------------------------//
708  // THE FINAL TUBE AND COLLIMATOR //
709  //-------------------------------//
710  // The last part of the transport beam line consists of
711  // a 59 mm thick PMMA slab (to stop all the diffused radiation), a 285 mm brass tube
712  // (to well collimate the carbon beam) and a final collimator with 25 mm diameter
713  // aperture (that provide the final trasversal shape of the beam)
714 
715  // -------------------//
716  // PMMA SUPPORT //
717  // -------------------//
718 
719  const G4double nozzleSupportXSize = 29.5 *mm;
720  const G4double nozzleSupportYSize = 180. *mm;
721  const G4double nozzleSupportZSize = 180. *mm;
722  //XXX Placed at
723  const G4double nozzleSupportXPosition = -558. *mm;
724 
725  G4double phi = 90. *deg;
726  // Matrix definition for a 90 deg rotation. Also used for other volumes
727  G4RotationMatrix rm;
728  rm.rotateY(phi);
729 
730  G4Box* solidNozzleSupport = new G4Box("NozzleSupport",
731  nozzleSupportXSize,
732  nozzleSupportYSize,
733  nozzleSupportZSize);
734 
735  G4LogicalVolume* logicNozzleSupport = new G4LogicalVolume(solidNozzleSupport,
737  "NozzleSupport");
738 
739  physiNozzleSupport = new G4PVPlacement(0, G4ThreeVector(nozzleSupportXPosition,0., 0.),
740  "NozzleSupport",
741  logicNozzleSupport,
743  false,
744  0);
745 
746  logicNozzleSupport -> SetVisAttributes(yellow);
747 
748  // -------------------//
749  // BRASS TUBE //
750  // -------------------//
751  const G4double innerRadiusHoleNozzleSupport = 18.*mm;
752  const G4double outerRadiusHoleNozzleSupport = 21.5 *mm;
753  //XXX h/2 = 142.5 mm
754  const G4double hightHoleNozzleSupport = 142.5*mm;
755  const G4double startAngleHoleNozzleSupport = 0.*deg;
756  const G4double spanningAngleHoleNozzleSupport = 360.*deg;
757  //XXX -(320+142.5)mm
758  const G4double holeNozzleSupportXPosition = -462.50 *mm;
759 
760  G4Tubs* solidHoleNozzleSupport = new G4Tubs("HoleNozzleSupport",
761  innerRadiusHoleNozzleSupport,
762  outerRadiusHoleNozzleSupport,
763  hightHoleNozzleSupport,
764  startAngleHoleNozzleSupport,
765  spanningAngleHoleNozzleSupport);
766 
767  G4LogicalVolume* logicHoleNozzleSupport = new G4LogicalVolume(solidHoleNozzleSupport,
769  "HoleNozzleSupport",
770  0, 0, 0);
771 
772  physiHoleNozzleSupport = new G4PVPlacement(G4Transform3D(rm, G4ThreeVector(holeNozzleSupportXPosition, 0., 0.)),
773  "HoleNozzleSupport",
774  logicHoleNozzleSupport,
775  physicalTreatmentRoom, false, 0);
776 
777  logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
778 
779  //--------------------------------------------------------------//
780  // HOLE OF THE BRASS TUBE (otherwise we'll have PMMA) //
781  //--------------------------------------------------------------//
782  const G4double innerRadiusSecondHoleNozzleSupport = 0.*mm;
783  const G4double outerRadiusSecondHoleNozzleSupport = 18.*mm;
784  const G4double hightSecondHoleNozzleSupport = 29.5 *mm;
785  const G4double startAngleSecondHoleNozzleSupport = 0.*deg;
786  const G4double spanningAngleSecondHoleNozzleSupport = 360.*deg;
787 
788  G4Tubs* solidSecondHoleNozzleSupport = new G4Tubs("SecondHoleNozzleSupport",
789  innerRadiusSecondHoleNozzleSupport,
790  outerRadiusSecondHoleNozzleSupport,
791  hightSecondHoleNozzleSupport,
792  startAngleSecondHoleNozzleSupport,
793  spanningAngleSecondHoleNozzleSupport);
794 
795  G4LogicalVolume* logicSecondHoleNozzleSupport = new G4LogicalVolume(solidSecondHoleNozzleSupport,
797  "SecondHoleNozzleSupport",
798  0,
799  0,
800  0);
801 
803  "SecondHoleNozzleSupport",
804  logicSecondHoleNozzleSupport,
806  false, 0);
807 
808 
809  logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
810 }
811 
814 {
815  // -----------------------//
816  // FINAL COLLIMATOR //
817  //------------------------//
818  const G4double outerRadiusFinalCollimator = 21.5*mm;
819  const G4double hightFinalCollimator = 3.5*mm;
820  const G4double startAngleFinalCollimator = 0.*deg;
821  const G4double spanningAngleFinalCollimator = 360.*deg;
822  //XXX
823  const G4double finalCollimatorXPosition = -323.50 *mm;
824 
825  G4double phi = 90. *deg;
826 
827  // Matrix definition for a 90 deg rotation. Also used for other volumes
828  G4RotationMatrix rm;
829  rm.rotateY(phi);
830 
831  solidFinalCollimator = new G4Tubs("FinalCollimator",
833  outerRadiusFinalCollimator,
834  hightFinalCollimator,
835  startAngleFinalCollimator,
836  spanningAngleFinalCollimator);
837 
838  G4LogicalVolume* logicFinalCollimator = new G4LogicalVolume(solidFinalCollimator,
840  "FinalCollimator",
841  0,
842  0,
843  0);
844 
845  physiFinalCollimator = new G4PVPlacement(G4Transform3D(rm, G4ThreeVector(finalCollimatorXPosition,0.,0.)),
846  "FinalCollimator", logicFinalCollimator, physicalTreatmentRoom, false, 0);
847 
848  logicFinalCollimator -> SetVisAttributes(yellow);
849 }
850 
static const double cm
Definition: G4SIunits.hh:106
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
CLHEP::HepRotation G4RotationMatrix
HadrontherapyDetectorConstruction * hadrontherapyDetectorConstruction
G4Material * layer2MonitorChamberMaterial
Definition: G4Box.hh:64
G4VPhysicalVolume * physiKaptonWindow
G4Material * layer3MonitorChamberMaterial
Definition: G4Tubs.hh:85
G4Material * seconHoleNozzleSupportMaterial
G4VPhysicalVolume * physiFirstMonitorLayer4
G4VPhysicalVolume * physiStopper
G4VPhysicalVolume * Construct()
G4VPhysicalVolume * physiBeamLineSupport
G4VPhysicalVolume * physiHoleNozzleSupport
G4Material * firstScatteringFoilMaterial
G4int nComponents
Definition: TRTMaterials.hh:41
G4Material * secondScatteringFoilMaterial
int G4int
Definition: G4Types.hh:78
static G4NistManager * Instance()
void RegisterParallelWorld(G4VUserParallelWorld *)
HadrontherapyDetectorROGeometry * RO
G4VPhysicalVolume * physicalTreatmentRoom
G4GLOB_DLL std::ostream G4cout
static const double deg
Definition: G4SIunits.hh:133
G4Material * layer1MonitorChamberMaterial
bool G4bool
Definition: G4Types.hh:79
G4VPhysicalVolume * physiFinalCollimator
G4VPhysicalVolume * physiSecondScatteringFoil
G4VPhysicalVolume * physiBeamLineCover
static const double cm3
Definition: G4SIunits.hh:108
HepGeom::Transform3D G4Transform3D
static const double perCent
Definition: G4SIunits.hh:296
G4VPhysicalVolume * physiFirstMonitorLayer3
G4VPhysicalVolume * physiNozzleSupport
G4Material * layer4MonitorChamberMaterial
static const double g
Definition: G4SIunits.hh:162
static const G4VisAttributes Invisible
static const double mole
Definition: G4SIunits.hh:265
G4VPhysicalVolume * physiBeamLineCover2
G4VPhysicalVolume * physiFirstScatteringFoil
#define G4endl
Definition: G4ios.hh:61
static const double m
Definition: G4SIunits.hh:110
G4VPhysicalVolume * physiFirstMonitorLayer1
void InitializeDetectorROGeometry(HadrontherapyDetectorROGeometry *, G4ThreeVector detectorToWorldPosition)
G4VPhysicalVolume * physiFirstMonitorLayer2
double G4double
Definition: G4Types.hh:76
G4LogicalVolume * logicStopper
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
Air AddElement(elN,.7)
G4VPhysicalVolume * physiSecondHoleNozzleSupport
static const double mm
Definition: G4SIunits.hh:102