test
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 class TrackingAction;
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 
30  void initPointer();
31 
32  int isItPrimaryDecayProductOrConversion(const G4Track*, const G4Track &) const;
33 
34  int isItFromPrimary(const G4Track &, int) const;
35 
36  bool rrApplicable(const G4Track*, const G4Track&) const;
37 
38  bool isItLongLived(const G4Track*) const;
39 
40  bool isThisRegion(const G4Region*, std::vector<const G4Region*>&) const;
41 
42  void printRegions(const std::vector<const G4Region*>& reg,
43  const std::string& word) const;
44 
45 private:
46 
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 
71 
72  // Russian roulette regions
73  const G4Region* regionEcal;
74  const G4Region* regionHcal;
75  const G4Region* regionMuonIron;
76  const G4Region* regionPreShower;
77  const G4Region* regionCastor;
78  const G4Region* regionWorld;
79 
80  // Russian roulette energy limits
81  double gRusRoEnerLim;
82  double nRusRoEnerLim;
83  double pRusRoEnerLim;
84 
85  // Russian roulette factors
86  double gRusRoEcal;
87  double nRusRoEcal;
88  double pRusRoEcal;
89  double gRusRoHcal;
90  double nRusRoHcal;
91  double pRusRoHcal;
98  double gRusRoCastor;
99  double nRusRoCastor;
100  double pRusRoCastor;
101  double gRusRoWorld;
102  double nRusRoWorld;
103  double pRusRoWorld;
104  // flags
105  bool gRRactive;
106  bool nRRactive;
107  bool pRRactive;
108 };
109 
110 #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)
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
StackingAction(const TrackingAction *, const edm::ParameterSet &ps)
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
const TrackingAction * trackAction
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