ATLAS Offline Software
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 
15 namespace {
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) {
27  HepMcParticleLink link;
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 }
Trk::PRD_MultiTruthCollection_p2
Definition: PRD_MultiTruthCollection_p2.h:18
Trk::PRD_MultiTruthCollection_p2::Entry::id
unsigned long long id
Definition: PRD_MultiTruthCollection_p2.h:22
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
Trk::PRD_MultiTruthCollection_p2::m_entries
CollectionType m_entries
Definition: PRD_MultiTruthCollection_p2.h:30
Trk::PRD_MultiTruthCollection_p2::Entry::particle
HepMcParticleLink_p1 particle
Definition: PRD_MultiTruthCollection_p2.h:23
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
HepMcParticleLinkCnv_p1.h
HepMcParticleLinkCnv_p1
Definition: HepMcParticleLinkCnv_p1.h:33
PRD_MultiTruthCollectionCnv_p2.h
PRD_MultiTruthCollectionCnv_p2::persToTrans
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...
Definition: PRD_MultiTruthCollectionCnv_p2.cxx:20
Trk::PRD_MultiTruthCollection_p2::Entry
Definition: PRD_MultiTruthCollection_p2.h:21
PRD_MultiTruthCollectionCnv_p2::transToPers
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...
Definition: PRD_MultiTruthCollectionCnv_p2.cxx:35
DEBUG
#define DEBUG
Definition: page_access.h:11
PRD_MultiTruthCollection.h
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
PRD_MultiTruthCollection_p2.h
Identifier
Definition: IdentifierFieldParser.cxx:14