CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ParametrisedPhysics.cc
Go to the documentation of this file.
2 
3 #include "G4Electron.hh"
4 #include "G4FastSimulationManagerProcess.hh"
5 #include "G4ProcessManager.hh"
6 
7 #include "G4LeptonConstructor.hh"
8 #include "G4MesonConstructor.hh"
9 #include "G4BaryonConstructor.hh"
10 #include "G4ShortLivedConstructor.hh"
11 #include "G4IonConstructor.hh"
12 #include "G4RegionStore.hh"
13 
14 
16  G4VPhysicsConstructor(name), theParSet(p) {}
17 
19  if(theParSet.getParameter<bool>("GflashEMShowerModel") && theEMShowerModel)
20  delete theEMShowerModel;
21  if(theParSet.getParameter<bool>("GflashHadronShowerModel") && theHadronShowerModel)
22  delete theHadronShowerModel;
23 }
24 
26 {
27  G4LeptonConstructor pLeptonConstructor;
28  pLeptonConstructor.ConstructParticle();
29 
30  G4MesonConstructor pMesonConstructor;
31  pMesonConstructor.ConstructParticle();
32 
33  G4BaryonConstructor pBaryonConstructor;
34  pBaryonConstructor.ConstructParticle();
35 
36  G4ShortLivedConstructor pShortLivedConstructor;
37  pShortLivedConstructor.ConstructParticle();
38 
39  G4IonConstructor pConstructor;
40  pConstructor.ConstructParticle();
41 }
42 
44 
45  G4FastSimulationManagerProcess * theFastSimulationManagerProcess = new G4FastSimulationManagerProcess();
46  theParticleIterator->reset();
47  while ((*theParticleIterator)()) {
48  G4ParticleDefinition * particle = theParticleIterator->value();
49  G4ProcessManager * pmanager = particle->GetProcessManager();
50  pmanager->AddProcess(theFastSimulationManagerProcess, -1, -1, 1);
51  }
52 
53  // GflashEnvelop definition as CaloRegion which includes EcalRegion & HcalRegion
54  G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion("CaloRegion");
55  if(aRegion == 0){
56  std::cout << "CaloRegion is not defined !!!" << std::endl;
57  std::cout << "This means that GFlash will not be turned on." << std::endl;
58  std::cout << "Take a look at cmsGflashGeometryXML.cfi if it includes gflashCaloProdCuts.xml." << std::endl;
59  }
60 
61  //Electromagnetic Shower Model
62  if(theParSet.getParameter<bool>("GflashEMShowerModel")) {
63  theEMShowerModel = new GflashEMShowerModel("GflashEMShowerModel",aRegion,theParSet);
64  }
65 
66  //Hadronic Shower Model
67  if(theParSet.getParameter<bool>("GflashHadronShowerModel")) {
68  theHadronShowerModel = new GflashHadronShowerModel("GflashHadronShowerModel",aRegion,theParSet);
69  }
70 }
T getParameter(std::string const &) const
ParametrisedPhysics(std::string name, const edm::ParameterSet &p)
edm::ParameterSet theParSet
GflashEMShowerModel * theEMShowerModel
virtual void ConstructParticle()
virtual void ConstructProcess()
GflashHadronShowerModel * theHadronShowerModel
tuple cout
Definition: gather_cfg.py:121