00001 #ifndef SimG4Core_EventAction_H 00002 #define SimG4Core_EventAction_H 00003 00004 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00005 00006 #include "SimG4Core/Application/interface/G4SimEvent.h" 00007 #include "SimG4Core/Application/interface/SimTrackManager.h" 00008 #include "SimG4Core/Notification/interface/TrackWithHistory.h" 00009 #include "SimG4Core/Notification/interface/TrackContainer.h" 00010 #include "SimG4Core/Notification/interface/SimActivityRegistry.h" 00011 00012 #include "G4UserEventAction.hh" 00013 00014 #include "CLHEP/Vector/LorentzVector.h" 00015 #include "CLHEP/Vector/ThreeVector.h" 00016 00017 #include <vector> 00018 #include <map> 00019 00020 class RunManager; 00021 class BeginOfEvent; 00022 class EndOfEvent; 00023 00024 class EventAction: public G4UserEventAction 00025 { 00026 public: 00027 //EventAction(const edm::ParameterSet & ps); 00028 EventAction(const edm::ParameterSet& ps, 00029 RunManager*, 00030 SimTrackManager*); 00031 ~EventAction(); 00032 // void SetRunManager( RunManager* rm ) { m_runManager = rm ; return ; } 00033 void BeginOfEventAction(const G4Event * evt); 00034 void EndOfEventAction(const G4Event * evt); 00035 00036 const TrackContainer * trackContainer() const { 00037 return m_trackManager->trackContainer(); 00038 } 00039 void addTrack(TrackWithHistory* iTrack, bool ); 00040 void addTkCaloStateInfo(uint32_t t,std::pair<math::XYZVectorD,math::XYZTLorentzVectorD> p); 00041 00042 SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal; 00043 SimActivityRegistry::EndOfEventSignal m_endOfEventSignal; 00044 00045 private: 00046 //does not own the manager 00047 RunManager* m_runManager; 00048 SimTrackManager* m_trackManager; 00049 std::string m_stopFile; 00050 bool m_debug; 00051 }; 00052 00053 #endif 00054 00055 00056