CMS 3D CMS Logo

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

#include <StackingAction.h>

Inheritance diagram for StackingAction:

Public Member Functions

G4ClassificationOfNewTrack ClassifyNewTrack (const G4Track *aTrack) final
 
void NewStage () override
 
void PrepareNewEvent () override
 
 StackingAction (const TrackingAction *, const edm::ParameterSet &ps, const CMSSteppingVerbose *)
 
 ~StackingAction () override
 

Private Member Functions

void initPointer ()
 
int isItFromPrimary (const G4Track &, int) const
 
bool isItOutOfTimeWindow (const G4Region *, const G4Track *) const
 
int isItPrimaryDecayProductOrConversion (const G4Track *, const G4Track &) const
 
bool isThisRegion (const G4Region *, std::vector< const G4Region * > &) const
 
void printRegions (const std::vector< const G4Region * > &reg, const std::string &word) const
 
bool rrApplicable (const G4Track *, const G4Track &) const
 

Private Attributes

std::vector< const G4Region * > caloRegions
 
std::vector< std::string > deadRegionNames
 
std::vector< const G4Region * > deadRegions
 
TrackInformationExtractor extractor
 
bool gRRactive
 
double gRusRoCastor
 
double gRusRoEcal
 
double gRusRoEnerLim
 
double gRusRoHcal
 
double gRusRoMuonIron
 
double gRusRoPreShower
 
double gRusRoWorld
 
bool killDeltaRay
 
bool killExtra
 
bool killGamma
 
bool killHeavy
 
bool killInCalo
 
bool killInCaloEfH
 
double kmaxGamma
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 
double limitEnergyForVacuum
 
std::vector< const G4Region * > lowdensRegions
 
std::vector< std::string > maxTimeNames
 
std::vector< const G4Region * > maxTimeRegions
 
double maxTrackTime
 
double maxTrackTimeForward
 
std::vector< double > maxTrackTimes
 
double maxZCentralCMS
 
std::vector< const G4Region * > muonRegions
 
NewTrackActionnewTA
 
bool nRRactive
 
double nRusRoCastor
 
double nRusRoEcal
 
double nRusRoEnerLim
 
double nRusRoHcal
 
double nRusRoMuonIron
 
double nRusRoPreShower
 
double nRusRoWorld
 
unsigned int numberTimes
 
const G4Region * regionCastor
 
const G4Region * regionEcal
 
const G4Region * regionHcal
 
const G4Region * regionMuonIron
 
const G4Region * regionPreShower
 
const G4Region * regionWorld
 
bool saveFirstSecondary
 
bool savePDandCinAll
 
bool savePDandCinCalo
 
bool savePDandCinMuon
 
bool savePDandCinTracker
 
const CMSSteppingVerbosesteppingVerbose
 
const TrackingActiontrackAction
 
std::vector< const G4Region * > trackerRegions
 
bool trackNeutrino
 
G4VSolid * worldSolid
 

Detailed Description

Definition at line 19 of file StackingAction.h.

Constructor & Destructor Documentation

◆ StackingAction()

StackingAction::StackingAction ( const TrackingAction trka,
const edm::ParameterSet ps,
const CMSSteppingVerbose sv 
)
explicit

Definition at line 18 of file StackingAction.cc.

