CMS 3D CMS Logo

StackingAction.h
Go to the documentation of this file.
1 #ifndef SimG4Core_StackingAction_H
2 #define SimG4Core_StackingAction_H
3 
6 
7 #include "G4UserStackingAction.hh"
8 #include "G4Region.hh"
9 #include "G4Track.hh"
10 #include "G4LogicalVolume.hh"
11 
12 #include <string>
13 #include <vector>
14 
15 class NewTrackAction;
16 class TrackingAction;
17 class CMSSteppingVerbose;
18 
19 class StackingAction : public G4UserStackingAction {
20 public:
21  explicit StackingAction(const TrackingAction*, const edm::ParameterSet& ps, const CMSSteppingVerbose*);
22 
23  ~StackingAction() override;
24 
25  G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack) final;
26 
27  void NewStage() override;
28  void PrepareNewEvent() override;
29 
30 private:
31  void initPointer();
32 
33  int isItPrimaryDecayProductOrConversion(const G4Track*, const G4Track&) const;
34 
35  int isItFromPrimary(const G4Track&, int) const;
36 
37  bool rrApplicable(const G4Track*, const G4Track&) const;
38 
39  bool isItOutOfTimeWindow(const G4Region*, const double&) const;
40 
41  bool isThisRegion(const G4Region*, std::vector<const G4Region*>&) const;
42 
43  void printRegions(const std::vector<const G4Region*>& reg, const std::string& word) const;
44 
45 private:
51  bool killExtra;
52  bool killGamma;
55  double kmaxGamma;
56  double maxTrackTime;
59  unsigned int numberTimes;
60  std::vector<double> maxTrackTimes;
61  std::vector<std::string> maxTimeNames;
62  std::vector<std::string> deadRegionNames;
63 
64  std::vector<const G4Region*> maxTimeRegions;
65  std::vector<const G4Region*> trackerRegions;
66  std::vector<const G4Region*> muonRegions;
67  std::vector<const G4Region*> caloRegions;
68  std::vector<const G4Region*> lowdensRegions;
69  std::vector<const G4Region*> deadRegions;
70 
71  G4VSolid* worldSolid;
76 
77  // Russian roulette regions
78  const G4Region* regionEcal;
79  const G4Region* regionHcal;
80  const G4Region* regionMuonIron;
81  const G4Region* regionPreShower;
82  const G4Region* regionCastor;
83  const G4Region* regionWorld;
84 
85  // Russian roulette energy limits
86  double gRusRoEnerLim;
87  double nRusRoEnerLim;
88 
89  // Russian roulette factors
90  double gRusRoEcal;
91  double nRusRoEcal;
92  double gRusRoHcal;
93  double nRusRoHcal;
98  double gRusRoCastor;
99  double nRusRoCastor;
100  double gRusRoWorld;
101  double nRusRoWorld;
102  // flags
103  bool gRRactive;
104  bool nRRactive;
105 };
106 
107 #endif
double nRusRoPreShower
NewTrackAction * newTA
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack) final
StackingAction(const TrackingAction *, const edm::ParameterSet &ps, const CMSSteppingVerbose *)
std::vector< const G4Region * > lowdensRegions
double maxZCentralCMS
void PrepareNewEvent() override
std::vector< double > maxTrackTimes
TrackInformationExtractor extractor
bool rrApplicable(const G4Track *, const G4Track &) const
double gRusRoPreShower
double nRusRoEnerLim
const G4Region * regionCastor
const G4Region * regionMuonIron
int isItFromPrimary(const G4Track &, int) const
std::vector< const G4Region * > deadRegions
const CMSSteppingVerbose * steppingVerbose
uint64_t word
std::vector< const G4Region * > muonRegions
std::vector< std::string > maxTimeNames
void NewStage() override
const G4Region * regionEcal
~StackingAction() override
unsigned int numberTimes
void printRegions(const std::vector< const G4Region *> &reg, const std::string &word) const
double nRusRoMuonIron
G4VSolid * worldSolid
bool isItOutOfTimeWindow(const G4Region *, const double &) const
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) const
bool isThisRegion(const G4Region *, std::vector< const G4Region *> &) const
bool savePDandCinTracker
std::vector< std::string > deadRegionNames
double gRusRoEnerLim
const G4Region * regionHcal
std::vector< const G4Region * > maxTimeRegions
double maxTrackTimeForward
const G4Region * regionPreShower
const TrackingAction * trackAction
double gRusRoMuonIron
std::vector< const G4Region * > trackerRegions
std::vector< const G4Region * > caloRegions
double limitEnergyForVacuum
const G4Region * regionWorld