ATLAS Offline Software
Loading...
Searching...
No Matches
eflowObjectCnv_p3.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_p3::persToTrans( const eflowObject_p3 *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 transObj->setCaloRecoStatus (CaloRecoStatus(persObj->m_recoStatus));
22
23 transObj->set_eta(persObj->m_eta);
24 transObj->set_phi(persObj->m_phi);
25 transObj->set_energy(persObj->m_e);
26 transObj->set_m(persObj->m_m);
27
28 //element links data
29
31 m_elMuCnv.persToTrans(&persObj->m_muonElementLink, &muonElementLink, eflowStream);
32 transObj->addMuon (muonElementLink);
33
34 ElementLink<VxContainer> convElementLink;
35 m_elVxCnv.persToTrans(&persObj->m_convElementLink, &convElementLink, eflowStream);
36 transObj->addConversion (convElementLink);
37
38 //navigable vectors data
39 //convert persistent elementlinkvector to transient first and then copy links to navigable vectors
40
42 m_navTrackCnv.persToTrans(&persObj->m_eflowTrack,&dummyTrackVector,eflowStream);
43 for (const ElementLink<Rec::TrackParticleContainer> track : dummyTrackVector)
44 transObj->addTrack(track);
45
47 m_navClusCnv.persToTrans(&persObj->m_eflowClus,&dummyClusterVector,eflowStream);
48 for (const ElementLink<CaloClusterContainer> clus : dummyClusterVector)
49 transObj->addClus (clus);
50}
51
52
53void eflowObjectCnv_p3::transToPers( const eflowObject *transObj,eflowObject_p3 *persObj, MsgStream &eflowStream ){
54
55 //data
56
57 persObj->m_d0 = transObj->d0();
58 persObj->m_z0 = transObj->z0();
59 persObj->m_eflowType = transObj->eflowType();
60 persObj->m_charge = transObj->charge();
61 persObj->m_valid = transObj->isValid();
62 //persObj->m_nTrack = transObj->m_nTrack;
63 //persObj->m_nClus = transObj->m_nClus;
64 persObj->m_recoStatus = transObj->getCaloRecoStatus().getStatusWord();
65
66 persObj->m_eta = transObj->eta();
67 persObj->m_phi = transObj->phi();
68 persObj->m_e = transObj->energy();
69 persObj->m_m = transObj->m();
70
71 //element links data
72
73
74 m_elMuCnv.transToPers(&transObj->muonLink(), &persObj->m_muonElementLink, eflowStream);
75 m_elVxCnv.transToPers(&transObj->conversionLink(), &persObj->m_convElementLink, eflowStream);
76
77 //navigable vectors
78 //there are no converters so we have to make an ElementLinkVector first for which converters exist
79
81 for (int i = 0; i < transObj->numTrack();i++)
82 dummyTrackVector.push_back(transObj->trackLink(i));
83 m_navTrackCnv.transToPers(&dummyTrackVector, &persObj->m_eflowTrack, eflowStream);
84
86 for (int i = 0; i < transObj->numClus(); i++)
87 dummyClusterVector.push_back(transObj->clusLink(i));
88 m_navClusCnv.transToPers(&dummyClusterVector, &persObj->m_eflowClus, eflowStream);
89}
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
ElementLinkCnv_p1< ElementLink< VxContainer > > m_elVxCnv
ElementLinkVectorCnv_p1< ElementLinkVector< CaloClusterContainer > > m_navClusCnv
friend class eflowObject
ElementLinkVectorCnv_p1< ElementLinkVector< Rec::TrackParticleContainer > > m_navTrackCnv
ElementLinkCnv_p1< ElementLink< Analysis::MuonContainer > > m_elMuCnv
friend class eflowObject_p3
virtual void persToTrans(const eflowObject_p3 *persObj, eflowObject *transObj, MsgStream &eflowStream)
virtual void transToPers(const eflowObject *transObj, eflowObject_p3 *persObj, MsgStream &eflowStream)
ElementLinkIntVector_p1 m_eflowClus
unsigned int m_recoStatus
ElementLinkInt_p1 m_convElementLink
ElementLinkIntVector_p1 m_eflowTrack
ElementLinkInt_p1 m_muonElementLink
void set_eta(double ceta)
void setCaloRecoStatus(CaloRecoStatus status)
const ElementLink< Rec::TrackParticleContainer > trackLink(size_t i) const
void addMuon(const ElementLink< Analysis::MuonContainer > &muonElementLink)
int numClus() const
int numTrack() const
const ElementLink< CaloClusterContainer > clusLink(size_t i) const
double d0() 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 addConversion(const ElementLink< VxContainer > &convElementLink)
void set_type(int ctype)
const ElementLink< Analysis::MuonContainer > & muonLink() const
const ElementLink< VxContainer > & conversionLink() const
void set_z0(double cz0)
void set_d0(double cd0)
void addClus(const ElementLink< CaloClusterContainer > &clusElementLink)
double z0() const
void set_m(double cm)
int charge() const
void set_energy(double cenergy)
bool isValid() const
void set_valid(bool flag=true)