Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:16

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Hadrontherapy advanced example for Geant4
0027 // See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
0028 
0029 #ifndef PassiveProtonBeamLine_H
0030 #define PassiveProtonBeamLine_H 1
0031 
0032 #include "globals.hh"
0033 #include "G4VUserDetectorConstruction.hh"
0034 #include "G4Box.hh"
0035 #include "G4Tubs.hh"
0036 #include "G4VisAttributes.hh"
0037 #include "G4LogicalVolume.hh"
0038 
0039 class G4VPhysicalVolume;
0040 class HadrontherapyDetectorConstruction;
0041 class HadrontherapyModulator;
0042 class PassiveProtonBeamLineMessenger;
0043 class HadrontherapyDetectorROGeometry;
0044 
0045 class PassiveProtonBeamLine : public G4VUserDetectorConstruction
0046 {
0047 public:
0048 
0049     PassiveProtonBeamLine();
0050     ~PassiveProtonBeamLine();
0051   // static G4bool doCalculation;
0052     
0053     G4VPhysicalVolume* Construct();
0054     //***************************** PW **************NON SERVE*************************
0055     
0056     static PassiveProtonBeamLine* GetInstance();
0057     
0058     //***************************** PW **************NON SERVE*************************
0059     
0060     void HadrontherapyBeamLineSupport();
0061     // Definition of the beam line support
0062     
0063     void HadrontherapyBeamScatteringFoils();
0064     // Definition of the first scattering foil,
0065     // of the Kapton window, of the stopper
0066     
0067     void HadrontherapyRangeShifter();
0068     // This defines the "range shifter". Is is a slab
0069     // (usually of PMMA" acting as energy degrader
0070     // of primary beam
0071     
0072     void HadrontherapyBeamCollimators();
0073     // Definition of the first collimator, of the range shifter,
0074     // of the second collimator, of the first and second
0075     // collimator modulators
0076     
0077     void HadrontherapyBeamMonitoring();
0078     // Definition of three monitor chambers
0079     
0080     void HadrontherapyMOPIDetector();
0081     // Construct the MOPI on-line detector
0082     
0083     void HadrontherapyBeamNozzle();
0084     // Definition of the beam noozle
0085     
0086     void HadrontherapyBeamFinalCollimator();
0087     // Definition of the final collimator
0088     
0089     // The following methods allow to change parameters
0090     // of some beam line components
0091     
0092     void SetRangeShifterXPosition(G4double value);
0093     // This method allows to move the Range Shifter along
0094     // the X axis
0095     
0096     void SetRangeShifterXSize(G4double halfSize);
0097     // This method allows to change the size of the range shifter along
0098     // the X axis
0099     
0100     void SetFirstScatteringFoilXSize(G4double);
0101     // This method allows to change the size of the first scattering foil
0102     // along the X axis
0103     
0104     void SetSecondScatteringFoilXSize(G4double);
0105     // This method allows to change the size of the second scattering foil
0106     // along the X axis
0107     
0108     void SetOuterRadiusStopper(G4double);
0109     // This method allows to change the size of the outer radius of the stopper
0110     
0111     void SetInnerRadiusFinalCollimator(G4double);
0112     // This method allows to change the size of the inner radius of the
0113     // final collimator
0114     
0115     void SetRSMaterial(G4String);
0116     // This method allows to change the material
0117     // of the range shifter
0118     
0119     void SetModulatorAngle(G4double angle);
0120     // This method allows moving the modulator through UI commands
0121     
0122     
0123 private:
0124     static PassiveProtonBeamLine* instance;
0125     //passive proton line dimensions
0126     void SetDefaultDimensions();
0127     void ConstructPassiveProtonBeamLine();
0128     
0129     HadrontherapyModulator* modulator; // Pointer to the modulator
0130     // geometry component
0131     PassiveProtonBeamLineMessenger* passiveMessenger;
0132     G4VPhysicalVolume* physicalTreatmentRoom;
0133     HadrontherapyDetectorConstruction* hadrontherapyDetectorConstruction;
0134     
0135     
0136     G4Material* kapton;
0137     
0138     G4double vacuumZoneXSize;
0139     G4double vacuumZoneYSize;
0140     G4double vacuumZoneZSize;
0141     G4double vacuumZoneXPosition;
0142     
0143     G4double firstScatteringFoilXSize;
0144     G4double firstScatteringFoilYSize;
0145     G4double firstScatteringFoilZSize;
0146     G4double firstScatteringFoilXPosition;
0147     
0148     G4double kaptonWindowXSize;
0149     G4double kaptonWindowYSize;
0150     G4double kaptonWindowZSize;
0151     G4double kaptonWindowXPosition;
0152     
0153     G4double innerRadiusStopper;
0154     G4double heightStopper;
0155     G4double startAngleStopper;
0156     G4double spanningAngleStopper;
0157     G4double stopperXPosition;
0158     G4double stopperYPosition;
0159     G4double stopperZPosition;
0160     G4double outerRadiusStopper;
0161     
0162     G4double secondScatteringFoilXSize;
0163     G4double secondScatteringFoilYSize;
0164     G4double secondScatteringFoilZSize;
0165     G4double secondScatteringFoilXPosition;
0166     G4double secondScatteringFoilYPosition;
0167     G4double secondScatteringFoilZPosition;
0168     
0169     G4double rangeShifterXSize;
0170     G4double rangeShifterYSize;
0171     G4double rangeShifterZSize;
0172     G4double rangeShifterXPosition;
0173     G4double rangeShifterYPosition;
0174     G4double rangeShifterZPosition;
0175     
0176     
0177     G4VPhysicalVolume* physiBeamLineSupport;
0178     G4VPhysicalVolume* physiBeamLineCover;
0179     G4VPhysicalVolume* physiBeamLineCover2;
0180     G4Box* firstScatteringFoil;
0181     G4VPhysicalVolume* physiFirstScatteringFoil;
0182     G4VPhysicalVolume* physiKaptonWindow;
0183     
0184     G4Tubs* solidStopper;
0185     G4VPhysicalVolume* physiStopper;
0186     G4LogicalVolume* logicStopper;
0187     
0188     G4Box* secondScatteringFoil;
0189     G4VPhysicalVolume* physiSecondScatteringFoil;
0190     G4VPhysicalVolume* physiFirstCollimator;
0191     G4VPhysicalVolume* physiHoleFirstCollimator;
0192     G4Box* solidRangeShifterBox;
0193     G4LogicalVolume* logicRangeShifterBox;
0194     G4VPhysicalVolume* physiRangeShifterBox;
0195     G4VPhysicalVolume* physiSecondCollimator;
0196     G4VPhysicalVolume* physiHoleSecondCollimator;
0197     
0198     G4VPhysicalVolume* physiFirstCollimatorModulatorBox;
0199     G4VPhysicalVolume* physiHoleFirstCollimatorModulatorBox;
0200     
0201     G4VPhysicalVolume* physiSecondCollimatorModulatorBox;
0202     G4VPhysicalVolume* physiHoleSecondCollimatorModulatorBox;
0203     
0204     // MOPI Detector
0205     // Mother volume
0206     G4VPhysicalVolume* physiMOPIMotherVolume;
0207     G4LogicalVolume* logicMOPIMotherVolume;
0208     G4Box* solidMOPIMotherVolume;
0209     
0210     G4double MOPIMotherVolumeXSize;
0211     G4double MOPIMotherVolumeYSize;
0212     G4double MOPIMotherVolumeZSize;
0213     G4double MOPIMotherVolumeXPosition;
0214     G4double MOPIMotherVolumeYPosition;
0215     G4double MOPIMotherVolumeZPosition;
0216     
0217     // First Kapton layer
0218     G4double MOPIFirstKaptonLayerXSize;
0219     G4double MOPIFirstKaptonLayerYSize;
0220     G4double MOPIFirstKaptonLayerZSize;
0221     G4double MOPIFirstKaptonLayerXPosition;
0222     G4double MOPIFirstKaptonLayerYPosition;
0223     G4double MOPIFirstKaptonLayerZPosition;
0224     G4Box* solidMOPIFirstKaptonLayer;
0225     G4LogicalVolume* logicMOPIFirstKaptonLayer;
0226     G4VPhysicalVolume* physiMOPIFirstKaptonLayer;
0227     
0228     // First Aluminum layer
0229     G4double MOPIFirstAluminumLayerXSize;
0230     G4double MOPIFirstAluminumLayerYSize;
0231     G4double MOPIFirstAluminumLayerZSize;
0232     G4double MOPIFirstAluminumLayerXPosition;
0233     G4double MOPIFirstAluminumLayerYPosition;
0234     G4double MOPIFirstAluminumLayerZPosition;
0235     G4Box* solidMOPIFirstAluminumLayer;
0236     G4LogicalVolume* logicMOPIFirstAluminumLayer;
0237     G4VPhysicalVolume* physiMOPIFirstAluminumLayer;
0238     
0239     // First Air Gap
0240     G4double MOPIFirstAirGapXSize;
0241     G4double MOPIFirstAirGapYSize;
0242     G4double MOPIFirstAirGapZSize;
0243     G4double MOPIFirstAirGapXPosition;
0244     G4double MOPIFirstAirGapYPosition;
0245     G4double MOPIFirstAirGapZPosition;
0246     G4Box* solidMOPIFirstAirGap;
0247     G4LogicalVolume* logicMOPIFirstAirGap;
0248     G4VPhysicalVolume* physiMOPIFirstAirGap;
0249     
0250     // Cathode
0251     G4double MOPICathodeXSize;
0252     G4double MOPICathodeYSize;
0253     G4double MOPICathodeZSize;
0254     G4double MOPICathodeXPosition;
0255     G4double MOPICathodeYPosition;
0256     G4double MOPICathodeZPosition;
0257     G4Box* solidMOPICathode;
0258     G4LogicalVolume* logicMOPICathode;
0259     G4VPhysicalVolume* physiMOPICathode;
0260     
0261     G4VisAttributes* redWire;
0262     
0263     // First Air Gap
0264     G4double MOPISecondAirGapXSize;
0265     G4double MOPISecondAirGapYSize;
0266     G4double MOPISecondAirGapZSize;
0267     G4double MOPISecondAirGapXPosition;
0268     G4double MOPISecondAirGapYPosition;
0269     G4double MOPISecondAirGapZPosition;
0270     G4Box* solidMOPISecondAirGap;
0271     G4LogicalVolume* logicMOPISecondAirGap;
0272     G4VPhysicalVolume* physiMOPISecondAirGap;
0273     
0274     // First Aluminum layer
0275     G4double MOPISecondAluminumLayerXSize;
0276     G4double MOPISecondAluminumLayerYSize;
0277     G4double MOPISecondAluminumLayerZSize;
0278     G4double MOPISecondAluminumLayerXPosition;
0279     G4double MOPISecondAluminumLayerYPosition;
0280     G4double MOPISecondAluminumLayerZPosition;
0281     G4Box* solidMOPISecondAluminumLayer;
0282     G4LogicalVolume* logicMOPISecondAluminumLayer;
0283     G4VPhysicalVolume* physiMOPISecondAluminumLayer;
0284     
0285     // Second Kapton layer
0286     G4double MOPISecondKaptonLayerXSize;
0287     G4double MOPISecondKaptonLayerYSize;
0288     G4double MOPISecondKaptonLayerZSize;
0289     G4double MOPISecondKaptonLayerXPosition;
0290     G4double MOPISecondKaptonLayerYPosition;
0291     G4double MOPISecondKaptonLayerZPosition;
0292     G4Box* solidMOPISecondKaptonLayer;
0293     G4LogicalVolume* logicMOPISecondKaptonLayer;
0294     G4VPhysicalVolume* physiMOPISecondKaptonLayer;
0295     
0296     G4double innerRadiusFinalCollimator;
0297     G4VPhysicalVolume* mother;
0298     
0299     G4VPhysicalVolume* physiFirstMonitorLayer1;
0300     G4VPhysicalVolume* physiFirstMonitorLayer2;
0301     G4VPhysicalVolume* physiFirstMonitorLayer3;
0302     G4VPhysicalVolume* physiFirstMonitorLayer4;
0303     G4VPhysicalVolume* physiSecondMonitorLayer1;
0304     G4VPhysicalVolume* physiSecondMonitorLayer2;
0305     G4VPhysicalVolume* physiSecondMonitorLayer3;
0306     G4VPhysicalVolume* physiSecondMonitorLayer4;
0307     G4VPhysicalVolume* physiNozzleSupport;
0308     G4VPhysicalVolume* physiHoleNozzleSupport;
0309     G4VPhysicalVolume* physiBrassTube;
0310     G4VPhysicalVolume* physiBrassTube2;
0311     G4VPhysicalVolume* physiBrassTube3;
0312     G4Tubs* solidFinalCollimator;
0313     G4VPhysicalVolume* physiFinalCollimator;
0314     
0315     G4VisAttributes* blue;
0316     G4VisAttributes* gray;
0317     G4VisAttributes* white;
0318     G4VisAttributes* red;
0319     G4VisAttributes* yellow;
0320     G4VisAttributes* green;
0321     G4VisAttributes* darkGreen;
0322     G4VisAttributes* darkOrange3;
0323     G4VisAttributes* skyBlue;
0324     
0325     G4Material* rangeShifterMaterial;
0326     G4Material* beamLineSupportMaterial;
0327     G4Material* vacuumZoneMaterial;
0328     G4Material* firstScatteringFoilMaterial;
0329     G4Material* kaptonWindowMaterial;
0330     G4Material* stopperMaterial;
0331     G4Material* secondScatteringFoilMaterial;
0332     G4Material* firstCollimatorMaterial;
0333     G4Material* holeFirstCollimatorMaterial;
0334     G4Material* modulatorBoxMaterial;
0335     G4Material* holeModulatorBoxMaterial;
0336     G4Material* layer1MonitorChamberMaterial;
0337     G4Material* layer2MonitorChamberMaterial;
0338     G4Material* layer3MonitorChamberMaterial;
0339     G4Material* layer4MonitorChamberMaterial;
0340     G4Material* MOPIMotherVolumeMaterial;
0341     G4Material* MOPIFirstKaptonLayerMaterial;
0342     G4Material* MOPIFirstAluminumLayerMaterial;
0343     G4Material* MOPIFirstAirGapMaterial;
0344     G4Material* MOPICathodeMaterial;
0345     G4Material* MOPISecondAirGapMaterial;
0346     G4Material* MOPISecondAluminumLayerMaterial;
0347     G4Material* MOPISecondKaptonLayerMaterial;
0348     G4Material* nozzleSupportMaterial;
0349     G4Material* holeNozzleSupportMaterial;
0350     
0351     G4Material* brassTubeMaterial;
0352     G4Material* brassTube2Material;
0353     G4Material* brassTube3Material;
0354     G4Material* finalCollimatorMaterial;
0355     
0356     
0357     HadrontherapyDetectorROGeometry* RO;
0358     
0359     
0360 };
0361 #endif