CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ParametrisedEMPhysics Class Reference

#include <ParametrisedEMPhysics.h>

Inheritance diagram for ParametrisedEMPhysics:

Public Member Functions

virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 
 ParametrisedEMPhysics (std::string name, const edm::ParameterSet &p)
 
virtual ~ParametrisedEMPhysics ()
 

Private Attributes

ElectronLimitertheElectronLimiter
 
GFlashEMShowerModeltheEMShowerModel
 
GFlashEMShowerModeltheHadShowerModel
 
edm::ParameterSet theParSet
 
ElectronLimiterthePositronLimiter
 

Detailed Description

Definition at line 17 of file ParametrisedEMPhysics.h.

Constructor & Destructor Documentation

ParametrisedEMPhysics::ParametrisedEMPhysics ( std::string  name,
const edm::ParameterSet p 
)

Definition at line 29 of file ParametrisedEMPhysics.cc.

References theEMShowerModel, and theHadShowerModel.

30  : G4VPhysicsConstructor(name), theParSet(p)
31 {
32  theEMShowerModel = 0;
34 }
edm::ParameterSet theParSet
GFlashEMShowerModel * theHadShowerModel
GFlashEMShowerModel * theEMShowerModel
ParametrisedEMPhysics::~ParametrisedEMPhysics ( )
virtual

Definition at line 36 of file ParametrisedEMPhysics.cc.

References theEMShowerModel, and theHadShowerModel.

36  {
37  delete theEMShowerModel;
38  delete theHadShowerModel;
39 }
GFlashEMShowerModel * theHadShowerModel
GFlashEMShowerModel * theEMShowerModel

Member Function Documentation

void ParametrisedEMPhysics::ConstructParticle ( )
virtual

Definition at line 41 of file ParametrisedEMPhysics.cc.

42 {
43  G4LeptonConstructor pLeptonConstructor;
44  pLeptonConstructor.ConstructParticle();
45 
46  G4MesonConstructor pMesonConstructor;
47  pMesonConstructor.ConstructParticle();
48 
49  G4BaryonConstructor pBaryonConstructor;
50  pBaryonConstructor.ConstructParticle();
51 
52  G4ShortLivedConstructor pShortLivedConstructor;
53  pShortLivedConstructor.ConstructParticle();
54 
55  G4IonConstructor pConstructor;
56  pConstructor.ConstructParticle();
57 }
void ParametrisedEMPhysics::ConstructProcess ( )
virtual

Definition at line 59 of file ParametrisedEMPhysics.cc.

References edm::ParameterSet::getParameter(), i, ElectronLimiter::SetFieldCheckFlag(), ElectronLimiter::SetRangeCheckFlag(), theElectronLimiter, theEMShowerModel, theHadShowerModel, theParSet, and thePositronLimiter.

