ATLAS Offline Software
xAODMenuReader.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Local include(s):
7 #include "xAODMenuReader.h"
8 
9 namespace TrigConf {
10 
11  xAODMenuReader::xAODMenuReader( const std::string& name,
12  ISvcLocator* svcLoc )
13  : AthAlgorithm( name, svcLoc ),
14  m_configSvc( "TrigConf::xAODConfigSvc", name ),
15  m_configTool( "TrigConf::xAODConfigTool" ) {
16 
17  declareProperty( "TrigConfigSvc", m_configSvc );
18  declareProperty( "TrigConfigTool", m_configTool );
19  }
20 
22 
23  // Greet the user:
24  ATH_MSG_INFO( "Initialising" );
25 
26  // Retrieve the needed components:
27  ATH_CHECK( m_configSvc.retrieve() );
28  ATH_CHECK( m_configTool.retrieve() );
29 
30  // Reset our internal counter:
31  m_eventCounter = 0;
32 
33  // Return gracefully:
34  return StatusCode::SUCCESS;
35  }
36 
38 
39  // Check if we want to do anything:
41  if( m_eventCounter > 10 ) {
42  return StatusCode::SUCCESS;
43  }
44 
45  // Print some info:
46  ATH_MSG_INFO( "Configuration loaded by the service:" );
47  ATH_MSG_INFO( " SMK: " << m_configSvc->masterKey()
48  << ", L1PSK: " << m_configSvc->lvl1PrescaleKey()
49  << ", HLTPSK: " << m_configSvc->hltPrescaleKey() );
50 
51  ATH_MSG_INFO( "Configuration loaded by the tool:" );
52  ATH_MSG_INFO( " SMK: " << m_configTool->masterKey()
53  << ", L1PSK: " << m_configTool->lvl1PrescaleKey()
54  << ", HLTPSK: " << m_configTool->hltPrescaleKey() );
55 
56  // Return gracefully:
57  return StatusCode::SUCCESS;
58  }
59 
60 } // namespace TrigConf
TrigConf::xAODMenuReader::m_configSvc
ServiceHandle< TrigConf::ITrigConfigSvc > m_configSvc
Connection to the trigger configuration service.
Definition: xAODMenuReader.h:45
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigConf::xAODMenuReader::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: xAODMenuReader.cxx:21
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
xAODMenuReader.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigConf::xAODMenuReader::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: xAODMenuReader.cxx:37
AthAlgorithm
Definition: AthAlgorithm.h:47
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::xAODMenuReader::m_configTool
ToolHandle< TrigConf::ITrigConfigTool > m_configTool
Connection to the trigger configuration tool.
Definition: xAODMenuReader.h:47
TrigConf::xAODMenuReader::xAODMenuReader
xAODMenuReader(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: xAODMenuReader.cxx:11
TrigConf::xAODMenuReader::m_eventCounter
int m_eventCounter
An internal counter.
Definition: xAODMenuReader.h:50