|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #include "CoralBase/Date.h"
10 #include "CoralBase/TimeStamp.h"
22 log <<
MSG::DEBUG <<
"IOVPayloadContainerCnv_p1::persToTrans - entering "
43 bool isEarlyVersion = persObj->
m_attrType.size() > 0;
53 payloadVec.push_back(transColl);
56 typedef std::vector<IOVPayloadContainer_p1::CondAttrListEntry_p1>::const_iterator attrListIt_t;
58 attrListIt_t itattrList = persColl.
m_attrLists.begin();
59 attrListIt_t lastAttrList = persColl.
m_attrLists.end();
60 for (; itattrList != lastAttrList; ++itattrList) {
67 unsigned int inameOld = 0;
68 for (
unsigned int iattr =
entry.m_firstIndex;
69 iattr <
entry.m_lastIndex; ++iattr, ++inameOld) {
74 <<
"IOVPayloadContainerCnv_p1::persToTrans attribute index bigger than array size "
75 << iattr <<
" " << persObj->
m_attrIndexes.size() <<
" last index "
81 if (!isEarlyVersion) {
99 bool indexesOK =
true;
102 log << MSG::WARNING <<
"IOVPayloadContainerCnv_p1::persToTrans name index bigger than name/type size. index "
103 << inameOld <<
" name size " << persObj->
m_attrName.size()
104 <<
" attr size " << persObj->
m_attrType.size()
105 <<
" last index " <<
entry.m_lastIndex
106 <<
" Most likely unfilled attribute list. Skipping to the next attrlist entry."
117 unsigned int itype = persObj->
m_attrType[inameOld];
126 unsigned int itype = indexes.
typeIndex();
127 typedef std::map<std::string, unsigned int>::const_iterator it_type;
130 for (; typeIt != endType; ++typeIt) {
131 if (itype == typeIt->second) {
136 std::string
name =
"unknown";
161 transColl->
add(
entry.m_channelNumber, attrList);
163 bool hasIOV = !(
entry.m_range.m_start == 0 &&
entry.m_range.m_stop == 0);
186 if (
entry.m_name.size()) {
218 log <<
MSG::DEBUG <<
"IOVPayloadContainerCnv_p1::transToPers "
232 log <<
MSG::DEBUG <<
"IOVPayloadContainerCnv_p1::transToPers - empty attr list spec "
242 unsigned int ipcoll = 0;
245 for (;
it != last; ++
it, ++ipcoll) {
253 if (isRunLumiBlock) {
271 unsigned int ientry = 0;
272 for (; itAttr != lastAttr; ++itAttr, ++ientry) {
275 unsigned int chan = (*itAttr).first;
280 entry.m_range.m_start = 0;
281 entry.m_range.m_stop = 0;
285 if (iovIt != tColl->
iov_end()) {
287 if (isRunLumiBlock) {
288 entry.m_range.m_start = iovIt->second.start().re_time();
289 entry.m_range.m_stop = iovIt->second.stop().re_time();
292 entry.m_range.m_start = iovIt->second.start().timestamp();
293 entry.m_range.m_stop = iovIt->second.stop().timestamp();
307 coral::AttributeList::const_iterator itAttr = attrList.begin();
308 coral::AttributeList::const_iterator itLast = attrList.end();
309 for (; itAttr != itLast; ++itAttr) {
311 std::string
typeName = itAttr->specification().typeName();
312 std::map<std::string, unsigned int>::const_iterator attIt =
315 log << MSG::ERROR <<
"IOVPayloadContainerCnv_p1::transToPers - cannot find attibute type in map - name "
319 unsigned int itype = attIt->second;
321 std::string
name = itAttr->specification().name();
324 log << MSG::ERROR <<
"IOVPayloadContainerCnv_p1::transToPers - cannot find attibute name in map - name "
328 unsigned int iname = attIt->second;
348 log <<
MSG::DEBUG <<
"IOVPayloadContainerCnv_p1::fillPersAttrSpec IOVPayloadContainer size "
359 std::set<std::string>
names;
363 for (; itPayload != itPayloadEnd; ++itPayload) {
368 for (; itColl != itCollEnd; ++itColl) {
371 coral::AttributeList::const_iterator
it = attrList.begin();
372 coral::AttributeList::const_iterator last = attrList.end();
373 for (;
it != last; ++
it) {
374 const coral::Attribute& attr = *
it;
375 std::string
name = attr.specification().name();
376 std::string
typeName = attr.specification().typeName();
387 unsigned int iname = 0;
391 for (; itName != itNameEnd; ++itName) {
399 log <<
MSG::DEBUG <<
"IOVPayloadContainerCnv_p1::fillPersAttrSpec number of attribute names "
452 unsigned int attrType,
453 const coral::Attribute& attr,
463 persObj->
m_bool.push_back(attr.data<
bool>());
468 persObj->
m_char.push_back(attr.data<
char>());
479 persObj->
m_short.push_back(attr.data<
short>());
490 persObj->
m_int.push_back(attr.data<
int>());
501 persObj->
m_long.push_back(attr.data<
long>());
512 persObj->
m_longLong.push_back(attr.data<
long long>());
523 persObj->
m_float.push_back(attr.data<
float>());
528 persObj->
m_double.push_back(attr.data<
double>());
538 persObj->
m_string.push_back(attr.data<std::string>());
542 <<
"IOVPayloadContainerCnv_p1::fillAttributeData - cannot currently treat BLOB type "
563 const std::string&
name,
589 unsigned int objIndex =
index.objIndex();
601 switch (
index.typeIndex()) {
649 <<
"IOVPayloadContainerCnv_p1::fillAttributeData - cannot currently treat BLOB type "
654 coral::TimeStamp::ValueType
ns( persObj->
m_date[objIndex +
offset] );
660 coral::TimeStamp::ValueType
ns =
JetConstituentVector::iterator iterator
const IOVRange & minRange() const
Current minimal IOVRange.
std::vector< AttrListIndexes > m_attrIndexes
This class is a container for the payload of conditions data. It is intended to be used to store cond...
const_iterator end() const
std::vector< short > m_short
std::vector< double > m_double
std::vector< CondAttrListCollection * > payloadVec
Validity Range object. Holds two IOVTimes (start and stop)
iov_const_iterator iov_end() const
unsigned long long m_stop
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
Indexes to attribute name, type name and object value for the persistent storage of an attribute list...
std::vector< unsigned long long > m_unsignedLongLong
std::vector< unsigned int > m_unsignedInt
void addNewStop(const IOVTime &stop)
Add new stop time to minRange - make sure that stop is <= to new stop
std::vector< float > m_float
const IOVTime & start() const
uint64_t timestamp() const noexcept
std::vector< long > m_long
uint64_t re_time() const noexcept
unsigned long long m_start
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
void addNewStart(const IOVTime &start)
Add new start time to minRange - make sure that start is >= to new start.
This class is a collection of AttributeLists where each one is associated with a channel number....
@ ATTR_UNSIGNED_LONG_LONG
ChanIOVMap::const_iterator iov_const_iterator
size_type size() const
size of payload vector
const IOVTime & stop() const
This class is the persistent version of a container for the payload of conditions data....
const_iterator begin() const
Begin of payload vector.
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
std::vector< char > m_char
virtual void persToTrans(const IOVPayloadContainer_p1 *persObj, IOVPayloadContainer *transObj, MsgStream &log)
unsigned short typeIndex() const
Index into the type name vector.
std::vector< std::string > m_attrName
std::vector< long long > m_longLong
std::vector< unsigned int > m_attrType
std::map< std::string, unsigned int >::value_type attrNameMapValue_t
std::vector< std::string > m_string
void fillPersAttrSpec(const IOVPayloadContainer *transObj, IOVPayloadContainer_p1 *persObj, MsgStream &log)
std::vector< unsigned short > m_unsignedShort
bool isRunEvent() const noexcept
unsigned int m_objIndexOffset[IOVPayloadContainer_p1::ATTR_TIME_STAMP+1]
std::vector< unsigned long long > m_date
This class is a container for the payload of conditions data. It is intended to be used to store cond...
const std::string & chanName(ChanNum chanNum) const
find name for particular channel
std::vector< CondAttrListEntry_p1 > m_attrLists
void fillAttributeData(unsigned int attrName, unsigned int attrType, const coral::Attribute &attr, IOVPayloadContainer_p1 *persObj, MsgStream &log)
IOVPayloadContainerCnv_p1()
unsigned short nameIndex() const
Index into attribute name vector.
size_type size() const
number of Chan/AttributeList pairs
std::vector< std::string > m_attributeTypes
def time(flags, cells_name, *args, **kw)
ChanAttrListMap::const_iterator const_iterator
payloadVec::const_iterator const_iterator
std::map< std::string, unsigned int > m_attrNameMap
const_iterator end() const
End of payload vector.
std::vector< unsigned long > m_unsignedLong
void fillAttributeTypeMap()
std::vector< unsigned char > m_unsignedChar
std::vector< CondAttrListCollection_p1 > m_payloadVec
iov_const_iterator chanIOVPair(ChanNum chanNum) const
Access to Chan/IOV pairs via channel number: returns map iterator.
bool m_hasRunLumiBlockTime
bool add(ChanNum chanNum, const AttributeList &attributeList)
Adding in chan/attrList pairs.
std::map< std::string, unsigned int > m_attributeTypeMap
std::vector< bool > m_bool
std::vector< unsigned long long > m_timeStamp
virtual void transToPers(const IOVPayloadContainer *transObj, IOVPayloadContainer_p1 *persObj, MsgStream &log)