ATLAS Offline Software
Loading...
Searching...
No Matches
InnerDetector
InDetEventCnv
InDetEventAthenaPool
src
InDetSimDataCnv_p1.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
#include "
InDetSimData/InDetSimData.h
"
6
#include "
MsgUtil.h
"
7
8
// Persistent class and converter header file
9
#include "
InDetEventAthenaPool/InDetSimData_p1.h
"
10
#include "
InDetSimDataCnv_p1.h
"
11
#include "
AthenaBaseComps/AthMessaging.h
"
12
13
14
using
depositIterator
= std::vector<InDetSimData::Deposit>::const_iterator;
15
16
InDetSimDataCnv_p1::InDetSimDataCnv_p1
()
17
:
m_sg
(nullptr)
18
{
19
}
20
21
22
void
23
InDetSimDataCnv_p1::persToTrans
(
const
InDetSimData_p1
* persObj,
InDetSimData
* transObj, MsgStream &log)
24
{
25
MSG_VERBOSE
(log,
"InDetSimDataCnv_p1::persToTrans called "
);
26
HepMcParticleLinkCnv_p1
HepMcPLCnv
;
27
std::vector<InDetSimData::Deposit> deposits;
28
const
unsigned
int
ndeposits = persObj->
m_enDeposits
.size();
29
deposits.reserve( ndeposits );
30
for
(
unsigned
int
icount=0; icount < ndeposits; icount++) {
31
HepMcParticleLink
mcLink(
m_sg
);
//FIXME This is left as a note to make the new implementation thread-safe
32
HepMcPLCnv
.persToTrans(&(persObj->
m_links
[icount]),&mcLink, log);
33
deposits.emplace_back (mcLink, persObj->
m_enDeposits
[icount]);
34
}
35
36
*transObj =
InDetSimData
(std::move(deposits),
37
persObj->
m_word
);
38
}
39
40
void
41
InDetSimDataCnv_p1::transToPers
(
const
InDetSimData
* transObj,
InDetSimData_p1
* persObj, MsgStream &log)
42
{
43
MSG_VERBOSE
(log,
"InDetSimDataCnv_p1::transToPers called "
);
44
45
persObj->
m_word
= transObj->
word
();
46
const
std::vector<InDetSimData::Deposit> &dep(transObj->
getdeposits
());
47
const
unsigned
int
ndeposits = dep.size();
48
persObj->
m_links
.resize(ndeposits);
49
persObj->
m_enDeposits
.resize(ndeposits);
50
for
(
unsigned
int
icount(0); icount < ndeposits; ++icount) {
51
HepMcPLCnv
.transToPers(&(dep[icount].first), &(persObj->
m_links
[icount]), log);
52
persObj->
m_enDeposits
[icount] = dep[icount].second;
53
}
54
}
55
56
void
InDetSimDataCnv_p1::setCurrentStore
(
IProxyDict
* store)
57
{
58
m_sg
= store;
59
}
AthMessaging.h
depositIterator
std::vector< InDetSimData::Deposit >::const_iterator depositIterator
Definition
InDetSimDataCnv_p1.cxx:14
InDetSimDataCnv_p1.h
InDetSimData.h
InDetSimData_p1.h
MsgUtil.h
MSG_VERBOSE
#define MSG_VERBOSE(log, x)
Definition
MsgUtil.h:17
HepMcParticleLinkCnv_p1
Definition
HepMcParticleLinkCnv_p1.h:33
HepMcParticleLink
a link optimized in size for a GenParticle in a McEventCollection
Definition
HepMcParticleLink.h:72
IProxyDict
A proxy dictionary.
Definition
AthenaKernel/AthenaKernel/IProxyDict.h:47
InDetSimDataCnv_p1::transToPers
virtual void transToPers(const InDetSimData *transObj, InDetSimData_p1 *persObj, MsgStream &log)
Definition
InDetSimDataCnv_p1.cxx:41
InDetSimDataCnv_p1::m_sg
IProxyDict * m_sg
Definition
InDetSimDataCnv_p1.h:32
InDetSimDataCnv_p1::setCurrentStore
void setCurrentStore(IProxyDict *store)
Definition
InDetSimDataCnv_p1.cxx:56
InDetSimDataCnv_p1::HepMcPLCnv
HepMcParticleLinkCnv_p1 HepMcPLCnv
Definition
InDetSimDataCnv_p1.h:33
InDetSimDataCnv_p1::InDetSimDataCnv_p1
InDetSimDataCnv_p1()
Definition
InDetSimDataCnv_p1.cxx:16
InDetSimDataCnv_p1::persToTrans
virtual void persToTrans(const InDetSimData_p1 *persObj, InDetSimData *transObj, MsgStream &log)
Definition
InDetSimDataCnv_p1.cxx:23
InDetSimData_p1
Definition
InDetSimData_p1.h:11
InDetSimData_p1::m_enDeposits
std::vector< float > m_enDeposits
Definition
InDetSimData_p1.h:19
InDetSimData_p1::m_word
unsigned int m_word
Definition
InDetSimData_p1.h:17
InDetSimData_p1::m_links
std::vector< HepMcParticleLink_p1 > m_links
Definition
InDetSimData_p1.h:18
InDetSimData
Definition
InDetSimData.h:42
InDetSimData::word
int word() const
Definition
InDetSimData.h:69
InDetSimData::getdeposits
const std::vector< Deposit > & getdeposits() const
Definition
InDetSimData.h:74
Generated on
for ATLAS Offline Software by
1.14.0