CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CMSEmStandardPhysics Class Reference

#include <CMSEmStandardPhysics.h>

Inheritance diagram for CMSEmStandardPhysics:

Public Member Functions

 CMSEmStandardPhysics (G4int ver, const edm::ParameterSet &p)
 
void ConstructParticle () override
 
void ConstructProcess () override
 
 ~CMSEmStandardPhysics () override=default
 

Private Attributes

bool fG4HepEmActive
 
G4double fGeomFactor
 
G4double fLambdaLimit
 
G4double fRangeFactor
 
G4double fSafetyFactor
 
G4MscStepLimitType fStepLimitType
 

Detailed Description

Definition at line 17 of file CMSEmStandardPhysics.h.

Constructor & Destructor Documentation

◆ CMSEmStandardPhysics()

CMSEmStandardPhysics::CMSEmStandardPhysics ( G4int  ver,
const edm::ParameterSet p 
)

Definition at line 52 of file CMSEmStandardPhysics.cc.

References fG4HepEmActive, fGeomFactor, fLambdaLimit, fRangeFactor, fSafetyFactor, fStepLimitType, AlCaHLTBitMon_ParallelJobs::p, and AlCaHLTBitMon_QueryRunRegistry::string.

53  : G4VPhysicsConstructor("CMSEmStandard_emm") {
54  SetVerboseLevel(ver);
55  // EM parameters specific for this EM physics configuration
56  G4EmParameters* param = G4EmParameters::Instance();
57  param->SetDefaults();
58  param->SetVerbose(ver);
59  param->SetApplyCuts(true);
60  param->SetStepFunction(0.8, 1 * CLHEP::mm);
61  param->SetMscRangeFactor(0.2);
62  param->SetMscStepLimitType(fMinimal);
63  param->SetFluo(false);
64  SetPhysicsType(bElectromagnetic);
65  fRangeFactor = p.getParameter<double>("G4MscRangeFactor");
66  fGeomFactor = p.getParameter<double>("G4MscGeomFactor");
67  fSafetyFactor = p.getParameter<double>("G4MscSafetyFactor");
68  fLambdaLimit = p.getParameter<double>("G4MscLambdaLimit") * CLHEP::mm;
69  std::string msc = p.getParameter<std::string>("G4MscStepLimit");
70  fStepLimitType = fUseSafety;
71  if (msc == "UseSafetyPlus") {
72  fStepLimitType = fUseSafetyPlus;
73  }
74  if (msc == "Minimal") {
75  fStepLimitType = fMinimal;
76  }
77  double tcut = p.getParameter<double>("G4TrackingCut") * CLHEP::MeV;
78  param->SetLowestElectronEnergy(tcut);
79  param->SetLowestMuHadEnergy(tcut);
80  fG4HepEmActive = p.getParameter<bool>("G4HepEmActive");
81 }
G4MscStepLimitType fStepLimitType

◆ ~CMSEmStandardPhysics()

CMSEmStandardPhysics::~CMSEmStandardPhysics ( )
overridedefault

Member Function Documentation

◆ ConstructParticle()

void CMSEmStandardPhysics::ConstructParticle ( )
override

Definition at line 83 of file CMSEmStandardPhysics.cc.

83  {
84  // minimal set of particles for EM physics
85  G4EmBuilder::ConstructMinimalEmSet();
86 }

◆ ConstructProcess()

void CMSEmStandardPhysics::ConstructProcess ( )
override

Definition at line 88 of file CMSEmStandardPhysics.cc.

References nanoDQM_cfi::Electron, fG4HepEmActive, fGeomFactor, fLambdaLimit, fRangeFactor, fSafetyFactor, fStepLimitType, g4SimHits_cfi::G4GammaGeneralProcess, MaterialEffects_cfi::MultipleScattering, contentValuesCheck::ss, and HLT_2022v15_cff::verboseLevel.

