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 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  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 PassiveProtonBeamLine_H
 30 #define PassiveProtonBeamLine_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 PassiveProtonBeamLineMessenger;
 43 class HadrontherapyDetectorROGeometry;
 44 
 45 class PassiveProtonBeamLine : public G4VUserDetectorConstruction
 46 {
 47 public:
 48 
 49     PassiveProtonBeamLine();
 50     ~PassiveProtonBeamLine();
 51   // static G4bool doCalculation;
 52     
 53     G4VPhysicalVolume* Construct();
 54     //***************************** PW **************NON SERVE*************************
 55     
 56     static PassiveProtonBeamLine* GetInstance();
 57     
 58     //***************************** PW **************NON SERVE*************************
 59     
 60     void HadrontherapyBeamLineSupport();
 61     // Definition of the beam line support
 62     
 63     void HadrontherapyBeamScatteringFoils();
 64     // Definition of the first scattering foil,
 65     // of the Kapton window, of the stopper
 66     
 67     void HadrontherapyRangeShifter();
 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 HadrontherapyBeamCollimators();
 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 HadrontherapyBeamMonitoring();
 78     // Definition of three monitor chambers
 79     
 80     void HadrontherapyMOPIDetector();
 81     // Construct the MOPI on-line detector
 82     
 83     void HadrontherapyBeamNozzle();
 84     // Definition of the beam noozle
 85     
 86     void HadrontherapyBeamFinalCollimator();
 87     // Definition of the final collimator
 88     
 89     // The following methods allow to change parameters
 90     // of some beam line components
 91     
 92     void SetRangeShifterXPosition(G4double value);
 93     // This method allows to move the Range Shifter along
 94     // the X axis
 95     
 96     void SetRangeShifterXSize(G4double halfSize);
 97     // This method allows to change the size of the range shifter along
 98     // the X axis
 99     
100     void SetFirstScatteringFoilXSize(G4double);
101     // This method allows to change the size of the first scattering foil
102     // along the X axis
103     
104     void SetSecondScatteringFoilXSize(G4double);
105     // This method allows to change the size of the second scattering foil
106     // along the X axis
107     
108     void SetOuterRadiusStopper(G4double);
109     // This method allows to change the size of the outer radius of the stopper
110     
111     void SetInnerRadiusFinalCollimator(G4double);
112     // This method allows to change the size of the inner radius of the
113     // final collimator
114     
115     void SetRSMaterial(G4String);
116     // This method allows to change the material
117     // of the range shifter
118     
119     void SetModulatorAngle(G4double angle);
120     // This method allows moving the modulator through UI commands
121     
122     
123 private:
124     static PassiveProtonBeamLine* instance;
125     //passive proton line dimensions
126     void SetDefaultDimensions();
127     void ConstructPassiveProtonBeamLine();
128     
129     HadrontherapyModulator* modulator; // Pointer to the modulator
130     // geometry component
131     PassiveProtonBeamLineMessenger* passiveMessenger;
132     G4VPhysicalVolume* physicalTreatmentRoom;
133     HadrontherapyDetectorConstruction* hadrontherapyDetectorConstruction;
134     
135     
136     G4Material* kapton;
137   
138     G4double vacuumZoneXSize;
139     G4double vacuumZoneYSize;
140     G4double vacuumZoneZSize;
141     G4double vacuumZoneXPosition;
142     
143     G4double firstScatteringFoilXSize;
144     G4double firstScatteringFoilYSize;
145     G4double firstScatteringFoilZSize;
146     G4double firstScatteringFoilXPosition;
147     
148     G4double kaptonWindowXSize;
149     G4double kaptonWindowYSize;
150     G4double kaptonWindowZSize;
151     G4double kaptonWindowXPosition;
152     
153     G4double innerRadiusStopper;
154     G4double heightStopper;
155     G4double startAngleStopper;
156     G4double spanningAngleStopper;
157     G4double stopperXPosition;
158     G4double stopperYPosition;
159     G4double stopperZPosition;
160     G4double outerRadiusStopper;
161     
162     G4double secondScatteringFoilXSize;
163     G4double secondScatteringFoilYSize;
164     G4double secondScatteringFoilZSize;
165     G4double secondScatteringFoilXPosition;
166     G4double secondScatteringFoilYPosition;
167     G4double secondScatteringFoilZPosition;
168     
169     G4double rangeShifterXSize;
170     G4double rangeShifterYSize;
171     G4double rangeShifterZSize;
172     G4double rangeShifterXPosition;
173     G4double rangeShifterYPosition;
174     G4double rangeShifterZPosition;
175     
176     
177     G4VPhysicalVolume* physiBeamLineSupport;
178     G4VPhysicalVolume* physiBeamLineCover;
179     G4VPhysicalVolume* physiBeamLineCover2;
180     G4Box* firstScatteringFoil;
181     G4VPhysicalVolume* physiFirstScatteringFoil;
182     G4VPhysicalVolume* physiKaptonWindow;
183     
184     G4Tubs* solidStopper;
185     G4VPhysicalVolume* physiStopper;
186     G4LogicalVolume* logicStopper;
187     
188     G4Box* secondScatteringFoil;
189     G4VPhysicalVolume* physiSecondScatteringFoil;
190     G4VPhysicalVolume* physiFirstCollimator;
191     G4VPhysicalVolume* physiHoleFirstCollimator;
192     G4Box* solidRangeShifterBox;
193     G4LogicalVolume* logicRangeShifterBox;
194     G4VPhysicalVolume* physiRangeShifterBox;
195     G4VPhysicalVolume* physiSecondCollimator;
196     G4VPhysicalVolume* physiHoleSecondCollimator;
197     
198     G4VPhysicalVolume* physiFirstCollimatorModulatorBox;
199     G4VPhysicalVolume* physiHoleFirstCollimatorModulatorBox;
200     
201     G4VPhysicalVolume* physiSecondCollimatorModulatorBox;
202     G4VPhysicalVolume* physiHoleSecondCollimatorModulatorBox;
203     
204     // MOPI Detector
205     // Mother volume
206     G4VPhysicalVolume* physiMOPIMotherVolume;
207     G4LogicalVolume* logicMOPIMotherVolume;
208     G4Box* solidMOPIMotherVolume;
209     
210     G4double MOPIMotherVolumeXSize;
211     G4double MOPIMotherVolumeYSize;
212     G4double MOPIMotherVolumeZSize;
213     G4double MOPIMotherVolumeXPosition;
214     G4double MOPIMotherVolumeYPosition;
215     G4double MOPIMotherVolumeZPosition;
216     
217     // First Kapton layer
218     G4double MOPIFirstKaptonLayerXSize;
219     G4double MOPIFirstKaptonLayerYSize;
220     G4double MOPIFirstKaptonLayerZSize;
221     G4double MOPIFirstKaptonLayerXPosition;
222     G4double MOPIFirstKaptonLayerYPosition;
223     G4double MOPIFirstKaptonLayerZPosition;
224     G4Box* solidMOPIFirstKaptonLayer;
225     G4LogicalVolume* logicMOPIFirstKaptonLayer;
226     G4VPhysicalVolume* physiMOPIFirstKaptonLayer;
227     
228     // First Aluminum layer
229     G4double MOPIFirstAluminumLayerXSize;
230     G4double MOPIFirstAluminumLayerYSize;
231     G4double MOPIFirstAluminumLayerZSize;
232     G4double MOPIFirstAluminumLayerXPosition;
233     G4double MOPIFirstAluminumLayerYPosition;
234     G4double MOPIFirstAluminumLayerZPosition;
235     G4Box* solidMOPIFirstAluminumLayer;
236     G4LogicalVolume* logicMOPIFirstAluminumLayer;
237     G4VPhysicalVolume* physiMOPIFirstAluminumLayer;
238     
239     // First Air Gap
240     G4double MOPIFirstAirGapXSize;
241     G4double MOPIFirstAirGapYSize;
242     G4double MOPIFirstAirGapZSize;
243     G4double MOPIFirstAirGapXPosition;
244     G4double MOPIFirstAirGapYPosition;
245     G4double MOPIFirstAirGapZPosition;
246     G4Box* solidMOPIFirstAirGap;
247     G4LogicalVolume* logicMOPIFirstAirGap;
248     G4VPhysicalVolume* physiMOPIFirstAirGap;
249     
250     // Cathode
251     G4double MOPICathodeXSize;
252     G4double MOPICathodeYSize;
253     G4double MOPICathodeZSize;
254     G4double MOPICathodeXPosition;
255     G4double MOPICathodeYPosition;
256     G4double MOPICathodeZPosition;
257     G4Box* solidMOPICathode;
258     G4LogicalVolume* logicMOPICathode;
259     G4VPhysicalVolume* physiMOPICathode;
260     
261     G4VisAttributes* redWire;
262     
263     // First Air Gap
264     G4double MOPISecondAirGapXSize;
265     G4double MOPISecondAirGapYSize;
266     G4double MOPISecondAirGapZSize;
267     G4double MOPISecondAirGapXPosition;
268     G4double MOPISecondAirGapYPosition;
269     G4double MOPISecondAirGapZPosition;
270     G4Box* solidMOPISecondAirGap;
271     G4LogicalVolume* logicMOPISecondAirGap;
272     G4VPhysicalVolume* physiMOPISecondAirGap;
273     
274     // First Aluminum layer
275     G4double MOPISecondAluminumLayerXSize;
276     G4double MOPISecondAluminumLayerYSize;
277     G4double MOPISecondAluminumLayerZSize;
278     G4double MOPISecondAluminumLayerXPosition;
279     G4double MOPISecondAluminumLayerYPosition;
280     G4double MOPISecondAluminumLayerZPosition;
281     G4Box* solidMOPISecondAluminumLayer;
282     G4LogicalVolume* logicMOPISecondAluminumLayer;
283     G4VPhysicalVolume* physiMOPISecondAluminumLayer;
284     
285     // Second Kapton layer
286     G4double MOPISecondKaptonLayerXSize;
287     G4double MOPISecondKaptonLayerYSize;
288     G4double MOPISecondKaptonLayerZSize;
289     G4double MOPISecondKaptonLayerXPosition;
290     G4double MOPISecondKaptonLayerYPosition;
291     G4double MOPISecondKaptonLayerZPosition;
292     G4Box* solidMOPISecondKaptonLayer;
293     G4LogicalVolume* logicMOPISecondKaptonLayer;
294     G4VPhysicalVolume* physiMOPISecondKaptonLayer;
295     
296     G4double innerRadiusFinalCollimator;
297     G4VPhysicalVolume* mother;
298     
299     G4VPhysicalVolume* physiFirstMonitorLayer1;
300     G4VPhysicalVolume* physiFirstMonitorLayer2;
301     G4VPhysicalVolume* physiFirstMonitorLayer3;
302     G4VPhysicalVolume* physiFirstMonitorLayer4;
303     G4VPhysicalVolume* physiSecondMonitorLayer1;
304     G4VPhysicalVolume* physiSecondMonitorLayer2;
305     G4VPhysicalVolume* physiSecondMonitorLayer3;
306     G4VPhysicalVolume* physiSecondMonitorLayer4;
307     G4VPhysicalVolume* physiNozzleSupport;
308     G4VPhysicalVolume* physiHoleNozzleSupport;
309     G4VPhysicalVolume* physiBrassTube;
310     G4VPhysicalVolume* physiBrassTube2;
311     G4VPhysicalVolume* physiBrassTube3;
312     G4Tubs* solidFinalCollimator;
313     G4VPhysicalVolume* physiFinalCollimator;
314     
315     G4VisAttributes* blue;
316     G4VisAttributes* gray;
317     G4VisAttributes* white;
318     G4VisAttributes* red;
319     G4VisAttributes* yellow;
320     G4VisAttributes* green;
321     G4VisAttributes* darkGreen;
322     G4VisAttributes* darkOrange3;
323     G4VisAttributes* skyBlue;
324     
325     G4Material* rangeShifterMaterial;
326     G4Material* beamLineSupportMaterial;
327     G4Material* vacuumZoneMaterial;
328     G4Material* firstScatteringFoilMaterial;
329     G4Material* kaptonWindowMaterial;
330     G4Material* stopperMaterial;
331     G4Material* secondScatteringFoilMaterial;
332     G4Material* firstCollimatorMaterial;
333     G4Material* holeFirstCollimatorMaterial;
334     G4Material* modulatorBoxMaterial;
335     G4Material* holeModulatorBoxMaterial;
336     G4Material* layer1MonitorChamberMaterial;
337     G4Material* layer2MonitorChamberMaterial;
338     G4Material* layer3MonitorChamberMaterial;
339     G4Material* layer4MonitorChamberMaterial;
340     G4Material* MOPIMotherVolumeMaterial;
341     G4Material* MOPIFirstKaptonLayerMaterial;
342     G4Material* MOPIFirstAluminumLayerMaterial;
343     G4Material* MOPIFirstAirGapMaterial;
344     G4Material* MOPICathodeMaterial;
345     G4Material* MOPISecondAirGapMaterial;
346     G4Material* MOPISecondAluminumLayerMaterial;
347     G4Material* MOPISecondKaptonLayerMaterial;
348     G4Material* nozzleSupportMaterial;
349     G4Material* holeNozzleSupportMaterial;
350     
351     G4Material* brassTubeMaterial;
352     G4Material* brassTube2Material;
353     G4Material* brassTube3Material;
354     G4Material* finalCollimatorMaterial;
355     
356     
357     HadrontherapyDetectorROGeometry* RO;
358     
359     
360 };
361 #endif
362