PandaRoot
RecoTrackStateProvider.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // ******************************************************
14 // DecayTreeFitter Package
15 // We thank the original author Wouter Hulsbergen
16 // (BaBar, LHCb) for providing the sources.
17 // http://arxiv.org/abs/physics/0503191v1 (2005)
18 // Adaptation & Development for PANDA: Ralf Kliemt (2015)
19 // ******************************************************
20 #ifndef DECAYTREEFITTER_RECOTRACKSTATEPROVIDER_H
21 #define DECAYTREEFITTER_RECOTRACKSTATEPROVIDER_H 1
22 
23 //#include "TrackInterfaces/ITrackStateProvider.h"
24 //#include "TrackKernel/TrackTraj.h"
25 // FIXME Make a Panda state provider...
26 #include "RhoCalculationTools.h"
27 //#include "LineTool.h"
28 #include "State.h"
29 #include "Rtypes.h"
30 #include "RhoCandidate.h"
31 #include "TVectorD.h"
32 #include "TMatrixDSym.h"
33 
34 namespace DecayTreeFitter {
35 // wrapper around ITrackStateProviderTool
37  public:
38  RecoTrackStateProvider(double ztolerance) : m_ztolerance(ztolerance){};
39 
40  RecoTrackStateProvider() : m_ztolerance(0){};
41 
43 
44  void state(DecayTreeFitter::State &aState, RhoCandidate *track) const { return state(aState, track, track->Pos().x(), track->Pos().y(), track->Pos().z()); };
45 
46  double ToleranceZ() const { return m_ztolerance; };
47  void SetToleranceZ(double z) { m_ztolerance = z; };
48 
49  void state(DecayTreeFitter::State &aState, RhoCandidate *track, double vx, double vy, double vz) const
50  {
51  TVectorD statevec = aState.stateVector();
52  TMatrixDSym statecov = aState.covariance();
53  double newz = RhoCalculationTools::StateFromTrajectory(statevec, statecov, track, vx, vy, vz, m_ztolerance);
54  aState.setState(statevec);
55  aState.setZ(newz);
56  aState.setCovariance(statecov);
57  };
58 
59  void P6FromTrack(TVectorD &p6, TMatrixDSym &cov6, RhoCandidate *track, double z) const { RhoCalculationTools::P6FromTrajectory(p6, cov6, track, z, m_ztolerance); };
60 
61  private:
62  double m_ztolerance;
63  bool m_usetraj;
64  ClassDef(RecoTrackStateProvider, 1)
65 };
66 } // namespace DecayTreeFitter
67 
68 #endif
void state(DecayTreeFitter::State &aState, RhoCandidate *track, double vx, double vy, double vz) const
const TVectorD & stateVector() const
Definition: State.h:173
static Bool_t P6FromTrajectory(TVectorD &mom6, TMatrixDSym &cov6, RhoCandidate *cand, double z, double ztolerance)
TVector3 Pos() const
Definition: RhoCandidate.h:188
void state(DecayTreeFitter::State &aState, RhoCandidate *track) const
void P6FromTrack(TVectorD &p6, TMatrixDSym &cov6, RhoCandidate *track, double z) const
void setCovariance(const TMatrixDSym &value)
Definition: State.h:152
void setZ(double value)
Definition: State.h:156
static Double_t StateFromTrajectory(TVectorD &state, TMatrixDSym &cov, RhoCandidate *track, double vx, double vy, double vz, double ztolerance)
const TMatrixDSym & covariance() const
Definition: State.h:176
void setState(const TVectorD &state)
Definition: State.h:140