CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
EventAction Class Reference

#include <EventAction.h>

Inheritance diagram for EventAction:

Public Member Functions

void abortEvent ()
 
void addTkCaloStateInfo (uint32_t t, const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &p)
 
void addTrack (TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
 
void BeginOfEventAction (const G4Event *evt)
 
void EndOfEventAction (const G4Event *evt)
 
 EventAction (const edm::ParameterSet &ps, RunManager *, SimTrackManager *)
 
void prepareForNewPrimary ()
 
const TrackContainertrackContainer () const
 
 ~EventAction ()
 

Public Attributes

SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
 
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
 

Private Attributes

bool m_debug
 
RunManagerm_runManager
 
std::string m_stopFile
 
SimTrackManagerm_trackManager
 

Detailed Description

Definition at line 24 of file EventAction.h.

Constructor & Destructor Documentation

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().

16  : m_runManager(rm),
17  m_trackManager(iManager),
18  m_stopFile(p.getParameter<std::string>("StopFile")),
19  m_debug(p.getUntrackedParameter<bool>("debug",false))
20 {
21  m_trackManager->setCollapsePrimaryVertices(p.getParameter<bool>("CollapsePrimaryVertices"));
22 }
std::string m_stopFile
Definition: EventAction.h:52
RunManager * m_runManager
Definition: EventAction.h:50
SimTrackManager * m_trackManager
Definition: EventAction.h:51
bool m_debug
Definition: EventAction.h:53
void setCollapsePrimaryVertices(bool iSet)
EventAction::~EventAction ( )

Definition at line 24 of file EventAction.cc.

24 {}

Member Function Documentation

void EventAction::abortEvent ( )

Definition at line 81 of file EventAction.cc.

References RunManager::abortEvent(), and m_runManager.

82 {
84 }
RunManager * m_runManager
Definition: EventAction.h:50
void abortEvent()
Definition: RunManager.cc:367
void EventAction::addTkCaloStateInfo ( uint32_t  t,
const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &  p 
)

Definition at line 75 of file EventAction.cc.

References SimTrackManager::addTkCaloStateInfo(), m_trackManager, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by TrackingAction::PostUserTrackingAction(), and SteppingAction::UserSteppingAction().

77 {
79 }
void addTkCaloStateInfo(uint32_t t, const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &p)
SimTrackManager * m_trackManager
Definition: EventAction.h:51
void EventAction::addTrack ( TrackWithHistory iTrack,
bool  inHistory,
bool  withAncestor 
)

Definition at line 70 of file EventAction.cc.

References SimTrackManager::addTrack(), and m_trackManager.

Referenced by TrackingAction::PostUserTrackingAction().

71 {
72  m_trackManager->addTrack(iTrack, inHistory, withAncestor);
73 }
void addTrack(TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
SimTrackManager * m_trackManager
Definition: EventAction.h:51
void EventAction::BeginOfEventAction ( const G4Event *  evt)

Definition at line 26 of file EventAction.cc.

References RunManager::abortRun(), gather_cfg::cout, alignCSCRings::e, m_beginOfEventSignal, m_runManager, m_stopFile, m_trackManager, and SimTrackManager::reset().

27 {
28  if (std::ifstream(m_stopFile.c_str()))
29  {
30  cout << "BeginOfEventAction: termination signal received at event "
31  << anEvent->GetEventID() << endl;
32  //RunManager::instance()->abortRun(true);
33  m_runManager->abortRun(true);
34  }
35 
37  BeginOfEvent e(anEvent);
39 
40 }
std::string m_stopFile
Definition: EventAction.h:52
RunManager * m_runManager
Definition: EventAction.h:50
void abortRun(bool softAbort=false)
Definition: RunManager.cc:469
SimTrackManager * m_trackManager
Definition: EventAction.h:51
tuple cout
Definition: gather_cfg.py:121
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:45
void EventAction::EndOfEventAction ( const G4Event *  evt)

Definition at line 42 of file EventAction.cc.

References RunManager::abortRun(), SimTrackManager::cleanTkCaloStateInfoMap(), gather_cfg::cout, SimTrackManager::deleteTracks(), alignCSCRings::e, m_endOfEventSignal, m_runManager, m_stopFile, m_trackManager, RunManager::simEvent(), and SimTrackManager::storeTracks().

43 {
44  if (std::ifstream(m_stopFile.c_str()))
45  {
46  cout << "EndOfEventAction: termination signal received at event "
47  << anEvent->GetEventID() << endl;
48  // soft abort run
49  m_runManager->abortRun(true);
50  }
51  if (anEvent->GetNumberOfPrimaryVertex()==0)
52  {
53  cout << " EndOfEventAction: event " << anEvent->GetEventID()
54  << " must have failed (no G4PrimaryVertices found) and will be skipped "
55  << endl;
56  return;
57  }
58 
59  // m_trackManager->storeTracks(RunManager::instance()->simEvent());
61  // dispatch now end of event, and only then delete tracks...
62  EndOfEvent e(anEvent);
64 
67 
68 }
std::string m_stopFile
Definition: EventAction.h:52
RunManager * m_runManager
Definition: EventAction.h:50
void abortRun(bool softAbort=false)
Definition: RunManager.cc:469
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:46
void cleanTkCaloStateInfoMap()
void storeTracks(G4SimEvent *simEvent)
SimTrackManager * m_trackManager
Definition: EventAction.h:51
G4SimEvent * simEvent()
Definition: RunManager.h:69
tuple cout
Definition: gather_cfg.py:121
void EventAction::prepareForNewPrimary ( )
inline

Definition at line 43 of file EventAction.h.

References SimTrackManager::cleanTracksWithHistory(), and m_trackManager.

Referenced by TrackingAction::PreUserTrackingAction().

void cleanTracksWithHistory()
SimTrackManager * m_trackManager
Definition: EventAction.h:51
const TrackContainer* EventAction::trackContainer ( ) const
inline

Definition at line 38 of file EventAction.h.

References m_trackManager, and SimTrackManager::trackContainer().

Referenced by TrackingAction::PostUserTrackingAction().

38  {
40  }
const TrackContainer * trackContainer() const
SimTrackManager * m_trackManager
Definition: EventAction.h:51

Member Data Documentation

SimActivityRegistry::BeginOfEventSignal EventAction::m_beginOfEventSignal

Definition at line 45 of file EventAction.h.

Referenced by BeginOfEventAction(), and RunManager::initializeUserActions().

bool EventAction::m_debug
private

Definition at line 53 of file EventAction.h.

SimActivityRegistry::EndOfEventSignal EventAction::m_endOfEventSignal

Definition at line 46 of file EventAction.h.

Referenced by EndOfEventAction(), and RunManager::initializeUserActions().

RunManager* EventAction::m_runManager
private

Definition at line 50 of file EventAction.h.

Referenced by abortEvent(), BeginOfEventAction(), and EndOfEventAction().

std::string EventAction::m_stopFile
private

Definition at line 52 of file EventAction.h.

Referenced by BeginOfEventAction(), and EndOfEventAction().

SimTrackManager* EventAction::m_trackManager
private