Back to home page

EIC code displayed by LXR

 
 

    


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

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 BESTPassiveProtonBeamLine_H
0030 #define BESTPassiveProtonBeamLine_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 BESTPassiveProtonBeamLineMessenger;
0043 class HadrontherapyDetectorROGeometry;
0044 
0045 class BESTPassiveProtonBeamLine : public G4VUserDetectorConstruction
0046 {
0047 public:
0048 
0049     BESTPassiveProtonBeamLine();
0050     ~BESTPassiveProtonBeamLine();
0051   // static G4bool doCalculation;
0052     
0053     G4VPhysicalVolume* Construct();
0054     //***************************** PW **************NON SERVE*************************
0055     
0056     static BESTPassiveProtonBeamLine* GetInstance();
0057     
0058     //***************************** PW **************NON SERVE*************************
0059     
0060     void BESTBeamLineSupport();
0061     // Definition of the beam line support
0062     
0063     void BESTBeamScatteringFoils();
0064     // Definition of the first scattering foil,
0065     // of the Kapton window, of the stopper
0066     
0067     void BESTRangeShifter();
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 BESTBeamCollimators();
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 BESTBeamMonitoring();
0078     // Definition of three monitor chambers
0079     
0080     
0081     void BESTBeamNozzle();
0082     // Definition of the beam noozle
0083     
0084     void BESTBeamFinalCollimator();
0085     // Definition of the final collimator
0086     
0087     // The following methods allow to change parameters
0088     // of some beam line components
0089     
0090     void SetRangeShifterXSize(G4double halfSize);
0091     // This method allows to change the size of the range shifter along
0092     // the X axis
0093     
0094     void SetFirstScatteringFoilXSize(G4double);
0095     // This method allows to change the size of the first scattering foil
0096     // along the X axis
0097     
0098     void SetSecondScatteringFoilXSize(G4double);
0099     // This method allows to change the size of the second scattering foil
0100     // along the X axis
0101     
0102     void SetOuterRadiusStopper(G4double);
0103     // This method allows to change the size of the outer radius of the stopper
0104     
0105     void SetInnerRadiusFinalCollimator(G4double);
0106     // This method allows to change the size of the inner radius of the
0107     // final collimator
0108     
0109     void SetRSMaterial(G4String);
0110     // This method allows to change the material
0111     // of the range shifter
0112     
0113     void SetModulatorAngle(G4double angle);
0114     // This method allows moving the modulator through UI commands
0115     
0116     
0117 private:
0118     static BESTPassiveProtonBeamLine* instance;
0119     //passive proton line dimensions
0120     void SetDefaultDimensions();
0121     void ConstructBESTPassiveProtonBeamLine();
0122     
0123     HadrontherapyModulator* modulator; // Pointer to the modulator
0124     // geometry component
0125     BESTPassiveProtonBeamLineMessenger* passiveMessenger;
0126     G4VPhysicalVolume* physicalTreatmentRoom;
0127     HadrontherapyDetectorConstruction* hadrontherapyDetectorConstruction;
0128     
0129     
0130     G4Material* kapton;
0131     
0132     G4double BESTvacuumZoneXSize;
0133     G4double BESTvacuumZoneYSize;
0134     G4double BESTvacuumZoneZSize;
0135     G4double BESTvacuumZoneXPosition;
0136     
0137     G4double BESTfirstScatteringFoilXSize;
0138     G4double BESTfirstScatteringFoilYSize;
0139     G4double BESTfirstScatteringFoilZSize;
0140     G4double BESTfirstScatteringFoilXPosition;
0141     
0142     G4double BESTkaptonWindowXSize;
0143     G4double BESTkaptonWindowYSize;
0144     G4double BESTkaptonWindowZSize;
0145     G4double BESTkaptonWindowXPosition;
0146     
0147     G4double BESTinnerRadiusStopper;
0148     G4double BESTheightStopper;
0149     G4double BESTstartAngleStopper;
0150     G4double BESTspanningAngleStopper;
0151     G4double BESTstopperXPosition;
0152     G4double BESTstopperYPosition;
0153     G4double BESTstopperZPosition;
0154     G4double BESTouterRadiusStopper;
0155     
0156     G4double BESTsecondScatteringFoilXSize;
0157     G4double BESTsecondScatteringFoilYSize;
0158     G4double BESTsecondScatteringFoilZSize;
0159     G4double BESTsecondScatteringFoilXPosition;
0160     G4double BESTsecondScatteringFoilYPosition;
0161     G4double BESTsecondScatteringFoilZPosition;
0162     
0163     G4double BESTrangeShifterXSize;
0164     G4double BESTrangeShifterYSize;
0165     G4double BESTrangeShifterZSize;
0166     G4double BESTrangeShifterXPosition;
0167     G4double BESTrangeShifterYPosition;
0168     G4double BESTrangeShifterZPosition;
0169     
0170     
0171     G4VPhysicalVolume* physiBeamLineSupport;
0172     G4VPhysicalVolume* physiBeamLineCover;
0173     G4VPhysicalVolume* physiBeamLineCover2;
0174     G4Box* BESTfirstScatteringFoil;
0175     G4VPhysicalVolume* physiBESTFirstScatteringFoil;
0176     G4VPhysicalVolume* physiBESTKaptonWindow;
0177     
0178     G4Tubs* solidBESTStopper;
0179     G4VPhysicalVolume* physiBESTStopper;
0180     G4LogicalVolume* logicBESTStopper;
0181     
0182     G4Box* BESTsecondScatteringFoil;
0183     G4VPhysicalVolume* physiBESTSecondScatteringFoil;
0184     G4VPhysicalVolume* physiBESTFirstCollimator;
0185     G4VPhysicalVolume* physiBESTHoleFirstCollimator;
0186     G4Box* solidBESTRangeShifterBox;
0187     G4LogicalVolume* logicBESTRangeShifterBox;
0188     G4VPhysicalVolume* physiBESTRangeShifterBox;
0189     G4VPhysicalVolume* physiBESTSecondCollimator;
0190     G4VPhysicalVolume* physiBESTHoleSecondCollimator;
0191     
0192     G4VPhysicalVolume* physiBESTFirstCollimatorModulatorBox;
0193     G4VPhysicalVolume* physiBESTHoleFirstCollimatorModulatorBox;
0194     
0195     G4VPhysicalVolume* physiBESTSecondCollimatorModulatorBox;
0196     G4VPhysicalVolume* physiBESTHoleSecondCollimatorModulatorBox;
0197       
0198     G4double BESTinnerRadiusFinalCollimator;
0199     G4VPhysicalVolume* mother;
0200 
0201 
0202 G4VPhysicalVolume* chamberPhys;
0203   G4VPhysicalVolume*innerchamberPhys;
0204   G4VPhysicalVolume*enterWindowPhys;
0205    G4VPhysicalVolume*enterElectrodePhys;
0206  G4VPhysicalVolume* kaptonLayerPhys1;
0207   G4VPhysicalVolume*copperLayerPhys1;
0208   G4VPhysicalVolume*nickelLayerPhys1;
0209   G4VPhysicalVolume*fFirstCavityPhys;
0210   G4VPhysicalVolume*centralElectrode1Phys;
0211   G4VPhysicalVolume*centralWindowPhys;
0212   G4VPhysicalVolume*centralElectrode2Phys;
0213 G4VPhysicalVolume*fSecondCavityPhys;
0214   G4VPhysicalVolume*exitElectrodePhys;
0215   G4VPhysicalVolume* kaptonLayerPhys2;
0216   G4VPhysicalVolume*copperLayerPhys2;
0217   G4VPhysicalVolume*nickelLayerPhys2;
0218 
0219 G4VPhysicalVolume* exitWindowPhys;
0220 
0221   G4Material* CopperLayerMaterial;
0222   G4Material* NichelLayerMaterial;
0223   G4Material* KaptonLayerMaterial;
0224   G4Material* WindowMaterial;
0225   G4Material* CentralWindowMaterial;
0226   G4Material* wallMaterial;
0227   G4Material* ElectrodeMaterial;
0228   G4Material* CavityMaterial;
0229 
0230 
0231     G4VPhysicalVolume* physiNozzleSupport;
0232     G4VPhysicalVolume* physiHoleNozzleSupport;
0233     G4VPhysicalVolume* physiBrassTube;
0234     G4VPhysicalVolume* physiBrassTube2;
0235     G4VPhysicalVolume* physiBrassTube3;
0236     G4Tubs* solidFinalCollimator;
0237     G4VPhysicalVolume* physiFinalCollimator;
0238     
0239     G4VisAttributes* blue;
0240     G4VisAttributes* gray;
0241     G4VisAttributes* white;
0242     G4VisAttributes* red;
0243     G4VisAttributes* yellow;
0244     G4VisAttributes* green;
0245     G4VisAttributes* darkGreen;
0246     G4VisAttributes* darkOrange3;
0247     G4VisAttributes* skyBlue;
0248     
0249     G4Material* rangeShifterMaterial;
0250     G4Material* beamLineSupportMaterial;
0251     G4Material* vacuumZoneMaterial;
0252     G4Material* firstScatteringFoilMaterial;
0253     G4Material* kaptonWindowMaterial;
0254     G4Material* stopperMaterial;
0255     G4Material* secondScatteringFoilMaterial;
0256     G4Material* firstCollimatorMaterial;
0257     G4Material* holeFirstCollimatorMaterial;
0258     G4Material* modulatorBoxMaterial;
0259     G4Material* holeModulatorBoxMaterial;
0260  
0261     
0262     G4Material* nozzleSupportMaterial;
0263     G4Material* holeNozzleSupportMaterial;
0264     
0265     G4Material* brassTubeMaterial;
0266     G4Material* brassTube2Material;
0267     G4Material* brassTube3Material;
0268     G4Material* finalCollimatorMaterial;
0269     
0270     
0271     HadrontherapyDetectorROGeometry* RO;
0272     
0273     
0274 };
0275 #endif