11#ifndef XAOD_STANDALONE
12# include "GaudiKernel/IIncidentSvc.h"
24 template<
typename T >
25 MsgStream&
operator<< ( MsgStream& out,
const std::vector< T >&
vec ) {
28 for(
size_t i = 0;
i <
vec.size(); ++
i ) {
30 if( i <
vec.size() - 1 ) {
44 TrigConfBunchCrossingTool::
45 TrigConfBunchCrossingTool(
const std::string& name )
47#ifndef XAOD_STANDALONE
48 m_configSvc(
"TrigConf::xAODConfigSvc/xAODConfigSvc",
name ),
50 m_configTool(
"TrigConf::xAODConfigTool" ) {
53#ifndef XAOD_STANDALONE
54 declareProperty(
"ConfigSvc", m_configSvc );
56 declareProperty(
"ConfigTool", m_configTool=
nullptr );
66 ATH_MSG_INFO(
"Initializing TrigConfBunchCrossingTool" );
70#ifndef XAOD_STANDALONE
76#ifndef XAOD_STANDALONE
78 ATH_MSG_DEBUG(
" xAODConfigTool is set - will read from xAOD metadata" );
81 ATH_MSG_DEBUG(
" xAODConfigTool is not set - will read from xAODConfigSvc" );
89 return StatusCode::SUCCESS;
98 return StatusCode::SUCCESS;
123 return std::vector< float >();
138 return std::vector< float >();
153 return std::vector< float >();
168 return std::vector< float >();
188#ifndef XAOD_STANDALONE
200 ATH_MSG_FATAL(
"Trigger configuration service doesn't provide "
201 "BunchGroupSet information" );
202 return StatusCode::FAILURE;
207 return StatusCode::SUCCESS;
222 const std::vector< TrigConf::BunchGroup >& bgs =
224 std::vector< TrigConf::BunchGroup >::const_iterator filled_bg =
227 ATH_MSG_INFO(
"Taking the second bunch group as the colliding bunch "
240 std::vector< int > unpaired;
242 if( bgs.size() > 4 ) {
243 unpaired.insert( unpaired.end(), bgs[ 4 ].bunches().begin(),
244 bgs[ 4 ].bunches().end() );
247 if( bgs.size() > 5 ) {
248 unpaired.insert( unpaired.end(), bgs[ 5 ].bunches().begin(),
249 bgs[ 5 ].bunches().end() );
260#ifndef XAOD_STANDALONE
264 incidentSvc->fireIncident( Incident(
"BunchConfiguration update",
269 return StatusCode::SUCCESS;
276 void TrigConfBunchCrossingTool::
280 if( !
msgLvl( MSG::VERBOSE ) )
return;
284 for(
const auto& bg : svc->bunchGroupSet()->bunchGroups() ) {
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
std::vector< size_t > vec
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
bool msgLvl(const MSG::Level lvl) const
const std::vector< BunchGroup > & bunchGroups() const
Interface for all services/tools that provide LVL1 menu configuration information.
virtual const BunchGroupSet * bunchGroupSet() const =0
Provides the LVL1 bunch group set.
static const std::string BUNCH_CONFIG_INCIDENT_NAME
Type name for the incident that such tools should emit.
unsigned int configid_type
Declare the interface that this class provides.
The common trigger namespace for trigger analysis tools.