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 NewTrackAction;
15 
16 class StackingAction : public G4UserStackingAction {
17 
18 public:
20  virtual ~StackingAction();
21 
22  virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track * aTrack);
23 
24  void NewStage();
25  void PrepareNewEvent();
26 
27 private:
28 
29  void initPointer();
30 
31  int isItPrimaryDecayProductOrConversion(const G4Track*, const G4Track &) const;
32 
33  int isItFromPrimary(const G4Track &, int) const;
34 
35  bool rrApplicable(const G4Track*, const G4Track&) const;
36 
37  bool isItLongLived(const G4Track*) const;
38 
39  bool isThisRegion(const G4Region*, std::vector<const G4Region*>&) const;
40 
41  void printRegions(const std::vector<const G4Region*>& reg,
42  const std::string& word) const;
43 
44 private:
45 
51  bool killGamma;
54  double kmaxGamma;
55  double maxTrackTime;
56  unsigned int numberTimes;
57  std::vector<double> maxTrackTimes;
58  std::vector<std::string> maxTimeNames;
59  std::vector<std::string> deadRegionNames;
60 
61  std::vector<const G4Region*> maxTimeRegions;
62  std::vector<const G4Region*> trackerRegions;
63  std::vector<const G4Region*> muonRegions;
64  std::vector<const G4Region*> caloRegions;
65  std::vector<const G4Region*> lowdensRegions;
66  std::vector<const G4Region*> deadRegions;
67 
69 
70  // Russian roulette regions
71  const G4Region* regionEcal;
72  const G4Region* regionHcal;
73  const G4Region* regionMuonIron;
74  const G4Region* regionPreShower;
75  const G4Region* regionCastor;
76  const G4Region* regionWorld;
77 
78  // Russian roulette energy limits
79  double gRusRoEnerLim;
80  double nRusRoEnerLim;
81  double pRusRoEnerLim;
82 
83  // Russian roulette factors
84  double gRusRoEcal;
85  double nRusRoEcal;
86  double pRusRoEcal;
87  double gRusRoHcal;
88  double nRusRoHcal;
89  double pRusRoHcal;
96  double gRusRoCastor;
97  double nRusRoCastor;
98  double pRusRoCastor;
99  double gRusRoWorld;
100  double nRusRoWorld;
101  double pRusRoWorld;
102  // flags
103  bool gRRactive;
104  bool nRRactive;
105  bool pRRactive;
106 };
107 
108 #endif
double nRusRoPreShower
NewTrackAction * newTA
std::vector< const G4Region * > lowdensRegions
std::vector< double > maxTrackTimes
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
unsigned int numberTimes
double pRusRoPreShower
void printRegions(const std::vector< const G4Region * > &reg, const std::string &word) const
double nRusRoMuonIron
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
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
const G4Region * regionWorld