Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-10 08:06: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 /// \file DetectorConstruction.hh
0027 /// \brief Definition of the DetectorConstruction class
0028 //
0029 //
0030 
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 
0034 #ifndef DetectorConstruction_H
0035 #define DetectorConstruction_H 1
0036 
0037 #include "G4VUserDetectorConstruction.hh"
0038 #include "globals.hh"
0039 
0040 class G4LogicalVolume;
0041 class G4VPhysicalVolume;
0042 class G4FieldManager;
0043 class G4UniformMagField;
0044 class G4Material;
0045 class DetectorMessenger;
0046 
0047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0048 
0049 class DetectorConstruction : public G4VUserDetectorConstruction
0050 {
0051   public:
0052     DetectorConstruction();
0053     ~DetectorConstruction();
0054 
0055     G4VPhysicalVolume* Construct();
0056     void ConstructSDandField();
0057 
0058     void SetMagField(const G4double fieldValue);
0059     void SetAbsorberMaterial(const G4String name);
0060     void SetActiveMaterial(const G4String name);
0061     // Use by the messenger.
0062 
0063     inline G4Material* GetAbsorberMaterial() const;
0064     inline G4Material* GetActiveMaterial() const;
0065 
0066     inline void SetIsCalHomogeneous(const G4bool choice);
0067     inline void SetIsUnitInLambda(const G4bool choice);
0068     inline void SetAbsorberTotalLength(const G4double value);
0069     inline void SetCalorimeterRadius(const G4double value);
0070     inline void SetActiveLayerNumber(const G4int value);
0071     inline void SetActiveLayerSize(const G4double value);
0072     // To define the calorimeter geometry.
0073 
0074     inline void SetIsRadiusUnitInLambda(const G4bool choice);
0075 
0076     void UpdateGeometry();
0077 
0078     inline G4double GetCaloLength() const;
0079 
0080   private:
0081     void DefineMaterials();
0082     // Define all the materials.
0083 
0084     G4VPhysicalVolume* ConstructCalorimeter();
0085     // To be invoked each time the geometry needs to be updated.
0086 
0087     G4bool AreParametersOK();
0088     // Return true if all the parameters are sensible, false otherwise.
0089 
0090     void PrintParameters();
0091     // Print the various parameters which define the calorimeter.
0092 
0093     G4Material* fVacuum;
0094     G4Material* fIron;
0095     G4Material* fCopper;
0096     G4Material* fTungsten;
0097     G4Material* fLead;
0098     G4Material* fUranium;
0099     G4Material* fPbWO4;
0100     G4Material* fPolystyrene;
0101     G4Material* fLiquidArgon;
0102     G4Material* fSilicon;
0103     G4Material* fQuartz;
0104     G4Material* fBrass;
0105     G4Material* fAluminium;
0106     G4Material* fGraphite;
0107     G4Material* fAbsorberMaterial;
0108     G4Material* fActiveMaterial;
0109 
0110     G4LogicalVolume* fExperimentalHall_log;
0111     G4VPhysicalVolume* fExperimentalHall_phys;
0112     // World envelope.
0113 
0114     G4LogicalVolume* fLogicCalo;
0115     G4VPhysicalVolume* fPhysiCalo;
0116     // "Calorimeter".
0117 
0118     G4LogicalVolume* fLogicModule;
0119     G4VPhysicalVolume* fPhysiModule;
0120     // Module of the "calorimeter".
0121 
0122     G4LogicalVolume* fLogicAbsorber;
0123     G4VPhysicalVolume* fPhysiAbsorber;
0124     // Absorber layer of the "calorimeter".
0125 
0126     G4LogicalVolume* fLogicActive;
0127     G4VPhysicalVolume* fPhysiActive;
0128     // Active layer of the "calorimeter".
0129 
0130     G4FieldManager* fFieldMgr;
0131     // Pointer to the field manager.
0132 
0133     G4UniformMagField* fUniformMagField;
0134     // Pointer to the uniform magnetic field.
0135 
0136     DetectorMessenger* fDetectorMessenger;
0137     // Pointer to the Messenger.
0138 
0139     G4bool fIsCalHomogeneous;
0140     // If false then Sampling calorimeter;
0141     // If true  then Homogeneous calorimeter.
0142 
0143     G4bool fIsUnitInLambda;
0144     // If false then normal unit of length to express the absorber total length.
0145     // If true  then lambda (interaction length) to express the absorber total length.
0146 
0147     G4double fAbsorberTotalLength;
0148     // This is the total length of the absorber material, expressed
0149     // in unit of length (e.g. m, cm, mm) if theIsUnitInLambda is false,
0150     // otherwise in number of lambdas (interaction lengths).
0151     // Notice that in the case of a sampling calorimeter (i.e.
0152     // theIsCalHomogeneous is false), the active layers are not counted;
0153     // in the case of an homogenous calorimeter, this length account
0154     // for the overall dimension of the calorimeter.
0155 
0156     G4double fCalorimeterRadius;
0157     // This is the radius of the calorimeter which is a cylinder, expressed
0158     // in unit of length (e.g. m, cm, mm) if theIsUnitInLambda is false,
0159     // otherwise in number of lambdas (interaction lengths) of the absorber.
0160 
0161     G4int fActiveLayerNumber;
0162     G4double fActiveLayerSize;
0163     // Number of active layers and length of each of them (in normal unit
0164     // of length, e.g. mm): in the case of sampling calorimeter
0165     // (i.e. theIsCalHomogeneous is false) the medium is theActiveMaterial;
0166     // in the case of an homogeneous calorimeter, the "active layers" are
0167     // only a fictitious way to sample the longitudinal energy deposits,
0168     // but they are actually made of the same absorber material, and their
0169     // thickness is taken into account in theAbsorberTotalLength.
0170 
0171     G4bool fIsRadiusUnitInLambda;
0172     // If false then normal unit of length to express the radius bin size.
0173     // If true  then lambda (interaction length of the absorber) to express
0174     // the radius bin size.
0175 
0176     G4double fCaloLength;  // total length of the calorimeter along its (z) axis
0177 
0178     // Scoring part
0179     G4LogicalVolume* fLogicScoringUpDown;
0180     G4VPhysicalVolume* fPhysiScoringUpstream;
0181     G4VPhysicalVolume* fPhysiScoringDownstream;
0182     G4LogicalVolume* fLogicScoringSide;
0183     G4VPhysicalVolume* fPhysiScoringSide;
0184     const G4double fScoringThickness = 10.0;
0185 };
0186 
0187 inline G4Material* DetectorConstruction::GetAbsorberMaterial() const
0188 {
0189   return fAbsorberMaterial;
0190 }
0191 
0192 inline G4Material* DetectorConstruction::GetActiveMaterial() const
0193 {
0194   return fActiveMaterial;
0195 }
0196 
0197 inline void DetectorConstruction::SetIsCalHomogeneous(const G4bool choice)
0198 {
0199   fIsCalHomogeneous = choice;
0200 }
0201 
0202 inline void DetectorConstruction::SetIsUnitInLambda(const G4bool choice)
0203 {
0204   fIsUnitInLambda = choice;
0205 }
0206 
0207 inline void DetectorConstruction::SetAbsorberTotalLength(const G4double value)
0208 {
0209   fAbsorberTotalLength = value;
0210 }
0211 
0212 inline void DetectorConstruction::SetCalorimeterRadius(const G4double value)
0213 {
0214   fCalorimeterRadius = value;
0215 }
0216 
0217 inline void DetectorConstruction::SetActiveLayerNumber(const G4int value)
0218 {
0219   fActiveLayerNumber = value;
0220 }
0221 
0222 inline void DetectorConstruction::SetActiveLayerSize(const G4double value)
0223 {
0224   fActiveLayerSize = value;
0225 }
0226 
0227 inline void DetectorConstruction::SetIsRadiusUnitInLambda(const G4bool choice)
0228 {
0229   fIsRadiusUnitInLambda = choice;
0230 }
0231 
0232 inline G4double DetectorConstruction::GetCaloLength() const
0233 {
0234   return fCaloLength;
0235 }
0236 
0237 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0238 
0239 #endif