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 StackingAction : public G4UserStackingAction {
15 
16 public:
18  virtual ~StackingAction();
19  virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track * aTrack);
20  virtual void NewStage();
21  virtual void PrepareNewEvent();
22 private:
23  void initPointer();
24  bool isThisVolume(const G4VTouchable*, std::vector<G4LogicalVolume*>&) const;
25  int isItPrimaryDecayProductOrConversion(const G4Track*, const G4Track &) const;
26  int isItFromPrimary(const G4Track &, int) const;
27  bool isItLongLived(const G4Track*) const;
28 private:
34  double maxTrackTime;
35  std::vector<double> maxTrackTimes;
36  std::vector<std::string> maxTimeNames;
37  std::vector<G4Region*> maxTimeRegions;
38  std::vector<G4LogicalVolume*> tracker, calo, muon;
39 
40  // Russian roulette regions
41  G4Region* regionEcal;
42  G4Region* regionHcal;
43  G4Region* regionQuad;
44  G4Region* regionMuonIron;
45  G4Region* regionPreShower;
46  G4Region* regionCastor;
47  G4Region* regionBeamPipeOut;
48  G4Region* regionWorld;
49 
50  // Russian roulette energy limits
51  double nRusRoEnerLim;
52  double pRusRoEnerLim;
53 
54  // Russian roulette factors
55  double nRusRoEcal;
56  double pRusRoEcal;
57  double nRusRoHcal;
58  double pRusRoHcal;
59  double nRusRoQuad;
60  double pRusRoQuad;
65  double nRusRoCastor;
66  double pRusRoCastor;
67  double nRusRoBeam;
68  double pRusRoBeam;
69  double nRusRoWorld;
70  double pRusRoWorld;
71  // flags
72  bool nRRactive;
73  bool pRRactive;
74 };
75 
76 #endif
double nRusRoPreShower
std::vector< G4LogicalVolume * > tracker
std::vector< G4Region * > maxTimeRegions
std::vector< double > maxTrackTimes
G4Region * regionPreShower
G4Region * regionHcal
double nRusRoEnerLim
double pRusRoEnerLim
G4Region * regionMuonIron
G4Region * regionEcal
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) const
virtual ~StackingAction()
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack)
StackingAction(const edm::ParameterSet &ps)
std::vector< std::string > maxTimeNames
virtual void PrepareNewEvent()
double pRusRoPreShower
double nRusRoMuonIron
G4Region * regionCastor
G4Region * regionWorld
std::vector< G4LogicalVolume * > calo
bool savePDandCinTracker
G4Region * regionBeamPipeOut
std::vector< G4LogicalVolume * > muon
bool isThisVolume(const G4VTouchable *, std::vector< G4LogicalVolume * > &) const
G4Region * regionQuad
virtual void NewStage()
int isItFromPrimary(const G4Track &, int) const
double pRusRoMuonIron
bool isItLongLived(const G4Track *) const