CMS 3D CMS Logo

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