ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExThinning
src
AthExDecayCnv.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// DecayCnv.cxx
8
// Implementation file for class DecayCnv
9
// Author: S.Binet<binet@cern.ch>
11
12
// STL includes
13
14
// Framework includes
15
#include "GaudiKernel/MsgStream.h"
16
#include "GaudiKernel/IToolSvc.h"
17
#include "GaudiKernel/IAlgTool.h"
18
#include "
StoreGate/StoreGateSvc.h
"
19
20
// AthExThinning includes
21
#include "
AthExDecayCnv_p1.h
"
22
#include "
AthExDecayCnv.h
"
23
27
31
33
// Protected methods:
35
36
AthExDecayCnv::AthExDecayCnv
(ISvcLocator* svcLocator) :
37
T_AthenaPoolCustomCnv
<
AthExDecay
,
38
AthExDecay_PERS
>(svcLocator)
39
{
40
if
( 0 == svcLocator ) {
41
throw
std::runtime_error(
"NULL pointer to ISvcLocator !!"
);
42
}
43
44
}
45
46
47
AthExDecay_PERS
*
48
AthExDecayCnv::createPersistent
(
AthExDecay
* transCont)
49
{
50
MsgStream
msg
( msgSvc(),
"AthExDecayCnv"
);
51
52
AthExDecayCnv_p1
cnv;
53
AthExDecay_PERS
*persObj = cnv.
createPersistent
(transCont,
msg
);
54
55
msg
<< MSG::DEBUG <<
"::createPersistent [Success]"
<<
endmsg
;
56
return
persObj;
57
}
58
59
AthExDecay
*
AthExDecayCnv::createTransient
(
const
Token
* token)
60
{
61
MsgStream
msg
( msgSvc(),
"AthExDecayConverter"
);
62
63
AthExDecay
*transObj = 0;
64
65
static
const
pool::Guid
p1_guid(
"FD6FC38A-2EE4-4EC6-916B-DBF6A8E88A03"
);
66
67
if
(
compareClassGuid
(token, p1_guid) ) {
68
69
// using unique_ptr ensures deletion of the persistent object
70
std::unique_ptr<AthExDecay_p1> persObj(
poolReadObject<AthExDecay_p1>
(token) );
71
AthExDecayCnv_p1
cnv;
72
transObj = cnv.
createTransient
( persObj.get(),
msg
);
73
74
}
else
{
75
throw
std::runtime_error(
"Unsupported persistent version of Decay"
);
76
}
77
78
return
transObj;
79
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
AthExDecayCnv.h
AthExDecay_PERS
AthExDecay_p1 AthExDecay_PERS
Definition
AthExDecayCnv.h:27
AthExDecayCnv_p1.h
StoreGateSvc.h
AthExDecayCnv_p1
Definition
AthExDecayCnv_p1.h:38
AthExDecayCnv::createPersistent
virtual AthExDecay_PERS * createPersistent(AthExDecay *transCont)
Build the persistent representation from the transient one.
Definition
AthExDecayCnv.cxx:48
AthExDecayCnv::createTransient
virtual AthExDecay * createTransient(const Token *token)
Build the transient representation from a persistent one.
Definition
AthExDecayCnv.cxx:59
AthExDecayCnv::AthExDecayCnv
AthExDecayCnv(ISvcLocator *svcloc)
Create the converter from the service locator.
Definition
AthExDecayCnv.cxx:36
AthExDecay
Definition
AthExDecay.h:28
T_AthenaPoolCustomCnv< AthExDecay, AthExDecay_PERS >::msg
MsgStream & msg() const
Definition
AthMessaging.h:167
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
T_AthenaPoolCustomCnv< AthExDecay, AthExDecay_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< AthExDecay, AthExDecay_PERS >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition
T_AthenaPoolCustomCnv.h:129
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0