Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-08 07:53:02

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 PhysicsList.cc
0027 /// \brief Implementation of the PhysicsList class
0028 
0029 #include "PhysicsList.hh"
0030 
0031 #include "PhysListEmStandard.hh"
0032 #include "PhysicsListMessenger.hh"
0033 #include "StepMax.hh"
0034 
0035 #include "G4DecayPhysics.hh"
0036 #include "G4EmDNAPhysics.hh"
0037 #include "G4EmDNAPhysics_option2.hh"
0038 #include "G4EmDNAPhysics_option4.hh"
0039 #include "G4EmDNAPhysics_option6.hh"
0040 #include "G4EmLivermorePhysics.hh"
0041 #include "G4EmLowEPPhysics.hh"
0042 #include "G4EmPenelopePhysics.hh"
0043 #include "G4EmStandardPhysics.hh"
0044 #include "G4EmStandardPhysicsGS.hh"
0045 #include "G4EmStandardPhysicsSS.hh"
0046 #include "G4EmStandardPhysicsWVI.hh"
0047 #include "G4EmStandardPhysics_option1.hh"
0048 #include "G4EmStandardPhysics_option2.hh"
0049 #include "G4EmStandardPhysics_option3.hh"
0050 #include "G4EmStandardPhysics_option4.hh"
0051 #include "G4HadronElasticPhysics.hh"
0052 #include "G4ParticleDefinition.hh"
0053 #include "G4ProcessManager.hh"
0054 #include "G4SystemOfUnits.hh"
0055 #include "G4UnitsTable.hh"
0056 
0057 // particles
0058 
0059 #include "G4BaryonConstructor.hh"
0060 #include "G4BosonConstructor.hh"
0061 #include "G4DNAGenericIonsManager.hh"
0062 #include "G4IonConstructor.hh"
0063 #include "G4LeptonConstructor.hh"
0064 #include "G4MesonConstructor.hh"
0065 #include "G4ShortLivedConstructor.hh"
0066 
0067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0068 
0069 PhysicsList::PhysicsList()
0070 {
0071   fMessenger = new PhysicsListMessenger(this);
0072   SetVerboseLevel(1);
0073 
0074   // EM physics
0075   fEmName = G4String("emstandard_opt4");
0076   fEmPhysicsList = new G4EmStandardPhysics_option4();
0077 
0078   // Decay physics
0079   fDecayPhysics = new G4DecayPhysics(1);
0080 
0081   SetDefaultCutValue(1 * mm);
0082 }
0083 
0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0085 
0086 PhysicsList::~PhysicsList()
0087 {
0088   delete fEmPhysicsList;
0089   delete fMessenger;
0090 }
0091 
0092 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0093 
0094 void PhysicsList::ConstructParticle()
0095 {
0096   G4BosonConstructor pBosonConstructor;
0097   pBosonConstructor.ConstructParticle();
0098 
0099   G4LeptonConstructor pLeptonConstructor;
0100   pLeptonConstructor.ConstructParticle();
0101 
0102   G4MesonConstructor pMesonConstructor;
0103   pMesonConstructor.ConstructParticle();
0104 
0105   G4BaryonConstructor pBaryonConstructor;
0106   pBaryonConstructor.ConstructParticle();
0107 
0108   G4IonConstructor pIonConstructor;
0109   pIonConstructor.ConstructParticle();
0110 
0111   G4ShortLivedConstructor sLivedConstructor;
0112   sLivedConstructor.ConstructParticle();
0113 
0114   // Geant4-DNA
0115 
0116   G4DNAGenericIonsManager* genericIonsManager;
0117   genericIonsManager = G4DNAGenericIonsManager::Instance();
0118   genericIonsManager->GetIon("alpha++");
0119   genericIonsManager->GetIon("alpha+");
0120   genericIonsManager->GetIon("helium");
0121   genericIonsManager->GetIon("hydrogen");
0122 }
0123 
0124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0125 
0126 void PhysicsList::ConstructProcess()
0127 {
0128   AddTransportation();
0129   fEmPhysicsList->ConstructProcess();
0130   fDecayPhysics->ConstructProcess();
0131   if (fHadPhysicsList) {
0132     fHadPhysicsList->ConstructProcess();
0133   }
0134   AddStepMax();
0135 }
0136 
0137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0138 
0139 void PhysicsList::AddStepMax()
0140 {
0141   // Step limitation seen as a process
0142   StepMax* stepMaxProcess = new StepMax();
0143 
0144   auto particleIterator = GetParticleIterator();
0145   particleIterator->reset();
0146   while ((*particleIterator)()) {
0147     G4ParticleDefinition* particle = particleIterator->value();
0148     G4ProcessManager* pmanager = particle->GetProcessManager();
0149 
0150     if (stepMaxProcess->IsApplicable(*particle)) {
0151       pmanager->AddDiscreteProcess(stepMaxProcess);
0152     }
0153   }
0154 }
0155 
0156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0157 
0158 void PhysicsList::AddPhysicsList(const G4String& name)
0159 {
0160   if (verboseLevel > -1) {
0161     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0162   }
0163 
0164   if (name == fEmName) return;
0165 
0166   if (name == "local") {
0167     fEmName = name;
0168     delete fEmPhysicsList;
0169     fEmPhysicsList = new PhysListEmStandard(name);
0170   }
0171   else if (name == "emstandard_opt0") {
0172     fEmName = name;
0173     delete fEmPhysicsList;
0174     fEmPhysicsList = new G4EmStandardPhysics();
0175   }
0176   else if (name == "emstandard_opt1") {
0177     fEmName = name;
0178     delete fEmPhysicsList;
0179     fEmPhysicsList = new G4EmStandardPhysics_option1();
0180   }
0181   else if (name == "emstandard_opt2") {
0182     fEmName = name;
0183     delete fEmPhysicsList;
0184     fEmPhysicsList = new G4EmStandardPhysics_option2();
0185   }
0186   else if (name == "emstandard_opt3") {
0187     fEmName = name;
0188     delete fEmPhysicsList;
0189     fEmPhysicsList = new G4EmStandardPhysics_option3();
0190   }
0191   else if (name == "emstandard_opt4") {
0192     fEmName = name;
0193     delete fEmPhysicsList;
0194     fEmPhysicsList = new G4EmStandardPhysics_option4();
0195   }
0196   else if (name == "emstandardSS") {
0197     fEmName = name;
0198     delete fEmPhysicsList;
0199     fEmPhysicsList = new G4EmStandardPhysicsSS();
0200   }
0201   else if (name == "emstandardWVI") {
0202     fEmName = name;
0203     delete fEmPhysicsList;
0204     fEmPhysicsList = new G4EmStandardPhysicsWVI();
0205   }
0206   else if (name == "emstandardGS") {
0207     fEmName = name;
0208     delete fEmPhysicsList;
0209     fEmPhysicsList = new G4EmStandardPhysicsGS();
0210   }
0211   else if (name == "empenelope") {
0212     fEmName = name;
0213     delete fEmPhysicsList;
0214     fEmPhysicsList = new G4EmPenelopePhysics();
0215   }
0216   else if (name == "emlowenergy") {
0217     fEmName = name;
0218     delete fEmPhysicsList;
0219     fEmPhysicsList = new G4EmLowEPPhysics();
0220   }
0221   else if (name == "emlivermore") {
0222     fEmName = name;
0223     delete fEmPhysicsList;
0224     fEmPhysicsList = new G4EmLivermorePhysics();
0225   }
0226   else if (name == "dna") {
0227     fEmName = name;
0228     delete fEmPhysicsList;
0229     fEmPhysicsList = new G4EmDNAPhysics();
0230   }
0231   else if (name == "dna_opt2") {
0232     fEmName = name;
0233     delete fEmPhysicsList;
0234     fEmPhysicsList = new G4EmDNAPhysics_option2();
0235   }
0236   else if (name == "dna_opt4") {
0237     fEmName = name;
0238     delete fEmPhysicsList;
0239     fEmPhysicsList = new G4EmDNAPhysics_option4();
0240   }
0241   else if (name == "dna_opt6") {
0242     fEmName = name;
0243     delete fEmPhysicsList;
0244     fEmPhysicsList = new G4EmDNAPhysics_option6();
0245   }
0246   else if (name == "had_elastic" && !fHadPhysicsList) {
0247     fHadPhysicsList = new G4HadronElasticPhysics();
0248   }
0249   else {
0250     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0251            << " is not defined" << G4endl;
0252   }
0253 }
0254 
0255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......