ATLAS Offline Software
Tracking
TrkEventCnv
TrkTruthTPCnv
src
PRD_MultiTruthCollectionCnv_p4.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 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_p4.h
"
10
11
#include "
TrkTruthTPCnv/PRD_MultiTruthCollection_p4.h
"
12
#include "
TrkTruthData/PRD_MultiTruthCollection.h
"
13
14
#include "
GeneratorObjectsTPCnv/HepMcParticleLinkCnv_p3.h
"
15
16
namespace
{
17
const
HepMcParticleLinkCnv_p3
particleLinkConverter;
18
}
19
20
21
void
PRD_MultiTruthCollectionCnv_p4::persToTrans
(
const
Trk::PRD_MultiTruthCollection_p4
* pers,
22
PRD_MultiTruthCollection
* trans,
23
MsgStream&
msg
)
24
{
25
msg
<<
MSG::DEBUG
<<
"PRD_MultiTruthCollectionCnv_p4::persToTrans()"
<<
endmsg
;
26
27
for
(
const
Trk::PRD_MultiTruthCollection_p4::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_p4::persToTrans() DONE"
<<
endmsg
;
34
}
35
36
void
PRD_MultiTruthCollectionCnv_p4::transToPers
(
const
PRD_MultiTruthCollection
* trans,
37
Trk::PRD_MultiTruthCollection_p4
* pers,
38
MsgStream&
msg
)
39
{
40
msg
<<
MSG::DEBUG
<<
"PRD_MultiTruthCollectionCnv_p4::transToPers()"
<<
endmsg
;
41
42
pers->
m_entries
.reserve(trans->size());
43
44
for
(
const
auto
&
p
: *trans) {
45
HepMcParticleLink_p3
link;
46
particleLinkConverter.transToPers(&
p
.second, &link,
msg
);
47
pers->
m_entries
.push_back(
Trk::PRD_MultiTruthCollection_p4::Entry
(
p
.first.get_compact(), link));
48
}
49
50
msg
<<
MSG::DEBUG
<<
"PRD_MultiTruthCollectionCnv_p4::transToPers() DONE"
<<
endmsg
;
51
}
HepMcParticleLinkCnv_p3
Definition:
HepMcParticleLinkCnv_p3.h:29
HepMcParticleLinkCnv_p3.h
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition:
PRD_MultiTruthCollection.h:24
PRD_MultiTruthCollectionCnv_p4::persToTrans
virtual void persToTrans(const Trk::PRD_MultiTruthCollection_p4 *persObj, PRD_MultiTruthCollection *transObj, MsgStream &msg)
Method creating the transient representation of Analysis::PRD_MultiTruthCollection from its persisten...
Definition:
PRD_MultiTruthCollectionCnv_p4.cxx:21
PRD_MultiTruthCollection_p4.h
HepMcParticleLink_p3
Definition:
HepMcParticleLink_p3.h:17
HepMcParticleLink
a link optimized in size for a GenParticle in a McEventCollection
Definition:
HepMcParticleLink.h:72
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:210
PRD_MultiTruthCollectionCnv_p4::transToPers
virtual void transToPers(const PRD_MultiTruthCollection *transObj, Trk::PRD_MultiTruthCollection_p4 *persObj, MsgStream &msg)
Method creating the persistent representation PRD_MultiTruthCollection_p4 from its transient represen...
Definition:
PRD_MultiTruthCollectionCnv_p4.cxx:36
endmsg
#define endmsg
Definition:
AnalysisConfig_Ntuple.cxx:63
Trk::PRD_MultiTruthCollection_p4::Entry
Definition:
PRD_MultiTruthCollection_p4.h:22
Trk::PRD_MultiTruthCollection_p4::m_entries
CollectionType m_entries
Definition:
PRD_MultiTruthCollection_p4.h:31
Trk::PRD_MultiTruthCollection_p4
Definition:
PRD_MultiTruthCollection_p4.h:19
PRD_MultiTruthCollectionCnv_p4.h
Trk::PRD_MultiTruthCollection_p4::Entry::particle
HepMcParticleLink_p3 particle
Definition:
PRD_MultiTruthCollection_p4.h:24
Trk::PRD_MultiTruthCollection_p4::Entry::id
unsigned long long id
Definition:
PRD_MultiTruthCollection_p4.h:23
DEBUG
#define DEBUG
Definition:
page_access.h:11
PRD_MultiTruthCollection.h
python.AutoConfigFlags.msg
msg
Definition:
AutoConfigFlags.py:7
Identifier
Definition:
IdentifierFieldParser.cxx:14
Generated on Thu Nov 7 2024 21:24:06 for ATLAS Offline Software by
1.8.18