50 modulator(0), physicalTreatmentRoom(0),hadrontherapyDetectorConstruction(0),
51 physiBeamLineSupport(0), physiBeamLineCover(0), physiBeamLineCover2(0),
52 firstScatteringFoil(0), physiFirstScatteringFoil(0), physiKaptonWindow(0),
53 solidStopper(0), physiStopper(0), secondScatteringFoil(0), physiSecondScatteringFoil(0),
54 physiFirstCollimator(0), solidRangeShifterBox(0), logicRangeShifterBox(0),
55 physiRangeShifterBox(0), physiSecondCollimator(0), physiFirstCollimatorModulatorBox(0),
56 physiHoleFirstCollimatorModulatorBox(0), physiSecondCollimatorModulatorBox(0),
57 physiHoleSecondCollimatorModulatorBox(0), physiMOPIMotherVolume(0),
58 physiFirstMonitorLayer1(0), physiFirstMonitorLayer2(0), physiFirstMonitorLayer3(0),
59 physiFirstMonitorLayer4(0), physiSecondMonitorLayer1(0), physiSecondMonitorLayer2(0),
60 physiSecondMonitorLayer3(0), physiSecondMonitorLayer4(0), physiNozzleSupport(0),
61 physiBrassTube(0), solidFinalCollimator(0), physiFinalCollimator(0)
67 static G4String ROGeometryName =
"DetectorROGeometry";
70 G4cout <<
"Going to register Parallel world...";
83 delete passiveMessenger;
84 delete hadrontherapyDetectorConstruction;
95 SetDefaultDimensions();
98 ConstructPassiveProtonBeamLine();
101 if (!hadrontherapyDetectorConstruction)
119 return physicalTreatmentRoom;
132 void PassiveProtonBeamLine::SetDefaultDimensions()
136 white -> SetVisibility(
true);
137 white -> SetForceSolid(
true);
140 blue -> SetVisibility(
true);
141 blue -> SetForceSolid(
true);
144 gray-> SetVisibility(
true);
145 gray-> SetForceSolid(
true);
148 red-> SetVisibility(
true);
149 red-> SetForceSolid(
true);
152 yellow-> SetVisibility(
true);
153 yellow-> SetForceSolid(
true);
156 green -> SetVisibility(
true);
157 green -> SetForceSolid(
true);
160 darkGreen -> SetVisibility(
true);
161 darkGreen -> SetForceSolid(
true);
164 darkOrange3 -> SetVisibility(
true);
165 darkOrange3 -> SetForceSolid(
true);
168 skyBlue -> SetVisibility(
true);
169 skyBlue -> SetForceSolid(
true);
175 vacuumZoneXSize = defaultVacuumZoneXSize;
178 vacuumZoneYSize = defaultVacuumZoneYSize;
181 vacuumZoneZSize = defaultVacuumZoneZSize;
183 G4double defaultVacuumZoneXPosition = -3010.0 *
mm;
184 vacuumZoneXPosition = defaultVacuumZoneXPosition;
188 G4double defaultFirstScatteringFoilXSize = 0.0075 *
mm;
189 firstScatteringFoilXSize = defaultFirstScatteringFoilXSize;
191 G4double defaultFirstScatteringFoilYSize = 52.5 *
mm;
192 firstScatteringFoilYSize = defaultFirstScatteringFoilYSize;
194 G4double defaultFirstScatteringFoilZSize = 52.5 *
mm;
195 firstScatteringFoilZSize = defaultFirstScatteringFoilZSize;
197 G4double defaultFirstScatteringFoilXPosition = 0.0 *
mm;
198 firstScatteringFoilXPosition = defaultFirstScatteringFoilXPosition;
202 kaptonWindowXSize = defaultKaptonWindowXSize;
205 kaptonWindowYSize = defaultKaptonWindowYSize;
208 kaptonWindowZSize = defaultKaptonWindowZSize;
210 G4double defaultKaptonWindowXPosition = 100.0*
mm - defaultKaptonWindowXSize;
211 kaptonWindowXPosition = defaultKaptonWindowXPosition;
217 innerRadiusStopper = defaultInnerRadiusStopper;
220 heightStopper = defaultHeightStopper;
223 startAngleStopper = defaultStartAngleStopper;
226 spanningAngleStopper = defaultSpanningAngleStopper;
228 G4double defaultStopperXPosition = -2705.0 *
mm;
229 stopperXPosition = defaultStopperXPosition;
232 stopperYPosition = defaultStopperYPosition;
235 stopperZPosition = defaultStopperZPosition;
238 outerRadiusStopper = defaultOuterRadiusStopper;
243 G4double defaultSecondScatteringFoilXSize = 0.0125 *
mm;
244 secondScatteringFoilXSize = defaultSecondScatteringFoilXSize;
246 G4double defaultSecondScatteringFoilYSize = 52.5 *
mm;
247 secondScatteringFoilYSize = defaultSecondScatteringFoilYSize;
249 G4double defaultSecondScatteringFoilZSize = 52.5 *
mm;
250 secondScatteringFoilZSize = defaultSecondScatteringFoilZSize;
252 G4double defaultSecondScatteringFoilXPosition = defaultStopperXPosition + defaultHeightStopper + defaultSecondScatteringFoilXSize;
253 secondScatteringFoilXPosition = defaultSecondScatteringFoilXPosition;
255 G4double defaultSecondScatteringFoilYPosition = 0 *
mm;
256 secondScatteringFoilYPosition = defaultSecondScatteringFoilYPosition;
258 G4double defaultSecondScatteringFoilZPosition = 0 *
mm;
259 secondScatteringFoilZPosition = defaultSecondScatteringFoilZPosition;
267 rangeShifterXSize = defaultRangeShifterXSize;
270 rangeShifterYSize = defaultRangeShifterYSize;
273 rangeShifterZSize = defaultRangeShifterZSize;
275 G4double defaultRangeShifterXPosition = -2393.0 *
mm;
276 rangeShifterXPosition = defaultRangeShifterXPosition;
278 G4double defaultRangeShifterYPosition = 0. *
mm;
279 rangeShifterYPosition = defaultRangeShifterYPosition;
281 G4double defaultRangeShifterZPosition = 0. *
mm;
282 rangeShifterZPosition = defaultRangeShifterZPosition;
292 G4double defaultMOPIMotherVolumeXSize = 12127.0 *
um;
293 MOPIMotherVolumeXSize = defaultMOPIMotherVolumeXSize;
295 G4double defaultMOPIMotherVolumeYSize = 40.0 *
cm;
296 MOPIMotherVolumeYSize = defaultMOPIMotherVolumeYSize;
298 G4double defaultMOPIMotherVolumeZSize = 40.0 *
cm;
299 MOPIMotherVolumeZSize = defaultMOPIMotherVolumeZSize;
301 G4double defaultMOPIMotherVolumeXPosition = -1000.0 *
mm;
302 MOPIMotherVolumeXPosition = defaultMOPIMotherVolumeXPosition;
304 G4double defaultMOPIMotherVolumeYPosition = 0.0 *
mm;
305 MOPIMotherVolumeYPosition = defaultMOPIMotherVolumeYPosition;
307 G4double defaultMOPIMotherVolumeZPosition = 0.0 *
mm;
308 MOPIMotherVolumeZPosition = defaultMOPIMotherVolumeZPosition;
311 G4double defaultMOPIFirstKaptonLayerXSize = 35 *
um;
312 MOPIFirstKaptonLayerXSize = defaultMOPIFirstKaptonLayerXSize;
314 G4double defaultMOPIFirstKaptonLayerYSize = 30 *
cm;
315 MOPIFirstKaptonLayerYSize = defaultMOPIFirstKaptonLayerYSize;
317 G4double defaultMOPIFirstKaptonLayerZSize = 30 *
cm;
318 MOPIFirstKaptonLayerZSize = defaultMOPIFirstKaptonLayerZSize;
320 G4double defaultMOPIFirstKaptonLayerXPosition = -(MOPIMotherVolumeXSize/2 - (MOPIFirstKaptonLayerXSize/2));
321 MOPIFirstKaptonLayerXPosition = defaultMOPIFirstKaptonLayerXPosition;
323 G4double defaultMOPIFirstKaptonLayerYPosition = 0.0 *
mm;
324 MOPIFirstKaptonLayerYPosition = defaultMOPIFirstKaptonLayerYPosition;
326 G4double defaultMOPIFirstKaptonLayerZPosition = 0.0 *
mm;
327 MOPIFirstKaptonLayerZPosition = defaultMOPIFirstKaptonLayerZPosition;
330 G4double defaultMOPIFirstAluminumLayerXSize = 15 *
um;
331 MOPIFirstAluminumLayerXSize = defaultMOPIFirstAluminumLayerXSize;
333 G4double defaultMOPIFirstAluminumLayerYSize = 30 *
cm;
334 MOPIFirstAluminumLayerYSize = defaultMOPIFirstAluminumLayerYSize;
336 G4double defaultMOPIFirstAluminumLayerZSize = 30 *
cm;
337 MOPIFirstAluminumLayerZSize = defaultMOPIFirstAluminumLayerZSize;
339 G4double defaultMOPIFirstAluminumLayerXPosition =
340 MOPIFirstKaptonLayerXPosition + MOPIFirstKaptonLayerXSize/2 + MOPIFirstAluminumLayerXSize/2;
341 MOPIFirstAluminumLayerXPosition = defaultMOPIFirstAluminumLayerXPosition;
343 G4double defaultMOPIFirstAluminumLayerYPosition = 0.0 *
mm;
344 MOPIFirstAluminumLayerYPosition = defaultMOPIFirstAluminumLayerYPosition;
346 G4double defaultMOPIFirstAluminumLayerZPosition = 0.0 *
mm;
347 MOPIFirstAluminumLayerZPosition = defaultMOPIFirstAluminumLayerZPosition;
350 G4double defaultMOPIFirstAirGapXSize = 6000 *
um;
351 MOPIFirstAirGapXSize = defaultMOPIFirstAirGapXSize;
353 G4double defaultMOPIFirstAirGapYSize = 30 *
cm;
354 MOPIFirstAirGapYSize = defaultMOPIFirstAirGapYSize;
356 G4double defaultMOPIFirstAirGapZSize = 30 *
cm;
357 MOPIFirstAirGapZSize = defaultMOPIFirstAirGapZSize;
359 G4double defaultMOPIFirstAirGapXPosition =
360 MOPIFirstAluminumLayerXPosition + MOPIFirstAluminumLayerXSize/2 + MOPIFirstAirGapXSize/2;
361 MOPIFirstAirGapXPosition = defaultMOPIFirstAirGapXPosition;
363 G4double defaultMOPIFirstAirGapYPosition = 0.0 *
mm;
364 MOPIFirstAirGapYPosition = defaultMOPIFirstAirGapYPosition;
366 G4double defaultMOPIFirstAirGapZPosition = 0.0 *
mm;
367 MOPIFirstAirGapZPosition = defaultMOPIFirstAirGapZPosition;
371 MOPICathodeXSize = defaultMOPICathodeXSize;
374 MOPICathodeYSize = defaultMOPICathodeYSize;
377 MOPICathodeZSize = defaultMOPICathodeZSize;
379 G4double defaultMOPICathodeXPosition =
380 MOPIFirstAirGapXPosition + MOPIFirstAirGapXSize/2 + MOPICathodeXSize/2;
381 MOPICathodeXPosition = defaultMOPICathodeXPosition;
383 G4double defaultMOPICathodeYPosition = 0.0 *
mm;
384 MOPICathodeYPosition = defaultMOPICathodeYPosition;
386 G4double defaultMOPICathodeZPosition = 0.0 *
mm;
387 MOPICathodeZPosition = defaultMOPICathodeZPosition;
390 G4double defaultMOPISecondAirGapXSize = 6000 *
um;
391 MOPISecondAirGapXSize = defaultMOPISecondAirGapXSize;
393 G4double defaultMOPISecondAirGapYSize = 30 *
cm;
394 MOPISecondAirGapYSize = defaultMOPISecondAirGapYSize;
396 G4double defaultMOPISecondAirGapZSize = 30 *
cm;
397 MOPISecondAirGapZSize = defaultMOPISecondAirGapZSize;
399 G4double defaultMOPISecondAirGapXPosition =
400 MOPICathodeXPosition + MOPICathodeXSize/2 + MOPISecondAirGapXSize/2;
401 MOPISecondAirGapXPosition = defaultMOPISecondAirGapXPosition;
403 G4double defaultMOPISecondAirGapYPosition = 0.0 *
mm;
404 MOPISecondAirGapYPosition = defaultMOPISecondAirGapYPosition;
406 G4double defaultMOPISecondAirGapZPosition = 0.0 *
mm;
407 MOPISecondAirGapZPosition = defaultMOPISecondAirGapZPosition;
410 G4double defaultMOPISecondAluminumLayerXSize = 15 *
um;
411 MOPISecondAluminumLayerXSize = defaultMOPISecondAluminumLayerXSize;
413 G4double defaultMOPISecondAluminumLayerYSize = 30 *
cm;
414 MOPISecondAluminumLayerYSize = defaultMOPISecondAluminumLayerYSize;
416 G4double defaultMOPISecondAluminumLayerZSize = 30 *
cm;
417 MOPISecondAluminumLayerZSize = defaultMOPISecondAluminumLayerZSize;
419 G4double defaultMOPISecondAluminumLayerXPosition =
420 MOPISecondAirGapXPosition + MOPISecondAirGapXSize/2 + MOPISecondAluminumLayerXSize/2;
421 MOPISecondAluminumLayerXPosition = defaultMOPISecondAluminumLayerXPosition;
423 G4double defaultMOPISecondAluminumLayerYPosition = 0.0 *
mm;
424 MOPISecondAluminumLayerYPosition = defaultMOPISecondAluminumLayerYPosition;
426 G4double defaultMOPISecondAluminumLayerZPosition = 0.0 *
mm;
427 MOPISecondAluminumLayerZPosition = defaultMOPISecondAluminumLayerZPosition;
430 G4double defaultMOPISecondKaptonLayerXSize = 35 *
um;
431 MOPISecondKaptonLayerXSize = defaultMOPISecondKaptonLayerXSize;
433 G4double defaultMOPISecondKaptonLayerYSize = 30 *
cm;
434 MOPISecondKaptonLayerYSize = defaultMOPISecondKaptonLayerYSize;
436 G4double defaultMOPISecondKaptonLayerZSize = 30 *
cm;
437 MOPISecondKaptonLayerZSize = defaultMOPISecondKaptonLayerZSize;
439 G4double defaultMOPISecondKaptonLayerXPosition =
440 MOPISecondAluminumLayerXPosition + MOPISecondAluminumLayerXSize/2 + MOPISecondKaptonLayerXSize/2;
441 MOPISecondKaptonLayerXPosition = defaultMOPISecondKaptonLayerXPosition;
443 G4double defaultMOPISecondKaptonLayerYPosition = 0.0 *
mm;
444 MOPISecondKaptonLayerYPosition = defaultMOPISecondKaptonLayerYPosition;
446 G4double defaultMOPISecondKaptonLayerZPosition = 0.0 *
mm;
447 MOPISecondKaptonLayerZPosition = defaultMOPISecondKaptonLayerZPosition;
452 G4double defaultinnerRadiusFinalCollimator = 7.5 *
mm;
453 innerRadiusFinalCollimator = defaultinnerRadiusFinalCollimator;
480 brass -> AddElement(zincNist, fractionmass = 30 *
perCent);
481 brass -> AddElement(copperNist, fractionmass = 70 *
perCent);
495 rangeShifterMaterial = airNist;
498 beamLineSupportMaterial = aluminumNist;
501 vacuumZoneMaterial = galacticNist;
504 firstScatteringFoilMaterial = tantalumNist;
507 kaptonWindowMaterial = kaptonNist;
510 stopperMaterial = brass;
513 secondScatteringFoilMaterial = tantalumNist;
516 firstCollimatorMaterial = PMMANist;
517 holeFirstCollimatorMaterial = airNist;
520 modulatorBoxMaterial = aluminumNist;
521 holeModulatorBoxMaterial = airNist;
524 layer1MonitorChamberMaterial = kaptonNist;
525 layer2MonitorChamberMaterial = copperNistAsMaterial;
526 layer3MonitorChamberMaterial = airNist;
527 layer4MonitorChamberMaterial = copperNistAsMaterial;
530 MOPIMotherVolumeMaterial = airNist;
531 MOPIFirstKaptonLayerMaterial = kaptonNist;
532 MOPIFirstAluminumLayerMaterial = aluminumNist;
533 MOPIFirstAirGapMaterial = airNist;
534 MOPICathodeMaterial = mylarNist;
535 MOPISecondAirGapMaterial = airNist;
536 MOPISecondAluminumLayerMaterial = aluminumNist;
537 MOPISecondKaptonLayerMaterial = kaptonNist;
540 nozzleSupportMaterial = PMMANist;
541 brassTubeMaterial = brassTube2Material = brassTube3Material = brass;
542 holeNozzleSupportMaterial = airNist;
545 finalCollimatorMaterial = brass;
549 void PassiveProtonBeamLine::ConstructPassiveProtonBeamLine()
561 G4Box* treatmentRoom =
new G4Box(
"TreatmentRoom",worldX,worldY,worldZ);
564 "logicTreatmentRoom",
568 "physicalTreatmentRoom",
590 modulator -> BuildModulator(physicalTreatmentRoom);
599 const G4double beamLineSupportXSize = 1.5*
m;
601 const G4double beamLineSupportZSize = 600.*
mm;
603 const G4double beamLineSupportXPosition = -1745.09 *
mm;
604 const G4double beamLineSupportYPosition = -230. *
mm;
605 const G4double beamLineSupportZPosition = 0.*
mm;
607 G4Box* beamLineSupport =
new G4Box(
"BeamLineSupport",
608 beamLineSupportXSize,
609 beamLineSupportYSize,
610 beamLineSupportZSize);
613 beamLineSupportMaterial,
616 beamLineSupportYPosition,
617 beamLineSupportZPosition),
619 logicBeamLineSupport,
620 physicalTreatmentRoom,
false, 0);
624 logicBeamLineSupport -> SetVisAttributes(gray);
629 const G4double beamLineCoverXSize = 1.5*
m;
633 const G4double beamLineCoverXPosition = -1745.09 *
mm;
634 const G4double beamLineCoverYPosition = -1000.*
mm;
635 const G4double beamLineCoverZPosition = 600.*
mm;
637 G4Box* beamLineCover =
new G4Box(
"BeamLineCover",
643 beamLineSupportMaterial,
647 beamLineCoverYPosition,
648 beamLineCoverZPosition),
651 physicalTreatmentRoom,
660 beamLineCoverYPosition,
661 - beamLineCoverZPosition),
664 physicalTreatmentRoom,
668 logicBeamLineCover -> SetVisAttributes(blue);
680 G4Box* vacuumZone =
new G4Box(
"VacuumZone", vacuumZoneXSize, vacuumZoneYSize, vacuumZoneZSize);
683 "VacuumZone", logicVacuumZone, physicalTreatmentRoom,
false, 0);
689 firstScatteringFoil =
new G4Box(
"FirstScatteringFoil",
690 firstScatteringFoilXSize,
691 firstScatteringFoilYSize,
692 firstScatteringFoilZSize);
695 firstScatteringFoilMaterial,
696 "FirstScatteringFoil");
699 "FirstScatteringFoil", logicFirstScatteringFoil, physiVacuumZone,
702 logicFirstScatteringFoil -> SetVisAttributes(skyBlue);
707 G4Box* solidKaptonWindow =
new G4Box(
"KaptonWindow",
713 kaptonWindowMaterial,
717 "KaptonWindow", logicKaptonWindow,
718 physiVacuumZone,
false, 0);
720 logicKaptonWindow -> SetVisAttributes(darkOrange3);
733 solidStopper =
new G4Tubs(
"Stopper",
738 spanningAngleStopper);
750 physicalTreatmentRoom,
754 logicStopper -> SetVisAttributes(red);
763 secondScatteringFoil =
new G4Box(
"SecondScatteringFoil",
764 secondScatteringFoilXSize,
765 secondScatteringFoilYSize,
766 secondScatteringFoilZSize);
769 secondScatteringFoilMaterial,
770 "SecondScatteringFoil");
773 secondScatteringFoilYPosition,
774 secondScatteringFoilZPosition),
775 "SeconScatteringFoil",
776 logicSecondScatteringFoil,
777 physicalTreatmentRoom,
781 logicSecondScatteringFoil -> SetVisAttributes(skyBlue);
791 solidRangeShifterBox =
new G4Box(
"RangeShifterBox",
797 rangeShifterMaterial,
802 logicRangeShifterBox,
803 physicalTreatmentRoom,
808 logicRangeShifterBox -> SetVisAttributes(yellow);
818 const G4double firstCollimatorYSize = 100.*
mm;
819 const G4double firstCollimatorZSize = 100.*
mm;
821 const G4double firstCollimatorXPosition = -2673.00*
mm;
822 const G4double firstCollimatorYPosition = 0.*
mm;
823 const G4double firstCollimatorZPosition = 0.*
mm;
825 G4Box* solidFirstCollimator =
new G4Box(
"FirstCollimator",
826 firstCollimatorXSize,
827 firstCollimatorYSize,
828 firstCollimatorZSize);
831 firstCollimatorMaterial,
835 firstCollimatorYPosition,
836 firstCollimatorZPosition),
838 logicFirstCollimator,
839 physicalTreatmentRoom,
845 G4double innerRadiusHoleFirstCollimator = 0.*
mm;
846 G4double outerRadiusHoleFirstCollimator = 15.*
mm;
849 G4double spanningAngleHoleFirstCollimator = 360.*
deg;
851 G4Tubs* solidHoleFirstCollimator =
new G4Tubs(
"HoleFirstCollimator",
852 innerRadiusHoleFirstCollimator,
853 outerRadiusHoleFirstCollimator,
854 hightHoleFirstCollimator,
855 startAngleHoleFirstCollimator,
856 spanningAngleHoleFirstCollimator);
859 holeFirstCollimatorMaterial,
860 "HoleFirstCollimator",
868 "HoleFirstCollimator",
869 logicHoleFirstCollimator,
870 physiFirstCollimator,
877 const G4double secondCollimatorXPosition = -1900.00*
mm;
878 const G4double secondCollimatorYPosition = 0*
mm;
879 const G4double secondCollimatorZPosition = 0*
mm;
882 secondCollimatorYPosition,
883 secondCollimatorZPosition),
885 logicFirstCollimator,
886 physicalTreatmentRoom,
894 "HoleSecondCollimator",
895 logicHoleFirstCollimator,
896 physiSecondCollimator,
909 const G4double firstCollimatorModulatorXSize = 10.*
mm;
910 const G4double firstCollimatorModulatorYSize = 200.*
mm;
911 const G4double firstCollimatorModulatorZSize = 200.*
mm;
913 const G4double firstCollimatorModulatorXPosition = -2523.00*
mm;
914 const G4double firstCollimatorModulatorYPosition = 0.*
mm;
915 const G4double firstCollimatorModulatorZPosition = 0.*
mm;
917 G4Box* solidFirstCollimatorModulatorBox =
new G4Box(
"FirstCollimatorModulatorBox",
918 firstCollimatorModulatorXSize,
919 firstCollimatorModulatorYSize,
920 firstCollimatorModulatorZSize);
923 modulatorBoxMaterial,
924 "FirstCollimatorModulatorBox");
927 firstCollimatorModulatorYPosition,
928 firstCollimatorModulatorZPosition),
929 "FirstCollimatorModulatorBox",
930 logicFirstCollimatorModulatorBox,
931 physicalTreatmentRoom,
false, 0);
936 const G4double innerRadiusHoleFirstCollimatorModulatorBox = 0.*
mm;
937 const G4double outerRadiusHoleFirstCollimatorModulatorBox = 31.*
mm;
938 const G4double hightHoleFirstCollimatorModulatorBox = 10.*
mm;
939 const G4double startAngleHoleFirstCollimatorModulatorBox = 0.*
deg;
940 const G4double spanningAngleHoleFirstCollimatorModulatorBox = 360.*
deg;
942 G4Tubs* solidHoleFirstCollimatorModulatorBox =
new G4Tubs(
"HoleFirstCollimatorModulatorBox",
943 innerRadiusHoleFirstCollimatorModulatorBox,
944 outerRadiusHoleFirstCollimatorModulatorBox,
945 hightHoleFirstCollimatorModulatorBox ,
946 startAngleHoleFirstCollimatorModulatorBox,
947 spanningAngleHoleFirstCollimatorModulatorBox);
950 holeModulatorBoxMaterial,
951 "HoleFirstCollimatorModulatorBox",
955 "HoleFirstCollimatorModulatorBox",
956 logicHoleFirstCollimatorModulatorBox,
957 physiFirstCollimatorModulatorBox,
false, 0);
962 const G4double secondCollimatorModulatorXSize = 10.*
mm;
963 const G4double secondCollimatorModulatorYSize = 200.*
mm;
964 const G4double secondCollimatorModulatorZSize = 200.*
mm;
966 const G4double secondCollimatorModulatorXPosition = -1953.00 *
mm;
968 const G4double secondCollimatorModulatorYPosition = 0.*
mm;
969 const G4double secondCollimatorModulatorZPosition = 0.*
mm;
971 G4Box* solidSecondCollimatorModulatorBox =
new G4Box(
"SecondCollimatorModulatorBox",
972 secondCollimatorModulatorXSize,
973 secondCollimatorModulatorYSize,
974 secondCollimatorModulatorZSize);
977 modulatorBoxMaterial,
978 "SecondCollimatorModulatorBox");
981 secondCollimatorModulatorYPosition,
982 secondCollimatorModulatorZPosition),
983 "SecondCollimatorModulatorBox",
984 logicSecondCollimatorModulatorBox,
985 physicalTreatmentRoom,
false, 0);
990 const G4double innerRadiusHoleSecondCollimatorModulatorBox = 0.*
mm;
991 const G4double outerRadiusHoleSecondCollimatorModulatorBox = 31.*
mm;
992 const G4double hightHoleSecondCollimatorModulatorBox = 10.*
mm;
993 const G4double startAngleHoleSecondCollimatorModulatorBox = 0.*
deg;
994 const G4double spanningAngleHoleSecondCollimatorModulatorBox = 360.*
deg;
996 G4Tubs* solidHoleSecondCollimatorModulatorBox =
new G4Tubs(
"HoleSecondCollimatorModulatorBox",
997 innerRadiusHoleSecondCollimatorModulatorBox,
998 outerRadiusHoleSecondCollimatorModulatorBox,
999 hightHoleSecondCollimatorModulatorBox ,
1000 startAngleHoleSecondCollimatorModulatorBox,
1001 spanningAngleHoleSecondCollimatorModulatorBox);
1004 holeModulatorBoxMaterial,
1005 "HoleSecondCollimatorModulatorBox",
1009 "HoleSecondCollimatorModulatorBox",
1010 logicHoleSecondCollimatorModulatorBox,
1011 physiSecondCollimatorModulatorBox,
false, 0);
1013 logicFirstCollimator -> SetVisAttributes(yellow);
1014 logicFirstCollimatorModulatorBox -> SetVisAttributes(blue);
1015 logicSecondCollimatorModulatorBox -> SetVisAttributes(blue);
1036 const G4double monitor1XPosition = -1262.47498 *
mm;
1037 const G4double monitor2XPosition = -4.500011*
mm;
1038 const G4double monitor4XPosition = 4.500011*
mm;
1040 G4Box* solidFirstMonitorLayer1 =
new G4Box(
"FirstMonitorLayer1",
1046 layer1MonitorChamberMaterial,
1047 "FirstMonitorLayer1");
1051 "FirstMonitorLayer1",
1052 logicFirstMonitorLayer1,
1053 physicalTreatmentRoom,
1057 G4Box* solidFirstMonitorLayer2 =
new G4Box(
"FirstMonitorLayer2",
1063 layer2MonitorChamberMaterial,
1064 "FirstMonitorLayer2");
1067 "FirstMonitorLayer2",
1068 logicFirstMonitorLayer2,
1069 physiFirstMonitorLayer1,
1073 G4Box* solidFirstMonitorLayer3 =
new G4Box(
"FirstMonitorLayer3",
1079 layer3MonitorChamberMaterial,
1080 "FirstMonitorLayer3");
1085 logicFirstMonitorLayer3,
1086 physiFirstMonitorLayer1,
1090 G4Box* solidFirstMonitorLayer4 =
new G4Box(
"FirstMonitorLayer4",
1096 layer4MonitorChamberMaterial,
1097 "FirstMonitorLayer4");
1100 "FirstMonitorLayer4",
1101 logicFirstMonitorLayer4,
1102 physiFirstMonitorLayer1,
false, 0);
1107 "SecondMonitorLayer1", logicFirstMonitorLayer1,physicalTreatmentRoom,
false, 0);
1110 logicFirstMonitorLayer2, physiSecondMonitorLayer1,
false, 0);
1113 logicFirstMonitorLayer3, physiSecondMonitorLayer1,
false, 0);
1116 logicFirstMonitorLayer4, physiSecondMonitorLayer1,
false, 0);
1118 logicFirstMonitorLayer3 -> SetVisAttributes(white);
1144 solidMOPIMotherVolume =
new G4Box(
"MOPIMotherVolume",
1145 MOPIMotherVolumeXSize/2,
1146 MOPIMotherVolumeYSize/2,
1147 MOPIMotherVolumeYSize/2);
1150 MOPIMotherVolumeMaterial,
1151 "MOPIMotherVolume");
1154 MOPIMotherVolumeYPosition,
1155 MOPIMotherVolumeZPosition),
1157 logicMOPIMotherVolume,
1158 physicalTreatmentRoom,
1163 solidMOPIFirstKaptonLayer =
new G4Box(
"MOPIFirstKaptonLayer",
1164 MOPIFirstKaptonLayerXSize/2,
1165 MOPIFirstKaptonLayerYSize/2 ,
1166 MOPIFirstKaptonLayerZSize/2);
1168 logicMOPIFirstKaptonLayer =
new G4LogicalVolume(solidMOPIFirstKaptonLayer,
1169 MOPIFirstKaptonLayerMaterial,
1170 "MOPIFirstKaptonLayer");
1174 MOPIFirstKaptonLayerYPosition ,
1175 MOPIFirstKaptonLayerZPosition),
1176 "MOPIFirstKaptonLayer",
1177 logicMOPIFirstKaptonLayer,
1178 physiMOPIMotherVolume,
1183 solidMOPIFirstAluminumLayer =
new G4Box(
"MOPIFirstAluminumLayer",
1184 MOPIFirstAluminumLayerXSize/2,
1185 MOPIFirstAluminumLayerYSize/2 ,
1186 MOPIFirstAluminumLayerZSize/2);
1188 logicMOPIFirstAluminumLayer =
new G4LogicalVolume(solidMOPIFirstAluminumLayer,
1189 MOPIFirstAluminumLayerMaterial,
1190 "MOPIFirstAluminumLayer");
1194 MOPIFirstAluminumLayerYPosition ,
1195 MOPIFirstAluminumLayerZPosition),
1196 "MOPIFirstAluminumLayer",
1197 logicMOPIFirstAluminumLayer, physiMOPIMotherVolume,
false, 0);
1200 solidMOPIFirstAirGap =
new G4Box(
"MOPIFirstAirGap",
1201 MOPIFirstAirGapXSize/2,
1202 MOPIFirstAirGapYSize/2,
1203 MOPIFirstAirGapZSize/2);
1206 MOPIFirstAirGapMaterial,
1211 MOPIFirstAirGapYPosition ,
1212 MOPIFirstAirGapZPosition),
1214 logicMOPIFirstAirGap, physiMOPIMotherVolume,
false, 0);
1218 solidMOPICathode =
new G4Box(
"MOPICathode",
1221 MOPICathodeZSize/2);
1224 MOPICathodeMaterial,
1229 MOPICathodeYPosition ,
1230 MOPICathodeZPosition),
1233 physiMOPIMotherVolume,
false, 0);
1236 solidMOPISecondAirGap =
new G4Box(
"MOPISecondAirGap",
1237 MOPISecondAirGapXSize/2,
1238 MOPISecondAirGapYSize/2,
1239 MOPISecondAirGapZSize/2);
1242 MOPISecondAirGapMaterial,
1243 "MOPISecondAirgap");
1247 MOPISecondAirGapYPosition ,
1248 MOPISecondAirGapZPosition),
1250 logicMOPISecondAirGap, physiMOPIMotherVolume,
false, 0);
1253 solidMOPISecondAluminumLayer =
new G4Box(
"MOPISecondAluminumLayer",
1254 MOPISecondAluminumLayerXSize/2,
1255 MOPISecondAluminumLayerYSize/2 ,
1256 MOPISecondAluminumLayerZSize/2);
1258 logicMOPISecondAluminumLayer =
new G4LogicalVolume(solidMOPISecondAluminumLayer,
1259 MOPISecondAluminumLayerMaterial,
1260 "MOPISecondAluminumLayer");
1264 MOPISecondAluminumLayerYPosition ,
1265 MOPISecondAluminumLayerZPosition),
1266 "MOPISecondAluminumLayer",
1267 logicMOPISecondAluminumLayer,
1268 physiMOPIMotherVolume,
1273 solidMOPISecondKaptonLayer =
new G4Box(
"MOPISecondKaptonLayer",
1274 MOPISecondKaptonLayerXSize/2,
1275 MOPISecondKaptonLayerYSize/2 ,
1276 MOPISecondKaptonLayerZSize/2);
1278 logicMOPISecondKaptonLayer =
new G4LogicalVolume(solidMOPISecondKaptonLayer,
1279 MOPIFirstKaptonLayerMaterial,
1280 "MOPISecondKaptonLayer");
1284 MOPISecondKaptonLayerYPosition ,
1285 MOPISecondKaptonLayerZPosition),
1286 "MOPISecondKaptonLayer",
1287 logicMOPISecondKaptonLayer,
1288 physiMOPIMotherVolume,
1292 logicMOPIFirstAirGap -> SetVisAttributes(darkGreen);
1293 logicMOPISecondAirGap -> SetVisAttributes(darkGreen);
1310 const G4double nozzleSupportXSize = 29.5 *
mm;
1311 const G4double nozzleSupportYSize = 180. *
mm;
1312 const G4double nozzleSupportZSize = 180. *
mm;
1314 const G4double nozzleSupportXPosition = -397.50 *
mm;
1321 G4Box* solidNozzleSupport =
new G4Box(
"NozzleSupport",
1324 nozzleSupportZSize);
1327 nozzleSupportMaterial,
1333 physicalTreatmentRoom,
1337 logicNozzleSupport -> SetVisAttributes(yellow);
1344 const G4double innerRadiusHoleNozzleSupport = 0.*
mm;
1345 const G4double outerRadiusHoleNozzleSupport = 21.5*
mm;
1346 const G4double hightHoleNozzleSupport = 29.5 *
mm;
1347 const G4double startAngleHoleNozzleSupport = 0.*
deg;
1348 const G4double spanningAngleHoleNozzleSupport = 360.*
deg;
1350 G4Tubs* solidHoleNozzleSupport =
new G4Tubs(
"HoleNozzleSupport",
1351 innerRadiusHoleNozzleSupport,
1352 outerRadiusHoleNozzleSupport,
1353 hightHoleNozzleSupport,
1354 startAngleHoleNozzleSupport,
1355 spanningAngleHoleNozzleSupport);
1358 holeNozzleSupportMaterial,
1359 "HoleNozzleSupport",
1366 "HoleNozzleSupport",
1367 logicHoleNozzleSupport,
1371 logicHoleNozzleSupport -> SetVisAttributes(darkOrange3);
1378 const G4double outerRadiusBrassTube = 21.5 *
mm;
1383 const G4double brassTubeXPosition = -227.5 *
mm;
1386 innerRadiusBrassTube,
1387 outerRadiusBrassTube,
1389 startAngleBrassTube,
1390 spanningAngleBrassTube);
1403 physicalTreatmentRoom,
1407 logicBrassTube -> SetVisAttributes(darkOrange3);
1413 const G4double innerRadiusBrassTube2= 18.*
mm;
1414 const G4double outerRadiusBrassTube2 = 21.5 *
mm;
1417 const G4double spanningAngleBrassTube2 = 360.*
deg;
1422 innerRadiusBrassTube2,
1423 outerRadiusBrassTube2,
1425 startAngleBrassTube2,
1426 spanningAngleBrassTube2);
1432 G4bool checkOverlaps =
true;
1438 logicHoleNozzleSupport,
1443 logicBrassTube2 -> SetVisAttributes(darkOrange3);
1450 const G4double innerRadiusBrassTube3= 18.*
mm;
1451 const G4double outerRadiusBrassTube3 = 21.5 *
mm;
1454 const G4double spanningAngleBrassTube3 = 360.*
deg;
1456 const G4double brassTube3XPosition = -437 *
mm;
1459 innerRadiusBrassTube3,
1460 outerRadiusBrassTube3,
1462 startAngleBrassTube3,
1463 spanningAngleBrassTube3);
1476 physicalTreatmentRoom,
1480 logicBrassTube3 -> SetVisAttributes(darkOrange3);
1489 const G4double outerRadiusFinalCollimator = 21.5*
mm;
1490 const G4double hightFinalCollimator = 3.5*
mm;
1491 const G4double startAngleFinalCollimator = 0.*
deg;
1492 const G4double spanningAngleFinalCollimator = 360.*
deg;
1493 const G4double finalCollimatorXPosition = -83.5 *
mm;
1501 solidFinalCollimator =
new G4Tubs(
"FinalCollimator",
1502 innerRadiusFinalCollimator,
1503 outerRadiusFinalCollimator,
1504 hightFinalCollimator,
1505 startAngleFinalCollimator,
1506 spanningAngleFinalCollimator);
1509 finalCollimatorMaterial,
1516 "FinalCollimator", logicFinalCollimator, physicalTreatmentRoom,
false, 0);
1518 logicFinalCollimator -> SetVisAttributes(yellow);
1524 physiRangeShifterBox -> SetTranslation(
G4ThreeVector(value, 0., 0.));
1526 G4cout <<
"The Range Shifter is translated to"<< value/
mm <<
"mm along the X axis" <<
G4endl;
1532 solidRangeShifterBox -> SetXHalfLength(value) ;
1533 G4cout <<
"RangeShifter size X (mm): "<< ((solidRangeShifterBox -> GetXHalfLength())*2.)/
mm
1541 firstScatteringFoil -> SetXHalfLength(value);
1543 G4cout <<
"The X size of the first scattering foil is (mm):"<<
1544 ((firstScatteringFoil -> GetXHalfLength())*2.)/
mm
1551 secondScatteringFoil -> SetXHalfLength(value);
1553 G4cout <<
"The X size of the second scattering foil is (mm):"<<
1554 ((secondScatteringFoil -> GetXHalfLength())*2.)/
mm
1561 solidStopper -> SetOuterRadius(value);
1563 G4cout <<
"OuterRadius od the Stopper is (mm):"
1564 << solidStopper -> GetOuterRadius()/
mm
1571 solidFinalCollimator -> SetInnerRadius(value);
1573 G4cout<<
"Inner Radius of the final collimator is (mm):"
1574 << solidFinalCollimator -> GetInnerRadius()/
mm
1585 rangeShifterMaterial = pttoMaterial;
1586 logicRangeShifterBox ->
SetMaterial(pttoMaterial);
1587 G4cout <<
"The material of the Range Shifter has been changed to " << materialChoice <<
G4endl;
1592 G4cout <<
"WARNING: material \"" << materialChoice <<
"\" doesn't exist in NIST elements/materials"
1593 " table [located in $G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc]" <<
G4endl;
1594 G4cout <<
"Use command \"/parameter/nist\" to see full materials list!" <<
G4endl;
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static constexpr double mm
CLHEP::Hep3Vector G4ThreeVector
static constexpr double perCent
void SetModulatorAngle(G4double angle)
void HadrontherapyBeamScatteringFoils()
void HadrontherapyBeamMonitoring()
void HadrontherapyBeamCollimators()
HepRotation & rotateY(double delta)
void SetSecondScatteringFoilXSize(G4double)
static G4NistManager * Instance()
void RegisterParallelWorld(G4VUserParallelWorld *)
void SetRangeShifterXPosition(G4double value)
void HadrontherapyBeamFinalCollimator()
G4GLOB_DLL std::ostream G4cout
void HadrontherapyBeamLineSupport()
static constexpr double um
static constexpr double m
const XML_Char int const XML_Char * value
void SetInnerRadiusFinalCollimator(G4double)
void SetOuterRadiusStopper(G4double)
static constexpr double cm
void HadrontherapyBeamNozzle()
void SetFirstScatteringFoilXSize(G4double)
void SetRangeShifterXSize(G4double halfSize)
void HadrontherapyRangeShifter()
static constexpr double cm3
void SetRSMaterial(G4String)
static G4RunManager * GetRunManager()
static const G4VisAttributes Invisible
void HadrontherapyMOPIDetector()
G4VPhysicalVolume * Construct()
void InitializeDetectorROGeometry(HadrontherapyDetectorROGeometry *, G4ThreeVector detectorToWorldPosition)
static constexpr double deg
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
G4ThreeVector GetDetectorToWorldPosition()
static constexpr double mole