Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // Hadrontherapy advanced example for Geant4 27 // See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy 28 29 #ifndef BESTPassiveProtonBeamLine_H 30 #define BESTPassiveProtonBeamLine_H 1 31 32 #include "globals.hh" 33 #include "G4VUserDetectorConstruction.hh" 34 #include "G4Box.hh" 35 #include "G4Tubs.hh" 36 #include "G4VisAttributes.hh" 37 #include "G4LogicalVolume.hh" 38 39 class G4VPhysicalVolume; 40 class HadrontherapyDetectorConstruction; 41 class HadrontherapyModulator; 42 class BESTPassiveProtonBeamLineMessenger; 43 class HadrontherapyDetectorROGeometry; 44 45 class BESTPassiveProtonBeamLine : public G4VUserDetectorConstruction 46 { 47 public: 48 49 BESTPassiveProtonBeamLine(); 50 ~BESTPassiveProtonBeamLine(); 51 // static G4bool doCalculation; 52 53 G4VPhysicalVolume* Construct(); 54 //***************************** PW **************NON SERVE************************* 55 56 static BESTPassiveProtonBeamLine* GetInstance(); 57 58 //***************************** PW **************NON SERVE************************* 59 60 void BESTBeamLineSupport(); 61 // Definition of the beam line support 62 63 void BESTBeamScatteringFoils(); 64 // Definition of the first scattering foil, 65 // of the Kapton window, of the stopper 66 67 void BESTRangeShifter(); 68 // This defines the "range shifter". Is is a slab 69 // (usually of PMMA" acting as energy degrader 70 // of primary beam 71 72 void BESTBeamCollimators(); 73 // Definition of the first collimator, of the range shifter, 74 // of the second collimator, of the first and second 75 // collimator modulators 76 77 void BESTBeamMonitoring(); 78 // Definition of three monitor chambers 79 80 81 void BESTBeamNozzle(); 82 // Definition of the beam noozle 83 84 void BESTBeamFinalCollimator(); 85 // Definition of the final collimator 86 87 // The following methods allow to change parameters 88 // of some beam line components 89 90 void SetRangeShifterXSize(G4double halfSize); 91 // This method allows to change the size of the range shifter along 92 // the X axis 93 94 void SetFirstScatteringFoilXSize(G4double); 95 // This method allows to change the size of the first scattering foil 96 // along the X axis 97 98 void SetSecondScatteringFoilXSize(G4double); 99 // This method allows to change the size of the second scattering foil 100 // along the X axis 101 102 void SetOuterRadiusStopper(G4double); 103 // This method allows to change the size of the outer radius of the stopper 104 105 void SetInnerRadiusFinalCollimator(G4double); 106 // This method allows to change the size of the inner radius of the 107 // final collimator 108 109 void SetRSMaterial(G4String); 110 // This method allows to change the material 111 // of the range shifter 112 113 void SetModulatorAngle(G4double angle); 114 // This method allows moving the modulator through UI commands 115 116 117 private: 118 static BESTPassiveProtonBeamLine* instance; 119 //passive proton line dimensions 120 void SetDefaultDimensions(); 121 void ConstructBESTPassiveProtonBeamLine(); 122 123 HadrontherapyModulator* modulator; // Pointer to the modulator 124 // geometry component 125 BESTPassiveProtonBeamLineMessenger* passiveMessenger; 126 G4VPhysicalVolume* physicalTreatmentRoom; 127 HadrontherapyDetectorConstruction* hadrontherapyDetectorConstruction; 128 129 130 G4Material* kapton; 131 132 G4double BESTvacuumZoneXSize; 133 G4double BESTvacuumZoneYSize; 134 G4double BESTvacuumZoneZSize; 135 G4double BESTvacuumZoneXPosition; 136 137 G4double BESTfirstScatteringFoilXSize; 138 G4double BESTfirstScatteringFoilYSize; 139 G4double BESTfirstScatteringFoilZSize; 140 G4double BESTfirstScatteringFoilXPosition; 141 142 G4double BESTkaptonWindowXSize; 143 G4double BESTkaptonWindowYSize; 144 G4double BESTkaptonWindowZSize; 145 G4double BESTkaptonWindowXPosition; 146 147 G4double BESTinnerRadiusStopper; 148 G4double BESTheightStopper; 149 G4double BESTstartAngleStopper; 150 G4double BESTspanningAngleStopper; 151 G4double BESTstopperXPosition; 152 G4double BESTstopperYPosition; 153 G4double BESTstopperZPosition; 154 G4double BESTouterRadiusStopper; 155 156 G4double BESTsecondScatteringFoilXSize; 157 G4double BESTsecondScatteringFoilYSize; 158 G4double BESTsecondScatteringFoilZSize; 159 G4double BESTsecondScatteringFoilXPosition; 160 G4double BESTsecondScatteringFoilYPosition; 161 G4double BESTsecondScatteringFoilZPosition; 162 163 G4double BESTrangeShifterXSize; 164 G4double BESTrangeShifterYSize; 165 G4double BESTrangeShifterZSize; 166 G4double BESTrangeShifterXPosition; 167 G4double BESTrangeShifterYPosition; 168 G4double BESTrangeShifterZPosition; 169 170 171 G4VPhysicalVolume* physiBeamLineSupport; 172 G4VPhysicalVolume* physiBeamLineCover; 173 G4VPhysicalVolume* physiBeamLineCover2; 174 G4Box* BESTfirstScatteringFoil; 175 G4VPhysicalVolume* physiBESTFirstScatteringFoil; 176 G4VPhysicalVolume* physiBESTKaptonWindow; 177 178 G4Tubs* solidBESTStopper; 179 G4VPhysicalVolume* physiBESTStopper; 180 G4LogicalVolume* logicBESTStopper; 181 182 G4Box* BESTsecondScatteringFoil; 183 G4VPhysicalVolume* physiBESTSecondScatteringFoil; 184 G4VPhysicalVolume* physiBESTFirstCollimator; 185 G4VPhysicalVolume* physiBESTHoleFirstCollimator; 186 G4Box* solidBESTRangeShifterBox; 187 G4LogicalVolume* logicBESTRangeShifterBox; 188 G4VPhysicalVolume* physiBESTRangeShifterBox; 189 G4VPhysicalVolume* physiBESTSecondCollimator; 190 G4VPhysicalVolume* physiBESTHoleSecondCollimator; 191 192 G4VPhysicalVolume* physiBESTFirstCollimatorModulatorBox; 193 G4VPhysicalVolume* physiBESTHoleFirstCollimatorModulatorBox; 194 195 G4VPhysicalVolume* physiBESTSecondCollimatorModulatorBox; 196 G4VPhysicalVolume* physiBESTHoleSecondCollimatorModulatorBox; 197 198 G4double BESTinnerRadiusFinalCollimator; 199 G4VPhysicalVolume* mother; 200 201 202 G4VPhysicalVolume* chamberPhys; 203 G4VPhysicalVolume*innerchamberPhys; 204 G4VPhysicalVolume*enterWindowPhys; 205 G4VPhysicalVolume*enterElectrodePhys; 206 G4VPhysicalVolume* kaptonLayerPhys1; 207 G4VPhysicalVolume*copperLayerPhys1; 208 G4VPhysicalVolume*nickelLayerPhys1; 209 G4VPhysicalVolume*fFirstCavityPhys; 210 G4VPhysicalVolume*centralElectrode1Phys; 211 G4VPhysicalVolume*centralWindowPhys; 212 G4VPhysicalVolume*centralElectrode2Phys; 213 G4VPhysicalVolume*fSecondCavityPhys; 214 G4VPhysicalVolume*exitElectrodePhys; 215 G4VPhysicalVolume* kaptonLayerPhys2; 216 G4VPhysicalVolume*copperLayerPhys2; 217 G4VPhysicalVolume*nickelLayerPhys2; 218 219 G4VPhysicalVolume* exitWindowPhys; 220 221 G4Material* CopperLayerMaterial; 222 G4Material* NichelLayerMaterial; 223 G4Material* KaptonLayerMaterial; 224 G4Material* WindowMaterial; 225 G4Material* CentralWindowMaterial; 226 G4Material* wallMaterial; 227 G4Material* ElectrodeMaterial; 228 G4Material* CavityMaterial; 229 230 231 G4VPhysicalVolume* physiNozzleSupport; 232 G4VPhysicalVolume* physiHoleNozzleSupport; 233 G4VPhysicalVolume* physiBrassTube; 234 G4VPhysicalVolume* physiBrassTube2; 235 G4VPhysicalVolume* physiBrassTube3; 236 G4Tubs* solidFinalCollimator; 237 G4VPhysicalVolume* physiFinalCollimator; 238 239 G4VisAttributes* blue; 240 G4VisAttributes* gray; 241 G4VisAttributes* white; 242 G4VisAttributes* red; 243 G4VisAttributes* yellow; 244 G4VisAttributes* green; 245 G4VisAttributes* darkGreen; 246 G4VisAttributes* darkOrange3; 247 G4VisAttributes* skyBlue; 248 249 G4Material* rangeShifterMaterial; 250 G4Material* beamLineSupportMaterial; 251 G4Material* vacuumZoneMaterial; 252 G4Material* firstScatteringFoilMaterial; 253 G4Material* kaptonWindowMaterial; 254 G4Material* stopperMaterial; 255 G4Material* secondScatteringFoilMaterial; 256 G4Material* firstCollimatorMaterial; 257 G4Material* holeFirstCollimatorMaterial; 258 G4Material* modulatorBoxMaterial; 259 G4Material* holeModulatorBoxMaterial; 260 261 262 G4Material* nozzleSupportMaterial; 263 G4Material* holeNozzleSupportMaterial; 264 265 G4Material* brassTubeMaterial; 266 G4Material* brassTube2Material; 267 G4Material* brassTube3Material; 268 G4Material* finalCollimatorMaterial; 269 270 271 HadrontherapyDetectorROGeometry* RO; 272 273 274 }; 275 #endif 276