ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetEventAthenaPool
src
JetCollectionCnv.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// JetCollectionCnv.cxx
8
// Implementation file for class JetCollectionCnv
9
// Author: S.Binet<binet@cern.ch>
11
12
// RecAthenaPool includes
13
#include "
JetCollectionCnv.h
"
14
15
// STL includes
16
17
// Framework includes
18
#include "GaudiKernel/MsgStream.h"
19
20
21
23
JetCollectionCnv::JetCollectionCnv
(ISvcLocator *svcLocator)
24
:
JetCollectionCnvBase
(svcLocator),
25
m_msgSvc
(msgSvc()),
26
m_log
(
m_msgSvc
,
"JetCollectionCnv"
)
27
{
28
}
29
35
JetCollection_PERS
*
36
JetCollectionCnv::createPersistent
(
JetCollection
* )
37
{
38
MsgStream
msg
( msgSvc(),
"JetCollectionCnv"
);
39
msg
<< MSG::ERROR <<
"createPersistent() is obsolete"
<<
endmsg
;
40
return
nullptr
;
41
}
42
48
JetCollection
*
JetCollectionCnv::createTransient
(
const
Token
* token)
49
{
50
MsgStream
msg
( msgSvc(),
"JetCollectionCnv"
);
51
52
JetCollection
*transObj =
nullptr
;
53
54
msg
<< MSG::DEBUG <<
" JetCollectionCnv::createTransient(const Token* token) "
<<
endmsg
;
55
56
static
const
Guid
tr_guid(
"2FB4D25D-E217-4B8A-B865-180DE73B20E0"
);
57
static
const
Guid
pj_guid(
"E97C0C61-0B3E-401C-B853-A3302168283E"
);
58
static
const
Guid
p1_guid(
"9B8CE942-1457-4392-A98A-A1A464990B9A"
);
59
static
const
Guid
p2_guid(
"0260D9A5-9C75-45FF-AC97-EA220FB11380"
);
60
static
const
Guid
p3_guid(
"8CC411B4-8369-4C61-9B15-8A806DBFBBD1"
);
61
static
const
Guid
tlp2_guid(
"668B769E-E190-4904-BE2C-1677279A9803"
);
62
static
const
Guid
tlp5_guid(
"BEDCAE36-5EFD-4035-A402-2DC4F7A6BF75"
);
63
static
const
Guid
tlp6_guid(
"77DFEE77-16A5-45DD-91FB-FDEEF2B65F7D"
);
64
65
if
(
compareClassGuid
(token, tlp6_guid) ) {
66
msg
<< MSG::DEBUG <<
" JetCollectionCnv: calling tlp6 converter"
<<
endmsg
;
67
poolReadObject<JetCollection_tlp6>
(
m_TPConverter
, token);
68
return
m_TPConverter
.createTransient(
m_log
);
69
70
}
else
if
(
compareClassGuid
(token, tlp5_guid) ) {
71
msg
<< MSG::DEBUG <<
" JetCollectionCnv: calling tlp5 converter"
<<
endmsg
;
72
poolReadObject<JetCollection_tlp5>
(
m_tlp5_cnv
, token);
73
return
transObj =
m_tlp5_cnv
.createTransient(
m_log
);
74
75
}
else
if
(
compareClassGuid
(token, tlp2_guid) ) {
76
77
// The T/P seperated object. JetCollection_PERS is not used here
78
// as we want to read out specifically JetColleciton_tlp2, not just
79
// the lastest guy.
80
81
msg
<< MSG::DEBUG <<
" JetCollectionCnv: calling tlp2 converter"
<<
endmsg
;
82
poolReadObject<JetCollection_tlp2>
(
m_tlp2_cnv
, token);
83
return
m_tlp2_cnv
.createTransient(
m_log
);
84
85
}
else
if
(
compareClassGuid
(token, tr_guid) ) {
86
87
// regular object from before the T/P separation
88
return
poolReadObject<JetCollection>
(token);
89
90
}
else
if
(
compareClassGuid
(token, p1_guid) ) {
91
92
// using unique_ptr ensures deletion of the persistent object
93
std::unique_ptr<JetCollection_p1> persObj(
poolReadObject<JetCollection_p1>
(token) );
94
transObj =
m_p1_cnv
.createTransient( persObj.get(),
msg
);
95
96
}
else
if
(
compareClassGuid
(token, p2_guid) ) {
97
98
// using unique_ptr ensures deletion of the persistent object
99
std::unique_ptr<JetCollection_p2> persObj(
poolReadObject<JetCollection_p2>
(token) );
100
transObj =
m_p2_cnv
.createTransient( persObj.get(),
msg
);
101
102
}
else
if
(
compareClassGuid
(token, p3_guid) ) {
103
104
// using unique_ptr ensures deletion of the persistent object
105
std::unique_ptr<JetCollection_p3> persObj(
poolReadObject<JetCollection_p3>
(token) );
106
transObj =
m_p3_cnv
.createTransient( persObj.get(),
msg
);
107
108
}
else
if
(
compareClassGuid
(token, pj_guid) ) {
109
msg
<< MSG::DEBUG <<
" creating pj_guid "
<<
endmsg
;
110
// using unique_ptr ensures deletion of the persistent object
111
std::unique_ptr<ParticleJetContainer_p1> persObj(
poolReadObject<ParticleJetContainer_p1>
(token) );
112
transObj =
m_pjp1_cnv
.createTransient( persObj.get(),
msg
);
113
}
else
{
114
throw
std::runtime_error(
"Unsupported persistent version of JetCollection"
);
115
}
116
117
return
transObj;
118
}
119
125
StatusCode
JetCollectionCnv::initialize
(
void
)
126
{
127
StatusCode result =
T_AthenaPoolCustomCnv<JetCollection, JetCollection_PERS>::initialize
();
128
if
(!result) {
129
return
result;
130
}
131
137
138
IConverter *converter =
m_athenaPoolCnvSvc
->converter(
CLID
(50623115));
139
if
(converter !=
nullptr
) {
140
registerExtendingCnv
(converter);
141
}
else
{
142
m_log
<< MSG::FATAL <<
"Could not load the jet tag info converters for readback!"
<<
endmsg
;
143
return
StatusCode::FAILURE;
144
}
145
146
return
StatusCode::SUCCESS;
147
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
JetCollectionCnv.h
JetCollection_PERS
JetCollection_tlp6 JetCollection_PERS
Definition
JetCollectionCnv.h:44
JetCollectionCnvBase
T_AthenaPoolCustomCnv< JetCollection, JetCollection_PERS > JetCollectionCnvBase
Definition
JetCollectionCnv.h:49
T_AthenaPoolCustomCnv< JetCollection, JetCollection_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
AthenaPoolCnvTPExtension::registerExtendingCnv
virtual bool registerExtendingCnv(AthenaConverterTLPExtension *cnv)
Register extending converter (that is, another converter that will extent this converter) and all his...
Definition
AthenaPoolCnvTPExtension.h:19
AthenaPoolConverter::initialize
virtual StatusCode initialize() override
Gaudi Service Interface method implementations:
Definition
AthenaPoolConverter.cxx:29
T_AthenaPoolCustomCnv< JetCollection, JetCollection_PERS >::m_athenaPoolCnvSvc
ServiceHandle< IAthenaPoolCnvSvc > m_athenaPoolCnvSvc
Definition
AthenaPoolConverter.h:108
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
JetCollectionCnv::m_p3_cnv
JetCollectionCnv_p3 m_p3_cnv
Definition
JetCollectionCnv.h:113
JetCollectionCnv::m_p1_cnv
JetCollectionCnv_p1 m_p1_cnv
Definition
JetCollectionCnv.h:111
JetCollectionCnv::m_tlp5_cnv
JetCollectionCnv_tlp5 m_tlp5_cnv
Definition
JetCollectionCnv.h:109
JetCollectionCnv::JetCollectionCnv
JetCollectionCnv(ISvcLocator *svcloc)
Create the converter from the service locator.
Definition
JetCollectionCnv.cxx:23
JetCollectionCnv::m_tlp2_cnv
JetCollectionCnv_tlp2 m_tlp2_cnv
Definition
JetCollectionCnv.h:110
JetCollectionCnv::m_msgSvc
IMessageSvc * m_msgSvc
Log file output for the translators.
Definition
JetCollectionCnv.h:105
JetCollectionCnv::createTransient
virtual JetCollection * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
JetCollectionCnv.cxx:48
JetCollectionCnv::m_log
MsgStream m_log
Definition
JetCollectionCnv.h:106
JetCollectionCnv::m_p2_cnv
JetCollectionCnv_p2 m_p2_cnv
Definition
JetCollectionCnv.h:112
JetCollectionCnv::m_pjp1_cnv
ParticleJetContainerCnv_p1 m_pjp1_cnv
Definition
JetCollectionCnv.h:114
JetCollectionCnv::m_TPConverter
JetCollectionCnv_tlp6 m_TPConverter
The master translator.
Definition
JetCollectionCnv.h:101
JetCollectionCnv::initialize
StatusCode initialize(void)
Connect up the sub-converters that we use to do the actual work.
Definition
JetCollectionCnv.cxx:125
JetCollectionCnv::createPersistent
virtual JetCollection_PERS * createPersistent(JetCollection *transCont)
Build the persistent representation from the transient one.
Definition
JetCollectionCnv.cxx:36
JetCollection
Definition
JetCollection.h:30
T_AthenaPoolCustomCnv< JetCollection, JetCollection_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< JetCollection, JetCollection_PERS >::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
Generated on
for ATLAS Offline Software by
1.17.0