19  : trackAction(trka), steppingVerbose(sv) {
20  trackNeutrino = p.getParameter<bool>("TrackNeutrino");
21  killHeavy = p.getParameter<bool>("KillHeavy");
22  killGamma = p.getParameter<bool>("KillGamma");
23  kmaxGamma = p.getParameter<double>("GammaThreshold") * CLHEP::MeV;
24  kmaxIon = p.getParameter<double>("IonThreshold") * CLHEP::MeV;
25  kmaxProton = p.getParameter<double>("ProtonThreshold") * CLHEP::MeV;
26  kmaxNeutron = p.getParameter<double>("NeutronThreshold") * CLHEP::MeV;
27  killDeltaRay = p.getParameter<bool>("KillDeltaRay");
28  limitEnergyForVacuum = p.getParameter<double>("CriticalEnergyForVacuum") * CLHEP::MeV;
29  maxTrackTime = p.getParameter<double>("MaxTrackTime") * ns;
30  maxTrackTimeForward = p.getParameter<double>("MaxTrackTimeForward") * ns;
31  maxZCentralCMS = p.getParameter<double>("MaxZCentralCMS") * CLHEP::m;
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");
35  savePDandCinAll = p.getUntrackedParameter<bool>("SaveAllPrimaryDecayProductsAndConversions", true);
36  savePDandCinTracker = p.getUntrackedParameter<bool>("SavePrimaryDecayProductsAndConversionsInTracker", false);
37  savePDandCinCalo = p.getUntrackedParameter<bool>("SavePrimaryDecayProductsAndConversionsInCalo", false);
38  savePDandCinMuon = p.getUntrackedParameter<bool>("SavePrimaryDecayProductsAndConversionsInMuon", false);
39  saveFirstSecondary = p.getUntrackedParameter<bool>("SaveFirstLevelSecondary", false);
40  killInCalo = false;
41  killInCaloEfH = false;
42 
43  // Russian Roulette
44  regionEcal = nullptr;
45  regionHcal = nullptr;
46  regionMuonIron = nullptr;
47  regionPreShower = nullptr;
48  regionCastor = nullptr;
49  regionWorld = nullptr;
50 
51  gRusRoEnerLim = p.getParameter<double>("RusRoGammaEnergyLimit") * CLHEP::MeV;
52  nRusRoEnerLim = p.getParameter<double>("RusRoNeutronEnergyLimit") * CLHEP::MeV;
53 
54  gRusRoEcal = p.getParameter<double>("RusRoEcalGamma");
55  gRusRoHcal = p.getParameter<double>("RusRoHcalGamma");
56  gRusRoMuonIron = p.getParameter<double>("RusRoMuonIronGamma");
57  gRusRoPreShower = p.getParameter<double>("RusRoPreShowerGamma");
58  gRusRoCastor = p.getParameter<double>("RusRoCastorGamma");
59  gRusRoWorld = p.getParameter<double>("RusRoWorldGamma");
60 
61  nRusRoEcal = p.getParameter<double>("RusRoEcalNeutron");
62  nRusRoHcal = p.getParameter<double>("RusRoHcalNeutron");
63  nRusRoMuonIron = p.getParameter<double>("RusRoMuonIronNeutron");
64  nRusRoPreShower = p.getParameter<double>("RusRoPreShowerNeutron");
65  nRusRoCastor = p.getParameter<double>("RusRoCastorNeutron");
66  nRusRoWorld = p.getParameter<double>("RusRoWorldNeutron");
67 
68  gRRactive = false;
69  nRRactive = false;
70  if (gRusRoEnerLim > 0.0 && (gRusRoEcal < 1.0 || gRusRoHcal < 1.0 || gRusRoMuonIron < 1.0 || gRusRoPreShower < 1.0 ||
71  gRusRoCastor < 1.0 || gRusRoWorld < 1.0)) {
72  gRRactive = true;
73  }
74  if (nRusRoEnerLim > 0.0 && (nRusRoEcal < 1.0 || nRusRoHcal < 1.0 || nRusRoMuonIron < 1.0 || nRusRoPreShower < 1.0 ||
75  nRusRoCastor < 1.0 || nRusRoWorld < 1.0)) {
76  nRRactive = true;
77  }
78 
79  if (p.exists("TestKillingOptions")) {
80  killInCalo = (p.getParameter<edm::ParameterSet>("TestKillingOptions")).getParameter<bool>("KillInCalo");
81  killInCaloEfH = (p.getParameter<edm::ParameterSet>("TestKillingOptions")).getParameter<bool>("KillInCaloEfH");
82  edm::LogWarning("SimG4CoreApplication")
83  << " *** Activating special test killing options in StackingAction \n"
84  << " *** Kill secondaries in Calorimetetrs volume = " << killInCalo << "\n"
85  << " *** Kill electromagnetic secondaries from hadrons in Calorimeters volume= " << killInCaloEfH;
86  }
87 
88  initPointer();
89  newTA = new NewTrackAction();
90 
91  edm::LogVerbatim("SimG4CoreApplication")
92  << "StackingAction initiated with"
93  << " flag for saving decay products in "
94  << " Tracker: " << savePDandCinTracker << " in Calo: " << savePDandCinCalo << " in Muon: " << savePDandCinMuon
95  << " everywhere: " << savePDandCinAll << "\n saveFirstSecondary"
96  << ": " << saveFirstSecondary << " Tracking neutrino flag: " << trackNeutrino
97  << " Kill Delta Ray flag: " << killDeltaRay << " Kill hadrons/ions flag: " << killHeavy
98  << " MaxZCentralCMS = " << maxZCentralCMS / CLHEP::m << " m"
99  << " MaxTrackTimeForward = " << maxTrackTimeForward / CLHEP::ns << " ns";
100 
101  if (killHeavy) {
102  edm::LogVerbatim("SimG4CoreApplication") << "StackingAction kill protons below " << kmaxProton / CLHEP::MeV
103  << " MeV, neutrons below " << kmaxNeutron / CLHEP::MeV << " MeV and ions"
104  << " below " << kmaxIon / CLHEP::MeV << " MeV";
105  }
107 
108  edm::LogVerbatim("SimG4CoreApplication") << "StackingAction kill tracks with "
109  << "time larger than " << maxTrackTime / CLHEP::ns << " ns ";
110  numberTimes = maxTimeNames.size();
111  if (0 < numberTimes) {
112  for (unsigned int i = 0; i < numberTimes; ++i) {
113  edm::LogVerbatim("SimG4CoreApplication")
114  << " MaxTrackTime for " << maxTimeNames[i] << " is " << maxTrackTimes[i] << " ns ";
115  maxTrackTimes[i] *= CLHEP::ns;
116  }
117  }
118  if (limitEnergyForVacuum > 0.0) {
119  edm::LogVerbatim("SimG4CoreApplication")
120  << "StackingAction LowDensity regions - kill if E < " << limitEnergyForVacuum / CLHEP::MeV << " MeV";
121  printRegions(lowdensRegions, "LowDensity");
122  }
123  if (deadRegions.size() > 0.0) {
124  edm::LogVerbatim("SimG4CoreApplication") << "StackingAction Dead regions - kill all secondaries ";
125  printRegions(deadRegions, "Dead");
126  }
127  if (gRRactive) {
128  edm::LogVerbatim("SimG4CoreApplication")
129  << "StackingAction: "
130  << "Russian Roulette for gamma Elimit(MeV)= " << gRusRoEnerLim / CLHEP::MeV << "\n"
131  << " ECAL Prob= " << gRusRoEcal << "\n"
132  << " HCAL Prob= " << gRusRoHcal << "\n"
133  << " MuonIron Prob= " << gRusRoMuonIron << "\n"
134  << " PreShower Prob= " << gRusRoPreShower << "\n"
135  << " CASTOR Prob= " << gRusRoCastor << "\n"
136  << " World Prob= " << gRusRoWorld;
137  }
138  if (nRRactive) {
139  edm::LogVerbatim("SimG4CoreApplication")
140  << "StackingAction: "
141  << "Russian Roulette for neutron Elimit(MeV)= " << nRusRoEnerLim / CLHEP::MeV << "\n"
142  << " ECAL Prob= " << nRusRoEcal << "\n"
143  << " HCAL Prob= " << nRusRoHcal << "\n"
144  << " MuonIron Prob= " << nRusRoMuonIron << "\n"
145  << " PreShower Prob= " << nRusRoPreShower << "\n"
146  << " CASTOR Prob= " << nRusRoCastor << "\n"
147  << " World Prob= " << nRusRoWorld;
148  }
149 
150  if (savePDandCinTracker) {
151  edm::LogVerbatim("SimG4CoreApplication") << "StackingAction Tracker regions: ";
152  printRegions(trackerRegions, "Tracker");
153  }
154  if (savePDandCinCalo) {
155  edm::LogVerbatim("SimG4CoreApplication") << "StackingAction Calo regions: ";
156  printRegions(caloRegions, "Calo");
157  }
158  if (savePDandCinMuon) {
159  edm::LogVerbatim("SimG4CoreApplication") << "StackingAction Muon regions: ";
160  printRegions(muonRegions, "Muon");
161  }
162  worldSolid = G4TransportationManager::GetTransportationManager()
163  ->GetNavigatorForTracking()
164  ->GetWorldVolume()
165  ->GetLogicalVolume()
166  ->GetSolid();
167 }

