#include <SimG4Core/Application/interface/EventAction.h>
Public Member Functions | |
void | addTkCaloStateInfo (uint32_t t, std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > p) |
void | addTrack (TrackWithHistory *iTrack, bool) |
void | BeginOfEventAction (const G4Event *evt) |
void | EndOfEventAction (const G4Event *evt) |
EventAction (const edm::ParameterSet &ps, RunManager *, SimTrackManager *) | |
const TrackContainer * | trackContainer () const |
~EventAction () | |
Public Attributes | |
SimActivityRegistry::BeginOfEventSignal | m_beginOfEventSignal |
SimActivityRegistry::EndOfEventSignal | m_endOfEventSignal |
Private Attributes | |
bool | m_debug |
RunManager * | m_runManager |
std::string | m_stopFile |
SimTrackManager * | m_trackManager |
Definition at line 24 of file EventAction.h.
EventAction::EventAction | ( | const edm::ParameterSet & | ps, | |
RunManager * | rm, | |||
SimTrackManager * | iManager | |||
) |
Definition at line 13 of file EventAction.cc.
References edm::ParameterSet::getParameter(), m_trackManager, and SimTrackManager::setCollapsePrimaryVertices().
00016 : m_runManager(rm), 00017 m_trackManager(iManager), 00018 m_stopFile(p.getParameter<std::string>("StopFile")), 00019 m_debug(p.getUntrackedParameter<bool>("debug",false)) 00020 { 00021 m_trackManager->setCollapsePrimaryVertices(p.getParameter<bool>("CollapsePrimaryVertices")); 00022 }
EventAction::~EventAction | ( | ) |
void EventAction::addTkCaloStateInfo | ( | uint32_t | t, | |
std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > | p | |||
) |
Definition at line 73 of file EventAction.cc.
References SimTrackManager::addTkCaloStateInfo(), and m_trackManager.
Referenced by TrackingAction::PostUserTrackingAction(), and SteppingAction::UserSteppingAction().
00074 { 00075 m_trackManager->addTkCaloStateInfo(t,p); 00076 }
void EventAction::addTrack | ( | TrackWithHistory * | iTrack, | |
bool | inHistory | |||
) |
Definition at line 68 of file EventAction.cc.
References SimTrackManager::addTrack(), and m_trackManager.
Referenced by TrackingAction::PostUserTrackingAction().
00069 { 00070 m_trackManager->addTrack(iTrack, inHistory); 00071 }
void EventAction::BeginOfEventAction | ( | const G4Event * | evt | ) |
Definition at line 26 of file EventAction.cc.
References RunManager::abortRun(), GenMuonPlsPt100GeV_cfg::cout, e, lat::endl(), m_beginOfEventSignal, m_runManager, m_stopFile, m_trackManager, and SimTrackManager::reset().
00027 { 00028 if (std::ifstream(m_stopFile.c_str())) 00029 { 00030 cout << "BeginOfEventAction: termination signal received at event " 00031 << anEvent->GetEventID() << endl; 00032 //RunManager::instance()->abortRun(true); 00033 m_runManager->abortRun(true); 00034 } 00035 00036 m_trackManager->reset(); 00037 BeginOfEvent e(anEvent); 00038 m_beginOfEventSignal(&e); 00039 }
void EventAction::EndOfEventAction | ( | const G4Event * | evt | ) |
Definition at line 41 of file EventAction.cc.
References RunManager::abortRun(), SimTrackManager::cleanTkCaloStateInfoMap(), GenMuonPlsPt100GeV_cfg::cout, SimTrackManager::deleteTracks(), e, lat::endl(), m_endOfEventSignal, m_runManager, m_stopFile, m_trackManager, RunManager::simEvent(), and SimTrackManager::storeTracks().
00042 { 00043 if (std::ifstream(m_stopFile.c_str())) 00044 { 00045 cout << "EndOfEventAction: termination signal received at event " 00046 << anEvent->GetEventID() << endl; 00047 //RunManager::instance()->abortRun(true); 00048 m_runManager->abortRun(this); 00049 } 00050 if (anEvent->GetNumberOfPrimaryVertex()==0) 00051 { 00052 cout << " EndOfEventAction: event " << anEvent->GetEventID() 00053 << " must have failed (no G4PrimaryVertices found) and will be skipped " << endl; 00054 return; 00055 } 00056 00057 // m_trackManager->storeTracks(RunManager::instance()->simEvent()); 00058 m_trackManager->storeTracks(m_runManager->simEvent()); 00059 // dispatch now end of event, and only then delete tracks... 00060 EndOfEvent e(anEvent); 00061 m_endOfEventSignal(&e); 00062 00063 m_trackManager->deleteTracks(); 00064 m_trackManager->cleanTkCaloStateInfoMap(); 00065 00066 }
const TrackContainer* EventAction::trackContainer | ( | ) | const [inline] |
Definition at line 36 of file EventAction.h.
References m_trackManager, and SimTrackManager::trackContainer().
Referenced by TrackingAction::PostUserTrackingAction().
00036 { 00037 return m_trackManager->trackContainer(); 00038 }
Definition at line 42 of file EventAction.h.
Referenced by BeginOfEventAction(), and RunManager::initializeUserActions().
bool EventAction::m_debug [private] |
Definition at line 50 of file EventAction.h.
Definition at line 43 of file EventAction.h.
Referenced by EndOfEventAction(), and RunManager::initializeUserActions().
RunManager* EventAction::m_runManager [private] |
Definition at line 47 of file EventAction.h.
Referenced by BeginOfEventAction(), and EndOfEventAction().
std::string EventAction::m_stopFile [private] |
Definition at line 49 of file EventAction.h.
Referenced by BeginOfEventAction(), and EndOfEventAction().
SimTrackManager* EventAction::m_trackManager [private] |
Definition at line 48 of file EventAction.h.
Referenced by addTkCaloStateInfo(), addTrack(), BeginOfEventAction(), EndOfEventAction(), EventAction(), and trackContainer().