Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-03 07:53:04

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 TSPhysicsList.cc
0027 /// \brief Implementation of the TSPhysicsList class
0028 ///
0029 /// This is a very, very extensive physics list and step-limiters are applied
0030 ///     to many particles. The reasoning behind this is because we wan't to put
0031 ///     as much pressure on the atomics as possible and produce as much
0032 ///     round-off error as possible. See descriptions in README and
0033 ///     TSDetectorConstruction for more details.
0034 //
0035 //
0036 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0038 
0039 #include "TSPhysicsList.hh"
0040 
0041 #include "G4ParticleDefinition.hh"
0042 #include "G4ParticleTypes.hh"
0043 #include "G4ProcessManager.hh"
0044 #include "G4RunManager.hh"
0045 
0046 // Hadrons
0047 #include "G4BaryonConstructor.hh"
0048 #include "G4IonConstructor.hh"
0049 #include "G4MesonConstructor.hh"
0050 
0051 // Bosons
0052 #include "G4BosonConstructor.hh"
0053 
0054 // Leptons
0055 #include "G4LeptonConstructor.hh"
0056 
0057 // Other Particles
0058 #include "G4ShortLivedConstructor.hh"
0059 
0060 // Process options
0061 #include "G4LossTableManager.hh"
0062 
0063 // Physics List Helper
0064 #include "G4PhysicsListHelper.hh"
0065 #include "G4StepLimiter.hh"
0066 
0067 // Constructors
0068 #include "G4DecayPhysics.hh"
0069 #include "G4EmStandardPhysics_option3.hh"
0070 #include "G4EmStandardPhysics_option4.hh"
0071 #include "G4HadronElasticPhysics.hh"
0072 #include "G4HadronElasticPhysicsHP.hh"
0073 #include "G4HadronPhysicsQGSP_BERT.hh"
0074 #include "G4HadronPhysicsQGSP_BERT_HP.hh"
0075 #include "G4IonBinaryCascadePhysics.hh"
0076 #include "G4IonElasticPhysics.hh"
0077 #include "G4RadioactiveDecayPhysics.hh"
0078 
0079 #include <set>
0080 
0081 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0082 
0083 TSPhysicsList::TSPhysicsList()
0084 {
0085   defaultCutValue = 1. * CLHEP::mm;
0086 
0087   fConstructors.push_back(new G4EmStandardPhysics_option4);
0088   fConstructors.push_back(new G4DecayPhysics);
0089   fConstructors.push_back(new G4RadioactiveDecayPhysics);
0090   fConstructors.push_back(new G4HadronPhysicsQGSP_BERT_HP);
0091   fConstructors.push_back(new G4HadronElasticPhysicsHP);
0092   fConstructors.push_back(new G4IonElasticPhysics);
0093   fConstructors.push_back(new G4IonBinaryCascadePhysics);
0094 }
0095 
0096 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0097 
0098 TSPhysicsList::~TSPhysicsList()
0099 {
0100   for (auto ite : fConstructors)
0101     delete ite;
0102 }
0103 
0104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0105 
0106 void TSPhysicsList::ConstructParticle()
0107 {
0108   for (auto c : fConstructors) {
0109     c->ConstructParticle();
0110   }
0111 }
0112 
0113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0114 
0115 void TSPhysicsList::ConstructProcess()
0116 {
0117   // Transportation
0118   //
0119   AddTransportation();
0120 
0121   for (auto c : fConstructors) {
0122     c->ConstructProcess();
0123   }
0124 
0125   std::set<G4String> step_limit_particles;
0126   // standard particles
0127   step_limit_particles.insert("e-");
0128   step_limit_particles.insert("e+");
0129   step_limit_particles.insert("alpha");
0130   step_limit_particles.insert("He3");
0131   step_limit_particles.insert("GenericIon");
0132   step_limit_particles.insert("proton");
0133   step_limit_particles.insert("neutron");
0134   // more ~exotic particles
0135   step_limit_particles.insert("pi+");
0136   step_limit_particles.insert("pi-");
0137   step_limit_particles.insert("mu+");
0138   step_limit_particles.insert("mu-");
0139 
0140   auto particleIterator = GetParticleIterator();
0141   particleIterator->reset();
0142 
0143   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0144 
0145   while ((*particleIterator)()) {
0146     G4ParticleDefinition* particle = particleIterator->value();
0147     G4String pname = particle->GetParticleName();
0148 
0149     if (step_limit_particles.find(pname) != step_limit_particles.end() || particle->GetPDGCharge())
0150     {
0151       ph->RegisterProcess(new G4StepLimiter, particle);
0152     }
0153   }
0154 }
0155 
0156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......