Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:17

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 field/field03/include/F03DetectorConstruction.hh
0027 /// \brief Definition of the F03DetectorConstruction class
0028 //
0029 //
0030 //
0031 //
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0034 
0035 #ifndef F03DetectorConstruction_h
0036 #define F03DetectorConstruction_h 1
0037 
0038 #include "G4VUserDetectorConstruction.hh"
0039 #include "G4Cache.hh"
0040 #include "G4ThreeVector.hh"
0041 
0042 #include "CLHEP/Units/SystemOfUnits.h"
0043 
0044 class G4Tubs;
0045 class G4LogicalVolume;
0046 class G4VPhysicalVolume;
0047 
0048 class G4Material;
0049 class G4UniformMagField;
0050 
0051 class F03DetectorMessenger;
0052 class F03CalorimeterSD;
0053 
0054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0055 
0056 class F03DetectorConstruction : public G4VUserDetectorConstruction
0057 {
0058   public:
0059     F03DetectorConstruction();
0060     ~F03DetectorConstruction() override;
0061 
0062     void SetAbsorberMaterial(G4String);
0063     void SetAbsorberThickness(G4double);
0064     void SetAbsorberRadius(G4double);
0065 
0066     void SetAbsorberZpos(G4double);
0067 
0068     void SetWorldMaterial(G4String);
0069     void SetWorldSizeZ(G4double);
0070     void SetWorldSizeR(G4double);
0071 
0072     void SetFieldValue(G4ThreeVector value);
0073     void SetLocalFieldValue(G4ThreeVector value);
0074 
0075     G4VPhysicalVolume* Construct() override;
0076     void ConstructSDandField() override;
0077 
0078     void PrintCalorParameters();
0079 
0080     G4Material* GetWorldMaterial() { return fWorldMaterial; }
0081     G4double GetWorldSizeZ() { return fWorldSizeZ; }
0082     G4double GetWorldSizeR() { return fWorldSizeR; }
0083 
0084     G4double GetAbsorberZpos() { return fZAbsorber; }
0085     G4double GetZStartAbs() { return fZStartAbs; }
0086     G4double GetZEndAbs() { return fZEndAbs; }
0087 
0088     G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
0089     G4double GetAbsorberThickness() { return fAbsorberThickness; }
0090     G4double GetAbsorberRadius() { return fAbsorberRadius; }
0091 
0092     const G4VPhysicalVolume* GetPhysiWorld() { return fPhysiWorld; }
0093     const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
0094     G4LogicalVolume* GetLogicalAbsorber() { return fLogicAbsorber; }
0095 
0096   private:
0097     void DefineMaterials();
0098     void ComputeCalorParameters();
0099     G4VPhysicalVolume* ConstructCalorimeter();
0100 
0101     F03DetectorMessenger* fDetectorMessenger = nullptr;  // pointer to the Messenger
0102     G4Cache<F03CalorimeterSD*> fCalorimeterSD = nullptr;  // pointer to the sensitive det.
0103 
0104     G4Tubs* fSolidWorld = nullptr;  // pointer to the solid World
0105     G4LogicalVolume* fLogicWorld = nullptr;  // pointer to the logical World
0106     G4VPhysicalVolume* fPhysiWorld = nullptr;  // pointer to the physical World
0107 
0108     G4Tubs* fSolidAbsorber = nullptr;  // pointer to the solid Absorber
0109     G4LogicalVolume* fLogicAbsorber = nullptr;  // pointer to the logical Absorber
0110     G4VPhysicalVolume* fPhysiAbsorber = nullptr;  // pointer to the physical Absorber
0111 
0112     G4Tubs* fSolidRadSlice = nullptr;  // pointer to the solid  z-slice
0113     G4LogicalVolume* fLogicRadSlice = nullptr;  // pointer to the logical z-slide
0114     G4VPhysicalVolume* fPhysiRadSlice = nullptr;  // pointer to the physical z-slide
0115 
0116     G4Tubs* fSolidRadiator = nullptr;
0117     G4LogicalVolume* fLogicRadiator = nullptr;
0118     G4VPhysicalVolume* fPhysiRadiator = nullptr;
0119 
0120     G4Material* fWorldMaterial = nullptr;
0121     G4Material* fAbsorberMaterial = nullptr;
0122     G4Material* fRadiatorMat = nullptr;  // pointer to the TR radiator material
0123 
0124     G4double fWorldSizeR = 22000. * CLHEP::mm;
0125     G4double fWorldSizeZ = 44000. * CLHEP::mm;
0126 
0127     G4double fAbsorberThickness = 1. * CLHEP::mm;
0128     G4double fAbsorberRadius = 20000. * CLHEP::mm;
0129 
0130     G4double fZAbsorber = 21990. * CLHEP::mm;
0131     G4double fZStartAbs = 0.;
0132     G4double fZEndAbs = 0.;
0133 
0134     G4double fRadThickness = 100. * CLHEP::mm;
0135     G4double fGasGap = 100. * CLHEP::mm;
0136     G4double fDetGap = 1. * CLHEP::mm;
0137 
0138     G4int fFoilNumber = 2;
0139 
0140     G4ThreeVector fFieldVector = {3.3*CLHEP::tesla, 0., 0.};
0141     G4ThreeVector fLocalFieldVector = {3.3*CLHEP::tesla, 0., 0.};
0142 };
0143 
0144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0145 
0146 inline void F03DetectorConstruction::ComputeCalorParameters()
0147 {
0148   // Compute derived parameters of the calorimeter
0149 
0150   fZStartAbs = fZAbsorber - 0.5 * fAbsorberThickness;
0151   fZEndAbs = fZAbsorber + 0.5 * fAbsorberThickness;
0152 }
0153 
0154 #endif