Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 07:56:20

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