References caloRegions, deadRegionNames, deadRegions, gRRactive, gRusRoCastor, gRusRoEcal, gRusRoEnerLim, gRusRoHcal, gRusRoMuonIron, gRusRoPreShower, gRusRoWorld, mps_fire::i, initPointer(), killDeltaRay, killExtra, killGamma, killHeavy, killInCalo, killInCaloEfH, kmaxGamma, kmaxIon, kmaxNeutron, kmaxProton, limitEnergyForVacuum, lowdensRegions, visualization-live-secondInstance_cfg::m, maxTimeNames, maxTrackTime, maxTrackTimeForward, maxTrackTimes, maxZCentralCMS, MeV, muonRegions, newTA, nRRactive, nRusRoCastor, nRusRoEcal, nRusRoEnerLim, nRusRoHcal, nRusRoMuonIron, nRusRoPreShower, nRusRoWorld, numberTimes, AlCaHLTBitMon_ParallelJobs::p, printRegions(), regionCastor, regionEcal, regionHcal, regionMuonIron, regionPreShower, regionWorld, saveFirstSecondary, savePDandCinAll, savePDandCinCalo, savePDandCinMuon, savePDandCinTracker, trackerRegions, trackNeutrino, and worldSolid.

◆ ~StackingAction()

StackingAction::~StackingAction ( )
override

Definition at line 169 of file StackingAction.cc.

169 { delete newTA; }

References newTA.

Member Function Documentation

◆ ClassifyNewTrack()

G4ClassificationOfNewTrack StackingAction::ClassifyNewTrack ( const G4Track *  aTrack)
final

Definition at line 171 of file StackingAction.cc.

