ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfIO
src
TrigDBMonitoringLoader.cxx
Go to the documentation of this file.
1
// Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3
#include "
./TrigDBHelper.h
"
4
#include "
TrigConfIO/TrigDBMonitoringLoader.h
"
5
6
TrigConf::TrigDBMonitoringLoader::TrigDBMonitoringLoader
(
const
std::string & connection) :
7
TrigDBLoader
(
"TrigDBMonitoringLoader"
, connection)
8
{
9
/*
10
DB queries
11
*/
12
{
// for schema version 7
13
auto
& q =
m_queries
[7];
14
// tables
15
q.addToTableList (
"SUPER_MASTER_TABLE"
,
"SMT"
);
16
q.addToTableList (
"HLT_MONITORING_GROUPS"
,
"HMG"
);
17
// bind vars
18
q.extendBinding<
int
>(
"key"
);
19
// conditions
20
q.extendCondition(
"SMT.SMT_ID = :key"
);
21
q.extendCondition(
" AND SMT.SMT_HLT_MENU_ID = HMG.HMG_HLT_MENU_ID"
);
22
q.extendCondition(
" AND HMG.HMG_IN_USE=1"
);
23
q.extendCondition(
" ORDER BY HMG.HMG_ID DESC"
);
24
// attributes
25
q.extendOutput<
int
> (
"HMG.HMG_ID"
);
26
q.extendOutput<coral::Blob>(
"HMG.HMG_DATA"
);
27
// the field with the data
28
q.setDataName(
"HMG.HMG_DATA"
);
29
}
30
}
31
32
33
// Destructor defined here because QueryDefinition is an incomplete type in the header
34
TrigConf::TrigDBMonitoringLoader::~TrigDBMonitoringLoader
() =
default
;
35
36
bool
37
TrigConf::TrigDBMonitoringLoader::loadHLTMonitoring
(
unsigned
int
smk,
38
boost::property_tree::ptree & hltmonitoring,
39
const
std::string & outFileName )
const
40
{
41
if
(
useCrest
()) {
42
loadFromCrest
(smk, hltmonitoring, outFileName,
"HLT monitoring"
,
"MGS"
);
43
}
else
{
44
loadFromOracle
(smk, hltmonitoring, outFileName,
"HLT monitoring"
,
m_queries
);
45
}
46
return
true
;
47
}
48
49
bool
50
TrigConf::TrigDBMonitoringLoader::loadHLTMonitoring
(
unsigned
int
smk,
HLTMonitoring
& hltmonitoring,
51
const
std::string & outFileName )
const
52
{
53
boost::property_tree::ptree pthlt;
54
loadHLTMonitoring
( smk, pthlt, outFileName );
55
try
{
56
hltmonitoring.
setData
(std::move(pthlt));
57
hltmonitoring.
setSMK
(smk);
58
}
59
catch
(std::exception & ex) {
60
hltmonitoring.
clear
();
61
TRG_MSG_ERROR
(
"When reading HLT menu for SMK "
<< smk <<
" a parsing error occured ( "
<< ex.what() <<
" )"
);
62
throw
TrigConf::ParsingException
(
"TrigDBMonitoringLoader: parsing error "
+ std::string(ex.what()));
63
}
64
return
true
;
65
}
TrigDBHelper.h
TrigDBMonitoringLoader.h
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::HLTMonitoring
HLT monitoring configuration.
Definition
HLTMonitoring.h:27
TrigConf::HLTMonitoring::clear
virtual void clear() override
Clearing the configuration data.
Definition
HLTMonitoring.cxx:87
TrigConf::HLTMonitoring::setSMK
void setSMK(unsigned int psk)
Definition
HLTMonitoring.cxx:99
TrigConf::ParsingException
Definition
Trigger/TrigConfiguration/TrigConfIO/TrigConfIO/Exceptions.h:56
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
TrigConf::TrigDBMonitoringLoader::m_queries
std::map< size_t, QueryDefinition > m_queries
Definition
TrigDBMonitoringLoader.h:56
TrigConf::TrigDBMonitoringLoader::~TrigDBMonitoringLoader
virtual ~TrigDBMonitoringLoader() override
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
TrigConf::TrigDBMonitoringLoader::TrigDBMonitoringLoader
TrigDBMonitoringLoader(const std::string &connection)
Constructor.
Definition
TrigDBMonitoringLoader.cxx:6
TrigConf::TrigDBMonitoringLoader::loadHLTMonitoring
bool loadHLTMonitoring(unsigned int smk, boost::property_tree::ptree &hltmonitoring, const std::string &outFileName="") const
Load HLT menu content from the Trigger DB into two ptrees for a given SuperMasterKey (SMK).
Definition
TrigDBMonitoringLoader.cxx:37
Generated on
for ATLAS Offline Software by
1.17.0