CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StackingAction.cc
Go to the documentation of this file.
6 
8 
9 #include "G4VProcess.hh"
10 #include "G4EmProcessSubType.hh"
11 #include "G4LogicalVolumeStore.hh"
12 #include "G4RegionStore.hh"
13 #include "Randomize.hh"
14 #include "G4SystemOfUnits.hh"
15 
16 #include<algorithm>
17 
18 //#define DebugLog
19 
21 {
22  trackNeutrino = p.getParameter<bool>("TrackNeutrino");
23  killHeavy = p.getParameter<bool>("KillHeavy");
24  killGamma = p.getParameter<bool>("KillGamma");
25  kmaxGamma = p.getParameter<double>("GammaThreshold")*MeV;
26  kmaxIon = p.getParameter<double>("IonThreshold")*MeV;
27  kmaxProton = p.getParameter<double>("ProtonThreshold")*MeV;
28  kmaxNeutron = p.getParameter<double>("NeutronThreshold")*MeV;
29  killDeltaRay = p.getParameter<bool>("KillDeltaRay");
30  limitEnergyForVacuum = p.getParameter<double>("CriticalEnergyForVacuum")*MeV;
31  maxTrackTime = p.getParameter<double>("MaxTrackTime")*ns;
32  maxTrackTimes = p.getParameter<std::vector<double> >("MaxTrackTimes");
33  maxTimeNames = p.getParameter<std::vector<std::string> >("MaxTimeNames");
34  deadRegionNames= p.getParameter<std::vector<std::string> >("DeadRegions");
36  p.getUntrackedParameter<bool>("SaveAllPrimaryDecayProductsAndConversions",
37  true);
39  p.getUntrackedParameter<bool>("SavePrimaryDecayProductsAndConversionsInTracker",
40  false);
42  p.getUntrackedParameter<bool>("SavePrimaryDecayProductsAndConversionsInCalo",
43  false);
45  p.getUntrackedParameter<bool>("SavePrimaryDecayProductsAndConversionsInMuon",
46  false);
48  p.getUntrackedParameter<bool>("SaveFirstLevelSecondary",false);
49  killInCalo = false;
50  killInCaloEfH = false;
51 
52  // Russian Roulette
53  regionEcal = 0;
54  regionHcal = 0;
55  regionMuonIron = 0;
56  regionPreShower= 0;
57  regionCastor = 0;
58  regionWorld = 0;
59 
60  gRusRoEnerLim = p.getParameter<double>("RusRoGammaEnergyLimit")*MeV;
61  nRusRoEnerLim = p.getParameter<double>("RusRoNeutronEnergyLimit")*MeV;
62  pRusRoEnerLim = p.getParameter<double>("RusRoProtonEnergyLimit")*MeV;
63 
64  gRusRoEcal = p.getParameter<double>("RusRoEcalGamma");
65  gRusRoHcal = p.getParameter<double>("RusRoHcalGamma");
66  gRusRoMuonIron = p.getParameter<double>("RusRoMuonIronGamma");
67  gRusRoPreShower = p.getParameter<double>("RusRoPreShowerGamma");
68  gRusRoCastor = p.getParameter<double>("RusRoCastorGamma");
69  gRusRoWorld = p.getParameter<double>("RusRoWorldGamma");
70 
71  nRusRoEcal = p.getParameter<double>("RusRoEcalNeutron");
72  nRusRoHcal = p.getParameter<double>("RusRoHcalNeutron");
73  nRusRoMuonIron = p.getParameter<double>("RusRoMuonIronNeutron");
74  nRusRoPreShower = p.getParameter<double>("RusRoPreShowerNeutron");
75  nRusRoCastor = p.getParameter<double>("RusRoCastorNeutron");
76  nRusRoWorld = p.getParameter<double>("RusRoWorldNeutron");
77 
78  pRusRoEcal = p.getParameter<double>("RusRoEcalProton");
79  pRusRoHcal = p.getParameter<double>("RusRoHcalProton");
80  pRusRoMuonIron = p.getParameter<double>("RusRoMuonIronProton");
81  pRusRoPreShower = p.getParameter<double>("RusRoPreShowerProton");
82  pRusRoCastor = p.getParameter<double>("RusRoCastorProton");
83  pRusRoWorld = p.getParameter<double>("RusRoWorldProton");
84 
85  gRRactive = false;
86  nRRactive = false;
87  pRRactive = false;
88  if(gRusRoEnerLim > 0.0 &&
89  (gRusRoEcal < 1.0 || gRusRoHcal < 1.0 ||
90  gRusRoMuonIron < 1.0 || gRusRoPreShower < 1.0 || gRusRoCastor < 1.0 ||
91  gRusRoWorld < 1.0)) { gRRactive = true; }
92  if(nRusRoEnerLim > 0.0 &&
93  (nRusRoEcal < 1.0 || nRusRoHcal < 1.0 ||
94  nRusRoMuonIron < 1.0 || nRusRoPreShower < 1.0 || nRusRoCastor < 1.0 ||
95  nRusRoWorld < 1.0)) { nRRactive = true; }
96  if(pRusRoEnerLim > 0.0 &&
97  (pRusRoEcal < 1.0 || pRusRoHcal < 1.0 ||
98  pRusRoMuonIron < 1.0 || pRusRoPreShower < 1.0 || pRusRoCastor < 1.0 ||
99  pRusRoWorld < 1.0)) { pRRactive = true; }
100 
101  if ( p.exists("TestKillingOptions") ) {
102  killInCalo = (p.getParameter<edm::ParameterSet>("TestKillingOptions"))
103  .getParameter<bool>("KillInCalo");
104  killInCaloEfH = (p.getParameter<edm::ParameterSet>("TestKillingOptions"))
105  .getParameter<bool>("KillInCaloEfH");
106  edm::LogWarning("SimG4CoreApplication")
107  << " *** Activating special test killing options in StackingAction \n"
108  << " *** Kill secondaries in Calorimetetrs volume = " << killInCalo << "\n"
109  << " *** Kill electromagnetic secondaries from hadrons in Calorimeters volume= "
110  << killInCaloEfH;
111  }
112 
113  initPointer();
114  newTA = new NewTrackAction();
115 
116  edm::LogInfo("SimG4CoreApplication") << "StackingAction initiated with"
117  << " flag for saving decay products in "
118  << " Tracker: " << savePDandCinTracker
119  << " in Calo: " << savePDandCinCalo
120  << " in Muon: " << savePDandCinMuon
121  << " everywhere: " << savePDandCinAll
122  << "\n saveFirstSecondary"
123  << ": " << saveFirstSecondary
124  << " Tracking neutrino flag: "
125  << trackNeutrino
126  << " Kill Delta Ray flag: "
127  << killDeltaRay
128  << " Kill hadrons/ions flag: "
129  << killHeavy;
130 
131 
132  if(killHeavy) {
133  edm::LogInfo("SimG4CoreApplication") << "StackingAction kill protons below "
134  << kmaxProton/MeV <<" MeV, neutrons below "
135  << kmaxNeutron/MeV << " MeV and ions"
136  << " below " << kmaxIon/MeV << " MeV";
137  }
138 
139  edm::LogInfo("SimG4CoreApplication") << "StackingAction kill tracks with "
140  << "time larger than " << maxTrackTime/ns
141  << " ns ";
142  numberTimes = maxTimeNames.size();
143  if(0 < numberTimes) {
144  for (unsigned int i=0; i<numberTimes; ++i) {
145  edm::LogInfo("SimG4CoreApplication") << "StackingAction MaxTrackTime for "
146  << maxTimeNames[i] << " is "
147  << maxTrackTimes[i] << " ns ";
148  maxTrackTimes[i] *= ns;
149  }
150  }
151  if(limitEnergyForVacuum > 0.0) {
152  edm::LogInfo("SimG4CoreApplication")
153  << "StackingAction LowDensity regions - kill if E < "
154  << limitEnergyForVacuum/MeV << " MeV";
155  printRegions(lowdensRegions,"LowDensity");
156  }
157  if(deadRegions.size() > 0.0) {
158  edm::LogInfo("SimG4CoreApplication")
159  << "StackingAction Dead regions - kill all secondaries ";
160  printRegions(deadRegions, "Dead");
161  }
162  if(gRRactive) {
163  edm::LogInfo("SimG4CoreApplication")
164  << "StackingAction: "
165  << "Russian Roulette for gamma Elimit(MeV)= "
166  << gRusRoEnerLim/MeV << "\n"
167  << " ECAL Prob= " << gRusRoEcal << "\n"
168  << " HCAL Prob= " << gRusRoHcal << "\n"
169  << " MuonIron Prob= " << gRusRoMuonIron << "\n"
170  << " PreShower Prob= " << gRusRoPreShower << "\n"
171  << " CASTOR Prob= " << gRusRoCastor << "\n"
172  << " World Prob= " << gRusRoWorld;
173  }
174  if(nRRactive) {
175  edm::LogInfo("SimG4CoreApplication")
176  << "StackingAction: "
177  << "Russian Roulette for neutron Elimit(MeV)= "
178  << nRusRoEnerLim/MeV << "\n"
179  << " ECAL Prob= " << nRusRoEcal << "\n"
180  << " HCAL Prob= " << nRusRoHcal << "\n"
181  << " MuonIron Prob= " << nRusRoMuonIron << "\n"
182  << " PreShower Prob= " << nRusRoPreShower << "\n"
183  << " CASTOR Prob= " << nRusRoCastor << "\n"
184  << " World Prob= " << nRusRoWorld;
185  }
186  if(pRRactive) {
187  edm::LogInfo("SimG4CoreApplication")
188  << "StackingAction: "
189  << "Russian Roulette for proton Elimit(MeV)= "
190  << pRusRoEnerLim/MeV << "\n"
191  << " ECAL Prob= " << pRusRoEcal << "\n"
192  << " HCAL Prob= " << pRusRoHcal << "\n"
193  << " MuonIron Prob= " << pRusRoMuonIron << "\n"
194  << " PreShower Prob= " << pRusRoPreShower << "\n"
195  << " CASTOR Prob= " << pRusRoCastor << "\n"
196  << " World Prob= " << pRusRoWorld;
197  }
198 
199  if(savePDandCinTracker) {
200  edm::LogInfo("SimG4CoreApplication") << "StackingAction Tracker regions: ";
201  printRegions(trackerRegions,"Tracker");
202  }
203  if(savePDandCinCalo) {
204  edm::LogInfo("SimG4CoreApplication") << "StackingAction Calo regions: ";
205  printRegions(caloRegions, "Calo");
206  }
207  if(savePDandCinMuon) {
208  edm::LogInfo("SimG4CoreApplication") << "StackingAction Muon regions: ";
209  printRegions(muonRegions,"Muon");
210  }
211 }
212 
214 {
215  delete newTA;
216 }
217 
218 G4ClassificationOfNewTrack StackingAction::ClassifyNewTrack(const G4Track * aTrack)
219 {
220  // G4 interface part
221  G4ClassificationOfNewTrack classification = fUrgent;
222  if (aTrack->GetCreatorProcess()==0 || aTrack->GetParentID()==0) {
223  /*
224  std::cout << "StackingAction: primary weight= "
225  << aTrack->GetWeight() << " "
226  << aTrack->GetDefinition()->GetParticleName()
227  << " " << aTrack->GetKineticEnergy()
228  << " Id=" << aTrack->GetTrackID()
229  << " trackInfo " << aTrack->GetUserInformation()
230  << std::endl;
231  */
232  newTA->primary(aTrack);
233  /*
234  if (!trackNeutrino) {
235  int pdg = std::abs(aTrack->GetDefinition()->GetPDGEncoding());
236  if (pdg == 12 || pdg == 14 || pdg == 16 || pdg == 18) {
237  classification = fKill;
238  }
239  }
240  */
241  } else if (aTrack->GetTouchable() == 0) {
242  edm::LogError("SimG4CoreApplication")
243  << "StackingAction: no touchable for track " << aTrack->GetTrackID()
244  << " from " << aTrack->GetParentID()
245  << " with PDG code " << aTrack->GetDefinition()->GetParticleName();
246  classification = fKill;
247  } else {
248  int pdg = aTrack->GetDefinition()->GetPDGEncoding();
249  double ke = aTrack->GetKineticEnergy();
250 
251  if (aTrack->GetTrackStatus() == fStopAndKill) { classification = fKill; }
252  if (killHeavy && classification != fKill) {
253  if (((pdg/1000000000 == 1) && (((pdg/10000)%100) > 0) &&
254  (((pdg/10)%100) > 0) && (ke<kmaxIon)) ||
255  ((pdg == 2212) && (ke < kmaxProton)) ||
256  ((pdg == 2112) && (ke < kmaxNeutron))) { classification = fKill; }
257  }
258  if (!trackNeutrino && classification != fKill) {
259  if (pdg == 12 || pdg == 14 || pdg == 16 || pdg == 18)
260  classification = fKill;
261  }
262  if (classification != fKill && isItLongLived(aTrack))
263  { classification = fKill; }
264 
265  if (classification != fKill && killGamma && pdg == 22 && ke < kmaxGamma)
266  {
267  classification = fKill;
268  //std::cout << "### next gamma killed E(MeV)= " << ke
269  // << " " << aTrack->GetCreatorProcess()->GetProcessName()
270  // << std::endl;
271  }
272 
273 
274  if (killDeltaRay && classification != fKill
275  && aTrack->GetCreatorProcess()->GetProcessSubType() == fIonisation) {
276  classification = fKill;
277  }
278 
279  const G4Region* reg = aTrack->GetVolume()->GetLogicalVolume()->GetRegion();
280  if (killInCalo && classification != fKill
281  && isThisRegion(reg, caloRegions)) {
282  classification = fKill;
283  }
284  if (classification != fKill && ke <= limitEnergyForVacuum
285  && isThisRegion(reg, lowdensRegions)) {
286  classification = fKill;
287  }
288  if (classification != fKill && isThisRegion(reg, deadRegions)) {
289  classification = fKill;
290  }
291 
292  // Russian roulette && MC truth
293  if(classification != fKill) {
294  const G4Track * mother = CurrentG4Track::track();
295  int flag = 0;
296  if(savePDandCinAll) {
297  flag = isItPrimaryDecayProductOrConversion(aTrack, *mother);
298  } else {
302  flag = isItPrimaryDecayProductOrConversion(aTrack, *mother);
303  }
304  }
305  if (saveFirstSecondary && 0 == flag) {
306  flag = isItFromPrimary(*mother, flag);
307  }
308 
309  // Russian roulette
310  if(2112 == pdg || 22 == pdg || 2212 == pdg) {
311  double currentWeight = aTrack->GetWeight();
312 
313  if(1.0 >= currentWeight) {
314  double prob = 1.0;
315  double elim = 0.0;
316 
317  // neutron
318  if(nRRactive && pdg == 2112) {
319  elim = nRusRoEnerLim;
320  if(reg == regionEcal) { prob = nRusRoEcal; }
321  else if(reg == regionHcal) { prob = nRusRoHcal; }
322  else if(reg == regionMuonIron) { prob = nRusRoMuonIron; }
323  else if(reg == regionPreShower) { prob = nRusRoPreShower; }
324  else if(reg == regionCastor) { prob = nRusRoCastor; }
325  else if(reg == regionWorld) { prob = nRusRoWorld; }
326 
327  // gamma
328  } else if(gRRactive && pdg == 22) {
329  elim = gRusRoEnerLim;
330  if(reg == regionEcal || reg == regionPreShower) {
331  if(rrApplicable(aTrack, *mother)) {
332  if(reg == regionEcal) { prob = gRusRoEcal; }
333  else { prob = gRusRoPreShower; }
334  }
335  } else {
336  if(reg == regionHcal) { prob = gRusRoHcal; }
337  else if(reg == regionMuonIron) { prob = gRusRoMuonIron; }
338  else if(reg == regionCastor) { prob = gRusRoCastor; }
339  else if(reg == regionWorld) { prob = gRusRoWorld; }
340  }
341 
342  // proton
343  } else if(pRRactive && pdg == 2212) {
344  elim = pRusRoEnerLim;
345  if(reg == regionEcal) { prob = pRusRoEcal; }
346  else if(reg == regionHcal) { prob = pRusRoHcal; }
347  else if(reg == regionMuonIron) { prob = pRusRoMuonIron; }
348  else if(reg == regionPreShower) { prob = pRusRoPreShower; }
349  else if(reg == regionCastor) { prob = pRusRoCastor; }
350  else if(reg == regionWorld) { prob = pRusRoWorld; }
351  }
352  if(prob < 1.0 && aTrack->GetKineticEnergy() < elim) {
353  if(G4UniformRand() < prob) {
354  const_cast<G4Track*>(aTrack)->SetWeight(currentWeight/prob);
355  } else {
356  classification = fKill;
357  }
358  }
359  }
360  }
361 
362  if(classification != fKill && killInCaloEfH) {
363  int pdgMother = mother->GetDefinition()->GetPDGEncoding();
364  if ( (pdg == 22 || std::abs(pdg) == 11) &&
365  (std::abs(pdgMother) < 11 || std::abs(pdgMother) > 17) &&
366  pdgMother != 22 ) {
367  if ( isThisRegion(reg,caloRegions)) {
368  classification = fKill;
369  }
370  }
371  }
372 
373  if (classification != fKill) {
374  newTA->secondary(aTrack, *mother, flag);
375  }
376  }
377  /*
378  double wt2 = aTrack->GetWeight();
379  if(wt2 != 1.0) {
380  G4Region* reg = aTrack->GetVolume()->GetLogicalVolume()->GetRegion();
381  std::cout << "StackingAction: weight= " << wt2 << " "
382  << aTrack->GetDefinition()->GetParticleName()
383  << " " << aTrack->GetKineticEnergy()
384  << " Id=" << aTrack->GetTrackID()
385  << " IdP=" << aTrack->GetParentID();
386  const G4VProcess* pr = aTrack->GetCreatorProcess();
387  if(pr) std::cout << " from " << pr->GetProcessName();
388  if(reg) std::cout << " in " << reg->GetName()
389  << " trackInfo " << aTrack->GetUserInformation();
390  std::cout << std::endl;
391  }
392  */
393  }
394 #ifdef DebugLog
395  LogDebug("SimG4CoreApplication") << "StackingAction:Classify Track "
396  << aTrack->GetTrackID() << " Parent "
397  << aTrack->GetParentID() << " Type "
398  << aTrack->GetDefinition()->GetParticleName()
399  << " K.E. " << aTrack->GetKineticEnergy()/MeV
400  << " MeV from process/subprocess "
401  << aTrack->GetCreatorProcess()->GetProcessType()
402  << "|"
403  <<aTrack->GetCreatorProcess()->GetProcessSubType()
404  << " as " << classification << " Flag " << flag;
405 #endif
406 
407  return classification;
408 }
409 
411 
413 
415 {
416  // Russian roulette
417  const G4RegionStore * rs = G4RegionStore::GetInstance();
418  std::vector<G4Region*>::const_iterator rcite;
419  std::vector<std::string>::const_iterator rd;
420 
421  for (rcite = rs->begin(); rcite != rs->end(); ++rcite) {
422  const G4Region* reg = (*rcite);
423  G4String rname = reg->GetName();
424  if ((gRusRoEcal < 1.0 || nRusRoEcal < 1.0 || pRusRoEcal < 1.0) &&
425  rname == "EcalRegion") {
426  regionEcal = reg;
427  }
428  if ((gRusRoHcal < 1.0 || nRusRoHcal < 1.0 || pRusRoHcal < 1.0) &&
429  rname == "HcalRegion") {
430  regionHcal = reg;
431  }
432  if ((gRusRoMuonIron < 1.0 || nRusRoMuonIron < 1.0 || pRusRoMuonIron < 1.0) &&
433  rname == "MuonIron") {
434  regionMuonIron = reg;
435  }
436  if ((gRusRoPreShower < 1.0 || nRusRoPreShower < 1.0 || pRusRoPreShower < 1.0)
437  && rname == "PreshowerRegion") {
438  regionPreShower = reg;
439  }
440  if ((gRusRoCastor < 1.0 || nRusRoCastor < 1.0 || pRusRoCastor < 1.0) &&
441  rname == "CastorRegion") {
442  regionCastor = reg;
443  }
444  if ((nRusRoWorld < 1.0 || nRusRoWorld < 1.0 || pRusRoWorld < 1.0) &&
445  rname == "DefaultRegionForTheWorld") {
446  regionWorld = reg;
447  }
448 
449  // time limits
450  unsigned int num = maxTimeNames.size();
451  maxTimeRegions.resize(num, 0);
452  if (num > 0) {
453  for (unsigned int i=0; i<num; i++) {
454  if (rname == (G4String)(maxTimeNames[i])) {
455  maxTimeRegions[i] = reg;
456  break;
457  }
458  }
459  }
460  //
461  if(savePDandCinTracker &&
462  (rname == "BeamPipe" || rname == "BeamPipeVacuum"
463  || rname == "TrackerPixelSensRegion"
464  || rname == "TrackerPixelDeadRegion"
465  || rname == "TrackerDeadRegion" || rname == "TrackerSensRegion")) {
466  trackerRegions.push_back(reg);
467  }
468  if(savePDandCinCalo &&
469  (rname == "HcalRegion" || rname == "EcalRegion"
470  || rname == "PreshowerSensRegion" || rname == "PreshowerRegion")) {
471  caloRegions.push_back(reg);
472  }
473  if(savePDandCinMuon &&
474  (rname == "MuonChamber" || rname == "MuonSensitive_RPC"
475  || rname == "MuonIron" || rname == "Muon"
476  || rname == "MuonSensitive_DT-CSC") ) {
477  muonRegions.push_back(reg);
478  }
479  if(rname == "BeamPipeOutside" || rname == "BeamPipeVacuum") {
480  lowdensRegions.push_back(reg);
481  }
482  for (rd = deadRegionNames.begin(); rd != deadRegionNames.end(); ++rd) {
483  if(rname == (G4String)(*rd)) {
484  deadRegions.push_back(reg);
485  }
486  }
487  }
488 }
489 
490 bool StackingAction::isThisRegion(const G4Region* reg,
491  std::vector<const G4Region*>& regions) const
492 {
493  bool flag = false;
494  unsigned int nRegions = regions.size();
495  for(unsigned int i=0; i<nRegions; ++i) {
496  if(reg == regions[i]) {
497  flag = true;
498  break;
499  }
500  }
501  return flag;
502 }
503 
505  const G4Track & mother) const
506 {
507  int flag = 0;
508  TrackInformationExtractor extractor;
509  const TrackInformation & motherInfo(extractor(mother));
510  // Check whether mother is a primary
511  if (motherInfo.isPrimary()) {
512  if (aTrack->GetCreatorProcess()->GetProcessType() == fDecay) {
513  flag = 1;
514  } else if (aTrack->GetCreatorProcess()->GetProcessSubType()==fGammaConversion) {
515  flag = 2;
516  }
517  }
518  return flag;
519 }
520 
521 bool StackingAction::rrApplicable(const G4Track * aTrack,
522  const G4Track & mother) const
523 {
524  bool flag = true;
525  TrackInformationExtractor extractor;
526  const TrackInformation & motherInfo(extractor(mother));
527  // Check whether mother is a primary
528  //if (motherInfo.isPrimary()) {
529  // }
530  int genID = motherInfo.genParticlePID();
531  if(22 == genID || 11 == genID || -11 == genID) { flag = false; }
532 
533  /*
534  //check if the primary was g, e+, e-
535  int genID = motherInfo.genParticlePID();
536  double genp = motherInfo.genParticleP();
537  std::cout << "Track# " << aTrack->GetTrackID() << " "
538  << aTrack->GetDefinition()->GetParticleName()
539  << " E(MeV)= " << aTrack->GetKineticEnergy()/MeV
540  << " mother: " << mother.GetTrackID()
541  << " " << mother.GetDefinition()->GetParticleName()
542  << " E(GeV)= " << mother.GetKineticEnergy()/GeV
543  << " flag: " << flag << " genID= " << genID
544  << " p(GeV)= " << genp/GeV << std::endl;
545  */
546  return flag;
547 }
548 
549 int StackingAction::isItFromPrimary(const G4Track & mother, int flagIn) const
550 {
551  int flag = flagIn;
552  if (flag != 1) {
553  TrackInformationExtractor extractor;
554  const TrackInformation & motherInfo(extractor(mother));
555  if (motherInfo.isPrimary()) { flag = 3; }
556  }
557  return flag;
558 }
559 
560 bool StackingAction::isItLongLived(const G4Track * aTrack) const
561 {
562  bool flag = false;
563  double tofM = maxTrackTime;
564  if (numberTimes > 0) {
565  G4Region* reg =
566  aTrack->GetVolume()->GetLogicalVolume()->GetRegion();
567  for (unsigned int i=0; i<numberTimes; ++i) {
568  if (reg == maxTimeRegions[i]) {
569  tofM = maxTrackTimes[i];
570  break;
571  }
572  }
573  }
574  if (aTrack->GetGlobalTime() > tofM) { flag = true; }
575  return flag;
576 }
577 
578 void StackingAction::printRegions(const std::vector<const G4Region*>& reg,
579  const std::string& word) const
580 {
581  for (unsigned int i=0; i<reg.size(); ++i) {
582  edm::LogInfo("SimG4CoreApplication") << " StackingAction: " << word
583  << "Region " << i
584  << ". " << reg[i]->GetName();
585  }
586 }
#define LogDebug(id)
void primary(const G4Track *aSecondary) const
double nRusRoPreShower
T getParameter(std::string const &) const
NewTrackAction * newTA
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< const G4Region * > lowdensRegions
std::vector< double > maxTrackTimes
bool exists(std::string const &parameterName) const
checks if a parameter exists
double gRusRoPreShower
double nRusRoEnerLim
double pRusRoEnerLim
const G4Region * regionCastor
const G4Region * regionMuonIron
bool rrApplicable(const G4Track *, const G4Track &) const
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) const
virtual ~StackingAction()
std::vector< const G4Region * > deadRegions
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
StackingAction(const edm::ParameterSet &ps)
std::vector< const G4Region * > muonRegions
std::vector< std::string > maxTimeNames
const G4Region * regionEcal
int genParticlePID() const
unsigned int numberTimes
double pRusRoPreShower
void printRegions(const std::vector< const G4Region * > &reg, const std::string &word) const
void secondary(const G4Track *aSecondary, const G4Track &mother, int) const
double nRusRoMuonIron
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isThisRegion(const G4Region *, std::vector< const G4Region * > &) const
bool isPrimary() const
bool savePDandCinTracker
std::vector< std::string > deadRegionNames
double gRusRoEnerLim
const G4Region * regionHcal
std::vector< const G4Region * > maxTimeRegions
const G4Region * regionPreShower
int isItFromPrimary(const G4Track &, int) const
double gRusRoMuonIron
std::vector< const G4Region * > trackerRegions
double pRusRoMuonIron
bool isItLongLived(const G4Track *) const
std::vector< const G4Region * > caloRegions
double limitEnergyForVacuum
static const G4Track * track()
const G4Region * regionWorld