88  {
89  if (verboseLevel > 0) {
90  edm::LogVerbatim("PhysicsList") << "### " << GetPhysicsName() << " Construct EM Processes";
91  }
92 
93  // This EM builder takes default models of Geant4 10 EMV.
94  // Multiple scattering by WentzelVI for all particles except:
95  // a) e+e- below 100 MeV for which the Urban model is used
96  // b) ions for which Urban model is used
97  G4EmBuilder::PrepareEMPhysics();
98 
99  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
100  // processes used by several particles
101  G4hMultipleScattering* hmsc = new G4hMultipleScattering("ionmsc");
102  G4NuclearStopping* pnuc(nullptr);
103 
104  // high energy limit for e+- scattering models
105  auto param = G4EmParameters::Instance();
106  G4double highEnergyLimit = param->MscEnergyLimit();
107 
108  const G4Region* aRegion = G4RegionStore::GetInstance()->GetRegion("HcalRegion", false);
109  const G4Region* bRegion = G4RegionStore::GetInstance()->GetRegion("HGCalRegion", false);
110 
111  // Add gamma EM Processes
112  G4ParticleDefinition* particle = G4Gamma::Gamma();
113 
114  G4PhotoElectricEffect* pee = new G4PhotoElectricEffect();
115 
116  if (param->GeneralProcessActive()) {
118  sp->AddEmProcess(pee);
119  sp->AddEmProcess(new G4ComptonScattering());
120  sp->AddEmProcess(new G4GammaConversion());
121  G4LossTableManager::Instance()->SetGammaGeneralProcess(sp);
122  ph->RegisterProcess(sp, particle);
123 
124  } else {
125  ph->RegisterProcess(pee, particle);
126  ph->RegisterProcess(new G4ComptonScattering(), particle);
127  ph->RegisterProcess(new G4GammaConversion(), particle);
128  }
129 
130  // e-
131  particle = G4Electron::Electron();
132 
133  G4eIonisation* eioni = new G4eIonisation();
134 
135  G4UrbanMscModel* msc1 = new G4UrbanMscModel();
136  G4WentzelVIModel* msc2 = new G4WentzelVIModel();
137  msc1->SetHighEnergyLimit(highEnergyLimit);
138  msc2->SetLowEnergyLimit(highEnergyLimit);
139 
140  // e-/e+ msc for HCAL and HGCAL using the Urban model
141  G4UrbanMscModel* msc3 = nullptr;
142  if (nullptr != aRegion || nullptr != bRegion) {
143  msc3 = new G4UrbanMscModel();
144  msc3->SetHighEnergyLimit(highEnergyLimit);
145  msc3->SetRangeFactor(fRangeFactor);
146  msc3->SetGeomFactor(fGeomFactor);
147  msc3->SetSafetyFactor(fSafetyFactor);
148  msc3->SetLambdaLimit(fLambdaLimit);
149  msc3->SetStepLimitType(fStepLimitType);
150  msc3->SetLocked(true);
151  }
152 
153 #if G4VERSION_NUMBER >= 1110
154  G4TransportationWithMscType transportationWithMsc = param->TransportationWithMsc();
155  if (transportationWithMsc != G4TransportationWithMscType::fDisabled) {
156  // Remove default G4Transportation and replace with G4TransportationWithMsc.
157  G4ProcessManager* procManager = particle->GetProcessManager();
158  G4VProcess* removed = procManager->RemoveProcess(0);
159  if (removed->GetProcessName() != "Transportation") {
160  G4Exception("CMSEmStandardPhysics::ConstructProcess",
161  "em0050",
162  FatalException,
163  "replaced process is not G4Transportation!");
164  }
165  G4TransportationWithMsc* transportWithMsc =
167  if (transportationWithMsc == G4TransportationWithMscType::fMultipleSteps) {
168  transportWithMsc->SetMultipleSteps(true);
169  }
170  transportWithMsc->AddMscModel(msc1);
171  transportWithMsc->AddMscModel(msc2);
172  if (nullptr != aRegion) {
173  transportWithMsc->AddMscModel(msc3, -1, aRegion);
174  }
175  if (nullptr != bRegion) {
176  transportWithMsc->AddMscModel(msc3, -1, bRegion);
177  }
178  procManager->AddProcess(transportWithMsc, -1, 0, 0);
179  } else
180 #endif
181  {
182  // Multiple scattering is registered as a separate process
183  G4eMultipleScattering* msc = new G4eMultipleScattering;
184  msc->SetEmModel(msc1);
185  msc->SetEmModel(msc2);
186  if (nullptr != aRegion) {
187  msc->AddEmModel(-1, msc3, aRegion);
188  }
189  if (nullptr != bRegion) {
190  msc->AddEmModel(-1, msc3, bRegion);
191  }
192  ph->RegisterProcess(msc, particle);
193  }
194 
195  // single scattering
196  G4eCoulombScatteringModel* ssm = new G4eCoulombScatteringModel();
197  G4CoulombScattering* ss = new G4CoulombScattering();
198  ss->SetEmModel(ssm);
199  ss->SetMinKinEnergy(highEnergyLimit);
200  ssm->SetLowEnergyLimit(highEnergyLimit);
201  ssm->SetActivationLowEnergyLimit(highEnergyLimit);
202 
203  ph->RegisterProcess(eioni, particle);
204  ph->RegisterProcess(new G4eBremsstrahlung(), particle);
205  ph->RegisterProcess(ss, particle);
206 
207  // e+
208  particle = G4Positron::Positron();
209  eioni = new G4eIonisation();
210 
211  msc1 = new G4UrbanMscModel();
212  msc2 = new G4WentzelVIModel();
213  msc1->SetHighEnergyLimit(highEnergyLimit);
214  msc2->SetLowEnergyLimit(highEnergyLimit);
215 
216  // e-/e+ msc for HCAL and HGCAL using the Urban model
217  if (nullptr != aRegion || nullptr != bRegion) {
218  msc3 = new G4UrbanMscModel();
219  msc3->SetHighEnergyLimit(highEnergyLimit);
220  msc3->SetRangeFactor(fRangeFactor);
221  msc3->SetGeomFactor(fGeomFactor);
222  msc3->SetSafetyFactor(fSafetyFactor);
223  msc3->SetLambdaLimit(fLambdaLimit);
224  msc3->SetStepLimitType(fStepLimitType);
225  msc3->SetLocked(true);
226  }
227 
228 #if G4VERSION_NUMBER >= 1110
229  if (transportationWithMsc != G4TransportationWithMscType::fDisabled) {
230  G4ProcessManager* procManager = particle->GetProcessManager();
231  // Remove default G4Transportation and replace with G4TransportationWithMsc.
232  G4VProcess* removed = procManager->RemoveProcess(0);
233  if (removed->GetProcessName() != "Transportation") {
234  G4Exception("CMSEmStandardPhysics::ConstructProcess",
235  "em0050",
236  FatalException,
237  "replaced process is not G4Transportation!");
238  }
239  G4TransportationWithMsc* transportWithMsc =
241  if (transportationWithMsc == G4TransportationWithMscType::fMultipleSteps) {
242  transportWithMsc->SetMultipleSteps(true);
243  }
244  transportWithMsc->AddMscModel(msc1);
245  transportWithMsc->AddMscModel(msc2);
246  if (nullptr != aRegion) {
247  transportWithMsc->AddMscModel(msc3, -1, aRegion);
248  }
249  if (nullptr != bRegion) {
250  transportWithMsc->AddMscModel(msc3, -1, bRegion);
251  }
252  procManager->AddProcess(transportWithMsc, -1, 0, 0);
253  } else
254 #endif
255  {
256  // Register as a separate process.
257  G4eMultipleScattering* msc = new G4eMultipleScattering;
258  msc->SetEmModel(msc1);
259  msc->SetEmModel(msc2);
260  if (nullptr != aRegion) {
261  msc->AddEmModel(-1, msc3, aRegion);
262  }
263  if (nullptr != bRegion) {
264  msc->AddEmModel(-1, msc3, bRegion);
265  }
266  ph->RegisterProcess(msc, particle);
267  }
268 
269  // single scattering
270  ssm = new G4eCoulombScatteringModel();
271  ss = new G4CoulombScattering();
272  ss->SetEmModel(ssm);
273  ss->SetMinKinEnergy(highEnergyLimit);
274  ssm->SetLowEnergyLimit(highEnergyLimit);
275  ssm->SetActivationLowEnergyLimit(highEnergyLimit);
276 
277  ph->RegisterProcess(eioni, particle);
278  ph->RegisterProcess(new G4eBremsstrahlung(), particle);
279  ph->RegisterProcess(new G4eplusAnnihilation(), particle);
280  ph->RegisterProcess(ss, particle);
281 
282 #if G4VERSION_NUMBER >= 1110
283  if (fG4HepEmActive) {
284  auto* hepEmTM = new CMSHepEmTrackingManager(highEnergyLimit);
285  G4Electron::Electron()->SetTrackingManager(hepEmTM);
286  G4Positron::Positron()->SetTrackingManager(hepEmTM);
287  }
288 #endif
289 
290  // generic ion
291  particle = G4GenericIon::GenericIon();
292  G4ionIonisation* ionIoni = new G4ionIonisation();
293  ph->RegisterProcess(hmsc, particle);
294  ph->RegisterProcess(ionIoni, particle);
295 
296  // muons, hadrons ions
297  G4EmBuilder::ConstructCharged(hmsc, pnuc);
298 }
Log< level::Info, true > LogVerbatim
G4MscStepLimitType fStepLimitType

