CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EventAction.h
Go to the documentation of this file.
1 #ifndef SimG4Core_EventAction_H
2 #define SimG4Core_EventAction_H
3 
5 
11 
12 #include "G4UserEventAction.hh"
13 
14 #include <vector>
15 #include <map>
16 #include <string>
17 
18 class SimRunInterface;
19 class BeginOfEvent;
20 class EndOfEvent;
21 class CMSSteppingVerbose;
22 
23 class EventAction : public G4UserEventAction {
24 public:
26  ~EventAction() override;
27 
28  void BeginOfEventAction(const G4Event* evt) override;
29  void EndOfEventAction(const G4Event* evt) override;
30 
31  void abortEvent();
32 
33  inline const TrackContainer* trackContainer() const { return m_trackManager->trackContainer(); }
34 
35  inline void addTrack(TrackWithHistory* iTrack, bool inHistory, bool withAncestor) {
36  m_trackManager->addTrack(iTrack, inHistory, withAncestor);
37  }
38 
39  bool trackExists(unsigned int id) const { return m_trackManager->trackExists(id); }
40  TrackWithHistory* getTrackByID(unsigned int id) const { return m_trackManager->getTrackByID(id); }
41 
42  void addTkCaloStateInfo(uint32_t t, const std::pair<math::XYZVectorD, math::XYZTLorentzVectorD>& p);
43 
45 
48 
49 private:
55  bool m_debug;
56 };
57 
58 #endif
void addTrack(TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
std::string m_stopFile
Definition: EventAction.h:53
SimRunInterface * m_runInterface
Definition: EventAction.h:50
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:47
bool m_printRandom
Definition: EventAction.h:54
void BeginOfEventAction(const G4Event *evt) override
Definition: EventAction.cc:29
void prepareForNewPrimary()
Definition: EventAction.h:44
const TrackContainer * trackContainer() const
TrackWithHistory * getTrackByID(unsigned int id) const
Definition: EventAction.h:40
std::vector< TrackWithHistory * > TrackContainer
Definition: TrackContainer.h:8
TrackWithHistory * getTrackByID(unsigned int trackID, bool strict=false) const
bool trackExists(unsigned int i) const
CMSSteppingVerbose * m_SteppingVerbose
Definition: EventAction.h:52
void cleanTracksWithHistory()
bool trackExists(unsigned int id) const
Definition: EventAction.h:39
const TrackContainer * trackContainer() const
Definition: EventAction.h:33
void EndOfEventAction(const G4Event *evt) override
Definition: EventAction.cc:45
SimTrackManager * m_trackManager
Definition: EventAction.h:51
EventAction(const edm::ParameterSet &ps, SimRunInterface *, SimTrackManager *, CMSSteppingVerbose *)
Definition: EventAction.cc:14
bool m_debug
Definition: EventAction.h:55
void addTkCaloStateInfo(uint32_t t, const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &p)
Definition: EventAction.cc:72
void abortEvent()
Definition: EventAction.cc:76
void addTrack(TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
Definition: EventAction.h:35
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:46
~EventAction() override
Definition: EventAction.cc:27