CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StackingAction.h
Go to the documentation of this file.
1 #ifndef SimG4Core_StackingAction_H
2 #define SimG4Core_StackingAction_H
3 
5 
6 #include "G4UserStackingAction.hh"
7 #include "G4Region.hh"
8 #include "G4Track.hh"
9 #include "G4LogicalVolume.hh"
10 
11 #include <string>
12 #include <vector>
13 
14 class EventAction;
15 class NewTrackAction;
16 
17 class StackingAction : public G4UserStackingAction {
18 
19 public:
21  virtual ~StackingAction();
22 
23  virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track * aTrack);
24 
25  void NewStage();
26  void PrepareNewEvent();
27 
28 private:
29  void initPointer();
30  bool isThisVolume(const G4VTouchable*, std::vector<G4LogicalVolume*>&) const;
31  int isItPrimaryDecayProductOrConversion(const G4Track*, const G4Track &) const;
32  bool rrApplicable(const G4Track*, const G4Track&) const;
33  bool isItLongLived(const G4Track*) const;
34 
35 private:
42  double maxTrackTime;
43  std::vector<double> maxTrackTimes;
44  std::vector<std::string> maxTimeNames;
45  std::vector<G4Region*> maxTimeRegions;
46  std::vector<G4LogicalVolume*> tracker, calo, muon;
47 
49 
50  // Russian roulette regions
51  G4Region* regionEcal;
52  G4Region* regionHcal;
53  G4Region* regionMuonIron;
54  G4Region* regionPreShower;
55  G4Region* regionCastor;
56  G4Region* regionWorld;
57 
58  // Russian roulette energy limits
59  double gRusRoEnerLim;
60  double nRusRoEnerLim;
61  double pRusRoEnerLim;
62 
63  // Russian roulette factors
64  double gRusRoEcal;
65  double nRusRoEcal;
66  double pRusRoEcal;
67  double gRusRoHcal;
68  double nRusRoHcal;
69  double pRusRoHcal;
76  double gRusRoCastor;
77  double nRusRoCastor;
78  double pRusRoCastor;
79  double gRusRoWorld;
80  double nRusRoWorld;
81  double pRusRoWorld;
82  // flags
83  bool gRRactive;
84  bool nRRactive;
85  bool pRRactive;
86 };
87 
88 #endif
double nRusRoPreShower
std::vector< G4LogicalVolume * > tracker
NewTrackAction * newTA
std::vector< G4Region * > maxTimeRegions
StackingAction(EventAction *e, const edm::ParameterSet &ps)
std::vector< double > maxTrackTimes
G4Region * regionPreShower
double gRusRoPreShower
G4Region * regionHcal
double nRusRoEnerLim
double pRusRoEnerLim
G4Region * regionMuonIron
G4Region * regionEcal
bool rrApplicable(const G4Track *, const G4Track &) const
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) const
virtual ~StackingAction()
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
std::vector< std::string > maxTimeNames
double pRusRoPreShower
double nRusRoMuonIron
G4Region * regionCastor
G4Region * regionWorld
EventAction * eventAction_
std::vector< G4LogicalVolume * > calo
bool savePDandCinTracker
double gRusRoEnerLim
std::vector< G4LogicalVolume * > muon
bool isThisVolume(const G4VTouchable *, std::vector< G4LogicalVolume * > &) const
double gRusRoMuonIron
double pRusRoMuonIron
bool isItLongLived(const G4Track *) const