Member Data Documentation

◆ fG4HepEmActive

bool CMSEmStandardPhysics::fG4HepEmActive
private

Definition at line 31 of file CMSEmStandardPhysics.h.

Referenced by CMSEmStandardPhysics(), and ConstructProcess().

◆ fGeomFactor

G4double CMSEmStandardPhysics::fGeomFactor
private

Definition at line 27 of file CMSEmStandardPhysics.h.

Referenced by CMSEmStandardPhysics(), and ConstructProcess().

◆ fLambdaLimit

G4double CMSEmStandardPhysics::fLambdaLimit
private

Definition at line 29 of file CMSEmStandardPhysics.h.

Referenced by CMSEmStandardPhysics(), and ConstructProcess().

◆ fRangeFactor

G4double CMSEmStandardPhysics::fRangeFactor
private

Definition at line 26 of file CMSEmStandardPhysics.h.

Referenced by CMSEmStandardPhysics(), and ConstructProcess().

◆ fSafetyFactor

G4double CMSEmStandardPhysics::fSafetyFactor
private

Definition at line 28 of file CMSEmStandardPhysics.h.

Referenced by CMSEmStandardPhysics(), and ConstructProcess().

◆ fStepLimitType

G4MscStepLimitType CMSEmStandardPhysics::fStepLimitType
private

Definition at line 30 of file CMSEmStandardPhysics.h.

Referenced by CMSEmStandardPhysics(), and ConstructProcess().