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 G4Track*) 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;
57  unsigned int numberTimes;
58  std::vector<double> maxTrackTimes;
59  std::vector<std::string> maxTimeNames;
60  std::vector<std::string> deadRegionNames;
61 
62  std::vector<const G4Region*> maxTimeRegions;
63  std::vector<const G4Region*> trackerRegions;
64  std::vector<const G4Region*> muonRegions;
65  std::vector<const G4Region*> caloRegions;
66  std::vector<const G4Region*> lowdensRegions;
67  std::vector<const G4Region*> deadRegions;
68 
69  G4VSolid* worldSolid;
74 
75  // Russian roulette regions
76  const G4Region* regionEcal;
77  const G4Region* regionHcal;
78  const G4Region* regionMuonIron;
79  const G4Region* regionPreShower;
80  const G4Region* regionCastor;
81  const G4Region* regionWorld;
82 
83  // Russian roulette energy limits
84  double gRusRoEnerLim;
85  double nRusRoEnerLim;
86 
87  // Russian roulette factors
88  double gRusRoEcal;
89  double nRusRoEcal;
90  double gRusRoHcal;
91  double nRusRoHcal;
96  double gRusRoCastor;
97  double nRusRoCastor;
98  double gRusRoWorld;
99  double nRusRoWorld;
100  // flags
101  bool gRRactive;
102  bool nRRactive;
103 };
104 
105 #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
void PrepareNewEvent() override
std::vector< double > maxTrackTimes
TrackInformationExtractor extractor
double gRusRoPreShower
double nRusRoEnerLim
const G4Region * regionCastor
const G4Region * regionMuonIron
bool rrApplicable(const G4Track *, const G4Track &) const
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) 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 isThisRegion(const G4Region *, std::vector< const G4Region * > &) const
bool savePDandCinTracker
std::vector< std::string > deadRegionNames
double gRusRoEnerLim
const G4Region * regionHcal
bool isItOutOfTimeWindow(const G4Region *, const G4Track *) const
std::vector< const G4Region * > maxTimeRegions
const G4Region * regionPreShower
const TrackingAction * trackAction
int isItFromPrimary(const G4Track &, int) const
double gRusRoMuonIron
std::vector< const G4Region * > trackerRegions
std::vector< const G4Region * > caloRegions
double limitEnergyForVacuum
const G4Region * regionWorld