ATLAS Offline Software
Loading...
Searching...
No Matches
MissingEtTruthCnv.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: MissingEtTruthCnv.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 "MissingEtTruthCnv.h"
21
22
25{
26 MsgStream msg( msgSvc(), "MissingEtTruthCnv" );
27
29 MissingEtTruth_PERS *persObj = cnv.createPersistent( transCont, msg );
30
31 msg << MSG::DEBUG << "::createPersistent [Success]" << endmsg;
32 return persObj;
33}
34
36{
37 MsgStream msg( msgSvc(), "MissingEtTruthCnv" );
38
39 MissingEtTruth *transObj = 0;
40
41 static const pool::Guid tr_guid("2147ED1C-7337-4717-900B-1B52BD8DC316");
42 static const pool::Guid p1_guid("E7D6D6B8-08A8-409E-9477-2A61467738B2");
43 static const pool::Guid p2_guid("291A1BDB-A25E-412D-8E49-EF0E1EA1A835");
44 static const pool::Guid p3_guid("3FA8CC45-8798-4C24-9D0E-22E5F11AD85F");
45
46 if ( compareClassGuid(p3_guid)) {
47
48 // using unique_ptr ensures deletion of the persistent object
49 std::unique_ptr<MissingEtTruth_p3> persObj( poolReadObject<MissingEtTruth_p3>() );
51 transObj = cnv.createTransient( persObj.get(), msg );
52
53 } else if ( compareClassGuid(p2_guid)) {
54
55 // using unique_ptr ensures deletion of the persistent object
56 std::unique_ptr<MissingEtTruth_p2> persObj( poolReadObject<MissingEtTruth_p2>() );
58 transObj = cnv.createTransient( persObj.get(), msg );
59
60 } else if ( compareClassGuid(p1_guid)) {
61
62 // using unique_ptr ensures deletion of the persistent object
63 std::unique_ptr<MissingEtTruth_p1> persObj( poolReadObject<MissingEtTruth_p1>() );
65 transObj = cnv.createTransient( persObj.get(), msg );
66
67 } else if ( compareClassGuid(tr_guid) ) { // regular object from before the T/P separation
69 } else {
70 throw std::runtime_error("Unsupported persistent version of MissingEtTruth");
71 }
72
73 return transObj;
74}
#define endmsg
MissingEtTruth_p3 MissingEtTruth_PERS
virtual MissingEtTruth_PERS * createPersistent(MissingEtTruth *transCont)
Build the persistent representation from the transient one.
virtual MissingEtTruth * 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