ATLAS Offline Software
PileUpEventInfoCnv_p5.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 static const EventInfoCnv_p4 evInfoConv;
10 
11 void PileUpEventInfoCnv_p5::transToPers(const PileUpEventInfo* trans, PileUpEventInfo_p5* pers, MsgStream &log) const {
12  evInfoConv.transToPers(trans, pers, log);
13 
14  pers->m_subEvents.clear();
15  /*
16  size_t sub_ev_n = trans->m_subEvents.size();
17  pers->m_subEvents.resize(sub_ev_n);
18  PileUpEventInfo::SubEvent::const_iterator sub_iter = trans->beginSubEvt();
19  PileUpEventInfo_p5::SubEvVect_t::iterator p_sub_iter = pers->m_subEvents.begin();
20  size_t sub_ev_n = std::distance (sub_iter, trans->endSubEvt());
21  pers->m_subEvents.resize(sub_ev_n);
22  while( sub_iter!=trans->endSubEvt() ) {
23  p_sub_iter->m_time = sub_iter->time();
24  p_sub_iter->m_index = sub_iter->index();
25  p_sub_iter->m_type = static_cast<short>(sub_iter->type());
26  evInfoConv.transToPers(sub_iter->pSubEvt, &p_sub_iter->m_subEventInfo, log);
27  p_sub_iter++; sub_iter++;
28  }
29  */
30 }
31 
32 void PileUpEventInfoCnv_p5::persToTrans(const PileUpEventInfo_p5* pers, PileUpEventInfo* trans, MsgStream &log) const
33 {
34  *trans = PileUpEventInfo();
35  evInfoConv.persToTrans(pers, trans, log);
36 
37  PileUpEventInfo_p5::SubEvVect_t::const_iterator p_sub_iter = pers->m_subEvents.begin();
38  while( p_sub_iter != pers->m_subEvents.end() ) {
39  trans->addSubEvt (p_sub_iter->m_time,
40  //p_sub_iter->m_index,
41  static_cast<PileUpTimeEventIndex::PileUpType>(p_sub_iter->m_type),
42  std::unique_ptr<EventInfo>
43  (evInfoConv.createTransientConst(&p_sub_iter->m_subEventInfo, log)),
44  nullptr);
45  ++p_sub_iter;
46  }
47 }
EventInfoCnv_p4
Definition: EventInfoCnv_p4.h:13
PileUpEventInfo.h
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
PileUpTimeEventIndex::PileUpType
PileUpType
Definition: PileUpTimeEventIndex.h:14
PileUpEventInfoCnv_p5.h
PileUpEventInfo
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old PileUpEventInfo
Definition: EventTPCnv.cxx:87
EventInfoCnv_p4::transToPers
virtual void transToPers(const EventInfo *transObj, EventInfo_p4 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p4.cxx:21
PileUpEventInfoCnv_p5::persToTrans
virtual void persToTrans(const PileUpEventInfo_p5 *persObj, PileUpEventInfo *transObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p5.cxx:32
PileUpEventInfo::addSubEvt
void addSubEvt(time_type t, PileUpTimeEventIndex::PileUpType puType, const EventInfo *pse, StoreGateSvc *psg)
setter for the subEvt collection t=0(ns) for the original event
Definition: PileUpEventInfo.h:104
EventInfoCnv_p4::createTransientConst
virtual EventInfo * createTransientConst(const EventInfo_p4 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p4.cxx:48
PileUpEventInfo
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
Definition: PileUpEventInfo.h:37
EventInfoCnv_p4.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
PileUpEventInfo_p5
Definition: PileUpEventInfo_p5.h:20
EventInfoCnv_p4::persToTrans
virtual void persToTrans(const EventInfo_p4 *persObj, EventInfo *transObj, MsgStream &log) const override
Definition: EventInfoCnv_p4.cxx:37
PileUpEventInfo_p5::m_subEvents
SubEvVect_t m_subEvents
Definition: PileUpEventInfo_p5.h:34
PileUpEventInfoCnv_p5::transToPers
virtual void transToPers(const PileUpEventInfo *transObj, PileUpEventInfo_p5 *persObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p5.cxx:11