11 #ifndef XAOD_STANDALONE
12 # include "GaudiKernel/IIncidentSvc.h"
13 #endif // not XAOD_STANDALONE
24 template<
typename T >
28 for(
size_t i = 0;
i <
vec.size(); ++
i ) {
30 if(
i <
vec.size() - 1 ) {
44 TrigConfBunchCrossingTool::
45 TrigConfBunchCrossingTool(
const std::string&
name )
46 : BunchCrossingToolBase(
name ), m_bgId( -1 ),
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 );
55 #endif // not XAOD_STANDALONE
56 declareProperty(
"ConfigTool", m_configTool=
nullptr );
66 ATH_MSG_INFO(
"Initializing TrigConfBunchCrossingTool" );
67 ATH_MSG_INFO(
" Maximal bunch spacing: " << m_maxBunchSpacing <<
" ns" );
68 ATH_MSG_INFO(
" Length of train front: " << m_frontLength <<
" ns" );
69 ATH_MSG_INFO(
" Length of train tail : " << m_tailLength <<
" ns" );
70 #ifndef XAOD_STANDALONE
72 #endif // XAOD_STANDALONE
76 #ifndef XAOD_STANDALONE
77 if (!m_configTool.empty()) {
78 ATH_MSG_DEBUG(
" xAODConfigTool is set - will read from xAOD metadata" );
81 ATH_MSG_DEBUG(
" xAODConfigTool is not set - will read from xAODConfigSvc" );
86 #endif // not XAOD_STANDALONE
89 return StatusCode::SUCCESS;
98 return StatusCode::SUCCESS;
106 TrigConfBunchCrossingTool::configID()
const {
121 TrigConfBunchCrossingTool::configuredIntensitiesBeam1()
const {
123 return std::vector< float >();
136 TrigConfBunchCrossingTool::configuredIntensitiesBeam2()
const {
138 return std::vector< float >();
151 TrigConfBunchCrossingTool::configuredUnpairedIntensitiesBeam1()
const {
153 return std::vector< float >();
166 TrigConfBunchCrossingTool::configuredUnpairedIntensitiesBeam2()
const {
168 return std::vector< float >();
188 #ifndef XAOD_STANDALONE
189 if (m_configTool.isSet()) {
190 configSvc = m_configTool.operator->();
192 configSvc = m_configSvc.operator->();
195 configSvc = m_configTool.operator->();
196 #endif // not XAOD_STANDALONE
200 ATH_MSG_FATAL(
"Trigger configuration service doesn't provide "
201 "BunchGroupSet information" );
202 return StatusCode::FAILURE;
207 return StatusCode::SUCCESS;
217 printBunchGroups( configSvc );
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 "
233 ATH_CHECK( loadSingleBunches( filled_bg->bunches() ) );
234 ATH_CHECK( loadBunchTrains( filled_bg->bunches() ) );
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() );
255 ATH_CHECK( loadUnpairedBunches( unpaired, unpaired ) );
260 #ifndef XAOD_STANDALONE
264 incidentSvc->fireIncident( Incident(
"BunchConfiguration update",
265 BUNCH_CONFIG_INCIDENT_NAME ) );
266 #endif // not XAOD_STANDALONE
269 return StatusCode::SUCCESS;
276 void TrigConfBunchCrossingTool::
284 for(
const auto&
bg :
svc->bunchGroupSet()->bunchGroups() ) {