CMS 3D CMS Logo

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