ATLAS Offline Software
TrigMonEventCnv.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 #include "TrigMonEventCnv.h"
8 
9 //---------------------------------------------------------------------------------------------
10 TrigMonEventCnv::TrigMonEventCnv(ISvcLocator* svcloc) :
12  m_log(new MsgStream(msgSvc(), "TrigMonEventCnv")),
13  m_TPConverter (new TrigMonEventCnv_p1)
14 {
15 }
16 
17 //---------------------------------------------------------------------------------------------
19 {
20  delete m_log;
21  delete m_TPConverter;
22 }
23 
24 //---------------------------------------------------------------------------------------------
25 //create persistent
27 {
28  (*m_log) << MSG::DEBUG << "TrigMonEventCnv::createPersistent" << endmsg;
29 
30  TrigMonEvent_PERS *persObj = m_TPConverter->createPersistent(transObj, *m_log);
31  return persObj;
32 }
33 
34 //---------------------------------------------------------------------------------------------
35 //createTransient
37 {
38  (*m_log) << MSG::DEBUG << "TrigMonEventCnv::createTransient " << endmsg;
39 
40  static const pool::Guid p1_guid("AECD5837-E8DA-4FF3-8601-44B4C17355ED");
41  TrigMonEvent *trans_obj(0);
42 
43  if( compareClassGuid(p1_guid) ) {
44 
45  (*m_log) << MSG::DEBUG << "TrigMonEventCnv::reading p1 persistent object" << endmsg;
46  std::unique_ptr< TrigMonEvent_p1 > col_vect( this->poolReadObject< TrigMonEvent_p1 >());
47  trans_obj = m_TPConverter->createTransient( col_vect.get(), *m_log);
48  }
49  else {
50  throw std::runtime_error("Unsupported persistent version of TrigMonEvent");
51  }
52 
53  return trans_obj;
54 }
TPPolyCnvBase::createTransient
virtual TRANS * createTransient(const PERS *persObj, MsgStream &log)
Create transient representation of a persistent object.
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
TrigMonEventCnv::m_TPConverter
TrigMonEventCnv_p1 * m_TPConverter
Definition: TrigMonEventCnv.h:35
TrigMonEvent_p1
Definition: TrigMonEvent_p1.h:22
TPAbstractPolyCnvBase::createPersistent
virtual PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of a transient object.
TrigMonEventCnv::~TrigMonEventCnv
virtual ~TrigMonEventCnv()
Definition: TrigMonEventCnv.cxx:18
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition: T_AthenaPoolCustomCnv.h:132
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigMonEventCnv::TrigMonEventCnv
TrigMonEventCnv(ISvcLocator *svcloc)
Definition: TrigMonEventCnv.cxx:10
TrigMonEvent
Definition: TrigMonEvent.h:36
TrigMonEventCnv::createTransient
TrigMonEvent * createTransient()
Definition: TrigMonEventCnv.cxx:36
TrigMonEventCnv_p1.h
TrigMonEventCnv::createPersistent
TrigMonEvent_PERS * createPersistent(TrigMonEvent *transObj)
Definition: TrigMonEventCnv.cxx:26
TrigMonEventCnv.h
TrigMonEventCnv_p1
Definition: TrigMonEventCnv_p1.h:24
DEBUG
#define DEBUG
Definition: page_access.h:11
T_AthenaPoolCustCnv< TrigMonEvent, TrigMonEvent_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TrigMonEventCnv::m_log
MsgStream * m_log
Definition: TrigMonEventCnv.h:34