ATLAS Offline Software
PileUpEventInfoCnv_p1.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_p1 evInfoConv;
10 
11 namespace {
12  const int MODULO(100000);
13  const double MINTIME(-2000.0); //ns
14 }
15 
16 void PileUpEventInfoCnv_p1::transToPers(const PileUpEventInfo* trans, PileUpEventInfo_p1* pers, MsgStream &log) const {
17  evInfoConv.transToPers(trans, pers, log);
18 
20  size_t sub_ev_n = std::distance (sub_iter, trans->endSubEvt());
21  pers->m_subEvents.resize(sub_ev_n);
22  PileUpEventInfo_p1::SubEvVect_t::iterator p_sub_iter = pers->m_subEvents.begin();
23  while( sub_iter!=trans->endSubEvt() ) {
24  short time = sub_iter->time();
25  short index = sub_iter->index();
26  p_sub_iter->m_timeIndex = (time - MINTIME) + MODULO * index;
27  evInfoConv.transToPers(sub_iter->pSubEvt, &p_sub_iter->m_subEventInfo, log);
28  ++p_sub_iter; ++sub_iter;
29  }
30 }
31 
32 void PileUpEventInfoCnv_p1::persToTrans(const PileUpEventInfo_p1* pers, PileUpEventInfo* trans, MsgStream &log) const
33 {
34  *trans = PileUpEventInfo();
35  evInfoConv.persToTrans(pers, trans, log);
36 
37  PileUpEventInfo_p1::SubEvVect_t::const_iterator p_sub_iter = pers->m_subEvents.begin();
38  while( p_sub_iter != pers->m_subEvents.end() ) {
39  short index1 = static_cast<short>( (p_sub_iter->m_timeIndex)*(1./MODULO) );
40  unsigned long index = MODULO*index1;
41 
42  trans->addSubEvt (static_cast<short>( MINTIME+(p_sub_iter->m_timeIndex-index) ),
43  //index1
45  std::unique_ptr<EventInfo>
46  (evInfoConv.createTransientConst(&p_sub_iter->m_subEventInfo, log)),
47  nullptr);
48  ++p_sub_iter;
49  }
50 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
EventInfoCnv_p1
Definition: EventInfoCnv_p1.h:13
PileUpEventInfo.h
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
index
Definition: index.py:1
PileUpEventInfoCnv_p1::transToPers
virtual void transToPers(const PileUpEventInfo *transObj, PileUpEventInfo_p1 *persObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p1.cxx:16
PileUpEventInfo_p1
Definition: PileUpEventInfo_p1.h:20
PileUpEventInfoCnv_p1::persToTrans
virtual void persToTrans(const PileUpEventInfo_p1 *persObj, PileUpEventInfo *transObj, MsgStream &log) const override
Definition: PileUpEventInfoCnv_p1.cxx:32
PileUpEventInfo_p1::m_subEvents
SubEvVect_t m_subEvents
Definition: PileUpEventInfo_p1.h:32
PileUpEventInfoCnv_p1.h
PileUpEventInfo::beginSubEvt
SubEvent::iterator beginSubEvt()
Definition: PileUpEventInfo.h:131
EventInfoCnv_p1::createTransientConst
virtual EventInfo * createTransientConst(const EventInfo_p1 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p1.cxx:57
Trk::index1
@ index1
Definition: BoundarySurfaceFace.h:48
PileUpEventInfo
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old PileUpEventInfo
Definition: EventTPCnv.cxx:87
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_p1.h
EventInfoCnv_p1::transToPers
virtual void transToPers(const EventInfo *transObj, EventInfo_p1 *persObj, MsgStream &log) const override
Definition: EventInfoCnv_p1.cxx:21
PileUpEventInfo
This class provides information about an overlaid event. It extends EventInfo with a list of sub-evts...
Definition: PileUpEventInfo.h:37
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
PileUpEventInfo::SubEvent::const_iterator
std::list< SubEvent >::const_iterator const_iterator
Definition: PileUpEventInfo.h:97
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
EventInfoCnv_p1::persToTrans
virtual void persToTrans(const EventInfo_p1 *persObj, EventInfo *transObj, MsgStream &log) const override
Definition: EventInfoCnv_p1.cxx:29
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
PileUpTimeEventIndex::Unknown
@ Unknown
Definition: PileUpTimeEventIndex.h:15