Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-03 07:56:05

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 /////////////////////////////////////////////////////////////////////////
0030 //
0031 // PhysicsList
0032 //
0033 // Created: 31.04.2006 V.Ivanchenko
0034 //
0035 // Modified:
0036 // 04.06.2006 Adoptation of Hadr01 (V.Ivanchenko)
0037 // 26.04.2007 Physics according to 8.3 Physics List (V.Ivanchenko)
0038 // 16.10.2012 Renamed used classes (A.Ribon)
0039 //
0040 ////////////////////////////////////////////////////////////////////////
0041 //
0042 
0043 #include "PhysicsList.hh"
0044 
0045 #include "PhysicsListMessenger.hh"
0046 
0047 #include "G4DecayPhysics.hh"
0048 #include "G4Electron.hh"
0049 #include "G4EmExtraPhysics.hh"
0050 #include "G4EmLivermorePhysics.hh"
0051 #include "G4EmParameters.hh"
0052 #include "G4EmPenelopePhysics.hh"
0053 #include "G4EmStandardPhysics.hh"
0054 #include "G4EmStandardPhysicsGS.hh"
0055 #include "G4EmStandardPhysics_option1.hh"
0056 #include "G4EmStandardPhysics_option2.hh"
0057 #include "G4EmStandardPhysics_option3.hh"
0058 #include "G4EmStandardPhysics_option4.hh"
0059 #include "G4Gamma.hh"
0060 #include "G4HadronElasticPhysics.hh"
0061 #include "G4HadronElasticPhysicsHP.hh"
0062 #include "G4HadronElasticPhysicsXS.hh"
0063 #include "G4HadronHElasticPhysics.hh"
0064 #include "G4HadronInelasticQBBC.hh"
0065 #include "G4HadronPhysicsFTFP_BERT.hh"
0066 #include "G4HadronPhysicsFTFP_BERT_HP.hh"
0067 #include "G4HadronPhysicsFTFP_BERT_TRV.hh"
0068 #include "G4HadronPhysicsFTF_BIC.hh"
0069 #include "G4HadronPhysicsQGSP_BERT.hh"
0070 #include "G4HadronPhysicsQGSP_BERT_HP.hh"
0071 #include "G4HadronPhysicsQGSP_BIC.hh"
0072 #include "G4HadronPhysicsQGSP_BIC_HP.hh"
0073 #include "G4HadronPhysicsQGSP_FTFP_BERT.hh"
0074 #include "G4HadronPhysicsQGS_BIC.hh"
0075 #include "G4IonBinaryCascadePhysics.hh"
0076 #include "G4IonElasticPhysics.hh"
0077 #include "G4IonPhysics.hh"
0078 #include "G4IonPhysicsXS.hh"
0079 #include "G4NeutronCrossSectionXS.hh"
0080 #include "G4NeutronTrackingCut.hh"
0081 #include "G4ParticleTable.hh"
0082 #include "G4ParticleTypes.hh"
0083 #include "G4PhysListFactoryMessenger.hh"
0084 #include "G4Positron.hh"
0085 #include "G4ProcessManager.hh"
0086 #include "G4Proton.hh"
0087 #include "G4RadioactiveDecayPhysics.hh"
0088 #include "G4StoppingPhysics.hh"
0089 #include "G4SystemOfUnits.hh"
0090 
0091 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0092 
0093 PhysicsList::PhysicsList() : G4VModularPhysicsList()
0094 {
0095   SetDefaultCutValue(0.7 * CLHEP::mm);
0096   verboseLevel = 1;
0097 
0098   // Messengers
0099   fMessenger = new PhysicsListMessenger(this);
0100   fFactMessenger = new G4PhysListFactoryMessenger(this);
0101 
0102   // Particles
0103   fParticleList = new G4DecayPhysics(verboseLevel);
0104 
0105   // EM physics
0106   fEmPhysicsList = new G4EmStandardPhysics(verboseLevel);
0107 }
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0110 
0111 PhysicsList::~PhysicsList()
0112 {
0113   delete fMessenger;
0114   delete fParticleList;
0115   delete fEmPhysicsList;
0116   for (std::size_t i = 0; i < fHadronPhys.size(); ++i) {
0117     delete fHadronPhys[i];
0118   }
0119 }
0120 
0121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0122 
0123 void PhysicsList::ConstructParticle()
0124 {
0125   fParticleList->ConstructParticle();
0126 }
0127 
0128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0129 
0130 void PhysicsList::ConstructProcess()
0131 {
0132   AddTransportation();
0133   fEmPhysicsList->ConstructProcess();
0134   fParticleList->ConstructProcess();
0135   for (std::size_t i = 0; i < fHadronPhys.size(); ++i) {
0136     fHadronPhys[i]->ConstructProcess();
0137   }
0138 }
0139 
0140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0141 
0142 void PhysicsList::AddPhysicsList(const G4String& name)
0143 {
0144   if (verboseLevel > 0) {
0145     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0146   }
0147   if (name == "emstandard_opt0") {
0148     delete fEmPhysicsList;
0149     fEmPhysicsList = new G4EmStandardPhysics(verboseLevel);
0150   }
0151   else if (name == "emstandard_opt1") {
0152     delete fEmPhysicsList;
0153     fEmPhysicsList = new G4EmStandardPhysics_option1(verboseLevel);
0154   }
0155   else if (name == "emstandard_opt2") {
0156     delete fEmPhysicsList;
0157     fEmPhysicsList = new G4EmStandardPhysics_option2(verboseLevel);
0158   }
0159   else if (name == "emstandard_opt3") {
0160     delete fEmPhysicsList;
0161     fEmPhysicsList = new G4EmStandardPhysics_option3(verboseLevel);
0162   }
0163   else if (name == "emstandard_opt4") {
0164     delete fEmPhysicsList;
0165     fEmPhysicsList = new G4EmStandardPhysics_option4(verboseLevel);
0166   }
0167   else if (name == "emstandardGS") {
0168     delete fEmPhysicsList;
0169     fEmPhysicsList = new G4EmStandardPhysicsGS(verboseLevel);
0170   }
0171   else if (name == "FTFP_BERT_EMV") {
0172     AddPhysicsList("FTFP_BERT");
0173     AddPhysicsList("emstandard_opt1");
0174   }
0175   else if (name == "FTFP_BERT_EMX") {
0176     AddPhysicsList("FTFP_BERT");
0177     AddPhysicsList("emstandard_opt2");
0178   }
0179   else if (name == "FTFP_BERT_EMY") {
0180     AddPhysicsList("FTFP_BERT");
0181     AddPhysicsList("emstandard_opt3");
0182   }
0183   else if (name == "FTFP_BERT_EMZ") {
0184     AddPhysicsList("FTFP_BERT");
0185     AddPhysicsList("emstandard_opt4");
0186   }
0187   else if (name == "FTFP_BERT") {
0188     SetBuilderList0(false);
0189     fHadronPhys.push_back(new G4HadronPhysicsFTFP_BERT(verboseLevel));
0190   }
0191   else if (name == "FTFP_BERT_TRV") {
0192     AddPhysicsList("emstandardGS");
0193     SetBuilderList1(false);
0194     fHadronPhys.push_back(new G4HadronPhysicsFTFP_BERT_TRV(verboseLevel));
0195   }
0196   else if (name == "FTF_BIC") {
0197     SetBuilderList0(false);
0198     fHadronPhys.push_back(new G4HadronPhysicsFTF_BIC(verboseLevel));
0199   }
0200   else if (name == "QBBC") {
0201     AddPhysicsList("emstandard_opt0");
0202     SetBuilderList2();
0203     fHadronPhys.push_back(new G4HadronInelasticQBBC(verboseLevel));
0204   }
0205   else if (name == "QGSP_BERT") {
0206     SetBuilderList0(false);
0207     fHadronPhys.push_back(new G4HadronPhysicsQGSP_BERT(verboseLevel));
0208   }
0209   else if (name == "QGSP_FTFP_BERT") {
0210     SetBuilderList0(false);
0211     fHadronPhys.push_back(new G4HadronPhysicsQGSP_FTFP_BERT(verboseLevel));
0212   }
0213   else if (name == "QGSP_FTFP_BERT_EMV") {
0214     AddPhysicsList("QGSP_FTFP_BERT");
0215     AddPhysicsList("emstandard_opt1");
0216   }
0217   else if (name == "QGSP_BERT_EMV") {
0218     AddPhysicsList("QGSP_BERT");
0219     AddPhysicsList("emstandard_opt1");
0220   }
0221   else if (name == "QGSP_BERT_EMX") {
0222     AddPhysicsList("QGSP_BERT");
0223     AddPhysicsList("emstandard_opt2");
0224   }
0225   else if (name == "QGSP_BERT_HP") {
0226     SetBuilderList0(true);
0227     fHadronPhys.push_back(new G4HadronPhysicsQGSP_BERT_HP(verboseLevel));
0228     AddPhysicsList("RadioactiveDecay");
0229   }
0230   else if (name == "QGSP_BIC") {
0231     SetBuilderList0(false);
0232     fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC(verboseLevel));
0233     fHadronPhys.push_back(new G4IonElasticPhysics(verboseLevel));
0234   }
0235   else if (name == "QGSP_BIC_EMY") {
0236     AddPhysicsList("QGSP_BIC");
0237     AddPhysicsList("emstandard_opt3");
0238   }
0239   else if (name == "QGS_BIC") {
0240     SetBuilderList0(false);
0241     fHadronPhys.push_back(new G4HadronPhysicsQGS_BIC(verboseLevel));
0242   }
0243   else if (name == "QGSP_BIC_HP") {
0244     SetBuilderList0(true);
0245     fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP(verboseLevel));
0246     AddPhysicsList("RadioactiveDecay");
0247   }
0248   else if (name == "RadioactiveDecay") {
0249     fHadronPhys.push_back(new G4RadioactiveDecayPhysics(verboseLevel));
0250   }
0251   else {
0252     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0253            << " is not defined" << G4endl;
0254   }
0255 }
0256 
0257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0258 
0259 void PhysicsList::SetBuilderList0(G4bool flagHP)
0260 {
0261   fHadronPhys.push_back(new G4EmExtraPhysics(verboseLevel));
0262   if (flagHP) {
0263     fHadronPhys.push_back(new G4HadronElasticPhysicsHP(verboseLevel));
0264   }
0265   else {
0266     fHadronPhys.push_back(new G4HadronElasticPhysics(verboseLevel));
0267   }
0268   fHadronPhys.push_back(new G4StoppingPhysics(verboseLevel));
0269   fHadronPhys.push_back(new G4IonPhysics(verboseLevel));
0270   if (!flagHP) {
0271     fHadronPhys.push_back(new G4NeutronTrackingCut(verboseLevel));
0272   }
0273 }
0274 
0275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0276 
0277 void PhysicsList::SetBuilderList1(G4bool flagHP)
0278 {
0279   fHadronPhys.push_back(new G4EmExtraPhysics(verboseLevel));
0280   if (flagHP) {
0281     fHadronPhys.push_back(new G4HadronElasticPhysicsHP(verboseLevel));
0282   }
0283   else {
0284     fHadronPhys.push_back(new G4HadronHElasticPhysics(verboseLevel));
0285   }
0286   fHadronPhys.push_back(new G4StoppingPhysics(verboseLevel));
0287   fHadronPhys.push_back(new G4IonPhysics(verboseLevel));
0288   if (!flagHP) {
0289     fHadronPhys.push_back(new G4NeutronTrackingCut(verboseLevel));
0290   }
0291 }
0292 
0293 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0294 
0295 void PhysicsList::SetBuilderList2()
0296 {
0297   fHadronPhys.push_back(new G4EmExtraPhysics(verboseLevel));
0298   fHadronPhys.push_back(new G4HadronElasticPhysicsXS(verboseLevel));
0299   fHadronPhys.push_back(new G4StoppingPhysics(verboseLevel));
0300   fHadronPhys.push_back(new G4IonPhysicsXS(verboseLevel));
0301   fHadronPhys.push_back(new G4IonElasticPhysics(verboseLevel));
0302   fHadronPhys.push_back(new G4NeutronTrackingCut(verboseLevel));
0303 }
0304 
0305 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
0306 
0307 void PhysicsList::List()
0308 {
0309   G4cout << "### PhysicsLists available: FTFP_BERT FTFP_BERT_EMV "
0310          << "FTFP_BERT_EMX FTFP_BERT_EMZ FTFP_BERT_TRV" << G4endl;
0311   G4cout << "                            FTF_BIC QBBC QGSP_BERT "
0312          << "QGSP_BERT_EMV QGSP_BERT_EMX" << G4endl;
0313   G4cout << "                            QGSP_BERT_HP QGSP_FTFP_BERT "
0314          << "QGSP_FTFP_BERT_EMV" << G4endl;
0315   G4cout << "                            QGS_BIC QGSP_BIC QGSP_BIC_EMY "
0316          << "QGSP_BIC_HP" << G4endl;
0317 }
0318 
0319 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......