Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:30

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