ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigSteeringEventAthenaPool
src
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
"
8
#include "
TrigSteeringEventTPCnv/Lvl1ResultCnv_p1.h
"
9
#include "
TrigSteeringEventTPCnv/Lvl1ResultCnv_p2.h
"
10
#include "
TrigSteeringEventTPCnv/Lvl1Result_p1.h
"
11
#include "
TrigSteeringEventTPCnv/Lvl1Result_p2.h
"
12
13
struct
Lvl1ResultCnv_impl
14
{
15
LVL1CTP::Lvl1ResultCnv_p1
m_TPConverter_p1
;
16
LVL1CTP::Lvl1ResultCnv_p2
m_TPConverter_p2
;
17
};
18
19
Lvl1ResultCnv::Lvl1ResultCnv
(ISvcLocator* svcloc) :
20
Lvl1ResultCnvBase
(svcloc),
21
m_impl
(new
Lvl1ResultCnv_impl
)
22
{
23
}
24
25
Lvl1ResultCnv::~Lvl1ResultCnv
()
26
{
27
delete
m_impl
;
28
}
29
30
//create persistent
31
Lvl1Result_PERS
*
Lvl1ResultCnv::createPersistent
(
LVL1CTP::Lvl1Result
* transCont)
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
41
LVL1CTP::Lvl1Result
*
Lvl1ResultCnv::createTransient
(
const
Token
* token)
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
(token, 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 >
(token) );
52
return
m_impl
->m_TPConverter_p1.createTransient( col_vect.get(), mlog );
53
}
else
if
(
compareClassGuid
(token, p0_guid) ){
54
// old version from before TP separation, just return it
55
return
this->
poolReadObject<LVL1CTP::Lvl1Result>
(token);
56
}
else
if
(
compareClassGuid
(token, 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 >
(token) );
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
Lvl1ResultCnv.h
Lvl1Result_PERS
LVL1CTP::Lvl1Result_p2 Lvl1Result_PERS
Definition
Lvl1ResultCnv.h:30
Lvl1ResultCnvBase
T_AthenaPoolCustomCnv< LVL1CTP::Lvl1Result, Lvl1Result_PERS > Lvl1ResultCnvBase
Definition
Lvl1ResultCnv.h:32
Lvl1ResultCnv_p1.h
Lvl1ResultCnv_p2.h
Lvl1Result_p1.h
Lvl1Result_p2.h
LVL1CTP::Lvl1ResultCnv_p1
Definition
Lvl1ResultCnv_p1.h:32
LVL1CTP::Lvl1ResultCnv_p2
Definition
Lvl1ResultCnv_p2.h:32
LVL1CTP::Lvl1Result
Definition
Lvl1Result.h:30
Lvl1ResultCnv::~Lvl1ResultCnv
~Lvl1ResultCnv()
Definition
Lvl1ResultCnv.cxx:25
Lvl1ResultCnv::m_impl
Lvl1ResultCnv_impl * m_impl
Definition
Lvl1ResultCnv.h:53
Lvl1ResultCnv::createTransient
virtual LVL1CTP::Lvl1Result * createTransient(const Token *token)
Definition
Lvl1ResultCnv.cxx:41
Lvl1ResultCnv::createPersistent
virtual Lvl1Result_PERS * createPersistent(LVL1CTP::Lvl1Result *transCont)
Definition
Lvl1ResultCnv.cxx:31
Lvl1ResultCnv::Lvl1ResultCnv
Lvl1ResultCnv(ISvcLocator *svcloc)
Definition
Lvl1ResultCnv.cxx:19
T_AthenaPoolCustomCnv< LVL1CTP::Lvl1Result, Lvl1Result_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< LVL1CTP::Lvl1Result, Lvl1Result_PERS >::poolReadObject
P * poolReadObject(const Token *token)
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Lvl1ResultCnv_impl
Definition
Lvl1ResultCnv.cxx:14
Lvl1ResultCnv_impl::m_TPConverter_p2
LVL1CTP::Lvl1ResultCnv_p2 m_TPConverter_p2
Definition
Lvl1ResultCnv.cxx:16
Lvl1ResultCnv_impl::m_TPConverter_p1
LVL1CTP::Lvl1ResultCnv_p1 m_TPConverter_p1
Definition
Lvl1ResultCnv.cxx:15
Generated on
for ATLAS Offline Software by
1.17.0