ATLAS Offline Software
Tracking
TrkEventCnv
TrkTruthTPCnv
src
PRD_MultiTruthCollectionCnv_p3.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
// Olivier Arnaez <olivier.arnaez@cern.ch>, 2015
8
9
#include "
TrkTruthTPCnv/PRD_MultiTruthCollectionCnv_p3.h
"
10
11
#include "
TrkTruthTPCnv/PRD_MultiTruthCollection_p3.h
"
12
#include "
TrkTruthData/PRD_MultiTruthCollection.h
"
13
14
#include "
GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p2.h
"
15
16
namespace
{
17
const
HepMcParticleLinkCnv_p2
particleLinkConverter;
18
}
19
20
21
void
PRD_MultiTruthCollectionCnv_p3::persToTrans
(
const
Trk::PRD_MultiTruthCollection_p3
* pers,
22
PRD_MultiTruthCollection
* trans,
23
MsgStream&
msg
)
24
{
25
msg
<<
MSG::DEBUG
<<
"PRD_MultiTruthCollectionCnv_p3::persToTrans()"
<<
endmsg
;
26
27
for
(
const
Trk::PRD_MultiTruthCollection_p3::Entry
& ent : pers->
m_entries
) {
28
HepMcParticleLink
link;
29
particleLinkConverter.persToTrans(&ent.
particle
, &link,
msg
);
30
trans->insert(trans->end(), std::make_pair(
Identifier
(ent.
id
), link) );
31
}
32
33
msg
<<
MSG::DEBUG
<<
"PRD_MultiTruthCollectionCnv_p3::persToTrans() DONE"
<<
endmsg
;
34
}
35
36
void
PRD_MultiTruthCollectionCnv_p3::transToPers
(
const
PRD_MultiTruthCollection
* trans,
37
Trk::PRD_MultiTruthCollection_p3
* pers,
38
MsgStream&
msg
)
39
{
40
msg
<<
MSG::DEBUG
<<
"PRD_MultiTruthCollectionCnv_p3::transToPers()"
<<
endmsg
;
41
42
pers->
m_entries
.reserve(trans->size());
43
44
for
(
const
auto
&
p
: *trans) {
45
HepMcParticleLink_p2
link;
46
particleLinkConverter.transToPers(&
p
.second, &link,
msg
);
47
pers->
m_entries
.push_back(
Trk::PRD_MultiTruthCollection_p3::Entry
(
p
.first.get_compact(), link));
48
}
49
50
msg
<<
MSG::DEBUG
<<
"PRD_MultiTruthCollectionCnv_p3::transToPers() DONE"
<<
endmsg
;
51
}
PRD_MultiTruthCollectionCnv_p3.h
Trk::PRD_MultiTruthCollection_p3::Entry::id
unsigned long long id
Definition:
PRD_MultiTruthCollection_p3.h:23
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition:
PRD_MultiTruthCollection.h:24
PRD_MultiTruthCollectionCnv_p3::transToPers
virtual void transToPers(const PRD_MultiTruthCollection *transObj, Trk::PRD_MultiTruthCollection_p3 *persObj, MsgStream &msg)
Method creating the persistent representation PRD_MultiTruthCollection_p3 from its transient represen...
Definition:
PRD_MultiTruthCollectionCnv_p3.cxx:36
PRD_MultiTruthCollectionCnv_p3::persToTrans
virtual void persToTrans(const Trk::PRD_MultiTruthCollection_p3 *persObj, PRD_MultiTruthCollection *transObj, MsgStream &msg)
Method creating the transient representation of Analysis::PRD_MultiTruthCollection from its persisten...
Definition:
PRD_MultiTruthCollectionCnv_p3.cxx:21
HepMcParticleLink
a link optimized in size for a GenParticle in a McEventCollection
Definition:
HepMcParticleLink.h:72
PRD_MultiTruthCollection_p3.h
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:210
endmsg
#define endmsg
Definition:
AnalysisConfig_Ntuple.cxx:63
Trk::PRD_MultiTruthCollection_p3
Definition:
PRD_MultiTruthCollection_p3.h:19
Trk::PRD_MultiTruthCollection_p3::m_entries
CollectionType m_entries
Definition:
PRD_MultiTruthCollection_p3.h:31
Trk::PRD_MultiTruthCollection_p3::Entry
Definition:
PRD_MultiTruthCollection_p3.h:22
HepMcParticleLinkCnv_p2.h
DEBUG
#define DEBUG
Definition:
page_access.h:11
Trk::PRD_MultiTruthCollection_p3::Entry::particle
HepMcParticleLink_p2 particle
Definition:
PRD_MultiTruthCollection_p3.h:24
PRD_MultiTruthCollection.h
HepMcParticleLink_p2
Definition:
HepMcParticleLink_p2.h:17
HepMcParticleLinkCnv_p2
Definition:
HepMcParticleLinkCnv_p2.h:29
python.AutoConfigFlags.msg
msg
Definition:
AutoConfigFlags.py:7
Identifier
Definition:
IdentifierFieldParser.cxx:14
Generated on Sun Dec 22 2024 21:16:38 for ATLAS Offline Software by
1.8.18