ATLAS Offline Software
DBLoader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TrigConf_DBLoader
6 #define TrigConf_DBLoader
7 
10 #include "RelationalAccess/ISessionProxy.h"
12 
13 #include <tuple>
14 
15 namespace TrigConf {
16 
18  class DBLoader : public TrigConfMessaging,
19  virtual public ILoader
20  {
21  public:
22 
29  explicit DBLoader( StorageMgr& sm, coral::ISessionProxy& session );
30 
31  explicit DBLoader( const std::string& name, StorageMgr& sm, coral::ISessionProxy& session );
32 
34  virtual ~DBLoader() override = default;
35 
37  //std::ostream & msg() { return m_storageMgr.msg(); }
38 
39  virtual void setLevel(MSGTC::Level lvl) override;
40  virtual MSGTC::Level outputLevel() const override { return msg().level(); }
41 
42 
44  void startSession();
45 
47  void commitSession();
48 
50  bool loadL1MasterKey(int SuperMasterKey, int& Lvl1MasterKey);
51 
53  bool loadL1MenuKey(int SuperMasterKey, int& Lvl1MenuKey);
54 
55  unsigned int triggerDBSchemaVersion();
56 
57  virtual int verbose() const override { return m_verbose; }
58  virtual void setVerbose(int v) override { m_verbose=v; }
59 
60  bool isRun1() { return ! isRun2(); }
61  bool isRun2();
62 
63  private:
64  int m_verbose{1};
65 
66  protected:
68  coral::ISessionProxy& m_session;
69  bool m_sessionOwner{false};
70  private:
72  std::tuple<unsigned int,unsigned int> loadSchemaVersion() const;
73  };
74 
75 }
76 
77 #endif
78 
TrigConf::DBLoader::loadL1MenuKey
bool loadL1MenuKey(int SuperMasterKey, int &Lvl1MenuKey)
get l1 menu id from super master
Definition: DBLoader.cxx:167
ILoader.h
TrigConf::DBLoader::verbose
virtual int verbose() const override
Definition: DBLoader.h:57
TrigConf::DBLoader::outputLevel
virtual MSGTC::Level outputLevel() const override
Definition: DBLoader.h:40
TrigConf::DBLoader::setVerbose
virtual void setVerbose(int v) override
Definition: DBLoader.h:58
TrigConf::DBLoader::m_storageMgr
StorageMgr & m_storageMgr
reference to the storage manager
Definition: DBLoader.h:67
TrigConf::DBLoader::triggerDBSchemaVersion
unsigned int triggerDBSchemaVersion()
Definition: DBLoader.cxx:76
TrigConf::DBLoader::isRun2
bool isRun2()
Definition: DBLoader.cxx:54
TrigConf::DBLoader::m_session
coral::ISessionProxy & m_session
CORAL interface to database session.
Definition: DBLoader.h:68
TrigConf::ILoader
Interface class for loaders.
Definition: ILoader.h:17
TrigConf::DBLoader::setLevel
virtual void setLevel(MSGTC::Level lvl) override
access to output stream
Definition: DBLoader.cxx:60
TrigConf::DBLoader::m_verbose
int m_verbose
Definition: DBLoader.h:64
TrigConf::DBLoader::DBLoader
DBLoader(StorageMgr &sm, coral::ISessionProxy &session)
constructor
Definition: DBLoader.cxx:30
TrigConf::StorageMgr
Database Storage Manager, controls the database session and the different loader classes for DB acces...
Definition: StorageMgr.h:23
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::DBLoader::~DBLoader
virtual ~DBLoader() override=default
destructor
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
StorageMgr.h
TrigConf::DBLoader
Base class for loaders of configurations from the TriggerDB.
Definition: DBLoader.h:20
TrigConf::DBLoader::m_sessionOwner
bool m_sessionOwner
remember if the loader started the session in the first place
Definition: DBLoader.h:69
TrigConf::TrigConfMessaging::msg
MsgStreamTC & msg() const
The standard message stream.
Definition: TrigConfMessaging.h:81
TrigConf::MsgStreamTC::level
MSGTC::Level level()
Return message level of stream.
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:53
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::TrigConfMessaging
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
Definition: TrigConfMessaging.h:28
TrigConf::DBLoader::commitSession
void commitSession()
commit session if not already done
Definition: DBLoader.cxx:45
python.PyAthena.v
v
Definition: PyAthena.py:154
TrigConf::DBLoader::loadSchemaVersion
std::tuple< unsigned int, unsigned int > loadSchemaVersion() const
get DB schema version and run number
Definition: DBLoader.cxx:81
TrigConf::DBLoader::startSession
void startSession()
start session if not already active
Definition: DBLoader.cxx:35
TrigConfMessaging.h
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
TrigConf::DBLoader::isRun1
bool isRun1()
Definition: DBLoader.h:60
TrigConf::DBLoader::loadL1MasterKey
bool loadL1MasterKey(int SuperMasterKey, int &Lvl1MasterKey)
get l1 master from super master
Definition: DBLoader.cxx:128