ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfIO
src
TrigDBL1PrescalesSetLoader.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
"
4
#include "
TrigConfIO/TrigDBL1PrescalesSetLoader.h
"
5
6
TrigConf::TrigDBL1PrescalesSetLoader::TrigDBL1PrescalesSetLoader
(
const
std::string & connection) :
7
TrigDBLoader
(
"TrigDBL1PrescalesSetLoader"
, connection)
8
{
9
{
// query for all schema versions
10
auto
& q =
m_queries
[1];
11
// tables
12
q.addToTableList (
"L1_PRESCALE_SET"
);
13
// bind vars
14
q.extendBinding<
int
>(
"key"
);
15
// conditions
16
q.extendCondition(
"L1PS_ID = :key"
);
17
// attributes
18
q.extendOutput<coral::Blob>(
"L1PS_DATA"
);
19
// the field with the data
20
q.setDataName(
"L1PS_DATA"
);
21
}
22
}
23
24
// Destructor defined here because QueryDefinition is an incomplete type in the header
25
TrigConf::TrigDBL1PrescalesSetLoader::~TrigDBL1PrescalesSetLoader
() =
default
;
26
27
bool
28
TrigConf::TrigDBL1PrescalesSetLoader::loadL1Prescales
(
unsigned
int
psk,
TrigConf::L1PrescalesSet
& pss,
29
const
std::string & outFileName )
const
30
{
31
// load data into ptree
32
boost::property_tree::ptree pt;
33
if
(
useCrest
()) {
34
loadFromCrest
(psk, pt, outFileName,
"L1 prescales"
,
"L1PS"
);
35
}
else
{
36
loadFromOracle
(psk, pt, outFileName,
"L1 prescales"
,
m_queries
);
37
}
38
39
// fill L1PrescaleSet 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 L1 prescales for L1 PSK "
<< psk <<
" a parsing error occured ( "
<< ex.what() <<
" )"
);
47
throw
TrigConf::ParsingException
(
"TrigDBL1PrescalesSetLoader: parsing error "
+ std::string(ex.what()));
48
}
49
50
return
true
;
51
}
TrigDBHelper.h
TrigDBL1PrescalesSetLoader.h
Loader class for Trigger configuration (L1 prescales set) from the Trigger DB.
TRG_MSG_ERROR
#define TRG_MSG_ERROR(x)
Definition
Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:29
TrigConf::DataStructure::setData
void setData(const ptree &data)
Setting the configuration data.
Definition
DataStructure.cxx:39
TrigConf::L1PrescalesSet
L1 menu configuration.
Definition
L1PrescalesSet.h:19
TrigConf::L1PrescalesSet::clear
virtual void clear() override
Clearing the configuration data.
Definition
L1PrescalesSet.cxx:31
TrigConf::L1PrescalesSet::setPSK
void setPSK(unsigned int psk)
Definition
L1PrescalesSet.cxx:49
TrigConf::ParsingException
Definition
Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/Exceptions.h:56
TrigConf::TrigDBL1PrescalesSetLoader::~TrigDBL1PrescalesSetLoader
virtual ~TrigDBL1PrescalesSetLoader() override
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
TrigConf::TrigDBL1PrescalesSetLoader::TrigDBL1PrescalesSetLoader
TrigDBL1PrescalesSetLoader(const std::string &connection)
Constructor.
Definition
TrigDBL1PrescalesSetLoader.cxx:6
TrigConf::TrigDBL1PrescalesSetLoader::m_queries
std::map< size_t, QueryDefinition > m_queries
Definition
TrigDBL1PrescalesSetLoader.h:45
TrigConf::TrigDBL1PrescalesSetLoader::loadL1Prescales
bool loadL1Prescales(unsigned int l1psk, L1PrescalesSet &l1pss, const std::string &outFileName="") const
Load content from the Trigger DB into an L1PrescalesSet for a given L1PrescaleKey (L1PSK).
Definition
TrigDBL1PrescalesSetLoader.cxx:28
TrigConf::TrigDBLoader::useCrest
bool useCrest() const
Definition
TrigDBLoader.h:74
TrigConf::TrigDBLoader::TrigDBLoader
TrigDBLoader(const std::string &loaderName, const std::string &connection)
Constructor.
Definition
TrigDBLoader.cxx:26
TrigConf::TrigDBLoader::loadFromOracle
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
Definition
TrigDBLoader.cxx:220
TrigConf::TrigDBLoader::loadFromCrest
void loadFromCrest(unsigned int key, boost::property_tree::ptree &pt, const std::string &outFileName, const std::string &description, const std::string &query_type) const
Definition
TrigDBLoader.cxx:194
Generated on
for ATLAS Offline Software by
1.17.0