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 PassiveCarbonBeamLine_H
0030 #define PassiveCarbonBeamLine_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 #include "G4Trd.hh"
0039 #include "PassiveCarbonBeamLineMessenger.hh"
0040 
0041 class G4VPhysicalVolume;
0042 class HadrontherapyDetectorConstruction;
0043 class HadrontherapyDetectorROGeometry;
0044 class PassiveCarbonBeamLineMessenger;
0045 
0046 class PassiveCarbonBeamLine : public G4VUserDetectorConstruction
0047 {
0048 public:
0049     
0050     PassiveCarbonBeamLine();
0051     ~PassiveCarbonBeamLine();
0052     
0053     G4VPhysicalVolume* Construct();
0054     
0055     void HadrontherapyBeamLineSupport();
0056     // Definition of the beam line support
0057     
0058     void VacuumToAirInterface();
0059     
0060     void HadrontherapyBeamMonitoring();
0061     // Definition of three monitor chambers
0062     
0063     void HadrontherapyBeamNozzle();
0064     // Definition of the beam noozle
0065     
0066     void HadrontherapyBeamFinalCollimator();
0067     // Definition of the final collimator
0068     
0069     void HadrontherapyPMMACollimator();
0070     // Definition of the PMMA collimator
0071     
0072     void HadrontherapyRippleFilter();
0073     // Definition of the ripple filter
0074     
0075     void StopperCostruction();
0076     void HadrontherapyRidgeFilter();
0077     void SetInnerRadiusFinalCollimator(G4double);
0078     // This method allows to change the size of the inner radius of the
0079     // final collimator
0080     
0081     void SetRippleFilterMaterial(G4String);
0082     // This method allows to change the material
0083     // of the ripple filter
0084     
0085     void SetRippleFilterXPosition(G4double);
0086     
0087     // The following methods allow to change parameters
0088     // of some beam line components
0089     
0090     G4Material* kapton;
0091     G4VisAttributes* redWire;
0092     G4VPhysicalVolume* mother;
0093 private:
0094     static PassiveCarbonBeamLine* instance;
0095     //passive carbon line dimensions
0096     void SetDefaultDimensions();
0097     void ConstructPassiveCarbonBeamLine();
0098     
0099     PassiveCarbonBeamLineMessenger* PassiveCarbonMessenger;
0100     G4VPhysicalVolume* physicalTreatmentRoom;
0101     HadrontherapyDetectorConstruction* hadrontherapyDetectorConstruction;
0102     
0103     ///////////////////////////////////////////////////////////////////////////
0104     // Definitions of all volumes
0105     // World (experimental hall)
0106     G4Box* treatmentRoom;
0107     G4LogicalVolume* logicTreatmentRoom;
0108     
0109     
0110     // Beamline support
0111     G4Box* beamLineSupport;
0112     G4LogicalVolume* logicBeamLineSupport;
0113     G4VPhysicalVolume* physiBeamLineSupport;
0114     
0115     // Beamline covers
0116     G4Box* beamLineCover;
0117     G4LogicalVolume* logicBeamLineCover;
0118     G4VPhysicalVolume* physiBeamLineCover;
0119     G4VPhysicalVolume* physiBeamLineCover2;
0120     
0121     // Vacuum pipe
0122     G4Box* vacuumZone;
0123     G4LogicalVolume* logicVacuumZone;
0124     G4VPhysicalVolume* physiVacuumZone;
0125     
0126     // Scattering foil
0127     G4Box* firstScatteringFoil;
0128     G4LogicalVolume* logicFirstScatteringFoil;
0129     G4VPhysicalVolume* physiFirstScatteringFoil;
0130     
0131     // Kapton window
0132     G4Box* solidKaptonWindow;
0133     G4LogicalVolume* logicKaptonWindow;
0134     G4VPhysicalVolume* physiKaptonWindow;
0135     
0136     //Ripple filter
0137     G4Box* SolidRippleFilter;
0138     G4LogicalVolume* LogicRippleFilter;
0139     G4VPhysicalVolume* PhysiRippleFilter;
0140     
0141     G4Box* SolidRippleFilterBase;
0142     G4LogicalVolume* LogicRippleFilterBase;
0143     G4VPhysicalVolume* PhysiRippleFilterBase;
0144     
0145     G4Trd* SolidRippleFilterTrd;
0146     G4LogicalVolume* LogicRippleFilterTrd;
0147     G4VPhysicalVolume* PhysiRippleFilterTrd;
0148     
0149     
0150     //
0151     G4Box* supportFoil;
0152     G4LogicalVolume* LogicSupportFoil;
0153     G4VPhysicalVolume* PhysiSupportFoil;
0154     //
0155     G4Tubs* stopper;
0156     G4LogicalVolume* LogicStopper;
0157     G4VPhysicalVolume* PhysicStopper;
0158     //Ridge filter
0159     G4Box* SolidRidgeBase;
0160     G4LogicalVolume* LogicRidgeBase;
0161     G4VPhysicalVolume* PhysiRidgeFilterBase;
0162     
0163     G4Box* SolidRidgeMother;
0164     G4LogicalVolume* LogicRidgeMother;
0165    // G4VPhysicalVolume* PhysiRidgeMother;
0166     
0167     
0168     // PMMA Collimator
0169     G4Box* solidPMMACollimatorSupport;
0170     G4LogicalVolume* logicPMMACollimatorSupport;
0171     G4VPhysicalVolume* physiPMMACollimatorSupport;
0172     
0173     G4Tubs* solidPMMACollimator;
0174     G4LogicalVolume* logicPMMACollimator;
0175     G4VPhysicalVolume* physiPMMACollimator;
0176     
0177     // Monitor chamber
0178     G4Box* solidFirstMonitorLayer1;
0179     G4LogicalVolume* logicFirstMonitorLayer1;
0180     G4VPhysicalVolume* physiFirstMonitorLayer1;
0181     
0182     G4Box* solidFirstMonitorLayer2;
0183     G4LogicalVolume* logicFirstMonitorLayer2;
0184     G4VPhysicalVolume* physiFirstMonitorLayer2;
0185     
0186     G4Box* solidFirstMonitorLayer3;
0187     G4LogicalVolume* logicFirstMonitorLayer3;
0188     G4VPhysicalVolume* physiFirstMonitorLayer3;
0189     
0190     G4Box* solidFirstMonitorLayer4;
0191     G4LogicalVolume* logicFirstMonitorLayer4;
0192     G4VPhysicalVolume* physiFirstMonitorLayer4;
0193     
0194     // Final nozzle and collimator
0195     G4Box* solidNozzleSupport;
0196     G4LogicalVolume* logicNozzleSupport;
0197     G4VPhysicalVolume* physiNozzleSupport;
0198     
0199     G4Tubs* solidHoleNozzleSupport;
0200     G4LogicalVolume* logicHoleNozzleSupport;
0201     G4VPhysicalVolume* physiHoleNozzleSupport;
0202     
0203     G4Tubs* solidBrassTube3;
0204     G4LogicalVolume* logicBrassTube3;
0205     G4VPhysicalVolume* physiBrassTube3;
0206     
0207     G4Tubs* solidBrassTube2;
0208     G4LogicalVolume* logicBrassTube2;
0209     G4VPhysicalVolume* physiBrassTube2;
0210     
0211     G4Tubs* solidBrassTube;
0212     G4LogicalVolume* logicBrassTube;
0213     G4VPhysicalVolume* physiBrassTube;
0214     
0215     // Final collimator
0216     G4Tubs* solidFinalCollimator;
0217     G4VPhysicalVolume* physiFinalCollimator;
0218     G4LogicalVolume* logicFinalCollimator;
0219     
0220     ///////////////////////////////////////////////////////////////////////////
0221     // Dimensions and positions of all volumes
0222     // Beamline support
0223     G4double beamLineSupportXSize;
0224     G4double beamLineSupportYSize;
0225     G4double beamLineSupportZSize;
0226     G4double beamLineSupportXPosition;
0227     G4double beamLineSupportYPosition;
0228     G4double beamLineSupportZPosition;
0229     
0230     // Beamline covers
0231     G4double beamLineCoverXSize;
0232     G4double beamLineCoverYSize;
0233     G4double beamLineCoverZSize;
0234     G4double beamLineCoverXPosition;
0235     G4double beamLineCoverYPosition;
0236     G4double beamLineCoverZPosition;
0237     
0238     // vacuum pipe
0239     G4double vacuumZoneXSize;
0240     G4double vacuumZoneYSize;
0241     G4double vacuumZoneZSize;
0242     G4double vacuumPipeXPosition;
0243     
0244     // Scattering foil
0245     G4double firstScatteringFoilXSize;
0246     G4double firstScatteringFoilYSize;
0247     G4double firstScatteringFoilZSize;
0248     G4double firstScatteringFoilXPosition;
0249     
0250     // kapton Windows
0251     G4double kaptonWindowXSize;
0252     G4double kaptonWindowYSize;
0253     G4double kaptonWindowZSize;
0254     G4double kaptonWindowXPosition;
0255     
0256     // PMMA Collimator
0257     G4double PMMACollimatorSupportXSize;
0258     G4double PMMACollimatorSupportYSize;
0259     G4double PMMACollimatorSupportZSize;
0260     G4double PMMACollimatorXPosition;
0261     G4double innerRadiusPMMACollimator;
0262     G4double outerRadiusPMMACollimator;
0263     G4double hightPMMACollimator;
0264     G4double startAnglePMMACollimator;
0265     G4double spanningAnglePMMACollimator;
0266     
0267     // Monitor chamber
0268     G4double monitor1XSize;
0269     G4double monitor2XSize;
0270     G4double monitor3XSize;
0271     G4double monitorYSize;
0272     G4double monitorZSize;
0273     G4double monitor1XPosition;
0274     G4double monitor2XPosition;
0275     G4double monitor4XPosition;
0276     
0277     // Final nozzle and collimator
0278     G4double nozzleSupportXSize;
0279     G4double nozzleSupportYSize;
0280     G4double nozzleSupportZSize;
0281     G4double nozzleSupportXPosition;
0282     
0283     G4double innerRadiusHoleNozzleSupport;
0284     G4double outerRadiusHoleNozzleSupport;
0285     G4double hightHoleNozzleSupport;
0286     G4double startAngleHoleNozzleSupport;
0287     G4double spanningAngleHoleNozzleSupport;
0288     
0289     G4double innerRadiusBrassTube3;
0290     G4double outerRadiusBrassTube3;
0291     G4double hightBrassTube3;
0292     G4double startAngleBrassTube3;
0293     G4double spanningAngleBrassTube3;
0294     G4double brassTube3XPosition;
0295     
0296     G4double innerRadiusBrassTube2;
0297     G4double outerRadiusBrassTube2;
0298     G4double hightBrassTube2;
0299     G4double startAngleBrassTube2;
0300     G4double spanningAngleBrassTube2;
0301     
0302     G4double innerRadiusBrassTube;
0303     G4double outerRadiusBrassTube;
0304     G4double hightBrassTube;
0305     G4double startAngleBrassTube;
0306     G4double spanningAngleBrassTube;
0307     G4double brassTubeXPosition;
0308     
0309     // Final collimator
0310     G4double outerRadiusFinalCollimator;
0311     G4double innerRadiusFinalCollimator;
0312     G4double hightFinalCollimator;
0313     G4double startAngleFinalCollimator;
0314     G4double spanningAngleFinalCollimator;
0315     G4double finalCollimatorXPosition;
0316     
0317     // Colors
0318     G4VisAttributes* blue;
0319     G4VisAttributes* gray;
0320     G4VisAttributes* white;
0321     G4VisAttributes* red;
0322     G4VisAttributes* yellow;
0323     G4VisAttributes* green;
0324     G4VisAttributes* darkGreen;
0325     G4VisAttributes* darkOrange3;
0326     G4VisAttributes* skyBlue;
0327     G4VisAttributes* black;
0328     
0329     // Elements, compounds and materials
0330     G4Material *aluminumNist;
0331     G4Material* copperNistMaterial;
0332     G4Material* airNist;
0333     G4Material* kaptonNist;
0334     G4Material* galacticNist;
0335     G4Material* PMMANist;
0336     G4Material* tantalumNist;
0337     G4Material* brass;
0338     
0339     G4Material* beamLineSupportMaterial;
0340     G4Material* vacuumZoneMaterial;
0341     G4Material* kaptonWindowMaterial;
0342     G4Material* firstScatteringFoilMaterial;
0343     
0344     G4Material* layer1MonitorChamberMaterial;
0345     G4Material* layer2MonitorChamberMaterial;
0346     G4Material* layer3MonitorChamberMaterial;
0347     G4Material* layer4MonitorChamberMaterial;
0348     G4Material* nozzleSupportMaterial;
0349     G4Material* holeNozzleSupportMaterial;
0350     G4Material* seconHoleNozzleSupportMaterial;
0351     G4Material* brassTubeMaterial;
0352     G4Material* brassTube2Material;
0353     G4Material* brassTube3Material;
0354     G4Material* finalCollimatorMaterial;
0355     G4Material* PMMACollimatorMaterial;
0356     G4Material* rippleFilterMaterial;
0357     G4Material* rippleFilterBoxMaterial;
0358     
0359     HadrontherapyDetectorROGeometry* RO;
0360     
0361     G4VPhysicalVolume* PhysiTrapp1;
0362     G4VPhysicalVolume* PhysiTrapp2;
0363     G4VPhysicalVolume* PhysiTrapp3;
0364     G4VPhysicalVolume* PhysiTrapp4;
0365     G4VPhysicalVolume* PhysiTrapp5;
0366     G4VPhysicalVolume* PhysiTrapp6;
0367     G4VPhysicalVolume* PhysiTrapp7;
0368     G4VPhysicalVolume* PhysiTrapp8;
0369     G4VPhysicalVolume* PhysiTrapp9;
0370     G4VPhysicalVolume* PhysiTrapp10;
0371     G4VPhysicalVolume* PhysiTrapp11;
0372     G4VPhysicalVolume* PhysiTrapp12;
0373     G4VPhysicalVolume* PhysiTrapp13;
0374     G4VPhysicalVolume* PhysiTrapp14;
0375     G4VPhysicalVolume* PhysiTrapp15;
0376     G4VPhysicalVolume* PhysiTrapp16;
0377     
0378     
0379 };
0380 #endif
0381