CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes
ParametrisedPhysics Class Reference

#include <ParametrisedPhysics.h>

Inheritance diagram for ParametrisedPhysics:

Classes

struct  ThreadPrivate
 

Public Member Functions

 ParametrisedPhysics (std::string name, const edm::ParameterSet &p)
 
 ~ParametrisedPhysics () override
 

Protected Member Functions

void ConstructParticle () override
 
void ConstructProcess () override
 

Private Attributes

edm::ParameterSet theParSet
 

Static Private Attributes

static G4ThreadLocal ThreadPrivatetpdata = nullptr
 

Detailed Description

Definition at line 14 of file ParametrisedPhysics.h.

Constructor & Destructor Documentation

◆ ParametrisedPhysics()

ParametrisedPhysics::ParametrisedPhysics ( std::string  name,
const edm::ParameterSet p 
)

Definition at line 16 of file ParametrisedPhysics.cc.

17  : G4VPhysicsConstructor(name), theParSet(p) {}

◆ ~ParametrisedPhysics()

ParametrisedPhysics::~ParametrisedPhysics ( )
override

Member Function Documentation

◆ ConstructParticle()

void ParametrisedPhysics::ConstructParticle ( )
overrideprotected

Definition at line 29 of file ParametrisedPhysics.cc.

29  {
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 }

◆ ConstructProcess()

void ParametrisedPhysics::ConstructProcess ( )
overrideprotected

Definition at line 46 of file ParametrisedPhysics.cc.

46  {
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 }

References ecalTB2006H4_GenSimDigiReco_cfg::G4cout, edm::ParameterSet::getParameter(), Calorimetry_cff::GflashEMShowerModel, HiggsValidation_cfi::particleName, EmParticleList::PartNames(), unpackData-CaloStage2::pname, TableParser::table, ParametrisedPhysics::ThreadPrivate::theEMShowerModel, ParametrisedPhysics::ThreadPrivate::theFastSimulationManagerProcess, ParametrisedPhysics::ThreadPrivate::theHadronShowerModel, ParametrisedPhysics::ThreadPrivate::theHadShowerModel, theParSet, and tpdata.

Member Data Documentation

◆ theParSet

edm::ParameterSet ParametrisedPhysics::theParSet
private

Definition at line 24 of file ParametrisedPhysics.h.

Referenced by ConstructProcess().

◆ tpdata

G4ThreadLocal ParametrisedPhysics::ThreadPrivate * ParametrisedPhysics::tpdata = nullptr
staticprivate

Definition at line 31 of file ParametrisedPhysics.h.

Referenced by ConstructProcess(), and ~ParametrisedPhysics().

ParametrisedPhysics::ThreadPrivate::theFastSimulationManagerProcess
G4FastSimulationManagerProcess * theFastSimulationManagerProcess
Definition: ParametrisedPhysics.h:29
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ParametrisedPhysics::ThreadPrivate::theHadShowerModel
GflashEMShowerModel * theHadShowerModel
Definition: ParametrisedPhysics.h:27
HiggsValidation_cfi.particleName
particleName
Definition: HiggsValidation_cfi.py:7
unpackData-CaloStage2.pname
pname
Definition: unpackData-CaloStage2.py:76
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EmParticleList
Definition: EmParticleList.h:10
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
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