Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:08:44

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 F01DetectorConstruction.hh
0027 /// \brief Definition of the F01DetectorConstruction class
0028 
0029 #ifndef F01DetectorConstruction_h
0030 #define F01DetectorConstruction_h 1
0031 
0032 #include "G4VUserDetectorConstruction.hh"
0033 #include "G4Cache.hh"
0034 #include "G4ThreeVector.hh"
0035 
0036 #include "CLHEP/Units/SystemOfUnits.h"
0037 
0038 class G4Box;
0039 class G4Tubs;
0040 class G4LogicalVolume;
0041 class G4VPhysicalVolume;
0042 
0043 class G4Material;
0044 class G4UniformMagField;
0045 
0046 class F01DetectorMessenger;
0047 class F01CalorimeterSD;
0048 
0049 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0050 
0051 class F01DetectorConstruction : public G4VUserDetectorConstruction
0052 {
0053   public:
0054     F01DetectorConstruction();
0055     ~F01DetectorConstruction() override;
0056 
0057     void SetAbsorberMaterial(G4String);
0058     void SetAbsorberThickness(G4double);
0059     void SetAbsorberRadius(G4double);
0060 
0061     void SetAbsorberZpos(G4double);
0062 
0063     void SetWorldMaterial(G4String);
0064     void SetWorldSizeZ(G4double);
0065     void SetWorldSizeR(G4double);
0066 
0067     void SetFieldValue(G4ThreeVector value);
0068 
0069     G4VPhysicalVolume* Construct() override;
0070     void ConstructSDandField() override;
0071 
0072     void PrintCalorParameters();
0073 
0074     G4Material* GetWorldMaterial() { return fWorldMaterial; }
0075     G4double GetWorldSizeZ() { return fWorldSizeZ; }
0076     G4double GetWorldSizeR() { return fWorldSizeR; }
0077 
0078     G4double GetAbsorberZpos() { return fZAbsorber; }
0079     G4double GetZStartAbs() { return fZStartAbs; }
0080     G4double GetZEndAbs() { return fZEndAbs; }
0081 
0082     G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
0083     G4double GetAbsorberThickness() { return fAbsorberThickness; }
0084     G4double GetAbsorberRadius() { return fAbsorberRadius; }
0085 
0086     const G4VPhysicalVolume* GetPhysiWorld() { return fPhysiWorld; }
0087     const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
0088     G4LogicalVolume* GetLogicalAbsorber() { return fLogicAbsorber; }
0089 
0090   private:
0091     void DefineMaterials();
0092     void ComputeCalorParameters();
0093     G4VPhysicalVolume* ConstructCalorimeter();
0094 
0095     F01DetectorMessenger* fDetectorMessenger = nullptr;  // pointer -> Messenger
0096     G4Cache<F01CalorimeterSD*> fCalorimeterSD;  // pointer -> sensitive detector
0097 
0098     G4Tubs* fSolidWorld = nullptr;  // pointer to the solid World
0099     G4LogicalVolume* fLogicWorld = nullptr;  // pointer to the logical World
0100     G4VPhysicalVolume* fPhysiWorld = nullptr;  // pointer to the physical World
0101 
0102     G4Tubs* fSolidAbsorber = nullptr;  // pointer to the solid Absorber
0103     G4LogicalVolume* fLogicAbsorber = nullptr;  // pointer to the logical Absorber
0104     G4VPhysicalVolume* fPhysiAbsorber = nullptr;  // pointer to the physical Absorber
0105 
0106     G4Material* fAbsorberMaterial = nullptr;
0107     G4double fAbsorberThickness = 1.0 * CLHEP::mm;
0108     G4double fAbsorberRadius = 20000. * CLHEP::mm;
0109 
0110     G4double fZAbsorber = 21990. * CLHEP::mm;
0111     G4double fZStartAbs = 0.;
0112     G4double fZEndAbs = 0.;
0113 
0114     G4Material* fWorldMaterial = nullptr;
0115     G4double fWorldSizeR = 22000. * CLHEP::mm;
0116     G4double fWorldSizeZ = 44000. * CLHEP::mm;
0117 
0118     G4ThreeVector fFieldVector = {0., 0., 3.3*CLHEP::tesla};
0119 };
0120 
0121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0122 
0123 inline void F01DetectorConstruction::ComputeCalorParameters()
0124 {
0125   // Compute derived parameters of the calorimeter
0126 
0127   fZStartAbs = fZAbsorber - 0.5 * fAbsorberThickness;
0128   fZEndAbs = fZAbsorber + 0.5 * fAbsorberThickness;
0129 
0130   G4cout << "-- Calorimeter Absorber z-coords:  Start= " << fZStartAbs << " End= " << fZEndAbs
0131          << G4endl;
0132 }
0133 
0134 #endif