ATLAS Offline Software
CTP_DecisionCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Gaudi/Athena include(s):
7 #include "GaudiKernel/MsgStream.h"
8 
9 // Local include(s):
10 #include "CTP_DecisionCnv.h"
11 
12 // AnalysisTrigger include(s):
14 
16 
17  MsgStream log( this->msgSvc(), "CTP_DecisionCnv" );
18  CTP_Decision_PERS* persObj = m_converter.createPersistent( transObj, log );
19  return persObj;
20 
21 }
22 
24 
25  static const pool::Guid p2_guid( "08922DA9-6E47-4D3A-9FEC-0B4440644B50" );
26  static const pool::Guid p1_guid( "1F421F32-8FBD-47B7-82ED-5354B9BE96D8" );
27  static const pool::Guid p0_guid( "2A450F66-8A30-42E1-91CB-BE1CEE3C772F" );
28 
29  if( this->compareClassGuid( p2_guid ) ) {
30 
31  std::unique_ptr< CTP_Decision_p2 > pers_ref( this->poolReadObject< CTP_Decision_p2 >() );
32  MsgStream log( this->msgSvc(), "CTP_DecisionCnv" );
33  return m_converter.createTransient( pers_ref.get(), log );
34 
35  } else if( this->compareClassGuid( p1_guid ) ) {
36 
37  std::unique_ptr< CTP_Decision_p1 > pers_ref( this->poolReadObject< CTP_Decision_p1 >() );
38  MsgStream log( this->msgSvc(), "CTP_DecisionCnv" );
39  return m_converter_p1.createTransient( pers_ref.get(), log );
40 
41  } else if( this->compareClassGuid( p0_guid ) ) {
42 
43  return this->poolReadObject< CTP_Decision >();
44 
45  }
46 
47  throw std::runtime_error( "Unsupported persistent version of CTP_Decision" );
48  return 0;
49 
50 }
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
CTP_DecisionCnv::m_converter
CTP_DecisionCnv_p2 m_converter
Definition: CTP_DecisionCnv.h:44
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
CTP_Decision
Legacy data class representing the LVL1 CTP trigger decision.
Definition: CTP_Decision.h:39
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
CTP_DecisionCnv::m_converter_p1
CTP_DecisionCnv_p1 m_converter_p1
Definition: CTP_DecisionCnv.h:45
CTP_DecisionCnv::createTransient
virtual CTP_Decision * createTransient()
Definition: CTP_DecisionCnv.cxx:23
CTP_DecisionCnv::createPersistent
virtual CTP_Decision_PERS * createPersistent(CTP_Decision *transObj)
Definition: CTP_DecisionCnv.cxx:15
CTP_Decision_p1.h
CTP_DecisionCnv.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
CTP_Decision_p2
Persistent representation of CTP_Decision.
Definition: CTP_Decision_p2.h:25
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.