|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
    5 #include "CoolKernel/IFolderSpecification.h" 
    7 #include "CoolKernel/IObject.h" 
    8 #include "CoolKernel/IObjectIterator.h" 
    9 #include "CoolKernel/IRecord.h" 
   10 #include "CoolKernel/IRecordIterator.h" 
   11 #include "CoralBase/AttributeList.h" 
   12 #include "CoralBase/AttributeListSpecification.h" 
   13 #include "CoralBase/Attribute.h" 
   14 #include "CoralBase/AttributeSpecification.h" 
   15 #include "CoralBase/Blob.h" 
   16 #include "TStopwatch.h" 
   34 #include <nlohmann/json.hpp> 
   38   spec2String(
const cool::IFolderPtr & pFolder){
 
   40     const std::string ob=
"";
 
   41     const std::string objName=
"\"folder_payloadspec\": \"";
 
   42     std::string 
result=ob+objName;
 
   43     const auto & rspec = pFolder->payloadSpecification();
 
   46     for (
unsigned int i(0); 
i<rspec.size();++
i){
 
   47       const auto & 
f = rspec[
i];
 
   49       obj[
f.name()] = 
f.storageType().name();
 
   50       chJson.push_back(
obj);
 
   60       const cool::ValidityKey & 
since, 
 
   61       const cool::ValidityKey & 
until, 
 
   62       const cool::ChannelSelection & chansel, 
 
   70       m_spec(spec2String(pFolder)), 
 
   72     const auto & channums=pFolder->listChannels();
 
   75     for (
const auto &
i:channums){
 
   83     saneXml = std::regex_replace(saneXml, 
std::regex(
"\\\\\""), 
"\"");
 
   84     std::string 
out = 
"\"node_description\" : \"";
 
   98     std::string 
result(
"\"data_array\" : [");
 
  102     while (itr->goToNext()){
 
  103       const cool::IObject& 
ref=itr->currentRef();
 
  105       const long long cId=
ref.channelId();
 
  146     if (
m_desc.find(
"<timeStamp>run-lumi</timeStamp>") != std::string::npos) 
result = 
"run-lumi";
 
  147     if (
m_desc.find(
"<timeStamp>run-event</timeStamp>") != std::string::npos) 
result = 
"run-lumi";
 
  148     if (
m_desc.find(
"<timeStamp>time</timeStamp>") != std::string::npos) 
result = 
"time";
 
  160     const cool::IObject& 
ref=itr->currentRef();
 
  161     cool::IRecordIterator& pitr=
ref.payloadIterator();
 
  162     auto pvec=pitr.fetchAllAsVector();
 
  165     for (
const auto & vitr:*
pvec){
 
  169       if (
sep.empty()) 
sep =IOVDbNamespace::s_delimiterJson;
 
  177     const cool::IObject& 
ref=itr->currentRef();
 
  185     const cool::IObject& 
ref=itr->currentRef();
 
  187     std::ostringstream 
os;
 
  188     atrlist[0].toOutputStream(
os);
 
  190     const std::string 
sep(
" : ");
 
  191     const auto separatorPosition = 
res.find(
sep);
 
  192     const std::string payloadOnly=
res.substr(separatorPosition+3);
 
  193     return quote(payloadOnly);
 
  198     std::string iovString(
"\"iov\" : ");
 
  203     o << 
c.description() << std::endl;
 
  
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
This file contains the class definition for the CondAttrListCollAddress class.
static std::string formatCvp(const cool::IObjectIteratorPtr &itr)
std::string to_string(const SectorProjector proj)
std::ostream & operator<<(std::ostream &o, const Cool2Json &c)
const cool::ValidityKey m_stop
Cool2Json(const cool::IFolderPtr &pFolder, const cool::ValidityKey &since, const cool::ValidityKey &until, const cool::ChannelSelection &m_chansel, const std::string &folderTag)
const cool::IFolderPtr m_pFolder
A CondAttrListVec is an Athena DataObject holding a vector of CORAL AttributeLists,...
This file contains the class definition for the AthenaAttrListAddress class.
std::pair< std::vector< unsigned int >, bool > res
const cool::ValidityKey m_start
std::chrono::time_point< std::chrono::high_resolution_clock > m_start
std::string payload()
Payload (data for the given channel selection and iov)
std::string jsonAttributeList(const coral::AttributeList &atrlist)
Produce a representation of a coral::AttributeList as a json string.
const std::string & payloadSpec() const
Payload specification for this folder.
const boost::regex ref(r_ef)
static std::string formatPoolRef(const cool::IObjectIteratorPtr &itr)
static std::string formatAttrList(const cool::IObjectIteratorPtr &itr)
const std::string & tag() const
Simply the tag string passed to the constructor.
std::string iov() const
Formatted iov as '[<since>, <until>]'.
std::string description() const
Folder description string.
std::string iovBase() const
'time' (ns of epoch) or 'run-lumi'
FolderType determineFolderType(const std::string &folderDescription, const std::string &spec, const std::vector< cool::ChannelId > &chans)
Determine folder type with optional check using clid service to check clid matches typename.
unsigned int nchans() const
Number of channels in the folder.
std::string quote(const std::string &sentence)
Enclose a string in ".
std::string sanitiseXml(const std::string &pseudoXmlString)
for use when converting cool folder description JSON
This file contains the class definition for the CondAttrListVecAddress class.
const cool::ChannelSelection m_chansel
std::string description
glabal timer - how long have I taken so far?