ATLAS Offline Software
MSVVtxInfoCnv_p1.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>
14 using std::transform;
15 using std::back_inserter;
16 
17 namespace Analysis {
18 
19 
24  MSVVtxInfo_p1 *persObj,
25  MsgStream &msg)
26  {
27 
28  persObj->m_masssvx = transObj->getMass();
29  persObj->m_efracsvx = transObj->getEnergyFraction();
30  persObj->m_normdist = transObj->getNormDist();
31 
33  &transObj->getRecSvx(),
34  msg);
35 
42 
44  size_t sz = transObj->numTrackInfo();
45  for (size_t i = 0; i < sz; i++)
46  movedVector.push_back (transObj->getTrackInfo(i).trackLink());
47 
48  m_trackVecCnv.transToPers (&movedVector, &persObj->m_trackinfo, msg);
49  }
50 
55  MSVVtxInfo *transObj,
56  MsgStream &msg)
57  {
58  // Clear contained vector.
59  *transObj = MSVVtxInfo();
60 
61  transObj->setMass (persObj->m_masssvx);
62  transObj->setEnergyFraction (persObj->m_efracsvx);
63  transObj->setNormDist (persObj->m_normdist);
64 
65  Trk::RecVertex svx;
67  persObj->m_recsvx,
68  &svx,
69  msg);
70  transObj->setRecSvx (std::move (svx));
71 
79 
81  m_trackVecCnv.persToTrans(&persObj->m_trackinfo, &movedVector, msg);
82  size_t sz = movedVector.size();
83  for (size_t i = 0; i < sz; i++)
84  transObj->addTrackInfo (SVTrackInfo (movedVector[i]));
85  }
86 
87 }
Analysis::MSVVtxInfo::setEnergyFraction
void setEnergyFraction(float)
Definition: MSVVtxInfo.h:59
Analysis::MSVVtxInfo::getNormDist
float getNormDist() const
Definition: MSVVtxInfo.h:69
fitman.sz
sz
Definition: fitman.py:527
Analysis::MSVVtxInfo::getRecSvx
const Trk::RecVertex & getRecSvx() const
Get methods.
Definition: MSVVtxInfo.h:63
Analysis::MSVVtxInfo::setRecSvx
void setRecSvx(const Trk::RecVertex &)
Set methods.
Definition: MSVVtxInfo.h:54
Analysis::SVTrackInfo
Definition: SVTrackInfo.h:17
MSVVtxInfo.h
Analysis::MSVVtxInfo_p1::m_efracsvx
float m_efracsvx
Definition: MSVVtxInfo_p1.h:27
Analysis::MSVVtxInfo::getTrackInfo
const SVTrackInfo & getTrackInfo(unsigned int i) const
Definition: MSVVtxInfo.h:71
Analysis::MSVVtxInfo_p1
Definition: MSVVtxInfo_p1.h:17
ElementLinkVectorCnv_p1::persToTrans
void persToTrans(const PersLinkVect_t &pers, LinkVect_t &trans, MsgStream &log) const
Analysis::MSVVtxInfo::numTrackInfo
int numTrackInfo() const
Definition: MSVVtxInfo.h:70
ElementLinkVector::push_back
void push_back(const ElemLink &link)
Definition: AthLinks/ElementLinkVector.h:316
ITPConverterFor::fillTransFromPStore
void fillTransFromPStore(CNV **cnv, const TPObjRef &ref, TRANS_T *trans, MsgStream &log) const
Convert persistent object, stored in the the top-level persistent object and referenced by the TP Ref...
Definition: TPConverter.h:145
Trk::RecVertex
Trk::RecVertex inherits from Trk::Vertex.
Definition: RecVertex.h:44
lumiFormat.i
int i
Definition: lumiFormat.py:85
Analysis::MSVVtxInfo_p1::m_normdist
float m_normdist
Definition: MSVVtxInfo_p1.h:28
Analysis::MSVVtxInfo::getMass
float getMass() const
Definition: MSVVtxInfo.h:64
Analysis::MSVVtxInfo::setNormDist
void setNormDist(float)
Definition: MSVVtxInfo.h:60
Analysis::MSVVtxInfoCnv_p1::m_recoVertexCnv
ITPConverterFor< Trk::Vertex > * m_recoVertexCnv
Definition: MSVVtxInfoCnv_p1.h:36
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
MSVVtxInfoCnv_p1.h
Analysis::MSVVtxInfo::addTrackInfo
void addTrackInfo(const SVTrackInfo &i)
Definition: MSVVtxInfo.h:61
Analysis::MSVVtxInfo_p1::m_masssvx
float m_masssvx
Definition: MSVVtxInfo_p1.h:26
Analysis::MSVVtxInfo::getEnergyFraction
float getEnergyFraction() const
Definition: MSVVtxInfo.h:68
ITPConverterFor::toPersistent
TPObjRef toPersistent(CNV **cnv, const typename CNV::TransBase_t *transObj, MsgStream &log) const
Persistify an object and store the persistent represenation in the storage vector of the top-level pe...
Definition: TPConverter.h:119
ElementLinkVector< Rec::TrackParticleContainer >
Analysis::SVTrackInfo::trackLink
const ElementLink< Rec::TrackParticleContainer > & trackLink() const
Definition: SVTrackInfo.h:52
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::MSVVtxInfo::setMass
void setMass(float)
Definition: MSVVtxInfo.h:55
Analysis::MSVVtxInfo_p1::m_trackinfo
ElementLinkIntVector_p1 m_trackinfo
Definition: MSVVtxInfo_p1.h:31
ElementLinkVector::size
size_type size() const
Definition: AthLinks/ElementLinkVector.h:292
Analysis::MSVVtxInfo
Definition: MSVVtxInfo.h:17
Analysis::MSVVtxInfo_p1::m_recsvx
TPObjRef m_recsvx
All of this data will be written out.
Definition: MSVVtxInfo_p1.h:24
ElementLinkVectorCnv_p1::transToPers
void transToPers(const LinkVect_t &trans, PersLinkVect_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
Analysis::MSVVtxInfoCnv_p1::m_trackVecCnv
ElementLinkVectorCnv_p1< ElementLinkVector< Rec::TrackParticleContainer > > m_trackVecCnv
Definition: MSVVtxInfoCnv_p1.h:37
SVTrackInfo.h
Analysis::MSVVtxInfoCnv_p1::persToTrans
virtual void persToTrans(const MSVVtxInfo_p1 *persObj, MSVVtxInfo *transObj, MsgStream &log)
Load from disk format to in-memory format.
Definition: MSVVtxInfoCnv_p1.cxx:54
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Analysis::MSVVtxInfoCnv_p1::transToPers
virtual void transToPers(const MSVVtxInfo *transObj, MSVVtxInfo_p1 *persObj, MsgStream &log)
Given a transient rep, save it to a persistent one.
Definition: MSVVtxInfoCnv_p1.cxx:23