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

Member Function Documentation

◆ operator()() [1/4]

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

Definition at line 223 of file PrecedenceRulesGraph.h.

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

◆ operator()() [2/4]

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

Definition at line 241 of file PrecedenceRulesGraph.h.

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

◆ operator()() [3/4]

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

Definition at line 231 of file PrecedenceRulesGraph.h.

231  {
232  std::string state;
233 
234  if ( m_whiteboard.isValid() && m_slot.eventContext->valid() )
235  if ( m_whiteboard->selectStore( m_slot.eventContext->slot() ).isSuccess() )
236  state = m_whiteboard->exists( props.m_id ) ? "Produced" : "Missing";
237 
238  return state;
239  }

◆ operator()() [4/4]

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

Definition at line 229 of file PrecedenceRulesGraph.h.

229 { return ""; }

Member Data Documentation

◆ m_conditionsEnabled

bool precedence::EntityState::m_conditionsEnabled { false }

Definition at line 254 of file PrecedenceRulesGraph.h.

◆ m_condSvc

SmartIF<ICondSvc> precedence::EntityState::m_condSvc

Definition at line 253 of file PrecedenceRulesGraph.h.

◆ m_slot

const EventSlot& precedence::EntityState::m_slot

Definition at line 250 of file PrecedenceRulesGraph.h.

◆ m_whiteboard

SmartIF<IHiveWhiteBoard> precedence::EntityState::m_whiteboard

Definition at line 252 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:82
precedence::EntityState::m_condSvc
SmartIF< ICondSvc > m_condSvc
Definition: PrecedenceRulesGraph.h:253
Gaudi.Configuration.log
log
Definition: Configuration.py:28
precedence::EntityState::m_conditionsEnabled
bool m_conditionsEnabled
Definition: PrecedenceRulesGraph.h:254
check_ParticleID.props
props
Definition: check_ParticleID.py:21
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:22
IHiveWhiteBoard
Definition: IHiveWhiteBoard.h:23
precedence::EntityState::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Definition: PrecedenceRulesGraph.h:252
AvalancheSchedulerErrorTest.msgSvc
msgSvc
Definition: AvalancheSchedulerErrorTest.py:80
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
ISvcLocator::service
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:69
ICondSvc
Definition: ICondSvc.h:38
SmartIF< IMessageSvc >
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:198
MsgStream
Definition: MsgStream.h:29
compareRootHistos.state
state
Definition: compareRootHistos.py:496
precedence::EntityState::m_slot
const EventSlot & m_slot
Definition: PrecedenceRulesGraph.h:250
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:84