ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDBL1BunchGroupSetLoader.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2
3#include "./TrigDBHelper.h"
5
7 TrigDBLoader("TrigDBL1BunchGroupSetLoader", connection)
8{
9 { // query for all schema versions
10 auto & q = m_queries[1];
11 // tables
12 q.addToTableList ( "L1_BUNCH_GROUP_SET" );
13 // bind vars
14 q.extendBinding<int>("key");
15 // conditions
16 q.extendCondition("L1BGS_ID = :key");
17 // attributes
18 q.extendOutput<coral::Blob>( "L1BGS_DATA" );
19 // the field with the data
20 q.setDataName("L1BGS_DATA");
21 }
22}
23
24// Destructor defined here because QueryDefinition is an incomplete type in the header
26
27bool
30 const std::string & outFileName ) const
31{
32 // load data into ptree
33 boost::property_tree::ptree pt;
34 if(useCrest()) {
35 loadFromCrest(bgsk, pt, outFileName, "L1 bunchgroups", "BGS");
36 } else {
37 loadFromOracle(bgsk, pt, outFileName, "L1 bunchgroups", m_queries);
38 }
39
40 // fill L1BunchGroupSet with data
41 try {
42 bgs.setData(std::move(pt));
43 bgs.setBGSK(bgsk);
44 }
45 catch(std::exception & ex) {
46 bgs.clear();
47 TRG_MSG_ERROR("When reading L1 bunchgroup set for L1 BGSK " << bgsk << " a parsing error occured ( " << ex.what() <<" )" );
48 throw TrigConf::ParsingException("TrigDBL1BunchGroupSetLoader: parsing error " + std::string(ex.what()));
49 }
50
51 return true;
52}
Loader class for Trigger configuration (L1 prescales set) from the Trigger DB.
void setData(const ptree &data)
Setting the configuration data.
L1 board configuration.
void setBGSK(unsigned int bgsk)
virtual void clear() override
Clearing the configuration data.
TrigDBL1BunchGroupSetLoader(const std::string &connection)
Constructor.
std::map< size_t, QueryDefinition > m_queries
virtual ~TrigDBL1BunchGroupSetLoader() override
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
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)
TrigDBLoader(const std::string &loaderName, const std::string &connection)
Constructor.
void loadFromOracle(unsigned int key, boost::property_tree::ptree &pt, const std::string &outFileName, const std::string &description, const std::map< size_t, QueryDefinition > &queries) const
void loadFromCrest(unsigned int key, boost::property_tree::ptree &pt, const std::string &outFileName, const std::string &description, const std::string &query_type) const