171  {
172  // G4 interface part
173  G4ClassificationOfNewTrack classification = fUrgent;
174  int pdg = aTrack->GetDefinition()->GetPDGEncoding();
175  int abspdg = std::abs(pdg);
176 
177  // primary
178  if (aTrack->GetCreatorProcess() == nullptr || aTrack->GetParentID() == 0) {
179  if (!trackNeutrino && (abspdg == 12 || abspdg == 14 || abspdg == 16 || abspdg == 18)) {
180  classification = fKill;
181  } else if (worldSolid->Inside(aTrack->GetPosition()) == kOutside) {
182  classification = fKill;
183  } else {
184  newTA->primary(aTrack);
185  }
186  } else {
187  // secondary
188  const G4Region* reg = aTrack->GetVolume()->GetLogicalVolume()->GetRegion();
189 
190  // definetly killed tracks
191  if (aTrack->GetTrackStatus() == fStopAndKill) {
192  classification = fKill;
193  } else if (!trackNeutrino && (abspdg == 12 || abspdg == 14 || abspdg == 16 || abspdg == 18)) {
194  classification = fKill;
195 
196  } else if (std::abs(aTrack->GetPosition().z()) >= maxZCentralCMS) {
197  // very forward secondary
198  if (aTrack->GetGlobalTime() > maxTrackTimeForward) {
199  classification = fKill;
200  } else {
201  const G4Track* mother = trackAction->geant4Track();
202  newTA->secondary(aTrack, *mother, 0);
203  }
204 
205  } else if (isItOutOfTimeWindow(reg, aTrack)) {
206  // time window check
207  classification = fKill;
208 
209  } else {
210  // potentially good for tracking
211  double ke = aTrack->GetKineticEnergy();
212 
213  // kill tracks in specific regions
214  if (classification != fKill && isThisRegion(reg, deadRegions)) {
215  classification = fKill;
216  }
218  classification = fKill;
219 
220  } else {
221  // very low-energy gamma
222  if (pdg == 22 && killGamma && ke < kmaxGamma) {
223  classification = fKill;
224  }
225 
226  // specific track killing - not for production
227  if (killExtra && classification != fKill) {
228  if (killHeavy && classification != fKill) {
229  if (((pdg / 1000000000 == 1) && (((pdg / 10000) % 100) > 0) && (((pdg / 10) % 100) > 0) &&
230  (ke < kmaxIon)) ||
231  ((pdg == 2212) && (ke < kmaxProton)) || ((pdg == 2112) && (ke < kmaxNeutron))) {
232  classification = fKill;
233  }
234  }
235 
236  if (killDeltaRay && classification != fKill &&
237  aTrack->GetCreatorProcess()->GetProcessSubType() == fIonisation) {
238  classification = fKill;
239  }
240  if (killInCalo && classification != fKill && isThisRegion(reg, caloRegions)) {
241  classification = fKill;
242  }
243  if (killInCaloEfH && classification != fKill) {
244  int pdgMother = std::abs(trackAction->geant4Track()->GetDefinition()->GetPDGEncoding());
245  if ((pdg == 22 || abspdg == 11) && pdgMother != 11 && pdgMother != 22 && isThisRegion(reg, caloRegions)) {
246  classification = fKill;
247  }
248  }
249  }
250 
251  // Russian roulette && MC truth
252  if (classification != fKill) {
253  const G4Track* mother = trackAction->geant4Track();
254  int flag = 0;
255  if (savePDandCinAll) {
256  flag = isItPrimaryDecayProductOrConversion(aTrack, *mother);
257  } else {
261  flag = isItPrimaryDecayProductOrConversion(aTrack, *mother);
262  }
263  }
264  if (saveFirstSecondary && 0 == flag) {
265  flag = isItFromPrimary(*mother, flag);
266  }
267 
268  // Russian roulette
269  if (2112 == pdg || 22 == pdg) {
270  double currentWeight = aTrack->GetWeight();
271 
272  if (1.0 >= currentWeight) {
273  double prob = 1.0;
274  double elim = 0.0;
275 
276  // neutron
277  if (nRRactive && pdg == 2112) {
278  elim = nRusRoEnerLim;
279  if (reg == regionEcal) {
280  prob = nRusRoEcal;
281  } else if (reg == regionHcal) {
282  prob = nRusRoHcal;
283  } else if (reg == regionMuonIron) {
285  } else if (reg == regionPreShower) {
287  } else if (reg == regionCastor) {
288  prob = nRusRoCastor;
289  } else if (reg == regionWorld) {
290  prob = nRusRoWorld;
291  }
292 
293  // gamma
294  } else if (gRRactive && pdg == 22) {
295  elim = gRusRoEnerLim;
296  if (reg == regionEcal || reg == regionPreShower) {
297  if (rrApplicable(aTrack, *mother)) {
298  if (reg == regionEcal) {
299  prob = gRusRoEcal;
300  } else {
302  }
303  }
304  } else {
305  if (reg == regionHcal) {
306  prob = gRusRoHcal;
307  } else if (reg == regionMuonIron) {
309  } else if (reg == regionCastor) {
310  prob = gRusRoCastor;
311  } else if (reg == regionWorld) {
312  prob = gRusRoWorld;
313  }
314  }
315  }
316  if (prob < 1.0 && aTrack->GetKineticEnergy() < elim) {
317  if (G4UniformRand() < prob) {
318  const_cast<G4Track*>(aTrack)->SetWeight(currentWeight / prob);
319  } else {
320  classification = fKill;
321  }
322  }
323  }
324  }
325  if (classification != fKill) {
326  newTA->secondary(aTrack, *mother, flag);
327  }
328  LogDebug("SimG4CoreApplication")
329  << "StackingAction:Classify Track " << aTrack->GetTrackID() << " Parent " << aTrack->GetParentID()
330  << " Type " << aTrack->GetDefinition()->GetParticleName() << " K.E. " << aTrack->GetKineticEnergy() / MeV
331  << " MeV from process/subprocess " << aTrack->GetCreatorProcess()->GetProcessType() << "|"
332  << aTrack->GetCreatorProcess()->GetProcessSubType() << " as " << classification << " Flag " << flag;
333  }
334  }
335  }
336  }
337  if (nullptr != steppingVerbose) {
338  steppingVerbose->StackFilled(aTrack, (classification == fKill));
339  }
340  return classification;
341 }

References funct::abs(), caloRegions, deadRegions, RemoveAddSevLevel::flag, TrackingAction::geant4Track(), gRRactive, gRusRoCastor, gRusRoEcal, gRusRoEnerLim, gRusRoHcal, gRusRoMuonIron, gRusRoPreShower, gRusRoWorld, isItFromPrimary(), isItOutOfTimeWindow(), isItPrimaryDecayProductOrConversion(), isThisRegion(), ke, killDeltaRay, killExtra, killGamma, killHeavy, killInCalo, killInCaloEfH, kmaxGamma, kmaxIon, kmaxNeutron, kmaxProton, limitEnergyForVacuum, LogDebug, lowdensRegions, maxTrackTimeForward, maxZCentralCMS, MeV, muonRegions, newTA, nRRactive, nRusRoCastor, nRusRoEcal, nRusRoEnerLim, nRusRoHcal, nRusRoMuonIron, nRusRoPreShower, nRusRoWorld, NewTrackAction::primary(), TtFullHadEvtBuilder_cfi::prob, regionCastor, regionEcal, regionHcal, regionMuonIron, regionPreShower, regionWorld, rrApplicable(), saveFirstSecondary, savePDandCinAll, savePDandCinCalo, savePDandCinMuon, savePDandCinTracker, NewTrackAction::secondary(), CMSSteppingVerbose::StackFilled(), steppingVerbose, trackAction, trackerRegions, trackNeutrino, and worldSolid.

