ATLAS Offline Software
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 
21 {
22  MsgStream msg( msgSvc(), "TauJetContainerCnv" );
24  TauJetContainer_PERS *persObj = cnv.createPersistent( transCont, msg );
25  return persObj;
26 }
27 
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 }
TauJetContainerCnv_p5.h
TauJetContainerCnv_p3.h
TauJetContainerCnv_p1.h
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
TauJetContainerCnv_p2
Definition: TauJetContainerCnv_p2.h:25
TauJetContainerCnv_p2.h
TauJetContainer_p5
Definition: TauJetContainer_p5.h:19
TauJetContainerCnv_p5
Definition: TauJetContainerCnv_p5.h:25
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TauJetContainerCnv_p1
Definition: TauJetContainerCnv_p1.h:25
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
TauJetContainerCnv_p4
Definition: TauJetContainerCnv_p4.h:25
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
TauJetContainerCnv::createTransient
virtual Analysis ::TauJetContainer * createTransient()
Definition: TauJetContainerCnv.cxx:28
xAOD::TauJetContainer
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Definition: Event/xAOD/xAODTau/xAODTau/TauJetContainer.h:17
TauJetContainerCnv::createPersistent
virtual TauJetContainer_PERS * createPersistent(Analysis ::TauJetContainer *transCont)
Definition: TauJetContainerCnv.cxx:20
TauJetContainerCnv_p3
Definition: TauJetContainerCnv_p3.h:25
T_AthenaPoolCustCnv< Analysis ::TauJetContainer, TauJetContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TauJetContainerCnv.h
TauJetContainerCnv_p4.h