ATLAS Offline Software
VxTrackAtVertexCnv_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: VxTrackAtVertexCnv_p1.cxx
8 //
9 //-----------------------------------------------------------------------------
10 
13 
14 #include "TrkTrack/LinkToTrack.h"
17 
19 
21 
22  std::unique_ptr<Trk::ITrackLink> trackLink;
23  if (persObj->m_typeOfLink==0){
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  }
29  else if (persObj->m_typeOfLink==1){
32  trackLink = std::unique_ptr<Trk::ITrackLink>(tmpLink);
33  m_elementLinkConverterForTrackParticle.persToTrans(&persObj->m_origTrack,tmpLink,log);
34  }
35 
36  Trk::FitQuality fitq;
37  fillTransFromPStore( &m_fqCnv, persObj->m_fitQuality, &fitq, log );
38 
39  ITPConverterFor<Trk::TrackParameters> * paramsCnv = nullptr;
40  Trk::TrackParameters* perigeeAtVertex = dynamic_cast<Trk::TrackParameters*>(createTransFromPStore(&paramsCnv, persObj->m_perigeeAtVertex,log ));
41 
42  *transObj = Trk::VxTrackAtVertex(fitq.chiSquared(),
43  perigeeAtVertex,
44  static_cast<Trk::NeutralParameters*>(nullptr),
45  fitq.doubleNumberDoF());
46  transObj->setWeight (persObj->m_trkWeight);
47  transObj->setVtxCompatibility (persObj->m_VertexCompatibility);
48  transObj->setOrigTrackNoCache (trackLink.release());
49 }
50 
52 
53  // std::cout<<"ILIJA write VxTrackAtVertexCnv_p1 "<<std::endl;
54 
55  const Trk::FitQuality fq = transObj->trackQuality();
56  persObj->m_fitQuality = toPersistent( &m_fqCnv, &fq, log );
57  persObj->m_trkWeight = transObj->weight();
58  persObj->m_VertexCompatibility = transObj->vtxCompatibility();
59 
60  ITPConverterFor<Trk::TrackParameters> * paramsCnv = nullptr;
61  persObj->m_perigeeAtVertex = toPersistent(&paramsCnv, transObj->perigeeAtVertex(), log );
62 
63  Trk::LinkToTrack* trLink = dynamic_cast<Trk::LinkToTrack*>(const_cast<Trk::ITrackLink*>(transObj->trackOrParticleLink()));
64  if (trLink!=nullptr){
65  persObj->m_typeOfLink = 0;
68  m_elementLinkConverterForTrack.transToPers(el,&persObj->m_origTrack,log);
69  } else {
70  Trk::LinkToTrackParticleBase *trPBLink = dynamic_cast<Trk::LinkToTrackParticleBase*>(const_cast<Trk::ITrackLink*>(transObj->trackOrParticleLink()));
71  if (trPBLink!=nullptr) {
72  persObj->m_typeOfLink = 1;
76  }
77  }
78 // log << "transToPers() Type of link is: " << persObj->m_typeOfLink << endmsg;
79 // log << "link saved at: " << persObj->m_origTrackNames.m_names.front()
80 // << "\tcontIndex: " << persObj->m_origTrack.m_contIndex
81 // << "\telIndex : " << persObj->m_origTrack.m_elementIndex << endmsg;
82 }
LinkToTrack.h
Trk::VxTrackAtVertex::trackQuality
FitQuality trackQuality(void) const
Returns a pointer to the original track if any.
ITPConverterFor< Trk::TrackParameters >
Trk::VxTrackAtVertex_p1::m_VertexCompatibility
float m_VertexCompatibility
Definition: VxTrackAtVertex_p1.h:22
TrackParameters.h
Trk::VxTrackAtVertex
The VxTrackAtVertex is a common class for all present TrkVertexFitters The VxTrackAtVertex is designe...
Definition: VxTrackAtVertex.h:77
VxTrackAtVertexCnv_p1::m_fqCnv
ITPConverterFor< Trk::FitQuality > * m_fqCnv
Definition: VxTrackAtVertexCnv_p1.h:46
VxTrackAtVertexCnv_p1.h
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.
VxTrackAtVertexCnv_p1::m_elementLinkConverterForTrack
ElementLinkCnv_p2< ElementLink< TrackCollection > > m_elementLinkConverterForTrack
Definition: VxTrackAtVertexCnv_p1.h:47
Trk::VxTrackAtVertex_p1::m_origTrackNames
ElementLinkContNames_p2 m_origTrackNames
Definition: VxTrackAtVertex_p1.h:30
Trk::VxTrackAtVertex::trackOrParticleLink
const ITrackLink * trackOrParticleLink(void) const
VxTrackAtVertexCnv_p1::persToTrans
void persToTrans(const Trk::VxTrackAtVertex_p1 *persObj, Trk::VxTrackAtVertex *transObj, MsgStream &log)
Conversion methods.
Definition: VxTrackAtVertexCnv_p1.cxx:20
Trk::VxTrackAtVertex::setWeight
void setWeight(const double)
Set method for a weight.
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::VxTrackAtVertex_p1::m_origTrack
ElementLinkInt_p2 m_origTrack
Definition: VxTrackAtVertex_p1.h:29
Trk::VxTrackAtVertex_p1::m_trkWeight
float m_trkWeight
Definition: VxTrackAtVertex_p1.h:21
Trk::VxTrackAtVertex_p1::m_perigeeAtVertex
TPObjRef m_perigeeAtVertex
Definition: VxTrackAtVertex_p1.h:23
Trk::LinkToTrack
AUTO - An Undocumented Tracking Object.
Definition: LinkToTrack.h:20
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
VxTrackAtVertex.h
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
VxTrackAtVertexCnv_p1::m_elementLinkConverterForTrackParticle
ElementLinkCnv_p2< ElementLink< Trk::TrackParticleBaseCollection > > m_elementLinkConverterForTrackParticle
Definition: VxTrackAtVertexCnv_p1.h:48
LinkToTrackParticleBase.h
Trk::LinkToTrackParticleBase
Definition: LinkToTrackParticleBase.h:17
Trk::VxTrackAtVertex_p1::m_typeOfLink
unsigned short int m_typeOfLink
Definition: VxTrackAtVertex_p1.h:28
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...
Trk::VxTrackAtVertex_p1::m_fitQuality
TPObjRef m_fitQuality
Definition: VxTrackAtVertex_p1.h:32
VxTrackAtVertexCnv_p1::transToPers
void transToPers(const Trk::VxTrackAtVertex *transObj, Trk::VxTrackAtVertex_p1 *persObj, MsgStream &log)
Definition: VxTrackAtVertexCnv_p1.cxx:51
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::setOrigTrackNoCache
void setOrigTrackNoCache(ITrackLink *trk)
Setting up the initial track, without caching parameters.
Definition: VxTrackAtVertex.cxx:442
Trk::VxTrackAtVertex_p1
Definition: VxTrackAtVertex_p1.h:16
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::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