ATLAS Offline Software
StorageMgr.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include "./MasterTableLoader.h"
9 #include "./MenuLoader.h"
10 #include "./MuctpiLoader.h"
11 #include "./DeadTimeLoader.h"
12 #include "./PrescaledClockLoader.h"
13 #include "./RandomLoader.h"
15 #include "./LutCamLoader.h"
17 #include "./CTPFilesLoader.h"
18 #include "./PrescaleSetLoader.h"
19 #include "./PrioritySetLoader.h"
20 #include "./BunchGroupLoader.h"
21 #include "./BunchGroupSetLoader.h"
22 #include "./CTPConfigLoader.h"
26 #include "./CaloJetInputLoader.h"
27 #include "./CaloSinCosLoader.h"
28 #include "./CaloInfoLoader.h"
30 #include "./HLTFrameLoader.h"
31 #include "./HLTPrescaleSetLoader.h"
33 #include "./JobOptionTableLoader.h"
34 #include "./L1TopoMenuLoader.h"
35 
36 #include <iostream>
37 #include <memory>
38 
39 using namespace std;
40 using namespace TrigConf;
41 
42 TrigConf::StorageMgr::StorageMgr( const std::string& cs,
43  const std::string& user,
44  const std::string& pass,
45  std::ostream & /*o*/) :
46  TrigConfMessaging("DBStorageMgr")
47  , m_cs( cs )
48  , m_user( user )
49  , m_password( pass )
50 {}
51 
53  const std::string& server,
54  const std::string& name,
55  const std::string& user,
56  const std::string& pass,
57  std::ostream & /*o*/) :
58  TrigConfMessaging("DBStorageMgr")
59  , m_dbtype( type )
60  , m_dbserver( server )
61  , m_dbname( name )
62  , m_user( user )
63  , m_password( pass )
64 {}
65 
66 
70  delete m_sessionMgr;
71 }
72 
73 
74 // setting log level of all loaders and itself
75 void
77  msg().setLevel(lvl);
78 }
79 
80 
81 void
83  this->sessionMgr().closeSession();
84 }
85 
86 
89  if( m_sessionMgr == 0 ) {
90  m_sessionMgr = new SessionMgr();
91  if( m_cs != "" ) {
93  } else {
99  }
104  }
105  return * m_sessionMgr;
106 }
107 
108 
109 
111  if (!m_l1topoMenuLoader) m_l1topoMenuLoader = NewLoader<L1TopoMenuLoader>();
112  return *m_l1topoMenuLoader;
113 }
114 
116  if (!m_masterTableLoader) m_masterTableLoader = NewLoader<MasterTableLoader>();
117  return *m_masterTableLoader;
118 }
119 
121  if( ! m_menuLoader ) m_menuLoader = NewLoader<MenuLoader>();
122  return *m_menuLoader;
123 }
124 
126  if( ! m_muctpiLoader ) m_muctpiLoader = NewLoader<MuctpiLoader>();
127  return *m_muctpiLoader;
128 }
129 
131  if( ! m_deadTimeLoader ) m_deadTimeLoader = NewLoader<DeadTimeLoader>();
132  return *m_deadTimeLoader;
133 }
134 
136  if( ! m_prescaledClockLoader ) m_prescaledClockLoader = NewLoader<PrescaledClockLoader>();
137  return *m_prescaledClockLoader;
138 }
139 
141  if( ! m_randomLoader ) m_randomLoader = NewLoader<RandomLoader>();
142  return *m_randomLoader;
143 }
144 
146  if( ! m_thresholdConfigLoader ) m_thresholdConfigLoader = NewLoader<ThresholdConfigLoader>();
147  return *m_thresholdConfigLoader;
148 }
149 
151  if( ! m_triggerThresholdLoader ) m_triggerThresholdLoader = NewLoader<TriggerThresholdLoader>();
152  return *m_triggerThresholdLoader;
153 }
154 
156  if( ! m_triggerThresholdValueLoader ) m_triggerThresholdValueLoader = NewLoader<TriggerThresholdValueLoader>();
157  return *m_triggerThresholdValueLoader;
158 }
159 
161  if( ! m_caloJetInputLoader ) m_caloJetInputLoader = NewLoader<CaloJetInputLoader>();
162  return *m_caloJetInputLoader;
163 }
164 
166  if( ! m_caloSinCosLoader ) m_caloSinCosLoader = NewLoader<CaloSinCosLoader>();
167  return *m_caloSinCosLoader;
168 }
169 
171  if( ! m_caloInfoLoader ) m_caloInfoLoader = NewLoader<CaloInfoLoader>();
172  return *m_caloInfoLoader;
173 }
174 
176  if( ! m_thresholdMonitorLoader ) m_thresholdMonitorLoader = NewLoader<ThresholdMonitorLoader>();
177  return *m_thresholdMonitorLoader;
178 }
179 
181 {
182  if( ! m_ctpFilesLoader ) m_ctpFilesLoader = NewLoader<CTPFilesLoader>();
183  return *m_ctpFilesLoader;
184 }
185 
187  if( ! m_lutCamLoader ) m_lutCamLoader = NewLoader<LutCamLoader>();
188  return *m_lutCamLoader;
189 }
190 
192  if( ! m_prescaleSetLoader ) m_prescaleSetLoader = NewLoader<PrescaleSetLoader>();
193  return *m_prescaleSetLoader;
194 }
195 
197  if( ! m_prioritySetLoader ) m_prioritySetLoader = NewLoader<PrioritySetLoader>();
198  return *m_prioritySetLoader;
199 }
200 
202  if( ! m_bunchGroupLoader ) m_bunchGroupLoader = NewLoader<BunchGroupLoader>();
203  return *m_bunchGroupLoader;
204 }
205 
207  if( ! m_bunchGroupSetLoader ) m_bunchGroupSetLoader = NewLoader<BunchGroupSetLoader>();
208  return *m_bunchGroupSetLoader;
209 }
210 
212  if( ! m_ctpConfigLoader ) m_ctpConfigLoader = NewLoader<CTPConfigLoader>();
213  return *m_ctpConfigLoader;
214 }
215 
217  return ctpConfigLoader();
218 }
219 
221  if( ! m_muonThresholdSetLoader ) m_muonThresholdSetLoader = NewLoader<MuonThresholdSetLoader>();
222  return *m_muonThresholdSetLoader;
223 }
224 
226  if( ! m_HLTFrameLoader ) m_HLTFrameLoader = NewLoader<HLTFrameLoader>();
227  return *m_HLTFrameLoader;
228 }
229 
231  if( ! m_jobOptionTableLoader ) m_jobOptionTableLoader = NewLoader<JobOptionTableLoader>();
232  return *m_jobOptionTableLoader;
233 }
234 
236  if( ! m_hltPrescaleSetLoader ) m_hltPrescaleSetLoader = NewLoader<HLTPrescaleSetLoader>();
237  return *m_hltPrescaleSetLoader;
238 }
239 
241  if( ! m_hltPrescaleSetCollectionLoader ) m_hltPrescaleSetCollectionLoader = NewLoader<HLTPrescaleSetCollectionLoader>();
242  return *m_hltPrescaleSetCollectionLoader;
243 }
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
CaloInfoLoader.h
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::SessionMgr::setDbServer
void setDbServer(const std::string &s)
Definition: SessionMgr.cxx:125
TrigConf::StorageMgr::useFrontier
bool useFrontier() const
Definition: StorageMgr.h:104
TrigConf::StorageMgr::triggerThresholdValueLoader
virtual ITriggerThresholdValueLoader & triggerThresholdValueLoader() override
Definition: StorageMgr.cxx:155
TrigConf::IBunchGroupLoader
Definition: IBunchGroupLoader.h:13
CTPConfigOnlineLoader.h
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
MuonThresholdSetLoader.h
ThresholdConfigLoader.h
HLTPrescaleSetCollectionLoader.h
MenuLoader.h
SessionMgr.h
TrigConf::SessionMgr::setDbName
void setDbName(const std::string &s)
Definition: SessionMgr.cxx:131
TrigConf::SessionMgr::setUseFrontier
void setUseFrontier(bool useFrontier)
Definition: SessionMgr.h:50
TrigConf::IMuctpiLoader
Definition: IMuctpiLoader.h:26
TrigConf::SessionMgr::setRetrialPeriod
void setRetrialPeriod(int retrialPeriod)
Definition: SessionMgr.h:51
TrigConf::IPrioritySetLoader
Definition: IPrioritySetLoader.h:13
TrigConf::StorageMgr::closeSession
void closeSession()
Definition: StorageMgr.cxx:82
TrigConf::StorageMgr::m_cs
std::string m_cs
connection string
Definition: StorageMgr.h:125
TrigConf::IPrescaleSetLoader
Definition: IPrescaleSetLoader.h:13
TrigConf::StorageMgr::m_user
std::string m_user
user name
Definition: StorageMgr.h:129
MasterTableLoader.h
HLTFrameLoader.h
TrigConf::ITriggerThresholdLoader
Definition: ITriggerThresholdLoader.h:27
TrigConf::StorageMgr::muonThresholdSetLoader
IMuonThresholdSetLoader & muonThresholdSetLoader()
Definition: StorageMgr.cxx:220
DeadTimeLoader.h
TrigConf::ICTPFilesLoader
Definition: ICTPFilesLoader.h:27
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::IHLTPrescaleSetCollectionLoader
Definition: IHLTPrescaleSetCollectionLoader.h:16
TrigConf::IMasterTableLoader
Interface for loaders of the LVL1 trigger configuration.
Definition: IMasterTableLoader.h:25
BunchGroupLoader.h
TrigConf::ICaloInfoLoader
Definition: ICaloInfoLoader.h:27
RandomLoader.h
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
MuctpiLoader.h
CTPConfigLoader.h
JobOptionTableLoader.h
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
CaloJetInputLoader.h
StorageMgr.h
TrigConf::StorageMgr::caloSinCosLoader
virtual ICaloSinCosLoader & caloSinCosLoader() override
Definition: StorageMgr.cxx:165
TrigConf::TrigConfMessaging::msg
MsgStreamTC & msg() const
The standard message stream.
Definition: TrigConfMessaging.h:81
TriggerThresholdLoader.h
TrigConf::StorageMgrBase::m_l1topoMenuLoader
IL1TopoMenuLoader * m_l1topoMenuLoader
Definition: StorageMgrBase.h:76
TrigConf::IPrescaledClockLoader
Definition: IPrescaledClockLoader.h:27
PrescaleSetLoader.h
TrigConf::StorageMgr::bunchGroupSetLoader
virtual IBunchGroupSetLoader & bunchGroupSetLoader() override
Definition: StorageMgr.cxx:206
HLTPrescaleSetLoader.h
TrigConf::ICaloJetInputLoader
Definition: ICaloJetInputLoader.h:13
CaloSinCosLoader.h
BunchGroupSetLoader.h
TrigConf::StorageMgr::m_connectionTimeout
int m_connectionTimeout
Definition: StorageMgr.h:135
TrigConf::name
Definition: HLTChainList.h:35
L1TopoMenuLoader.h
TrigConf::StorageMgr::masterTableLoader
virtual IMasterTableLoader & masterTableLoader() override
Definition: StorageMgr.cxx:115
TrigConf::IMuonThresholdSetLoader
Definition: IMuonThresholdSetLoader.h:27
TrigConf::StorageMgr::caloInfoLoader
virtual ICaloInfoLoader & caloInfoLoader() override
Definition: StorageMgr.cxx:170
TrigConf::StorageMgr::triggerThresholdLoader
virtual ITriggerThresholdLoader & triggerThresholdLoader() override
Definition: StorageMgr.cxx:150
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
PrioritySetLoader.h
TrigConf::StorageMgr::~StorageMgr
virtual ~StorageMgr() override
destructor
Definition: StorageMgr.cxx:67
TrigConf::StorageMgr::ctpFilesLoader
virtual ICTPFilesLoader & ctpFilesLoader() override
Definition: StorageMgr.cxx:180
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
TrigConf::StorageMgr::m_hltPrescaleSetLoader
IHLTPrescaleSetLoader * m_hltPrescaleSetLoader
Definition: StorageMgr.h:121
LutCamLoader.h
TrigConf::StorageMgr::m_dbtype
std::string m_dbtype
db type
Definition: StorageMgr.h:126
TrigConf::SessionMgr::setDbPassword
void setDbPassword(const std::string &s)
Definition: SessionMgr.cxx:143
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::SessionMgr::setRetrialTimeout
void setRetrialTimeout(int retrialTimeout)
Definition: SessionMgr.h:52
TrigConf::ICaloSinCosLoader
Definition: ICaloSinCosLoader.h:27
TrigConf::StorageMgr::setLevel
void setLevel(MSGTC::Level lvl) override
Definition: StorageMgr.cxx:76
TrigConf::StorageMgr::prioritySetLoader
virtual IPrioritySetLoader & prioritySetLoader() override
Definition: StorageMgr.cxx:196
TrigConf::SessionMgr::closeSession
void closeSession()
close open sessions
Definition: SessionMgr.cxx:59
ThresholdMonitorLoader.h
TrigConf::StorageMgr::m_retrialTimeout
int m_retrialTimeout
Definition: StorageMgr.h:134
TrigConf::SessionMgr::setDbUser
void setDbUser(const std::string &s)
Definition: SessionMgr.cxx:137
TrigConf::MsgStreamTC::setLevel
void setLevel(MSGTC::Level lvl)
Set message level of stream.
Definition: Trigger/TrigConfiguration/TrigConfBase/Root/MsgStream.cxx:52
TrigConf::IL1TopoMenuLoader
Definition: IL1TopoMenuLoader.h:16
python.html.AtlRunQueryDQSummary.server
server
Definition: AtlRunQueryDQSummary.py:22
TrigConf::StorageMgr::m_hltPrescaleSetCollectionLoader
IHLTPrescaleSetCollectionLoader * m_hltPrescaleSetCollectionLoader
Definition: StorageMgr.h:122
TrigConf::SessionMgr::setConnectionTimeout
void setConnectionTimeout(int connectionTimeout)
Definition: SessionMgr.h:53
TrigConf::ILutCamLoader
Definition: ILutCamLoader.h:13
TrigConf::IRandomLoader
Definition: IRandomLoader.h:27
TrigConf::SessionMgr::setConnectionString
void setConnectionString(const std::string &connStr)
Definition: SessionMgr.h:49
TrigConf::SessionMgr::setDbType
void setDbType(const std::string &s)
Definition: SessionMgr.cxx:119
TrigConf::StorageMgr::randomLoader
virtual IRandomLoader & randomLoader() override
Definition: StorageMgr.cxx:140
TriggerThresholdValueLoader.h
TrigConf::StorageMgr::prescaleSetLoader
virtual IPrescaleSetLoader & prescaleSetLoader() override
Definition: StorageMgr.cxx:191
CTPFilesLoader.h
PrescaledClockLoader.h