Back to home page

EIC code displayed by LXR

 
 

    


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