The Gaudi Framework  master (37c0b60a)
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 195 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ EntityState()

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

Definition at line 196 of file PrecedenceRulesGraph.h.

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

Member Function Documentation

◆ operator()() [1/4]

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

Definition at line 222 of file PrecedenceRulesGraph.h.

222  {
223  std::ostringstream oss;
224  oss << m_slot.algsStates[props.m_algoIndex];
225  return oss.str();
226  }

◆ operator()() [2/4]

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

Definition at line 240 of file PrecedenceRulesGraph.h.

240  {
242 
243  if ( m_condSvc.isValid() && m_slot.eventContext->valid() )
244  state = m_condSvc->isValidID( *( m_slot.eventContext ), props.m_id ) ? "Produced" : "Missing";
245 
246  return state;
247  }

◆ operator()() [3/4]

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

Definition at line 230 of file PrecedenceRulesGraph.h.

230  {
232 
234  if ( m_whiteboard->selectStore( m_slot.eventContext->slot() ).isSuccess() )
235  state = m_whiteboard->exists( props.m_id ) ? "Produced" : "Missing";
236 
237  return state;
238  }

◆ operator()() [4/4]

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

Definition at line 228 of file PrecedenceRulesGraph.h.

228 { return ""; }

Member Data Documentation

◆ m_conditionsEnabled

bool precedence::EntityState::m_conditionsEnabled { false }

Definition at line 253 of file PrecedenceRulesGraph.h.

◆ m_condSvc

SmartIF<ICondSvc> precedence::EntityState::m_condSvc

Definition at line 252 of file PrecedenceRulesGraph.h.

◆ m_slot

const EventSlot& precedence::EntityState::m_slot

Definition at line 249 of file PrecedenceRulesGraph.h.

◆ m_whiteboard

SmartIF<IHiveWhiteBoard> precedence::EntityState::m_whiteboard

Definition at line 251 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:252
std::string
STL class.
Gaudi.Configuration.log
log
Definition: Configuration.py:28
precedence::EntityState::m_conditionsEnabled
bool m_conditionsEnabled
Definition: PrecedenceRulesGraph.h:253
check_ParticleID.props
props
Definition: check_ParticleID.py:21
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
IHiveWhiteBoard
Definition: IHiveWhiteBoard.h:27
precedence::EntityState::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Definition: PrecedenceRulesGraph.h:251
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:80
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:98
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
std::ostringstream
STL class.
std::ostringstream::str
T str(T... args)
compareRootHistos.state
state
Definition: compareRootHistos.py:496
precedence::EntityState::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:249
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:85