ATLAS Offline Software
Loading...
Searching...
No Matches
TauJetContainerCnv.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//-----------------------------------------------------------------------------
6// file: TauJetContainerCnv.cxx
7// author: Kyle Cranmer, Sebastien Binet, Lukasz Janyst
8// date: April 1007
9//-----------------------------------------------------------------------------
10
11#include "GaudiKernel/MsgStream.h"
17#include "TauJetContainerCnv.h"
18
20TauJetContainerCnv :: createPersistent( Analysis :: TauJetContainer *transCont )
21{
22 MsgStream msg( msgSvc(), "TauJetContainerCnv" );
24 TauJetContainer_PERS *persObj = cnv.createPersistent( transCont, msg );
25 return persObj;
26}
27
28Analysis :: TauJetContainer *TauJetContainerCnv :: createTransient()
29{
30 MsgStream msg( msgSvc(), "TauJetContainerCnv" );
31
32 Analysis :: TauJetContainer *transObj = 0;
33
34 static const pool::Guid p1_guid( "AD52E539-5A69-493A-B33C-7BE558348EBA" );
35 static const pool::Guid p2_guid( "3F9C4AF7-1B48-4DBC-BA24-F7CF658E7820" );
36 static const pool::Guid p3_guid( "3B6CC0D5-D033-45A6-9440-0276EE55B4C5" );
37 static const pool::Guid p4_guid( "87896E97-2688-4373-BD6F-6FC0ED406C2B" );
38 static const pool::Guid p5_guid( "7D98A685-ED84-43AD-9B35-69295E19D402" );
39
40 if( compareClassGuid( p5_guid ) ){
41 // using unique_ptr ensures deletion of the persistent object
42 std :: unique_ptr<TauJetContainer_p5> persObj(poolReadObject<TauJetContainer_p5>());
44 transObj = cnv.createTransient( persObj.get(), msg );
45 }
46 else if( compareClassGuid( p4_guid ) ){
47 // using unique_ptr ensures deletion of the persistent object
48 std :: unique_ptr<TauJetContainer_p4> persObj(poolReadObject<TauJetContainer_p4>());
50 transObj = cnv.createTransient( persObj.get(), msg );
51 }
52 else if( compareClassGuid( p3_guid ) ){
53 // using unique_ptr ensures deletion of the persistent object
54 std :: unique_ptr<TauJetContainer_p3> persObj( poolReadObject<TauJetContainer_p3>() );
56 transObj = cnv.createTransient( persObj.get(), msg );
57 }
58 else if( compareClassGuid( p2_guid ) ){
59 // using unique_ptr ensures deletion of the persistent object
60 std :: unique_ptr<TauJetContainer_p2> persObj( poolReadObject<TauJetContainer_p2>() );
62 transObj = cnv.createTransient( persObj.get(), msg );
63 }
64 else if( compareClassGuid( p1_guid ) ){
65 // using unique_ptr ensures deletion of the persistent object
66 std :: unique_ptr<TauJetContainer_p1> persObj( poolReadObject<TauJetContainer_p1>() );
68 transObj = cnv.createTransient( persObj.get(), msg );
69 }
70 else
71 throw std::runtime_error("Unsupported persistent version of TauJetContainer");
72
73 return transObj;
74}
TauJetContainer_p5 TauJetContainer_PERS
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.
MsgStream & msg
Definition testRead.cxx:32