test
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

GFlashEMShowerModeltheEcalEMShowerModel
 
GFlashHadronShowerModeltheEcalHadShowerModel
 
ElectronLimitertheElectronLimiter
 
GFlashEMShowerModeltheHcalEMShowerModel
 
GFlashHadronShowerModeltheHcalHadShowerModel
 
edm::ParameterSet theParSet
 
ElectronLimiterthePositronLimiter
 

Detailed Description

Definition at line 18 of file ParametrisedEMPhysics.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file ParametrisedEMPhysics.cc.

References theEcalEMShowerModel, theEcalHadShowerModel, theHcalEMShowerModel, and theHcalHadShowerModel.

46  : G4VPhysicsConstructor(name), theParSet(p)
47 {
48  theEcalEMShowerModel = nullptr;
49  theEcalHadShowerModel = nullptr;
50  theHcalEMShowerModel = nullptr;
51  theHcalHadShowerModel = nullptr;
52 
53  // will be uncommented for Geant4 10.1
54  // bremsstrahlung threshold and EM verbosity
55  /*
56  G4EmParameters* param = G4EmParameters::Instance();
57  G4int verb = theParSet.getUntrackedParameter<int>("Verbosity",0);
58  param->SetVerbose(verb);
59 
60  G4double bremth = theParSet.getParameter<double>("G4BremsstrahlungThreshold")*GeV;
61  param->SetBremsstrahlungTh(bremth);
62 
63  bool fluo = theParSet.getParameter<bool>("FlagFluo");
64  param->SetFluo(fluo);
65 
66  edm::LogInfo("SimG4CoreApplication")
67  << "ParametrisedEMPhysics::ConstructProcess: bremsstrahlung threshold Eth= "
68  << bremth/GeV << " GeV"
69  << "\n verbosity= " << verb
70  << " fluoFlag: " << fluo;
71  */
72 }
edm::ParameterSet theParSet
GFlashHadronShowerModel * theEcalHadShowerModel
GFlashHadronShowerModel * theHcalHadShowerModel
GFlashEMShowerModel * theHcalEMShowerModel
GFlashEMShowerModel * theEcalEMShowerModel
ParametrisedEMPhysics::~ParametrisedEMPhysics ( )
virtual

Definition at line 74 of file ParametrisedEMPhysics.cc.

References theEcalEMShowerModel, theEcalHadShowerModel, theHcalEMShowerModel, and theHcalHadShowerModel.

74  {
75  delete theEcalEMShowerModel;
76  delete theEcalHadShowerModel;
77  delete theHcalEMShowerModel;
78  delete theHcalHadShowerModel;
79 }
GFlashHadronShowerModel * theEcalHadShowerModel
GFlashHadronShowerModel * theHcalHadShowerModel
GFlashEMShowerModel * theHcalEMShowerModel
GFlashEMShowerModel * theEcalEMShowerModel

Member Function Documentation

void ParametrisedEMPhysics::ConstructParticle ( )
virtual

Definition at line 81 of file ParametrisedEMPhysics.cc.

82 {
83  G4LeptonConstructor pLeptonConstructor;
84  pLeptonConstructor.ConstructParticle();
85 
86  G4MesonConstructor pMesonConstructor;
87  pMesonConstructor.ConstructParticle();
88 
89  G4BaryonConstructor pBaryonConstructor;
90  pBaryonConstructor.ConstructParticle();
91 
92  G4ShortLivedConstructor pShortLivedConstructor;
93  pShortLivedConstructor.ConstructParticle();
94 
95  G4IonConstructor pConstructor;
96  pConstructor.ConstructParticle();
97 }
void ParametrisedEMPhysics::ConstructProcess ( )
virtual

Definition at line 99 of file ParametrisedEMPhysics.cc.

References configurableAnalysis::Electron, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), GeV, i, MeV, ElectronLimiter::SetFieldCheckFlag(), ElectronLimiter::SetRangeCheckFlag(), theEcalEMShowerModel, theEcalHadShowerModel, theElectronLimiter, theHcalEMShowerModel, theHcalHadShowerModel, theParSet, and thePositronLimiter.

