CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes | Static Private Attributes
ParametrisedEMPhysics Class Reference

#include <ParametrisedEMPhysics.h>

Inheritance diagram for ParametrisedEMPhysics:

Classes

struct  TLSmod
 

Public Member Functions

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

Private Attributes

edm::ParameterSet theParSet
 

Static Private Attributes

static G4ThreadLocal TLSmodm_tpmod = 0
 

Detailed Description

Definition at line 13 of file ParametrisedEMPhysics.h.

Constructor & Destructor Documentation

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

Definition at line 54 of file ParametrisedEMPhysics.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), GeV, mps_fire::i, MeV, nt, and theParSet.

56  : G4VPhysicsConstructor(name), theParSet(p)
57 {
58  // bremsstrahlung threshold and EM verbosity
59  G4EmParameters* param = G4EmParameters::Instance();
60  G4int verb = theParSet.getUntrackedParameter<int>("Verbosity",0);
61  param->SetVerbose(verb);
62 
63  G4double bremth = theParSet.getParameter<double>("G4BremsstrahlungThreshold")*GeV;
64  param->SetBremsstrahlungTh(bremth);
65 
66  bool fluo = theParSet.getParameter<bool>("FlagFluo");
67  param->SetFluo(fluo);
68 
69  bool modifyT = theParSet.getParameter<bool>("ModifyTransportation");
70  double th1 = theParSet.getUntrackedParameter<double>("ThresholdWarningEnergy")*MeV;
71  double th2 = theParSet.getUntrackedParameter<double>("ThresholdImportantEnergy")*MeV;
72  int nt = theParSet.getUntrackedParameter<int>("ThresholdTrials");
73 
74  edm::LogVerbatim("SimG4CoreApplication")
75  << "ParametrisedEMPhysics::ConstructProcess: bremsstrahlung threshold Eth= "
76  << bremth/GeV << " GeV"
77  << "\n verbosity= " << verb
78  << " fluoFlag: " << fluo << " modifyTransport: " << modifyT
79  << " Ntrials= " << nt
80  << "\n ThWarning(MeV)= " << th1
81  << " ThException(MeV)= " << th2;
82 
83  // Russian roulette and tracking cut for e+-
84  double energyLim =
85  theParSet.getParameter<double>("RusRoElectronEnergyLimit")*MeV;
86  if(energyLim > 0.0) {
87  const G4int NREG = 6;
88  const G4String rname[NREG] = {"EcalRegion", "HcalRegion", "MuonIron",
89  "PreshowerRegion","CastorRegion",
90  "DefaultRegionForTheWorld"};
91  G4double rrfact[NREG] = { 1.0 };
92 
93  rrfact[0] = theParSet.getParameter<double>("RusRoEcalElectron");
94  rrfact[1] = theParSet.getParameter<double>("RusRoHcalElectron");
95  rrfact[2] = theParSet.getParameter<double>("RusRoMuonIronElectron");
96  rrfact[3] = theParSet.getParameter<double>("RusRoPreShowerElectron");
97  rrfact[4] = theParSet.getParameter<double>("RusRoCastorElectron");
98  rrfact[5] = theParSet.getParameter<double>("RusRoWorldElectron");
99  for(int i=0; i<NREG; ++i) {
100  if(rrfact[i] < 1.0) {
101  param->ActivateSecondaryBiasing("eIoni",rname[i],rrfact[i],energyLim);
102  param->ActivateSecondaryBiasing("hIoni",rname[i],rrfact[i],energyLim);
103  edm::LogVerbatim("SimG4CoreApplication")
104  << "ParametrisedEMPhysics: Russian Roulette"
105  << " for e- Prob= " << rrfact[i]
106  << " Elimit(MeV)= " << energyLim/CLHEP::MeV
107  << " inside " << rname[i];
108  }
109  }
110  }
111 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const double GeV
Definition: MathUtil.h:16
edm::ParameterSet theParSet
const double MeV
int nt
Definition: AMPTWrapper.h:32
ParametrisedEMPhysics::~ParametrisedEMPhysics ( )
override

Definition at line 113 of file ParametrisedEMPhysics.cc.

References m_tpmod.

113  {
114  if(m_tpmod) {
115  delete m_tpmod;
116  m_tpmod = nullptr;
117  }
118 }
static G4ThreadLocal TLSmod * m_tpmod

Member Function Documentation

void ParametrisedEMPhysics::ConstructParticle ( )
override

Definition at line 120 of file ParametrisedEMPhysics.cc.

121 {
122  G4LeptonConstructor pLeptonConstructor;
123  pLeptonConstructor.ConstructParticle();
124 
125  G4MesonConstructor pMesonConstructor;
126  pMesonConstructor.ConstructParticle();
127 
128  G4BaryonConstructor pBaryonConstructor;
129  pBaryonConstructor.ConstructParticle();
130 
131  G4ShortLivedConstructor pShortLivedConstructor;
132  pShortLivedConstructor.ConstructParticle();
133 
134  G4IonConstructor pConstructor;
135  pConstructor.ConstructParticle();
136 }
void ParametrisedEMPhysics::ConstructProcess ( )
override

Definition at line 138 of file ParametrisedEMPhysics.cc.

References nanoDQM_cfi::Electron, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), m_tpmod, MeV, nt, ParametrisedEMPhysics::TLSmod::theEcalEMShowerModel, ParametrisedEMPhysics::TLSmod::theEcalHadShowerModel, ParametrisedEMPhysics::TLSmod::theElectronLimiter, ParametrisedEMPhysics::TLSmod::theFastSimulationManagerProcess, ParametrisedEMPhysics::TLSmod::theHcalEMShowerModel, ParametrisedEMPhysics::TLSmod::theHcalHadShowerModel, theParSet, and ParametrisedEMPhysics::TLSmod::thePositronLimiter.

