Belle II Software  release-05-02-19
TimeExtractionUtils.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Tobias Schlüter, Thomas Hauth, Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/eventTimeExtraction/utilities/TimeExtractionUtils.h>
11 #include <tracking/trackFitting/fitter/base/TrackFitter.h>
12 #include <tracking/dataobjects/RecoTrack.h>
13 
14 #include <genfit/KalmanFitStatus.h>
15 #include <genfit/KalmanFitterInfo.h>
16 
17 #include <genfit/Tools.h>
18 
19 #include <cdc/dataobjects/CDCRecoHit.h>
20 #include <framework/logging/Logger.h>
21 #include <TDecompChol.h>
22 
23 #include <numeric>
24 
25 using namespace Belle2;
26 
27 
28 namespace {
32  template<typename T>
33  void setSubOnDiagonal(TMatrixTSym <T>& target, int iRow,
34  const TMatrixTSym <T>& source)
35  {
36  const int nColsTarget = target.GetNrows();
37  const int nColsSource = source.GetNrows();
38 
39  T* pt = target.GetMatrixArray();
40  const T* ps = source.GetMatrixArray();
41 
42  for (int i = 0; i < nColsSource; ++i) {
43  for (int j = 0; j < nColsSource; ++j) {
44  pt[(iRow + i) * nColsTarget + (iRow + j)] = ps[i * nColsSource + j];
45  }
46  }
47  }
48 
53  template<typename T>
54  void setSubOffDiagonal(TMatrixTSym <T>& target, int iRow, int iCol,
55  const TMatrixT <T>& source)
56  {
57  const int nColsTarget = target.GetNcols();
58  const int nRowsSource = source.GetNrows();
59  const int nColsSource = source.GetNcols();
60 
61  T* pt = target.GetMatrixArray();
62  const T* ps = source.GetMatrixArray();
63 
64  for (int i = 0; i < nRowsSource; ++i) {
65  for (int j = 0; j < nColsSource; ++j) {
66  pt[(iRow + i) * nColsTarget + (iCol + j)] = ps[i * nColsSource + j];
67  }
68  }
69  for (int i = 0; i < nRowsSource; ++i) {
70  for (int j = 0; j < nColsSource; ++j) {
71  pt[(iCol + j) * nColsTarget + (iRow + i)] = ps[i * nColsSource + j];
72  }
73  }
74  }
75 }
76 
77 
78 void TimeExtractionUtils::addEventT0WithQuality(std::vector<RecoTrack*>& recoTracks,
79  StoreObjPtr<EventT0>& eventT0,
80  std::vector<EventT0::EventT0Component>& eventT0WithQualityIndex)
81 {
82  if (not eventT0->hasEventT0()) {
83  B2DEBUG(50, "No event t0 is set. Not testing.");
84  return;
85  }
86 
87  // As we do not know what happened before, we have to set the dirty flag here to force a refit.
88  const auto& chi2_with_ndf = TimeExtractionUtils::getChi2WithFit(recoTracks, true);
89  const double quality = chi2_with_ndf.second;
90 
91  if (std::isnan(quality)) {
92  B2DEBUG(50, "The calculated quality is nan. Not using this EventT0 of " << eventT0->getEventT0());
93  return;
94  }
95 
96  B2DEBUG(50, "The iteration gave a result of " << quality << " for " << eventT0->getEventT0());
97  EventT0::EventT0Component eventT0Component = *(eventT0->getEventT0Component());
98  eventT0Component.quality = quality;
99  eventT0WithQualityIndex.emplace_back(eventT0Component);
100  eventT0->addTemporaryEventT0(eventT0Component);
101  eventT0->setEventT0(eventT0Component);
102 }
103 
104 
105 std::pair<double, double> TimeExtractionUtils::getChi2WithFit(const std::vector<RecoTrack*>& recoTracks, bool setDirtyFlag)
106 {
107  TrackFitter trackFitter;
108 
109  double summedChi2 = 0;
110  double summedNDF = 0;
111  unsigned int numberOfFittableRecoTracks = 0;
112 
113  for (RecoTrack* recoTrack : recoTracks) {
114  if (setDirtyFlag) {
115  recoTrack->setDirtyFlag();
116  }
117 
118  if (not trackFitter.fit(*recoTrack)) {
119  continue;
120  }
121 
122  const double chi2 = TimeExtractionUtils::extractReducedChi2(*recoTrack);
123  const double ndf = recoTrack->getTrackFitStatus()->getNdf();
124 
125  if (std::isnan(chi2)) {
126  continue;
127  }
128 
129  numberOfFittableRecoTracks++;
130  summedChi2 += chi2;
131  summedNDF += ndf;
132  }
133 
134  if (numberOfFittableRecoTracks == 0) {
135  return {NAN, NAN};
136  }
137 
138  return {summedChi2 / numberOfFittableRecoTracks, summedNDF / numberOfFittableRecoTracks};
139 }
140 
141 
142 std::pair<double, double> TimeExtractionUtils::getExtractedTimeAndUncertaintyWithFit(const std::vector<RecoTrack*>& recoTracks,
143  bool setDirtyFlag)
144 {
145  TrackFitter trackFitter;
146 
147  double sumFirstDerivatives = 0;
148  double sumSecondDerivatives = 0;
149  unsigned int numberOfFittableRecoTracks = 0;
150 
151  for (RecoTrack* recoTrack : recoTracks) {
152  if (setDirtyFlag) {
153  recoTrack->setDirtyFlag();
154  }
155 
156  if (not trackFitter.fit(*recoTrack)) {
157  continue;
158  }
159 
160  const auto& chi2Derivatives = TimeExtractionUtils::getChi2Derivatives(*recoTrack);
161  const double dchi2da = chi2Derivatives.first;
162  const double d2chi2da2 = chi2Derivatives.second;
163 
164  if (std::isnan(dchi2da) or std::isnan(d2chi2da2)) {
165  continue;
166  }
167 
168  if (d2chi2da2 > 20) {
169  B2DEBUG(50, "Track with bad second derivative");
170  continue;
171  }
172 
173  numberOfFittableRecoTracks++;
174  sumFirstDerivatives += dchi2da;
175  sumSecondDerivatives += d2chi2da2;
176  }
177 
178  if (numberOfFittableRecoTracks == 0) {
179  return {NAN, NAN};
180  }
181 
182  const double extractedEventT0 = sumFirstDerivatives / sumSecondDerivatives;
183  const double extractedEventT0Uncertainty = std::sqrt(2 / sumSecondDerivatives);
184 
185  return {extractedEventT0, extractedEventT0Uncertainty};
186 }
187 
189 {
190  const double chi2 = recoTrack.getTrackFitStatus()->getChi2();
191  const double ndf = recoTrack.getTrackFitStatus()->getNdf();
192 
193  if (ndf == 0) {
194  return NAN;
195  }
196 
197  return chi2 / ndf;
198 }
199 
200 
201 std::pair<double, double> TimeExtractionUtils::getChi2Derivatives(const RecoTrack& recoTrack)
202 {
203  // Check if track is ready to be used.
204  if (recoTrack.getNumberOfCDCHits() == 0) {
205  B2DEBUG(200, "No CDC hits in track.");
206  return {NAN, NAN};
207  }
208 
209  if (recoTrack.wasFitSuccessful()) {
210  const genfit::FitStatus* fs = recoTrack.getTrackFitStatus();
211  if (!fs)
212  return {NAN, NAN};
213  if (fs->isTrackPruned()) {
214  B2WARNING("Skipping pruned track");
215  return {NAN, NAN};
216  }
217  }
218 
219  try {
220  const std::vector<int>& vDimMeas = TimeExtractionUtils::getMeasurementDimensions(recoTrack);
221 
222  TMatrixDSym fullCovariance;
223  bool success = buildFullCovarianceMatrix(recoTrack, fullCovariance);
224  if (!success) {
225  // Error printed inside.
226  return {NAN, NAN};
227  }
228  TMatrixDSym fullResidualCovariance;
229  TMatrixDSym inverseFullMeasurementCovariance;
230  buildFullResidualCovarianceMatrix(recoTrack, vDimMeas, fullCovariance, fullResidualCovariance,
231  inverseFullMeasurementCovariance);
232 
233  TVectorD residuals;
234  TVectorD residualsTimeDerivative;
235  buildResidualsAndTimeDerivative(recoTrack, vDimMeas, residuals, residualsTimeDerivative);
236 
237  // Equations with their numbers from 0810.2241:
238  // 2 At V^-1 (V - HCHt) V^-1 r (9)
239  // = 2 At V^-1 r for fitted tracks (12)
240  const double dchi2da = 2. * residualsTimeDerivative * (inverseFullMeasurementCovariance * residuals);
241 
242  // (2 At V^-1 (V - HCHt) V^-1 A)^-1, note that this should be (10)
243  // SimilarityT(...) if (...) were a matrix.
244  const double d2chi2da2 = 2. * fullResidualCovariance.Similarity(inverseFullMeasurementCovariance * residualsTimeDerivative);
245 
246 
247  if (d2chi2da2 > 20) {
248  B2DEBUG(200, "Track with bad second derivative");
249  return {NAN, NAN};
250  }
251  return {dchi2da, d2chi2da2};
252  } catch (...) {
253  B2DEBUG(50, "Failed time extraction - skipping track");
254  return {NAN, NAN};
255  }
256 }
257 
258 
260 {
261  const auto& hitPoints = recoTrack.getHitPointsWithMeasurement();
262 
263  std::vector<int> vDimMeas;
264  vDimMeas.reserve(hitPoints.size());
265 
266  for (const auto& hit : hitPoints) {
267  // cppcheck-suppress useStlAlgorithm
268  vDimMeas.push_back(hit->getRawMeasurement(0)->getDim());
269  }
270 
271  return vDimMeas;
272 }
273 
274 
276  TMatrixDSym& fullCovariance)
277 {
278  const auto* kfs = dynamic_cast<const genfit::KalmanFitStatus*>(recoTrack.getTrackFitStatus());
279 
280  if (!kfs) {
281  B2ERROR("Track not fitted with a Kalman fitter.");
282  return false;
283  }
284 
285  if (!kfs->isFitConverged()) {
286  B2ERROR("Track fit didn't converge.");
287  return false;
288  }
289 
290  if (!kfs->isFittedWithReferenceTrack()) {
291  B2ERROR("No reference track.");
292  return false;
293  }
294 
295  const auto& hitPoints = recoTrack.getHitPointsWithMeasurement();
296  const unsigned int nPoints = hitPoints.size();
297  const genfit::AbsTrackRep* rep = recoTrack.getCardinalRepresentation();
298  const int nDim = rep->getDim();
299 
300  fullCovariance.ResizeTo(nPoints * nDim, nPoints * nDim);
301  std::vector<TMatrixD> vFitterGain;
302  vFitterGain.reserve(nPoints);
303  for (unsigned int i = 0; i < nPoints; ++i) {
304  const genfit::TrackPoint* tp = hitPoints[i];
306  if (!fi) {
307  B2DEBUG(50, "Missing KalmanFitterInfo - skipping track");
308  return false;
309  }
310 
311  // Diagonal part of the full covariance matrix are the covariances
312  // of the smoothed states.
313  const genfit::MeasuredStateOnPlane& mop = fi->getFittedState();
314  setSubOnDiagonal(fullCovariance, i * nDim, mop.getCov());
315 
316  // Build the corresponding smoother gain matrix.
317  if (i + 1 < nPoints) {
318  const genfit::TrackPoint* tpNext = hitPoints[i + 1];
319  const genfit::KalmanFitterInfo* fiNext = tpNext->getKalmanFitterInfo();
320  if (!fiNext) {
321  B2DEBUG(50, "Missing next KalmanFitterInfo - skipping track");
322  return false;
323  }
324 
325  // update at i
326  const genfit::MeasuredStateOnPlane* update = fi->getForwardUpdate();
327  // transport to i+1 prediction at i+1
328  const genfit::ReferenceStateOnPlane* rsop = fiNext->getReferenceState();
329  if (rsop) {
330  const genfit::MeasuredStateOnPlane* pred = fiNext->getForwardPrediction();
331 
332  // Evaluate (C^i_i+1)^-1 F_i
333  TDecompChol decomp(pred->getCov());
334  TMatrixD F = rsop->getForwardTransportMatrix();
335  decomp.MultiSolve(F);
336 
337  // Calculate gain matrix as
338  // C_i F_i^T (C^i_i+1)^-1 = C_i ((C^i_i+1)^-1 F_i)^T
339  // in the notation of 0810.2241
340  vFitterGain.emplace_back(TMatrixD(update->getCov(),
341  TMatrixD::kMultTranspose, F));
342  } else {
343  B2DEBUG(150, "No reference state, substituting empty fitter gain matrix.");
344  vFitterGain.emplace_back(TMatrixD(5, 5));
345  }
346  }
347 
348  // Build the off-diagonal elements.
349  TMatrixD offDiag = mop.getCov();
350  for (int j = i - 1; j >= 0; --j) {
351  offDiag = TMatrixD(vFitterGain[j], TMatrixD::kMult, offDiag);
352  setSubOffDiagonal(fullCovariance, j * nDim, i * nDim, offDiag);
353  }
354  }
355 
356  return true;
357 }
358 
360  const std::vector<int>& vDimMeas,
361  const TMatrixDSym& fullCovariance,
362  TMatrixDSym& fullResidualCovariance,
363  TMatrixDSym& inverseFullMeasurementCovariance)
364 {
365  const auto& hitPoints = recoTrack.getHitPointsWithMeasurement();
366  const unsigned int nPoints = hitPoints.size();
367  const genfit::AbsTrackRep* rep = recoTrack.getCardinalRepresentation();
368  const int nDim = rep->getDim();
369  int measurementDimensions = std::accumulate(vDimMeas.begin(), vDimMeas.end(), 0);
370  fullResidualCovariance.ResizeTo(measurementDimensions, measurementDimensions);
371  inverseFullMeasurementCovariance.ResizeTo(measurementDimensions, measurementDimensions);
372 
373  // Put together the parts containing the track covariances.
374  std::vector<TMatrixD> HMatrices;
375  HMatrices.reserve(nPoints);
376  for (unsigned int i = 0, index = 0; i < nPoints; ++i) {
377  const genfit::TrackPoint* tp = hitPoints[i];
378  const genfit::AbsMeasurement* meas = tp->getRawMeasurement(0);
379  std::unique_ptr<const genfit::AbsHMatrix> pH(meas->constructHMatrix(rep));
380  const TMatrixD& H = pH->getMatrix();
381  int nDimMeas = vDimMeas[i];
382  TMatrixDSym cov = fullCovariance.GetSub(i * nDim, (i + 1) * nDim - 1,
383  i * nDim, (i + 1) * nDim - 1);
384  pH->HMHt(cov);
385  setSubOnDiagonal(fullResidualCovariance, index, cov);
386 
387  int indexOffDiag = index;
388  for (int j = i - 1; j >= 0; --j) {
389  int nDimMeasJ = HMatrices[j].GetNrows();
390  indexOffDiag -= nDimMeasJ;
391 
392  TMatrixD offDiag(HMatrices[j], TMatrixD::kMult,
393  TMatrixD(fullCovariance.GetSub(nDim * j, nDim * (j + 1) - 1,
394  nDim * i, nDim * (i + 1) - 1),
395  TMatrixD::kMultTranspose, H));
396 
397  setSubOffDiagonal(fullResidualCovariance, indexOffDiag, index, offDiag);
398  }
399 
400  index += nDimMeas;
401  HMatrices.push_back(H);
402  }
403 
404  // Add the measurment covariances, also calculate their full
405  // (block-diagonal) inverse covariance matrix.
406  fullResidualCovariance *= -1;
407  inverseFullMeasurementCovariance = 0;
408  for (unsigned int i = 0, index = 0; i < nPoints; ++i) {
409  const genfit::TrackPoint* tp = hitPoints[i];
411  const genfit::MeasurementOnPlane& mop = fi->getAvgWeightedMeasurementOnPlane();
412  TMatrixDSym cov = mop.getCov();
413  const int dim = cov.GetNrows();
414  setSubOnDiagonal(fullResidualCovariance, index,
415  cov + fullResidualCovariance.GetSub(index, index + dim - 1,
416  index, index + dim - 1));
417 
418  genfit::tools::invertMatrix(cov);
419  setSubOnDiagonal(inverseFullMeasurementCovariance, index, cov);
420 
421  index += dim;
422  }
423 
424  return true;
425 }
426 
427 
429  const std::vector<int>& vDimMeas,
430  TVectorD& residuals,
431  TVectorD& residualTimeDerivative)
432 {
433  // The residuals and their derivatives WRT the event time.
434 
435  int measurementDimensions = std::accumulate(vDimMeas.begin(), vDimMeas.end(), 0);
436  residuals.ResizeTo(measurementDimensions);
437  residualTimeDerivative.ResizeTo(measurementDimensions);
438 
439  const auto& hitPoints = recoTrack.getHitPointsWithMeasurement();
440  const unsigned int nPoints = hitPoints.size();
441  for (unsigned int i = 0, index = 0; i < nPoints; ++i) {
442  const genfit::TrackPoint* tp = hitPoints[i];
444 
445  const std::vector<double>& weights = fi->getWeights();
446  TVectorD weightedResidual(vDimMeas[i]);
447  for (size_t iMeas = 0; iMeas < fi->getNumMeasurements(); ++iMeas) {
448  weightedResidual += weights[iMeas] * fi->getResidual(iMeas).getState();
449  }
450  residuals.SetSub(index, weightedResidual);
451  if (dynamic_cast<const CDCRecoHit*>(tp->getRawMeasurement(0))) {
452  const CDCRecoHit* hit = static_cast<const CDCRecoHit*>(tp->getRawMeasurement(0));
453  std::vector<double> deriv = hit->timeDerivativesMeasurementsOnPlane(fi->getFittedState());
454 
455  double weightedDeriv = weights[0] * deriv[0] + weights[1] * deriv[1];
456  residualTimeDerivative[index] = weightedDeriv;
457  }
458  index += vDimMeas[i];
459  }
460 }
genfit::TrackPoint
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition: TrackPoint.h:46
Belle2::RecoTrack::getTrackFitStatus
const genfit::FitStatus * getTrackFitStatus(const genfit::AbsTrackRep *representation=nullptr) const
Return the track fit status for the given representation or for the cardinal one. You are not allowed...
Definition: RecoTrack.h:537
genfit::FitStatus::getChi2
double getChi2() const
Get chi^2 of the fit.
Definition: FitStatus.h:120
Belle2::RecoTrack::wasFitSuccessful
bool wasFitSuccessful(const genfit::AbsTrackRep *representation=nullptr) const
Returns true if the last fit with the given representation was successful.
Definition: RecoTrack.cc:326
Belle2::RecoTrack::getCardinalRepresentation
genfit::AbsTrackRep * getCardinalRepresentation() const
Get a pointer to the cardinal track representation. You are not allowed to modify or delete it!
Definition: RecoTrack.h:547
Belle2::TrackFitter::fit
bool fit(RecoTrack &recoTrack, genfit::AbsTrackRep *trackRepresentation) const
Fit a reco track with a given non-default track representation.
Definition: TrackFitter.cc:109
genfit::MeasuredStateOnPlane
#StateOnPlane with additional covariance matrix.
Definition: MeasuredStateOnPlane.h:39
genfit::FitStatus::isTrackPruned
bool isTrackPruned() const
Has the track been pruned after the fit?
Definition: FitStatus.h:116
genfit::KalmanFitStatus
FitStatus for use with AbsKalmanFitter implementations.
Definition: KalmanFitStatus.h:36
genfit::ReferenceStateOnPlane
#StateOnPlane with linearized transport to that #ReferenceStateOnPlane from previous and next #Refere...
Definition: ReferenceStateOnPlane.h:43
genfit::AbsHMatrix::HMHt
virtual void HMHt(TMatrixDSym &M) const
similarity: H*M*H^t
Definition: AbsHMatrix.h:56
genfit::AbsHMatrix::getMatrix
virtual const TMatrixD & getMatrix() const =0
Get the actual matrix representation.
genfit::TrackPoint::getKalmanFitterInfo
KalmanFitterInfo * getKalmanFitterInfo(const AbsTrackRep *rep=nullptr) const
Helper to avoid casting.
Definition: TrackPoint.cc:180
Belle2::TimeExtractionUtils::addEventT0WithQuality
static void addEventT0WithQuality(std::vector< RecoTrack * > &recoTracks, StoreObjPtr< EventT0 > &eventT0, std::vector< EventT0::EventT0Component > &eventT0WithQualityIndex)
Append an event-t0 value with quality information.
Definition: TimeExtractionUtils.cc:78
genfit::AbsTrackRep
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
Belle2::TimeExtractionUtils::buildResidualsAndTimeDerivative
static void buildResidualsAndTimeDerivative(const RecoTrack &recoTrack, const std::vector< int > &vDimMeas, TVectorD &residuals, TVectorD &residualTimeDerivative)
Calculate the weighted residuals (weighted with the DAF weight) of each hit and the time derivative o...
Definition: TimeExtractionUtils.cc:428
Belle2::EventT0::EventT0Component
Structure for storing the extracted event t0s together with its detector and its uncertainty.
Definition: EventT0.h:44
Belle2::CDCRecoHit
This class is used to transfer CDC information to the track fit.
Definition: CDCRecoHit.h:43
Belle2::TimeExtractionUtils::getChi2Derivatives
static std::pair< double, double > getChi2Derivatives(const RecoTrack &recoTrack)
Extract the derivatives d chi^2 / d alpha and d^2 chi^2 / (d alpha)^2 from the reco track by calculat...
Definition: TimeExtractionUtils.cc:201
Belle2::RecoTrack::getHitPointsWithMeasurement
const std::vector< genfit::TrackPoint * > & getHitPointsWithMeasurement() const
Return a list of measurements and track points, which can be used e.g. to extrapolate....
Definition: RecoTrack.h:607
Belle2::TimeExtractionUtils::getMeasurementDimensions
static std::vector< int > getMeasurementDimensions(const RecoTrack &recoTrack)
Get a list of dimensions for each measurement in the reco track.
Definition: TimeExtractionUtils.cc:259
Belle2::TrackFitter
Algorithm class to handle the fitting of RecoTrack objects.
Definition: TrackFitter.h:116
Belle2::EventT0::EventT0Component::quality
double quality
Storage for the internal quality estimation for a single algorithm. Only comparable for all temporari...
Definition: EventT0.h:67
Belle2::TimeExtractionUtils::getExtractedTimeAndUncertaintyWithFit
static std::pair< double, double > getExtractedTimeAndUncertaintyWithFit(const std::vector< RecoTrack * > &recoTracks, bool setDirtyFlag)
Fit the tracks and extract the chi2 derivatives.
Definition: TimeExtractionUtils.cc:142
genfit::AbsMeasurement
Contains the measurement and covariance in raw detector coordinates.
Definition: AbsMeasurement.h:42
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
genfit::KalmanFitterInfo
Collects information needed and produced by a AbsKalmanFitter implementations and is specific to one ...
Definition: KalmanFitterInfo.h:44
Belle2::TimeExtractionUtils::extractReducedChi2
static double extractReducedChi2(const RecoTrack &recoTrack)
Small helper function to extract the reduced chi^2 (chi^2/ndf). Returns NaN if ndf is 0.
Definition: TimeExtractionUtils.cc:188
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
genfit::AbsTrackRep::getDim
virtual unsigned int getDim() const =0
Get the dimension of the state vector used by the track representation.
genfit::FitStatus::getNdf
double getNdf() const
Get the degrees of freedom of the fit.
Definition: FitStatus.h:122
genfit::AbsMeasurement::constructHMatrix
virtual const AbsHMatrix * constructHMatrix(const AbsTrackRep *) const =0
Returns a new AbsHMatrix object.
Belle2::TimeExtractionUtils::buildFullResidualCovarianceMatrix
static bool buildFullResidualCovarianceMatrix(const RecoTrack &recoTrack, const std::vector< int > &vDimMeas, const TMatrixDSym &fullCovariance, TMatrixDSym &fullResidualCovariance, TMatrixDSym &inverseFullMeasurementCovariance)
Build the full covariance matrix of the residuals of the measurements out of the full covariance matr...
Definition: TimeExtractionUtils.cc:359
Belle2::RecoTrack::getNumberOfCDCHits
unsigned int getNumberOfCDCHits() const
Return the number of cdc hits.
Definition: RecoTrack.h:417
Belle2::TimeExtractionUtils::buildFullCovarianceMatrix
static bool buildFullCovarianceMatrix(const RecoTrack &recoTrack, TMatrixDSym &fullCovariance)
Build the full covariance matrix of the given reco track and fills it into the given TMatrixDSym.
Definition: TimeExtractionUtils.cc:275
Belle2::TimeExtractionUtils::getChi2WithFit
static std::pair< double, double > getChi2WithFit(const std::vector< RecoTrack * > &recoTracks, bool setDirtyFlag)
Fit the tracks and extract the reduced chi2.
Definition: TimeExtractionUtils.cc:105
genfit::FitStatus
Class where important numbers and properties of a fit can be stored.
Definition: FitStatus.h:80
genfit::MeasurementOnPlane
Measured coordinates on a plane.
Definition: MeasurementOnPlane.h:46