ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDBLoader.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
11
12#ifndef TRIGCONFIO_TRIGDBLOADER_H
13#define TRIGCONFIO_TRIGDBLOADER_H
14
17
18#include <memory>
19#include <map>
20
21#include "boost/property_tree/ptree_fwd.hpp"
22
23
24// namespace boost { namespace property_tree {
25// class ptree;
26// }}
27namespace coral {
28 class ISessionProxy;
29 class Blob;
30}
31
32namespace TrigConf {
33
34 class QueryDefinition;
35
40 public:
41
43 TrigDBLoader(const std::string & loaderName, const std::string & connection);
44
46 virtual ~TrigDBLoader();
47
53 void setCrestConnection(const std::string & server, const std::string & version = "");
54
61 void setCrestTrigDB(const std::string & crestTrigDB);
62
66 size_t schemaVersion(coral::ISessionProxy* session) const;
67
68 void setLevel(MSGTC::Level lvl) { msg().setLevel(lvl); }
69
70 MSGTC::Level outputLevel() const { return msg().level(); }
71
72 protected:
73
74 bool useCrest() const {
75 return m_useCrest;
76 }
77
89 std::string getTrigDataCrest(const std::string & type, int key) const;
90
92 std::unique_ptr<coral::ISessionProxy> createDBSession() const;
93
96 const std::map<size_t, QueryDefinition> & queries) const;
97
98 void loadFromCrest(unsigned int key, boost::property_tree::ptree & pt,
99 const std::string & outFileName, const std::string & description,
100 const std::string & query_type) const;
101
102 void loadFromOracle(unsigned int key, boost::property_tree::ptree & pt,
103 const std::string & outFileName, const std::string & description,
104 const std::map<size_t, QueryDefinition> & queries) const;
105
106 private:
107
108 // private variables
109 bool m_useCrest {false};
110 std::string m_connection {""};
111 std::string m_crestServer {""};
112 std::string m_crestVersion {""};
113 std::string m_crestTrigDb {""};
117 };
118
119}
120
121#endif
122
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
void setLevel(MSGTC::Level lvl)
Set message level of stream.
MsgStreamTC & msg() const
The standard message stream.
TrigConfMessaging(const std::string &name)
Constructor with parameters.
std::unique_ptr< coral::ISessionProxy > createDBSession() const
create (if needed) DB session and return the session proxy
QueryDefinition getQueryDefinition(size_t schemaVersion, const std::map< size_t, QueryDefinition > &queries) const
return query for given schemaVersion from possible queries
std::string getTrigDataCrest(const std::string &type, int key) const
Get trigger configuration from the TriggerDB through Crest.
TrigDBLoader(const std::string &loaderName, const std::string &connection)
Constructor.
MSGTC::Level outputLevel() const
void setLevel(MSGTC::Level lvl)
void setCrestTrigDB(const std::string &crestTrigDB)
set trigger db for the crest connection
virtual ~TrigDBLoader()
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
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
size_t schemaVersion(coral::ISessionProxy *session) const
access to TriggerDB schema version
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
void loadFromCrest(unsigned int key, boost::property_tree::ptree &pt, const std::string &outFileName, const std::string &description, const std::string &query_type) const
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22