49 physicalTreatmentRoom(0), hadrontherapyDetectorConstruction(0),
50 physiBeamLineSupport(0), physiBeamLineCover(0), physiBeamLineCover2(0),
52 physiFirstMonitorLayer1(0), physiFirstMonitorLayer2(0),
53 physiFirstMonitorLayer3(0), physiFirstMonitorLayer4(0),
54 physiNozzleSupport(0), physiHoleNozzleSupport(0),
55 physiSecondHoleNozzleSupport(0),
56 solidFinalCollimator(0),
57 physiFinalCollimator(0)
62 static G4String ROGeometryName =
"DetectorROGeometry";
67 G4cout <<
"Going to register Parallel world...";
76 delete hadrontherapyDetectorConstruction;
83 SetDefaultDimensions();
86 ConstructPassiveCarbonBeamLine();
90 if (!hadrontherapyDetectorConstruction)
102 return physicalTreatmentRoom;
115 void PassiveCarbonBeamLine::SetDefaultDimensions()
119 white -> SetVisibility(
true);
120 white -> SetForceSolid(
true);
123 blue -> SetVisibility(
true);
124 blue -> SetForceSolid(
true);
127 gray-> SetVisibility(
true);
128 gray-> SetForceSolid(
true);
131 red-> SetVisibility(
true);
132 red-> SetForceSolid(
true);
135 yellow-> SetVisibility(
true);
136 yellow-> SetForceSolid(
true);
139 green -> SetVisibility(
true);
140 green -> SetForceSolid(
true);
143 darkGreen -> SetVisibility(
true);
144 darkGreen -> SetForceSolid(
true);
147 darkOrange3 -> SetVisibility(
true);
148 darkOrange3 -> SetForceSolid(
true);
151 skyBlue -> SetVisibility(
true);
152 skyBlue -> SetForceSolid(
true);
157 G4double defaultVacuumZoneXSize = 80.5325 *
mm;
158 vacuumZoneXSize = defaultVacuumZoneXSize;
161 vacuumZoneYSize = defaultVacuumZoneYSize;
164 vacuumZoneZSize = defaultVacuumZoneZSize;
167 G4double defaultVacuumZoneXPosition = -1855.5075 *
mm;
168 vacuumZoneXPosition = defaultVacuumZoneXPosition;
173 kaptonWindowXSize = defaultKaptonWindowXSize;
176 kaptonWindowYSize = defaultKaptonWindowYSize;
179 kaptonWindowZSize = defaultKaptonWindowZSize;
181 G4double defaultKaptonWindowXPosition = 80.5075*
mm;
182 kaptonWindowXPosition = defaultKaptonWindowXPosition;
186 G4double defaultFirstScatteringFoilXSize = 0.025 *
mm;
187 firstScatteringFoilXSize = defaultFirstScatteringFoilXSize;
189 G4double defaultFirstScatteringFoilYSize = 105.0 *
mm;
190 firstScatteringFoilYSize = defaultFirstScatteringFoilYSize;
192 G4double defaultFirstScatteringFoilZSize = 105 *
mm;
193 firstScatteringFoilZSize = defaultFirstScatteringFoilZSize;
195 G4double defaultFirstScatteringFoilXPosition = 0.0 *
mm;
206 innerRadiusStopper = defaultInnerRadiusStopper;
209 heightStopper = defaultHeightStopper;
212 startAngleStopper = defaultStartAngleStopper;
215 spanningAngleStopper = defaultSpanningAngleStopper;
217 G4double defaultStopperXPosition = -1675.0 *
mm;
218 stopperXPosition = defaultStopperXPosition;
221 stopperYPosition = defaultStopperYPosition;
224 stopperZPosition = defaultStopperZPosition;
227 outerRadiusStopper = defaultOuterRadiusStopper;
232 G4double defaultSecondScatteringFoilXSize = 0.025 *
mm;
233 secondScatteringFoilXSize = defaultSecondScatteringFoilXSize;
235 G4double defaultSecondScatteringFoilYSize = 105.0 *
mm;
236 secondScatteringFoilYSize = defaultSecondScatteringFoilYSize;
238 G4double defaultSecondScatteringFoilZSize = 105.0 *
mm;
239 secondScatteringFoilZSize = defaultSecondScatteringFoilZSize;
241 G4double defaultSecondScatteringFoilXPosition = defaultStopperXPosition + defaultHeightStopper + defaultSecondScatteringFoilXSize/2;
242 secondScatteringFoilXPosition = defaultSecondScatteringFoilXPosition;
244 G4double defaultSecondScatteringFoilYPosition = 0 *
mm;
245 secondScatteringFoilYPosition = defaultSecondScatteringFoilYPosition;
247 G4double defaultSecondScatteringFoilZPosition = 0 *
mm;
248 secondScatteringFoilZPosition = defaultSecondScatteringFoilZPosition;
253 G4double defaultinnerRadiusFinalCollimator = 12.5 *
mm;
254 innerRadiusFinalCollimator = defaultinnerRadiusFinalCollimator;
280 brass -> AddElement(zincNist, fractionmass = 30 *
perCent);
281 brass -> AddElement(copperNist, fractionmass = 70 *
perCent);
293 beamLineSupportMaterial = aluminumNist;
296 vacuumZoneMaterial = galacticNist;
299 firstScatteringFoilMaterial = tantalumNist;
302 kaptonWindowMaterial = kaptonNist;
305 stopperMaterial = brass;
308 secondScatteringFoilMaterial = tantalumNist;
311 layer1MonitorChamberMaterial = kaptonNist;
312 layer2MonitorChamberMaterial = copperNistAsMaterial;
313 layer3MonitorChamberMaterial = airNist;
314 layer4MonitorChamberMaterial = copperNistAsMaterial;
318 nozzleSupportMaterial = PMMANist;
319 holeNozzleSupportMaterial = brass;
320 seconHoleNozzleSupportMaterial = airNist;
323 finalCollimatorMaterial = brass;
327 void PassiveCarbonBeamLine::ConstructPassiveCarbonBeamLine()
339 G4Box* treatmentRoom =
new G4Box(
"TreatmentRoom",worldX,worldY,worldZ);
342 "logicTreatmentRoom",
346 "physicalTreatmentRoom",
369 const G4double beamLineSupportXSize = 1.5*
m;
371 const G4double beamLineSupportZSize = 600.*
mm;
373 const G4double beamLineSupportXPosition = -1745.09 *
mm;
374 const G4double beamLineSupportYPosition = -230. *
mm;
375 const G4double beamLineSupportZPosition = 0.*
mm;
377 G4Box* beamLineSupport =
new G4Box(
"BeamLineSupport",
378 beamLineSupportXSize,
379 beamLineSupportYSize,
380 beamLineSupportZSize);
383 beamLineSupportMaterial,
386 beamLineSupportYPosition,
387 beamLineSupportZPosition),
389 logicBeamLineSupport,
390 physicalTreatmentRoom,
false, 0);
394 logicBeamLineSupport -> SetVisAttributes(gray);
399 const G4double beamLineCoverXSize = 1.5*
m;
403 const G4double beamLineCoverXPosition = -1745.09 *
mm;
404 const G4double beamLineCoverYPosition = -1000.*
mm;
405 const G4double beamLineCoverZPosition = 610.*
mm;
407 G4Box* beamLineCover =
new G4Box(
"BeamLineCover",
413 beamLineSupportMaterial,
417 beamLineCoverYPosition,
418 beamLineCoverZPosition),
421 physicalTreatmentRoom,
430 beamLineCoverYPosition,
431 - beamLineCoverZPosition),
434 physicalTreatmentRoom,
439 logicBeamLineCover -> SetVisAttributes(blue);
464 physicalTreatmentRoom,
478 firstScatteringFoil =
new G4Box(
"FirstScatteringFoil",
479 firstScatteringFoilXSize/2,
480 firstScatteringFoilYSize/2,
481 firstScatteringFoilZSize/2);
484 firstScatteringFoilMaterial,
485 "FirstScatteringFoil");
489 "FirstScatteringFoil",
490 logicFirstScatteringFoil,
494 logicFirstScatteringFoil -> SetVisAttributes(skyBlue);
503 G4Box* solidKaptonWindow =
new G4Box(
"KaptonWindow",
509 kaptonWindowMaterial,
513 "KaptonWindow", logicKaptonWindow,
514 physiVacuumZone,
false, 0);
516 logicKaptonWindow -> SetVisAttributes(darkOrange3);
534 solidStopper =
new G4Tubs(
"Stopper",
539 spanningAngleStopper);
551 physicalTreatmentRoom,
555 logicStopper -> SetVisAttributes(red);
564 secondScatteringFoil =
new G4Box(
"SecondScatteringFoil",
565 secondScatteringFoilXSize/2,
566 secondScatteringFoilYSize/2,
567 secondScatteringFoilZSize/2);
570 secondScatteringFoilMaterial,
571 "SecondScatteringFoil");
574 secondScatteringFoilYPosition,
575 secondScatteringFoilZPosition),
576 "SeconScatteringFoil",
577 logicSecondScatteringFoil,
578 physicalTreatmentRoom,
582 logicSecondScatteringFoil -> SetVisAttributes(skyBlue);
605 const G4double monitor1XPosition = -1450.474956 *
mm;
606 const G4double monitor2XPosition = -4.500011*
mm;
607 const G4double monitor4XPosition = 4.500011*
mm;
609 G4Box* solidFirstMonitorLayer1 =
new G4Box(
"FirstMonitorLayer1",
615 layer1MonitorChamberMaterial,
616 "FirstMonitorLayer1");
620 "FirstMonitorLayer1",
621 logicFirstMonitorLayer1,
622 physicalTreatmentRoom,
626 G4Box* solidFirstMonitorLayer2 =
new G4Box(
"FirstMonitorLayer2",
632 layer2MonitorChamberMaterial,
633 "FirstMonitorLayer2");
636 "FirstMonitorLayer2",
637 logicFirstMonitorLayer2,
638 physiFirstMonitorLayer1,
642 G4Box* solidFirstMonitorLayer3 =
new G4Box(
"FirstMonitorLayer3",
648 layer3MonitorChamberMaterial,
649 "FirstMonitorLayer3");
654 logicFirstMonitorLayer3,
655 physiFirstMonitorLayer1,
659 G4Box* solidFirstMonitorLayer4 =
new G4Box(
"FirstMonitorLayer4",
665 layer4MonitorChamberMaterial,
666 "FirstMonitorLayer4");
669 "FirstMonitorLayer4",
670 logicFirstMonitorLayer4,
671 physiFirstMonitorLayer1,
false, 0);
673 logicFirstMonitorLayer3 -> SetVisAttributes(white);
697 const G4double nozzleSupportXPosition = -558. *
mm;
704 G4Box* solidNozzleSupport =
new G4Box(
"NozzleSupport",
710 nozzleSupportMaterial,
716 physicalTreatmentRoom,
720 logicNozzleSupport -> SetVisAttributes(yellow);
724 const G4double innerRadiusHoleNozzleSupport = 18.*
mm;
725 const G4double outerRadiusHoleNozzleSupport = 21.5 *
mm;
727 const G4double hightHoleNozzleSupportFirst = nozzleSupportXSize;
728 const G4double hightHoleNozzleSupport = 113.0*
mm;
729 const G4double startAngleHoleNozzleSupport = 0.*
deg;
730 const G4double spanningAngleHoleNozzleSupport = 360.*
deg;
731 const G4double holeNozzleSupportXPosition = -415.5 *
mm;
732 G4Tubs* solidNozzleSupportHole =
new G4Tubs(
"NozzleSupportHole1", innerRadiusHoleNozzleSupport,
733 outerRadiusHoleNozzleSupport,
734 hightHoleNozzleSupportFirst,
735 startAngleHoleNozzleSupport,
736 spanningAngleHoleNozzleSupport);
739 holeNozzleSupportMaterial,
740 "NozzleSupportHole1");
743 "HoleNozzleSupportHole1",
744 logicNozzleSupportHole,
745 physiNozzleSupport,
false, 0);
747 G4Tubs* solidHoleNozzleSupport =
new G4Tubs(
"HoleNozzleSupport",
748 innerRadiusHoleNozzleSupport,
749 outerRadiusHoleNozzleSupport,
750 hightHoleNozzleSupport,
751 startAngleHoleNozzleSupport,
752 spanningAngleHoleNozzleSupport);
755 holeNozzleSupportMaterial,
761 logicHoleNozzleSupport,
762 physicalTreatmentRoom,
false, 0);
763 logicNozzleSupportHole -> SetVisAttributes(darkOrange3);
764 logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
769 const G4double innerRadiusSecondHoleNozzleSupport = 0.*
mm;
770 const G4double outerRadiusSecondHoleNozzleSupport = 18.*
mm;
771 const G4double hightSecondHoleNozzleSupport = 29.5 *
mm;
772 const G4double startAngleSecondHoleNozzleSupport = 0.*
deg;
773 const G4double spanningAngleSecondHoleNozzleSupport = 360.*
deg;
775 G4Tubs* solidSecondHoleNozzleSupport =
new G4Tubs(
"SecondHoleNozzleSupport",
776 innerRadiusSecondHoleNozzleSupport,
777 outerRadiusSecondHoleNozzleSupport,
778 hightSecondHoleNozzleSupport,
779 startAngleSecondHoleNozzleSupport,
780 spanningAngleSecondHoleNozzleSupport);
783 seconHoleNozzleSupportMaterial,
784 "SecondHoleNozzleSupport",
790 "SecondHoleNozzleSupport",
791 logicSecondHoleNozzleSupport,
796 logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
805 const G4double outerRadiusFinalCollimator = 21.5*
mm;
808 const G4double spanningAngleFinalCollimator = 360.*
deg;
810 const G4double finalCollimatorXPosition = -299.0 *
mm;
818 solidFinalCollimator =
new G4Tubs(
"FinalCollimator",
819 innerRadiusFinalCollimator,
820 outerRadiusFinalCollimator,
821 hightFinalCollimator,
822 startAngleFinalCollimator,
823 spanningAngleFinalCollimator);
826 finalCollimatorMaterial,
833 "FinalCollimator", logicFinalCollimator, physicalTreatmentRoom,
false, 0);
835 logicFinalCollimator -> SetVisAttributes(yellow);
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static constexpr double mm
CLHEP::Hep3Vector G4ThreeVector
static constexpr double perCent
G4VPhysicalVolume * Construct()
HepRotation & rotateY(double delta)
void HadrontherapyBeamLineSupport()
static G4NistManager * Instance()
void HadrontherapyBeamNozzle()
void RegisterParallelWorld(G4VUserParallelWorld *)
G4GLOB_DLL std::ostream G4cout
static constexpr double m
static constexpr double cm
void HadrontherapyBeamFinalCollimator()
static constexpr double cm3
void HadrontherapyBeamMonitoring()
static const G4VisAttributes Invisible
void VacuumToAirInterface()
void InitializeDetectorROGeometry(HadrontherapyDetectorROGeometry *, G4ThreeVector detectorToWorldPosition)
static constexpr double deg
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
G4ThreeVector GetDetectorToWorldPosition()
static constexpr double mole
G4double firstScatteringFoilXPosition