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, SimRunInterface *, SimTrackManager *)
 
void prepareForNewPrimary ()
 
const TrackContainertrackContainer () const
 
 ~EventAction ()
 

Public Attributes

SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
 
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
 

Private Attributes

bool m_debug
 
SimRunInterfacem_runInterface
 
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,
SimRunInterface rm,
SimTrackManager iManager 
)

Definition at line 15 of file EventAction.cc.

References edm::ParameterSet::getParameter(), m_trackManager, and SimTrackManager::setCollapsePrimaryVertices().

18  : m_runInterface(rm),
19  m_trackManager(iManager),
20  m_stopFile(p.getParameter<std::string>("StopFile")),
21  m_debug(p.getUntrackedParameter<bool>("debug",false))
22 {
23  m_trackManager->setCollapsePrimaryVertices(p.getParameter<bool>("CollapsePrimaryVertices"));
24 }
std::string m_stopFile
Definition: EventAction.h:52
SimRunInterface * m_runInterface
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 26 of file EventAction.cc.

26 {}

Member Function Documentation

void EventAction::abortEvent ( )

Definition at line 96 of file EventAction.cc.

References SimRunInterface::abortEvent(), and m_runInterface.

97 {
99 }
SimRunInterface * m_runInterface
Definition: EventAction.h:50
void EventAction::addTkCaloStateInfo ( uint32_t  t,
const std::pair< math::XYZVectorD, math::XYZTLorentzVectorD > &  p 
)

Definition at line 90 of file EventAction.cc.

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

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

92 {
94 }
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 85 of file EventAction.cc.

References SimTrackManager::addTrack(), and m_trackManager.

Referenced by TrackingAction::PostUserTrackingAction().

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

Definition at line 28 of file EventAction.cc.

References SimRunInterface::abortRun(), alignCSCRings::e, m_beginOfEventSignal, m_runInterface, m_stopFile, m_trackManager, and SimTrackManager::reset().

29 {
30  if (std::ifstream(m_stopFile.c_str()))
31  {
32  edm::LogWarning("SimG4CoreApplication")
33  << "BeginOfEventAction: termination signal received at event "
34  << anEvent->GetEventID();
35  /*
36  cout << "BeginOfEventAction: termination signal received at event "
37  << anEvent->GetEventID() << endl;
38  */
39  m_runInterface->abortRun(true);
40  }
41 
43  BeginOfEvent e(anEvent);
45 
46 }
std::string m_stopFile
Definition: EventAction.h:52
SimRunInterface * m_runInterface
Definition: EventAction.h:50
void abortRun(bool softAbort)
SimTrackManager * m_trackManager
Definition: EventAction.h:51
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:45
void EventAction::EndOfEventAction ( const G4Event *  evt)

Definition at line 48 of file EventAction.cc.

References SimRunInterface::abortRun(), SimTrackManager::cleanTkCaloStateInfoMap(), SimTrackManager::deleteTracks(), alignCSCRings::e, m_endOfEventSignal, m_runInterface, m_stopFile, m_trackManager, SimRunInterface::simEvent(), and SimTrackManager::storeTracks().

49 {
50  if (std::ifstream(m_stopFile.c_str()))
51  {
52  edm::LogWarning("SimG4CoreApplication")
53  << "EndOfEventAction: termination signal received at event "
54  << anEvent->GetEventID();
55  /*
56  cout << "EndOfEventAction: termination signal received at event "
57  << anEvent->GetEventID() << endl;
58  */
59  // soft abort run
60  m_runInterface->abortRun(true);
61  }
62  if (anEvent->GetNumberOfPrimaryVertex()==0)
63  {
64  edm::LogWarning("SimG4CoreApplication")
65  << "EndOfEventAction: event " << anEvent->GetEventID()
66  << " must have failed (no G4PrimaryVertices found) and will be skipped ";
67  /*
68  cout << " EndOfEventAction: event " << anEvent->GetEventID()
69  << " must have failed (no G4PrimaryVertices found) and will be skipped "
70  << endl;
71  */
72  return;
73  }
74 
76 
77  // dispatch now end of event, and only then delete tracks...
78  EndOfEvent e(anEvent);
80 
83 }
std::string m_stopFile
Definition: EventAction.h:52
SimRunInterface * m_runInterface
Definition: EventAction.h:50
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:46
G4SimEvent * simEvent()
void cleanTkCaloStateInfoMap()
void abortRun(bool softAbort)
void storeTracks(G4SimEvent *simEvent)
SimTrackManager * m_trackManager
Definition: EventAction.h:51
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(), RunManager::Connect(), and RunManagerMT::Connect().

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 RunManager::Connect(), RunManagerMT::Connect(), and EndOfEventAction().

SimRunInterface* EventAction::m_runInterface
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