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 ( std::string  name,
const edm::ParameterSet p 
)

Definition at line 18 of file ParametrisedPhysics.cc.

19  : G4VPhysicsConstructor(name), theParSet(p) {}
edm::ParameterSet theParSet
ParametrisedPhysics::~ParametrisedPhysics ( )
override

Member Function Documentation

void ParametrisedPhysics::ConstructParticle ( )
overrideprotected

Definition at line 31 of file ParametrisedPhysics.cc.

31  {
32  G4LeptonConstructor pLeptonConstructor;
33  pLeptonConstructor.ConstructParticle();
34 
35  G4MesonConstructor pMesonConstructor;
36  pMesonConstructor.ConstructParticle();
37 
38  G4BaryonConstructor pBaryonConstructor;
39  pBaryonConstructor.ConstructParticle();
40 
41  G4ShortLivedConstructor pShortLivedConstructor;
42  pShortLivedConstructor.ConstructParticle();
43 
44  G4IonConstructor pConstructor;
45  pConstructor.ConstructParticle();
46 }
void ParametrisedPhysics::ConstructProcess ( )
overrideprotected

Definition at line 48 of file ParametrisedPhysics.cc.

References ecalTB2006H4_GenSimDigiReco_cfg::G4cout, edm::ParameterSet::getParameter(), ecalTB2006H4_GenSimDigiReco_cfg::GflashEMShowerModel, HiggsValidation_cfi::particleName, EmParticleList::PartNames(), BPhysicsValidation_cfi::pname, ParametrisedPhysics::ThreadPrivate::theEMShowerModel, ParametrisedPhysics::ThreadPrivate::theFastSimulationManagerProcess, ParametrisedPhysics::ThreadPrivate::theHadronShowerModel, ParametrisedPhysics::ThreadPrivate::theHadShowerModel, theParSet, and tpdata.

48  {
49  tpdata = new ThreadPrivate;
50  tpdata->theEMShowerModel = nullptr;
51  tpdata->theHadShowerModel = nullptr;
52  tpdata->theHadronShowerModel = nullptr;
54 
55  bool gem = theParSet.getParameter<bool>("GflashEcal");
56  bool ghad = theParSet.getParameter<bool>("GflashHcal");
57  G4cout << "GFlash Construct: " << gem << " " << ghad << G4endl;
58 
59  if (gem || ghad) {
60  tpdata->theFastSimulationManagerProcess = new G4FastSimulationManagerProcess();
61 
62  G4ParticleTable *table = G4ParticleTable::GetParticleTable();
63  EmParticleList emList;
64  for (const auto &particleName : emList.PartNames()) {
65  G4ParticleDefinition *particle = table->FindParticle(particleName);
66  G4ProcessManager *pmanager = particle->GetProcessManager();
67  const G4String &pname = particle->GetParticleName();
68  if (pname == "e-" || pname == "e+") {
69  pmanager->AddDiscreteProcess(tpdata->theFastSimulationManagerProcess);
70  }
71  }
72 
73  if (gem) {
74  G4Region *aRegion = G4RegionStore::GetInstance()->GetRegion("EcalRegion");
75 
76  if (!aRegion) {
77  G4cout << "EcalRegion is not defined !!!" << G4endl;
78  G4cout << "This means that GFlash will not be turned on." << G4endl;
79 
80  } else {
81  // Electromagnetic Shower Model for ECAL
82  tpdata->theEMShowerModel = new GflashEMShowerModel("GflashEMShowerModel", aRegion, theParSet);
83  G4cout << "GFlash is defined for EcalRegion" << G4endl;
84  }
85  }
86  if (ghad) {
87  G4Region *aRegion = G4RegionStore::GetInstance()->GetRegion("HcalRegion");
88  if (!aRegion) {
89  G4cout << "HcalRegion is not defined !!!" << G4endl;
90  G4cout << "This means that GFlash will not be turned on." << G4endl;
91 
92  } else {
93  // Electromagnetic Shower Model for HCAL
94  tpdata->theHadShowerModel = new GflashEMShowerModel("GflashHadShowerModel", aRegion, theParSet);
95  G4cout << "GFlash is defined for HcalRegion" << G4endl;
96  }
97  }
98  }
99 }
T getParameter(std::string const &) const
const std::vector< G4String > & PartNames() const
edm::ParameterSet theParSet
G4FastSimulationManagerProcess * theFastSimulationManagerProcess
Definition: AMC13Event.h:6
GflashHadronShowerModel * theHadronShowerModel
static G4ThreadLocal ThreadPrivate * tpdata

Member Data Documentation

edm::ParameterSet ParametrisedPhysics::theParSet
private

Definition at line 24 of file ParametrisedPhysics.h.

Referenced by ConstructProcess().

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

Definition at line 31 of file ParametrisedPhysics.h.

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