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 16 of file ParametrisedPhysics.cc.

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

Member Function Documentation

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 }
void ParametrisedPhysics::ConstructProcess ( )
overrideprotected

Definition at line 46 of file ParametrisedPhysics.cc.

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.

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 }
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().