CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GFlash.cc
Go to the documentation of this file.
9 
10 #include "G4DecayPhysics.hh"
11 #include "G4EmExtraPhysics.hh"
12 #include "G4IonPhysics.hh"
13 #include "G4QStoppingPhysics.hh"
14 #include "G4HadronElasticPhysics.hh"
15 #include "G4NeutronTrackingCut.hh"
16 
17 #include "G4DataQuestionaire.hh"
19 
20 #include <string>
21 
24  sim::FieldBuilder *fieldBuilder_,
25  const edm::ParameterSet & p) : PhysicsList(map, table_, fieldBuilder_, p),
26  thePar(p.getParameter<edm::ParameterSet>("GFlash")) {
27 
28  G4DataQuestionaire it(photon);
29 
30  std::string hadronPhysics = thePar.getParameter<std::string>("GflashHadronPhysics");
31 
32  int ver = p.getUntrackedParameter<int>("Verbosity",0);
33  bool emPhys = p.getUntrackedParameter<bool>("EMPhysics",true);
34  bool hadPhys = p.getUntrackedParameter<bool>("HadPhysics",true);
35  bool tracking= p.getParameter<bool>("TrackingCut");
36  std::string region = p.getParameter<std::string>("Region");
37 
38  edm::LogInfo("PhysicsList") << "You are using the simulation engine: "
39  << hadronPhysics << " + CMS GFLASH with Flags for EM Physics "
40  << emPhys << ", for Hadronic Physics "
41  << hadPhys << " and tracking cut " << tracking
42  << " with special region " << region;
43 
44  RegisterPhysics(new ParametrisedPhysics("parametrised",thePar));
45 
46  if (emPhys) {
47  // EM Physics
48  RegisterPhysics( new CMSEmStandardPhysics92("standard EM EML",ver,region));
49 
50  // Synchroton Radiation & GN Physics
51  RegisterPhysics( new G4EmExtraPhysics("extra EM"));
52  }
53 
54  // Decays
55  RegisterPhysics( new G4DecayPhysics("decay",ver) );
56 
57  if (hadPhys) {
58  // Hadron Elastic scattering
59  RegisterPhysics( new G4HadronElasticPhysics("elastic",ver,false));
60 
61  // Hadron Physics
62  G4bool quasiElastic=true;
63 
64  if(hadronPhysics=="QGSP_FTFP_BERT") {
65  RegisterPhysics( new HadronPhysicsQGSPCMS_FTFP_BERT_WP("hadron",quasiElastic));
66  }
67  else if(hadronPhysics=="QGSP_BERT") {
68  RegisterPhysics( new HadronPhysicsQGSP_BERT_WP("hadron",quasiElastic));
69  }
70  else if (hadronPhysics=="QGSP") {
71  RegisterPhysics( new HadronPhysicsQGSP_WP("hadron",quasiElastic));
72  }
73  else {
74  edm::LogInfo("PhysicsList") << hadronPhysics << " is not available for GflashHadronPhysics!"
75  << "... Using QGSP_FTFP_BERT\n";
76  RegisterPhysics( new HadronPhysicsQGSPCMS_FTFP_BERT_WP("hadron",quasiElastic));
77  }
78  // Stopping Physics
79  RegisterPhysics( new G4QStoppingPhysics("stopping"));
80 
81  // Ion Physics
82  RegisterPhysics( new G4IonPhysics("ion"));
83 
84  // Neutron tracking cut
85  if (tracking)
86  RegisterPhysics( new G4NeutronTrackingCut("Neutron tracking cut", ver));
87  }
88 
89  // Monopoles
90  RegisterPhysics( new CMSMonopolePhysics(table_,fieldBuilder_,p));
91 
92  // singleton histogram object
93  if(thePar.getParameter<bool>("GflashHistogram")) {
95  theHisto->setStoreFlag(true);
96  theHisto->bookHistogram(thePar.getParameter<std::string>("GflashHistogramName"));
97  }
98 
99 }
100 
102 
103  if(thePar.getParameter<bool>("GflashHistogram")) {
104  if(theHisto) delete theHisto;
105  }
106 
107 }
108 
109 //define this as a plug-in
112 
113 
115 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual ~GFlash()
Definition: GFlash.cc:101
static GflashHistogram * instance()
#define DEFINE_PHYSICSLIST(type)
HepPDT::ParticleDataTable ParticleDataTable
GFlash(G4LogicalVolumeToDDLogicalPartMap &map, const HepPDT::ParticleDataTable *table_, sim::FieldBuilder *fieldBuilder_, const edm::ParameterSet &p)
Definition: GFlash.cc:22
Definition: GFlash.h:11
dictionary map
Definition: Association.py:205
edm::ParameterSet thePar
Definition: GFlash.h:19
void bookHistogram(std::string histFileName="gflash_histogram.root")
Table table_
Definition: Actions.cc:22
GflashHistogram * theHisto
Definition: GFlash.h:18
void setStoreFlag(bool flag)