ATLAS Offline Software
eflowObjectCnv_p2.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_p2::persToTrans( const eflowObject_p2 *persObj, eflowObject *transObj, MsgStream &eflowStream ){
10 
11 
12  //data
13 
14  transObj->set_d0 (persObj->m_d0);
15  transObj->set_z0 (persObj->m_z0);
16  transObj->set_type (persObj->m_eflowType);
17  transObj->set_charge (persObj->m_charge);
18  transObj->set_valid (persObj->m_valid);
19  //transObj->m_nTrack = persObj->m_nTrack;
20  //transObj->m_nClus = persObj->m_nClus;
21 
22  transObj->set_eta(persObj->m_eta);
23  transObj->set_phi(persObj->m_phi);
24  transObj->set_energy(persObj->m_e);
25  transObj->set_m(persObj->m_m);
26 
27  //element links data
28 
30  m_elMuCnv.persToTrans(&persObj->m_muonElementLink, &muonElementLink, eflowStream);
31  transObj->addMuon (muonElementLink);
32 
33  ElementLink<VxContainer> convElementLink;
34  m_elVxCnv.persToTrans(&persObj->m_convElementLink, &convElementLink, eflowStream);
35  transObj->addConversion (convElementLink);
36 
37  //navigable vectors data
38  //convert persistent elementlinkvector to transient first and then copy links to navigable vectors
39 
41  m_navTrackCnv.persToTrans(&persObj->m_eflowTrack,&dummyTrackVector,eflowStream);
42  for (const ElementLink<Rec::TrackParticleContainer> track : dummyTrackVector)
43  transObj->addTrack(track);
44 
45  ElementLinkVector<CaloClusterContainer> dummyClusterVector;
46  m_navClusCnv.persToTrans(&persObj->m_eflowClus,&dummyClusterVector,eflowStream);
47  for (const ElementLink<CaloClusterContainer> clus : dummyClusterVector)
48  transObj->addClus (clus);
49 }
50 
51 
52 void eflowObjectCnv_p2::transToPers( const eflowObject *transObj,eflowObject_p2 *persObj, MsgStream &eflowStream ){
53 
54  //data
55 
56  persObj->m_d0 = transObj->d0();
57  persObj->m_z0 = transObj->z0();
58  persObj->m_eflowType = transObj->eflowType();
59  persObj->m_charge = transObj->charge();
60  persObj->m_valid = transObj->isValid();
61  //persObj->m_nTrack = transObj->m_nTrack;
62  //persObj->m_nClus = transObj->m_nClus;
63 
64  persObj->m_eta = transObj->eta();
65  persObj->m_phi = transObj->phi();
66  persObj->m_e = transObj->energy();
67  persObj->m_m = transObj->m();
68 
69  //element links data
70 
71 
72  m_elMuCnv.transToPers(&transObj->muonLink(), &persObj->m_muonElementLink, eflowStream);
73  m_elVxCnv.transToPers(&transObj->conversionLink(), &persObj->m_convElementLink, eflowStream);
74 
75  //navigable vectors
76  //there are no converters so we have to make an ElementLinkVector first for which converters exist
77 
79  for (int i = 0; i < transObj->numTrack();i++)
80  dummyTrackVector.push_back(transObj->trackLink(i));
81  m_navTrackCnv.transToPers(&dummyTrackVector, &persObj->m_eflowTrack, eflowStream);
82 
83  ElementLinkVector<CaloClusterContainer> dummyClusterVector;
84  for (int i = 0; i < transObj->numClus(); i++)
85  dummyClusterVector.push_back(transObj->clusLink(i));
86  m_navClusCnv.transToPers(&dummyClusterVector, &persObj->m_eflowClus, eflowStream);
87 }
eflowObject::energy
double energy() const
Definition: eflowObject.h:146
eflowObject_p2::m_valid
bool m_valid
Definition: eflowObject_p2.h:62
eflowObject::set_z0
void set_z0(double cz0)
Definition: eflowObject.h:144
eflowObjectCnv_p2::persToTrans
virtual void persToTrans(const eflowObject_p2 *persObj, eflowObject *transObj, MsgStream &eflowStream)
Definition: eflowObjectCnv_p2.cxx:9
eflowObjectCnv_p2::m_elVxCnv
ElementLinkCnv_p1< ElementLink< VxContainer > > m_elVxCnv
Definition: eflowObjectCnv_p2.h:42
eflowObjectCnv_p2::m_elMuCnv
ElementLinkCnv_p1< ElementLink< Analysis::MuonContainer > > m_elMuCnv
Definition: eflowObjectCnv_p2.h:41
eflowObject_p2
Definition: eflowObject_p2.h:27
eflowObject_p2::m_charge
int m_charge
Definition: eflowObject_p2.h:59
eflowObject::set_phi
void set_phi(double cphi)
Definition: eflowObject.h:138
eflowObject::set_d0
void set_d0(double cd0)
Definition: eflowObject.h:141
eflowObject::d0
double d0() const
Definition: eflowObject.h:140
eflowObject_p2::m_eflowClus
ElementLinkIntVector_p1 m_eflowClus
Definition: eflowObject_p2.h:52
eflowObject_p2::m_eflowType
int m_eflowType
Definition: eflowObject_p2.h:59
eflowObject::z0
double z0() const
Definition: eflowObject.h:143
eflowObject::conversionLink
const ElementLink< VxContainer > & conversionLink() const
Definition: eflowObject.cxx:367
eflowObject::addConversion
void addConversion(const ElementLink< VxContainer > &convElementLink)
Definition: eflowObject.h:130
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
eflowObjectCnv_p2.h
eflowObject::eflowType
int eflowType() const
Definition: eflowObject.h:151
eflowObject_p2::m_d0
double m_d0
Definition: eflowObject_p2.h:57
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
ElementLinkVector::push_back
void push_back(const ElemLink &link)
Definition: AthLinks/ElementLinkVector.h:316
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
lumiFormat.i
int i
Definition: lumiFormat.py:92
ElementLinkCnv_p1::transToPers
void transToPers(const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
P4EEtaPhiM::m
virtual double m() const
get mass data member
Definition: P4EEtaPhiM.h:111
eflowObject_p2::m_convElementLink
ElementLinkInt_p1 m_convElementLink
Definition: eflowObject_p2.h:65
eflowObject::set_type
void set_type(int ctype)
Definition: eflowObject.h:152
eflowObject_p2::m_e
double m_e
Definition: eflowObject_p2.h:68
eflowObject::addTrack
void addTrack(const ElementLink< Rec::TrackParticleContainer > &trackElementLink)
Definition: eflowObject.cxx:130
eflowObjectCnv_p2::m_navClusCnv
ElementLinkVectorCnv_p1< ElementLinkVector< CaloClusterContainer > > m_navClusCnv
Definition: eflowObjectCnv_p2.h:44
eflowObject_p2::m_muonElementLink
ElementLinkInt_p1 m_muonElementLink
Definition: eflowObject_p2.h:64
ElementLinkVector< Rec::TrackParticleContainer >
eflowObject::set_charge
void set_charge(int ccharge)
Definition: eflowObject.h:155
P4EEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4EEtaPhiM.h:108
ElementLinkCnv_p1::persToTrans
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log) const
eflowObject::numClus
int numClus() const
Definition: eflowObject.h:122
eflowObject_p2::m_m
double m_m
Definition: eflowObject_p2.h:68
eflowObject::set_m
void set_m(double cm)
Definition: eflowObject.h:149
eflowObject_p2::m_phi
double m_phi
Definition: eflowObject_p2.h:68
eflowObject.h
eflowObject_p2::m_eflowTrack
ElementLinkIntVector_p1 m_eflowTrack
Definition: eflowObject_p2.h:55
NavigableVector.h
eflowObject::muonLink
const ElementLink< Analysis::MuonContainer > & muonLink() const
Definition: eflowObject.cxx:365
eflowObject::charge
int charge() const
Definition: eflowObject.h:154
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
eflowObjectCnv_p2::transToPers
virtual void transToPers(const eflowObject *transObj, eflowObject_p2 *persObj, MsgStream &eflowStream)
Definition: eflowObjectCnv_p2.cxx:52
eflowObjectCnv_p2::m_navTrackCnv
ElementLinkVectorCnv_p1< ElementLinkVector< Rec::TrackParticleContainer > > m_navTrackCnv
Definition: eflowObjectCnv_p2.h:43
eflowObject::isValid
bool isValid() const
Definition: eflowObject.h:157
eflowObject::numTrack
int numTrack() const
Definition: eflowObject.h:121
eflowObject_p2::m_z0
double m_z0
Definition: eflowObject_p2.h:57
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
eflowObject::set_valid
void set_valid(bool flag=true)
Definition: eflowObject.h:159
eflowObject_p2::m_eta
double m_eta
Definition: eflowObject_p2.h:68
eflowObject::addMuon
void addMuon(const ElementLink< Analysis::MuonContainer > &muonElementLink)
Definition: eflowObject.h:126