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 double&) 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;
59  unsigned int numberTimes;
60  std::vector<double> maxTrackTimes;
61  std::vector<std::string> maxTimeNames;
62  std::vector<std::string> deadRegionNames;
63 
64  std::vector<const G4Region*> maxTimeRegions;
65  std::vector<const G4Region*> trackerRegions;
66  std::vector<const G4Region*> muonRegions;
67  std::vector<const G4Region*> caloRegions;
68  std::vector<const G4Region*> lowdensRegions;
69  std::vector<const G4Region*> deadRegions;
70 
71  G4VSolid* worldSolid;
76 
77  // Russian roulette regions
78  const G4Region* regionEcal;
79  const G4Region* regionHcal;
80  const G4Region* regionMuonIron;
81  const G4Region* regionPreShower;
82  const G4Region* regionCastor;
83  const G4Region* regionWorld;
84 
85  // Russian roulette energy limits
86  double gRusRoEnerLim;
87  double nRusRoEnerLim;
88 
89  // Russian roulette factors
90  double gRusRoEcal;
91  double nRusRoEcal;
92  double gRusRoHcal;
93  double nRusRoHcal;
98  double gRusRoCastor;
99  double nRusRoCastor;
100  double gRusRoWorld;
101  double nRusRoWorld;
102  // flags
103  bool gRRactive;
104  bool nRRactive;
105 };
106 
107 #endif
StackingAction::killGamma
bool killGamma
Definition: StackingAction.h:52
StackingAction::isItPrimaryDecayProductOrConversion
int isItPrimaryDecayProductOrConversion(const G4Track *, const G4Track &) const
Definition: StackingAction.cc:421
StackingAction::nRusRoMuonIron
double nRusRoMuonIron
Definition: StackingAction.h:95
StackingAction::worldSolid
G4VSolid * worldSolid
Definition: StackingAction.h:71
StackingAction::deadRegions
std::vector< const G4Region * > deadRegions
Definition: StackingAction.h:69
StackingAction::deadRegionNames
std::vector< std::string > deadRegionNames
Definition: StackingAction.h:62
StackingAction::StackingAction
StackingAction(const TrackingAction *, const edm::ParameterSet &ps, const CMSSteppingVerbose *)
Definition: StackingAction.cc:18
StackingAction::savePDandCinMuon
bool savePDandCinMuon
Definition: StackingAction.h:47
StackingAction::maxZCentralCMS
double maxZCentralCMS
Definition: StackingAction.h:58
StackingAction::nRusRoEcal
double nRusRoEcal
Definition: StackingAction.h:91
StackingAction::killHeavy
bool killHeavy
Definition: StackingAction.h:50
StackingAction::gRRactive
bool gRRactive
Definition: StackingAction.h:103
StackingAction::nRusRoPreShower
double nRusRoPreShower
Definition: StackingAction.h:97
StackingAction::savePDandCinCalo
bool savePDandCinCalo
Definition: StackingAction.h:46
StackingAction::gRusRoWorld
double gRusRoWorld
Definition: StackingAction.h:100
StackingAction::nRusRoCastor
double nRusRoCastor
Definition: StackingAction.h:99
StackingAction::~StackingAction
~StackingAction() override
Definition: StackingAction.cc:169
StackingAction
Definition: StackingAction.h:19
CMSSteppingVerbose
Definition: CMSSteppingVerbose.h:25
StackingAction::newTA
NewTrackAction * newTA
Definition: StackingAction.h:74
StackingAction::savePDandCinAll
bool savePDandCinAll
Definition: StackingAction.h:48
StackingAction::isItOutOfTimeWindow
bool isItOutOfTimeWindow(const G4Region *, const double &) const
Definition: StackingAction.cc:454
StackingAction::maxTrackTimeForward
double maxTrackTimeForward
Definition: StackingAction.h:57
StackingAction::muonRegions
std::vector< const G4Region * > muonRegions
Definition: StackingAction.h:66
StackingAction::gRusRoEcal
double gRusRoEcal
Definition: StackingAction.h:90
StackingAction::NewStage
void NewStage() override
Definition: StackingAction.cc:344
StackingAction::gRusRoCastor
double gRusRoCastor
Definition: StackingAction.h:98
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
StackingAction::regionPreShower
const G4Region * regionPreShower
Definition: StackingAction.h:81
StackingAction::isThisRegion
bool isThisRegion(const G4Region *, std::vector< const G4Region * > &) const
Definition: StackingAction.cc:410
TrackingAction
Definition: TrackingAction.h:16
StackingAction::isItFromPrimary
int isItFromPrimary(const G4Track &, int) const
Definition: StackingAction.cc:443
StackingAction::gRusRoHcal
double gRusRoHcal
Definition: StackingAction.h:92
TrackInformationExtractor
Definition: TrackInformationExtractor.h:20
StackingAction::killDeltaRay
bool killDeltaRay
Definition: StackingAction.h:50
StackingAction::regionMuonIron
const G4Region * regionMuonIron
Definition: StackingAction.h:80
StackingAction::regionWorld
const G4Region * regionWorld
Definition: StackingAction.h:83
StackingAction::lowdensRegions
std::vector< const G4Region * > lowdensRegions
Definition: StackingAction.h:68
StackingAction::numberTimes
unsigned int numberTimes
Definition: StackingAction.h:59
StackingAction::killInCaloEfH
bool killInCaloEfH
Definition: StackingAction.h:49
StackingAction::regionHcal
const G4Region * regionHcal
Definition: StackingAction.h:79
StackingAction::extractor
TrackInformationExtractor extractor
Definition: StackingAction.h:75
StackingAction::killInCalo
bool killInCalo
Definition: StackingAction.h:49
StackingAction::rrApplicable
bool rrApplicable(const G4Track *, const G4Track &) const
Definition: StackingAction.cc:435
StackingAction::trackerRegions
std::vector< const G4Region * > trackerRegions
Definition: StackingAction.h:65
StackingAction::PrepareNewEvent
void PrepareNewEvent() override
Definition: StackingAction.cc:346
StackingAction::caloRegions
std::vector< const G4Region * > caloRegions
Definition: StackingAction.h:67
StackingAction::limitEnergyForVacuum
double limitEnergyForVacuum
Definition: StackingAction.h:53
edm::ParameterSet
Definition: ParameterSet.h:47
StackingAction::nRusRoWorld
double nRusRoWorld
Definition: StackingAction.h:101
StackingAction::nRusRoEnerLim
double nRusRoEnerLim
Definition: StackingAction.h:87
StackingAction::saveFirstSecondary
bool saveFirstSecondary
Definition: StackingAction.h:47
StackingAction::gRusRoPreShower
double gRusRoPreShower
Definition: StackingAction.h:96
StackingAction::maxTimeNames
std::vector< std::string > maxTimeNames
Definition: StackingAction.h:61
StackingAction::savePDandCinTracker
bool savePDandCinTracker
Definition: StackingAction.h:46
StackingAction::initPointer
void initPointer()
Definition: StackingAction.cc:348
StackingAction::regionCastor
const G4Region * regionCastor
Definition: StackingAction.h:82
StackingAction::kmaxIon
double kmaxIon
Definition: StackingAction.h:54
StackingAction::gRusRoMuonIron
double gRusRoMuonIron
Definition: StackingAction.h:94
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
StackingAction::maxTrackTime
double maxTrackTime
Definition: StackingAction.h:56
StackingAction::maxTimeRegions
std::vector< const G4Region * > maxTimeRegions
Definition: StackingAction.h:64
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:60
StackingAction::ClassifyNewTrack
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track *aTrack) final
Definition: StackingAction.cc:171
StackingAction::nRusRoHcal
double nRusRoHcal
Definition: StackingAction.h:93
StackingAction::gRusRoEnerLim
double gRusRoEnerLim
Definition: StackingAction.h:86
StackingAction::trackAction
const TrackingAction * trackAction
Definition: StackingAction.h:72
StackingAction::regionEcal
const G4Region * regionEcal
Definition: StackingAction.h:78
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:465
TrackInformationExtractor.h
StackingAction::steppingVerbose
const CMSSteppingVerbose * steppingVerbose
Definition: StackingAction.h:73
StackingAction::trackNeutrino
bool trackNeutrino
Definition: StackingAction.h:50
StackingAction::nRRactive
bool nRRactive
Definition: StackingAction.h:104