ATLAS Offline Software
HLTResultCnv.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef XAOD_ANALYSIS
6 
7 #include "HLTResultCnv.h"
10 
11 HLTResultCnv::HLTResultCnv (ISvcLocator* svcloc) :
12  HLTResultCnvBase(svcloc),
13  m_TPConverter (new HLT::HLTResultCnv_p1)
14 {}
15 
17 {
18  delete m_TPConverter;
19 }
20 
21 
22 //create persistent
24 {
25  MsgStream mlog(msgSvc(), "HLTResultConverter" );
26 
27  HLTResult_PERS* persObj = m_TPConverter->createPersistent( transCont, mlog );
28 
29  return persObj;
30 }
31 
32 //create transient
34 {
35  MsgStream mlog(msgSvc(), "HLTResultConverter" );
36 
37  static const pool::Guid p1_guid("9567573D-F35E-4D5E-9A1A-A43B07D3CF3B");
38  static const pool::Guid p0_guid("559D6CB9-9A54-4284-A03D-9C745352281D");
39 
40  if ( compareClassGuid(p1_guid) ) {
41  // using unique_ptr ensures deletion of the persistent object
42  std::unique_ptr< HLT::HLTResult_p1 > col_vect( poolReadObject< HLT::HLTResult_p1 >() );
43  return m_TPConverter->createTransient( col_vect.get(), mlog );
44  }
45 
46  else if( compareClassGuid(p0_guid) ){
47  // old version from before TP separation, just return it
48  return this->poolReadObject<HLT::HLTResult>();
49  }
50 
51  throw std::runtime_error("Unsupported persistent version of HLTResult");
52 }
53 
54 #endif
HLTResultCnv.h
HLTResultCnv::~HLTResultCnv
~HLTResultCnv()
Definition: HLTResultCnv.cxx:16
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
HLTResultCnv_p1.h
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
HLTResultCnv::createTransient
virtual HLT::HLTResult * createTransient()
Definition: HLTResultCnv.cxx:33
HLTResultCnv::HLTResultCnv
HLTResultCnv(ISvcLocator *svcloc)
Definition: HLTResultCnv.cxx:11
HLT::HLTResult_p1
Definition: HLTResult_p1.h:47
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
HLTResult_p1.h
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:134
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
HLT::HLTResult
HLT::HLTResult is sumarising result of trigger decision evaluation (online/offline) It contains basic...
Definition: HLTResult.h:57
HLTResultCnv::createPersistent
virtual HLTResult_PERS * createPersistent(HLT::HLTResult *transCont)
Definition: HLTResultCnv.cxx:23
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
HLTResultCnv::m_TPConverter
HLT::HLTResultCnv_p1 * m_TPConverter
Definition: HLTResultCnv.h:56