99  {
100 
101  // GFlash part
102  bool gem = theParSet.getParameter<bool>("GflashEcal");
103  bool ghad = theParSet.getParameter<bool>("GflashHcal");
104  bool gemHad = theParSet.getParameter<bool>("GflashEcalHad");
105  bool ghadHad = theParSet.getParameter<bool>("GflashHcalHad");
106 
107  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
108  if(gem || ghad || gemHad || ghadHad) {
109  edm::LogInfo("SimG4CoreApplication")
110  << "ParametrisedEMPhysics: GFlash Construct for e+-: "
111  << gem << " " << ghad << " for hadrons: " << gemHad << " " << ghadHad;
112 
113  G4FastSimulationManagerProcess * theFastSimulationManagerProcess =
114  new G4FastSimulationManagerProcess();
115 
116  if(gem || ghad) {
117  ph->RegisterProcess(theFastSimulationManagerProcess, G4Electron::Electron());
118  ph->RegisterProcess(theFastSimulationManagerProcess, G4Positron::Positron());
119  }
120  if(gemHad || ghadHad) {
121  ph->RegisterProcess(theFastSimulationManagerProcess, G4Proton::Proton());
122  ph->RegisterProcess(theFastSimulationManagerProcess, G4AntiProton::AntiProton());
123  ph->RegisterProcess(theFastSimulationManagerProcess, G4PionPlus::PionPlus());
124  ph->RegisterProcess(theFastSimulationManagerProcess, G4PionMinus::PionMinus());
125  ph->RegisterProcess(theFastSimulationManagerProcess, G4KaonPlus::KaonPlus());
126  ph->RegisterProcess(theFastSimulationManagerProcess, G4KaonMinus::KaonMinus());
127  }
128 
129  if(gem || gemHad) {
130  G4Region* aRegion =
131  G4RegionStore::GetInstance()->GetRegion("EcalRegion");
132 
133  if(!aRegion){
134  edm::LogInfo("SimG4CoreApplication")
135  << "ParametrisedEMPhysics::ConstructProcess: "
136  << "EcalRegion is not defined, GFlash will not be enabled for ECAL!";
137 
138  } else {
139  if(gem) {
140 
141  //Electromagnetic Shower Model for ECAL
143  new GFlashEMShowerModel("GflashEcalEMShowerModel",aRegion,theParSet);
144  //std::cout << "GFlash is defined for EcalRegion" << std::endl;
145  }
146  if(gemHad) {
147 
148  //Electromagnetic Shower Model for ECAL
150  new GFlashHadronShowerModel("GflashEcalHadShowerModel",aRegion,theParSet);
151  //std::cout << "GFlash is defined for EcalRegion" << std::endl;
152  }
153  }
154  }
155  if(ghad || ghadHad) {
156  G4Region* aRegion =
157  G4RegionStore::GetInstance()->GetRegion("HcalRegion");
158  if(!aRegion) {
159  edm::LogInfo("SimG4CoreApplication")
160  << "ParametrisedEMPhysics::ConstructProcess: "
161  << "HcalRegion is not defined, GFlash will not be enabled for HCAL!";
162 
163  } else {
164  if(ghad) {
165 
166  //Electromagnetic Shower Model for HCAL
168  new GFlashEMShowerModel("GflashHcalEMShowerModel",aRegion,theParSet);
169  //std::cout << "GFlash is defined for HcalRegion" << std::endl;
170  }
171  if(ghadHad) {
172 
173  //Electromagnetic Shower Model for ECAL
175  new GFlashHadronShowerModel("GflashHcalHadShowerModel",aRegion,theParSet);
176  //std::cout << "GFlash is defined for EcalRegion" << std::endl;
177  }
178  }
179  }
180  }
181  // bremsstrahlung threshold and EM verbosity
182  G4EmProcessOptions opt;
183  G4int verb = theParSet.getUntrackedParameter<int>("Verbosity",0);
184  opt.SetVerbose(verb - 1);
185 
186  G4double bremth = theParSet.getParameter<double>("G4BremsstrahlungThreshold")*GeV;
187  edm::LogInfo("SimG4CoreApplication")
188  << "ParametrisedEMPhysics::ConstructProcess: bremsstrahlung threshold Eth= "
189  << bremth/GeV << " GeV";
190  opt.SetBremsstrahlungTh(bremth);
191 
192  // Russian roulette and tracking cut for e+-
193  const G4int NREG = 6;
194  const G4String rname[NREG] = {"EcalRegion", "HcalRegion", "MuonIron",
195  "PreshowerRegion","CastorRegion",
196  "DefaultRegionForTheWorld"};
197  G4double rrfact[NREG] = { 1.0 };
198 
199  double energyLim =
200  theParSet.getParameter<double>("RusRoElectronEnergyLimit")*MeV;
201  if(energyLim > 0.0) {
202  rrfact[0] = theParSet.getParameter<double>("RusRoEcalElectron");
203  rrfact[1] = theParSet.getParameter<double>("RusRoHcalElectron");
204  rrfact[2] = theParSet.getParameter<double>("RusRoMuonIronElectron");
205  rrfact[3] = theParSet.getParameter<double>("RusRoPreShowerElectron");
206  rrfact[4] = theParSet.getParameter<double>("RusRoCastorElectron");
207  rrfact[5] = theParSet.getParameter<double>("RusRoWorldElectron");
208  for(int i=0; i<NREG; ++i) {
209  if(rrfact[i] < 1.0) {
210  opt.ActivateSecondaryBiasing("eIoni",rname[i],rrfact[i],energyLim);
211  opt.ActivateSecondaryBiasing("hIoni",rname[i],rrfact[i],energyLim);
212  edm::LogInfo("SimG4CoreApplication")
213  << "ParametrisedEMPhysics: Russian Roulette"
214  << " for e- Prob= " << rrfact[i]
215  << " Elimit(MeV)= " << energyLim/CLHEP::MeV
216  << " inside " << rname[i];
217  }
218  }
219  }
220 
221  // Step limiters for e+-
222  bool eLimiter = theParSet.getParameter<bool>("ElectronStepLimit");
223  bool rLimiter = theParSet.getParameter<bool>("ElectronRangeTest");
224  bool pLimiter = theParSet.getParameter<bool>("PositronStepLimit");
225 
226  if(eLimiter || rLimiter) {
230  ph->RegisterProcess(theElectronLimiter, G4Electron::Electron());
231  }
232 
233  if(pLimiter){
236  ph->RegisterProcess(theElectronLimiter, G4Positron::Positron());
237  }
238  // enable fluorescence
239  bool fluo = theParSet.getParameter<bool>("FlagFluo");
240  if(fluo) {
241  G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
242  G4LossTableManager::Instance()->SetAtomDeexcitation(de);
243  de->SetFluo(true);
244  }
245  // enable muon nuclear (valid option for Geant4 10.0pX only)
246  bool munuc = theParSet.getParameter<bool>("FlagMuNucl");
247  //bool munuc = false;
248  if(munuc) {
249  G4MuonNuclearProcess* muNucProcess = new G4MuonNuclearProcess();
250  muNucProcess->RegisterMe(new G4MuonVDNuclearModel());
251  ph->RegisterProcess(muNucProcess, G4MuonPlus::MuonPlus());
252  ph->RegisterProcess(muNucProcess, G4MuonMinus::MuonMinus());
253  }
254 
255 }
ElectronLimiter * theElectronLimiter
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
const double GeV
Definition: MathUtil.h:16
void SetRangeCheckFlag(G4bool)
edm::ParameterSet theParSet
ElectronLimiter * thePositronLimiter
GFlashHadronShowerModel * theEcalHadShowerModel
const double MeV
void SetFieldCheckFlag(G4bool)
GFlashHadronShowerModel * theHcalHadShowerModel
GFlashEMShowerModel * theHcalEMShowerModel
GFlashEMShowerModel * theEcalEMShowerModel

Member Data Documentation

GFlashEMShowerModel* ParametrisedEMPhysics::theEcalEMShowerModel
private
GFlashHadronShowerModel* ParametrisedEMPhysics::theEcalHadShowerModel
private
ElectronLimiter* ParametrisedEMPhysics::theElectronLimiter
private

Definition at line 37 of file ParametrisedEMPhysics.h.

Referenced by ConstructProcess().

GFlashEMShowerModel* ParametrisedEMPhysics::theHcalEMShowerModel
private
GFlashHadronShowerModel* ParametrisedEMPhysics::theHcalHadShowerModel
private
edm::ParameterSet ParametrisedEMPhysics::theParSet
private

Definition at line 30 of file ParametrisedEMPhysics.h.

Referenced by ConstructProcess().

ElectronLimiter* ParametrisedEMPhysics::thePositronLimiter
private

Definition at line 38 of file ParametrisedEMPhysics.h.

Referenced by ConstructProcess().