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

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

Member Function Documentation

void ParametrisedPhysics::ConstructParticle ( )
protectedvirtual

Definition at line 32 of file ParametrisedPhysics.cc.

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

Definition at line 50 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.

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