ATLAS Offline Software
MissingEtCaloCnv_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 NAME: MissingEtCaloCnv_p2.cxx
7 PURPOSE: Transient/Persisten converter for MissingEtCalo class
8 ********************************************************************/
9 
10 // AthenaPoolCnvSvc includes
12 
13 // MissingETEvent includes
16 
17 // RecTPCnv includes
20 
21 // MissingET converter
22 static const MissingETCnv_p2 metCnv;
23 
24 
25 void MissingEtCaloCnv_p2::persToTrans( const MissingEtCalo_p2* pers, MissingEtCalo* trans, MsgStream& /* msg */ ) const {
26  std::vector<float>::const_iterator i=pers->m_AllTheData.begin();
27  int size=(int)(*i);++i;
28  trans->setExCaloVec (std::vector<double> (i, i+size)); i+= size;
29  trans->setEyCaloVec (std::vector<double> (i, i+size)); i+= size;
30  trans->setEtSumCaloVec (std::vector<double> (i, i+size)); i+= size;
31  union conv{ unsigned int i; float f; } c;
32  for(int w=0;w<size;++w){
33  c.f=(*i);
34  trans->setNCellCalo(static_cast<MissingEtCalo::CaloIndex>(w), c.i);
35  ++i;
36  }
37  metCnv.persToTrans(trans,i);
38 
39 // std::cout<<"READING MissingEtCalo"<<std::endl;
40 // std::cout<<"READING: "<<size<<"\t"<<trans->m_exCalo[0]<<"\t"<<trans->m_eyCalo[6]<<"\t"<<trans->m_etSumCalo[3]<<"\t"<<trans->m_nCellsCalo[6]<<std::endl;
41 
42  return;
43 }
44 
45 void MissingEtCaloCnv_p2::transToPers( const MissingEtCalo* trans, MissingEtCalo_p2* pers, MsgStream& /* msg */ ) const {
46  pers->m_AllTheData.push_back((float)trans->exCaloVec().size());
47  std::copy(trans->exCaloVec().begin(), trans->exCaloVec().end(), std::back_inserter(pers->m_AllTheData) );
48  std::copy(trans->eyCaloVec().begin(),trans->eyCaloVec().end(), std::back_inserter(pers->m_AllTheData) );
49  std::copy(trans->etSumCaloVec().begin(),trans->etSumCaloVec().end(), std::back_inserter(pers->m_AllTheData) );
50  union conv{ unsigned int i; float f; } c;
51  for(unsigned int w=0;w<trans->exCaloVec().size();++w){
52  c.i=trans->ncellCalo(static_cast<MissingEtCalo::CaloIndex>(w));
53  pers->m_AllTheData.push_back(c.f);
54  }
55  metCnv.transToPers( trans, pers->m_AllTheData );
56 
57 // std::cout<<"WRITING MissingEtCalo"<<std::endl;
58 // std::cout<<"WRITING: "<<trans->m_exCalo.size()<<"\t"<<trans->m_exCalo[0]<<"\t"<<trans->m_eyCalo[6]<<"\t"<<trans->m_etSumCalo[3]<<"\t"<<trans->m_nCellsCalo[6]<<std::endl;
59  return;
60 }
MissingET.h
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
MissingEtCalo::CaloIndex
CaloIndex
Definition: MissingEtCalo.h:40
MissingEtCaloCnv_p2::transToPers
virtual void transToPers(const MissingEtCalo *transObj, MissingEtCalo_p2 *persObj, MsgStream &msg) const override
Definition: MissingEtCaloCnv_p2.cxx:45
MissingETCnv_p2
Definition: MissingETCnv_p2.h:24
MissingEtCalo::setNCellCalo
void setNCellCalo(CaloIndex aCalo, unsigned int theNCell)
Definition: MissingEtCalo.cxx:174
MissingEtCalo
Definition: MissingEtCalo.h:27
MissingEtCalo::exCaloVec
const std::vector< double > & exCaloVec() const
Definition: MissingEtCalo.cxx:246
MissingEtCalo::ncellCalo
unsigned int ncellCalo(CaloIndex aCalo) const
Definition: MissingEtCalo.cxx:233
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
MissingEtCalo::setEyCaloVec
void setEyCaloVec(std::vector< double > &&exCaloVec)
Definition: MissingEtCalo.cxx:195
lumiFormat.i
int i
Definition: lumiFormat.py:85
MissingEtCaloCnv_p2::persToTrans
virtual void persToTrans(const MissingEtCalo_p2 *persObj, MissingEtCalo *transObj, MsgStream &msg) const override
Definition: MissingEtCaloCnv_p2.cxx:25
T_AthenaPoolTPConverter.h
MissingETCnv_p2::transToPers
virtual void transToPers(const MissingET *transObj, MissingET_p2 *persObj, MsgStream &msg) const override
Definition: MissingETCnv_p2.cxx:38
MissingEtCalo::eyCaloVec
const std::vector< double > & eyCaloVec() const
Definition: MissingEtCalo.cxx:253
MissingEtCalo.h
hist_file_dump.f
f
Definition: hist_file_dump.py:135
MissingEtCalo_p2::m_AllTheData
std::vector< float > m_AllTheData
Definition: MissingEtCalo_p2.h:35
MissingEtCalo::setEtSumCaloVec
void setEtSumCaloVec(std::vector< double > &&etSumCaloVec)
Definition: MissingEtCalo.cxx:202
MissingEtCalo_p2
Definition: MissingEtCalo_p2.h:21
MissingEtCalo::etSumCaloVec
const std::vector< double > & etSumCaloVec() const
Definition: MissingEtCalo.cxx:260
MissingETCnv_p2.h
calibdata.copy
bool copy
Definition: calibdata.py:27
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
MissingETCnv_p2::persToTrans
virtual void persToTrans(const MissingET_p2 *persObj, MissingET *transObj, MsgStream &msg) const override
Definition: MissingETCnv_p2.cxx:32
MissingEtCaloCnv_p2.h
MissingEtCalo::setExCaloVec
void setExCaloVec(std::vector< double > &&exCaloVec)
Definition: MissingEtCalo.cxx:188
python.compressB64.c
def c
Definition: compressB64.py:93
pdg_comparison.conv
conv
Definition: pdg_comparison.py:321