ATLAS Offline Software
Loading...
Searching...
No Matches
MSVVtxInfoCnv_p2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6
10
11#include "GaudiKernel/MsgStream.h"
12
13#include <algorithm>
14using std::transform;
15using std::back_inserter;
16
17namespace Analysis {
18
19
24 MSVVtxInfo_p2 *persObj,
25 MsgStream &msg)
26 {
27
28 persObj->m_masssvx = transObj->getMass();
29 persObj->m_ptsvx = transObj->getPt();
30 persObj->m_etasvx = transObj->getEta();
31 persObj->m_phisvx = transObj->getPhi();
32 persObj->m_efracsvx = transObj->getEnergyFraction();
33 persObj->m_normdist = transObj->getNormDist();
34
36 &transObj->getRecSvx(),
37 msg);
38
45
47 size_t sz = transObj->numTrackInfo();
48 for (size_t i = 0; i < sz; i++)
49 movedVector.push_back (transObj->getTrackInfo(i).trackLink());
50
51 m_trackVecCnv.transToPers (&movedVector, &persObj->m_trackinfo, msg);
52 }
53
58 MSVVtxInfo *transObj,
59 MsgStream &msg)
60 {
61 // Clear contained vector.
62 *transObj = MSVVtxInfo();
63
64 transObj->setMass (persObj->m_masssvx);
65 transObj->setPt (persObj->m_ptsvx);
66 transObj->setEta (persObj->m_etasvx);
67 transObj->setPhi (persObj->m_phisvx);
68 transObj->setEnergyFraction (persObj->m_efracsvx);
69 transObj->setNormDist (persObj->m_normdist);
70
73 persObj->m_recsvx,
74 &svx,
75 msg);
76 transObj->setRecSvx (std::move (svx));
77
85
87 m_trackVecCnv.persToTrans(&persObj->m_trackinfo, &movedVector, msg);
88 size_t sz = movedVector.size();
89 for (size_t i = 0; i < sz; i++)
90 transObj->addTrackInfo (SVTrackInfo (movedVector[i]));
91 }
92
93}
static Double_t sz
ITPConverterFor< Trk::Vertex > * m_recoVertexCnv
ElementLinkVectorCnv_p1< ElementLinkVector< Rec::TrackParticleContainer > > m_trackVecCnv
virtual void transToPers(const MSVVtxInfo *transObj, MSVVtxInfo_p2 *persObj, MsgStream &log)
Given a transient rep, save it to a persistent one.
virtual void persToTrans(const MSVVtxInfo_p2 *persObj, MSVVtxInfo *transObj, MsgStream &log)
Load from disk format to in-memory format.
TPObjRef m_recsvx
All of this data will be written out.
ElementLinkIntVector_p1 m_trackinfo
void setEta(float)
Definition MSVVtxInfo.h:57
void addTrackInfo(const SVTrackInfo &i)
Definition MSVVtxInfo.h:61
float getNormDist() const
Definition MSVVtxInfo.h:69
void setMass(float)
Definition MSVVtxInfo.h:55
void setRecSvx(const Trk::RecVertex &)
Set methods.
Definition MSVVtxInfo.h:54
const Trk::RecVertex & getRecSvx() const
Get methods.
Definition MSVVtxInfo.h:63
void setPt(float)
Definition MSVVtxInfo.h:56
float getEnergyFraction() const
Definition MSVVtxInfo.h:68
float getEta() const
Definition MSVVtxInfo.h:66
const SVTrackInfo & getTrackInfo(unsigned int i) const
Definition MSVVtxInfo.h:71
int numTrackInfo() const
Definition MSVVtxInfo.h:70
float getMass() const
Definition MSVVtxInfo.h:64
float getPt() const
Definition MSVVtxInfo.h:65
void setEnergyFraction(float)
Definition MSVVtxInfo.h:59
void setNormDist(float)
Definition MSVVtxInfo.h:60
void setPhi(float)
Definition MSVVtxInfo.h:58
float getPhi() const
Definition MSVVtxInfo.h:67
const ElementLink< Rec::TrackParticleContainer > & trackLink() const
Definition SVTrackInfo.h:52
ElementLinkVector implementation for standalone ROOT.
void push_back(const ElemLink &link)
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Trk::RecVertex inherits from Trk::Vertex.
Definition RecVertex.h:44
The namespace of all packages in PhysicsAnalysis/JetTagging.
MsgStream & msg
Definition testRead.cxx:32