Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CrestFunctions.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef IOVDBSVC_CRESTFUNCTIONS_H
13 #define IOVDBSVC_CRESTFUNCTIONS_H
14 
15 #include <vector>
16 #include <string>
17 #include <map> //also contains std::pair
18 #include <string_view>
19 
20 #include "CoolKernel/ChannelId.h"
21 
22 #include "nlohmann/json.hpp"
23 
24 #include <CrestApi/CrestApiBase.h>
25 
26 
27 namespace IOVDbNamespace{
28  typedef std::pair<std::string,std::string> IovHashPair; // <IOV,Hash> pairs extracted from Json
29 
31  {
32 
33  public:
34 
35  CrestFunctions(const std::string & crest_path);
36 
37  const std::string & getURLBase();
38 
39  void setURLBase(const std::string & crest_path);
40 
41  std::string
42  extractHashFromJson(const std::string & jsonReply);
43 
44  std::vector<IovHashPair>
45  getIovsForTag(const std::string & tag, uint64_t since, uint64_t until);
46 
47  std::string
48  getLastHashForTag(const std::string & tag);
49 
50  std::string
51  getPayloadForHash(const std::string & hash);
52 
53  std::vector<uint64_t>
54  getIovGroups(const std::string & tag);
55 
56  std::pair<uint64_t,uint64_t>
57  getSinceUntilPair(const std::vector<uint64_t>& v, const uint64_t since, const uint64_t until);
58 
59  int
60  getTagSize(const std::string& tagname);
61 
62  std::pair<uint64_t,uint64_t>
63  getIovInterval(const std::string& tag, const uint64_t since, const uint64_t until);
64 
65  private:
66 
67  std::unique_ptr<Crest::CrestApiBase> m_crestCl;
68 
69  std::string m_CREST_PATH = "";
70 
72 
73  };
74 }
75 #endif
IOVDbNamespace::CrestFunctions::m_CREST_PATH
std::string m_CREST_PATH
Definition: CrestFunctions.h:69
IOVDbNamespace::CrestFunctions::getIovsForTag
std::vector< IovHashPair > getIovsForTag(const std::string &tag, uint64_t since, uint64_t until)
Definition: CrestFunctions.cxx:176
IOVDbNamespace::CrestFunctions::getIovInterval
std::pair< uint64_t, uint64_t > getIovInterval(const std::string &tag, const uint64_t since, const uint64_t until)
Definition: CrestFunctions.cxx:168
IOVDbNamespace::CrestFunctions::m_crestCl
std::unique_ptr< Crest::CrestApiBase > m_crestCl
Definition: CrestFunctions.h:67
json
nlohmann::json json
Definition: HistogramDef.cxx:9
IOVDbNamespace::CrestFunctions::getSinceUntilPair
std::pair< uint64_t, uint64_t > getSinceUntilPair(const std::vector< uint64_t > &v, const uint64_t since, const uint64_t until)
Definition: CrestFunctions.cxx:127
IOVDbNamespace::CrestFunctions::setURLBase
void setURLBase(const std::string &crest_path)
Definition: CrestFunctions.cxx:43
IOVDbNamespace::IovHashPair
std::pair< std::string, std::string > IovHashPair
Definition: CrestFunctions.h:28
IOVDbNamespace::CrestFunctions::CrestFunctions
CrestFunctions(const std::string &crest_path)
Definition: CrestFunctions.cxx:24
IOVDbNamespace::CrestFunctions::extractHashFromJson
std::string extractHashFromJson(const std::string &jsonReply)
Definition: CrestFunctions.cxx:49
dq_defect_copy_defect_database.since
def since
Definition: dq_defect_copy_defect_database.py:54
dq_defect_copy_defect_database.until
def until
Definition: dq_defect_copy_defect_database.py:55
IOVDbNamespace::CrestFunctions
Definition: CrestFunctions.h:31
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
python.PyAthena.v
v
Definition: PyAthena.py:154
IOVDbNamespace::CrestFunctions::getResources
nlohmann::json getResources(nlohmann::json &js)
Definition: CrestFunctions.cxx:103
IOVDbNamespace::CrestFunctions::getURLBase
const std::string & getURLBase()
Definition: CrestFunctions.cxx:38
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
IOVDbNamespace::CrestFunctions::getPayloadForHash
std::string getPayloadForHash(const std::string &hash)
Definition: CrestFunctions.cxx:88
IOVDbNamespace::CrestFunctions::getIovGroups
std::vector< uint64_t > getIovGroups(const std::string &tag)
Definition: CrestFunctions.cxx:110
tagname
Definition: tagname.h:29
IOVDbNamespace::CrestFunctions::getTagSize
int getTagSize(const std::string &tagname)
Definition: CrestFunctions.cxx:157
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IOVDbNamespace::CrestFunctions::getLastHashForTag
std::string getLastHashForTag(const std::string &tag)
Definition: CrestFunctions.cxx:68
IOVDbNamespace
Definition: Base64Codec.cxx:16