ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
18TrigTauCnv::TrigTauCnv(ISvcLocator* svcloc) :
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}
#define endmsg
TrigTau_tlp2 TrigTau_PERS
Definition TrigTauCnv.h:26
virtual bool compareClassGuid(const Guid &clid) const
Compatibility for old converter classes that don't get passed the key.
TrigTauCnv_tlp2 m_TPConverter_p2
TrigTauCnv_tlp1 m_TPConverter_p1
TrigTau * createTransient()
TrigTauCnv_impl * m_impl
Definition TrigTauCnv.h:48
TrigTau_PERS * createPersistent(TrigTau *transCont)
TrigTauCnv(ISvcLocator *svcloc)
File: TrigTau.h.
Definition TrigTau.h:37