◆ initPointer()

void StackingAction::initPointer ( )
private

Definition at line 347 of file StackingAction.cc.

347  {
348  // prepare region vector
349  unsigned int num = maxTimeNames.size();
350  maxTimeRegions.resize(num, nullptr);
351 
352  // Russian roulette
353  std::vector<G4Region*>* rs = G4RegionStore::GetInstance();
354 
355  for (auto& reg : *rs) {
356  G4String rname = reg->GetName();
357  if ((gRusRoEcal < 1.0 || nRusRoEcal < 1.0) && rname == "EcalRegion") {
358  regionEcal = reg;
359  }
360  if ((gRusRoHcal < 1.0 || nRusRoHcal < 1.0) && rname == "HcalRegion") {
361  regionHcal = reg;
362  }
363  if ((gRusRoMuonIron < 1.0 || nRusRoMuonIron < 1.0) && rname == "MuonIron") {
364  regionMuonIron = reg;
365  }
366  if ((gRusRoPreShower < 1.0 || nRusRoPreShower < 1.0) && rname == "PreshowerRegion") {
367  regionPreShower = reg;
368  }
369  if ((gRusRoCastor < 1.0 || nRusRoCastor < 1.0) && rname == "CastorRegion") {
370  regionCastor = reg;
371  }
372  if ((gRusRoWorld < 1.0 || nRusRoWorld < 1.0) && rname == "DefaultRegionForTheWorld") {
373  regionWorld = reg;
374  }
375 
376  // time limits
377  for (unsigned int i = 0; i < num; ++i) {
378  if (rname == (G4String)(maxTimeNames[i])) {
379  maxTimeRegions[i] = reg;
380  break;
381  }
382  }
383  //
384  if (savePDandCinTracker &&
385  (rname == "BeamPipe" || rname == "BeamPipeVacuum" || rname == "TrackerPixelSensRegion" ||
386  rname == "TrackerPixelDeadRegion" || rname == "TrackerDeadRegion" || rname == "TrackerSensRegion")) {
387  trackerRegions.push_back(reg);
388  }
389  if (savePDandCinCalo && (rname == "HcalRegion" || rname == "EcalRegion" || rname == "PreshowerSensRegion" ||
390  rname == "PreshowerRegion")) {
391  caloRegions.push_back(reg);
392  }
393  if (savePDandCinMuon && (rname == "MuonChamber" || rname == "MuonSensitive_RPC" || rname == "MuonIron" ||
394  rname == "Muon" || rname == "MuonSensitive_DT-CSC")) {
395  muonRegions.push_back(reg);
396  }
397  if (rname == "BeamPipeOutside" || rname == "BeamPipeVacuum") {
398  lowdensRegions.push_back(reg);
399  }
400  for (auto& dead : deadRegionNames) {
401  if (rname == (G4String)(dead)) {
402  deadRegions.push_back(reg);
403  }
404  }
405  }
406 }

References caloRegions, deadRegionNames, deadRegions, gRusRoCastor, gRusRoEcal, gRusRoHcal, gRusRoMuonIron, gRusRoPreShower, gRusRoWorld, mps_fire::i, lowdensRegions, maxTimeNames, maxTimeRegions, muonRegions, nRusRoCastor, nRusRoEcal, nRusRoHcal, nRusRoMuonIron, nRusRoPreShower, nRusRoWorld, EgammaValidation_cff::num, regionCastor, regionEcal, regionHcal, regionMuonIron, regionPreShower, regionWorld, rname, savePDandCinCalo, savePDandCinMuon, savePDandCinTracker, and trackerRegions.

Referenced by StackingAction().

◆ isItFromPrimary()

int StackingAction::isItFromPrimary ( const G4Track &  mother,
int  flagIn 
) const
private

Definition at line 441 of file StackingAction.cc.

441  {
442  int flag = flagIn;
443  if (flag != 1) {
444  const TrackInformation& motherInfo(extractor(mother));
445  if (motherInfo.isPrimary()) {
446  flag = 3;
447  }
448  }
449  return flag;
450 }

References extractor, RemoveAddSevLevel::flag, and TrackInformation::isPrimary().

Referenced by ClassifyNewTrack().

◆ isItOutOfTimeWindow()

bool StackingAction::isItOutOfTimeWindow ( const G4Region *  reg,
const G4Track *  aTrack 
) const
private

Definition at line 452 of file StackingAction.cc.

452  {
453  double tofM = maxTrackTime;
454  for (unsigned int i = 0; i < numberTimes; ++i) {
455  if (reg == maxTimeRegions[i]) {
456  tofM = maxTrackTimes[i];
457  break;
458  }
459  }
460  return (aTrack->GetGlobalTime() > tofM) ? true : false;
461 }

References mps_fire::i, maxTimeRegions, maxTrackTime, maxTrackTimes, and numberTimes.

Referenced by ClassifyNewTrack().

◆ isItPrimaryDecayProductOrConversion()

int StackingAction::isItPrimaryDecayProductOrConversion ( const G4Track *  aTrack,
const G4Track &  mother 
) const
private

Definition at line 419 of file StackingAction.cc.

419  {
420  int flag = 0;
421  const TrackInformation& motherInfo(extractor(mother));
422  // Check whether mother is a primary
423  if (motherInfo.isPrimary()) {
424  if (aTrack->GetCreatorProcess()->GetProcessType() == fDecay) {
425  flag = 1;
426  } else if (aTrack->GetCreatorProcess()->GetProcessSubType() == fGammaConversion) {
427  flag = 2;
428  }
429  }
430  return flag;
431 }

