ATLAS Offline Software
StorageMgr.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TrigConf_StorageMgr
6 #define TrigConf_StorageMgr
7 
12 
13 #include <string>
14 #include <memory>
15 
16 #include "TrigConfBase/MsgStream.h"
17 
18 namespace TrigConf {
19 
20 
23  class StorageMgr : public StorageMgrBase, public TrigConfMessaging, virtual public IStorageMgr {
24  public:
25 
34  StorageMgr( const std::string& cs,
35  const std::string& user = "",
36  const std::string& password = "",
37  std::ostream & o = std::cout);
38 
49  StorageMgr( const std::string& type, const std::string& server,
50  const std::string& name, const std::string& user ,
51  const std::string& password , std::ostream & o = std::cout);
52 
54  virtual ~StorageMgr() override;
55 
56  // setting log level of all loaders
57  void setLevel(MSGTC::Level lvl) override;
58 
59 
60  // provide CTP and L1 version to be accessible by all the L1 loaders
61  void setCTPVersion(unsigned int v) override { m_ctpVersion = v; }
62  void setL1Version(unsigned int v) override { m_l1Version = v; }
63  unsigned int ctpVersion() const override { return m_ctpVersion; }
64  unsigned int l1Version() const override { return m_l1Version; }
65 
66 
69 
70  // Mandatory interface implementation
71  virtual IL1TopoMenuLoader& l1topoMenuLoader() override;
72  virtual IMasterTableLoader& masterTableLoader() override;
73  virtual IMenuLoader& menuLoader() override;
74  virtual IMuctpiLoader& muctpiLoader() override;
75  virtual IDeadTimeLoader& deadTimeLoader() override;
76  virtual IPrescaledClockLoader& prescaledClockLoader() override;
77  virtual IRandomLoader& randomLoader() override;
82  virtual ICTPFilesLoader& ctpFilesLoader() override;
83  virtual ICaloJetInputLoader& caloJetInputLoader() override;
84  virtual ICaloSinCosLoader& caloSinCosLoader() override;
85  virtual ICaloInfoLoader& caloInfoLoader() override;
86  virtual ILutCamLoader& lutcamLoader() override;
87  virtual IPrescaleSetLoader& prescaleSetLoader() override;
88  virtual IPrioritySetLoader& prioritySetLoader() override;
89  virtual IBunchGroupLoader& bunchGroupLoader() override;
90  virtual IBunchGroupSetLoader& bunchGroupSetLoader() override;
91  virtual ICTPConfigLoader& ctpConfigLoader() override;
92  virtual ICTPConfigLoader& ctpConfigOnlineLoader() override;
93  virtual IHLTFrameLoader& hltFrameLoader() override;
94  virtual IJobOptionTableLoader& jobOptionTableLoader() override;
95 
96  // These loaders are DB-only no XML implementation
100 
101  void closeSession();
102 
104  bool useFrontier() const { return m_useFrontier; }
105 
109 
110  int retrialPeriod() const { return m_retrialPeriod; }
111  int retrialTimeout() const { return m_retrialTimeout; }
112  int connectionTimeout() const { return m_connectionTimeout; }
113 
114  private:
115 
116  template< class L >
117  L * NewLoader() {
118  return new L( *this, this->sessionMgr().createSession() );
119  }
120 
123 
124  SessionMgr* m_sessionMgr { nullptr };
125  std::string m_cs {""};
126  std::string m_dbtype {""};
127  std::string m_dbserver {""};
128  std::string m_dbname {""};
129  std::string m_user {""};
130  std::string m_password {""};
131  bool m_useFrontier {false};
132 
136 
137  };
138 }
139 
140 #endif
IStorageMgr.h
TrigConf::ICTPConfigLoader
Definition: ICTPConfigLoader.h:27
TrigConf::IDeadTimeLoader
Definition: IDeadTimeLoader.h:27
TrigConf::StorageMgr::prescaledClockLoader
virtual IPrescaledClockLoader & prescaledClockLoader() override
Definition: StorageMgr.cxx:135
TrigConf::ITriggerThresholdValueLoader
Definition: ITriggerThresholdValueLoader.h:27
TrigConf::StorageMgr::hltPrescaleSetLoader
IHLTPrescaleSetLoader & hltPrescaleSetLoader()
Definition: StorageMgr.cxx:235
TrigConf::IBunchGroupSetLoader
Definition: IBunchGroupSetLoader.h:27
TrigConf::IHLTFrameLoader
Definition: IHLTFrameLoader.h:27
TrigConf::StorageMgr::m_retrialPeriod
int m_retrialPeriod
Definition: StorageMgr.h:133
TrigConf::StorageMgr::StorageMgr
StorageMgr(const std::string &cs, const std::string &user="", const std::string &password="", std::ostream &o=std::cout)
constructor
Definition: StorageMgr.cxx:42
TrigConf::StorageMgr::jobOptionTableLoader
virtual IJobOptionTableLoader & jobOptionTableLoader() override
Definition: StorageMgr.cxx:230
TrigConf::StorageMgr::useFrontier
bool useFrontier() const
Definition: StorageMgr.h:104
TrigConf::StorageMgr::triggerThresholdValueLoader
virtual ITriggerThresholdValueLoader & triggerThresholdValueLoader() override
Definition: StorageMgr.cxx:155
TrigConf::StorageMgr::NewLoader
L * NewLoader()
Definition: StorageMgr.h:117
TrigConf::IBunchGroupLoader
Definition: IBunchGroupLoader.h:13
TrigConf::StorageMgr::hltFrameLoader
virtual IHLTFrameLoader & hltFrameLoader() override
Definition: StorageMgr.cxx:225
TrigConf::StorageMgr::m_dbserver
std::string m_dbserver
db server
Definition: StorageMgr.h:127
TrigConf::StorageMgr::thresholdConfigLoader
virtual IThresholdConfigLoader & thresholdConfigLoader() override
Definition: StorageMgr.cxx:145
TrigConf::StorageMgr::menuLoader
virtual IMenuLoader & menuLoader() override
Definition: StorageMgr.cxx:120
TrigConf::StorageMgr::m_useFrontier
bool m_useFrontier
using frontier to connect to oracle (if set, disables sqlite)
Definition: StorageMgr.h:131
SessionMgr.h
TrigConf::IStorageMgr
Interface for the StorageMgr (TriggerDB) and XMLStorageMgr (XML) classes.
Definition: IStorageMgr.h:47
TrigConf::IMuctpiLoader
Definition: IMuctpiLoader.h:26
TrigConf::IPrioritySetLoader
Definition: IPrioritySetLoader.h:13
TrigConf::StorageMgr::closeSession
void closeSession()
Definition: StorageMgr.cxx:82
TrigConf::StorageMgr::retrialPeriod
int retrialPeriod() const
Definition: StorageMgr.h:110
TrigConf::StorageMgr::m_cs
std::string m_cs
connection string
Definition: StorageMgr.h:125
MsgStream.h
MsgStream for TrigConf classes.
TrigConf::IPrescaleSetLoader
Definition: IPrescaleSetLoader.h:13
TrigConf::StorageMgr::m_user
std::string m_user
user name
Definition: StorageMgr.h:129
TrigConf::ITriggerThresholdLoader
Definition: ITriggerThresholdLoader.h:27
TrigConf::StorageMgr::muonThresholdSetLoader
IMuonThresholdSetLoader & muonThresholdSetLoader()
Definition: StorageMgr.cxx:220
TrigConf::ICTPFilesLoader
Definition: ICTPFilesLoader.h:27
StorageMgrBase.h
TrigConf::SessionMgr
Manager of the database session.
Definition: SessionMgr.h:30
TrigConf::StorageMgr::m_password
std::string m_password
password
Definition: StorageMgr.h:130
TrigConf::IHLTPrescaleSetLoader
Definition: IHLTPrescaleSetLoader.h:14
TrigConf::StorageMgr::hltPrescaleSetCollectionLoader
IHLTPrescaleSetCollectionLoader & hltPrescaleSetCollectionLoader()
Definition: StorageMgr.cxx:240
TrigConf::StorageMgr::lutcamLoader
virtual ILutCamLoader & lutcamLoader() override
Definition: StorageMgr.cxx:186
TrigConf::StorageMgr::setConnectionTimeout
void setConnectionTimeout(int connectionTimeout)
Definition: StorageMgr.h:108
TrigConf::StorageMgr
Database Storage Manager, controls the database session and the different loader classes for DB acces...
Definition: StorageMgr.h:23
TrigConf::IHLTPrescaleSetCollectionLoader
Definition: IHLTPrescaleSetCollectionLoader.h:16
TrigConf::IMasterTableLoader
Interface for loaders of the LVL1 trigger configuration.
Definition: IMasterTableLoader.h:25
TrigConf::ICaloInfoLoader
Definition: ICaloInfoLoader.h:27
TrigConf::StorageMgr::setRetrialTimeout
void setRetrialTimeout(int retrialTimeout)
Definition: StorageMgr.h:107
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::StorageMgr::deadTimeLoader
virtual IDeadTimeLoader & deadTimeLoader() override
Definition: StorageMgr.cxx:130
TrigConf::StorageMgr::ctpConfigLoader
virtual ICTPConfigLoader & ctpConfigLoader() override
Definition: StorageMgr.cxx:211
TrigConf::StorageMgr::m_sessionMgr
SessionMgr * m_sessionMgr
Definition: StorageMgr.h:124
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
TrigConf::IThresholdConfigLoader
Definition: IThresholdConfigLoader.h:27
TrigConf::StorageMgr::m_dbname
std::string m_dbname
db name
Definition: StorageMgr.h:128
TrigConf::StorageMgr::caloSinCosLoader
virtual ICaloSinCosLoader & caloSinCosLoader() override
Definition: StorageMgr.cxx:165
TrigConf::StorageMgr::retrialTimeout
int retrialTimeout() const
Definition: StorageMgr.h:111
TrigConf::IPrescaledClockLoader
Definition: IPrescaledClockLoader.h:27
TrigConf::StorageMgr::bunchGroupSetLoader
virtual IBunchGroupSetLoader & bunchGroupSetLoader() override
Definition: StorageMgr.cxx:206
GetLBsToIgnore.password
password
Definition: GetLBsToIgnore.py:13
TrigConf::ICaloJetInputLoader
Definition: ICaloJetInputLoader.h:13
TrigConf::StorageMgr::m_connectionTimeout
int m_connectionTimeout
Definition: StorageMgr.h:135
TrigConf::StorageMgr::setL1Version
void setL1Version(unsigned int v) override
Definition: StorageMgr.h:62
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::StorageMgrBase::m_ctpVersion
unsigned int m_ctpVersion
Definition: StorageMgrBase.h:78
TrigConf::StorageMgr::masterTableLoader
virtual IMasterTableLoader & masterTableLoader() override
Definition: StorageMgr.cxx:115
TrigConf::IMuonThresholdSetLoader
Definition: IMuonThresholdSetLoader.h:27
TrigConf::StorageMgr::l1Version
unsigned int l1Version() const override
Definition: StorageMgr.h:64
TrigConf::StorageMgr::caloInfoLoader
virtual ICaloInfoLoader & caloInfoLoader() override
Definition: StorageMgr.cxx:170
TrigConf::StorageMgr::triggerThresholdLoader
virtual ITriggerThresholdLoader & triggerThresholdLoader() override
Definition: StorageMgr.cxx:150
TrigConf::StorageMgr::ctpVersion
unsigned int ctpVersion() const override
Definition: StorageMgr.h:63
TrigConf::IMenuLoader
Definition: IMenuLoader.h:14
TrigConf::StorageMgr::sessionMgr
SessionMgr & sessionMgr()
creates and returns a new database session manager
Definition: StorageMgr.cxx:88
TrigConf::StorageMgr::bunchGroupLoader
virtual IBunchGroupLoader & bunchGroupLoader() override
Definition: StorageMgr.cxx:201
TrigConf::StorageMgr::setUseFrontier
void setUseFrontier(bool useFrontier)
Definition: StorageMgr.h:103
TrigConf::StorageMgr::~StorageMgr
virtual ~StorageMgr() override
destructor
Definition: StorageMgr.cxx:67
TrigConf::StorageMgr::ctpFilesLoader
virtual ICTPFilesLoader & ctpFilesLoader() override
Definition: StorageMgr.cxx:180
TrigConf::StorageMgr::setRetrialPeriod
void setRetrialPeriod(int retrialPeriod)
Definition: StorageMgr.h:106
TrigConf::IThresholdMonitorLoader
Definition: IThresholdMonitorLoader.h:27
WriteBchToCool.user
user
Definition: WriteBchToCool.py:76
TrigConf::TrigConfMessaging
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
Definition: TrigConfMessaging.h:28
TrigConf::IJobOptionTableLoader
Definition: IJobOptionTableLoader.h:27
TrigConf::StorageMgr::muctpiLoader
virtual IMuctpiLoader & muctpiLoader() override
Definition: StorageMgr.cxx:125
TrigConf::StorageMgr::ctpConfigOnlineLoader
virtual ICTPConfigLoader & ctpConfigOnlineLoader() override
Definition: StorageMgr.cxx:216
TrigConf::StorageMgr::l1topoMenuLoader
virtual IL1TopoMenuLoader & l1topoMenuLoader() override
Definition: StorageMgr.cxx:110
python.PyAthena.v
v
Definition: PyAthena.py:154
TrigConf::StorageMgr::m_hltPrescaleSetLoader
IHLTPrescaleSetLoader * m_hltPrescaleSetLoader
Definition: StorageMgr.h:121
TrigConf::StorageMgr::m_dbtype
std::string m_dbtype
db type
Definition: StorageMgr.h:126
TrigConf::StorageMgr::connectionTimeout
int connectionTimeout() const
Definition: StorageMgr.h:112
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigConf::StorageMgr::thresholdMonitorLoader
virtual IThresholdMonitorLoader & thresholdMonitorLoader() override
Definition: StorageMgr.cxx:175
TrigConf::StorageMgr::caloJetInputLoader
virtual ICaloJetInputLoader & caloJetInputLoader() override
Definition: StorageMgr.cxx:160
TrigConf::ICaloSinCosLoader
Definition: ICaloSinCosLoader.h:27
TrigConf::StorageMgr::setCTPVersion
void setCTPVersion(unsigned int v) override
Definition: StorageMgr.h:61
TrigConf::StorageMgr::setLevel
void setLevel(MSGTC::Level lvl) override
Definition: StorageMgr.cxx:76
TrigConf::StorageMgr::prioritySetLoader
virtual IPrioritySetLoader & prioritySetLoader() override
Definition: StorageMgr.cxx:196
TrigConfMessaging.h
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
TrigConf::StorageMgr::m_retrialTimeout
int m_retrialTimeout
Definition: StorageMgr.h:134
TrigConf::StorageMgrBase
Definition: StorageMgrBase.h:39
TrigConf::IL1TopoMenuLoader
Definition: IL1TopoMenuLoader.h:16
TrigConf::StorageMgrBase::m_l1Version
unsigned int m_l1Version
Definition: StorageMgrBase.h:79
python.html.AtlRunQueryDQSummary.server
server
Definition: AtlRunQueryDQSummary.py:22
TrigConf::StorageMgr::m_hltPrescaleSetCollectionLoader
IHLTPrescaleSetCollectionLoader * m_hltPrescaleSetCollectionLoader
Definition: StorageMgr.h:122
TrigConf::ILutCamLoader
Definition: ILutCamLoader.h:13
TrigConf::IRandomLoader
Definition: IRandomLoader.h:27
TrigConf::StorageMgr::randomLoader
virtual IRandomLoader & randomLoader() override
Definition: StorageMgr.cxx:140
TrigConf::StorageMgr::prescaleSetLoader
virtual IPrescaleSetLoader & prescaleSetLoader() override
Definition: StorageMgr.cxx:191