ATLAS Offline Software
DatabaseConfig.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef dqiDatabaseConfig_h
6 #define dqiDatabaseConfig_h
7 
8 
9 #include <nlohmann/json.hpp>
10 #include "CoolKernel/pointers.h" //for IFolderPtr, IDatabasePtr typedef
11 #include <unordered_map>
12 #include <string>
13 namespace dqi {
14 
16 
17 public:
18  DatabaseConfig(std::string connectionString, long runNumber);
19  nlohmann::json GetPayload(const std::string& tag);
20 
21  bool IsConnected() const;
22  void Disconnect();
23 
24 private:
25  const std::string m_connectionString;
26  const long m_runNumber{};
27 
28  bool m_dbConnected{};
30 
31  std::unordered_map<std::string, nlohmann::json> m_jsonData;
32  cool::IFolderPtr m_folder;
33  cool::IDatabasePtr m_database;
34 
35  long GetRunNumber() const;
36  nlohmann::json LoadPayload(const std::string& tag);
37 
38  void Connect();
39 };
40 
41 }
42 #endif
dqi::DatabaseConfig::m_folderConnected
bool m_folderConnected
Definition: DatabaseConfig.h:29
dqi::DatabaseConfig::m_database
cool::IDatabasePtr m_database
Definition: DatabaseConfig.h:33
json
nlohmann::json json
Definition: HistogramDef.cxx:9
dqi::DatabaseConfig::GetRunNumber
long GetRunNumber() const
Definition: DatabaseConfig.cxx:105
dqi::DatabaseConfig::DatabaseConfig
DatabaseConfig(std::string connectionString, long runNumber)
Definition: DatabaseConfig.cxx:21
dqi::DatabaseConfig::IsConnected
bool IsConnected() const
Definition: DatabaseConfig.cxx:98
dqi::DatabaseConfig
Definition: DatabaseConfig.h:15
dqi::DatabaseConfig::m_connectionString
const std::string m_connectionString
Definition: DatabaseConfig.h:25
dqi::DatabaseConfig::GetPayload
nlohmann::json GetPayload(const std::string &tag)
Definition: DatabaseConfig.cxx:65
dqi::DatabaseConfig::m_dbConnected
bool m_dbConnected
Definition: DatabaseConfig.h:28
dqi::DatabaseConfig::Connect
void Connect()
Definition: DatabaseConfig.cxx:42
dqi::DatabaseConfig::m_folder
cool::IFolderPtr m_folder
Definition: DatabaseConfig.h:32
dqi::DatabaseConfig::LoadPayload
nlohmann::json LoadPayload(const std::string &tag)
Definition: DatabaseConfig.cxx:78
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
dqi::DatabaseConfig::m_jsonData
std::unordered_map< std::string, nlohmann::json > m_jsonData
Definition: DatabaseConfig.h:31
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
dqi
Definition: CompositeAlgorithm.h:16
dqi::DatabaseConfig::m_runNumber
const long m_runNumber
Definition: DatabaseConfig.h:26
dqi::DatabaseConfig::Disconnect
void Disconnect()
Definition: DatabaseConfig.cxx:31