ATLAS Offline Software
PileUpEventInfoCnv_p4.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_p3 evInfoConv;
10 
11 void PileUpEventInfoCnv_p4::transToPers(const PileUpEventInfo* trans, PileUpEventInfo_p4* pers, MsgStream &log) const {
12  evInfoConv.transToPers(trans, pers, log);
13 
15  size_t sub_ev_n = std::distance (sub_iter, trans->endSubEvt());
16  pers->m_subEvents.resize(sub_ev_n);
17  PileUpEventInfo_p4::SubEvVect_t::iterator p_sub_iter = pers->m_subEvents.begin();
18  while( sub_iter!=trans->endSubEvt() ) {
19  p_sub_iter->m_time = sub_iter->time();
20  p_sub_iter->m_index = sub_iter->index();
21  p_sub_iter->m_type = static_cast<short>(sub_iter->type());
22  evInfoConv.transToPers(sub_iter->pSubEvt, &p_sub_iter->m_subEventInfo, log);
23  ++p_sub_iter; ++sub_iter;
24  }
25 }
26 
27 void PileUpEventInfoCnv_p4::persToTrans(const PileUpEventInfo_p4* pers, PileUpEventInfo* trans, MsgStream &log) const
28 {
29  *trans = PileUpEventInfo();
30  evInfoConv.persToTrans(pers, trans, log);
31 
32  PileUpEventInfo_p4::SubEvVect_t::const_iterator p_sub_iter = pers->m_subEvents.begin();
33  while( p_sub_iter != pers->m_subEvents.end() ) {
34  trans->addSubEvt (p_sub_iter->m_time,
35  //p_sub_iter->m_index,
36  static_cast<PileUpTimeEventIndex::PileUpType>(p_sub_iter->m_type),
37  std::unique_ptr<EventInfo>
38  (evInfoConv.createTransientConst(&p_sub_iter->m_subEventInfo, log)),
39  nullptr);
40  ++p_sub_iter;
41  }
42 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
PileUpEventInfo.h
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
EventInfoCnv_p3::createTransientConst
virtual EventInfo * createTransientConst(const EventInfo_p3 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p3.cxx:104
PileUpTimeEventIndex::PileUpType
PileUpType
Definition: PileUpTimeEventIndex.h:14
PileUpEventInfoCnv_p4.h
PileUpEventInfo::beginSubEvt
SubEvent::iterator beginSubEvt()
Definition: PileUpEventInfo.h:131
EventInfoCnv_p3::persToTrans
virtual void persToTrans(const EventInfo_p3 *persObj, EventInfo *transObj, MsgStream &log) const override
Definition: EventInfoCnv_p3.cxx:20
PileUpEventInfo
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old PileUpEventInfo
Definition: EventTPCnv.cxx:87
PileUpEventInfo_p4
Definition: PileUpEventInfo_p4.h:20
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_p3.h
PileUpEventInfo_p4::m_subEvents
SubEvVect_t m_subEvents
Definition: PileUpEventInfo_p4.h:34
PileUpEventInfo
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
Definition: PileUpEventInfo.h:37
PileUpEventInfo::SubEvent::const_iterator
std::list< SubEvent >::const_iterator const_iterator
Definition: PileUpEventInfo.h:97
PileUpEventInfoCnv_p4::persToTrans
virtual void persToTrans(const PileUpEventInfo_p4 *persObj, PileUpEventInfo *transObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p4.cxx:27
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
EventInfoCnv_p3
Definition: EventInfoCnv_p3.h:13
PileUpEventInfoCnv_p4::transToPers
virtual void transToPers(const PileUpEventInfo *transObj, PileUpEventInfo_p4 *persObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p4.cxx:11
EventInfoCnv_p3::transToPers
virtual void transToPers(const EventInfo *transObj, EventInfo_p3 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p3.cxx:59
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
PileUpEventInfo::endSubEvt
SubEvent::iterator endSubEvt()
Definition: PileUpEventInfo.h:132