File indexing completed on 2025-03-13 02:32:22
0001 #ifndef SimG4Core_TrackingAction_H
0002 #define SimG4Core_TrackingAction_H
0003
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "SimG4Core/Notification/interface/SimActivityRegistry.h"
0006
0007 #include "G4UserTrackingAction.hh"
0008 #include "G4Region.hh"
0009
0010 #include <vector>
0011
0012 class SimTrackManager;
0013 class CMSG4TrackInterface;
0014 class TrackWithHistory;
0015 class BeginOfTrack;
0016 class EndOfTrack;
0017 class CMSSteppingVerbose;
0018 class TrackInformation;
0019
0020 class TrackingAction : public G4UserTrackingAction {
0021 public:
0022 explicit TrackingAction(SimTrackManager*, CMSSteppingVerbose*, const edm::ParameterSet& ps);
0023 ~TrackingAction() override = default;
0024
0025 void PreUserTrackingAction(const G4Track* aTrack) override;
0026 void PostUserTrackingAction(const G4Track* aTrack) override;
0027
0028 inline TrackWithHistory* currentTrackWithHistory() { return currentTrack_; }
0029 inline const G4Track* geant4Track() const { return g4Track_; }
0030 inline G4TrackingManager* getTrackManager() { return fpTrackingManager; }
0031
0032 SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal;
0033 SimActivityRegistry::EndOfTrackSignal m_endOfTrackSignal;
0034
0035 TrackingAction(TrackingAction&) = delete;
0036 TrackingAction& operator=(const TrackingAction& right) = delete;
0037
0038 private:
0039 SimTrackManager* trackManager_;
0040 CMSG4TrackInterface* interface_;
0041 CMSSteppingVerbose* steppingVerbose_;
0042 const G4Track* g4Track_ = nullptr;
0043 TrackInformation* trkInfo_ = nullptr;
0044 TrackWithHistory* currentTrack_ = nullptr;
0045 int endPrintTrackID_;
0046 bool checkTrack_;
0047 bool doFineCalo_;
0048 bool saveCaloBoundaryInformation_;
0049 double ekinMin_;
0050 std::vector<double> ekinMinRegion_;
0051 std::vector<G4Region*> ptrRegion_;
0052 };
0053
0054 #endif