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