ATLAS Offline Software
EventStreamInfoCnv_p3.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #include "EventInfo/EventType.h"
13 
16 
17 static const EventTypeCnv_p3 typeConv;
18 
19 void EventStreamInfoCnv_p3::persToTrans(const EventStreamInfo_p3* pers, EventStreamInfo* trans, MsgStream &log) const {
20  *trans = EventStreamInfo();
21  trans->addEvent (pers->m_numberOfEvents);
22 
23  for (unsigned int rn : pers->m_runNumbers)
24  trans->insertRunNumber (rn);
25  for (unsigned int lbn : pers->m_lumiBlockNumbers)
26  trans->insertLumiBlockNumber (lbn);
27  for (const std::string& tag : pers->m_processingTags)
28  trans->insertProcessingTag (tag);
29  for (const std::pair<CLID, std::string>& p : pers->m_itemList)
30  trans->insertItemList (p.first, p.second);
31  for (const EventType_p3& ptype : pers->m_eventTypes)
32  {
33  std::unique_ptr<EventType> p (typeConv.createTransientConst(&ptype, log));
34  trans->insertEventType(*p);
35  }
36 }
37 
38 void EventStreamInfoCnv_p3::transToPers(const EventStreamInfo* trans, EventStreamInfo_p3* pers, MsgStream &log) const {
39  pers->m_numberOfEvents = trans->getNumberOfEvents();
40 
41  pers->m_runNumbers.assign (trans->getRunNumbers().begin(),
42  trans->getRunNumbers().end());
43 
44  pers->m_lumiBlockNumbers.assign (trans->getLumiBlockNumbers().begin(),
45  trans->getLumiBlockNumbers().end());
46 
47  pers->m_processingTags.assign (trans->getProcessingTags().begin(),
48  trans->getProcessingTags().end());
49 
50  pers->m_itemList.assign (trans->getItemList().begin(),
51  trans->getItemList().end());
52 
53  pers->m_eventTypes.reserve(trans->getEventTypes().size());
54  pers->m_eventTypes.clear();
55  for (const EventType& ttype : trans->getEventTypes()) {
56  EventType_p3 ptype;
57  typeConv.transToPers(&ttype, &ptype, log);
58  pers->m_eventTypes.push_back(ptype);
59  }
60 }
EventType_p3
Definition: EventType_p3.h:18
EventStreamInfo_p3::m_itemList
std::vector< std::pair< unsigned int, std::string > > m_itemList
Definition: EventStreamInfo_p3.h:44
EventStreamInfo::getRunNumbers
const std::set< unsigned int > & getRunNumbers() const
Definition: EventStreamInfo.cxx:23
EventStreamInfo_p3::m_lumiBlockNumbers
std::vector< unsigned int > m_lumiBlockNumbers
Definition: EventStreamInfo_p3.h:42
EventType
This class represents the "type of event" where the type is given by one or more "characteristics".
Definition: EventType.h:92
EventStreamInfo::getProcessingTags
const std::set< std::string > & getProcessingTags() const
Definition: EventStreamInfo.cxx:35
EventStreamInfo
Athena::TPCnvVers::Old Athena::TPCnvVers::Current EventStreamInfo
Definition: EventTPCnv.cxx:67
EventStreamInfo::getEventTypes
const std::set< EventType > & getEventTypes() const
Definition: EventStreamInfo.cxx:47
EventTypeCnv_p3
Definition: EventTypeCnv_p3.h:13
EventType.h
This class provides general information about an event. It extends EventInfo with a list of sub-evts ...
EventStreamInfo.h
This file contains the class definition for the EventStreamInfo class.
EventStreamInfo_p3
This class is the persistent representation of EventStreamInfo.
Definition: EventStreamInfo_p3.h:22
EventStreamInfo::getLumiBlockNumbers
const std::set< unsigned int > & getLumiBlockNumbers() const
Definition: EventStreamInfo.cxx:29
EventStreamInfoCnv_p3::persToTrans
virtual void persToTrans(const EventStreamInfo_p3 *persObj, EventStreamInfo *transObj, MsgStream &log) const override
Definition: EventStreamInfoCnv_p3.cxx:19
EventTypeCnv_p3::createTransientConst
virtual EventType * createTransientConst(const EventType_p3 *persObj, MsgStream &log) const override
Definition: EventTypeCnv_p3.cxx:40
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
EventStreamInfo::insertRunNumber
void insertRunNumber(unsigned int run)
Insert new Run Number into a set.
Definition: EventStreamInfo.cxx:59
python.BunchSpacingUtils.rn
rn
Definition: BunchSpacingUtils.py:87
EventStreamInfo::addEvent
void addEvent(unsigned int number=1)
Increase Event Counter.
Definition: EventStreamInfo.cxx:53
EventStreamInfoCnv_p3.h
This file contains the class definition for the EventStreamInfoCnv_p3 class.
EventStreamInfo::insertProcessingTag
void insertProcessingTag(const std::string &process)
Insert new Processing Tag into a set.
Definition: EventStreamInfo.cxx:71
EventTypeCnv_p3::transToPers
virtual void transToPers(const EventType *transObj, EventType_p3 *persObj, MsgStream &log) const override
Definition: EventTypeCnv_p3.cxx:8
EventStreamInfo::getNumberOfEvents
unsigned int getNumberOfEvents() const
Definition: EventStreamInfo.cxx:17
EventStreamInfo::getItemList
const std::set< std::pair< CLID, std::string > > & getItemList() const
Definition: EventStreamInfo.cxx:41
EventStreamInfo_p3::m_eventTypes
std::vector< EventType_p3 > m_eventTypes
Definition: EventStreamInfo_p3.h:45
EventStreamInfo_p3::m_runNumbers
std::vector< unsigned int > m_runNumbers
Definition: EventStreamInfo_p3.h:41
EventStreamInfo
This class provides the summary information stored for data written as a Event Stream.
Definition: EventStreamInfo.h:28
EventStreamInfoCnv_p3::transToPers
virtual void transToPers(const EventStreamInfo *transObj, EventStreamInfo_p3 *persObj, MsgStream &log) const override
Definition: EventStreamInfoCnv_p3.cxx:38
EventStreamInfo_p3::m_processingTags
std::vector< std::string > m_processingTags
Definition: EventStreamInfo_p3.h:43
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
EventStreamInfo::insertItemList
void insertItemList(CLID type, const std::string &key)
Insert new ItemList Entry into a set.
Definition: EventStreamInfo.cxx:77
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
EventStreamInfo_p3::m_numberOfEvents
unsigned int m_numberOfEvents
Definition: EventStreamInfo_p3.h:40
EventTypeCnv_p3.h
EventStreamInfo::insertEventType
void insertEventType(const EventType &event)
Insert new Event Type into a set.
Definition: EventStreamInfo.cxx:83
EventStreamInfo::insertLumiBlockNumber
void insertLumiBlockNumber(unsigned int lumiBlock)
Insert new Luminosity Block Number into a set.
Definition: EventStreamInfo.cxx:65
LB_AnalMapSplitter.lbn
lbn
Definition: LB_AnalMapSplitter.py:28