 |
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "CoolKernel/types.h"
25 ATH_CHECK(m_bgkFolderInputKey.initialize());
26 if( m_configSource ==
"FILE" || m_configSource ==
"DB" ) {
27 renounce( m_bgkFolderInputKey );
30 ATH_CHECK(m_l1BunchGroupSetOutputKey.initialize());
37 if( m_configSource ==
"FILE" ) {
41 m_BgsMap.insert(std::make_pair(0
u, createFromFile(m_filename)));
43 }
else if( m_bgk != 0
u ) {
48 m_BgsMap.insert(std::make_pair(m_bgk,
createFromDB(m_bgk)));
52 return StatusCode::SUCCESS;
55 std::shared_ptr<TrigConf::L1BunchGroupSet>
57 auto bgs = std::make_shared<L1BunchGroupSet>();
74 std::shared_ptr<TrigConf::L1BunchGroupSet>
76 auto bgs = std::make_shared<L1BunchGroupSet>();
77 ATH_MSG_DEBUG(
"Setting up TrigDBL1BunchGroupSetLoader with DB connection " << m_dbConnection.value() );
80 std::string crest_api(
"");
91 ATH_MSG_WARNING(
"Failed loading L1BunchGroup set from db with key " << bgk );
102 ATH_MSG_DEBUG(
"BunchGroupCondAlg::execute with lb " << ctx.eventID().lumi_block());
105 if (writeCondHandle.
isValid()) {
106 return StatusCode::SUCCESS;
109 unsigned int l1Ggk = m_bgk;
112 if(m_configSource ==
"COOL") {
117 if ( bgkAL ==
nullptr ) {
118 ATH_MSG_FATAL(
"Null pointer to the read conditions object of " << m_bgkFolderInputKey.key());
119 return StatusCode::FAILURE;
123 return StatusCode::FAILURE;
128 l1Ggk = (*bgkAL)[
"Lvl1BunchGroupConfigurationKey"].data<cool::UInt32>();
129 ATH_MSG_INFO(
"Extracted the L1 bgk " << l1Ggk <<
" for run " << ctx.eventID().run_number()
130 <<
" and lb " << ctx.eventID().lumi_block() );
137 start.set_lumi_block(0);
139 stop.set_lumi_block(0);
144 std::shared_ptr<const L1BunchGroupSet> bgs;
146 if( m_configSource ==
"FILE" ) {
148 bgs = m_BgsMap.at(0);
150 }
else if ( l1Ggk != 0 ) {
152 auto bgsi = m_BgsMap.find( l1Ggk );
154 if( bgsi == m_BgsMap.end()) {
158 if( bgs ==
nullptr ) {
159 ATH_MSG_ERROR(
"Failed loading bunchgroup set from the database" );
160 return StatusCode::FAILURE;
163 const auto p = m_BgsMap.insert(std::make_pair( l1Ggk, bgs ));
164 bgs =
p.first->second;
174 ATH_MSG_ERROR(
"Failed loading L1 BunchGroup set (not reading from FILE and no bgk known)" );
175 return StatusCode::FAILURE;
179 if( bgs ==
nullptr ) {
183 ATH_MSG_INFO(
"Recording L1BunchGroupSet set with range " <<
range <<
" (key = " << bgs->
bgsk() <<
")");
187 return StatusCode::SUCCESS;
std::shared_ptr< L1BunchGroupSet > createFromDB(unsigned int) const
virtual StatusCode initialize() override
Loader class for Trigger configuration (L1 prescales set) from the Trigger DB.
bool loadFile(const std::string &filename, boost::property_tree::ptree &data, const std::string &pathToChild="") const
Load content of json file into a ptree.
BunchGroupCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
bool range(EventIDRange &r)
void setCrestConnection(const std::string &server, const std::string &version="")
declare CREST as the source of the configuration An empty crest server makes it use Oracle
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
@ u
Enums for curvilinear frames.
An algorithm that can be simultaneously executed in multiple threads.
::StatusCode StatusCode
StatusCode definition for legacy code.
void setCrestTrigDB(const std::string &crestTrigDB)
set trigger db for the crest connection
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
void setLevel(MSGTC::Level lvl)
std::shared_ptr< L1BunchGroupSet > createFromFile(const std::string &filename) const
uint32_t truncatedHash(const DataStructure &dataStructure)
Function to compute a truncated MD5 hash for a JSON file.
bool loadBunchGroupSet(unsigned int bgsk, L1BunchGroupSet &bgs, const std::string &outFileName="") const
Load content from the Trigger DB into an L1PrescalesSet for a given L1PrescaleKey (L1PSK)
void createFromDB(GeoFullPhysVol *envelope, IRDBAccessSvc *rdbAccess, IGeoModelSvc *geoModel, StoredMaterialManager *materialManager)
#define ATH_MSG_WARNING(x)
void setLevel(MSGTC::Level lvl)
bool isCrestConnection(const std::string &db_connection_string, std::string &crest_server, std::string &crest_api, std::string &dbname)
Function to interpret the trigger connection string for CREST connections Format of the connections s...
Loader class for Trigger configuration from Json.
unsigned int bgsk() const
setter and getter for the bunch group key
Loader of trigger configurations from Json files.
const std::string & key() const
virtual StatusCode execute(const EventContext &ctx) const override
Loader of trigger configurations from Json files.