test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
ThreadPrivate
tpdata = nullptr
 

Detailed Description

Definition at line 13 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

Definition at line 22 of file ParametrisedPhysics.cc.

References ParametrisedPhysics::ThreadPrivate::theEMShowerModel, ParametrisedPhysics::ThreadPrivate::theHadronShowerModel, ParametrisedPhysics::ThreadPrivate::theHadShowerModel, and tpdata.

22  {
23  if(nullptr != tpdata) {
24  delete tpdata->theEMShowerModel;
25  delete tpdata->theHadShowerModel;
27  delete tpdata;
28  tpdata = nullptr;
29  }
30 }
GflashHadronShowerModel * theHadronShowerModel
static G4ThreadLocal ThreadPrivate * tpdata

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 edm::ParameterSet::getParameter(), ecalTB2006H4_GenSimDigiReco_cfg::GflashEMShowerModel, unpackData-CaloStage2::pname, ParametrisedPhysics::ThreadPrivate::theEMShowerModel, 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;
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) {
62  G4FastSimulationManagerProcess * theFastSimulationManagerProcess =
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->AddProcess(theFastSimulationManagerProcess, -1, -1, 1);
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
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 30 of file ParametrisedPhysics.h.

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