ATLAS Offline Software
IsoMuonFeatureCnv.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 #include "IsoMuonFeatureCnv.h"
7 
8 //constructor
9 IsoMuonFeatureCnv::IsoMuonFeatureCnv( ISvcLocator* svcloc ) :
10  IsoMuonFeatureCnvBase( svcloc ),
11  m_TPConverter (new IsoMuonFeatureCnv_tlp1)
12 {}
13 
14 //destructor
16 {
17  delete m_TPConverter;
18 }
19 
20 //-----------------------------------------------------------------------------
21 // Create persistent
22 //-----------------------------------------------------------------------------
23 
26 {
27  MsgStream mlog(msgSvc(), "IsoMuonFeatureConverter" );
28 
29  mlog << MSG::DEBUG << "IsoMuonFeatureCnv::createPersistent" << endmsg;
30 
31  IsoMuonFeature_PERS *persObj = m_TPConverter->createPersistent( transObj, mlog );
32 
33  return persObj;
34 }
35 
36 //-----------------------------------------------------------------------------
37 // Create transient
38 //-----------------------------------------------------------------------------
40 {
41  MsgStream mlog(msgSvc(), "IsoMuonFeatureConverter" );
42 
43  mlog << MSG::DEBUG << "IsoMuonFeatureCnv::createTransient " << endmsg;
44 
45  IsoMuonFeature *transObj(0);
46 
47  static const pool::Guid p1_guid("31A90EEE-AF5A-4CAF-9A83-F523D141C4CF");
48  static const pool::Guid p0_guid("60ECF1E1-408A-43CA-9858-62AAFE8041FF");
49 
50  if( compareClassGuid( p1_guid ) ) {
51  std::unique_ptr< IsoMuonFeature_tlp1 > ptr_tlp1( this->poolReadObject< IsoMuonFeature_tlp1 >() );
52  transObj = m_TPConverter->createTransient( ptr_tlp1.get(), mlog );
53  }
54  else if( compareClassGuid(p0_guid) ) {
55  // old version from before TP separation, just return it
56  transObj = this->poolReadObject<IsoMuonFeature>();
57  }
58  else {
59  throw std::runtime_error("Unsupported persistent version");
60  }
61  return transObj;
62 }
IsoMuonFeatureCnv::createPersistent
virtual IsoMuonFeature_PERS * createPersistent(IsoMuonFeature *transObj)
Definition: IsoMuonFeatureCnv.cxx:25
IsoMuonFeature_tlp1
Definition: IsoMuonFeature_tlp1.h:13
IsoMuonFeatureCnv_tlp1.h
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
IsoMuonFeatureCnv::IsoMuonFeatureCnv
IsoMuonFeatureCnv(ISvcLocator *svcloc)
Definition: IsoMuonFeatureCnv.cxx:9
IsoMuonFeatureCnv.h
IsoMuonFeatureCnv::createTransient
virtual IsoMuonFeature * createTransient()
Definition: IsoMuonFeatureCnv.cxx:39
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TopLevelTPConverter::createTransient
TRANS * createTransient(MsgStream &log)
Create transient representation of the persistent object known to this converter.
Definition: TopLevelTPConverter.h:62
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:134
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
IsoMuonFeatureCnv::~IsoMuonFeatureCnv
~IsoMuonFeatureCnv()
Definition: IsoMuonFeatureCnv.cxx:15
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
IsoMuonFeatureCnv::m_TPConverter
IsoMuonFeatureCnv_tlp1 * m_TPConverter
Definition: IsoMuonFeatureCnv.h:54
IsoMuonFeature
Class with isolation variables for TrigmuIso algorithm.
Definition: IsoMuonFeature.h:41
DEBUG
#define DEBUG
Definition: page_access.h:11
IsoMuonFeatureCnv_tlp1
Definition: IsoMuonFeatureCnv_tlp1.h:26
TopLevelTPConverter::createPersistent
virtual TL_PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of transObj.
Definition: TopLevelTPConverter.h:110
T_AthenaPoolCustCnv::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.