ATLAS Offline Software
Loading...
Searching...
No Matches
MissingETCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6NAME: MissingETCnv.h
7PACKAGE: offline/Reconstruction/RecAthenaPool
8PURPOSE: Implementation file for class MissingETCnv
9********************************************************************/
10
11// Framework includes
12#include "GaudiKernel/MsgStream.h"
13
14// RecTPCnv includes
18
19// RecAthenaPool includes
20#include "MissingETCnv.h"
21
24{
25 MsgStream msg( msgSvc(), "MissingETCnv" );
26
28 MissingET_PERS *persObj = cnv.createPersistent( transCont, msg );
29
30 msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
31 return persObj;
32}
33
35{
36 MsgStream msg( msgSvc(), "MissingETCnv" );
37
38 MissingET *transObj = 0;
39
40 static const pool::Guid tr_guid("14E6F88E-BA7F-4241-BF3D-99DE583B4709");
41 static const pool::Guid p1_guid("C0D9AEE8-A2B0-4EED-BD75-53D67DF9736F");
42 static const pool::Guid p2_guid("2D9729C7-646D-4BF5-B404-380AE2D9D308");
43 static const pool::Guid p3_guid("AD744C55-6CA6-4D44-8E2F-C47FF3CE980E");
44
45 if ( compareClassGuid(tr_guid) ) { // regular object from before the T/P separation
47 } else if ( compareClassGuid(p1_guid) ) {
48 // using unique_ptr ensures deletion of the persistent object
49 std::unique_ptr<MissingET_p1> persObj( poolReadObject<MissingET_p1>() );
51 transObj = cnv.createTransient( persObj.get(), msg );
52 } else if ( compareClassGuid(p2_guid) ) {
53 std::unique_ptr<MissingET_p2> persObj( poolReadObject<MissingET_p2>() );
55 transObj = cnv.createTransient( persObj.get(), msg );
56 } else if ( compareClassGuid(p3_guid) ) {
57 std::unique_ptr<MissingET_p3> persObj( poolReadObject<MissingET_p3>() );
59 transObj = cnv.createTransient( persObj.get(), msg );
60 } else {
61 throw std::runtime_error("Unsupported persistent version of MissingET");
62 }
63
64 return transObj;
65}
#define endmsg
MissingET_p3 MissingET_PERS
virtual MissingET_PERS * createPersistent(MissingET *transCont)
Build the persistent representation from the transient one.
virtual MissingET * 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.
virtual bool compareClassGuid(const Guid &clid) const