ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigEvent
TrigEventAthenaPool
src
TrigMonEventCollectionCnv.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
6
#include "
TrigMonEventCollectionCnv.h
"
7
#include "
TrigMonitoringEventTPCnv/TrigMonEventCollectionCnv_p1.h
"
8
#include "
TrigMonitoringEventTPCnv/TrigMonEventCollectionCnv_tlp1.h
"
9
10
class
TrigMonEventCollectionCnv_impl
11
{
12
public
:
13
TrigMonEventCollectionCnv_p1
m_TPConverter
;
14
TrigMonEventCollectionCnv_tlp1
m_TPConverter_tlp1
;
15
};
16
17
//---------------------------------------------------------------------------------------------
18
TrigMonEventCollectionCnv::TrigMonEventCollectionCnv
(ISvcLocator* svcloc) :
19
T_AthenaPoolCustomCnv
<
TrigMonEventCollection
,
TrigMonEventCollection_PERS
>(svcloc),
20
m_log
(new MsgStream(msgSvc(),
"TrigMonEventCollectionCnv"
)),
21
m_impl
(new
TrigMonEventCollectionCnv_impl
)
22
{
23
}
24
25
//---------------------------------------------------------------------------------------------
26
TrigMonEventCollectionCnv::~TrigMonEventCollectionCnv
()
27
{
28
delete
m_log
;
29
delete
m_impl
;
30
}
31
32
//---------------------------------------------------------------------------------------------
33
//create persistent
34
TrigMonEventCollection_PERS
*
TrigMonEventCollectionCnv::createPersistent
(
TrigMonEventCollection
* transObj)
35
{
36
(*m_log) << MSG::DEBUG <<
"TrigMonEventCollectionCnv::createPersistent"
<<
endmsg
;
37
38
TrigMonEventCollection_PERS
*persObj =
m_impl
->m_TPConverter_tlp1.createPersistent(transObj, *
m_log
);
39
return
persObj;
40
}
41
42
//---------------------------------------------------------------------------------------------
43
//createTransient
44
TrigMonEventCollection
*
TrigMonEventCollectionCnv::createTransient
(
const
Token
* token)
45
{
46
(*m_log) << MSG::DEBUG <<
"TrigMonEventCollectionCnv::createTransient "
<<
endmsg
;
47
48
static
const
pool::Guid
tlp1_guid(
"F224B21A-0CE8-40F1-B88B-027DA832A2A5"
);
49
static
const
pool::Guid
p1_guid(
"9A0D41EB-9A40-42A1-8CDA-C80845FC7271"
);
50
51
TrigMonEventCollection
*trans_obj(0);
52
53
if
(
compareClassGuid
(token, tlp1_guid) ) {
54
55
(*m_log) << MSG::DEBUG <<
"TrigMonEventCollectionCnv::reading tlp1 persistent object"
<<
endmsg
;
56
std::unique_ptr< TrigMonEventCollection_tlp1 > col_vect( this->
poolReadObject< TrigMonEventCollection_tlp1 >
(token) );
57
(*m_log) << MSG::DEBUG <<
"TrigMonEventCollectionCnv::reading tlp1 persistent object pointer"
<< col_vect.get() <<
endmsg
;
58
trans_obj =
m_impl
->m_TPConverter_tlp1.createTransient(col_vect.get(), *
m_log
);
59
}
60
else
if
(
compareClassGuid
(token, p1_guid) ) {
61
62
(*m_log) << MSG::DEBUG <<
"TrigMonEventCollectionCnv::reading p1 persistent object"
<<
endmsg
;
63
std::unique_ptr< TrigMonEventCollection_p1 > col_vect( this->
poolReadObject< TrigMonEventCollection_p1 >
(token) );
64
(*m_log) << MSG::DEBUG <<
"TrigMonEventCollectionCnv::reading p1 persistent object pointer"
<< col_vect.get() <<
endmsg
;
65
trans_obj =
m_impl
->m_TPConverter.createTransient(col_vect.get(), *
m_log
);
66
}
67
else
{
68
throw
std::runtime_error(
"Unsupported persistent version of TrigMonEventCollection"
);
69
}
70
71
return
trans_obj;
72
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
TrigMonEventCollectionCnv.h
TrigMonEventCollection_PERS
TrigMonEventCollection_tlp1 TrigMonEventCollection_PERS
Definition
TrigMonEventCollectionCnv.h:16
TrigMonEventCollectionCnv_p1.h
TrigMonEventCollectionCnv_tlp1.h
T_AthenaPoolCustomCnv< TrigMonEventCollection, TrigMonEventCollection_PERS >::compareClassGuid
virtual bool compareClassGuid(const Token *token, const Guid &clid) const
T_AthenaPoolCustomCnv< TrigMonEventCollection, TrigMonEventCollection_PERS >::poolReadObject
P * poolReadObject(const Token *token)
T_AthenaPoolCustomCnv
Compatibility for old converter classes that don't get passed the key.
Definition
T_AthenaPoolCustomCnv.h:129
Token
This class provides a token that identifies in a unique way objects on the persistent storage.
Definition
Token.h:22
TrigMonEventCollectionCnv_impl
Definition
TrigMonEventCollectionCnv.cxx:11
TrigMonEventCollectionCnv_impl::m_TPConverter
TrigMonEventCollectionCnv_p1 m_TPConverter
Definition
TrigMonEventCollectionCnv.cxx:13
TrigMonEventCollectionCnv_impl::m_TPConverter_tlp1
TrigMonEventCollectionCnv_tlp1 m_TPConverter_tlp1
Definition
TrigMonEventCollectionCnv.cxx:14
TrigMonEventCollectionCnv_p1
Definition
TrigMonEventCollectionCnv_p1.h:18
TrigMonEventCollectionCnv_tlp1
Definition
TrigMonEventCollectionCnv_tlp1.h:16
TrigMonEventCollectionCnv::m_impl
TrigMonEventCollectionCnv_impl * m_impl
Definition
TrigMonEventCollectionCnv.h:35
TrigMonEventCollectionCnv::createPersistent
TrigMonEventCollection_PERS * createPersistent(TrigMonEventCollection *transObj)
Definition
TrigMonEventCollectionCnv.cxx:34
TrigMonEventCollectionCnv::~TrigMonEventCollectionCnv
virtual ~TrigMonEventCollectionCnv()
Definition
TrigMonEventCollectionCnv.cxx:26
TrigMonEventCollectionCnv::m_log
MsgStream * m_log
Definition
TrigMonEventCollectionCnv.h:34
TrigMonEventCollectionCnv::createTransient
TrigMonEventCollection * createTransient(const Token *token)
Definition
TrigMonEventCollectionCnv.cxx:44
TrigMonEventCollectionCnv::TrigMonEventCollectionCnv
TrigMonEventCollectionCnv(ISvcLocator *svcloc)
Definition
TrigMonEventCollectionCnv.cxx:18
TrigMonEventCollection
Definition
TrigMonEventCollection.h:11
pool::Guid
::Guid Guid
Definition
T_AthenaPoolCustCnv.h:19
Generated on
for ATLAS Offline Software by
1.17.0