ATLAS Offline Software
IParticleLinkContainerCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
16 
17 // This classes header
19 
20 // This is here as a checkreq workaround.
21 // The generated pool files depend on EventKernel, but nothing in src does
22 // directly. So checkreq was fiving different errors before and after pool
23 // generation. By adding an explicit dependency here, those are made
24 // consistent.
25 #include "EventKernel/IParticle.h"
26 
27 
28 // Create the persistent object from the transient one
30 {
31  // Create the message service for this class
32  MsgStream log( msgSvc(), "IParticleLinkContainerConverter" );
33 
34  // Do the actual creation of the persistent object
36 
37  // Write a debug message out
38  log << MSG::DEBUG << "Success" << endmsg;
39 
40  return persObj;
41 }
42 
43 
44 // Create the transient object from the persistent one
46 {
47  // Create the message service for this class
48  MsgStream log( msgSvc(), "IParticleLinkContainerConverter" );
49 
50  // Define the pool IDs
51  static const pool::Guid p1_guid("E82C71AF-AC5C-453B-9A35-FA45A849838E");
52 
53  if( compareClassGuid(p1_guid) )
54  {
55  // using unique_ptr ensures deletion of the persistent object
56  std::unique_ptr< IParticleLinkContainer_PERS > col_vect( poolReadObject< IParticleLinkContainer_PERS >() );
57  return m_TPConverter.createTransient( col_vect.get(), log );
58  }
59  else
60  {
61  throw std::runtime_error("Unsupported persistent version of Data Collection");
62  }
63 }
64 
ElementLinkCnv_p3.h
This file contains the class definition for the ElementLinkCnv_p3 class.
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
IParticle.h
VectorElementLinkCnv_p1.h
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
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
IParticleLinkContainerCnv::createPersistent
virtual IParticleLinkContainer_PERS * createPersistent(IParticleLinkContainer *transCont)
Member method to create the persistent version.
Definition: IParticleLinkContainerCnv.cxx:29
IParticleLinkContainerCnv::m_TPConverter
IParticleLinkContainerCnv_p1 m_TPConverter
Create the t/p converter.
Definition: IParticleLinkContainerCnv.h:57
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
IParticleLinkContainerCnv.h
T_AthenaPoolCustCnv< IParticleLinkContainer, IParticleLinkContainer_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
IParticleLinkContainerCnv::createTransient
virtual IParticleLinkContainer * createTransient()
Member method to create the transient version.
Definition: IParticleLinkContainerCnv.cxx:45