ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkEventCnv
TrkTruthAthenaPool
src
TrackTruthCollectionCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrackTruthCollectionCnv.h
"
6
7
#include "
TrkTruthData/TrackTruthCollection.h
"
8
#include "
TrkTruthTPCnv/TrackTruthCollection_p0.h
"
9
#include "
TrkTruthTPCnv/TrackTruthCollection_p1.h
"
10
#include "
TrkTruthTPCnv/TrackTruthCollection_p2.h
"
11
#include "
TrkTruthTPCnv/TrackTruthCollection_p3.h
"
12
#include "
TrkTruthTPCnv/TrackTruthCollectionCnv_p1.h
"
13
#include "
TrkTruthTPCnv/TrackTruthCollectionCnv_p2.h
"
14
#include "
TrkTruthTPCnv/TrackTruthCollectionCnv_p3.h
"
15
16
#include "GaudiKernel/StatusCode.h"
17
#include "GaudiKernel/MsgStream.h"
18
#include "GaudiKernel/ISvcLocator.h"
19
20
// Athena
21
#include "
StoreGate/StoreGateSvc.h
"
22
23
// This is release 12 guid for TrackTruthVector.
24
constexpr
Guid
s_p0_guid
(
"8BC86D69-DBC4-4B34-8273-513D9BE771D5"
);
25
constexpr
Guid
s_p1_guid
(
"ED2B4B64-7CF6-48B3-8C40-29F8501A6090"
);
26
constexpr
Guid
s_p2_guid
(
"44F35B21-838A-4C4E-B09B-971CEA0EB70A"
);
27
constexpr
Guid
s_p3_guid
(
"018E41F8-0857-7D8C-A062-A3947683EB99"
);
28
29
30
//================================================================
31
TrackTruthCollectionCnv::TrackTruthCollectionCnv
(ISvcLocator* svcLoc) :
32
TrackTruthCollectionCnvBase
(svcLoc)
33
{}
34
35
//================================================================
36
TrackTruthCollectionPERS
*
TrackTruthCollectionCnv::createPersistent
(
TrackTruthCollection
* trans) {
37
MsgStream log(msgSvc(),
"TrackTruthCollectionCnv"
);
38
log<<MSG::DEBUG<<
"Writing TrackTruthCollection_p3"
<<
endmsg
;
39
TrackTruthCollectionPERS
* pers=
new
TrackTruthCollectionPERS
();
40
m_converter_p3
.transToPers(trans,pers,log);
41
return
pers;
42
}
43
44
//================================================================
45
TrackTruthCollection
*
TrackTruthCollectionCnv::createTransient
(
const
Token
* token) {
46
MsgStream log(msgSvc(),
"TrackTruthCollectionCnv"
);
47
std::unique_ptr<TrackTruthCollection> trans(
new
TrackTruthCollection
());
48
49
if
(
compareClassGuid
(token,
s_p3_guid
)) {
50
log<<MSG::DEBUG<<
"Read TrackTruthCollection_p3. token="
<<token->
toString
()<<
endmsg
;
51
Trk::TrackTruthCollection_p3
* pers=
poolReadObject<Trk::TrackTruthCollection_p3>
(token);
52
m_converter_p3
.persToTrans(pers, trans.get(), log);
53
delete
pers;
54
}
55
else
if
(
compareClassGuid
(token,
s_p2_guid
)) {
56
log<<MSG::DEBUG<<
"Read TrackTruthCollection_p2. token="
<<token->
toString
()<<
endmsg
;
57
Trk::TrackTruthCollection_p2
* pers=
poolReadObject<Trk::TrackTruthCollection_p2>
(token);
58
m_converter_p2
.persToTrans(pers, trans.get(), log);
59
delete
pers;
60
}
61
else
if
(
compareClassGuid
(token,
s_p1_guid
)) {
62
log<<MSG::DEBUG<<
"Read TrackTruthCollection_p1. token="
<<token->
toString
()<<
endmsg
;
63
Trk::TrackTruthCollection_p1
* pers=
poolReadObject<Trk::TrackTruthCollection_p1>
(token);
64
m_converter_p1
.persToTrans(pers, trans.get(), log);
65
delete
pers;
66
}
67
else
if
(
compareClassGuid
(token,
s_p0_guid
)) {
68
log<<MSG::DEBUG<<
"Read version p0 of TrackTruthCollection. token="
<<token->
toString
()<<
endmsg
;
69
TrackTruthVector
*pers =
poolReadObject<TrackTruthVector>
(token);
70
m_converter_p0
.persToTrans(pers, trans.get(), log);
71
delete
pers;
72
}
73
else
{
74
log<<MSG::ERROR<<
"Unsupported persistent version of TrackTruthCollection. token="
75
<<token->
toString
()<<
endmsg
;
76
throw
std::runtime_error(
"Unsupported persistent version of Data Collection"
);
77
}
78
79
return
trans.release();
80
}
81
82
//================================================================
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
StoreGateSvc.h
s_p2_guid
constexpr Guid s_p2_guid("D62AFEEE-EF2C-437A-B7BE-CA926D38CCFB")
s_p3_guid
constexpr Guid s_p3_guid("018F1ACE-8405-7174-9305-46B503B5EF52")
s_p1_guid
constexpr Guid s_p1_guid("D62AFEEE-EF2C-437A-B7BE-CA926D38CCFA")
s_p0_guid
constexpr Guid s_p0_guid("B35041E8-D980-458E-AC06-79028CF79D5D")
s_p1_guid
constexpr Guid s_p1_guid("ED2B4B64-7CF6-48B3-8C40-29F8501A6090")
s_p2_guid
constexpr Guid s_p2_guid("44F35B21-838A-4C4E-B09B-971CEA0EB70A")
s_p0_guid
constexpr Guid s_p0_guid("8BC86D69-DBC4-4B34-8273-513D9BE771D5")
s_p3_guid
constexpr Guid s_p3_guid("018E41F8-0857-7D8C-A062-A3947683EB99")
TrackTruthCollectionCnv.h
TrackTruthCollectionCnvBase
T_AthenaPoolCustomCnv< TrackTruthCollection, TrackTruthCollectionPERS > TrackTruthCollectionCnvBase
Definition
TrackTruthCollectionCnv.h:22
TrackTruthCollectionPERS
Trk::TrackTruthCollection_p3 TrackTruthCollectionPERS
Definition
TrackTruthCollectionCnv.h:20
TrackTruthCollectionCnv_p1.h
TrackTruthCollectionCnv_p2.h
TrackTruthCollectionCnv_p3.h
TrackTruthCollection.h
TrackTruthCollection_p0.h
TrackTruthCollection_p1.h
TrackTruthCollection_p2.h
TrackTruthCollection_p3.h
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
T_AthenaPoolCustomCnv< TrackTruthCollection, TrackTruthCollectionPERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< TrackTruthCollection, TrackTruthCollectionPERS >::poolReadObject
P * poolReadObject(const Token *token)
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
Token::toString
const std::string toString() const
Retrieve the string representation of the token.
Definition
Token.cxx:135
TrackTruthCollectionCnv::m_converter_p0
TrackTruthCollectionCnv_p0 m_converter_p0
Definition
TrackTruthCollectionCnv.h:34
TrackTruthCollectionCnv::m_converter_p3
TrackTruthCollectionCnv_p3 m_converter_p3
Definition
TrackTruthCollectionCnv.h:37
TrackTruthCollectionCnv::TrackTruthCollectionCnv
TrackTruthCollectionCnv(ISvcLocator *svcloc)
Definition
TrackTruthCollectionCnv.cxx:31
TrackTruthCollectionCnv::m_converter_p2
TrackTruthCollectionCnv_p2 m_converter_p2
Definition
TrackTruthCollectionCnv.h:36
TrackTruthCollectionCnv::createTransient
virtual TrackTruthCollection * createTransient(const Token *token)
Definition
TrackTruthCollectionCnv.cxx:45
TrackTruthCollectionCnv::m_converter_p1
TrackTruthCollectionCnv_p1 m_converter_p1
Definition
TrackTruthCollectionCnv.h:35
TrackTruthCollectionCnv::createPersistent
virtual TrackTruthCollectionPERS * createPersistent(TrackTruthCollection *)
Definition
TrackTruthCollectionCnv.cxx:36
TrackTruthCollection
Definition
TrackTruthCollection.h:21
TrackTruthVector
Definition
TrackTruthCollection_p0.h:24
Trk::TrackTruthCollection_p1
Definition
TrackTruthCollection_p1.h:21
Trk::TrackTruthCollection_p2
Definition
TrackTruthCollection_p2.h:21
Trk::TrackTruthCollection_p3
Definition
TrackTruthCollection_p3.h:21
Generated on
for ATLAS Offline Software by
1.17.0