File indexing completed on 2023-03-17 11:25:00
0001 #include "FTFPCMS_BERT_EMM.h"
0002 #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"
0003 #include "SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005
0006 #include "G4DecayPhysics.hh"
0007 #include "G4EmExtraPhysics.hh"
0008 #include "G4IonPhysics.hh"
0009 #include "G4StoppingPhysics.hh"
0010 #include "G4HadronElasticPhysics.hh"
0011
0012 #include "G4Version.hh"
0013 #if G4VERSION_NUMBER >= 1110
0014 #include "G4HadronicParameters.hh"
0015 #endif
0016
0017 FTFPCMS_BERT_EMM::FTFPCMS_BERT_EMM(const edm::ParameterSet& p) : PhysicsList(p) {
0018 int ver = p.getUntrackedParameter<int>("Verbosity", 0);
0019 bool emPhys = p.getUntrackedParameter<bool>("EMPhysics", true);
0020 bool hadPhys = p.getUntrackedParameter<bool>("HadPhysics", true);
0021 double minFTFP = p.getParameter<double>("EminFTFP") * CLHEP::GeV;
0022 double maxBERT = p.getParameter<double>("EmaxBERT") * CLHEP::GeV;
0023 double maxBERTpi = p.getParameter<double>("EmaxBERTpi") * CLHEP::GeV;
0024 edm::LogVerbatim("PhysicsList") << "CMS Physics List FTFP_BERT_EMM: "
0025 << "\n Flags for EM Physics: " << emPhys << "; Hadronic Physics: " << hadPhys
0026 << "\n Transition energy Bertini/FTFP from " << minFTFP / CLHEP::GeV << " to "
0027 << maxBERT / CLHEP::GeV << "; for pions to " << maxBERTpi / CLHEP::GeV << " GeV";
0028
0029 if (emPhys) {
0030
0031 RegisterPhysics(new CMSEmStandardPhysics(ver, p));
0032
0033
0034 G4EmExtraPhysics* gn = new G4EmExtraPhysics(ver);
0035 RegisterPhysics(gn);
0036 #if G4VERSION_NUMBER >= 1110
0037 bool mu = p.getParameter<bool>("G4MuonPairProductionByMuon");
0038 gn->MuonToMuMu(mu);
0039 edm::LogVerbatim("PhysicsList") << " Muon pair production by muons: " << mu;
0040 #endif
0041 }
0042
0043
0044 this->RegisterPhysics(new G4DecayPhysics(ver));
0045
0046 if (hadPhys) {
0047 #if G4VERSION_NUMBER >= 1110
0048 bool ngen = p.getParameter<bool>("G4NeutronGeneralProcess");
0049 bool bc = p.getParameter<bool>("G4BCHadronicProcess");
0050 bool hn = p.getParameter<bool>("G4LightHyperNucleiTracking");
0051 auto param = G4HadronicParameters::Instance();
0052 param->SetEnableNeutronGeneralProcess(ngen);
0053 param->SetEnableBCParticles(bc);
0054 param->SetEnableHyperNuclei(hn);
0055 edm::LogVerbatim("PhysicsList") << " Eneble neutron general process: " << ngen
0056 << "\n Enable b- and c- hadron physics: " << bc
0057 << "\n Enable light hyper-nuclei physics: " << hn;
0058 #endif
0059
0060
0061 RegisterPhysics(new G4HadronElasticPhysics(ver));
0062
0063
0064 RegisterPhysics(new CMSHadronPhysicsFTFP_BERT(minFTFP, maxBERT, maxBERTpi, minFTFP, maxBERT));
0065
0066
0067 RegisterPhysics(new G4StoppingPhysics(ver));
0068
0069
0070 RegisterPhysics(new G4IonPhysics(ver));
0071 }
0072 }