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 31 of file ParametrisedEMPhysics.cc.

References theEMShowerModel, and theHadShowerModel.

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

Definition at line 38 of file ParametrisedEMPhysics.cc.

References theEMShowerModel, and theHadShowerModel.

38  {
39  delete theEMShowerModel;
40  delete theHadShowerModel;
41 }
GFlashEMShowerModel * theHadShowerModel
GFlashEMShowerModel * theEMShowerModel

Member Function Documentation

void ParametrisedEMPhysics::ConstructParticle ( )
virtual

Definition at line 43 of file ParametrisedEMPhysics.cc.

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

Definition at line 61 of file ParametrisedEMPhysics.cc.

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

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