ATLAS Offline Software
TrigTauCnv.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 "TrigTauCnv.h"
10 
12 {
13 public:
16 };
17 
18 TrigTauCnv::TrigTauCnv(ISvcLocator* svcloc) :
20  m_impl (new TrigTauCnv_impl)
21 {
22 }
24 {
25  delete m_impl;
26 }
27 
28 //create persistent
30 {
31  MsgStream mlog(msgSvc(), "TrigTauConverter" );
32  mlog << MSG::DEBUG << "TrigTauCnv::createPersistent" << endmsg;
33 
34  TrigTau_PERS *persObj = m_impl->m_TPConverter_p2.createPersistent( transCont, mlog );
35 
36  return persObj;
37 }
38 
39 //create transient
41 {
42  MsgStream mlog(msgSvc(), "TrigTauConverter" );
43  mlog << MSG::DEBUG << "TrigTauCnv::createTransient " << endmsg;
44 
45  static const pool::Guid tlp1_guid("82AE3333-5398-4590-A51A-616832332D9B");
46  static const pool::Guid p0_guid("F95B5B76-13D3-4EB4-94BB-1383B8571ADD");
47  static const pool::Guid tlp2_guid("B2619D46-FB89-4961-8A57-6A980A2EFB33");
48  static const pool::Guid p2_guid("9CA7EFF2-DB12-4E06-A425-01B1D8367BE3");
49 
50  TrigTau *trans_cont(0);
51 
52  if( compareClassGuid(tlp1_guid) ) {
53 
54  mlog << MSG::DEBUG << "TrigTauCnv::reading tlp1 persistent object" << endmsg;
55  std::unique_ptr< TrigTau_tlp1 > col_vect( this->poolReadObject< TrigTau_tlp1 >() );
56  trans_cont = m_impl->m_TPConverter_p1.createTransient( col_vect.get(), mlog );
57 
58  }
59  else if( compareClassGuid(p0_guid) ) {
60 
61  mlog << MSG::DEBUG << "TrigTauCnv::reading p0 persistent object" << endmsg;
62  // old version from before TP separation, just return it
63  trans_cont = this->poolReadObject<TrigTau>();
64 
65  }else if( compareClassGuid(tlp2_guid) ) {
66 
67  mlog << MSG::DEBUG << "TrigTauCnv::reading tlp2 persistent object" << endmsg;
68  std::unique_ptr< TrigTau_tlp2 > col_vect( this->poolReadObject< TrigTau_tlp2 >() );
69  trans_cont = m_impl->m_TPConverter_p2.createTransient( col_vect.get(), mlog );
70 
71  }
72  else if( compareClassGuid(p2_guid) ) {
73 
74  mlog << MSG::DEBUG << "TrigTauCnv::reading p2 persistent object" << endmsg;
75  // old version from before TP separation, just return it
76  trans_cont = this->poolReadObject<TrigTau>();
77 
78  } else {
79 
80  throw std::runtime_error("Unsupported persistent version of Data container");
81 
82  }
83 
84  return trans_cont;
85 
86 }
TrigTauCnv_tlp1
Definition: TrigTauCnv_tlp1.h:29
TrigTauCnv::createTransient
TrigTau * createTransient()
Definition: TrigTauCnv.cxx:40
TrigTauCnv_tlp1.h
TrigTau_tlp2.h
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
TrigTauCnv_impl::m_TPConverter_p1
TrigTauCnv_tlp1 m_TPConverter_p1
Definition: TrigTauCnv.cxx:14
TrigTau_tlp1.h
TrigTauCnv::m_impl
TrigTauCnv_impl * m_impl
Definition: TrigTauCnv.h:48
pool::Guid
::Guid Guid
Definition: T_AthenaPoolCustCnv.h:19
TrigTau_tlp2
Definition: TrigTau_tlp2.h:25
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
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigTauCnv::TrigTauCnv
TrigTauCnv(ISvcLocator *svcloc)
Definition: TrigTauCnv.cxx:18
TrigTauCnv_impl::m_TPConverter_p2
TrigTauCnv_tlp2 m_TPConverter_p2
Definition: TrigTauCnv.cxx:15
TrigTauCnv.h
TrigTauCnv_impl
Definition: TrigTauCnv.cxx:12
TrigTauCnv_tlp2.h
TrigTauCnv::~TrigTauCnv
~TrigTauCnv()
Definition: TrigTauCnv.cxx:23
TrigTauCnv_tlp2
Definition: TrigTauCnv_tlp2.h:29
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigTau
File: TrigTau.h.
Definition: TrigTau.h:37
TopLevelTPConverter::createPersistent
virtual TL_PERS * createPersistent(const TRANS *transObj, MsgStream &log)
Create persistent representation of transObj.
Definition: TopLevelTPConverter.h:110
T_AthenaPoolCustCnv< TrigTau, TrigTau_PERS >::compareClassGuid
virtual bool compareClassGuid(const Guid &clid) const
Compare POOL class GUID with the one of the object being read.
TrigTauCnv::createPersistent
TrigTau_PERS * createPersistent(TrigTau *transCont)
Definition: TrigTauCnv.cxx:29