|
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"
36 spec2String(
const cool::IFolderPtr & pFolder){
38 const std::string ob=
"";
39 const std::string cb=
"";
40 const std::string objName=
"\"folder_payloadspec\": \"";
41 std::string
result=ob+objName;
42 const auto & rspec = pFolder->payloadSpecification();
44 for (
unsigned int i(0);
i<rspec.size();++
i){
46 const auto &
f = rspec[
i];
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 std::string
out =
"\"node_description\" : \"";
97 std::string
result(
"\"data_array\" : [");
101 while (itr->goToNext()){
102 const cool::IObject&
ref=itr->currentRef();
104 const long long cId=
ref.channelId();
145 if (
m_desc.find(
"<timeStamp>run-lumi</timeStamp>") != std::string::npos)
result =
"run-lumi";
146 if (
m_desc.find(
"<timeStamp>run-event</timeStamp>") != std::string::npos)
result =
"run-lumi";
147 if (
m_desc.find(
"<timeStamp>time</timeStamp>") != std::string::npos)
result =
"time";
159 const cool::IObject&
ref=itr->currentRef();
160 cool::IRecordIterator& pitr=
ref.payloadIterator();
161 auto pvec=pitr.fetchAllAsVector();
164 for (
const auto & vitr:*
pvec){
168 if (
sep.empty())
sep =IOVDbNamespace::s_delimiterJson;
176 const cool::IObject&
ref=itr->currentRef();
184 const cool::IObject&
ref=itr->currentRef();
186 std::ostringstream
os;
187 atrlist[0].toOutputStream(
os);
189 const std::string
sep(
" : ");
190 const auto separatorPosition =
res.find(
sep);
191 const std::string payloadOnly=
res.substr(separatorPosition+3);
192 return quote(payloadOnly);
197 std::string iovString(
"\"iov\" : ");
202 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::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 theAthenaAttrListAddress class.
std::pair< std::vector< unsigned int >, bool > res
const cool::ValidityKey m_start
std::string payload()
Payload (data for the given channel selection and iov)
std::string to_string(const DetectorType &type)
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?