ATLAS Offline Software
VxTrackAtVertexCnv_p2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
10 
11 #include "TrkTrack/LinkToTrack.h"
14 
16 
17 static const FitQualityCnv_p1 fitQualityCnv;
18 
20  // std::cout<<"ILIJA read VxTrackAtVertexCnv_p2 "<<std::endl;
21 
22  std::unique_ptr<Trk::ITrackLink> trackLink;
23  if (persObj->m_typeOfLink == 0) {
24  // m_elementLinkConverterForTrack.resetForCnv(persObj->m_origTrackNames); // for element link change - Gerhard !?
25  Trk::LinkToTrack* tmpLink = new Trk::LinkToTrack;
26  trackLink = std::unique_ptr<Trk::ITrackLink>(tmpLink);
27  m_elementLinkConverterForTrack.persToTrans(&persObj->m_origTrack,tmpLink,log);
28  } else if (persObj->m_typeOfLink == 1) {
29  // m_elementLinkConverterForTrackParticle.resetForCnv(persObj->m_origTrackNames);
31  trackLink = std::unique_ptr<Trk::ITrackLink>(tmpLink);
32  m_elementLinkConverterForTrackParticle.persToTrans ( &persObj->m_origTrack, tmpLink, log);
33  }
34 
35  Trk::FitQuality fitq;
36  fitQualityCnv.persToTrans(&persObj->m_fitQuality, &fitq, log);
37 
39 
40  *transObj = Trk::VxTrackAtVertex(fitq.chiSquared(),
41  perigeeAtVertex,
42  static_cast<Trk::NeutralParameters*>(nullptr),
43  fitq.doubleNumberDoF());
44  transObj->setWeight (persObj->m_trkWeight);
45  transObj->setVtxCompatibility (persObj->m_VertexCompatibility);
46  transObj->setOrigTrackNoCache (trackLink.release());
47 }
48 
50 
51  // std::cout<<"ILIJA write VxTrackAtVertexCnv_p2 "<<std::endl;
52 
53  // persObj->m_fitQuality = toPersistent (&m_fqCnv, &(transObj->m_fitQuality), log);
54 
55  const Trk::FitQuality fq = transObj->trackQuality();
56  fitQualityCnv.transToPers(&fq, &persObj->m_fitQuality, log);
57 
58  persObj->m_trkWeight = transObj->weight();
59  persObj->m_VertexCompatibility = transObj->vtxCompatibility();
60 
61  // ITPConverterFor < Trk::ParametersBase > *paramsCnv = 0;
62  // persObj->m_perigeeAtVertex = toPersistent (&paramsCnv, transObj->m_perigeeAtVertex, log);
63  persObj->m_perigeeAtVertex = toPersistent (&m_paramsCnv, transObj->perigeeAtVertex(), log);
64 
65  const Trk::LinkToTrack * trLink = dynamic_cast < const Trk::LinkToTrack * >((transObj->trackOrParticleLink ()));
66  if (trLink != nullptr) {
67  persObj->m_typeOfLink = 0;
68  // m_elementLinkConverterForTrack.resetForCnv(persObj->m_origTrackNames);
69  const ElementLink < TrackCollection > *el = dynamic_cast < const ElementLink < TrackCollection > *>(trLink);
70  m_elementLinkConverterForTrack.transToPers (el, &persObj->m_origTrack, log);
71  } else {
72  const Trk::LinkToTrackParticleBase * trPBLink = dynamic_cast < const Trk::LinkToTrackParticleBase * >((transObj->trackOrParticleLink()));
73  if (trPBLink != nullptr) {
74  persObj->m_typeOfLink = 1;
75  // m_elementLinkConverterForTrackParticle.resetForCnv(persObj->m_origTrackNames);
77  m_elementLinkConverterForTrackParticle.transToPers (el, &persObj->m_origTrack, log);
78  }
79  }
80 }
LinkToTrack.h
Trk::VxTrackAtVertex::trackQuality
FitQuality trackQuality(void) const
Returns a pointer to the original track if any.
VxTrackAtVertexCnv_p2::transToPers
void transToPers(const Trk::VxTrackAtVertex *transObj, Trk::VxTrackAtVertex_p2 *persObj, MsgStream &log)
Definition: VxTrackAtVertexCnv_p2.cxx:49
TrackParameters.h
Trk::VxTrackAtVertex
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Definition: VxTrackAtVertex.h:77
VxTrackAtVertexCnv_p2::m_paramsCnv
ITPConverterFor< Trk::TrackParameters > * m_paramsCnv
Definition: VxTrackAtVertexCnv_p2.h:38
VxTrackAtVertexCnv_p2.h
Trk::VxTrackAtVertex_p2
Definition: VxTrackAtVertex_p2.h:18
Trk::VxTrackAtVertex::setVtxCompatibility
void setVtxCompatibility(const double)
Trk::VxTrackAtVertex::weight
double weight(void) const
Information about the weight of track in fit (given back by annealing): weight=ndf/2.
Trk::VxTrackAtVertex::trackOrParticleLink
const ITrackLink * trackOrParticleLink(void) const
Trk::VxTrackAtVertex_p2::m_VertexCompatibility
float m_VertexCompatibility
Definition: VxTrackAtVertex_p2.h:24
Trk::VxTrackAtVertex::setWeight
void setWeight(const double)
Set method for a weight.
FitQualityCnv_p1
Definition: FitQualityCnv_p1.h:22
FitQuality_p1.h
FitQualityCnv_p1::transToPers
virtual void transToPers(const Trk ::FitQuality *transObj, Trk ::FitQuality_p1 *persObj, MsgStream &log) const override
Definition: FitQualityCnv_p1.cxx:20
FitQualityCnv_p1::persToTrans
virtual void persToTrans(const Trk ::FitQuality_p1 *persObj, Trk ::FitQuality *transObj, MsgStream &log) const override
Definition: FitQualityCnv_p1.cxx:14
VxTrackAtVertexCnv_p2::m_elementLinkConverterForTrackParticle
ElementLinkCnv_p3< ElementLink< Trk::TrackParticleBaseCollection > > m_elementLinkConverterForTrackParticle
Definition: VxTrackAtVertexCnv_p2.h:40
Trk::VxTrackAtVertex_p2::m_trkWeight
float m_trkWeight
Definition: VxTrackAtVertex_p2.h:23
Trk::LinkToTrack
AUTO - An Undocumented Tracking Object.
Definition: LinkToTrack.h:20
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
VxTrackAtVertex.h
VxTrackAtVertexCnv_p2::m_elementLinkConverterForTrack
ElementLinkCnv_p3< ElementLink< TrackCollection > > m_elementLinkConverterForTrack
Definition: VxTrackAtVertexCnv_p2.h:39
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
Trk::ParametersBase
Definition: ParametersBase.h:55
LinkToTrackParticleBase.h
Trk::LinkToTrackParticleBase
Definition: LinkToTrackParticleBase.h:17
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::VxTrackAtVertex::perigeeAtVertex
const TrackParameters * perigeeAtVertex(void) const
Perigee parameters with respect to fitted vertex d_0 and z_0 are equal to 0 in case the trajectory wa...
VxTrackAtVertexCnv_p2::persToTrans
void persToTrans(const Trk::VxTrackAtVertex_p2 *persObj, Trk::VxTrackAtVertex *transObj, MsgStream &log)
Conversion methods.
Definition: VxTrackAtVertexCnv_p2.cxx:19
Trk::VxTrackAtVertex_p2::m_fitQuality
FitQuality_p1 m_fitQuality
Definition: VxTrackAtVertex_p2.h:36
FitQualityCnv_p1.h
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
Trk::VxTrackAtVertex_p2::m_typeOfLink
unsigned short int m_typeOfLink
Definition: VxTrackAtVertex_p2.h:30
Trk::VxTrackAtVertex_p2::m_perigeeAtVertex
TPObjRef m_perigeeAtVertex
Definition: VxTrackAtVertex_p2.h:25
Trk::VxTrackAtVertex::setOrigTrackNoCache
void setOrigTrackNoCache(ITrackLink *trk)
Setting up the initial track, without caching parameters.
Definition: VxTrackAtVertex.cxx:442
Trk::FitQuality::doubleNumberDoF
double doubleNumberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as double
Definition: FitQuality.h:68
Trk::VxTrackAtVertex_p2::m_origTrack
ElementLinkInt_p3 m_origTrack
Definition: VxTrackAtVertex_p2.h:31
Trk::VxTrackAtVertex::vtxCompatibility
double vtxCompatibility(void) const
Information about fast compatibility estimation, to be given to the annealing.
ITPConverterFor::createTransFromPStore
CNV::Trans_t * createTransFromPStore(CNV **cnv, const TPObjRef &ref, MsgStream &log) const
Create transient representation of a persistent object, stored in the the top-level persistent object...
Definition: TPConverter.h:172