ATLAS Offline Software
Loading...
Searching...
No Matches
egammaContainerCnv.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5*/
6
7// egammaContainerCnv.cxx
8// Implementation file for class egammaContainerCnv
9// Author: K.Cranmer<cranmer@cern.ch>
10// Author: S.Binet<binet@cern.ch>
12
13// STL includes
14
15// Framework includes
16#include "GaudiKernel/MsgStream.h"
17
18// egammaEventTPCnv includes
24
25// RecAthenaPool includes
26#include "egammaContainerCnv.h"
27#include "egammaMsgUtil.h"
28
29
33
37
39// Protected methods:
41
42
45{
46 MsgStream msg( msgSvc(), "egammaContainerCnv" );
47
49 egammaContainer_PERS *persObj = cnv.createPersistent( transCont, msg );
50
51 MSG_DEBUG(msg, "::createPersistent [Success]");
52 return persObj;
53}
54
56{
57 MsgStream msg( msgSvc(), "egammaContainerCnv" );
58
59 egammaContainer *transObj = nullptr;
60
61 static const pool::Guid tr_guid("7CAB4F67-1765-4CDC-9614-60EB93E5551B");
62 static const pool::Guid p1_guid("DBA382E5-52F7-4B40-8623-E807E134412E");
63 static const pool::Guid p2_guid("5576188C-ECA9-4BD1-B1F1-563C728FE51F");
64 static const pool::Guid p3_guid("95BD7D50-F070-4245-91DE-ECAB4A8D722D");
65 static const pool::Guid p4_guid("451AACD2-5B23-4557-8A3F-6CD1AB36BF9F");
66 static const pool::Guid p5_guid("1AA8DE2E-D1CC-4076-B74A-82BBCC551798");
67
68 if ( compareClassGuid(p5_guid) ) {
69
70 // using unique_ptr ensures deletion of the persistent object
71 std::unique_ptr<egammaContainer_p5> persObj( poolReadObject<egammaContainer_p5>() );
73 transObj = cnv.createTransient( persObj.get(), msg );
74
75 } else if ( compareClassGuid(p4_guid) ) {
76
77 // using unique_ptr ensures deletion of the persistent object
78 std::unique_ptr<egammaContainer_p4> persObj( poolReadObject<egammaContainer_p4>() );
80 transObj = cnv.createTransient( persObj.get(), msg );
81
82 } else if ( compareClassGuid(p3_guid) ) {
83
84 // using unique_ptr ensures deletion of the persistent object
85 std::unique_ptr<egammaContainer_p3> persObj( poolReadObject<egammaContainer_p3>() );
87 transObj = cnv.createTransient( persObj.get(), msg );
88
89 } else if ( compareClassGuid(p2_guid) ) {
90
91 // using unique_ptr ensures deletion of the persistent object
92 std::unique_ptr<egammaContainer_p2> persObj( poolReadObject<egammaContainer_p2>() );
94 transObj = cnv.createTransient( persObj.get(), msg );
95
96 } else if ( compareClassGuid(p1_guid) ) {
97
98 // using unique_ptr ensures deletion of the persistent object
99 std::unique_ptr<egammaContainer_p1> persObj( poolReadObject<egammaContainer_p1>() );
101 transObj = cnv.createTransient( persObj.get(), msg );
102
103 } else if ( compareClassGuid(tr_guid) ) {
104
105 // regular object from before the T/P separation
107
108 } else {
109 throw std::runtime_error("Unsupported persistent version of egammaContainer");
110 }
111
112 return transObj;
113}
#define MSG_DEBUG(log, x)
Definition MsgUtil.h:15
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
virtual egammaContainer * createTransient()
Build the transient representation from a persistent one.
virtual egammaContainer_PERS * createPersistent(egammaContainer *transCont)
Build the persistent representation from the transient one.
This is a data object, containing a collection of egamma Objects.
egammaContainer_p5 egammaContainer_PERS
T_AthenaPoolTPCnvVector< egammaContainer, egammaContainer_p1, egammaCnv_p1 > egammaContainerCnv_p1
T_AthenaPoolTPCnvVector< egammaContainer, egammaContainer_p2, egammaCnv_p2 > egammaContainerCnv_p2
T_AthenaPoolTPCnvVector< egammaContainer, egammaContainer_p3, egammaCnv_p3 > egammaContainerCnv_p3
T_AthenaPoolTPCnvVector< egammaContainer, egammaContainer_p4, egammaCnv_p4 > egammaContainerCnv_p4
T_AthenaPoolTPCnvVector< egammaContainer, egammaContainer_p5, egammaCnv_p5 > egammaContainerCnv_p5