ATLAS Offline Software
MissingEtCaloCnv_p1.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: MissingEtCaloCnv_p1.cxx
8 PACKAGE: offline/Reconstruction/RecTPCnv
9 
10 AUTHORS: S. Resconi
11 CREATED: Jul 2007
12 
13 PURPOSE: Transient/Persistent converter for MissingEtCalo class
14 ********************************************************************/
15 
16 
17 // STL includes
18 
19 // AthenaPoolCnvSvc includes
21 
22 // MissingETEvent includes
25 
26 // RecTPCnv includes
29 
30 // MissingET converter
31 static const MissingETCnv_p1 metCnv;
32 
33 
35  MissingEtCalo* trans,
36  MsgStream& msg ) const
37 {
38 // msg << MSG::DEBUG << "Loading MissingEtCalo from persistent state..." << endmsg;
39 
40  trans->setExCaloVec (std::vector<double> (pers->m_exCalo));
41  trans->setEyCaloVec (std::vector<double> (pers->m_eyCalo));
42  trans->setEtSumCaloVec (std::vector<double> (pers->m_etSumCalo));
43  trans->setNCellCaloVec (std::vector<unsigned int> (pers->m_nCellsCalo));
44 
45  {
46  // use the MissingET converter to convert from pers to trans
47  metCnv.persToTrans(&pers->m_met, trans, msg);
48  }
49 
50  // for (unsigned int vi=0;vi<trans->m_exCalo.size();++vi)
51  // std::cout<<"IN EtCalo ex: "<<trans->m_exCalo[vi]<<"\tey: "<<trans->m_eyCalo[vi]<<"\tet: "<<trans->m_etSumCalo[vi]<<"\tnCells: "<<trans->m_nCellsCalo[vi]<<std::endl;
52 
53  return;
54 }
55 
57  MissingEtCalo_p1* pers,
58  MsgStream& msg ) const
59 {
60 // msg << MSG::DEBUG << "Creating persistent state of MissingEtCalo..." << endmsg;
61 
62  pers->m_exCalo = trans->exCaloVec();
63  pers->m_eyCalo = trans->eyCaloVec();
64  pers->m_etSumCalo = trans->etSumCaloVec();
65  pers->m_nCellsCalo = trans->ncellCaloVec();
66 
67  if( trans->getSource() >= 0 && trans->getSource() < 1000 ) {
68 
69  // use the MissingET converter to convert from trans to pers
70  MissingET_p1 theMet;
71  metCnv.transToPers( trans, &theMet, msg );
72  pers->m_met = theMet;
73 
74  }
75 
76  // for (unsigned int vi=0;vi<trans->m_exCalo.size();++vi)
77  // std::cout<<"OUT EtCalo ex: "<<trans->m_exCalo[vi]<<"\tey: "<<trans->m_eyCalo[vi]<<"\tet: "<<trans->m_etSumCalo[vi]<<"\tnCells: "<<trans->m_nCellsCalo[vi]<<std::endl;
78 
79  return;
80 }
MissingEtCaloCnv_p1.h
MissingEtCalo_p1::m_met
MissingET_p1 m_met
Definition: MissingEtCalo_p1.h:40
MissingET.h
MissingEtCalo_p1::m_exCalo
std::vector< double > m_exCalo
basic components of MissingEtCalo_p1
Definition: MissingEtCalo_p1.h:43
MissingEtCalo::setNCellCaloVec
void setNCellCaloVec(std::vector< unsigned int > &&ncellCaloVec)
Definition: MissingEtCalo.cxx:209
MissingET_p1
Definition: MissingET_p1.h:27
MissingEtCaloCnv_p1::transToPers
virtual void transToPers(const MissingEtCalo *transObj, MissingEtCalo_p1 *persObj, MsgStream &msg) const override
Definition: MissingEtCaloCnv_p1.cxx:56
MissingEtCalo
Definition: MissingEtCalo.h:27
MissingEtCalo::ncellCaloVec
const std::vector< unsigned int > & ncellCaloVec() const
Definition: MissingEtCalo.cxx:267
MissingEtCaloCnv_p1::persToTrans
virtual void persToTrans(const MissingEtCalo_p1 *persObj, MissingEtCalo *transObj, MsgStream &msg) const override
Definition: MissingEtCaloCnv_p1.cxx:34
MissingEtCalo::exCaloVec
const std::vector< double > & exCaloVec() const
Definition: MissingEtCalo.cxx:246
MissingEtCalo_p1::m_nCellsCalo
std::vector< unsigned int > m_nCellsCalo
Definition: MissingEtCalo_p1.h:46
MissingET::getSource
virtual Source getSource() const
Definition: MissingET.cxx:171
MissingEtCalo::setEyCaloVec
void setEyCaloVec(std::vector< double > &&exCaloVec)
Definition: MissingEtCalo.cxx:195
T_AthenaPoolTPConverter.h
MissingEtCalo::eyCaloVec
const std::vector< double > & eyCaloVec() const
Definition: MissingEtCalo.cxx:253
MissingEtCalo.h
MissingETCnv_p1.h
MissingEtCalo::setEtSumCaloVec
void setEtSumCaloVec(std::vector< double > &&etSumCaloVec)
Definition: MissingEtCalo.cxx:202
MissingEtCalo_p1::m_eyCalo
std::vector< double > m_eyCalo
Definition: MissingEtCalo_p1.h:44
MissingEtCalo::etSumCaloVec
const std::vector< double > & etSumCaloVec() const
Definition: MissingEtCalo.cxx:260
MissingETCnv_p1::transToPers
virtual void transToPers(const MissingET *transObj, MissingET_p1 *persObj, MsgStream &msg) const override
Definition: MissingETCnv_p1.cxx:54
MissingEtCalo_p1
Definition: MissingEtCalo_p1.h:26
MissingEtCalo_p1::m_etSumCalo
std::vector< double > m_etSumCalo
Definition: MissingEtCalo_p1.h:45
MissingEtCalo::setExCaloVec
void setExCaloVec(std::vector< double > &&exCaloVec)
Definition: MissingEtCalo.cxx:188
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
MissingETCnv_p1
Definition: MissingETCnv_p1.h:26
MissingETCnv_p1::persToTrans
virtual void persToTrans(const MissingET_p1 *persObj, MissingET *transObj, MsgStream &msg) const override
Definition: MissingETCnv_p1.cxx:31