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
StackingAction::killGamma
bool killGamma
Definition: StackingAction.h:52
StackingAction::isItPrimaryDecayProductOrConversion
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) const
Definition: StackingAction.cc:404
StackingAction::nRusRoMuonIron
double nRusRoMuonIron
Definition: StackingAction.h:93
StackingAction::worldSolid
G4VSolid * worldSolid
Definition: StackingAction.h:69
StackingAction::deadRegions
std::vector< const G4Region * > deadRegions
Definition: StackingAction.h:67
StackingAction::deadRegionNames
std::vector< std::string > deadRegionNames
Definition: StackingAction.h:60
StackingAction::StackingAction
StackingAction(const TrackingAction *, const edm::ParameterSet &ps, const CMSSteppingVerbose *)
Definition: StackingAction.cc:18
StackingAction::savePDandCinMuon
bool savePDandCinMuon
Definition: StackingAction.h:47
StackingAction::nRusRoEcal
double nRusRoEcal
Definition: StackingAction.h:89
StackingAction::killHeavy
bool killHeavy
Definition: StackingAction.h:50
StackingAction::gRRactive
bool gRRactive
Definition: StackingAction.h:101
StackingAction::nRusRoPreShower
double nRusRoPreShower
Definition: StackingAction.h:95
StackingAction::savePDandCinCalo
bool savePDandCinCalo
Definition: StackingAction.h:46
StackingAction::gRusRoWorld
double gRusRoWorld
Definition: StackingAction.h:98
StackingAction::nRusRoCastor
double nRusRoCastor
Definition: StackingAction.h:97
StackingAction::~StackingAction
~StackingAction() override
Definition: StackingAction.cc:165
StackingAction
Definition: StackingAction.h:19
CMSSteppingVerbose
Definition: CMSSteppingVerbose.h:25
StackingAction::newTA
NewTrackAction * newTA
Definition: StackingAction.h:72
StackingAction::savePDandCinAll
bool savePDandCinAll
Definition: StackingAction.h:48
StackingAction::muonRegions
std::vector< const G4Region * > muonRegions
Definition: StackingAction.h:64
StackingAction::gRusRoEcal
double gRusRoEcal
Definition: StackingAction.h:88
StackingAction::NewStage
void NewStage() override
Definition: StackingAction.cc:328
StackingAction::gRusRoCastor
double gRusRoCastor
Definition: StackingAction.h:96
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
StackingAction::regionPreShower
const G4Region * regionPreShower
Definition: StackingAction.h:79
StackingAction::isThisRegion
bool isThisRegion(const G4Region *, std::vector< const G4Region * > &) const
Definition: StackingAction.cc:393
TrackingAction
Definition: TrackingAction.h:16
StackingAction::isItFromPrimary
int isItFromPrimary(const G4Track &, int) const
Definition: StackingAction.cc:426
StackingAction::gRusRoHcal
double gRusRoHcal
Definition: StackingAction.h:90
TrackInformationExtractor
Definition: TrackInformationExtractor.h:20
StackingAction::killDeltaRay
bool killDeltaRay
Definition: StackingAction.h:50
StackingAction::regionMuonIron
const G4Region * regionMuonIron
Definition: StackingAction.h:78
StackingAction::regionWorld
const G4Region * regionWorld
Definition: StackingAction.h:81
StackingAction::lowdensRegions
std::vector< const G4Region * > lowdensRegions
Definition: StackingAction.h:66
StackingAction::numberTimes
unsigned int numberTimes
Definition: StackingAction.h:57
StackingAction::killInCaloEfH
bool killInCaloEfH
Definition: StackingAction.h:49
StackingAction::regionHcal
const G4Region * regionHcal
Definition: StackingAction.h:77
StackingAction::extractor
TrackInformationExtractor extractor
Definition: StackingAction.h:73
StackingAction::killInCalo
bool killInCalo
Definition: StackingAction.h:49
StackingAction::rrApplicable
bool rrApplicable(const G4Track *, const G4Track &) const
Definition: StackingAction.cc:418
StackingAction::trackerRegions
std::vector< const G4Region * > trackerRegions
Definition: StackingAction.h:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
StackingAction::PrepareNewEvent
void PrepareNewEvent() override
Definition: StackingAction.cc:330
StackingAction::caloRegions
std::vector< const G4Region * > caloRegions
Definition: StackingAction.h:65
StackingAction::limitEnergyForVacuum
double limitEnergyForVacuum
Definition: StackingAction.h:53
edm::ParameterSet
Definition: ParameterSet.h:36
StackingAction::nRusRoWorld
double nRusRoWorld
Definition: StackingAction.h:99
StackingAction::nRusRoEnerLim
double nRusRoEnerLim
Definition: StackingAction.h:85
StackingAction::saveFirstSecondary
bool saveFirstSecondary
Definition: StackingAction.h:47
StackingAction::gRusRoPreShower
double gRusRoPreShower
Definition: StackingAction.h:94
StackingAction::maxTimeNames
std::vector< std::string > maxTimeNames
Definition: StackingAction.h:59
StackingAction::savePDandCinTracker
bool savePDandCinTracker
Definition: StackingAction.h:46
StackingAction::initPointer
void initPointer()
Definition: StackingAction.cc:332
StackingAction::regionCastor
const G4Region * regionCastor
Definition: StackingAction.h:80
StackingAction::kmaxIon
double kmaxIon
Definition: StackingAction.h:54
StackingAction::gRusRoMuonIron
double gRusRoMuonIron
Definition: StackingAction.h:92
StackingAction::maxTrackTime
double maxTrackTime
Definition: StackingAction.h:56
StackingAction::maxTimeRegions
std::vector< const G4Region * > maxTimeRegions
Definition: StackingAction.h:62
StackingAction::kmaxGamma
double kmaxGamma
Definition: StackingAction.h:55
StackingAction::killExtra
bool killExtra
Definition: StackingAction.h:51
NewTrackAction
Definition: NewTrackAction.h:14
StackingAction::kmaxProton
double kmaxProton
Definition: StackingAction.h:54
StackingAction::maxTrackTimes
std::vector< double > maxTrackTimes
Definition: StackingAction.h:58
StackingAction::ClassifyNewTrack
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack) final
Definition: StackingAction.cc:167
StackingAction::nRusRoHcal
double nRusRoHcal
Definition: StackingAction.h:91
StackingAction::gRusRoEnerLim
double gRusRoEnerLim
Definition: StackingAction.h:84
StackingAction::trackAction
const TrackingAction * trackAction
Definition: StackingAction.h:70
StackingAction::regionEcal
const G4Region * regionEcal
Definition: StackingAction.h:76
ParameterSet.h
StackingAction::kmaxNeutron
double kmaxNeutron
Definition: StackingAction.h:54
StackingAction::printRegions
void printRegions(const std::vector< const G4Region * > &reg, const std::string &word) const
Definition: StackingAction.cc:448
TrackInformationExtractor.h
StackingAction::steppingVerbose
const CMSSteppingVerbose * steppingVerbose
Definition: StackingAction.h:71
StackingAction::trackNeutrino
bool trackNeutrino
Definition: StackingAction.h:50
StackingAction::nRRactive
bool nRRactive
Definition: StackingAction.h:102
StackingAction::isItOutOfTimeWindow
bool isItOutOfTimeWindow(const G4Region *, const G4Track *) const
Definition: StackingAction.cc:437