ATLAS Offline Software
Loading...
Searching...
No Matches
PRD_MultiTruthCollectionCnv_p2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// T/P converter for PRD_MultiTruthCollection.
6// Andrei Gaponenko <agaponenko@lbl.gov>, 2007
7
9
12
14
15namespace {
16 const HepMcParticleLinkCnv_p1 particleLinkConverter;
17}
18
19
22 MsgStream& msg )
23{
24 msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p2::persToTrans()"<<endmsg;
25
26 for (const Trk::PRD_MultiTruthCollection_p2::Entry& ent : pers->m_entries) {
28 particleLinkConverter.persToTrans(&ent.particle, &link, msg);
29 trans->insert(trans->end(), std::make_pair(Identifier(ent.id), link) );
30 }
31
32 msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p2::persToTrans() DONE"<<endmsg;
33}
34
37 MsgStream& msg )
38{
39 msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p2::transToPers()"<<endmsg;
40
41 pers->m_entries.reserve(trans->size());
42
43 for (const auto& p : *trans) {
45 particleLinkConverter.transToPers(&p.second, &link, msg);
46 pers->m_entries.push_back(Trk::PRD_MultiTruthCollection_p2::Entry(p.first.get_compact(), link));
47 }
48
49 msg<<MSG::DEBUG<<"PRD_MultiTruthCollectionCnv_p2::transToPers() DONE"<<endmsg;
50}
#define endmsg
virtual void transToPers(const PRD_MultiTruthCollection *transObj, Trk::PRD_MultiTruthCollection_p2 *persObj, MsgStream &msg)
Method creating the persistent representation PRD_MultiTruthCollection_p2 from its transient represen...
virtual void persToTrans(const Trk::PRD_MultiTruthCollection_p2 *persObj, PRD_MultiTruthCollection *transObj, MsgStream &msg)
Method creating the transient representation of Analysis::PRD_MultiTruthCollection from its persisten...
A PRD is mapped onto all contributing particles.
MsgStream & msg
Definition testRead.cxx:32