CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ParametrisedPhysics.cc
Go to the documentation of this file.
3 
4 #include "G4Electron.hh"
5 #include "G4ProcessManager.hh"
6 
7 #include "G4BaryonConstructor.hh"
8 #include "G4IonConstructor.hh"
9 #include "G4LeptonConstructor.hh"
10 #include "G4MesonConstructor.hh"
11 #include "G4RegionStore.hh"
12 #include "G4ShortLivedConstructor.hh"
13 
15 
17  : G4VPhysicsConstructor(name), theParSet(p) {}
18 
20  if (nullptr != tpdata) {
21  delete tpdata->theEMShowerModel;
22  delete tpdata->theHadShowerModel;
25  tpdata = nullptr;
26  }
27 }
28 
30  G4LeptonConstructor pLeptonConstructor;
31  pLeptonConstructor.ConstructParticle();
32 
33  G4MesonConstructor pMesonConstructor;
34  pMesonConstructor.ConstructParticle();
35 
36  G4BaryonConstructor pBaryonConstructor;
37  pBaryonConstructor.ConstructParticle();
38 
39  G4ShortLivedConstructor pShortLivedConstructor;
40  pShortLivedConstructor.ConstructParticle();
41 
42  G4IonConstructor pConstructor;
43  pConstructor.ConstructParticle();
44 }
45 
47  tpdata = new ThreadPrivate;
48  tpdata->theEMShowerModel = nullptr;
49  tpdata->theHadShowerModel = nullptr;
50  tpdata->theHadronShowerModel = nullptr;
52 
53  bool gem = theParSet.getParameter<bool>("GflashEcal");
54  bool ghad = theParSet.getParameter<bool>("GflashHcal");
55  G4cout << "GFlash Construct: " << gem << " " << ghad << G4endl;
56 
57  if (gem || ghad) {
58  tpdata->theFastSimulationManagerProcess = new G4FastSimulationManagerProcess();
59 
60  G4ParticleTable *table = G4ParticleTable::GetParticleTable();
61  EmParticleList emList;
62  for (const auto &particleName : emList.PartNames()) {
63  G4ParticleDefinition *particle = table->FindParticle(particleName);
64  G4ProcessManager *pmanager = particle->GetProcessManager();
65  const G4String &pname = particle->GetParticleName();
66  if (pname == "e-" || pname == "e+") {
67  pmanager->AddDiscreteProcess(tpdata->theFastSimulationManagerProcess);
68  }
69  }
70 
71  if (gem) {
72  G4Region *aRegion = G4RegionStore::GetInstance()->GetRegion("EcalRegion");
73 
74  if (!aRegion) {
75  G4cout << "EcalRegion is not defined !!!" << G4endl;
76  G4cout << "This means that GFlash will not be turned on." << G4endl;
77 
78  } else {
79  // Electromagnetic Shower Model for ECAL
80  tpdata->theEMShowerModel = new GflashEMShowerModel("GflashEMShowerModel", aRegion, theParSet);
81  G4cout << "GFlash is defined for EcalRegion" << G4endl;
82  }
83  }
84  if (ghad) {
85  G4Region *aRegion = G4RegionStore::GetInstance()->GetRegion("HcalRegion");
86  if (!aRegion) {
87  G4cout << "HcalRegion is not defined !!!" << G4endl;
88  G4cout << "This means that GFlash will not be turned on." << G4endl;
89 
90  } else {
91  // Electromagnetic Shower Model for HCAL
92  tpdata->theHadShowerModel = new GflashEMShowerModel("GflashHadShowerModel", aRegion, theParSet);
93  G4cout << "GFlash is defined for HcalRegion" << G4endl;
94  }
95  }
96  }
97 }
EmParticleList.h
ParametrisedPhysics.h
ParametrisedPhysics::ThreadPrivate::theFastSimulationManagerProcess
G4FastSimulationManagerProcess * theFastSimulationManagerProcess
Definition: ParametrisedPhysics.h:29
ParametrisedPhysics::ThreadPrivate
Definition: ParametrisedPhysics.h:25
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ParametrisedPhysics::ConstructProcess
void ConstructProcess() override
Definition: ParametrisedPhysics.cc:46
ParametrisedPhysics::ConstructParticle
void ConstructParticle() override
Definition: ParametrisedPhysics.cc:29
ParametrisedPhysics::ThreadPrivate::theHadShowerModel
GflashEMShowerModel * theHadShowerModel
Definition: ParametrisedPhysics.h:27
HiggsValidation_cfi.particleName
particleName
Definition: HiggsValidation_cfi.py:7
ParametrisedPhysics::~ParametrisedPhysics
~ParametrisedPhysics() override
Definition: ParametrisedPhysics.cc:19
unpackData-CaloStage2.pname
pname
Definition: unpackData-CaloStage2.py:76
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
ParametrisedPhysics::ThreadPrivate::theHadronShowerModel
GflashHadronShowerModel * theHadronShowerModel
Definition: ParametrisedPhysics.h:28
ParametrisedPhysics::theParSet
edm::ParameterSet theParSet
Definition: ParametrisedPhysics.h:24
gem
Definition: AMC13Event.h:6
ParametrisedPhysics::ThreadPrivate::theEMShowerModel
GflashEMShowerModel * theEMShowerModel
Definition: ParametrisedPhysics.h:26
EmParticleList
Definition: EmParticleList.h:10
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ParametrisedPhysics::ParametrisedPhysics
ParametrisedPhysics(std::string name, const edm::ParameterSet &p)
Definition: ParametrisedPhysics.cc:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Calorimetry_cff.GflashEMShowerModel
GflashEMShowerModel
Definition: Calorimetry_cff.py:286
EmParticleList::PartNames
const std::vector< G4String > & PartNames() const
Definition: EmParticleList.cc:52
ParametrisedPhysics::tpdata
static G4ThreadLocal ThreadPrivate * tpdata
Definition: ParametrisedPhysics.h:31
ecalTB2006H4_GenSimDigiReco_cfg.G4cout
G4cout
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:303
TableParser.table
table
Definition: TableParser.py:111