CMS 3D CMS Logo

GFlash.cc
Go to the documentation of this file.
6 
7 #include "G4DecayPhysics.hh"
8 #include "G4EmExtraPhysics.hh"
9 #include "G4HadronElasticPhysics.hh"
10 #include "G4IonPhysics.hh"
11 #include "G4NeutronTrackingCut.hh"
12 #include "G4StoppingPhysics.hh"
13 
15 
16 #include <string>
17 
18 GFlash::GFlash(const edm::ParameterSet &p) : PhysicsList(p), thePar(p.getParameter<edm::ParameterSet>("GFlash")) {
19  int ver = p.getUntrackedParameter<int>("Verbosity", 0);
20  bool emPhys = p.getUntrackedParameter<bool>("EMPhysics", true);
21  bool hadPhys = p.getUntrackedParameter<bool>("HadPhysics", true);
22  bool tracking = p.getParameter<bool>("TrackingCut");
23  std::string region = p.getParameter<std::string>("Region");
24 
25  edm::LogInfo("PhysicsList") << "You are using the obsolete simulation engine: "
26  << " GFlash with Flags for EM Physics " << emPhys << ", for Hadronic Physics " << hadPhys
27  << " and tracking cut " << tracking << " with special region " << region;
28 
29  RegisterPhysics(new ParametrisedPhysics("parametrised", thePar));
30 
31  if (emPhys) {
32  // EM Physics
33  RegisterPhysics(new CMSEmStandardPhysics(ver, p));
34 
35  // Synchroton Radiation & GN Physics
36  RegisterPhysics(new G4EmExtraPhysics(ver));
37  }
38 
39  // Decays
40  RegisterPhysics(new G4DecayPhysics(ver));
41 
42  if (hadPhys) {
43  // Hadron Elastic scattering
44  RegisterPhysics(new G4HadronElasticPhysics(ver));
45 
46  // Hadron Physics
47  RegisterPhysics(new CMSHadronPhysicsFTFP_BERT(ver));
48  // Stopping Physics
49  RegisterPhysics(new G4StoppingPhysics(ver));
50 
51  // Ion Physics
52  RegisterPhysics(new G4IonPhysics(ver));
53 
54  // Neutron tracking cut
55  if (tracking) {
56  RegisterPhysics(new G4NeutronTrackingCut(ver));
57  }
58  }
59  // singleton histogram object
60  if (thePar.getParameter<bool>("GflashHistogram")) {
62  theHisto->setStoreFlag(true);
63  theHisto->bookHistogram(thePar.getParameter<std::string>("GflashHistogramName"));
64  }
65 }
66 
68  if (thePar.getParameter<bool>("GflashHistogram")) {
69  if (theHisto)
70  delete theHisto;
71  }
72 }
73 
74 // define this as a plug-in
77 
static GflashHistogram * instance()
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
#define DEFINE_PHYSICSLIST(type)
~GFlash() override
Definition: GFlash.cc:67
Definition: GFlash.h:11
edm::ParameterSet thePar
Definition: GFlash.h:18
void bookHistogram(std::string histFileName="gflash_histogram.root")
GFlash(const edm::ParameterSet &p)
Definition: GFlash.cc:18
Log< level::Info, false > LogInfo
HLT enums.
GflashHistogram * theHisto
Definition: GFlash.h:17
void setStoreFlag(bool flag)