ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecTPCnv
src
MissingEtCaloCnv_p2.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_p2.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
16
// RecTPCnv includes
17
#include "
RecTPCnv/MissingEtCaloCnv_p2.h
"
18
#include "
RecTPCnv/MissingETCnv_p2.h
"
19
#include <vector>
20
#include <bit>
21
#include <cstdint>
22
23
// MissingET converter
24
static
const
MissingETCnv_p2
metCnv
;
25
26
27
void
MissingEtCaloCnv_p2::persToTrans
(
const
MissingEtCalo_p2
* pers,
MissingEtCalo
*
trans
, MsgStream&
/* msg */
)
const
{
28
std::vector<float>::const_iterator i=pers->
m_AllTheData
.begin();
29
int
size
=(int)(*i);++i;
30
trans
->setExCaloVec (std::vector<double> (i, i+
size
)); i+=
size
;
31
trans
->setEyCaloVec (std::vector<double> (i, i+
size
)); i+=
size
;
32
trans
->setEtSumCaloVec (std::vector<double> (i, i+
size
)); i+=
size
;
33
static_assert
(
sizeof
(float) ==
sizeof
(std::uint32_t));
34
for
(
int
w = 0; w <
size
; ++w) {
35
const
auto
ncell = std::bit_cast<std::uint32_t>(*i);
36
trans
->setNCellCalo(
static_cast<
MissingEtCalo::CaloIndex
>
(w), ncell);
37
++i;
38
}
39
metCnv
.persToTrans(
trans
,i);
40
return
;
41
}
42
43
void
MissingEtCaloCnv_p2::transToPers
(
const
MissingEtCalo
*
trans
,
MissingEtCalo_p2
* pers, MsgStream&
/* msg */
)
const
{
44
pers->
m_AllTheData
.push_back((
float
)
trans
->exCaloVec().size());
45
std::copy(
trans
->exCaloVec().begin(),
trans
->exCaloVec().end(), std::back_inserter(pers->
m_AllTheData
) );
46
std::copy(
trans
->eyCaloVec().begin(),
trans
->eyCaloVec().end(), std::back_inserter(pers->
m_AllTheData
) );
47
std::copy(
trans
->etSumCaloVec().begin(),
trans
->etSumCaloVec().end(), std::back_inserter(pers->
m_AllTheData
) );
48
static_assert
(
sizeof
(float) ==
sizeof
(std::uint32_t));
49
for
(
unsigned
int
w = 0; w <
trans
->exCaloVec().
size
(); ++w) {
50
const
auto
ncell =
static_cast<
std::uint32_t
>
(
51
trans
->ncellCalo(
static_cast<
MissingEtCalo::CaloIndex
>
(w))
52
);
53
pers->
m_AllTheData
.push_back(std::bit_cast<float>(ncell));
54
}
55
metCnv
.transToPers(
trans
, pers->
m_AllTheData
);
56
57
return
;
58
}
MissingETCnv_p2.h
metCnv
static const MissingETCnv_p1 metCnv
Definition
MissingEtCaloCnv_p1.cxx:31
MissingEtCaloCnv_p2.h
MissingET.h
size
size_t size() const
Number of registered mappings.
T_AthenaPoolTPConverter.h
MissingETCnv_p2
Definition
MissingETCnv_p2.h:24
MissingEtCaloCnv_p2::transToPers
virtual void transToPers(const MissingEtCalo *transObj, MissingEtCalo_p2 *persObj, MsgStream &msg) const override
Definition
MissingEtCaloCnv_p2.cxx:43
MissingEtCaloCnv_p2::persToTrans
virtual void persToTrans(const MissingEtCalo_p2 *persObj, MissingEtCalo *transObj, MsgStream &msg) const override
Definition
MissingEtCaloCnv_p2.cxx:27
MissingEtCalo_p2
Definition
MissingEtCalo_p2.h:21
MissingEtCalo_p2::m_AllTheData
std::vector< float > m_AllTheData
Definition
MissingEtCalo_p2.h:35
MissingEtCalo
Definition
MissingEtCalo.h:27
MissingEtCalo::CaloIndex
CaloIndex
Definition
MissingEtCalo.h:31
trans
TH1F * trans(TH1F *h, bool t=false)
Definition
comparitor.cxx:199
Generated on
for ATLAS Offline Software by
1.17.0