Back to home page

EIC code displayed by LXR

 
 

    


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

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 electromagnetic/TestEm15/src/PhysicsList.cc
0027 /// \brief Implementation of the PhysicsList class
0028 //
0029 //
0030 //
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 
0034 #include "PhysicsList.hh"
0035 
0036 #include "PhysListEmStandard.hh"
0037 #include "PhysicsListMessenger.hh"
0038 
0039 #include "G4EmStandardPhysicsGS.hh"
0040 #include "G4EmStandardPhysicsSS.hh"
0041 #include "G4EmStandardPhysicsWVI.hh"
0042 #include "G4EmStandardPhysics_option3.hh"
0043 #include "G4EmStandardPhysics_option4.hh"
0044 #include "G4LossTableManager.hh"
0045 #include "G4SystemOfUnits.hh"
0046 #include "G4UnitsTable.hh"
0047 
0048 // Bosons
0049 #include "G4ChargedGeantino.hh"
0050 #include "G4Gamma.hh"
0051 #include "G4Geantino.hh"
0052 #include "G4OpticalPhoton.hh"
0053 
0054 // leptons
0055 #include "G4AntiNeutrinoE.hh"
0056 #include "G4AntiNeutrinoMu.hh"
0057 #include "G4Electron.hh"
0058 #include "G4MuonMinus.hh"
0059 #include "G4MuonPlus.hh"
0060 #include "G4NeutrinoE.hh"
0061 #include "G4NeutrinoMu.hh"
0062 #include "G4Positron.hh"
0063 
0064 // Mesons
0065 #include "G4AntiKaonZero.hh"
0066 #include "G4Eta.hh"
0067 #include "G4EtaPrime.hh"
0068 #include "G4KaonMinus.hh"
0069 #include "G4KaonPlus.hh"
0070 #include "G4KaonZero.hh"
0071 #include "G4KaonZeroLong.hh"
0072 #include "G4KaonZeroShort.hh"
0073 #include "G4PionMinus.hh"
0074 #include "G4PionPlus.hh"
0075 #include "G4PionZero.hh"
0076 
0077 // Baryons
0078 #include "G4AntiNeutron.hh"
0079 #include "G4AntiProton.hh"
0080 #include "G4Neutron.hh"
0081 #include "G4Proton.hh"
0082 
0083 // Nuclei
0084 #include "StepMax.hh"
0085 
0086 #include "G4Alpha.hh"
0087 #include "G4Deuteron.hh"
0088 #include "G4GenericIon.hh"
0089 #include "G4ProcessManager.hh"
0090 #include "G4Triton.hh"
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0093 
0094 PhysicsList::PhysicsList() : G4VModularPhysicsList(), fEmPhysicsList(0), fMessenger(0)
0095 {
0096   G4LossTableManager::Instance();
0097   SetDefaultCutValue(1 * mm);
0098 
0099   fMessenger = new PhysicsListMessenger(this);
0100 
0101   SetVerboseLevel(1);
0102 
0103   // EM physics
0104   fEmName = G4String("local");
0105   fEmPhysicsList = new PhysListEmStandard(fEmName);
0106 }
0107 
0108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0109 
0110 PhysicsList::~PhysicsList()
0111 {
0112   delete fMessenger;
0113 }
0114 
0115 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0116 
0117 void PhysicsList::ConstructParticle()
0118 {
0119   // pseudo-particles
0120   G4Geantino::GeantinoDefinition();
0121   G4ChargedGeantino::ChargedGeantinoDefinition();
0122 
0123   // gamma
0124   G4Gamma::GammaDefinition();
0125 
0126   // optical photon
0127   G4OpticalPhoton::OpticalPhotonDefinition();
0128 
0129   // leptons
0130   G4Electron::ElectronDefinition();
0131   G4Positron::PositronDefinition();
0132   G4MuonPlus::MuonPlusDefinition();
0133   G4MuonMinus::MuonMinusDefinition();
0134 
0135   G4NeutrinoE::NeutrinoEDefinition();
0136   G4AntiNeutrinoE::AntiNeutrinoEDefinition();
0137   G4NeutrinoMu::NeutrinoMuDefinition();
0138   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
0139 
0140   // mesons
0141   G4PionPlus::PionPlusDefinition();
0142   G4PionMinus::PionMinusDefinition();
0143   G4PionZero::PionZeroDefinition();
0144   G4Eta::EtaDefinition();
0145   G4EtaPrime::EtaPrimeDefinition();
0146   G4KaonPlus::KaonPlusDefinition();
0147   G4KaonMinus::KaonMinusDefinition();
0148   G4KaonZero::KaonZeroDefinition();
0149   G4AntiKaonZero::AntiKaonZeroDefinition();
0150   G4KaonZeroLong::KaonZeroLongDefinition();
0151   G4KaonZeroShort::KaonZeroShortDefinition();
0152 
0153   // barions
0154   G4Proton::ProtonDefinition();
0155   G4AntiProton::AntiProtonDefinition();
0156   G4Neutron::NeutronDefinition();
0157   G4AntiNeutron::AntiNeutronDefinition();
0158 
0159   // ions
0160   G4Deuteron::DeuteronDefinition();
0161   G4Triton::TritonDefinition();
0162   G4Alpha::AlphaDefinition();
0163   G4GenericIon::GenericIonDefinition();
0164 }
0165 
0166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0167 
0168 void PhysicsList::ConstructProcess()
0169 {
0170   // Transportation
0171   //
0172   AddTransportation();
0173 
0174   // Electromagnetic physics list
0175   //
0176   fEmPhysicsList->ConstructProcess();
0177 
0178   // Em options
0179   //
0180   G4EmParameters* param = G4EmParameters::Instance();
0181   param->SetIntegral(false);
0182   param->SetStepFunction(1., 1 * mm);
0183   param->SetLossFluctuations(false);
0184 
0185   // step limitation (as a full process)
0186   //
0187   AddStepMax();
0188 }
0189 
0190 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0191 
0192 void PhysicsList::AddPhysicsList(const G4String& name)
0193 {
0194   if (verboseLevel > 0) {
0195     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0196   }
0197 
0198   if (name == fEmName) return;
0199 
0200   if (name == "local") {
0201     fEmName = name;
0202     delete fEmPhysicsList;
0203     fEmPhysicsList = new PhysListEmStandard(name);
0204   }
0205   else if (name == "emstandard_opt3") {
0206     fEmName = name;
0207     delete fEmPhysicsList;
0208     fEmPhysicsList = new G4EmStandardPhysics_option3();
0209   }
0210   else if (name == "emstandard_opt4") {
0211     fEmName = name;
0212     delete fEmPhysicsList;
0213     fEmPhysicsList = new G4EmStandardPhysics_option4();
0214   }
0215   else if (name == "emstandardSS") {
0216     fEmName = name;
0217     delete fEmPhysicsList;
0218     fEmPhysicsList = new G4EmStandardPhysicsSS();
0219   }
0220   else if (name == "emstandardWVI") {
0221     fEmName = name;
0222     delete fEmPhysicsList;
0223     fEmPhysicsList = new G4EmStandardPhysicsWVI();
0224   }
0225   else if (name == "emstandardGS") {
0226     fEmName = name;
0227     delete fEmPhysicsList;
0228     fEmPhysicsList = new G4EmStandardPhysicsGS();
0229   }
0230   else {
0231     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0232            << " is not defined" << G4endl;
0233   }
0234 }
0235 
0236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0237 
0238 void PhysicsList::AddStepMax()
0239 {
0240   // Step limitation seen as a process
0241   StepMax* stepMaxProcess = new StepMax();
0242 
0243   auto particleIterator = GetParticleIterator();
0244   particleIterator->reset();
0245   while ((*particleIterator)()) {
0246     G4ParticleDefinition* particle = particleIterator->value();
0247     G4ProcessManager* pmanager = particle->GetProcessManager();
0248 
0249     if (stepMaxProcess->IsApplicable(*particle) && pmanager) {
0250       pmanager->AddDiscreteProcess(stepMaxProcess);
0251     }
0252   }
0253 }
0254 
0255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......