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