ATLAS Offline Software
MissingETCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 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
15 
16 // MissingETEvent includes
19 
20 // RecTPCnv includes
23 
24 
25 #include <stdlib.h>
26 
27 // region converter
28 static const MissingEtRegionsCnv_p2 regCnv;
29 
30 
31 
32 void MissingETCnv_p2::persToTrans( const MissingET_p2* pers, MissingET* trans, MsgStream& /* msg */ ) const {
33  std::vector<float>::const_iterator it=pers->m_AllTheData.begin();
34  persToTrans(trans, it);
35  return;
36 }
37 
38 void MissingETCnv_p2::transToPers( const MissingET* trans, MissingET_p2* pers, MsgStream& /* msg */ ) const {
39  transToPers(trans, pers->m_AllTheData);
40  return;
41 }
42 
43 
44 void MissingETCnv_p2::persToTrans( MissingET* trans, std::vector<float>::const_iterator i) const {
45  union conv{ unsigned int i; float f; } c;
46  c.f=(*i); ++i;
47  MissingET::Source source = static_cast<MissingET::Source>(c.i>>1);
48  double ex = (*i);++i;
49  double ey = (*i);++i;
50  double etSum = (*i);++i;
51  std::unique_ptr<MissingEtRegions> regions;
52  if( c.i & 1) {
53  regions = std::make_unique<MissingEtRegions>();
54  regCnv.persToTrans( regions.get(), i);
55  }
56 
57  *trans = MissingET (source,
58  std::move (regions),
59  ex, ey, etSum);
60  // std::cout<<"READING: source: "<<trans->m_source<<"\t et: "<<trans->m_etSum;
61  // if (trans->m_regions != 0) std::cout<<"\t has Regions"<<std::endl; else std::cout<<"\t NO Regions"<<std::endl;
62  return;
63 }
64 
65 void MissingETCnv_p2::transToPers( const MissingET* trans, std::vector<float> &all ) const {
66  unsigned int tmp=static_cast<unsigned int>(trans->getSource());
67  tmp <<= 1;
68  if( trans->getRegions() != 0) tmp|=1;
69  union conv{ unsigned int i; float f; } c;
70  c.i=tmp;
71  all.push_back(c.f);
72  all.push_back(trans->etx());
73  all.push_back(trans->ety());
74  all.push_back(trans->sumet());
75  if( trans->getRegions() != 0) regCnv.transToPers(trans->getRegions(), all);
76  // std::cout<<"WRITING: source: "<<trans->m_source<<"\t et: "<<trans->m_etSum;
77  // if (trans->m_regions != 0) std::cout<<"\t has Regions"<<std::endl; else std::cout<<"\t NO Regions"<<std::endl;
78  return;
79 }
MissingET::etx
virtual double etx() const
Definition: MissingET.cxx:141
MissingET.h
MissingET::getRegions
virtual const MissingEtRegions * getRegions() const
Definition: MissingET.cxx:164
MissingEtRegionsCnv_p2.h
MissingEtRegionsCnv_p2::transToPers
virtual void transToPers(const MissingEtRegions *transObj, MissingEtRegions_p2 *persObj, MsgStream &msg) const override
Definition: MissingEtRegionsCnv_p2.cxx:37
MissingET::Source
Source
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:38
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
MissingEtRegionsCnv_p2::persToTrans
virtual void persToTrans(const MissingEtRegions_p2 *persObj, MissingEtRegions *transObj, MsgStream &msg) const override
Definition: MissingEtRegionsCnv_p2.cxx:32
MissingET::getSource
virtual Source getSource() const
Definition: MissingET.cxx:171
lumiFormat.i
int i
Definition: lumiFormat.py:85
T_AthenaPoolTPConverter.h
MissingETCnv_p2::transToPers
virtual void transToPers(const MissingET *transObj, MissingET_p2 *persObj, MsgStream &msg) const override
Definition: MissingETCnv_p2.cxx:38
hist_file_dump.f
f
Definition: hist_file_dump.py:135
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
MissingET
Athena::TPCnvVers::Old Athena::TPCnvVers::Old MissingET
Definition: RecTPCnv.cxx:64
MissingET_p2::m_AllTheData
std::vector< float > m_AllTheData
Definition: MissingET_p2.h:27
MissingET::ety
virtual double ety() const
Definition: MissingET.cxx:145
MissingEtRegions.h
MissingET
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:23
MissingETCnv_p2.h
copySelective.source
string source
Definition: copySelective.py:32
MissingEtRegionsCnv_p2
Definition: MissingEtRegionsCnv_p2.h:23
MissingET::sumet
virtual double sumet() const
Definition: MissingET.cxx:149
MissingETCnv_p2::persToTrans
virtual void persToTrans(const MissingET_p2 *persObj, MissingET *transObj, MsgStream &msg) const override
Definition: MissingETCnv_p2.cxx:32
python.compressB64.c
def c
Definition: compressB64.py:93
pdg_comparison.conv
conv
Definition: pdg_comparison.py:321
MissingET_p2
Definition: MissingET_p2.h:20