ATLAS Offline Software
PileUpEventInfoCnv_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 
8 
9 static const EventInfoCnv_p2 evInfoConv;
10 
11 void PileUpEventInfoCnv_p3::transToPers(const PileUpEventInfo* trans, PileUpEventInfo_p3* 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_p3::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_p3::persToTrans(const PileUpEventInfo_p3* pers, PileUpEventInfo* trans, MsgStream &log) const
28 {
29  *trans = PileUpEventInfo();
30  evInfoConv.persToTrans(pers, trans, log);
31 
32  PileUpEventInfo_p3::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...
PileUpTimeEventIndex::PileUpType
PileUpType
Definition: PileUpTimeEventIndex.h:14
EventInfoCnv_p2
Definition: EventInfoCnv_p2.h:13
PileUpEventInfo_p3
Definition: PileUpEventInfo_p3.h:20
EventInfoCnv_p2.h
PileUpEventInfo::beginSubEvt
SubEvent::iterator beginSubEvt()
Definition: PileUpEventInfo.h:131
PileUpEventInfo
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old PileUpEventInfo
Definition: EventTPCnv.cxx:87
PileUpEventInfoCnv_p3::transToPers
virtual void transToPers(const PileUpEventInfo *transObj, PileUpEventInfo_p3 *persObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p3.cxx:11
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
PileUpEventInfoCnv_p3::persToTrans
virtual void persToTrans(const PileUpEventInfo_p3 *persObj, PileUpEventInfo *transObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p3.cxx:27
EventInfoCnv_p2::persToTrans
virtual void persToTrans(const EventInfo_p2 *persObj, EventInfo *transObj, MsgStream &log) const override
Definition: EventInfoCnv_p2.cxx:38
PileUpEventInfo_p3::m_subEvents
SubEvVect_t m_subEvents
Definition: PileUpEventInfo_p3.h:34
PileUpEventInfo
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
Definition: PileUpEventInfo.h:37
EventInfoCnv_p2::createTransientConst
virtual EventInfo * createTransientConst(const EventInfo_p2 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p2.cxx:46
EventInfoCnv_p2::transToPers
virtual void transToPers(const EventInfo *transObj, EventInfo_p2 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p2.cxx:21
PileUpEventInfo::SubEvent::const_iterator
std::list< SubEvent >::const_iterator const_iterator
Definition: PileUpEventInfo.h:97
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
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
PileUpEventInfoCnv_p3.h