ATLAS Offline Software
Loading...
Searching...
No Matches
eflowObjectCnv_p4.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
9void eflowObjectCnv_p4::persToTrans( const eflowObject_p4 *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
18 transObj->set_eta(persObj->m_eta);
19 transObj->set_phi(persObj->m_phi);
20 transObj->set_energy(persObj->m_e);
21 transObj->set_m(persObj->m_m);
22
23 //element links data
24
25 //m_elMuCnv.persToTrans(&persObj->m_muonElementLink, &transObj->m_muonElementLink, eflowStream);
26 //m_elVxCnv.persToTrans(&persObj->m_convElementLink, &transObj->m_convElementLink, eflowStream);
27
28 //navigable vectors data
29 //convert persistent elementlinkvector to transient first and then copy links to navigable vectors
30
32 m_navTrackCnv.persToTrans(&persObj->m_eflowTrack,&dummyTrackVector,eflowStream);
33 for (const ElementLink<Rec::TrackParticleContainer> track : dummyTrackVector)
34 transObj->addTrack(track);
35
37 m_navClusCnv.persToTrans(&persObj->m_eflowClus,&dummyClusterVector,eflowStream);
38 for (const ElementLink<CaloClusterContainer> clus : dummyClusterVector)
39 transObj->addClus (clus);
40}
41
42
43void eflowObjectCnv_p4::transToPers( const eflowObject *transObj,eflowObject_p4 *persObj, MsgStream &eflowStream ){
44
45 //data
46
47 persObj->m_eflowType = transObj->eflowType();
48 persObj->m_charge = transObj->charge();
49 persObj->m_recoStatus = transObj->getCaloRecoStatus().getStatusWord();
50
51 persObj->m_eta = transObj->eta();
52 persObj->m_phi = transObj->phi();
53 persObj->m_e = transObj->energy();
54 persObj->m_m = transObj->m();
55
56 //element links data
57
58
59 //if (transObj->m_muonElementLink.isValid()) m_elMuCnv.transToPers(&transObj->m_muonElementLink, &persObj->m_muonElementLink, eflowStream);
60 //if (transObj->m_convElementLink.isValid()) m_elVxCnv.transToPers(&transObj->m_convElementLink, &persObj->m_convElementLink, eflowStream);
61
62 //navigable vectors
63 //there are no converters so we have to make an ElementLinkVector first for which converters exist
64
66 for (int i = 0; i < transObj->numTrack();i++)
67 dummyTrackVector.push_back(transObj->trackLink(i));
68 m_navTrackCnv.transToPers(&dummyTrackVector, &persObj->m_eflowTrack, eflowStream);
69
71 for (int i = 0; i < transObj->numClus(); i++)
72 dummyClusterVector.push_back(transObj->clusLink(i));
73 m_navClusCnv.transToPers(&dummyClusterVector, &persObj->m_eflowClus, eflowStream);
74}
reconstruction status indicator
virtual const store_type & getStatusWord() const
retrieve the entire status word
ElementLinkVector implementation for standalone ROOT.
void push_back(const ElemLink &link)
virtual double phi() const
get phi data member
Definition P4EEtaPhiM.h:108
virtual double eta() const
get eta data member
Definition P4EEtaPhiM.h:105
virtual double m() const
get mass data member
Definition P4EEtaPhiM.h:111
friend class eflowObject
ElementLinkVectorCnv_p1< ElementLinkVector< CaloClusterContainer > > m_navClusCnv
virtual void transToPers(const eflowObject *transObj, eflowObject_p4 *persObj, MsgStream &eflowStream)
friend class eflowObject_p4
ElementLinkVectorCnv_p1< ElementLinkVector< Rec::TrackParticleContainer > > m_navTrackCnv
virtual void persToTrans(const eflowObject_p4 *persObj, eflowObject *transObj, MsgStream &eflowStream)
ElementLinkIntVector_p1 m_eflowClus
unsigned int m_recoStatus
ElementLinkIntVector_p1 m_eflowTrack
void set_eta(double ceta)
void setCaloRecoStatus(CaloRecoStatus status)
const ElementLink< Rec::TrackParticleContainer > trackLink(size_t i) const
int numClus() const
int numTrack() const
const ElementLink< CaloClusterContainer > clusLink(size_t i) const
void set_phi(double cphi)
void set_charge(int ccharge)
CaloRecoStatus getCaloRecoStatus() const
int eflowType() const
void addTrack(const ElementLink< Rec::TrackParticleContainer > &trackElementLink)
double energy() const
void set_type(int ctype)
void addClus(const ElementLink< CaloClusterContainer > &clusElementLink)
void set_m(double cm)
int charge() const
void set_energy(double cenergy)