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 addTkCaloStateInfo (uint32_t t, 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:50
RunManager * m_runManager
Definition: EventAction.h:48
SimTrackManager * m_trackManager
Definition: EventAction.h:49
bool m_debug
Definition: EventAction.h:51
void setCollapsePrimaryVertices(bool iSet)
EventAction::~EventAction ( )

Definition at line 24 of file EventAction.cc.

24 {}

Member Function Documentation

void EventAction::addTkCaloStateInfo ( uint32_t  t,
std::pair< math::XYZVectorD, math::XYZTLorentzVectorD p 
)

Definition at line 74 of file EventAction.cc.

References SimTrackManager::addTkCaloStateInfo(), and m_trackManager.

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

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

Definition at line 69 of file EventAction.cc.

References SimTrackManager::addTrack(), and m_trackManager.

Referenced by TrackingAction::PostUserTrackingAction().

70 {
71  m_trackManager->addTrack(iTrack, inHistory, withAncestor);
72 }
void addTrack(TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
SimTrackManager * m_trackManager
Definition: EventAction.h:49
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:50
RunManager * m_runManager
Definition: EventAction.h:48
void abortRun(bool softAbort=false)
Definition: RunManager.cc:470
SimTrackManager * m_trackManager
Definition: EventAction.h:49
tuple cout
Definition: gather_cfg.py:121
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:43
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  //RunManager::instance()->abortRun(true);
49  m_runManager->abortRun(this);
50  }
51  if (anEvent->GetNumberOfPrimaryVertex()==0)
52  {
53  cout << " EndOfEventAction: event " << anEvent->GetEventID()
54  << " must have failed (no G4PrimaryVertices found) and will be skipped " << endl;
55  return;
56  }
57 
58  // m_trackManager->storeTracks(RunManager::instance()->simEvent());
60  // dispatch now end of event, and only then delete tracks...
61  EndOfEvent e(anEvent);
63 
66 
67 }
std::string m_stopFile
Definition: EventAction.h:50
RunManager * m_runManager
Definition: EventAction.h:48
void abortRun(bool softAbort=false)
Definition: RunManager.cc:470
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:44
void cleanTkCaloStateInfoMap()
void storeTracks(G4SimEvent *simEvent)
SimTrackManager * m_trackManager
Definition: EventAction.h:49
G4SimEvent * simEvent()
Definition: RunManager.h:69
tuple cout
Definition: gather_cfg.py:121
void EventAction::prepareForNewPrimary ( )
inline

Definition at line 41 of file EventAction.h.

References SimTrackManager::cleanTracksWithHistory(), and m_trackManager.

Referenced by TrackingAction::PreUserTrackingAction().

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

Definition at line 36 of file EventAction.h.

References m_trackManager, and SimTrackManager::trackContainer().

Referenced by TrackingAction::PostUserTrackingAction().

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

Member Data Documentation

SimActivityRegistry::BeginOfEventSignal EventAction::m_beginOfEventSignal

Definition at line 43 of file EventAction.h.

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

bool EventAction::m_debug
private

Definition at line 51 of file EventAction.h.

SimActivityRegistry::EndOfEventSignal EventAction::m_endOfEventSignal

Definition at line 44 of file EventAction.h.

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

RunManager* EventAction::m_runManager
private

Definition at line 48 of file EventAction.h.

Referenced by BeginOfEventAction(), and EndOfEventAction().

std::string EventAction::m_stopFile
private

Definition at line 50 of file EventAction.h.

Referenced by BeginOfEventAction(), and EndOfEventAction().

SimTrackManager* EventAction::m_trackManager
private