ATLAS Offline Software
LArTTL1ContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // LArTPCnv includes
7 
8 // LArEventAthenaPool includes
9 #include "LArTTL1ContainerCnv.h"
10 
13 {
15  LArTTL1Container_PERS *persObj = cnv.createPersistent( transCont, msg() );
16 
17  return persObj;
18 }
19 
21 
22  LArTTL1Container *transObj = 0;
23 
24  static const pool::Guid tr_guid("38FAECC7-D0C5-4DD8-8FAE-8D35F0542ECD");
25  static const pool::Guid p1_guid("b859a463-2ea4-4902-b46a-89e5fbc20132");
26 
27  if ( compareClassGuid(tr_guid) ) {
28 
29  // regular object from before the T/P separation
30  return poolReadObject<LArTTL1Container>();
31 
32  } else if ( compareClassGuid(p1_guid) ) {
33 
34  // using unique_ptr ensures deletion of the persistent object
35  std::unique_ptr<LArTTL1Container_p1> persObj( poolReadObject<LArTTL1Container_p1>() );
37  transObj = cnv.createTransient( persObj.get(), msg() );
38  } else {
39  throw std::runtime_error("Unsupported persistent version of LArTTL1Container");
40  }
41 
42  return transObj;
43 }
LArTTL1Container_p1
Definition: LArTTL1Container_p1.h:12
LArTTL1ContainerCnv_p1.h
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
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
LArTTL1ContainerCnv::createTransient
virtual LArTTL1Container * createTransient()
Build the transient representation from a persistent one.
Definition: LArTTL1ContainerCnv.cxx:20
LArTTL1Container
Container class for LArTTL1.
Definition: LArTTL1Container.h:24
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
LArTTL1ContainerCnv::createPersistent
virtual LArTTL1Container_PERS * createPersistent(LArTTL1Container *transCont)
Build the persistent representation from the transient one.
Definition: LArTTL1ContainerCnv.cxx:12
LArTTL1ContainerCnv.h
TPCnvVector
Definition: TPConverter.h:1256
T_AthenaPoolCustCnv< LArTTL1Container, LArTTL1Container_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.