References extractor, hydjet2DefaultParameters_cff::fDecay, RemoveAddSevLevel::flag, and TrackInformation::isPrimary().

Referenced by ClassifyNewTrack().

◆ isThisRegion()

bool StackingAction::isThisRegion ( const G4Region *  reg,
std::vector< const G4Region * > &  regions 
) const
private

Definition at line 408 of file StackingAction.cc.

408  {
409  bool flag = false;
410  for (auto& region : regions) {
411  if (reg == region) {
412  flag = true;
413  break;
414  }
415  }
416  return flag;
417 }

References RemoveAddSevLevel::flag, and HLT_FULL_cff::region.

Referenced by ClassifyNewTrack().

◆ NewStage()

void StackingAction::NewStage ( )
override

Definition at line 343 of file StackingAction.cc.

343 {}

◆ PrepareNewEvent()

void StackingAction::PrepareNewEvent ( )
override

Definition at line 345 of file StackingAction.cc.

345 {}

◆ printRegions()

void StackingAction::printRegions ( const std::vector< const G4Region * > &  reg,
const std::string &  word 
) const
private

Definition at line 463 of file StackingAction.cc.

463  {
464  for (unsigned int i = 0; i < reg.size(); ++i) {
465  edm::LogVerbatim("SimG4CoreApplication")
466  << " StackingAction: " << word << "Region " << i << ". " << reg[i]->GetName();
467  }
468 }

References mps_fire::i.

Referenced by StackingAction().

◆ rrApplicable()

bool StackingAction::rrApplicable ( const G4Track *  aTrack,
const G4Track &  mother 
) const
private

Definition at line 433 of file StackingAction.cc.

433  {
434  const TrackInformation& motherInfo(extractor(mother));
435 
436  // Check whether mother is gamma, e+, e-
437  int genID = motherInfo.genParticlePID();
438  return (22 == genID || 11 == genID || -11 == genID) ? false : true;
439 }

References extractor, funct::false, and TrackInformation::genParticlePID().

Referenced by ClassifyNewTrack().

Member Data Documentation

◆ caloRegions

std::vector<const G4Region*> StackingAction::caloRegions
private

Definition at line 67 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ deadRegionNames

std::vector<std::string> StackingAction::deadRegionNames
private

Definition at line 62 of file StackingAction.h.

Referenced by initPointer(), and StackingAction().

◆ deadRegions

std::vector<const G4Region*> StackingAction::deadRegions
private

Definition at line 69 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ extractor

TrackInformationExtractor StackingAction::extractor
private

◆ gRRactive

bool StackingAction::gRRactive
private

Definition at line 103 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ gRusRoCastor

double StackingAction::gRusRoCastor
private

Definition at line 98 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ gRusRoEcal

double StackingAction::gRusRoEcal
private

Definition at line 90 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ gRusRoEnerLim

double StackingAction::gRusRoEnerLim
private

Definition at line 86 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ gRusRoHcal

double StackingAction::gRusRoHcal
private

Definition at line 92 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ gRusRoMuonIron

double StackingAction::gRusRoMuonIron
private

Definition at line 94 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ gRusRoPreShower

double StackingAction::gRusRoPreShower
private

Definition at line 96 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ gRusRoWorld

double StackingAction::gRusRoWorld
private

Definition at line 100 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ killDeltaRay

bool StackingAction::killDeltaRay
private

Definition at line 50 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ killExtra

bool StackingAction::killExtra
private

Definition at line 51 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ killGamma

bool StackingAction::killGamma
private

Definition at line 52 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ killHeavy

bool StackingAction::killHeavy
private

Definition at line 50 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ killInCalo

bool StackingAction::killInCalo
private

Definition at line 49 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ killInCaloEfH

bool StackingAction::killInCaloEfH
private

Definition at line 49 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ kmaxGamma

double StackingAction::kmaxGamma
private

Definition at line 55 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ kmaxIon

double StackingAction::kmaxIon
private

Definition at line 54 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ kmaxNeutron

double StackingAction::kmaxNeutron
private

Definition at line 54 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ kmaxProton

double StackingAction::kmaxProton
private

Definition at line 54 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ limitEnergyForVacuum

double StackingAction::limitEnergyForVacuum
private

Definition at line 53 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ lowdensRegions

std::vector<const G4Region*> StackingAction::lowdensRegions
private

Definition at line 68 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ maxTimeNames

std::vector<std::string> StackingAction::maxTimeNames
private

Definition at line 61 of file StackingAction.h.

Referenced by initPointer(), and StackingAction().

◆ maxTimeRegions

std::vector<const G4Region*> StackingAction::maxTimeRegions
private

Definition at line 64 of file StackingAction.h.

Referenced by initPointer(), and isItOutOfTimeWindow().

◆ maxTrackTime

double StackingAction::maxTrackTime
private

Definition at line 56 of file StackingAction.h.

Referenced by isItOutOfTimeWindow(), and StackingAction().

◆ maxTrackTimeForward

double StackingAction::maxTrackTimeForward
private

Definition at line 57 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ maxTrackTimes

std::vector<double> StackingAction::maxTrackTimes
private

Definition at line 60 of file StackingAction.h.

Referenced by isItOutOfTimeWindow(), and StackingAction().

◆ maxZCentralCMS

double StackingAction::maxZCentralCMS
private

Definition at line 58 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ muonRegions

