File indexing completed on 2023-03-17 11:24:56
0001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0002 #include "SimG4Core/GFlash/interface/GFlash.h"
0003 #include "SimG4Core/GFlash/interface/ParametrisedPhysics.h"
0004 #include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"
0005 #include "SimG4Core/PhysicsLists/interface/CMSHadronPhysicsFTFP_BERT.h"
0006
0007 #include "G4DecayPhysics.hh"
0008 #include "G4EmExtraPhysics.hh"
0009 #include "G4HadronElasticPhysics.hh"
0010 #include "G4IonPhysics.hh"
0011 #include "G4NeutronTrackingCut.hh"
0012 #include "G4StoppingPhysics.hh"
0013
0014 #include "SimGeneral/GFlash/interface/GflashHistogram.h"
0015
0016 #include <string>
0017
0018 GFlash::GFlash(const edm::ParameterSet &p) : PhysicsList(p), thePar(p.getParameter<edm::ParameterSet>("GFlash")) {
0019 int ver = p.getUntrackedParameter<int>("Verbosity", 0);
0020 bool emPhys = p.getUntrackedParameter<bool>("EMPhysics", true);
0021 bool hadPhys = p.getUntrackedParameter<bool>("HadPhysics", true);
0022 bool tracking = p.getParameter<bool>("TrackingCut");
0023 std::string region = p.getParameter<std::string>("Region");
0024
0025 edm::LogInfo("PhysicsList") << "You are using the obsolete simulation engine: "
0026 << " GFlash with Flags for EM Physics " << emPhys << ", for Hadronic Physics " << hadPhys
0027 << " and tracking cut " << tracking << " with special region " << region;
0028
0029 RegisterPhysics(new ParametrisedPhysics("parametrised", thePar));
0030
0031 if (emPhys) {
0032
0033 RegisterPhysics(new CMSEmStandardPhysics(ver, p));
0034
0035
0036 RegisterPhysics(new G4EmExtraPhysics(ver));
0037 }
0038
0039
0040 RegisterPhysics(new G4DecayPhysics(ver));
0041
0042 if (hadPhys) {
0043
0044 RegisterPhysics(new G4HadronElasticPhysics(ver));
0045
0046
0047 RegisterPhysics(new CMSHadronPhysicsFTFP_BERT(ver));
0048
0049 RegisterPhysics(new G4StoppingPhysics(ver));
0050
0051
0052 RegisterPhysics(new G4IonPhysics(ver));
0053
0054
0055 if (tracking) {
0056 RegisterPhysics(new G4NeutronTrackingCut(ver));
0057 }
0058 }
0059
0060 if (thePar.getParameter<bool>("GflashHistogram")) {
0061 theHisto = GflashHistogram::instance();
0062 theHisto->setStoreFlag(true);
0063 theHisto->bookHistogram(thePar.getParameter<std::string>("GflashHistogramName"));
0064 }
0065 }
0066
0067 GFlash::~GFlash() {
0068 if (thePar.getParameter<bool>("GflashHistogram")) {
0069 if (theHisto)
0070 delete theHisto;
0071 }
0072 }
0073
0074
0075 #include "FWCore/Framework/interface/MakerMacros.h"
0076 #include "SimG4Core/Physics/interface/PhysicsListFactory.h"
0077
0078 DEFINE_PHYSICSLIST(GFlash);