ATLAS Offline Software
eflowObjectCnv_p5.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 void eflowObjectCnv_p5::persToTrans( const eflowObject_p5 *persObj, eflowObject *transObj, MsgStream &eflowStream ){
10 
11 
12  //data
13 
14  transObj->set_type (persObj->m_eflowType);
15  transObj->set_charge (persObj->m_charge);
16  transObj->setCaloRecoStatus (CaloRecoStatus(persObj->m_recoStatus));
17  transObj->setPi0MVA (persObj->m_pi0MVA);
18  transObj->setCenterMag (persObj->m_centerMag);
19 
20  transObj->set_eta(persObj->m_eta);
21  transObj->set_phi(persObj->m_phi);
22  transObj->set_energy(persObj->m_e);
23  transObj->set_m(persObj->m_m);
24 
25  //navigable vectors data
26  //convert persistent elementlinkvector to transient first and then copy links to navigable vectors
27 
29  m_navTrackCnv.persToTrans(&persObj->m_eflowTrack,&dummyTrackVector,eflowStream);
30  for (const ElementLink<Rec::TrackParticleContainer> track : dummyTrackVector)
31  transObj->addTrack(track);
32 
33  ElementLinkVector<CaloClusterContainer> dummyClusterVector;
34  m_navClusCnv.persToTrans(&persObj->m_eflowClus,&dummyClusterVector,eflowStream);
35  for (const ElementLink<CaloClusterContainer> clus : dummyClusterVector)
36  transObj->addClus (clus);
37 }
38 
39 
40 void eflowObjectCnv_p5::transToPers( const eflowObject *transObj,eflowObject_p5 *persObj, MsgStream &eflowStream ){
41 
42  //data
43 
44  persObj->m_eflowType = transObj->eflowType();
45  persObj->m_charge = transObj->charge();
46  persObj->m_recoStatus = transObj->getCaloRecoStatus().getStatusWord();
47  persObj->m_pi0MVA = transObj->getPi0MVA();
48  persObj->m_centerMag = transObj->getCenterMag();
49 
50  persObj->m_eta = transObj->eta();
51  persObj->m_phi = transObj->phi();
52  persObj->m_e = transObj->energy();
53  persObj->m_m = transObj->m();
54 
55  //element links data
56 
57 
58  //if (transObj->m_muonElementLink.isValid()) m_elMuCnv.transToPers(&transObj->m_muonElementLink, &persObj->m_muonElementLink, eflowStream);
59  //if (transObj->m_convElementLink.isValid()) m_elVxCnv.transToPers(&transObj->m_convElementLink, &persObj->m_convElementLink, eflowStream);
60 
61  //navigable vectors
62  //there are no converters so we have to make an ElementLinkVector first for which converters exist
63 
65  for (int i = 0; i < transObj->numTrack();i++)
66  dummyTrackVector.push_back(transObj->trackLink(i));
67  m_navTrackCnv.transToPers(&dummyTrackVector, &persObj->m_eflowTrack, eflowStream);
68 
69  ElementLinkVector<CaloClusterContainer> dummyClusterVector;
70  for (int i = 0; i < transObj->numClus(); i++)
71  dummyClusterVector.push_back(transObj->clusLink(i));
72  m_navClusCnv.transToPers(&dummyClusterVector, &persObj->m_eflowClus, eflowStream);
73 }
eflowObject_p5::m_eflowTrack
ElementLinkIntVector_p1 m_eflowTrack
Definition: eflowObject_p5.h:58
eflowObject::energy
double energy() const
Definition: eflowObject.h:146
eflowObject::setCenterMag
void setCenterMag(double centerMag)
Definition: eflowObject.h:187
eflowObject_p5::m_eflowType
int m_eflowType
Definition: eflowObject_p5.h:60
eflowObject::set_phi
void set_phi(double cphi)
Definition: eflowObject.h:138
eflowObjectCnv_p5::m_navTrackCnv
ElementLinkVectorCnv_p1< ElementLinkVector< Rec::TrackParticleContainer > > m_navTrackCnv
Definition: eflowObjectCnv_p5.h:39
eflowObject_p5::m_centerMag
float m_centerMag
Definition: eflowObject_p5.h:68
eflowObject_p5::m_charge
int m_charge
Definition: eflowObject_p5.h:60
eflowObject::getCaloRecoStatus
CaloRecoStatus getCaloRecoStatus() const
Definition: eflowObject.h:185
eflowObject_p5::m_m
float m_m
Definition: eflowObject_p5.h:63
eflowObject::set_eta
void set_eta(double ceta)
Definition: eflowObject.h:136
eflowObject::clusLink
const ElementLink< CaloClusterContainer > clusLink(size_t i) const
Definition: eflowObject.h:113
eflowObject::eflowType
int eflowType() const
Definition: eflowObject.h:151
eflowObject_p5::m_pi0MVA
float m_pi0MVA
Definition: eflowObject_p5.h:66
ElementLinkVector< Rec::TrackParticleContainer >
ElementLinkVectorCnv_p1::persToTrans
void persToTrans(const PersLinkVect_t &pers, LinkVect_t &trans, MsgStream &log) const
eflowObject
Definition: eflowObject.h:60
eflowObject::addClus
void addClus(const ElementLink< CaloClusterContainer > &clusElementLink)
Definition: eflowObject.cxx:115
eflowObjectCnv_p5::m_navClusCnv
ElementLinkVectorCnv_p1< ElementLinkVector< CaloClusterContainer > > m_navClusCnv
Definition: eflowObjectCnv_p5.h:40
P4EEtaPhiM::eta
virtual double eta() const
get eta data member
Definition: P4EEtaPhiM.h:105
eflowObject::set_energy
void set_energy(double cenergy)
Definition: eflowObject.h:147
eflowObjectCnv_p5.h
eflowObject::getPi0MVA
double getPi0MVA() const
Definition: eflowObject.h:161
lumiFormat.i
int i
Definition: lumiFormat.py:85
eflowObject_p5::m_eta
float m_eta
Definition: eflowObject_p5.h:63
P4EEtaPhiM::m
virtual double m() const
get mass data member
Definition: P4EEtaPhiM.h:111
eflowObject::set_type
void set_type(int ctype)
Definition: eflowObject.h:152
eflowObject_p5::m_e
float m_e
Definition: eflowObject_p5.h:63
eflowObject::addTrack
void addTrack(const ElementLink< Rec::TrackParticleContainer > &trackElementLink)
Definition: eflowObject.cxx:130
ElementLinkVector::push_back
void push_back(const ElemLink &link)
Definition: AthLinks/ElementLinkVector.h:318
eflowObjectCnv_p5::transToPers
virtual void transToPers(const eflowObject *transObj, eflowObject_p5 *persObj, MsgStream &eflowStream)
Definition: eflowObjectCnv_p5.cxx:40
eflowObject::set_charge
void set_charge(int ccharge)
Definition: eflowObject.h:155
eflowObject::setCaloRecoStatus
void setCaloRecoStatus(CaloRecoStatus status)
Definition: eflowObject.h:184
P4EEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4EEtaPhiM.h:108
eflowObject::numClus
int numClus() const
Definition: eflowObject.h:122
eflowObject::set_m
void set_m(double cm)
Definition: eflowObject.h:149
eflowObject.h
eflowObject::setPi0MVA
void setPi0MVA(double Pi0MVA)
Definition: eflowObject.h:162
NavigableVector.h
eflowObject::getCenterMag
double getCenterMag() const
Definition: eflowObject.h:188
eflowObject::charge
int charge() const
Definition: eflowObject.h:154
eflowObject_p5::m_phi
float m_phi
Definition: eflowObject_p5.h:63
ElementLinkVectorCnv_p1::transToPers
void transToPers(const LinkVect_t &trans, PersLinkVect_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
eflowObject::trackLink
const ElementLink< Rec::TrackParticleContainer > trackLink(size_t i) const
Definition: eflowObject.h:102
CaloRecoStatus::getStatusWord
virtual const store_type & getStatusWord() const
retrieve the entire status word
Definition: CaloRecoStatus.h:112
eflowObject::numTrack
int numTrack() const
Definition: eflowObject.h:121
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
eflowObject_p5::m_eflowClus
ElementLinkIntVector_p1 m_eflowClus
Definition: eflowObject_p5.h:55
eflowObject_p5
Definition: eflowObject_p5.h:27
CaloRecoStatus
reconstruction status indicator
Definition: CaloRecoStatus.h:12
eflowObjectCnv_p5::persToTrans
virtual void persToTrans(const eflowObject_p5 *persObj, eflowObject *transObj, MsgStream &eflowStream)
Definition: eflowObjectCnv_p5.cxx:9
eflowObject_p5::m_recoStatus
unsigned int m_recoStatus
Definition: eflowObject_p5.h:52