The Gaudi Framework  v38r0 (2143aa4c)
precedence::EntityState Struct Reference

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

Collaboration diagram for precedence::EntityState:

Public Member Functions

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

Public Attributes

const EventSlotm_slot
 
SmartIF< IHiveWhiteBoardm_whiteboard
 
SmartIF< ICondSvcm_condSvc
 
bool m_conditionsEnabled { false }
 

Detailed Description

Definition at line 200 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ EntityState()

precedence::EntityState::EntityState ( const EventSlot slot,
SmartIF< ISvcLocator > &  svcLocator,
bool  conditionsEnabled 
)
inline

Definition at line 201 of file PrecedenceRulesGraph.h.

202  : m_slot( slot ), m_conditionsEnabled( conditionsEnabled ) {
204  MsgStream log{ msgSvc, "EntityState.Getter" };
205 
206  // Figure if we can discover the data object states
207  m_whiteboard = svcLocator->service<IHiveWhiteBoard>( "EventDataSvc", false );
208  if ( !m_whiteboard.isValid() ) {
209  log << MSG::WARNING << "Failed to locate EventDataSvc: no way to add DO "
210  << "states to the TTT dump " << endmsg;
211  }
212 
213  if ( m_conditionsEnabled ) {
214  // Figure if we can discover Condition data object states
215  m_condSvc = svcLocator->service<ICondSvc>( "CondSvc", false );
216  if ( !m_condSvc.isValid() )
217  log << MSG::WARNING << "Failed to locate CondSvc: no way to add Condition DO "
218  << "states to the TTT dump " << endmsg;
219  }
220 
221  if ( !m_slot.eventContext->valid() )
222  log << MSG::WARNING << "Event context is invalid: no way to add DO states"
223  << " in the TTT dump" << endmsg;
224  }

Member Function Documentation

◆ operator()() [1/4]

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

Definition at line 227 of file PrecedenceRulesGraph.h.

227  {
228  std::ostringstream oss;
229  oss << m_slot.algsStates[props.m_algoIndex];
230  return oss.str();
231  }

◆ operator()() [2/4]

std::string precedence::EntityState::operator() ( const CondDataProps props) const
inline

Definition at line 245 of file PrecedenceRulesGraph.h.

245  {
247 
248  if ( m_condSvc.isValid() && m_slot.eventContext->valid() )
249  state = m_condSvc->isValidID( *( m_slot.eventContext ), props.m_id ) ? "Produced" : "Missing";
250 
251  return state;
252  }

◆ operator()() [3/4]

std::string precedence::EntityState::operator() ( const DataProps props) const
inline

Definition at line 235 of file PrecedenceRulesGraph.h.

235  {
237 
239  if ( m_whiteboard->selectStore( m_slot.eventContext->slot() ).isSuccess() )
240  state = m_whiteboard->exists( props.m_id ) ? "Produced" : "Missing";
241 
242  return state;
243  }

◆ operator()() [4/4]

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

Definition at line 233 of file PrecedenceRulesGraph.h.

233 { return ""; }

Member Data Documentation

◆ m_conditionsEnabled

bool precedence::EntityState::m_conditionsEnabled { false }

Definition at line 258 of file PrecedenceRulesGraph.h.

◆ m_condSvc

SmartIF<ICondSvc> precedence::EntityState::m_condSvc

Definition at line 257 of file PrecedenceRulesGraph.h.

◆ m_slot

const EventSlot& precedence::EntityState::m_slot

Definition at line 254 of file PrecedenceRulesGraph.h.

◆ m_whiteboard

SmartIF<IHiveWhiteBoard> precedence::EntityState::m_whiteboard

Definition at line 256 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
EventContext::valid
bool valid() const
Definition: EventContext.h:54
precedence::EntityState::m_condSvc
SmartIF< ICondSvc > m_condSvc
Definition: PrecedenceRulesGraph.h:257
std::string
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:29
precedence::EntityState::m_conditionsEnabled
bool m_conditionsEnabled
Definition: PrecedenceRulesGraph.h:258
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
IHiveWhiteBoard
Definition: IHiveWhiteBoard.h:27
precedence::EntityState::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Definition: PrecedenceRulesGraph.h:256
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:72
ICondSvc
Definition: ICondSvc.h:39
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:97
SmartIF< IMessageSvc >
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
MsgStream
Definition: MsgStream.h:34
std::ostringstream
STL class.
ProduceConsume.props
props
Definition: ProduceConsume.py:84
std::ostringstream::str
T str(T... args)
AsyncIncidents.msgSvc
msgSvc
Definition: AsyncIncidents.py:34
compareRootHistos.state
state
Definition: compareRootHistos.py:496
precedence::EntityState::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:254
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:85