ATLAS Offline Software
Loading...
Searching...
No Matches
Lvl1ResultCnv.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 "Lvl1ResultCnv.h"
12
18
19Lvl1ResultCnv::Lvl1ResultCnv (ISvcLocator* svcloc) :
20 Lvl1ResultCnvBase(svcloc),
22{
23}
24
29
30//create persistent
32{
33 MsgStream mlog(msgSvc(), "Lvl1ResultConverter" );
34
35 Lvl1Result_PERS* persObj = m_impl->m_TPConverter_p2.createPersistent( transCont, mlog );
36
37 return persObj;
38}
39
40//create transient
42{
43 MsgStream mlog(msgSvc(), "Lvl1ResultConverter" );
44
45 static const pool::Guid p2_guid("F4208CCF-9FAA-4F01-9C0B-26E9E59CE49F");
46 static const pool::Guid p1_guid("226FF990-4D6A-4957-AAAD-42172D174773");
47 static const pool::Guid p0_guid("18DE165E-3DB5-4EAC-867D-807DA3E217C0");
48
49 if ( compareClassGuid(p1_guid) ) {
50 // using unique_ptr ensures deletion of the persistent object
51 std::unique_ptr< LVL1CTP::Lvl1Result_p1 > col_vect( poolReadObject< LVL1CTP::Lvl1Result_p1 >() );
52 return m_impl->m_TPConverter_p1.createTransient( col_vect.get(), mlog );
53 } else if( compareClassGuid(p0_guid) ){
54 // old version from before TP separation, just return it
56 } else if ( compareClassGuid(p2_guid) ) {
57 // using unique_ptr ensures deletion of the persistent object
58 std::unique_ptr< LVL1CTP::Lvl1Result_p2 > col_vect( poolReadObject< LVL1CTP::Lvl1Result_p2 >() );
59 return m_impl->m_TPConverter_p2.createTransient( col_vect.get(), mlog );
60 }
61
62 throw std::runtime_error("Unsupported persistent version of Lvl1Result");
63}
64
65#endif
LVL1CTP::Lvl1Result_p2 Lvl1Result_PERS
T_AthenaPoolCustomCnv< LVL1CTP::Lvl1Result, Lvl1Result_PERS > Lvl1ResultCnvBase
virtual LVL1CTP::Lvl1Result * createTransient()
Lvl1ResultCnv_impl * m_impl
virtual Lvl1Result_PERS * createPersistent(LVL1CTP::Lvl1Result *transCont)
Lvl1ResultCnv(ISvcLocator *svcloc)
virtual bool compareClassGuid(const Guid &clid) const
LVL1CTP::Lvl1ResultCnv_p2 m_TPConverter_p2
LVL1CTP::Lvl1ResultCnv_p1 m_TPConverter_p1