Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  master (f31105fd)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
precedence::StartTime Struct Reference

#include </builds/gaudi/Gaudi/GaudiHive/src/PRGraph/PrecedenceRulesGraph.h>

Collaboration diagram for precedence::StartTime:

Public Member Functions

 StartTime (const EventSlot &slot, SmartIF< ISvcLocator > &svcLocator)
 
std::string operator() (const AlgoProps &props) const
 
std::string operator() (const DecisionHubProps &) const
 
std::string operator() (const DataProps &) const
 

Public Attributes

const EventSlotm_slot
 
SmartIF< ITimelineSvcm_timelineSvc
 

Detailed Description

Definition at line 256 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ StartTime()

precedence::StartTime::StartTime ( const EventSlot slot,
SmartIF< ISvcLocator > &  svcLocator 
)
inline

Definition at line 257 of file PrecedenceRulesGraph.h.

257  : m_slot( slot ) {
259  MsgStream log{ msgSvc, "StartTime.Getter" };
260 
261  // Figure if we can discover the algorithm timings
262  m_timelineSvc = svcLocator->service<ITimelineSvc>( "TimelineSvc", false );
263  if ( !m_timelineSvc.isValid() ) {
264  log << MSG::WARNING << "Failed to locate the TimelineSvc: no way to "
265  << "add algorithm start time to the TTT dumps" << endmsg;
266  }
267  }

Member Function Documentation

◆ operator()() [1/3]

std::string precedence::StartTime::operator() ( const AlgoProps props) const
inline

Definition at line 269 of file PrecedenceRulesGraph.h.

269  {
270 
271  std::string startTime;
272 
273  if ( m_timelineSvc.isValid() ) {
274 
275  TimelineEvent te{};
276  te.algorithm = props.m_name;
277  te.slot = m_slot.eventContext->slot();
278  te.event = m_slot.eventContext->evt();
279 
280  m_timelineSvc->getTimelineEvent( te );
281  startTime = std::to_string(
282  std::chrono::duration_cast<std::chrono::nanoseconds>( te.start.time_since_epoch() ).count() );
283  }
284 
285  return startTime;
286  }

◆ operator()() [2/3]

std::string precedence::StartTime::operator() ( const DataProps ) const
inline

Definition at line 290 of file PrecedenceRulesGraph.h.

290 { return ""; }

◆ operator()() [3/3]

std::string precedence::StartTime::operator() ( const DecisionHubProps ) const
inline

Definition at line 288 of file PrecedenceRulesGraph.h.

288 { return ""; }

Member Data Documentation

◆ m_slot

const EventSlot& precedence::StartTime::m_slot

Definition at line 292 of file PrecedenceRulesGraph.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> precedence::StartTime::m_timelineSvc

Definition at line 293 of file PrecedenceRulesGraph.h.


The documentation for this struct was generated from the following file:
EventSlot::eventContext
std::unique_ptr< EventContext > eventContext
Cache for the eventContext.
Definition: EventSlot.h:83
std::string
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:28
check_ParticleID.props
props
Definition: check_ParticleID.py:21
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:80
TimelineEvent
Definition: ITimelineSvc.h:23
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
precedence::StartTime::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Definition: PrecedenceRulesGraph.h:293
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:72
ITimelineSvc
Definition: ITimelineSvc.h:37
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:51
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:98
std::to_string
T to_string(T... args)
SmartIF< IMessageSvc >
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
MsgStream
Definition: MsgStream.h:33
TimelineEvent::algorithm
std::string algorithm
Definition: ITimelineSvc.h:31
precedence::StartTime::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:292
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:50