Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:17:01

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 // Please cite the following paper if you use this software
0027 // Nucl.Instrum.Meth.B260:20-27, 2007
0028 
0029 #include "PhysicsList.hh"
0030 #include "G4SystemOfUnits.hh"
0031 
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0033 
0034 PhysicsList::PhysicsList():  G4VUserPhysicsList()
0035 {
0036   defaultCutValue = 1*micrometer;
0037   fCutForGamma     = defaultCutValue;
0038   fCutForElectron  = defaultCutValue;
0039   fCutForPositron  = defaultCutValue;
0040   fCutForProton    = defaultCutValue;
0041   
0042   SetVerboseLevel(1);
0043 }
0044 
0045 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0046 
0047 PhysicsList::~PhysicsList()
0048 {}
0049 
0050 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0051 
0052 void PhysicsList::ConstructParticle()
0053 {
0054   ConstructBosons();
0055   ConstructLeptons();
0056   ConstructBarions();
0057 }
0058 
0059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0060 
0061 void PhysicsList::ConstructBosons()
0062 { 
0063   // gamma
0064   G4Gamma::GammaDefinition();
0065 
0066   // optical photon
0067   G4OpticalPhoton::OpticalPhotonDefinition();
0068 }
0069  //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0070 
0071 void PhysicsList::ConstructLeptons()
0072 {
0073   // leptons
0074   G4Electron::ElectronDefinition();
0075   G4Positron::PositronDefinition();
0076 }
0077 
0078 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0079 
0080 void PhysicsList::ConstructBarions()
0081 {
0082   //  barions
0083   G4Proton::ProtonDefinition();
0084   G4AntiProton::AntiProtonDefinition();
0085   G4GenericIon::GenericIonDefinition();
0086 }
0087 
0088 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0089 
0090 void PhysicsList::ConstructProcess()
0091 {
0092   AddTransportation();
0093   ConstructEM();
0094   ConstructGeneral();
0095 }
0096 
0097 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0098 
0099 #include "G4PhotoElectricEffect.hh"
0100 #include "G4ComptonScattering.hh"
0101 #include "G4GammaConversion.hh"
0102 
0103 #include "G4eMultipleScattering.hh"
0104 #include "G4eIonisation.hh"
0105 #include "G4eBremsstrahlung.hh"
0106 #include "G4eplusAnnihilation.hh"
0107 
0108 #include "G4MuMultipleScattering.hh"
0109 #include "G4WentzelVIModel.hh"
0110 
0111 #include "G4MuIonisation.hh"
0112 #include "G4MuBremsstrahlung.hh"
0113 #include "G4MuPairProduction.hh"
0114 #include "G4CoulombScattering.hh"
0115 
0116 #include "G4hMultipleScattering.hh"
0117 #include "G4ionIonisation.hh"
0118 #include "G4hIonisation.hh"
0119 #include "G4hBremsstrahlung.hh"
0120 #include "G4hPairProduction.hh"
0121 
0122 #include "G4StepLimiter.hh"
0123 
0124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0125 
0126 void PhysicsList::ConstructEM()
0127 {
0128 
0129   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0130 
0131 // ****************************************************************
0132 // Identical to G4EmStandardPhysics but added G4StepLimiter process
0133 // ****************************************************************
0134 
0135 
0136   auto particleIterator=GetParticleIterator();
0137   particleIterator->reset();
0138 
0139   while( (*particleIterator)() ){
0140 
0141     G4ParticleDefinition* particle = particleIterator->value();
0142 
0143     G4String particleName = particle->GetParticleName();
0144 
0145     if (particleName == "gamma") {
0146 
0147       ph->RegisterProcess(new G4PhotoElectricEffect(), particle);
0148       ph->RegisterProcess(new G4ComptonScattering(), particle);
0149       ph->RegisterProcess(new G4GammaConversion(), particle);
0150 
0151     } else if (particleName == "e-") {
0152 
0153       ph->RegisterProcess(new G4eMultipleScattering(), particle);
0154       ph->RegisterProcess(new G4eIonisation(), particle);
0155       ph->RegisterProcess(new G4eBremsstrahlung(), particle);
0156 
0157     } else if (particleName == "e+") {
0158 
0159       ph->RegisterProcess(new G4eMultipleScattering(), particle);
0160       ph->RegisterProcess(new G4eIonisation(), particle);
0161       ph->RegisterProcess(new G4eBremsstrahlung(), particle);
0162       ph->RegisterProcess(new G4eplusAnnihilation(), particle);
0163       
0164     } else if( particleName == "mu+" || 
0165                particleName == "mu-"    ) {
0166 
0167       G4MuMultipleScattering* msc = new G4MuMultipleScattering();
0168       msc->AddEmModel(0, new G4WentzelVIModel());
0169 
0170       ph->RegisterProcess(msc, particle);
0171       ph->RegisterProcess(new G4MuIonisation(), particle);
0172       ph->RegisterProcess(new G4MuBremsstrahlung(), particle);
0173       ph->RegisterProcess(new G4MuPairProduction(), particle);
0174       ph->RegisterProcess(new G4CoulombScattering(), particle);
0175 
0176     } else if (particleName == "alpha" ||
0177                particleName == "He3") {
0178 
0179       ph->RegisterProcess(new G4hMultipleScattering(), particle);
0180       ph->RegisterProcess(new G4ionIonisation(), particle);
0181 
0182     } else if (particleName == "GenericIon") {
0183 
0184       ph->RegisterProcess(new G4hMultipleScattering(), particle);
0185       ph->RegisterProcess(new G4ionIonisation(), particle);
0186      
0187     } else if (particleName == "proton") {
0188       ph->RegisterProcess(new G4hMultipleScattering(), particle);
0189       ph->RegisterProcess(new G4hIonisation(), particle);
0190       ph->RegisterProcess(new G4hBremsstrahlung(), particle);
0191       ph->RegisterProcess(new G4hPairProduction(), particle);
0192 
0193       ph->RegisterProcess(new G4StepLimiter(), particle);
0194             
0195     }
0196   }
0197 }
0198 
0199 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0200 
0201 void PhysicsList::ConstructGeneral()
0202 { }
0203 
0204 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0205 
0206 void PhysicsList::SetCuts()
0207 {
0208   if (verboseLevel >0){
0209     G4cout << "PhysicsList::SetCuts:";
0210     G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
0211   }  
0212   
0213   SetCutValue(fCutForGamma, "gamma");
0214   SetCutValue(fCutForElectron, "e-");
0215   SetCutValue(fCutForPositron, "e+");
0216   SetCutValue(fCutForProton, "proton");
0217   SetCutValue(fCutForProton, "anti_proton");
0218   
0219   if (verboseLevel>0) DumpCutValuesTable();
0220 }
0221 
0222 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0223 
0224 void PhysicsList::SetGammaCut(G4double val)
0225 {
0226   fCutForGamma = val;
0227 }
0228 
0229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0230 
0231 void PhysicsList::SetElectronCut(G4double val)
0232 {
0233   fCutForElectron = val;
0234 }
0235 
0236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0237 
0238 void PhysicsList::SetPositronCut(G4double val)
0239 {
0240   fCutForPositron = val;
0241 }
0242 
0243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0244 
0245 void PhysicsList::SetProtonCut(G4double val)
0246 {
0247   fCutForProton = val;
0248 }