ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecTPCnv
src
MissingEtCaloCnv_p3.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
NAME: MissingEtCaloCnv_p3.cxx
7
PURPOSE: Transient/Persisten converter for MissingEtCalo class
8
********************************************************************/
9
10
// AthenaPoolCnvSvc includes
11
#include "
AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h
"
12
13
// MissingETEvent includes
14
#include "
MissingETEvent/MissingET.h
"
15
#include "
MissingETEvent/MissingEtCalo.h
"
16
17
// RecTPCnv includes
18
#include "
RecTPCnv/MissingEtCaloCnv_p3.h
"
19
#include "
RecTPCnv/MissingETCnv_p3.h
"
20
#include <bit>
21
#include <cstdint>
22
23
// MissingET converter
24
static
const
MissingETCnv_p3
metCnv
;
25
26
27
void
MissingEtCaloCnv_p3::persToTrans
(
const
MissingEtCalo_p3
* pers,
MissingEtCalo
*
trans
, MsgStream&
/* msg */
)
const
{
28
std::vector<float>::const_iterator i=pers->
m_allTheData
.begin();
29
//float version;
30
//version = (*i);
31
++i;
// as there is just one it is not used.
32
static_assert
(
sizeof
(float) ==
sizeof
(std::uint32_t));
33
int
size
=
static_cast<
int
>
(*i); ++i;
34
for
(
int
vi=0;vi<
size
;++vi){
35
auto
ci =
static_cast<
MissingEtCalo::CaloIndex
>
(vi);
36
trans
->setExCalo(ci, *i); ++i;
37
trans
->setEyCalo(ci, *i); ++i;
38
trans
->setEtSumCalo(ci, *i); ++i;
39
trans
->setNCellCalo(ci, std::bit_cast<std::uint32_t>(*i));
40
++i;
41
}
42
if
( i != pers->
m_allTheData
.end()) {
43
metCnv
.persToTrans(
trans
, i);
44
}
45
46
return
;
47
}
48
49
void
MissingEtCaloCnv_p3::transToPers
(
const
MissingEtCalo
*
trans
,
MissingEtCalo_p3
* pers, MsgStream&
/* msg */
)
const
{
50
static_assert
(
sizeof
(float) ==
sizeof
(std::uint32_t));
51
pers->
m_allTheData
.push_back(3.0);
// storing version number
52
pers->
m_allTheData
.reserve(
MissingEtCalo::Size
* 4 + 1);
53
pers->
m_allTheData
.push_back(
MissingEtCalo::Size
);
54
for
(
int
vi=0;vi<
MissingEtCalo::Size
;++vi){
55
auto
ci =
static_cast<
MissingEtCalo::CaloIndex
>
(vi);
56
pers->
m_allTheData
.push_back(
trans
->exCalo(ci));
57
pers->
m_allTheData
.push_back(
trans
->eyCalo(ci));
58
pers->
m_allTheData
.push_back(
trans
->etSumCalo(ci));
59
pers->
m_allTheData
.push_back(std::bit_cast<float>(
trans
->ncellCalo(ci)));
60
}
61
if
(
trans
->getSource() >= 0 &&
trans
->getSource() < 1000 )
62
metCnv
.transToPers(
trans
, pers->
m_allTheData
);
63
return
;
64
}
MissingETCnv_p3.h
metCnv
static const MissingETCnv_p1 metCnv
Definition
MissingEtCaloCnv_p1.cxx:31
MissingEtCaloCnv_p3.h
MissingEtCalo.h
MissingET.h
size
size_t size() const
Number of registered mappings.
T_AthenaPoolTPConverter.h
MissingETCnv_p3
Definition
MissingETCnv_p3.h:22
MissingEtCaloCnv_p3::persToTrans
virtual void persToTrans(const MissingEtCalo_p3 *persObj, MissingEtCalo *transObj, MsgStream &msg) const override
Definition
MissingEtCaloCnv_p3.cxx:27
MissingEtCaloCnv_p3::transToPers
virtual void transToPers(const MissingEtCalo *transObj, MissingEtCalo_p3 *persObj, MsgStream &msg) const override
Definition
MissingEtCaloCnv_p3.cxx:49
MissingEtCalo_p3
Definition
MissingEtCalo_p3.h:19
MissingEtCalo_p3::m_allTheData
std::vector< float > m_allTheData
Definition
MissingEtCalo_p3.h:33
MissingEtCalo
Definition
MissingEtCalo.h:27
MissingEtCalo::CaloIndex
CaloIndex
Definition
MissingEtCalo.h:31
MissingEtCalo::Size
@ Size
Definition
MissingEtCalo.h:39
trans
TH1F * trans(TH1F *h, bool t=false)
Definition
comparitor.cxx:199
Generated on
for ATLAS Offline Software by
1.17.0