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)
 
virtual ~ParametrisedPhysics ()
 

Protected Member Functions

virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 

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

17  :
18  G4VPhysicsConstructor(name), theParSet(p)
19 {}
edm::ParameterSet theParSet
ParametrisedPhysics::~ParametrisedPhysics ( )
virtual

Member Function Documentation

void ParametrisedPhysics::ConstructParticle ( )
protectedvirtual

Definition at line 31 of file ParametrisedPhysics.cc.

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

Definition at line 49 of file ParametrisedPhysics.cc.

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

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

Member Data Documentation

edm::ParameterSet ParametrisedPhysics::theParSet
private

Definition at line 25 of file ParametrisedPhysics.h.

Referenced by ConstructProcess().

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

Definition at line 32 of file ParametrisedPhysics.h.

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