ATLAS Offline Software
Loading...
Searching...
No Matches
egDetailContainerCnv.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// egDetailContainerCnv.cxx
8// Implementation file for class egDetailContainerCnv
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
21
22// RecAthenaPool includes
24#include "egammaMsgUtil.h"
25
29
33
35// Protected methods:
37
38
41{
42 MsgStream msg( msgSvc(), "egDetailContainerCnv" );
43
45 egDetailContainer_PERS *persObj = cnv.createPersistent( transCont, msg );
46
47 MSG_DEBUG(msg, "::createPersistent [Success]");
48 return persObj;
49}
50
52{
53 MsgStream msg( msgSvc(), "egDetailContainerCnv" );
54
55 egDetailContainer *transObj = nullptr;
56
57 static const pool::Guid tr_guid("F8C02E11-E6C5-4843-A57D-3DB2EFACCC5B");
58 static const pool::Guid p1_guid("C3E26ADE-A984-41AC-83DF-F430F6DF1F1F");
59 static const pool::Guid p2_guid("6AB9ADFD-836F-416D-B343-3DDF7D4F6E18");
60
61 if ( compareClassGuid(tr_guid) ) {
62
63 // regular object from before the T/P separation
65
66 } if ( compareClassGuid(p1_guid) ) {
67
68 // using unique_ptr ensures deletion of the persistent object
69 std::unique_ptr<egDetailContainer_p1> persObj( poolReadObject<egDetailContainer_p1>() );
71 transObj = cnv.createTransient( persObj.get(), msg );
72 } else if ( compareClassGuid(p2_guid) ) {
73
74 // using unique_ptr ensures deletion of the persistent object
75 std::unique_ptr<egDetailContainer_p2> persObj( poolReadObject<egDetailContainer_p2>() );
77 transObj = cnv.createTransient( persObj.get(), msg );
78 } else {
79 throw std::runtime_error("Unsupported persistent version of egDetailContainer");
80 }
81
82 return transObj;
83}
84
#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 egDetailContainer_PERS * createPersistent(egDetailContainer *transCont)
Build the persistent representation from the transient one.
virtual egDetailContainer * createTransient()
Build the transient representation from a persistent one.
Container for detailed egamma information.
egDetailContainer_p2 egDetailContainer_PERS