std::vector<const G4Region*> StackingAction::muonRegions
private

Definition at line 66 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ newTA

NewTrackAction* StackingAction::newTA
private

Definition at line 74 of file StackingAction.h.

Referenced by ClassifyNewTrack(), StackingAction(), and ~StackingAction().

◆ nRRactive

bool StackingAction::nRRactive
private

Definition at line 104 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ nRusRoCastor

double StackingAction::nRusRoCastor
private

Definition at line 99 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ nRusRoEcal

double StackingAction::nRusRoEcal
private

Definition at line 91 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ nRusRoEnerLim

double StackingAction::nRusRoEnerLim
private

Definition at line 87 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ nRusRoHcal

double StackingAction::nRusRoHcal
private

Definition at line 93 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ nRusRoMuonIron

double StackingAction::nRusRoMuonIron
private

Definition at line 95 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ nRusRoPreShower

double StackingAction::nRusRoPreShower
private

Definition at line 97 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ nRusRoWorld

double StackingAction::nRusRoWorld
private

Definition at line 101 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ numberTimes

unsigned int StackingAction::numberTimes
private

Definition at line 59 of file StackingAction.h.

Referenced by isItOutOfTimeWindow(), and StackingAction().

◆ regionCastor

const G4Region* StackingAction::regionCastor
private

Definition at line 82 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ regionEcal

const G4Region* StackingAction::regionEcal
private

Definition at line 78 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ regionHcal

const G4Region* StackingAction::regionHcal
private

Definition at line 79 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ regionMuonIron

const G4Region* StackingAction::regionMuonIron
private

Definition at line 80 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ regionPreShower

const G4Region* StackingAction::regionPreShower
private

Definition at line 81 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ regionWorld

const G4Region* StackingAction::regionWorld
private

Definition at line 83 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ saveFirstSecondary

bool StackingAction::saveFirstSecondary
private

Definition at line 47 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ savePDandCinAll

bool StackingAction::savePDandCinAll
private

Definition at line 48 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ savePDandCinCalo

bool StackingAction::savePDandCinCalo
private

Definition at line 46 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ savePDandCinMuon

bool StackingAction::savePDandCinMuon
private

Definition at line 47 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ savePDandCinTracker

bool StackingAction::savePDandCinTracker
private

Definition at line 46 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ steppingVerbose

const CMSSteppingVerbose* StackingAction::steppingVerbose
private

Definition at line 73 of file StackingAction.h.

Referenced by ClassifyNewTrack().

◆ trackAction

const TrackingAction* StackingAction::trackAction
private

Definition at line 72 of file StackingAction.h.

Referenced by ClassifyNewTrack().

◆ trackerRegions

std::vector<const G4Region*> StackingAction::trackerRegions
private

Definition at line 65 of file StackingAction.h.

Referenced by ClassifyNewTrack(), initPointer(), and StackingAction().

◆ trackNeutrino

bool StackingAction::trackNeutrino
private

Definition at line 50 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

◆ worldSolid

G4VSolid* StackingAction::worldSolid
private

Definition at line 71 of file StackingAction.h.

Referenced by ClassifyNewTrack(), and StackingAction().

