67 physicalTreatmentRoom(0), hadrontherapyDetectorConstruction(0),
68 physiBeamLineSupport(0), physiBeamLineCover(0), physiBeamLineCover2(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)
82 static G4String ROGeometryName =
"DetectorROGeometry";
87 G4cout <<
"Going to register Parallel world...";
100 delete hadrontherapyDetectorConstruction;
107 SetDefaultDimensions();
110 ConstructPassiveCarbonBeamLine();
114 if (!hadrontherapyDetectorConstruction)
128 return physicalTreatmentRoom;
141 void PassiveCarbonBeamLine::SetDefaultDimensions()
145 white -> SetVisibility(
true);
146 white -> SetForceSolid(
true);
149 blue -> SetVisibility(
true);
150 blue -> SetForceSolid(
true);
153 gray-> SetVisibility(
true);
154 gray-> SetForceSolid(
true);
157 red-> SetVisibility(
true);
158 red-> SetForceSolid(
true);
161 yellow-> SetVisibility(
true);
162 yellow-> SetForceSolid(
true);
165 green -> SetVisibility(
true);
166 green -> SetForceSolid(
true);
169 darkGreen -> SetVisibility(
true);
170 darkGreen -> SetForceSolid(
true);
173 darkOrange3 -> SetVisibility(
true);
174 darkOrange3 -> SetForceSolid(
true);
177 skyBlue -> SetVisibility(
true);
178 skyBlue -> SetForceSolid(
true);
183 G4double defaultVacuumZoneXSize = 80.5325 *
mm;
184 vacuumZoneXSize = defaultVacuumZoneXSize;
187 vacuumZoneYSize = defaultVacuumZoneYSize;
190 vacuumZoneZSize = defaultVacuumZoneZSize;
193 G4double defaultVacuumZoneXPosition = -1855.5075 *
mm;
194 vacuumZoneXPosition = defaultVacuumZoneXPosition;
199 kaptonWindowXSize = defaultKaptonWindowXSize;
202 kaptonWindowYSize = defaultKaptonWindowYSize;
205 kaptonWindowZSize = defaultKaptonWindowZSize;
207 G4double defaultKaptonWindowXPosition = 80.5075*
mm;
208 kaptonWindowXPosition = defaultKaptonWindowXPosition;
212 G4double defaultFirstScatteringFoilXSize = 0.025 *
mm;
213 firstScatteringFoilXSize = defaultFirstScatteringFoilXSize;
215 G4double defaultFirstScatteringFoilYSize = 105.0 *
mm;
216 firstScatteringFoilYSize = defaultFirstScatteringFoilYSize;
218 G4double defaultFirstScatteringFoilZSize = 105 *
mm;
219 firstScatteringFoilZSize = defaultFirstScatteringFoilZSize;
221 G4double defaultFirstScatteringFoilXPosition = 0.0 *
mm;
232 innerRadiusStopper = defaultInnerRadiusStopper;
235 heightStopper = defaultHeightStopper;
238 startAngleStopper = defaultStartAngleStopper;
241 spanningAngleStopper = defaultSpanningAngleStopper;
243 G4double defaultStopperXPosition = -1675.0 *
mm;
244 stopperXPosition = defaultStopperXPosition;
247 stopperYPosition = defaultStopperYPosition;
250 stopperZPosition = defaultStopperZPosition;
253 outerRadiusStopper = defaultOuterRadiusStopper;
258 G4double defaultSecondScatteringFoilXSize = 0.025 *
mm;
259 secondScatteringFoilXSize = defaultSecondScatteringFoilXSize;
261 G4double defaultSecondScatteringFoilYSize = 105.0 *
mm;
262 secondScatteringFoilYSize = defaultSecondScatteringFoilYSize;
264 G4double defaultSecondScatteringFoilZSize = 105.0 *
mm;
265 secondScatteringFoilZSize = defaultSecondScatteringFoilZSize;
267 G4double defaultSecondScatteringFoilXPosition = defaultStopperXPosition + defaultHeightStopper + defaultSecondScatteringFoilXSize/2;
268 secondScatteringFoilXPosition = defaultSecondScatteringFoilXPosition;
270 G4double defaultSecondScatteringFoilYPosition = 0 *
mm;
271 secondScatteringFoilYPosition = defaultSecondScatteringFoilYPosition;
273 G4double defaultSecondScatteringFoilZPosition = 0 *
mm;
274 secondScatteringFoilZPosition = defaultSecondScatteringFoilZPosition;
279 G4double defaultinnerRadiusFinalCollimator = 12.5 *
mm;
280 innerRadiusFinalCollimator = defaultinnerRadiusFinalCollimator;
319 beamLineSupportMaterial = aluminumNist;
322 vacuumZoneMaterial = galacticNist;
325 firstScatteringFoilMaterial = tantalumNist;
328 kaptonWindowMaterial = kaptonNist;
331 stopperMaterial = brass;
334 secondScatteringFoilMaterial = tantalumNist;
337 layer1MonitorChamberMaterial = kaptonNist;
338 layer2MonitorChamberMaterial = copperNistAsMaterial;
339 layer3MonitorChamberMaterial = airNist;
340 layer4MonitorChamberMaterial = copperNistAsMaterial;
344 nozzleSupportMaterial = PMMANist;
345 holeNozzleSupportMaterial = brass;
346 seconHoleNozzleSupportMaterial = airNist;
349 finalCollimatorMaterial = brass;
353 void PassiveCarbonBeamLine::ConstructPassiveCarbonBeamLine()
365 G4Box* treatmentRoom =
new G4Box(
"TreatmentRoom",worldX,worldY,worldZ);
368 "logicTreatmentRoom",
372 "physicalTreatmentRoom",
395 const G4double beamLineSupportXSize = 1.5*
m;
397 const G4double beamLineSupportZSize = 600.*
mm;
399 const G4double beamLineSupportXPosition = -1745.09 *
mm;
400 const G4double beamLineSupportYPosition = -230. *
mm;
401 const G4double beamLineSupportZPosition = 0.*
mm;
403 G4Box* beamLineSupport =
new G4Box(
"BeamLineSupport",
404 beamLineSupportXSize,
405 beamLineSupportYSize,
406 beamLineSupportZSize);
409 beamLineSupportMaterial,
412 beamLineSupportYPosition,
413 beamLineSupportZPosition),
415 logicBeamLineSupport,
416 physicalTreatmentRoom,
false, 0);
420 logicBeamLineSupport -> SetVisAttributes(gray);
425 const G4double beamLineCoverXSize = 1.5*
m;
429 const G4double beamLineCoverXPosition = -1745.09 *
mm;
430 const G4double beamLineCoverYPosition = -980.*
mm;
431 const G4double beamLineCoverZPosition = 600.*
mm;
433 G4Box* beamLineCover =
new G4Box(
"BeamLineCover",
439 beamLineSupportMaterial,
443 beamLineCoverYPosition,
444 beamLineCoverZPosition),
447 physicalTreatmentRoom,
456 beamLineCoverYPosition,
457 - beamLineCoverZPosition),
460 physicalTreatmentRoom,
465 logicBeamLineCover -> SetVisAttributes(blue);
490 physicalTreatmentRoom,
504 firstScatteringFoil =
new G4Box(
"FirstScatteringFoil",
505 firstScatteringFoilXSize/2,
506 firstScatteringFoilYSize/2,
507 firstScatteringFoilZSize/2);
510 firstScatteringFoilMaterial,
511 "FirstScatteringFoil");
515 "FirstScatteringFoil",
516 logicFirstScatteringFoil,
520 logicFirstScatteringFoil -> SetVisAttributes(skyBlue);
529 G4Box* solidKaptonWindow =
new G4Box(
"KaptonWindow",
535 kaptonWindowMaterial,
539 "KaptonWindow", logicKaptonWindow,
540 physiVacuumZone,
false, 0);
542 logicKaptonWindow -> SetVisAttributes(darkOrange3);
560 solidStopper =
new G4Tubs(
"Stopper",
565 spanningAngleStopper);
577 physicalTreatmentRoom,
581 logicStopper -> SetVisAttributes(red);
590 secondScatteringFoil =
new G4Box(
"SecondScatteringFoil",
591 secondScatteringFoilXSize/2,
592 secondScatteringFoilYSize/2,
593 secondScatteringFoilZSize/2);
596 secondScatteringFoilMaterial,
597 "SecondScatteringFoil");
600 secondScatteringFoilYPosition,
601 secondScatteringFoilZPosition),
602 "SeconScatteringFoil",
603 logicSecondScatteringFoil,
604 physicalTreatmentRoom,
608 logicSecondScatteringFoil -> SetVisAttributes(skyBlue);
631 const G4double monitor1XPosition = -1450.474956 *
mm;
632 const G4double monitor2XPosition = -4.500011*
mm;
633 const G4double monitor4XPosition = 4.500011*
mm;
635 G4Box* solidFirstMonitorLayer1 =
new G4Box(
"FirstMonitorLayer1",
641 layer1MonitorChamberMaterial,
642 "FirstMonitorLayer1");
646 "FirstMonitorLayer1",
647 logicFirstMonitorLayer1,
648 physicalTreatmentRoom,
652 G4Box* solidFirstMonitorLayer2 =
new G4Box(
"FirstMonitorLayer2",
658 layer2MonitorChamberMaterial,
659 "FirstMonitorLayer2");
662 "FirstMonitorLayer2",
663 logicFirstMonitorLayer2,
664 physiFirstMonitorLayer1,
668 G4Box* solidFirstMonitorLayer3 =
new G4Box(
"FirstMonitorLayer3",
674 layer3MonitorChamberMaterial,
675 "FirstMonitorLayer3");
680 logicFirstMonitorLayer3,
681 physiFirstMonitorLayer1,
685 G4Box* solidFirstMonitorLayer4 =
new G4Box(
"FirstMonitorLayer4",
691 layer4MonitorChamberMaterial,
692 "FirstMonitorLayer4");
695 "FirstMonitorLayer4",
696 logicFirstMonitorLayer4,
697 physiFirstMonitorLayer1,
false, 0);
699 logicFirstMonitorLayer3 -> SetVisAttributes(white);
723 const G4double nozzleSupportXPosition = -558. *
mm;
730 G4Box* solidNozzleSupport =
new G4Box(
"NozzleSupport",
736 nozzleSupportMaterial,
742 physicalTreatmentRoom,
746 logicNozzleSupport -> SetVisAttributes(yellow);
751 const G4double innerRadiusHoleNozzleSupport = 18.*
mm;
752 const G4double outerRadiusHoleNozzleSupport = 21.5 *
mm;
754 const G4double hightHoleNozzleSupport = 142.5*
mm;
755 const G4double startAngleHoleNozzleSupport = 0.*
deg;
756 const G4double spanningAngleHoleNozzleSupport = 360.*
deg;
758 const G4double holeNozzleSupportXPosition = -462.50 *
mm;
760 G4Tubs* solidHoleNozzleSupport =
new G4Tubs(
"HoleNozzleSupport",
761 innerRadiusHoleNozzleSupport,
762 outerRadiusHoleNozzleSupport,
763 hightHoleNozzleSupport,
764 startAngleHoleNozzleSupport,
765 spanningAngleHoleNozzleSupport);
768 holeNozzleSupportMaterial,
774 logicHoleNozzleSupport,
775 physicalTreatmentRoom,
false, 0);
777 logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
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;
788 G4Tubs* solidSecondHoleNozzleSupport =
new G4Tubs(
"SecondHoleNozzleSupport",
789 innerRadiusSecondHoleNozzleSupport,
790 outerRadiusSecondHoleNozzleSupport,
791 hightSecondHoleNozzleSupport,
792 startAngleSecondHoleNozzleSupport,
793 spanningAngleSecondHoleNozzleSupport);
796 seconHoleNozzleSupportMaterial,
797 "SecondHoleNozzleSupport",
803 "SecondHoleNozzleSupport",
804 logicSecondHoleNozzleSupport,
809 logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
818 const G4double outerRadiusFinalCollimator = 21.5*
mm;
821 const G4double spanningAngleFinalCollimator = 360.*
deg;
823 const G4double finalCollimatorXPosition = -323.50 *
mm;
831 solidFinalCollimator =
new G4Tubs(
"FinalCollimator",
832 innerRadiusFinalCollimator,
833 outerRadiusFinalCollimator,
834 hightFinalCollimator,
835 startAngleFinalCollimator,
836 spanningAngleFinalCollimator);
839 finalCollimatorMaterial,
846 "FinalCollimator", logicFinalCollimator, physicalTreatmentRoom,
false, 0);
848 logicFinalCollimator -> SetVisAttributes(yellow);
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
CLHEP::Hep3Vector G4ThreeVector
G4VPhysicalVolume * Construct()
HepRotation & rotateY(double delta)
void HadrontherapyBeamLineSupport()
static G4NistManager * Instance()
void HadrontherapyBeamNozzle()
void RegisterParallelWorld(G4VUserParallelWorld *)
G4GLOB_DLL std::ostream G4cout
void HadrontherapyBeamFinalCollimator()
void HadrontherapyBeamMonitoring()
static const G4VisAttributes Invisible
void VacuumToAirInterface()
void InitializeDetectorROGeometry(HadrontherapyDetectorROGeometry *, G4ThreeVector detectorToWorldPosition)
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
G4ThreeVector GetDetectorToWorldPosition()
G4double firstScatteringFoilXPosition