Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
CoralCrestManager Class Reference

#include <CoralCrestManager.h>

Collaboration diagram for CoralCrestManager:

Public Member Functions

 CoralCrestManager (const std::string &crest_path, const std::string &crestTag)
 

Static Public Member Functions

static std::map< std::string, std::string > getGlobalTagMap (const std::string &crest_path, const std::string &globaltag)
 

Static Public Attributes

static const std::string prefix1 {"http://"}
 
static const std::string prefix2 {"https://"}
 

Private Attributes

std::unique_ptr< Crest::CrestApiBase > m_crestCl
 
const std::string m_crestTag
 

Detailed Description

Definition at line 19 of file CoralCrestManager.h.

Constructor & Destructor Documentation

◆ CoralCrestManager()

CoralCrestManager::CoralCrestManager ( const std::string &  crest_path,
const std::string &  crestTag 
)

Definition at line 18 of file CoralCrestManager.cxx.

18  :m_crestTag(crestTag){
19  if(crest_path.length()==0)
20  return;
21  if (crest_path.starts_with(CoralCrestManager::prefix1) || crest_path.starts_with(CoralCrestManager::prefix2)){
22  m_crestCl = std::make_unique<Crest::CrestApi>(Crest::CrestApi(crest_path));
23  }
24  else{
25  m_crestCl = std::make_unique<Crest::CrestApiFs>(Crest::CrestApiFs(true,crest_path));
26  }
27 
28  }

Member Function Documentation

◆ getGlobalTagMap()

std::map< std::string, std::string > CoralCrestManager::getGlobalTagMap ( const std::string &  crest_path,
const std::string &  globaltag 
)
static

Definition at line 29 of file CoralCrestManager.cxx.

29  {
30  Crest::CrestApiBase* crestCl=NULL;
31  if (crest_path.starts_with(CoralCrestManager::prefix1) || crest_path.starts_with(CoralCrestManager::prefix2)){
32  crestCl = new Crest::CrestApi(crest_path);
33  }
34  else{
35  crestCl = new Crest::CrestApiFs(true,crest_path);
36  }
37  std::map<std::string, std::string> tagmap;
38  try{
39  Crest::GlobalTagMapSetDto dto = crestCl->findGlobalTagMap(globaltag,"Trace");
40  for (const auto &tagMapDto : dto.getResources()){
41  tagmap[tagMapDto.getLabel()]=tagMapDto.getTagName();
42  }
43  } catch (std::exception & e){
44  std::cerr<<__FILE__<<":"<<__LINE__<< ": " << e.what() << " Cannot get a global tag map for " << globaltag << std::endl;
45  }
46  if(crestCl!=NULL){
47  delete crestCl;
48  crestCl=NULL;
49  }
50  return tagmap;
51  }

Member Data Documentation

◆ m_crestCl

std::unique_ptr<Crest::CrestApiBase> CoralCrestManager::m_crestCl
private

Definition at line 26 of file CoralCrestManager.h.

◆ m_crestTag

const std::string CoralCrestManager::m_crestTag
private

Definition at line 27 of file CoralCrestManager.h.

◆ prefix1

const std::string CoralCrestManager::prefix1 {"http://"}
inlinestatic

Definition at line 21 of file CoralCrestManager.h.

◆ prefix2

const std::string CoralCrestManager::prefix2 {"https://"}
inlinestatic

Definition at line 22 of file CoralCrestManager.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
CoralCrestManager::m_crestTag
const std::string m_crestTag
Definition: CoralCrestManager.h:27
CoralCrestManager::m_crestCl
std::unique_ptr< Crest::CrestApiBase > m_crestCl
Definition: CoralCrestManager.h:26
calibdata.exception
exception
Definition: calibdata.py:496
CheckTagAssociation.globaltag
globaltag
Definition: CheckTagAssociation.py:18
CoralCrestManager::prefix2
static const std::string prefix2
Definition: CoralCrestManager.h:22
CoralCrestManager::prefix1
static const std::string prefix1
Definition: CoralCrestManager.h:21