Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:25

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 //  Author: F. Poignant, floriane.poignant@gmail.com
0027 //
0028 /// file STCyclotronDetectorConstruction.cc
0029 
0030 #ifndef STCyclotronDetectorConstruction_h
0031 #define STCyclotronDetectorConstruction_h 1
0032 
0033 #include "G4VUserDetectorConstruction.hh"
0034 #include "globals.hh"
0035 #include "G4PhysicalConstants.hh"
0036 #include <fstream>
0037 
0038 class G4VPhysicalVolume;
0039 class G4LogicalVolume;
0040 class G4Region;
0041 class G4Tubs;
0042 class G4Material;
0043 class STCyclotronDetectorMessenger;
0044 class G4Element;
0045 
0046 /// Detector construction class to define materials and geometry.
0047 
0048 class STCyclotronDetectorConstruction : public G4VUserDetectorConstruction
0049 {
0050 public:
0051   STCyclotronDetectorConstruction();
0052   ~STCyclotronDetectorConstruction();
0053     
0054   G4VPhysicalVolume* Construct();
0055   void ConstructSDandField();
0056   
0057   void SetTargetDiameter(G4double );
0058   void SetTargetIsotopeName(G4String );
0059   void SetTargetIsotopeZ(G4double );
0060   void SetTargetIsotopeN(G4int );
0061   void SetTargetIsotopeA(G4double );
0062   void SetTargetElementName(G4String );
0063   void SetTargetElementSymbole(G4String );
0064   void SetTargetElementNComponents(G4int );
0065   void SetTargetElementAbundance(G4double );
0066   void SetTargetMaterialDensity(G4double );
0067   void SetTargetMaterialNComponents(G4int );
0068   void SetTargetMaterialFractionMass(G4double );
0069   void SetTargetNaturalElement(G4String );
0070   void SetTargetNaturalMaterialFractionMass(G4double );
0071   G4bool UpdateMaterial();
0072   void SetTargetMaterial(G4String );
0073 
0074   void SetFoilIsotopeName(G4String );
0075   void SetFoilIsotopeZ(G4double );
0076   void SetFoilIsotopeN(G4int );
0077   void SetFoilIsotopeA(G4double );
0078   void SetFoilElementName(G4String );
0079   void SetFoilElementSymbole(G4String );
0080   void SetFoilElementNComponents(G4int );
0081   void SetFoilElementAbundance(G4double );
0082   void SetFoilMaterialDensity(G4double );
0083   void SetFoilMaterialNComponents(G4int );
0084   void SetFoilMaterialFractionMass(G4double );
0085   void SetFoilNaturalElement(G4String );
0086   void SetFoilNaturalMaterialFractionMass(G4double );
0087   G4bool UpdateFoilMaterial();
0088   void SetFoilMaterial(G4String );
0089 
0090   void SetTargetThickness(G4double );
0091   void SetFoilThickness(G4double );
0092   
0093   //Get methods
0094   inline G4double GetTargetPosition1(){return fLayer1_z_position_PART4 + 0.5*11.5 - fTarget_thickness;}
0095   inline G4double GetTargetPosition2(){return fLayer1_z_position_PART4 + 0.5*11.5;}
0096   inline G4double GetVolumeTarget(){return pi*fTarget_diameter*fTarget_diameter/4*fTarget_thickness;}
0097   inline G4double GetFoilPosition1(){return fZ_foil_position - 0.5*fFoil_thickness;}
0098   inline G4double GetTargetVolume(){return fTargetVolume;}
0099   inline G4double GetFoilVolume(){return fFoilVolume;}
0100   inline G4double GetFoilThickness(){return fFoil_thickness;}
0101   inline G4double GetTargetThickness(){return fTarget_thickness;}
0102   inline G4double GetTargetDiameter(){return fTarget_diameter;}
0103   
0104 private:
0105 
0106   STCyclotronDetectorMessenger* fDetectorMessenger;
0107 
0108   //Messenger parameters
0109   G4double fTarget_diameter;
0110   std::vector<G4String> fIsotopeName;
0111   std::vector<G4double> fIsotopeZ;
0112   std::vector<G4int>    fIsotopeN;
0113   std::vector<G4double> fIsotopeA;
0114   std::vector<G4String> fElementName;
0115   std::vector<G4String> fElementSymbole;
0116   std::vector<G4int>    fElementNComponents;
0117   std::vector<G4double> fElementAbundance;
0118   std::vector<G4String> fNaturalElementName;
0119   std::vector<G4double> fNaturalMaterialFractionMass;
0120   G4double fDensity_target;
0121   G4int    fTarget_NComponents;
0122   std::vector<G4double> fMaterialFractionMass;
0123 
0124   std::vector<G4String> fIsotopeNameFoil;
0125   std::vector<G4double> fIsotopeZFoil;
0126   std::vector<G4int>    fIsotopeNFoil;
0127   std::vector<G4double> fIsotopeAFoil;
0128   std::vector<G4String> fElementNameFoil;
0129   std::vector<G4String> fElementSymboleFoil;
0130   std::vector<G4int>    fElementNComponentsFoil;
0131   std::vector<G4double> fElementAbundanceFoil;
0132   std::vector<G4String> fNaturalElementNameFoil;
0133   std::vector<G4double> fNaturalMaterialFractionMassFoil;
0134   G4double fDensity_foil;
0135   G4int    fFoil_NComponents;
0136   std::vector<G4double> fMaterialFractionMassFoil;
0137 
0138   G4double fTarget_thickness;
0139   G4double fFoil_thickness;
0140 
0141   //Parameters that are used/modified in the set methods
0142   //When modifying the target parameters
0143  
0144   //Material
0145   G4Material* fTarget_Material;
0146   G4Material* fFoil_Material;
0147   //Foil
0148   G4double fZ_foil_position;
0149   G4Tubs* fSolidFoil;
0150   G4LogicalVolume* fLogicFoil;
0151   G4VPhysicalVolume* fPhysFoil;
0152   //WORLD
0153   G4LogicalVolume* fLogicWorld;
0154   //PART 3
0155   G4double fLayer_z_position_PART3;
0156   G4VPhysicalVolume* fPhysLayer_PART3;
0157   G4VPhysicalVolume* fPhysTube_PART3;
0158   //PART 4
0159   G4double fTube_outerRadius_PART4;
0160   G4double fTube_length_PART4;
0161   G4double fLayer_z_position_PART4;
0162   G4VPhysicalVolume* fPhysTube_PART4;
0163   G4VPhysicalVolume* fPhysLayer_PART4;
0164   G4double fLayer1_z_position_PART4;
0165   G4VPhysicalVolume* fPhysLayer1_PART4;
0166   //Target
0167   G4LogicalVolume* fLogicTarget;
0168   G4double fTarget_z_position;
0169   G4Tubs* fSolidTarget;
0170   G4VPhysicalVolume* fPhysTarget;
0171   //PART 5 
0172   G4double fLayer1_z_position_PART5;
0173   G4VPhysicalVolume* fPhysLayer1_PART5;
0174   G4double fLayer2_z_position_PART5;
0175   G4VPhysicalVolume* fPhysLayer2_PART5;
0176   G4double fLayer3_z_position_PART5;
0177   G4VPhysicalVolume* fPhysLayer3_PART5;
0178   
0179   G4Region* fRegionTarget;
0180   G4Region* fRegionFoil;
0181 
0182   G4double fTargetVolume;
0183   G4double fFoilVolume;
0184   
0185   std::ofstream fParametersSummary;
0186 
0187 };
0188 #endif