Geant4  10.01.p03
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 
32 #include "G4Box.hh"
33 #include "G4Tubs.hh"
34 #include "G4VisAttributes.hh"
35 #include "G4Colour.hh"
36 #include "globals.hh"
37 #include "G4RunManager.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4PVPlacement.hh"
40 #include "G4RotationMatrix.hh"
41 #include "G4NistManager.hh"
42 #include "G4NistElementBuilder.hh"
45 #include "PassiveCarbonBeamLine.hh"
46 #include "G4SystemOfUnits.hh"
47 //#include "FaradayCup.hh"
48 
49 //G4bool PassiveCarbonBeamLine::doCalculation = false;
52 physicalTreatmentRoom(0), hadrontherapyDetectorConstruction(0),
53 physiBeamLineSupport(0), physiBeamLineCover(0), physiBeamLineCover2(0),
54 physiKaptonWindow(0),
55 physiFirstMonitorLayer1(0), physiFirstMonitorLayer2(0),
56 physiFirstMonitorLayer3(0), physiFirstMonitorLayer4(0),
57 physiNozzleSupport(0), physiHoleNozzleSupport(0),
58 physiSecondHoleNozzleSupport(0),
59 solidFinalCollimator(0),
60 physiFinalCollimator(0)
61 {
62 
63 //***************************** PW ***************************************
64 
65  static G4String ROGeometryName = "DetectorROGeometry";
66  RO = new HadrontherapyDetectorROGeometry(ROGeometryName);
67 
68 
69 
70  G4cout << "Going to register Parallel world...";
72  G4cout << "... done" << G4endl;
73 //***************************** PW ***************************************
74 }
75 
78 {
80 }
81 
84 {
85  // Sets default geometry and materials
87 
88  // Construct the whole CarbonPassive Beam Line
90 
91 
92 //***************************** PW ***************************************
94 
95 //***************************** PW ***************************************
96 
97  // HadrontherapyDetectorConstruction builds ONLY the phantom and the detector with its associated ROGeometry
99 
100 //***************************** PW ***************************************
101 
103 
104 //***************************** PW ***************************************
105  return physicalTreatmentRoom;
106 }
107 
108 // In the following method the DEFAULTS used in the geometry of
109 // passive beam line are provided
110 // HERE THE USER CAN CHANGE THE GEOMETRY CHARACTERISTICS OF BEAM
111 // LINE ELEMENTS, ALTERNATIVELY HE/SHE CAN USE THE MACRO FILE (IF A
112 // MESSENGER IS PROVIDED)
113 //
114 // DEFAULT MATERIAL ARE ALSO PROVIDED
115 // and COLOURS ARE ALSO DEFINED
116 // ----------------------------------------------------------
119 {
120  // Set of coulors that can be used
121  white = new G4VisAttributes( G4Colour());
122  white -> SetVisibility(true);
123  white -> SetForceSolid(true);
124 
125  blue = new G4VisAttributes(G4Colour(0. ,0. ,1.));
126  blue -> SetVisibility(true);
127  blue -> SetForceSolid(true);
128 
129  gray = new G4VisAttributes( G4Colour(0.5, 0.5, 0.5 ));
130  gray-> SetVisibility(true);
131  gray-> SetForceSolid(true);
132 
133  red = new G4VisAttributes(G4Colour(1. ,0. ,0.));
134  red-> SetVisibility(true);
135  red-> SetForceSolid(true);
136 
137  yellow = new G4VisAttributes(G4Colour(1., 1., 0. ));
138  yellow-> SetVisibility(true);
139  yellow-> SetForceSolid(true);
140 
141  green = new G4VisAttributes( G4Colour(25/255. , 255/255. , 25/255. ));
142  green -> SetVisibility(true);
143  green -> SetForceSolid(true);
144 
145  darkGreen = new G4VisAttributes( G4Colour(0/255. , 100/255. , 0/255. ));
146  darkGreen -> SetVisibility(true);
147  darkGreen -> SetForceSolid(true);
148 
149  darkOrange3 = new G4VisAttributes( G4Colour(205/255. , 102/255. , 000/255. ));
150  darkOrange3 -> SetVisibility(true);
151  darkOrange3 -> SetForceSolid(true);
152 
153  skyBlue = new G4VisAttributes( G4Colour(135/255. , 206/255. , 235/255. ));
154  skyBlue -> SetVisibility(true);
155  skyBlue -> SetForceSolid(true);
156 
157 
158  // VACUUM PIPE: first track of the beam line is inside vacuum;
159  // The PIPE contains KAPTON WINDOW
160  G4double defaultVacuumZoneXSize = 80.5325 *mm;
161  vacuumZoneXSize = defaultVacuumZoneXSize;
162 
163  G4double defaultVacuumZoneYSize = 52.5 *mm;
164  vacuumZoneYSize = defaultVacuumZoneYSize;
165 
166  G4double defaultVacuumZoneZSize = 52.5 *mm;
167  vacuumZoneZSize = defaultVacuumZoneZSize;
168 
169  // XXX -1775 mm (xKapton to WORLD) - 80.5075 (xKapton to vacuumZone)
170  G4double defaultVacuumZoneXPosition = -1855.5075 *mm;
171  vacuumZoneXPosition = defaultVacuumZoneXPosition;
172 
173 
174  // KAPTON WINDOW: it permits the passage of the beam from vacuum to air
175  G4double defaultKaptonWindowXSize = 0.025*mm;
176  kaptonWindowXSize = defaultKaptonWindowXSize;
177 
178  G4double defaultKaptonWindowYSize = 5.25*cm;
179  kaptonWindowYSize = defaultKaptonWindowYSize;
180 
181  G4double defaultKaptonWindowZSize = 5.25*cm;
182  kaptonWindowZSize = defaultKaptonWindowZSize;
183 
184  G4double defaultKaptonWindowXPosition = 80.5075*mm;
185  kaptonWindowXPosition = defaultKaptonWindowXPosition;
186 
187  // FIRST SCATTERING FOIL: a thin foil performing a first scattering
188  // of the original beam
189  G4double defaultFirstScatteringFoilXSize = 0.025 *mm;
190  firstScatteringFoilXSize = defaultFirstScatteringFoilXSize;
191 
192  G4double defaultFirstScatteringFoilYSize = 105.0 *mm;
193  firstScatteringFoilYSize = defaultFirstScatteringFoilYSize;
194 
195  G4double defaultFirstScatteringFoilZSize = 105 *mm;
196  firstScatteringFoilZSize = defaultFirstScatteringFoilZSize;
197 
198  G4double defaultFirstScatteringFoilXPosition = 0.0 *mm;
199  firstScatteringFoilXPosition = defaultFirstScatteringFoilXPosition;
200 
201 
202 
203  // STOPPER AND SCATTERING FOIL SIMULATED TO TEST THEIR EFFECT
204  // IN THE LATERAL DOSE DISTRIBUTION
205  // STOPPER: is a small cylinder able to stop the central component
206  // of the beam (having a gaussian shape). It is connected to the SECON SCATTERING FOIL
207  // and represent the second element of the scattering system
208  G4double defaultInnerRadiusStopper = 0.*cm;
209  innerRadiusStopper = defaultInnerRadiusStopper;
210 
211  G4double defaultHeightStopper = 7.0 *mm;
212  heightStopper = defaultHeightStopper;
213 
214  G4double defaultStartAngleStopper = 0.*deg;
215  startAngleStopper = defaultStartAngleStopper;
216 
217  G4double defaultSpanningAngleStopper = 360.*deg;
218  spanningAngleStopper = defaultSpanningAngleStopper;
219 
220  G4double defaultStopperXPosition = -1675.0 *mm;
221  stopperXPosition = defaultStopperXPosition;
222 
223  G4double defaultStopperYPosition = 0.*m;
224  stopperYPosition = defaultStopperYPosition;
225 
226  G4double defaultStopperZPosition = 0.*m;
227  stopperZPosition = defaultStopperZPosition;
228 
229  G4double defaultOuterRadiusStopper = 2 *mm;
230  outerRadiusStopper = defaultOuterRadiusStopper;
231 
232  // SECOND SCATTERING FOIL: it is another thin foil and provides the
233  // final diffusion of the beam. It represents the third element of the scattering
234  // system;
235  G4double defaultSecondScatteringFoilXSize = 0.025 *mm;
236  secondScatteringFoilXSize = defaultSecondScatteringFoilXSize;
237 
238  G4double defaultSecondScatteringFoilYSize = 105.0 *mm;
239  secondScatteringFoilYSize = defaultSecondScatteringFoilYSize;
240 
241  G4double defaultSecondScatteringFoilZSize = 105.0 *mm;
242  secondScatteringFoilZSize = defaultSecondScatteringFoilZSize;
243 
244  G4double defaultSecondScatteringFoilXPosition = defaultStopperXPosition + defaultHeightStopper + defaultSecondScatteringFoilXSize/2;
245  secondScatteringFoilXPosition = defaultSecondScatteringFoilXPosition;
246 
247  G4double defaultSecondScatteringFoilYPosition = 0 *mm;
248  secondScatteringFoilYPosition = defaultSecondScatteringFoilYPosition;
249 
250  G4double defaultSecondScatteringFoilZPosition = 0 *mm;
251  secondScatteringFoilZPosition = defaultSecondScatteringFoilZPosition;
252 
253 
254  // FINAL COLLIMATOR: is the collimator giving the final transversal shape
255  // of the beam
256  G4double defaultinnerRadiusFinalCollimator = 12.5 *mm;
257  innerRadiusFinalCollimator = defaultinnerRadiusFinalCollimator;
258 
259  // DEFAULT DEFINITION OF THE MATERIALS
260  // All elements and compound definition follows the NIST database
261 
262  // ELEMENTS
263  G4bool isotopes = false;
264  G4Material* aluminumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Al", isotopes);
265  G4Material* copperNistAsMaterial = G4NistManager::Instance()->FindOrBuildMaterial("G4_Cu", isotopes);
268  G4Material* tantalumNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Ta", isotopes);
269 
270  // COMPOUND
271  G4Material* airNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
272  G4Material* kaptonNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_KAPTON", isotopes);
273  G4Material* galacticNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic", isotopes);
274  G4Material* PMMANist = G4NistManager::Instance()->FindOrBuildMaterial("G4_PLEXIGLASS", isotopes);
275 
276  G4double d; // Density
277  G4int nComponents;// Number of components
278  G4double fractionmass; // Fraction in mass of an element in a material
279 
280  d = 8.40*g/cm3;
281  nComponents = 2;
282  G4Material* brass = new G4Material("Brass", d, nComponents);
283  brass -> AddElement(zincNist, fractionmass = 30 *perCent);
284  brass -> AddElement(copperNist, fractionmass = 70 *perCent);
285 
286 //***************************** PW ***************************************
287 
288 // DetectorROGeometry Material
289  new G4Material("dummyMat", 1., 1.*g/mole, 1.*g/cm3);
290 
291 //***************************** PW ***************************************
292 
293 
294  // MATERIAL ASSIGNMENT
295  // Support of the beam line
296  beamLineSupportMaterial = aluminumNist;
297 
298  // Vacuum pipe
299  vacuumZoneMaterial = galacticNist;
300 
301  // Material of the firt scattering foil
302  firstScatteringFoilMaterial = tantalumNist;
303 
304  // Material of kapton window
305  kaptonWindowMaterial = kaptonNist;
306 
307  // Material of the stopper
308  stopperMaterial = brass;
309 
310  // Material of the second scattering foil
311  secondScatteringFoilMaterial = tantalumNist;
312 
313  // Materials of the monitor chamber
314  layer1MonitorChamberMaterial = kaptonNist;
315  layer2MonitorChamberMaterial = copperNistAsMaterial;
317  layer4MonitorChamberMaterial = copperNistAsMaterial;
318 
319 
320  // material of the final nozzle
321  nozzleSupportMaterial = PMMANist;
324 
325  // Material of the final collimator
326  finalCollimatorMaterial = brass;
327 }
328 
331 {
332  // -----------------------------
333  // Treatment room - World volume
334  //------------------------------
335  // Treatment room sizes
336  const G4double worldX = 400.0 *cm;
337  const G4double worldY = 400.0 *cm;
338  const G4double worldZ = 400.0 *cm;
339  G4bool isotopes = false;
340 
341  G4Material* airNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
342  G4Box* treatmentRoom = new G4Box("TreatmentRoom",worldX,worldY,worldZ);
343  G4LogicalVolume* logicTreatmentRoom = new G4LogicalVolume(treatmentRoom,
344  airNist,
345  "logicTreatmentRoom",
346  0,0,0);
348  G4ThreeVector(),
349  "physicalTreatmentRoom",
350  logicTreatmentRoom,
351  0,false,0);
352 
353 
354  // The treatment room is invisible in the Visualisation
355  logicTreatmentRoom -> SetVisAttributes (G4VisAttributes::Invisible);
356 
357  // Components of the Passive Carbon Beam Line
364 }
365 
368 {
369  // ------------------//
370  // BEAM LINE SUPPORT //
371  //-------------------//
372  const G4double beamLineSupportXSize = 1.5*m;
373  const G4double beamLineSupportYSize = 20.*mm;
374  const G4double beamLineSupportZSize = 600.*mm;
375 
376  const G4double beamLineSupportXPosition = -1745.09 *mm;
377  const G4double beamLineSupportYPosition = -230. *mm;
378  const G4double beamLineSupportZPosition = 0.*mm;
379 
380  G4Box* beamLineSupport = new G4Box("BeamLineSupport",
381  beamLineSupportXSize,
382  beamLineSupportYSize,
383  beamLineSupportZSize);
384 
385  G4LogicalVolume* logicBeamLineSupport = new G4LogicalVolume(beamLineSupport,
387  "BeamLineSupport");
388  physiBeamLineSupport = new G4PVPlacement(0, G4ThreeVector(beamLineSupportXPosition,
389  beamLineSupportYPosition,
390  beamLineSupportZPosition),
391  "BeamLineSupport",
392  logicBeamLineSupport,
393  physicalTreatmentRoom, false, 0);
394 
395  // Visualisation attributes of the beam line support
396 
397  logicBeamLineSupport -> SetVisAttributes(gray);
398 
399  //---------------------------------//
400  // Beam line cover 1 (left panel) //
401  //---------------------------------//
402  const G4double beamLineCoverXSize = 1.5*m;
403  const G4double beamLineCoverYSize = 750.*mm;
404  const G4double beamLineCoverZSize = 10.*mm;
405 
406  const G4double beamLineCoverXPosition = -1745.09 *mm;
407  const G4double beamLineCoverYPosition = -1000.*mm;
408  const G4double beamLineCoverZPosition = 610.*mm;
409 
410  G4Box* beamLineCover = new G4Box("BeamLineCover",
411  beamLineCoverXSize,
412  beamLineCoverYSize,
413  beamLineCoverZSize);
414 
415  G4LogicalVolume* logicBeamLineCover = new G4LogicalVolume(beamLineCover,
417  "BeamLineCover");
418 
419  physiBeamLineCover = new G4PVPlacement(0, G4ThreeVector(beamLineCoverXPosition,
420  beamLineCoverYPosition,
421  beamLineCoverZPosition),
422  "BeamLineCover",
423  logicBeamLineCover,
425  false,
426  0);
427 
428  // ---------------------------------//
429  // Beam line cover 2 (rigth panel) //
430  // ---------------------------------//
431  // It has the same characteristic of beam line cover 1 but set in a different position
432  physiBeamLineCover2 = new G4PVPlacement(0, G4ThreeVector(beamLineCoverXPosition,
433  beamLineCoverYPosition,
434  - beamLineCoverZPosition),
435  "BeamLineCover2",
436  logicBeamLineCover,
438  false,
439  0);
440 
441 
442  logicBeamLineCover -> SetVisAttributes(blue);
443 }
444 
447 {
448  // ------------//
449  // VACUUM PIPE //
450  //-------------//
451  //
452  // First track of the beam line is inside vacuum;
453  // The PIPE contains the FIRST SCATTERING FOIL and the KAPTON WINDOW
454  G4Box* vacuumZone = new G4Box("VacuumZone",
458 
459  G4LogicalVolume* logicVacuumZone = new G4LogicalVolume(vacuumZone,
461  "VacuumZone");
462 
463  G4VPhysicalVolume* physiVacuumZone = new G4PVPlacement(0,
465  "VacuumZone",
466  logicVacuumZone,
468  false,
469  0);
470 
471 
472 
473 
474 
475  // --------------------------//
476  // THE FIRST SCATTERING FOIL //
477  // --------------------------//
478  // A thin foil performing a first scattering
479  // of the original beam
480 
481  firstScatteringFoil = new G4Box("FirstScatteringFoil",
485 
486  G4LogicalVolume* logicFirstScatteringFoil = new G4LogicalVolume(firstScatteringFoil,
488  "FirstScatteringFoil");
489 
492  "FirstScatteringFoil",
493  logicFirstScatteringFoil,
494  physiVacuumZone,
495  false, 0);
496 
497  logicFirstScatteringFoil -> SetVisAttributes(skyBlue);
498 
499 
500 
501  // -------------------//
502  // THE KAPTON WINDOWS //
503  //--------------------//
504  //It permits the passage of the beam from vacuum to air
505 
506  G4Box* solidKaptonWindow = new G4Box("KaptonWindow",
510 
511  G4LogicalVolume* logicKaptonWindow = new G4LogicalVolume(solidKaptonWindow,
513  "KaptonWindow");
514 
516  "KaptonWindow", logicKaptonWindow,
517  physiVacuumZone, false, 0);
518 
519  logicKaptonWindow -> SetVisAttributes(darkOrange3);
520 }
521 
524 {
525  // ------------//
526  // THE STOPPER //
527  //-------------//
528  // Is a small cylinder able to stop the central component
529  // of the beam (having a gaussian shape). It is connected to the SECON SCATTERING FOIL
530  // and represent the second element of the scattering system
531 
532  G4double phi = 90. *deg;
533  // Matrix definition for a 90 deg rotation with respect to Y axis
534  G4RotationMatrix rm;
535  rm.rotateY(phi);
536 
537  solidStopper = new G4Tubs("Stopper",
540  heightStopper/2,
543 
546  "Stopper",
547  0, 0, 0);
548 
552  "Stopper",
553  logicStopper,
555  false,
556  0);
557 
558  logicStopper -> SetVisAttributes(red);
559 
560  // ---------------------------//
561  // THE SECOND SCATTERING FOIL //
562  // ---------------------------//
563  // It is another thin foil and provides the
564  // final diffusion of the beam. It represents the third element of the scattering
565  // system;
566 
567  secondScatteringFoil = new G4Box("SecondScatteringFoil",
571 
572  G4LogicalVolume* logicSecondScatteringFoil = new G4LogicalVolume(secondScatteringFoil,
574  "SecondScatteringFoil");
575 
579  "SeconScatteringFoil",
580  logicSecondScatteringFoil,
582  false,
583  0);
584 
585  logicSecondScatteringFoil -> SetVisAttributes(skyBlue);
586 
587 }
588 
591 {
592  // ----------------------------
593  // THE FIRST MONITOR CHAMBER
594  // ----------------------------
595  // A monitor chamber is a free-air ionisation chamber
596  // able to measure do carbon fluence during the treatment.
597  // Here its responce is not simulated in terms of produced
598  // charge but only the energy losses are taked into account.
599  // Each chamber consist of 9 mm of air in a box
600  // that has two layers one of kapton and one
601  // of copper
602  const G4double monitor1XSize = 4.525022*mm;
603  const G4double monitor2XSize = 0.000011*mm;
604  const G4double monitor3XSize = 4.5*mm;
605  const G4double monitorYSize = 10.*cm;
606  const G4double monitorZSize = 10.*cm;
607  // XXX (Camera monitor size = 9.050088 mm)
608  const G4double monitor1XPosition = -1450.474956 *mm;
609  const G4double monitor2XPosition = -4.500011*mm;
610  const G4double monitor4XPosition = 4.500011*mm;
611 
612  G4Box* solidFirstMonitorLayer1 = new G4Box("FirstMonitorLayer1",
613  monitor1XSize,
614  monitorYSize,
615  monitorZSize);
616 
617  G4LogicalVolume* logicFirstMonitorLayer1 = new G4LogicalVolume(solidFirstMonitorLayer1,
619  "FirstMonitorLayer1");
620 
622  G4ThreeVector(monitor1XPosition,0.*cm,0.*cm),
623  "FirstMonitorLayer1",
624  logicFirstMonitorLayer1,
626  false,
627  0);
628 
629  G4Box* solidFirstMonitorLayer2 = new G4Box("FirstMonitorLayer2",
630  monitor2XSize,
631  monitorYSize,
632  monitorZSize);
633 
634  G4LogicalVolume* logicFirstMonitorLayer2 = new G4LogicalVolume(solidFirstMonitorLayer2,
636  "FirstMonitorLayer2");
637 
638  physiFirstMonitorLayer2 = new G4PVPlacement(0, G4ThreeVector(monitor2XPosition,0.*cm,0.*cm),
639  "FirstMonitorLayer2",
640  logicFirstMonitorLayer2,
642  false,
643  0);
644 
645  G4Box* solidFirstMonitorLayer3 = new G4Box("FirstMonitorLayer3",
646  monitor3XSize,
647  monitorYSize,
648  monitorZSize);
649 
650  G4LogicalVolume* logicFirstMonitorLayer3 = new G4LogicalVolume(solidFirstMonitorLayer3,
652  "FirstMonitorLayer3");
653 
655  G4ThreeVector(0.*mm,0.*cm,0.*cm),
656  "MonitorLayer3",
657  logicFirstMonitorLayer3,
659  false,
660  0);
661 
662  G4Box* solidFirstMonitorLayer4 = new G4Box("FirstMonitorLayer4",
663  monitor2XSize,
664  monitorYSize,
665  monitorZSize);
666 
667  G4LogicalVolume* logicFirstMonitorLayer4 = new G4LogicalVolume(solidFirstMonitorLayer4,
669  "FirstMonitorLayer4");
670 
671  physiFirstMonitorLayer4 = new G4PVPlacement(0, G4ThreeVector(monitor4XPosition,0.*cm,0.*cm),
672  "FirstMonitorLayer4",
673  logicFirstMonitorLayer4,
674  physiFirstMonitorLayer1, false, 0);
675 
676  logicFirstMonitorLayer3 -> SetVisAttributes(white);
677 
678 }
679 
683 {
684  // ------------------------------//
685  // THE FINAL TUBE AND COLLIMATOR //
686  //-------------------------------//
687  // The last part of the transport beam line consists of
688  // a 59 mm thick PMMA slab (to stop all the diffused radiation), a 285 mm brass tube
689  // (to well collimate the carbon beam) and a final collimator with 25 mm diameter
690  // aperture (that provide the final trasversal shape of the beam)
691 
692  // -------------------//
693  // PMMA SUPPORT //
694  // -------------------//
695 
696  const G4double nozzleSupportXSize = 29.5 *mm;
697  const G4double nozzleSupportYSize = 180. *mm;
698  const G4double nozzleSupportZSize = 180. *mm;
699  //XXX Placed at
700  const G4double nozzleSupportXPosition = -558. *mm;
701 
702  G4double phi = 90. *deg;
703  // Matrix definition for a 90 deg rotation. Also used for other volumes
704  G4RotationMatrix rm;
705  rm.rotateY(phi);
706 
707  G4Box* solidNozzleSupport = new G4Box("NozzleSupport",
708  nozzleSupportXSize,
709  nozzleSupportYSize,
710  nozzleSupportZSize);
711 
712  G4LogicalVolume* logicNozzleSupport = new G4LogicalVolume(solidNozzleSupport,
714  "NozzleSupport");
715 
716  physiNozzleSupport = new G4PVPlacement(0, G4ThreeVector(nozzleSupportXPosition,0., 0.),
717  "NozzleSupport",
718  logicNozzleSupport,
720  false,
721  0);
722 
723  logicNozzleSupport -> SetVisAttributes(yellow);
724  // -------------------//
725  // BRASS TUBE //
726  // -------------------//
727  const G4double innerRadiusHoleNozzleSupport = 18.*mm;
728  const G4double outerRadiusHoleNozzleSupport = 21.5 *mm;
729  //XXX h/2 = 142.5 mm
730  const G4double hightHoleNozzleSupportFirst = nozzleSupportXSize;
731  const G4double hightHoleNozzleSupport = 113.0*mm;
732  const G4double startAngleHoleNozzleSupport = 0.*deg;
733  const G4double spanningAngleHoleNozzleSupport = 360.*deg;
734  const G4double holeNozzleSupportXPosition = -415.5 *mm;
735  G4Tubs* solidNozzleSupportHole = new G4Tubs("NozzleSupportHole1", innerRadiusHoleNozzleSupport,
736  outerRadiusHoleNozzleSupport,
737  hightHoleNozzleSupportFirst,
738  startAngleHoleNozzleSupport,
739  spanningAngleHoleNozzleSupport);
740 
741  G4LogicalVolume* logicNozzleSupportHole = new G4LogicalVolume(solidNozzleSupportHole,
743  "NozzleSupportHole1");
744 
746  "HoleNozzleSupportHole1",
747  logicNozzleSupportHole,
748  physiNozzleSupport, false, 0);
749 
750  G4Tubs* solidHoleNozzleSupport = new G4Tubs("HoleNozzleSupport",
751  innerRadiusHoleNozzleSupport,
752  outerRadiusHoleNozzleSupport,
753  hightHoleNozzleSupport,
754  startAngleHoleNozzleSupport,
755  spanningAngleHoleNozzleSupport);
756 
757  G4LogicalVolume* logicHoleNozzleSupport = new G4LogicalVolume(solidHoleNozzleSupport,
759  "HoleNozzleSupport",
760  0, 0, 0);
761 
762  physiHoleNozzleSupport = new G4PVPlacement(G4Transform3D(rm, G4ThreeVector(holeNozzleSupportXPosition, 0., 0.)),
763  "HoleNozzleSupport",
764  logicHoleNozzleSupport,
765  physicalTreatmentRoom, false, 0);
766  logicNozzleSupportHole -> SetVisAttributes(darkOrange3);
767  logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
768 
769  //--------------------------------------------------------------//
770  // HOLE OF THE BRASS TUBE (otherwise we'll have PMMA) //
771  //--------------------------------------------------------------//
772  const G4double innerRadiusSecondHoleNozzleSupport = 0.*mm;
773  const G4double outerRadiusSecondHoleNozzleSupport = 18.*mm;
774  const G4double hightSecondHoleNozzleSupport = 29.5 *mm;
775  const G4double startAngleSecondHoleNozzleSupport = 0.*deg;
776  const G4double spanningAngleSecondHoleNozzleSupport = 360.*deg;
777 
778  G4Tubs* solidSecondHoleNozzleSupport = new G4Tubs("SecondHoleNozzleSupport",
779  innerRadiusSecondHoleNozzleSupport,
780  outerRadiusSecondHoleNozzleSupport,
781  hightSecondHoleNozzleSupport,
782  startAngleSecondHoleNozzleSupport,
783  spanningAngleSecondHoleNozzleSupport);
784 
785  G4LogicalVolume* logicSecondHoleNozzleSupport = new G4LogicalVolume(solidSecondHoleNozzleSupport,
787  "SecondHoleNozzleSupport",
788  0,
789  0,
790  0);
791 
793  "SecondHoleNozzleSupport",
794  logicSecondHoleNozzleSupport,
796  false, 0);
797 
798 
799  logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
800 }
801 
804 {
805  // -----------------------//
806  // FINAL COLLIMATOR //
807  //------------------------//
808  const G4double outerRadiusFinalCollimator = 21.5*mm;
809  const G4double hightFinalCollimator = 3.5*mm;
810  const G4double startAngleFinalCollimator = 0.*deg;
811  const G4double spanningAngleFinalCollimator = 360.*deg;
812  //XXX
813  const G4double finalCollimatorXPosition = -299.0 *mm;
814 
815  G4double phi = 90. *deg;
816 
817  // Matrix definition for a 90 deg rotation. Also used for other volumes
818  G4RotationMatrix rm;
819  rm.rotateY(phi);
820 
821  solidFinalCollimator = new G4Tubs("FinalCollimator",
823  outerRadiusFinalCollimator,
824  hightFinalCollimator,
825  startAngleFinalCollimator,
826  spanningAngleFinalCollimator);
827 
828  G4LogicalVolume* logicFinalCollimator = new G4LogicalVolume(solidFinalCollimator,
830  "FinalCollimator",
831  0,
832  0,
833  0);
834 
835  physiFinalCollimator = new G4PVPlacement(G4Transform3D(rm, G4ThreeVector(finalCollimatorXPosition,0.,0.)),
836  "FinalCollimator", logicFinalCollimator, physicalTreatmentRoom, false, 0);
837 
838  logicFinalCollimator -> SetVisAttributes(yellow);
839 }
840 
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
G4VPhysicalVolume * physiNozzleSupportHole
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