ATLAS Offline Software
CoralCrestManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef IOVDBSVC_CORALCRESTMANAGER_H
13 #define IOVDBSVC_CORALCRESTMANAGER_H
14 #include <string>
15 #include <iostream>
16 #include <map>
17 #include <list>
18 #include <regex>
19 #include <iosfwd>
20 #include <cstdint>
21 #include "CrestApi/CrestApiBase.h"
22 #include "CrestApi/CrestRequest.h"
23 #include "FolderTypes.h"
24 #include "CoolKernel/ChannelSelection.h"
25 #include "CoolKernel/ValidityKey.h"
26 #include "CoolKernel/IFolder.h"
27 #include "CrestContainer.h"
28 
30 public:
31  static inline const std::string prefix1{"http://"};
32  static inline const std::string prefix2 {"https://"};
33 
34  CoralCrestManager(const std::string & crest_path, const std::string & crestTag);
35 
36  static std::map<std::string, std::string> getGlobalTagMap(const std::string & crest_path, const std::string& globaltag);
37 
38  void loadTagInfo();
39 
40  std::string getFolderDescription();
41 
42  Crest::TagDto& getTagDto();
43 
44  std::string getPayloadSpec();
45 
47 
48  std::pair<std::vector<cool::ChannelId> , std::vector<std::string>> getChannelList();
49 
50  Crest::TagInfoDto getTagInfoDto();
51 
52  bool isVectorPayload();
53 
54  coral::AttributeListSpecification* getAttributeListSpec();
55  std::vector<std::pair<cool::ValidityKey,std::string>> getIovsForTag(uint64_t since, uint64_t until);
56  std::vector<uint64_t> loadPayloadForHash(uint64_t since,const std::string & hash);
57  std::vector<coral::AttributeList> getVectorPayload(coral::AttributeListSpecification* pSpec,const std::string & chId);
58  std::string dumpPayload(cool::ValidityKey since);
59  coral::AttributeList getPayload(coral::AttributeListSpecification* pSpec,const std::string & chId);
60  void selectIov(cool::ValidityKey since);
61  std::vector<std::string> channelIds(cool::ValidityKey since);
62 
63 private:
64  std::unique_ptr<Crest::CrestApiBase> m_crestCl;
65  const std::string m_crestTag;
66  std::optional<Crest::TagMetaDto> m_TagMeta;
67  std::optional<Crest::TagDto> m_Tag;
68  std::optional<bool> m_isVectorPayload;
69  std::string parseTypeName(const std::string & description);
70  coral::AttributeList createAttributeList(coral::AttributeListSpecification * pSpec,nlohmann::json& j ,const std::vector<std::pair<std::string, Crest::TypeId>> & tSpec);
71  std::pair<uint64_t,uint64_t> getIovInterval(const std::string& tag, const uint64_t since, const uint64_t until);
72  std::pair<uint64_t,uint64_t> getSinceUntilPair(std::vector<uint64_t>& v, const uint64_t since, const uint64_t until);
73  void initCrestContainer();
74  std::optional<Crest::CrestContainer> m_crest_cont;
75 
76 };
77 #endif
CoralCrestManager::getIovsForTag
std::vector< std::pair< cool::ValidityKey, std::string > > getIovsForTag(uint64_t since, uint64_t until)
Definition: CoralCrestManager.cxx:237
CoralCrestManager::getTagDto
Crest::TagDto & getTagDto()
Definition: CoralCrestManager.cxx:141
CoralCrestManager::initCrestContainer
void initCrestContainer()
Definition: CoralCrestManager.cxx:181
CoralCrestManager::m_crestTag
const std::string m_crestTag
Definition: CoralCrestManager.h:65
json
nlohmann::json json
Definition: HistogramDef.cxx:9
CoralCrestManager::m_crestCl
std::unique_ptr< Crest::CrestApiBase > m_crestCl
Definition: CoralCrestManager.h:64
CoralCrestManager::loadTagInfo
void loadTagInfo()
Definition: CoralCrestManager.cxx:121
CoralCrestManager::m_isVectorPayload
std::optional< bool > m_isVectorPayload
Definition: CoralCrestManager.h:68
CoralCrestManager::getPayload
coral::AttributeList getPayload(coral::AttributeListSpecification *pSpec, const std::string &chId)
Definition: CoralCrestManager.cxx:345
CoralCrestManager
Definition: CoralCrestManager.h:29
CoralCrestManager::getAttributeListSpec
coral::AttributeListSpecification * getAttributeListSpec()
Definition: CoralCrestManager.cxx:171
CoralCrestManager::dumpPayload
std::string dumpPayload(cool::ValidityKey since)
Definition: CoralCrestManager.cxx:287
CoralCrestManager::m_crest_cont
std::optional< Crest::CrestContainer > m_crest_cont
Definition: CoralCrestManager.h:74
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
CoralCrestManager::getGlobalTagMap
static std::map< std::string, std::string > getGlobalTagMap(const std::string &crest_path, const std::string &globaltag)
Definition: CoralCrestManager.cxx:57
dq_defect_copy_defect_database.since
def since
Definition: dq_defect_copy_defect_database.py:54
CoralCrestManager::getTagInfoDto
Crest::TagInfoDto getTagInfoDto()
Definition: CoralCrestManager.cxx:135
dq_defect_copy_defect_database.until
def until
Definition: dq_defect_copy_defect_database.py:55
CoralCrestManager::getIovInterval
std::pair< uint64_t, uint64_t > getIovInterval(const std::string &tag, const uint64_t since, const uint64_t until)
Definition: CoralCrestManager.cxx:230
CoralCrestManager::getSinceUntilPair
std::pair< uint64_t, uint64_t > getSinceUntilPair(std::vector< uint64_t > &v, const uint64_t since, const uint64_t until)
Definition: CoralCrestManager.cxx:201
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
CoralCrestManager::channelIds
std::vector< std::string > channelIds(cool::ValidityKey since)
Definition: CoralCrestManager.cxx:364
CheckTagAssociation.globaltag
globaltag
Definition: CheckTagAssociation.py:18
CoralCrestManager::determineFolderType
IOVDbNamespace::FolderType determineFolderType()
Definition: CoralCrestManager.cxx:90
CoralCrestManager::getVectorPayload
std::vector< coral::AttributeList > getVectorPayload(coral::AttributeListSpecification *pSpec, const std::string &chId)
Definition: CoralCrestManager.cxx:350
CoralCrestManager::prefix2
static const std::string prefix2
Definition: CoralCrestManager.h:32
CoralCrestManager::isVectorPayload
bool isVectorPayload()
Definition: CoralCrestManager.cxx:115
CoralCrestManager::getChannelList
std::pair< std::vector< cool::ChannelId >, std::vector< std::string > > getChannelList()
Definition: CoralCrestManager.cxx:157
CrestContainer.h
Header file for CrestContainer class.
CoralCrestManager::getFolderDescription
std::string getFolderDescription()
Definition: CoralCrestManager.cxx:152
CoralCrestManager::selectIov
void selectIov(cool::ValidityKey since)
Definition: CoralCrestManager.cxx:360
python.PyAthena.v
v
Definition: PyAthena.py:154
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
CoralCrestManager::prefix1
static const std::string prefix1
Definition: CoralCrestManager.h:31
CoralCrestManager::m_TagMeta
std::optional< Crest::TagMetaDto > m_TagMeta
Definition: CoralCrestManager.h:66
FolderTypes.h
CoralCrestManager::loadPayloadForHash
std::vector< uint64_t > loadPayloadForHash(uint64_t since, const std::string &hash)
Definition: CoralCrestManager.cxx:263
CoralCrestManager::CoralCrestManager
CoralCrestManager(const std::string &crest_path, const std::string &crestTag)
Definition: CoralCrestManager.cxx:45
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:23
CoralCrestManager::m_Tag
std::optional< Crest::TagDto > m_Tag
Definition: CoralCrestManager.h:67
CoralCrestManager::parseTypeName
std::string parseTypeName(const std::string &description)
Definition: CoralCrestManager.cxx:82
CoralCrestManager::createAttributeList
coral::AttributeList createAttributeList(coral::AttributeListSpecification *pSpec, nlohmann::json &j, const std::vector< std::pair< std::string, Crest::TypeId >> &tSpec)
Definition: CoralCrestManager.cxx:369
CoralCrestManager::getPayloadSpec
std::string getPayloadSpec()
Definition: CoralCrestManager.cxx:148
IOVDbNamespace::FolderType
FolderType
Definition: FolderTypes.h:26
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88