#include <Cool2Json.h>
Definition at line 26 of file Cool2Json.h.
◆ FolderType
Enumerator |
---|
AttrList | |
AttrListColl | |
PoolRef | |
PoolRefColl | |
CoraCool | |
CoolVector | |
JSON | |
NUM_FOLDER_TYPES | |
Definition at line 70 of file Cool2Json.h.
◆ Cool2Json()
IOVDbNamespace::Cool2Json::Cool2Json |
( |
const cool::IFolderPtr & |
pFolder, |
|
|
const cool::ValidityKey & |
since, |
|
|
const cool::ValidityKey & |
until, |
|
|
const cool::ChannelSelection & |
m_chansel, |
|
|
const std::string & |
folderTag |
|
) |
| |
Definition at line 59 of file Cool2Json.cxx.
69 m_desc(pFolder->description()),
70 m_spec(spec2String(pFolder)),
72 const auto & channums=pFolder->listChannels();
75 for (
const auto &
i:channums){
◆ close()
static std::string IOVDbNamespace::Cool2Json::close |
( |
| ) |
|
|
static |
◆ delimiter()
static std::string IOVDbNamespace::Cool2Json::delimiter |
( |
| ) |
|
|
static |
json standard delimiter ', '
◆ description()
std::string IOVDbNamespace::Cool2Json::description |
( |
| ) |
const |
Folder description string.
Definition at line 81 of file Cool2Json.cxx.
83 std::string
out =
"\"node_description\" : \"";
◆ formatAttrList()
std::string IOVDbNamespace::Cool2Json::formatAttrList |
( |
const cool::IObjectIteratorPtr & |
itr | ) |
|
|
staticprivate |
◆ formatCvp()
std::string IOVDbNamespace::Cool2Json::formatCvp |
( |
const cool::IObjectIteratorPtr & |
itr | ) |
|
|
staticprivate |
Definition at line 157 of file Cool2Json.cxx.
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;
◆ formatPoolRef()
std::string IOVDbNamespace::Cool2Json::formatPoolRef |
( |
const cool::IObjectIteratorPtr & |
itr | ) |
|
|
staticprivate |
Definition at line 183 of file Cool2Json.cxx.
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);
◆ iov()
std::string IOVDbNamespace::Cool2Json::iov |
( |
| ) |
const |
Formatted iov as '[<since>, <until>]'.
Definition at line 196 of file Cool2Json.cxx.
197 std::string iovString(
"\"iov\" : ");
◆ iovBase()
std::string IOVDbNamespace::Cool2Json::iovBase |
( |
| ) |
const |
'time' (ns of epoch) or 'run-lumi'
Definition at line 142 of file Cool2Json.cxx.
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";
◆ nchans()
unsigned int IOVDbNamespace::Cool2Json::nchans |
( |
| ) |
const |
◆ open()
static std::string IOVDbNamespace::Cool2Json::open |
( |
| ) |
|
|
static |
◆ payload()
std::string IOVDbNamespace::Cool2Json::payload |
( |
| ) |
|
Payload (data for the given channel selection and iov)
Definition at line 96 of file Cool2Json.cxx.
97 std::string
result(
"\"data_array\" : [");
101 while (itr->goToNext()){
102 const cool::IObject&
ref=itr->currentRef();
104 const long long cId=
ref.channelId();
◆ payloadSpec()
const std::string & IOVDbNamespace::Cool2Json::payloadSpec |
( |
| ) |
const |
Payload specification for this folder.
Definition at line 90 of file Cool2Json.cxx.
◆ tag()
const std::string & IOVDbNamespace::Cool2Json::tag |
( |
| ) |
const |
Simply the tag string passed to the constructor.
Definition at line 152 of file Cool2Json.cxx.
◆ operator<<
◆ m_chansel
const cool::ChannelSelection IOVDbNamespace::Cool2Json::m_chansel |
|
private |
◆ m_desc
const std::string IOVDbNamespace::Cool2Json::m_desc |
|
private |
◆ m_nchans
unsigned int IOVDbNamespace::Cool2Json::m_nchans |
|
private |
◆ m_pFolder
const cool::IFolderPtr IOVDbNamespace::Cool2Json::m_pFolder |
|
private |
◆ m_spec
const std::string IOVDbNamespace::Cool2Json::m_spec |
|
private |
◆ m_start
const cool::ValidityKey IOVDbNamespace::Cool2Json::m_start |
|
private |
◆ m_stop
const cool::ValidityKey IOVDbNamespace::Cool2Json::m_stop |
|
private |
◆ m_tag
const std::string IOVDbNamespace::Cool2Json::m_tag |
|
private |
The documentation for this class was generated from the following files:
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.