File indexing completed on 2025-04-09 02:02:19
0001 #ifndef SimG4Core_Phase2EventAction_H
0002 #define SimG4Core_Phase2EventAction_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012
0013 #include "SimG4Core/Notification/interface/SimTrackManager.h"
0014 #include "SimG4Core/Notification/interface/TrackWithHistory.h"
0015 #include "SimG4Core/Notification/interface/TrackContainer.h"
0016 #include "SimG4Core/Notification/interface/SimActivityRegistry.h"
0017
0018 #include "G4UserEventAction.hh"
0019
0020 #include <vector>
0021 #include <string>
0022
0023 class SimRunInterface;
0024 class BeginOfEvent;
0025 class EndOfEvent;
0026 class CMSSteppingVerbose;
0027
0028 class Phase2EventAction : public G4UserEventAction {
0029 public:
0030 explicit Phase2EventAction(const edm::ParameterSet& ps, SimRunInterface*, SimTrackManager*, CMSSteppingVerbose*);
0031 ~Phase2EventAction() override = default;
0032
0033 void BeginOfEventAction(const G4Event* evt) override;
0034 void EndOfEventAction(const G4Event* evt) override;
0035
0036 void abortEvent();
0037
0038 const TrackContainer* trackContainer() const { return m_trackManager->trackContainer(); }
0039
0040 TrackWithHistory* getTrackByID(int id) const { return m_trackManager->getTrackByID(id); }
0041
0042 SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal;
0043 SimActivityRegistry::EndOfEventSignal m_endOfEventSignal;
0044
0045 Phase2EventAction(const Phase2EventAction&) = delete;
0046 const Phase2EventAction& operator=(const Phase2EventAction&) = delete;
0047
0048 private:
0049 SimRunInterface* m_runInterface;
0050 SimTrackManager* m_trackManager;
0051 CMSSteppingVerbose* m_SteppingVerbose;
0052 std::string m_stopFile;
0053 bool m_printRandom;
0054 bool m_debug;
0055 };
0056
0057 #endif