ATLAS Offline Software
TrigDBHLTPrescalesSetLoader.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("TrigDBHLTPrescalesSetLoader", connection)
8 {
9  { // query for all schema versions
10  auto & q = m_queries[1];
11  // tables
12  q.addToTableList ( "HLT_PRESCALE_SET" );
13  // bind vars
14  q.extendBinding<int>("key");
15  // conditions
16  q.extendCondition("HPS_ID = :key");
17  // attributes
18  q.extendOutput<coral::Blob>( "HPS_DATA" );
19  // the field with the data
20  q.setDataName("HPS_DATA");
21  }
22 }
23 
24 // Destructor defined here because QueryDefinition is an incomplete type in the header
26 
27 bool
29  const std::string & outFileName ) const
30 {
31  // load data into ptree
33  if(useCrest()) {
34  loadFromCrest(psk, pt, outFileName, "HLT prescales", "HLTPS");
35  } else {
36  loadFromOracle(psk, pt, outFileName, "HLT prescales", m_queries);
37  }
38 
39  // fill HLTPrescaleSet with data
40  try {
41  pss.setData(std::move(pt));
42  pss.setPSK(psk);
43  }
44  catch(std::exception & ex) {
45  pss.clear();
46  TRG_MSG_ERROR("When reading HLT prescales for HLT PSK " << psk << " a parsing error occured ( " << ex.what() <<" )" );
47  throw TrigConf::ParsingException("TrigDBHLTPrescalesSetLoader: parsing error " + std::string(ex.what()));
48  }
49  return true;
50 }
TRG_MSG_ERROR
#define TRG_MSG_ERROR(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:29
TrigConf::HLTPrescalesSet::setPSK
void setPSK(unsigned int psk)
Definition: HLTPrescalesSet.cxx:80
TrigConf::TrigDBHLTPrescalesSetLoader::~TrigDBHLTPrescalesSetLoader
virtual ~TrigDBHLTPrescalesSetLoader() override
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
TrigConf::TrigDBLoader
Loader of trigger configurations from the Trigger database.
Definition: TrigDBLoader.h:39
test_pyathena.pt
pt
Definition: test_pyathena.py:11
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
TrigConf::TrigDBHLTPrescalesSetLoader::loadHLTPrescales
bool loadHLTPrescales(unsigned int hltpsk, HLTPrescalesSet &hltpss, const std::string &outFileName="") const
Load content from the Trigger DB into an HLTPrescalesSet for a given HLTPrescaleKey (HLTPSK)
Definition: TrigDBHLTPrescalesSetLoader.cxx:28
TrigConf::DataStructure::setData
void setData(const ptree &data)
Setting the configuration data.
Definition: DataStructure.cxx:39
calibdata.exception
exception
Definition: calibdata.py:495
TrigDBHLTPrescalesSetLoader.h
Loader class for Trigger configuration (HLT prescales set) from the Trigger DB.
TrigConf::TrigDBHLTPrescalesSetLoader::TrigDBHLTPrescalesSetLoader
TrigDBHLTPrescalesSetLoader(const std::string &connection)
Constructor.
Definition: TrigDBHLTPrescalesSetLoader.cxx:6
TrigConf::ParsingException
Definition: Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/Exceptions.h:56
ptree
boost::property_tree::ptree ptree
Definition: JsonFileLoader.cxx:16
dumpNswErrorDb.outFileName
string outFileName
Definition: dumpNswErrorDb.py:131
TrigConf::HLTPrescalesSet::clear
virtual void clear() override
Clearing the configuration data.
Definition: HLTPrescalesSet.cxx:61
extractSporadic.q
list q
Definition: extractSporadic.py:97
TrigDBHelper.h
TrigConf::HLTPrescalesSet
HLT menu configuration.
Definition: HLTPrescalesSet.h:19
TrigConf::TrigDBHLTPrescalesSetLoader::m_queries
std::map< size_t, QueryDefinition > m_queries
Definition: TrigDBHLTPrescalesSetLoader.h:43