CMS 3D CMS Logo

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) override
 
void EndOfEventAction (const G4Event *evt) override
 
 EventAction (const edm::ParameterSet &ps, SimRunInterface *, SimTrackManager *, CMSSteppingVerbose *)
 
void prepareForNewPrimary ()
 
const TrackContainertrackContainer () const
 
 ~EventAction () override
 

Public Attributes

SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
 
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
 

Private Attributes

bool m_debug
 
bool m_printRandom
 
SimRunInterfacem_runInterface
 
CMSSteppingVerbosem_SteppingVerbose
 
std::string m_stopFile
 
SimTrackManagerm_trackManager
 

Detailed Description

Definition at line 26 of file EventAction.h.

Constructor & Destructor Documentation

EventAction::EventAction ( const edm::ParameterSet ps,
SimRunInterface rm,
SimTrackManager iManager,
CMSSteppingVerbose sv 
)
explicit

Definition at line 14 of file EventAction.cc.

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

18  : m_runInterface(rm),
19  m_trackManager(iManager),
21  m_stopFile(p.getParameter<std::string>("StopFile")),
22  m_printRandom(p.getParameter<bool>("PrintRandomSeed")),
23  m_debug(p.getUntrackedParameter<bool>("debug",false))
24 {
25  m_trackManager->setCollapsePrimaryVertices(p.getParameter<bool>("CollapsePrimaryVertices"));
26 }
std::string m_stopFile
Definition: EventAction.h:61
SimRunInterface * m_runInterface
Definition: EventAction.h:58
bool m_printRandom
Definition: EventAction.h:62
CMSSteppingVerbose * m_SteppingVerbose
Definition: EventAction.h:60
SimTrackManager * m_trackManager
Definition: EventAction.h:59
bool m_debug
Definition: EventAction.h:63
void setCollapsePrimaryVertices(bool iSet)
EventAction::~EventAction ( )
override

Definition at line 28 of file EventAction.cc.

28 {}

Member Function Documentation

void EventAction::abortEvent ( )

Definition at line 80 of file EventAction.cc.

References SimRunInterface::abortEvent(), and m_runInterface.

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

Definition at line 74 of file EventAction.cc.

References SimTrackManager::addTkCaloStateInfo(), and m_trackManager.

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

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

Definition at line 44 of file EventAction.h.

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

Referenced by TrackingAction::PostUserTrackingAction().

44  {
45  m_trackManager->addTrack(iTrack, inHistory, withAncestor);
46  }
void addTrack(TrackWithHistory *iTrack, bool inHistory, bool withAncestor)
SimTrackManager * m_trackManager
Definition: EventAction.h:59
void EventAction::BeginOfEventAction ( const G4Event *  evt)
override

Definition at line 30 of file EventAction.cc.

References CMSSteppingVerbose::BeginOfEvent(), MillePedeFileConverter_cfg::e, m_beginOfEventSignal, m_SteppingVerbose, m_trackManager, and SimTrackManager::reset().

31 {
33 
34  BeginOfEvent e(anEvent);
36 
37  if(nullptr != m_SteppingVerbose) { m_SteppingVerbose->BeginOfEvent(anEvent); }
38 }
CMSSteppingVerbose * m_SteppingVerbose
Definition: EventAction.h:60
void BeginOfEvent(const G4Event *)
SimTrackManager * m_trackManager
Definition: EventAction.h:59
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:53
void EventAction::EndOfEventAction ( const G4Event *  evt)
override

Definition at line 40 of file EventAction.cc.

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

41 {
42  if(m_printRandom)
43  {
44  edm::LogInfo("SimG4CoreApplication") << " Event " << anEvent->GetEventID()
45  << " Random number: " << G4UniformRand();
46  //CLHEP::HepRandom::showEngineStatus();
47  }
48  if (std::ifstream(m_stopFile.c_str()))
49  {
50  edm::LogWarning("SimG4CoreApplication")
51  << "EndOfEventAction: termination signal received at event "
52  << anEvent->GetEventID();
53  // soft abort run
54  m_runInterface->abortRun(true);
55  }
56  if (anEvent->GetNumberOfPrimaryVertex()==0)
57  {
58  edm::LogWarning("SimG4CoreApplication")
59  << "EndOfEventAction: event " << anEvent->GetEventID()
60  << " must have failed (no G4PrimaryVertices found) and will be skipped ";
61  return;
62  }
63 
65 
66  // dispatch now end of event, and only then delete tracks...
67  EndOfEvent e(anEvent);
69 
72 }
std::string m_stopFile
Definition: EventAction.h:61
SimRunInterface * m_runInterface
Definition: EventAction.h:58
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:54
bool m_printRandom
Definition: EventAction.h:62
G4SimEvent * simEvent()
void cleanTkCaloStateInfoMap()
void abortRun(bool softAbort)
void storeTracks(G4SimEvent *simEvent)
SimTrackManager * m_trackManager
Definition: EventAction.h:59
void EventAction::prepareForNewPrimary ( )
inline

Definition at line 51 of file EventAction.h.

References SimTrackManager::cleanTracksWithHistory(), and m_trackManager.

Referenced by TrackingAction::PreUserTrackingAction().

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

Definition at line 40 of file EventAction.h.

References m_trackManager, and SimTrackManager::trackContainer().

Referenced by TrackingAction::PostUserTrackingAction().

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

Member Data Documentation

SimActivityRegistry::BeginOfEventSignal EventAction::m_beginOfEventSignal
bool EventAction::m_debug
private

Definition at line 63 of file EventAction.h.

SimActivityRegistry::EndOfEventSignal EventAction::m_endOfEventSignal
bool EventAction::m_printRandom
private

Definition at line 62 of file EventAction.h.

Referenced by EndOfEventAction().

SimRunInterface* EventAction::m_runInterface
private

Definition at line 58 of file EventAction.h.

Referenced by abortEvent(), and EndOfEventAction().

CMSSteppingVerbose* EventAction::m_SteppingVerbose
private

Definition at line 60 of file EventAction.h.

Referenced by BeginOfEventAction().

std::string EventAction::m_stopFile
private

Definition at line 61 of file EventAction.h.

Referenced by EndOfEventAction().

SimTrackManager* EventAction::m_trackManager
private