ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecTPCnv
src
MissingETCnv_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
7
NAME: MissingETCnv_p2.cxx
8
PACKAGE: offline/Reconstruction/RecTPCnv
9
10
PURPOSE: Transient/Persisten converter for MissingET class
11
********************************************************************/
12
13
// AthenaPoolCnvSvc includes
14
#include "
AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h
"
15
16
// MissingETEvent includes
17
#include "
MissingETEvent/MissingET.h
"
18
#include "
MissingETEvent/MissingEtRegions.h
"
19
20
// RecTPCnv includes
21
#include "
RecTPCnv/MissingETCnv_p2.h
"
22
#include "
RecTPCnv/MissingEtRegionsCnv_p2.h
"
23
24
25
#include <stdlib.h>
26
#include <bit>
27
28
// region converter
29
static
const
MissingEtRegionsCnv_p2
regCnv
;
30
31
32
33
void
MissingETCnv_p2::persToTrans
(
const
MissingET_p2
* pers,
MissingET
*
trans
, MsgStream&
/* msg */
)
const
{
34
std::vector<float>::const_iterator it=pers->
m_AllTheData
.begin();
35
persToTrans
(
trans
, it);
36
return
;
37
}
38
39
void
MissingETCnv_p2::transToPers
(
const
MissingET
*
trans
,
MissingET_p2
* pers, MsgStream&
/* msg */
)
const
{
40
transToPers
(
trans
, pers->
m_AllTheData
);
41
return
;
42
}
43
44
45
void
MissingETCnv_p2::persToTrans
(
MissingET
*
trans
, std::vector<float>::const_iterator i)
const
{
46
float
fcnv=(*i); ++i;
47
auto
icnv = std::bit_cast<unsigned int>(fcnv);
48
MissingET::Source
source =
static_cast<
MissingET::Source
>
(icnv>>1);
49
double
ex = (*i);++i;
50
double
ey = (*i);++i;
51
double
etSum = (*i);++i;
52
std::unique_ptr<MissingEtRegions>
regions
;
53
if
( icnv & 1) {
54
regions
= std::make_unique<MissingEtRegions>();
55
regCnv
.persToTrans(
regions
.get(), i);
56
}
57
58
*
trans
=
MissingET
(source,
59
std::move (
regions
),
60
ex, ey, etSum);
61
// std::cout<<"READING: source: "<<trans->m_source<<"\t et: "<<trans->m_etSum;
62
// if (trans->m_regions != 0) std::cout<<"\t has Regions"<<std::endl; else std::cout<<"\t NO Regions"<<std::endl;
63
return
;
64
}
65
66
void
MissingETCnv_p2::transToPers
(
const
MissingET
*
trans
, std::vector<float> &all )
const
{
67
unsigned
int
tmp=
static_cast<
unsigned
int
>
(
trans
->getSource());
68
tmp <<= 1;
69
if
(
trans
->getRegions() != 0) tmp|=1;
70
union
conv{
unsigned
int
i;
float
f; } c;
71
c.i=tmp;
72
all.push_back(c.f);
73
all.push_back(
trans
->etx());
74
all.push_back(
trans
->ety());
75
all.push_back(
trans
->sumet());
76
if
(
trans
->getRegions() != 0)
regCnv
.transToPers(
trans
->getRegions(), all);
77
// std::cout<<"WRITING: source: "<<trans->m_source<<"\t et: "<<trans->m_etSum;
78
// if (trans->m_regions != 0) std::cout<<"\t has Regions"<<std::endl; else std::cout<<"\t NO Regions"<<std::endl;
79
return
;
80
}
regCnv
static const MissingEtRegionsCnv_p1 regCnv
Definition
MissingETCnv_p1.cxx:28
MissingETCnv_p2.h
MissingEtRegionsCnv_p2.h
MissingEtRegions.h
regions
static const std::vector< std::string > regions
Definition
MuonTriggerSFFilesTest.cxx:21
MissingET
Athena::TPCnvVers::Old Athena::TPCnvVers::Old MissingET
Definition
RecTPCnv.cxx:64
MissingET.h
T_AthenaPoolTPConverter.h
MissingETCnv_p2::persToTrans
virtual void persToTrans(const MissingET_p2 *persObj, MissingET *transObj, MsgStream &msg) const override
Definition
MissingETCnv_p2.cxx:33
MissingETCnv_p2::transToPers
virtual void transToPers(const MissingET *transObj, MissingET_p2 *persObj, MsgStream &msg) const override
Definition
MissingETCnv_p2.cxx:39
MissingET_p2
Definition
MissingET_p2.h:20
MissingET_p2::m_AllTheData
std::vector< float > m_AllTheData
Definition
MissingET_p2.h:27
MissingET
Definition
Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:23
MissingET::Source
Source
Definition
Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:29
MissingEtRegionsCnv_p2
Definition
MissingEtRegionsCnv_p2.h:23
trans
TH1F * trans(TH1F *h, bool t=false)
Definition
comparitor.cxx:199
Generated on
for ATLAS Offline Software by
1.17.0