Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:50

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 //
0027 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0028 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0029 
0030 #include "TransitionRadiationPhysics.hh"
0031 
0032 #include "DetectorConstruction.hh"
0033 #include "XTRTransparentRegRadModel.hh"
0034 
0035 #include "G4Electron.hh"
0036 #include "G4GammaXTRadiator.hh"
0037 #include "G4Positron.hh"
0038 #include "G4ProcessManager.hh"
0039 #include "G4RegularXTRadiator.hh"
0040 #include "G4StrawTubeXTRadiator.hh"
0041 #include "G4TransparentRegXTRadiator.hh"
0042 #include "G4VXTRenergyLoss.hh"
0043 #include "G4XTRGammaRadModel.hh"
0044 #include "G4XTRRegularRadModel.hh"
0045 #include "G4XTRTransparentRegRadModel.hh"
0046 
0047 G4ThreadLocal G4VXTRenergyLoss* TransitionRadiationPhysics::fXTRProcess = nullptr;
0048 
0049 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0050 
0051 TransitionRadiationPhysics::TransitionRadiationPhysics(G4int verb, DetectorConstruction* ptr)
0052   : G4VPhysicsConstructor("XTR"), fDetector(ptr), fVerbose(verb), fXTRModel("transpM")
0053 {}
0054 
0055 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0056 
0057 TransitionRadiationPhysics::~TransitionRadiationPhysics() {}
0058 
0059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0060 
0061 void TransitionRadiationPhysics::ConstructProcess()
0062 {
0063   if ("dummy" == fXTRModel) {
0064     return;
0065   }
0066   if (0 < fVerbose) {
0067     G4cout << "TransitionRadiationPhysics: XTR model <" << fXTRModel << ">" << G4endl;
0068   }
0069   RadiatorDescription* rDescription = fDetector->GetRadiatorDescription();
0070 
0071   if (fXTRModel == "gammaR") {
0072     fXTRProcess = new G4GammaXTRadiator(rDescription->fLogicalVolume, 100., 100.,
0073                                         rDescription->fFoilMaterial, rDescription->fGasMaterial,
0074                                         rDescription->fFoilThickness, rDescription->fGasThickness,
0075                                         rDescription->fFoilNumber, "GammaXTRadiator");
0076   }
0077   else if (fXTRModel == "gammaM") {
0078     fXTRProcess = new G4XTRGammaRadModel(rDescription->fLogicalVolume, 100., 100.,
0079                                          rDescription->fFoilMaterial, rDescription->fGasMaterial,
0080                                          rDescription->fFoilThickness, rDescription->fGasThickness,
0081                                          rDescription->fFoilNumber, "GammaXTRadiator");
0082   }
0083   else if (fXTRModel == "strawR") {
0084     fXTRProcess = new G4StrawTubeXTRadiator(
0085       rDescription->fLogicalVolume, rDescription->fFoilMaterial, rDescription->fGasMaterial, 0.53,
0086       3.14159, fDetector->GetAbsorberMaterial(), true, "strawXTRadiator");
0087   }
0088   else if (fXTRModel == "regR") {
0089     fXTRProcess = new G4RegularXTRadiator(rDescription->fLogicalVolume, rDescription->fFoilMaterial,
0090                                           rDescription->fGasMaterial, rDescription->fFoilThickness,
0091                                           rDescription->fGasThickness, rDescription->fFoilNumber,
0092                                           "RegularXTRadiator");
0093   }
0094   else if (fXTRModel == "transpR") {
0095     // G4TransparentRegXTRadiator*
0096     fXTRProcess = new G4TransparentRegXTRadiator(
0097       rDescription->fLogicalVolume, rDescription->fFoilMaterial, rDescription->fGasMaterial,
0098       rDescription->fFoilThickness, rDescription->fGasThickness, rDescription->fFoilNumber,
0099       "RegularXTRadiator");
0100   }
0101   else if (fXTRModel == "regM") {
0102     fXTRProcess = new G4XTRRegularRadModel(
0103       rDescription->fLogicalVolume, rDescription->fFoilMaterial, rDescription->fGasMaterial,
0104       rDescription->fFoilThickness, rDescription->fGasThickness, rDescription->fFoilNumber,
0105       "RegularXTRadiator");
0106   }
0107   else if (fXTRModel == "transpM") {
0108     fXTRProcess = new XTRTransparentRegRadModel(
0109       rDescription->fLogicalVolume, rDescription->fFoilMaterial, rDescription->fGasMaterial,
0110       rDescription->fFoilThickness, rDescription->fGasThickness, rDescription->fFoilNumber,
0111       "RegularXTRadiator");
0112   }
0113   if (!fXTRProcess) {
0114     if (0 < fVerbose) {
0115       G4cout << "TransitionRadiationPhysics: XTR model <" << fXTRModel
0116              << "> is not known - no XTR process defined" << G4endl;
0117     }
0118     return;
0119   }
0120 
0121   fXTRProcess->SetVerboseLevel(fVerbose);
0122 
0123   G4Electron* elec = G4Electron::Electron();
0124   G4ProcessManager* manager = elec->GetProcessManager();
0125   manager->AddDiscreteProcess(fXTRProcess);
0126 
0127   G4Positron* posi = G4Positron::Positron();
0128   manager = posi->GetProcessManager();
0129   manager->AddDiscreteProcess(fXTRProcess);
0130 }
0131 
0132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......