StackingAction::killGamma
bool killGamma
Definition: StackingAction.h:52
StackingAction::isItPrimaryDecayProductOrConversion
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) const
Definition: StackingAction.cc:419
StackingAction::nRusRoMuonIron
double nRusRoMuonIron
Definition: StackingAction.h:95
mps_fire.i
i
Definition: mps_fire.py:428
StackingAction::worldSolid
G4VSolid * worldSolid
Definition: StackingAction.h:71
StackingAction::deadRegions
std::vector< const G4Region * > deadRegions
Definition: StackingAction.h:69
StackingAction::deadRegionNames
std::vector< std::string > deadRegionNames
Definition: StackingAction.h:62
funct::false
false
Definition: Factorize.h:29
StackingAction::savePDandCinMuon
bool savePDandCinMuon
Definition: StackingAction.h:47
StackingAction::maxZCentralCMS
double maxZCentralCMS
Definition: StackingAction.h:58
StackingAction::nRusRoEcal
double nRusRoEcal
Definition: StackingAction.h:91
StackingAction::killHeavy
bool killHeavy
Definition: StackingAction.h:50
StackingAction::gRRactive
bool gRRactive
Definition: StackingAction.h:103
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
StackingAction::nRusRoPreShower
double nRusRoPreShower
Definition: StackingAction.h:97
StackingAction::savePDandCinCalo
bool savePDandCinCalo
Definition: StackingAction.h:46
StackingAction::gRusRoWorld
double gRusRoWorld
Definition: StackingAction.h:100
StackingAction::nRusRoCastor
double nRusRoCastor
Definition: StackingAction.h:99
MeV
const double MeV
StackingAction::newTA
NewTrackAction * newTA
Definition: StackingAction.h:74
TrackingAction::geant4Track
const G4Track * geant4Track() const
Definition: TrackingAction.h:25
StackingAction::savePDandCinAll
bool savePDandCinAll
Definition: StackingAction.h:48
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
StackingAction::maxTrackTimeForward
double maxTrackTimeForward
Definition: StackingAction.h:57
StackingAction::muonRegions
std::vector< const G4Region * > muonRegions
Definition: StackingAction.h:66
StackingAction::gRusRoEcal
double gRusRoEcal
Definition: StackingAction.h:90
StackingAction::gRusRoCastor
double gRusRoCastor
Definition: StackingAction.h:98
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
StackingAction::regionPreShower
const G4Region * regionPreShower
Definition: StackingAction.h:81
StackingAction::isThisRegion
bool isThisRegion(const G4Region *, std::vector< const G4Region * > &) const
Definition: StackingAction.cc:408
StackingAction::isItFromPrimary
int isItFromPrimary(const G4Track &, int) const
Definition: StackingAction.cc:441
StackingAction::gRusRoHcal
double gRusRoHcal
Definition: StackingAction.h:92
StackingAction::killDeltaRay
bool killDeltaRay
Definition: StackingAction.h:50
StackingAction::regionMuonIron
const G4Region * regionMuonIron
Definition: StackingAction.h:80
StackingAction::regionWorld
const G4Region * regionWorld
Definition: StackingAction.h:83
StackingAction::lowdensRegions
std::vector< const G4Region * > lowdensRegions
Definition: StackingAction.h:68
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
NewTrackAction::secondary
void secondary(const G4Track *aSecondary, const G4Track &mother, int) const
Definition: NewTrackAction.cc:18
StackingAction::numberTimes
unsigned int numberTimes
Definition: StackingAction.h:59
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
StackingAction::killInCaloEfH
bool killInCaloEfH
Definition: StackingAction.h:49
StackingAction::regionHcal
const G4Region * regionHcal
Definition: StackingAction.h:79
StackingAction::extractor
TrackInformationExtractor extractor
Definition: StackingAction.h:75
StackingAction::killInCalo
bool killInCalo
Definition: StackingAction.h:49
StackingAction::rrApplicable
bool rrApplicable(const G4Track *, const G4Track &) const
Definition: StackingAction.cc:433
StackingAction::trackerRegions
std::vector< const G4Region * > trackerRegions
Definition: StackingAction.h:65
StackingAction::caloRegions
std::vector< const G4Region * > caloRegions
Definition: StackingAction.h:67
StackingAction::limitEnergyForVacuum
double limitEnergyForVacuum
Definition: StackingAction.h:53
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
StackingAction::nRusRoWorld
double nRusRoWorld
Definition: StackingAction.h:101
StackingAction::nRusRoEnerLim
double nRusRoEnerLim
Definition: StackingAction.h:87
CMSSteppingVerbose::StackFilled
void StackFilled(const G4Track *, bool isKilled) const
Definition: CMSSteppingVerbose.cc:136
StackingAction::saveFirstSecondary
bool saveFirstSecondary
Definition: StackingAction.h:47
ke
int ke
Definition: CascadeWrapper.h:13
rname
const G4String rname[NREG]
Definition: ParametrisedEMPhysics.cc:48
StackingAction::gRusRoPreShower
double gRusRoPreShower
Definition: StackingAction.h:96
TrackInformation
Definition: TrackInformation.h:8
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88272
StackingAction::maxTimeNames
std::vector< std::string > maxTimeNames
Definition: StackingAction.h:61
StackingAction::savePDandCinTracker
bool savePDandCinTracker
Definition: StackingAction.h:46
StackingAction::initPointer
void initPointer()
Definition: StackingAction.cc:347
StackingAction::regionCastor
const G4Region * regionCastor
Definition: StackingAction.h:82
StackingAction::kmaxIon
double kmaxIon
Definition: StackingAction.h:54
StackingAction::gRusRoMuonIron
double gRusRoMuonIron
Definition: StackingAction.h:94
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
StackingAction::maxTrackTime
double maxTrackTime
Definition: StackingAction.h:56
StackingAction::maxTimeRegions
std::vector< const G4Region * > maxTimeRegions
Definition: StackingAction.h:64
StackingAction::kmaxGamma
double kmaxGamma
Definition: StackingAction.h:55
StackingAction::killExtra
bool killExtra
Definition: StackingAction.h:51
NewTrackAction
Definition: NewTrackAction.h:14
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
StackingAction::kmaxProton
double kmaxProton
Definition: StackingAction.h:54
StackingAction::maxTrackTimes
std::vector< double > maxTrackTimes
Definition: StackingAction.h:60
StackingAction::nRusRoHcal
double nRusRoHcal
Definition: StackingAction.h:93
hydjet2DefaultParameters_cff.fDecay
fDecay
Decays ###.
Definition: hydjet2DefaultParameters_cff.py:62
pdg
Definition: pdg_functions.h:28
StackingAction::gRusRoEnerLim
double gRusRoEnerLim
Definition: StackingAction.h:86
StackingAction::trackAction
const TrackingAction * trackAction
Definition: StackingAction.h:72
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:76
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
StackingAction::regionEcal
const G4Region * regionEcal
Definition: StackingAction.h:78
StackingAction::kmaxNeutron
double kmaxNeutron
Definition: StackingAction.h:54
StackingAction::printRegions
void printRegions(const std::vector< const G4Region * > &reg, const std::string &word) const
Definition: StackingAction.cc:463
StackingAction::steppingVerbose
const CMSSteppingVerbose * steppingVerbose
Definition: StackingAction.h:73
NewTrackAction::primary
void primary(const G4Track *aSecondary) const
Definition: NewTrackAction.cc:14
TtFullHadEvtBuilder_cfi.prob
prob
Definition: TtFullHadEvtBuilder_cfi.py:33
StackingAction::trackNeutrino
bool trackNeutrino
Definition: StackingAction.h:50
StackingAction::nRRactive
bool nRRactive
Definition: StackingAction.h:104
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
StackingAction::isItOutOfTimeWindow
bool isItOutOfTimeWindow(const G4Region *, const G4Track *) const
Definition: StackingAction.cc:452