Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-13 08:26:57

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.cc
0027 /// \brief Implementation of the DetectorConstruction class
0028 //
0029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0030 
0031 #ifndef B1DetectorConstruction_h
0032 #define B1DetectorConstruction_h 1
0033 
0034 #include "G4VUserDetectorConstruction.hh"
0035 #include "G4ios.hh"
0036 #include "globals.hh"
0037 #include <CLHEP/Units/SystemOfUnits.h>
0038 #include <vector>
0039 
0040 #include "G4Region.hh"
0041 #include "G4PVPlacement.hh"
0042 
0043 #include "G4ChannelingFastSimModel.hh"
0044 
0045 #include "DetectorConstructionMessenger.hh"
0046 
0047 class G4VPhysicalVolume;
0048 class G4LogicalVolume;
0049 
0050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0051 
0052 /// Detector construction class to define materials and geometry.
0053 
0054 class DetectorConstruction : public G4VUserDetectorConstruction
0055 {
0056   public:
0057     DetectorConstruction();
0058     ~DetectorConstruction() override = default;
0059 
0060     G4VPhysicalVolume* Construct() override;
0061     void ConstructSDandField() override;
0062 
0063     //methods to set the Crystal features
0064     void SetCrystalMaterial(const G4String& val) {fCrystalMaterialStr = val;}
0065     void SetCrystalSize(G4ThreeVector val) {fCrystalSize = val;}
0066     void SetCrystalBendingAngle(G4double val) {fBendingAngle = val;}
0067     void SetCrystalLattice(const G4String& val) {fLattice = val;}
0068     void SetCrystalAngleX(G4double val) {fAngleX = val;}
0069     void SetCrystalAngleY(G4double val) {fAngleY = val;}
0070     void SetRadiationModel(G4bool val) {fActivateRadiationModel = val;}
0071     void SetChannelingModel(G4bool val) {fActivateChannelingModel = val;}
0072 
0073     void SetCrystallineUndulatorAmplitude(G4double val)
0074     {fCrystallineUndulatorAmplitude = val;}
0075     void SetCrystallineUndulatorPeriod(G4double val)
0076     {fCrystallineUndulatorPeriod = val;}
0077     void SetCrystallineUndulatorPhase(G4double val)
0078     {fCrystallineUndulatorPhase = val;}
0079 
0080     void SetPotentialPath(const G4String& path){fPotentialPath = path;}
0081     void SetMinPhotonEnergy(G4double val) {fMinPhotonEnergy = val;}
0082     void SetSamplingPhotonsNumber(G4int val) {fSamplingPhotonsNumber = val;}
0083     void SetNSmallTrajectorySteps(G4int val) {fNSmallTrajectorySteps = val;}
0084     void SetRadiationAngleFactor(G4double val) {fRadiationAngleFactor = val;}
0085 
0086     void SetMinPhotonEnergyAddStat(G4double val) {fMinPhotonEnergyAddStat = val;}
0087     void SetMaxPhotonEnergyAddStat(G4double val) {fMaxPhotonEnergyAddStat = val;}
0088     void SetMultiplePhotonStatistics(G4int val) {fTimesPhotonStatistics = val;}
0089 
0090     void SetDetectorSize(G4ThreeVector val) {fDetectorSize = val;}
0091     void SetDetectorFrontPositionZ(G4double val) {fDetectorFrontPosZ = val;}
0092 
0093     void SetParticleMinKinEnergy(G4double val)   {fParticleMinKinEnergy = val;}
0094     void SetProtonMinKinEnergy(G4double val)     {fProtonMinKinEnergy = val;}
0095     void SetAntiprotonMinKinEnergy(G4double val) {fAntiprotonMinKinEnergy = val;}
0096     void SetPiPlusMinKinEnergy(G4double val)     {fPiPlusMinKinEnergy = val;}
0097     void SetPiMinusMinKinEnergy(G4double val)    {fPiMinusMinKinEnergy = val;}
0098     void SetElectronMinKinEnergy(G4double val)   {fElectronMinKinEnergy = val;}
0099     void SetPositronMinKinEnergy(G4double val)   {fPositronMinKinEnergy = val;}
0100     void SetMuPlusMinKinEnergy(G4double val)     {fMuPlusMinKinEnergy = val;}
0101     void SetMuMinusMinKinEnergy(G4double val)    {fMuMinusMinKinEnergy = val;}
0102 
0103     void SetLindhardAngles(G4double val)           {fLindhardAngles = val;}
0104     void SetLindhardAnglesProton(G4double val)     {fLindhardAnglesProton = val;}
0105     void SetLindhardAnglesAntiproton(G4double val) {fLindhardAnglesAntiproton = val;}
0106     void SetLindhardAnglesPiPlus(G4double val)     {fLindhardAnglesPiPlus = val;}
0107     void SetLindhardAnglesPiMinus(G4double val)    {fLindhardAnglesPiMinus = val;}
0108     void SetLindhardAnglesElectron(G4double val)   {fLindhardAnglesElectron = val;}
0109     void SetLindhardAnglesPositron(G4double val)   {fLindhardAnglesPositron = val;}
0110     void SetLindhardAnglesMuPlus(G4double val)     {fLindhardAnglesMuPlus = val;}
0111     void SetLindhardAnglesMuMinus(G4double val)    {fLindhardAnglesMuMinus = val;}
0112 
0113   private:
0114     DetectorConstructionMessenger* fMessenger;
0115 
0116       //crystal features
0117       G4LogicalVolume* fLogicCrystal{nullptr};
0118       G4String fCrystalMaterialStr = "G4_Si";
0119       G4Material* fCrystalMaterial{nullptr};
0120       G4ThreeVector fCrystalSize;
0121       G4double fBendingAngle = 0.;
0122       G4String fLattice;
0123       G4double fAngleX = 0.;
0124       G4double fAngleY = 0.;
0125       G4bool fActivateRadiationModel = false;
0126       G4bool fActivateChannelingModel = true;
0127 
0128       //Crystal undulator parameters; default 0 => no undulator
0129       G4double fCrystallineUndulatorAmplitude = 0.;
0130       G4double fCrystallineUndulatorPeriod = 0.;
0131       G4double fCrystallineUndulatorPhase = 0.;
0132 
0133       G4ThreeVector fDetectorSize;
0134       G4double fDetectorFrontPosZ = 1*CLHEP::m;
0135 
0136       G4String fPotentialPath = "";
0137 
0138       G4double fMinPhotonEnergy = 1*CLHEP::MeV; //G4BaierKatkov default value
0139       G4int fSamplingPhotonsNumber = 150; //G4BaierKatkov default value
0140       G4int fNSmallTrajectorySteps = 10000; //G4BaierKatkov default value
0141       G4double fRadiationAngleFactor = 4; //G4BaierKatkov default value
0142 
0143       G4double fMinPhotonEnergyAddStat = 1*CLHEP::MeV;
0144       G4double fMaxPhotonEnergyAddStat = 20*CLHEP::MeV;
0145       G4int fTimesPhotonStatistics = 1;
0146 
0147       G4double fParticleMinKinEnergy   = 200.*CLHEP::MeV;//G4ChannelingFastSimModel default value
0148       G4double fProtonMinKinEnergy     = 200.*CLHEP::MeV;
0149       G4double fAntiprotonMinKinEnergy = 200.*CLHEP::MeV;
0150       G4double fPiPlusMinKinEnergy     = 200.*CLHEP::MeV;
0151       G4double fPiMinusMinKinEnergy    = 200.*CLHEP::MeV;
0152       G4double fElectronMinKinEnergy   = 200.*CLHEP::MeV;
0153       G4double fPositronMinKinEnergy   = 200.*CLHEP::MeV;
0154       G4double fMuPlusMinKinEnergy     = 200.*CLHEP::MeV;
0155       G4double fMuMinusMinKinEnergy    = 200.*CLHEP::MeV;
0156 
0157       G4double fLindhardAngles = 100; //G4ChannelingFastSimModel default value
0158       G4double fLindhardAnglesProton     = 100;
0159       G4double fLindhardAnglesAntiproton = 100;
0160       G4double fLindhardAnglesPiPlus     = 100;
0161       G4double fLindhardAnglesPiMinus    = 100;
0162       G4double fLindhardAnglesElectron   = 100;
0163       G4double fLindhardAnglesPositron   = 100;
0164       G4double fLindhardAnglesMuPlus     = 100;
0165       G4double fLindhardAnglesMuMinus    = 100;
0166 };
0167 
0168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0169 
0170 #endif