59  {
60 
61  // GFlash part
62  bool gem = theParSet.getParameter<bool>("GflashEcal");
63  bool ghad = theParSet.getParameter<bool>("GflashHcal");
64 
65  if(gem || ghad) {
66  edm::LogInfo("SimG4CoreApplication")
67  << "ParametrisedEMPhysics: GFlash Construct: "
68  << gem << " " << ghad;
69  G4FastSimulationManagerProcess * theFastSimulationManagerProcess =
70  new G4FastSimulationManagerProcess();
71  theParticleIterator->reset();
72  while ((*theParticleIterator)()) {
73  G4ParticleDefinition * particle = theParticleIterator->value();
74  G4ProcessManager * pmanager = particle->GetProcessManager();
75  G4String pname = particle->GetParticleName();
76  if(pname == "e-" || pname == "e+") {
77  pmanager->AddProcess(theFastSimulationManagerProcess, -1, -1, 1);
78  }
79  }
80 
81  if(gem) {
82  G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion("EcalRegion");
83 
84  if(!aRegion){
85  edm::LogInfo("SimG4CoreApplication")
86  << "ParametrisedEMPhysics::ConstructProcess: "
87  << "EcalRegion is not defined, GFlash will not be enabled for ECAL!";
88 
89  } else {
90 
91  //Electromagnetic Shower Model for ECAL
93  new GFlashEMShowerModel("GflashEMShowerModel",aRegion,theParSet);
94  //std::cout << "GFlash is defined for EcalRegion" << std::endl;
95  }
96  }
97  if(ghad) {
98  G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion("HcalRegion");
99  if(!aRegion) {
100  edm::LogInfo("SimG4CoreApplication")
101  << "ParametrisedEMPhysics::ConstructProcess: "
102  << "HcalRegion is not defined, GFlash will not be enabled for HCAL!";
103 
104  } else {
105 
106  //Electromagnetic Shower Model for HCAL
108  new GFlashEMShowerModel("GflashHadShowerModel",aRegion,theParSet);
109  //std::cout << "GFlash is defined for HcalRegion" << std::endl;
110  }
111  }
112  }
113  // Russian Roulette part
114  G4EmProcessOptions opt;
115  const G4int NREG = 6;
116  const G4String rname[NREG] = {"EcalRegion", "HcalRegion", "MuonIron",
117  "PreshowerRegion","CastorRegion",
118  "DefaultRegionForTheWorld"};
119  G4double rrfact[NREG] = { 1.0 };
120 
121  // Russian roulette for gamma
122  G4double energyLim = theParSet.getParameter<double>("RusRoGammaEnergyLimit")*MeV;
123  if(energyLim > 0.0) {
124  rrfact[0] = theParSet.getParameter<double>("RusRoEcalGamma");
125  rrfact[1] = theParSet.getParameter<double>("RusRoHcalGamma");
126  rrfact[2] = theParSet.getParameter<double>("RusRoMuonIronGamma");
127  rrfact[3] = theParSet.getParameter<double>("RusRoPreShowerGamma");
128  rrfact[4] = theParSet.getParameter<double>("RusRoCastorGamma");
129  rrfact[5] = theParSet.getParameter<double>("RusRoWorldGamma");
130  for(int i=0; i<NREG; ++i) {
131  if(rrfact[i] < 1.0) {
132  opt.ActivateSecondaryBiasing("eBrem",rname[i],rrfact[i],energyLim);
133  edm::LogInfo("SimG4CoreApplication")
134  << "ParametrisedEMPhysics: Russian Roulette"
135  << " for gamma Prob= " << rrfact[i]
136  << " Elimit(MeV)= " << energyLim/CLHEP::MeV
137  << " inside " << rname[i];
138  }
139  }
140  }
141  // Russian roulette for e-
142  energyLim = theParSet.getParameter<double>("RusRoElectronEnergyLimit")*MeV;
143  if(energyLim > 0.0) {
144  rrfact[0] = theParSet.getParameter<double>("RusRoEcalElectron");
145  rrfact[1] = theParSet.getParameter<double>("RusRoHcalElectron");
146  rrfact[2] = theParSet.getParameter<double>("RusRoMuonIronElectron");
147  rrfact[3] = theParSet.getParameter<double>("RusRoPreShowerElectron");
148  rrfact[4] = theParSet.getParameter<double>("RusRoCastorElectron");
149  rrfact[5] = theParSet.getParameter<double>("RusRoWorldElectron");
150  for(int i=0; i<NREG; ++i) {
151  if(rrfact[i] < 1.0) {
152  opt.ActivateSecondaryBiasing("eIoni",rname[i],rrfact[i],energyLim);
153  opt.ActivateSecondaryBiasing("hIoni",rname[i],rrfact[i],energyLim);
154  //opt.ActivateSecondaryBiasing("muIoni",rname[i],rrfact[i],energyLim);
155  //opt.ActivateSecondaryBiasing("ionIoni",rname[i],rrfact[i],energyLim);
156  //opt.ActivateSecondaryBiasingForGamma("phot",rname[i],rrfact[i],energyLim);
157  //opt.ActivateSecondaryBiasingForGamma("compt",rname[i],rrfact[i],energyLim);
158  //opt.ActivateSecondaryBiasingForGamma("conv",rname[i],rrfact[i],energyLim);
159  edm::LogInfo("SimG4CoreApplication")
160  << "ParametrisedEMPhysics: Russian Roulette"
161  << " for e- Prob= " << rrfact[i]
162  << " Elimit(MeV)= " << energyLim/CLHEP::MeV
163  << " inside " << rname[i];
164  }
165  }
166  }
167 
168  // Step limiters for e+-
169  bool eLimiter = theParSet.getParameter<bool>("ElectronStepLimit");
170  bool rLimiter = theParSet.getParameter<bool>("ElectronRangeTest");
171  bool pLimiter = theParSet.getParameter<bool>("PositronStepLimit");
172 
173  if(eLimiter || rLimiter || pLimiter) {
174  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
175 
176  if(eLimiter || rLimiter) {
180  ph->RegisterProcess(theElectronLimiter, G4Electron::Electron());
181  }
182 
183  if(pLimiter){
186  ph->RegisterProcess(theElectronLimiter, G4Positron::Positron());
187  }
188  }
189 }
ElectronLimiter * theElectronLimiter
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
void SetRangeCheckFlag(G4bool)
edm::ParameterSet theParSet
ElectronLimiter * thePositronLimiter
void SetFieldCheckFlag(G4bool)
GFlashEMShowerModel * theHadShowerModel
GFlashEMShowerModel * theEMShowerModel

Member Data Documentation

ElectronLimiter* ParametrisedEMPhysics::theElectronLimiter
private

Definition at line 34 of file ParametrisedEMPhysics.h.

Referenced by ConstructProcess().

GFlashEMShowerModel* ParametrisedEMPhysics::theEMShowerModel
private
GFlashEMShowerModel* ParametrisedEMPhysics::theHadShowerModel
private
edm::ParameterSet ParametrisedEMPhysics::theParSet
private

Definition at line 29 of file ParametrisedEMPhysics.h.

Referenced by ConstructProcess().

ElectronLimiter* ParametrisedEMPhysics::thePositronLimiter
private

Definition at line 35 of file ParametrisedEMPhysics.h.

Referenced by ConstructProcess().