ATLAS Offline Software
VxCandidateCnv_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 //
7 // file: VxCandidate_p1.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
11 #include "VxVertex/VxCandidate.h"
14 #include <iostream>
15 void VxCandidateCnv_p1::persToTrans(const Trk::VxCandidate_p1 * persObj, Trk::VxCandidate * transObj, MsgStream &log) {
16 
17  Trk::RecVertex vx;
19  std::vector<Trk::VxTrackAtVertex*> trackAtVertex;
20  m_vxTrkAtVrtCnv.persToTrans(&persObj->m_vxTrackAtVertex, &trackAtVertex, log);
21 
22  *transObj = Trk::VxCandidate (std::move(vx),
23  std::move (trackAtVertex));
24  transObj->setVertexType (static_cast<Trk::VertexType>(persObj->m_vertexType));
25 }
26 
27 void VxCandidateCnv_p1::transToPers(const Trk::VxCandidate * transObj, Trk::VxCandidate_p1 * persObj, MsgStream &log)
28 {
29  persObj->m_recVertex = toPersistent( &m_recVertexConverter, &(transObj->recVertex()), log );
30 
31  // get rid of the refitted perigees in case of primary and pileup vertex
32 
33  const std::vector<Trk::VxTrackAtVertex*>& trackAtVertex = *transObj->vxTrackAtVertex();
34  if (transObj->vertexType() == Trk::PriVtx || transObj->vertexType() == Trk::PileUp)
35  {
36  for (Trk::VxTrackAtVertex* t : trackAtVertex) {
37  t->setPerigeeAtVertex (static_cast<Trk::TrackParameters*>(nullptr));
38  }
39  }
40  m_vxTrkAtVrtCnv.transToPers( &trackAtVertex, &persObj->m_vxTrackAtVertex, log);
41  persObj->m_vertexType = static_cast<int>(transObj->vertexType());
42 }
VxCandidateCnv_p1::persToTrans
void persToTrans(const Trk::VxCandidate_p1 *persObj, Trk::VxCandidate *transObj, MsgStream &log)
Conversion methods.
Definition: VxCandidateCnv_p1.cxx:15
Trk::VxCandidate::recVertex
const Trk::RecVertex & recVertex(void) const
Returns a reference to reconstructed vertex.
Definition: VxCandidate.h:132
Trk::VxTrackAtVertex
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Definition: VxTrackAtVertex.h:77
VxCandidateCnv_p1.h
Trk::VertexType
VertexType
Definition: VertexType.h:25
Trk::VxCandidate::vertexType
VertexType vertexType() const
return the type of the vertex
Definition: VxCandidate.h:120
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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
VxCandidateCnv_p1::m_recVertexConverter
RecVertexCnv_p1 * m_recVertexConverter
Definition: VxCandidateCnv_p1.h:43
Trk::VxCandidate::vxTrackAtVertex
std::vector< Trk::VxTrackAtVertex * > * vxTrackAtVertex(void)
Unconst pointer to the vector of tracks Required by some of the vertex fitters.
Definition: VxCandidate.h:144
VxTrackAtVertex.h
TPPtrVectorCnv::persToTrans
virtual void persToTrans(const PERS *persVect, TRANS *transVect, MsgStream &log)
Converts vector of PERS::value_type objects to vector of TRANS::value_type objects,...
Definition: TPConverter.h:929
TPPolyVectorCnv::transToPers
virtual void transToPers(const TRANS *transVect, PERS *persVect, MsgStream &log)
Converts vector of TRANS::value_type objects to vector of PERS::value_type objects,...
Definition: TPConverter.h:1122
Trk::VxCandidate_p1::m_recVertex
TPObjRef m_recVertex
Definition: VxCandidate_p1.h:29
Trk::ParametersBase
Definition: ParametersBase.h:55
VxCandidate.h
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
Trk::VxCandidate_p1
Definition: VxCandidate_p1.h:23
Trk::VxCandidate
Definition: VxCandidate.h:27
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::PriVtx
@ PriVtx
Primary Vertex.
Definition: VertexType.h:27
VxCandidateCnv_p1::m_vxTrkAtVrtCnv
VxTrkAtVrtVectorCnv_p1 m_vxTrkAtVrtCnv
Definition: VxCandidateCnv_p1.h:50
Trk::VxCandidate_p1::m_vertexType
int m_vertexType
Definition: VxCandidate_p1.h:31
VxCandidateCnv_p1::transToPers
void transToPers(const Trk::VxCandidate *transObj, Trk::VxCandidate_p1 *persObj, MsgStream &log)
Definition: VxCandidateCnv_p1.cxx:27
Trk::VxCandidate_p1::m_vxTrackAtVertex
std::vector< TPObjRef > m_vxTrackAtVertex
Definition: VxCandidate_p1.h:30
Trk::PileUp
@ PileUp
Pile Up Vertex.
Definition: VertexType.h:29
Trk::VxCandidate::setVertexType
void setVertexType(VertexType vertexType)
return the type of the vertex
Definition: VxCandidate.h:114