138  {
139 
140  // GFlash part
141  bool gem = theParSet.getParameter<bool>("GflashEcal");
142  bool ghad = theParSet.getParameter<bool>("GflashHcal");
143  bool gemHad = theParSet.getParameter<bool>("GflashEcalHad");
144  bool ghadHad = theParSet.getParameter<bool>("GflashHcalHad");
145 
146  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
147  if(gem || ghad || gemHad || ghadHad) {
148  if(!m_tpmod) { m_tpmod = new TLSmod; }
149  edm::LogVerbatim("SimG4CoreApplication")
150  << "ParametrisedEMPhysics: GFlash Construct for e+-: "
151  << gem << " " << ghad << " for hadrons: " << gemHad << " " << ghadHad;
152 
153  m_tpmod->theFastSimulationManagerProcess.reset(new G4FastSimulationManagerProcess());
154 
155  if(gem || ghad) {
156  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4Electron::Electron());
157  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4Positron::Positron());
158  }
159  if(gemHad || ghadHad) {
160  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4Proton::Proton());
161  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4AntiProton::AntiProton());
162  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4PionPlus::PionPlus());
163  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4PionMinus::PionMinus());
164  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4KaonPlus::KaonPlus());
165  ph->RegisterProcess(m_tpmod->theFastSimulationManagerProcess.get(), G4KaonMinus::KaonMinus());
166  }
167 
168  if(gem || gemHad) {
169  G4Region* aRegion =
170  G4RegionStore::GetInstance()->GetRegion("EcalRegion");
171 
172  if(!aRegion){
173  edm::LogVerbatim("SimG4CoreApplication")
174  << "ParametrisedEMPhysics::ConstructProcess: "
175  << "EcalRegion is not defined, GFlash will not be enabled for ECAL!";
176 
177  } else {
178  if(gem) {
179 
180  //Electromagnetic Shower Model for ECAL
181  m_tpmod->theEcalEMShowerModel.reset(new GFlashEMShowerModel("GflashEcalEMShowerModel",
182  aRegion,theParSet));
183  }
184  if(gemHad) {
185 
186  //Electromagnetic Shower Model for ECAL
187  m_tpmod->theEcalHadShowerModel.reset(new GFlashHadronShowerModel("GflashEcalHadShowerModel",
188  aRegion,theParSet));
189  }
190  }
191  }
192  if(ghad || ghadHad) {
193  G4Region* aRegion =
194  G4RegionStore::GetInstance()->GetRegion("HcalRegion");
195  if(!aRegion) {
196  edm::LogVerbatim("SimG4CoreApplication")
197  << "ParametrisedEMPhysics::ConstructProcess: "
198  << "HcalRegion is not defined, GFlash will not be enabled for HCAL!";
199 
200  } else {
201  if(ghad) {
202 
203  //Electromagnetic Shower Model for HCAL
204  m_tpmod->theHcalEMShowerModel.reset(new GFlashEMShowerModel("GflashHcalEMShowerModel",
205  aRegion,theParSet));
206  }
207  if(ghadHad) {
208 
209  //Electromagnetic Shower Model for ECAL
210  m_tpmod->theHcalHadShowerModel.reset(new GFlashHadronShowerModel("GflashHcalHadShowerModel",
211  aRegion,theParSet));
212  }
213  }
214  }
215  }
216 
217  // Step limiters for e+-
218  bool eLimiter = theParSet.getParameter<bool>("ElectronStepLimit");
219  bool rLimiter = theParSet.getParameter<bool>("ElectronRangeTest");
220  bool pLimiter = theParSet.getParameter<bool>("PositronStepLimit");
221 
222  if(eLimiter || rLimiter) {
223  if(!m_tpmod) { m_tpmod = new TLSmod; }
225  m_tpmod->theElectronLimiter.get()->SetRangeCheckFlag(rLimiter);
226  m_tpmod->theElectronLimiter.get()->SetFieldCheckFlag(eLimiter);
227  ph->RegisterProcess(m_tpmod->theElectronLimiter.get(), G4Electron::Electron());
228  }
229 
230  if(pLimiter){
231  if(!m_tpmod) { m_tpmod = new TLSmod; }
233  m_tpmod->thePositronLimiter.get()->SetFieldCheckFlag(pLimiter);
234  ph->RegisterProcess(m_tpmod->theElectronLimiter.get(), G4Positron::Positron());
235  }
236  // enable fluorescence
237  bool fluo = theParSet.getParameter<bool>("FlagFluo");
238  if(fluo && !G4LossTableManager::Instance()->AtomDeexcitation()) {
239  G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
240  G4LossTableManager::Instance()->SetAtomDeexcitation(de);
241  }
242  // change parameters of transportation
243  bool modifyT = theParSet.getParameter<bool>("ModifyTransportation");
244  if(modifyT) {
245  G4ProcessManager* man = G4Electron::Electron()->GetProcessManager();
246  G4Transportation* trans = (G4Transportation*)((*(man->GetProcessList()))[0]);
247  if(trans) {
248  double th1 = theParSet.getUntrackedParameter<double>("ThresholdWarningEnergy")*MeV;
249  double th2 = theParSet.getUntrackedParameter<double>("ThresholdImportantEnergy")*MeV;
250  int nt = theParSet.getUntrackedParameter<int>("ThresholdTrials");
251  trans->SetThresholdWarningEnergy(th1);
252  trans->SetThresholdImportantEnergy(th2);
253  trans->SetThresholdTrials(nt);
254  }
255  }
256 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet theParSet
static G4ThreadLocal TLSmod * m_tpmod
std::unique_ptr< ElectronLimiter > thePositronLimiter
A class for AMC data.
Definition: AMC13Event.h:6
const double MeV
std::unique_ptr< G4FastSimulationManagerProcess > theFastSimulationManagerProcess
std::unique_ptr< GFlashEMShowerModel > theEcalEMShowerModel
int nt
Definition: AMPTWrapper.h:32
std::unique_ptr< GFlashEMShowerModel > theHcalEMShowerModel
std::unique_ptr< GFlashHadronShowerModel > theHcalHadShowerModel
std::unique_ptr< GFlashHadronShowerModel > theEcalHadShowerModel
std::unique_ptr< ElectronLimiter > theElectronLimiter

Member Data Documentation

G4ThreadLocal ParametrisedEMPhysics::TLSmod * ParametrisedEMPhysics::m_tpmod = 0
staticprivate

Definition at line 27 of file ParametrisedEMPhysics.h.

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

edm::ParameterSet ParametrisedEMPhysics::theParSet
private

Definition at line 25 of file ParametrisedEMPhysics.h.

Referenced by ConstructProcess(), and ParametrisedEMPhysics().