ATLAS Offline Software
Loading...
Searching...
No Matches
ElectronContainerCnv.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// ElectronContainerCnv.cxx
8// Implementation file for class ElectronContainerCnv
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
27#include "egammaMsgUtil.h"
28
32
36
38// Protected methods:
40
41
44{
45 MsgStream msg( msgSvc(), "ElectronContainerCnv" );
46
48 ElectronContainer_PERS *persObj = cnv.createPersistent( transCont, msg );
49
50 MSG_DEBUG(msg, "::createPersistent [Success]");
51 return persObj;
52}
53
55{
56 MsgStream msg( msgSvc(), "ElectronContainerCnv" );
57
58 ElectronContainer *transObj = nullptr;
59
60 static const pool::Guid tr_guid("417E86E5-CA20-4F50-A7A2-C91BF44C9125");
61 static const pool::Guid p1_guid("48355DA8-3BCE-43E0-B29B-51525BCEEDDD");
62 static const pool::Guid p2_guid("A4377CE2-C0DC-4F80-8CFD-3BBE9A8EFD52");
63 static const pool::Guid p3_guid("51C149D6-2FBA-4ADD-B6AA-8AE39E07D202");
64 static const pool::Guid p4_guid("1A7C1F66-D9D2-49E9-80A8-592A0CEE3FDF");
65 static const pool::Guid p5_guid("A7C69641-E985-4D31-92D4-D33206C197F1");
66
67 if ( compareClassGuid(p5_guid) ) {
68
69 // using unique_ptr ensures deletion of the persistent object
70 std::unique_ptr<ElectronContainer_p5> persObj( poolReadObject<ElectronContainer_p5>() );
72 transObj = cnv.createTransient( persObj.get(), msg );
73
74 } else if ( compareClassGuid(p4_guid) ) {
75
76 // using unique_ptr ensures deletion of the persistent object
77 std::unique_ptr<ElectronContainer_p4> persObj( poolReadObject<ElectronContainer_p4>() );
79 transObj = cnv.createTransient( persObj.get(), msg );
80
81 } else if ( compareClassGuid(p3_guid) ) {
82
83 // using unique_ptr ensures deletion of the persistent object
84 std::unique_ptr<ElectronContainer_p3> persObj( poolReadObject<ElectronContainer_p3>() );
86 transObj = cnv.createTransient( persObj.get(), msg );
87
88 } else if ( compareClassGuid(p2_guid) ) {
89
90 // using unique_ptr ensures deletion of the persistent object
91 std::unique_ptr<ElectronContainer_p2> persObj( poolReadObject<ElectronContainer_p2>() );
93 transObj = cnv.createTransient( persObj.get(), msg );
94
95 } else if ( compareClassGuid(p1_guid) ) {
96
97 // using unique_ptr ensures deletion of the persistent object
98 std::unique_ptr<ElectronContainer_p1> persObj( poolReadObject<ElectronContainer_p1>() );
100 transObj = cnv.createTransient( persObj.get(), msg );
101
102 } else if ( compareClassGuid(tr_guid) ) {
103
104 // regular object from before the T/P separation
106
107 } else {
108 throw std::runtime_error("Unsupported persistent version of ElectronContainer");
109 }
110
111 return transObj;
112}
ElectronContainer_p5 ElectronContainer_PERS
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p1, ElectronCnv_p1 > ElectronContainerCnv_p1
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p2, ElectronCnv_p2 > ElectronContainerCnv_p2
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p3, ElectronCnv_p3 > ElectronContainerCnv_p3
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p4, ElectronCnv_p4 > ElectronContainerCnv_p4
T_AthenaPoolTPCnvVector< ElectronContainer, ElectronContainer_p5, ElectronCnv_p5 > ElectronContainerCnv_p5
#define MSG_DEBUG(log, x)
Definition MsgUtil.h:15
virtual ElectronContainer_PERS * createPersistent(ElectronContainer *transCont)
Build the persistent representation from the transient one.
virtual ElectronContainer * createTransient()
Build the transient representation from a persistent one.
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.