ATLAS Offline Software
TimePointBetaFitter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUON_STAU_TIMEPOINTBETAFITTER_H
6 #define MUON_STAU_TIMEPOINTBETAFITTER_H
7 
8 #include <vector>
9 #include "GaudiKernel/PhysicalConstants.h"
10 
11 static constexpr double const& invSpeedOfLight = 1 / Gaudi::Units::c_light; // need 1/299.792458
12 
13 namespace Muon {
14 
16  public:
18  struct Hit {
20  Hit(float distance_, float time_, float error_ ) : distance(distance_), time(time_+distance*invSpeedOfLight), error(error_), useInFit(true), residual(0.) { weight2 = 1./(error*error); }
21 
23  float distance;
24  float time;
25  float error;
26  float weight2;
27  bool useInFit;
28  float residual;
29  };
30  typedef std::vector<Hit> HitVec;
31 
33  struct FitResult {
35  FitResult() : status(0), beta(0), chi2(0), ndof(1) {}
36  FitResult(int status_, float beta_, float chi2_, int ndof_) : status(status_), beta(beta_), chi2(chi2_), ndof(ndof_) {}
37 
39  float chi2PerDOF() const { return (status == 0 || ndof == 0) ? 0 : chi2/ndof; }
40 
42  int status;
43  float beta;
44  float chi2;
45  int ndof;
46  };
47 
50 
52  static FitResult fit( HitVec& hits ) ;
53 
55  FitResult fitWithOutlierLogic( HitVec& hits ) const;
56 
57  };
58 
59 }
60 
61 #endif
Muon::TimePointBetaFitter::Hit
simple struct holding the input to the fit
Definition: TimePointBetaFitter.h:18
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
Muon::TimePointBetaFitter::FitResult::ndof
int ndof
fit chi2
Definition: TimePointBetaFitter.h:45
Muon::TimePointBetaFitter::FitResult::chi2
float chi2
fitted beta
Definition: TimePointBetaFitter.h:44
Muon::TimePointBetaFitter::Hit::Hit
Hit(float distance_, float time_, float error_)
constructor, takes the distance of the point to the IP, the measured time with tof subtracted and the...
Definition: TimePointBetaFitter.h:20
Muon::TimePointBetaFitter
Definition: TimePointBetaFitter.h:15
Muon::TimePointBetaFitter::FitResult::FitResult
FitResult(int status_, float beta_, float chi2_, int ndof_)
Definition: TimePointBetaFitter.h:36
Muon::TimePointBetaFitter::Hit::time
float time
distance from time reference point use to calculate TOF
Definition: TimePointBetaFitter.h:24
Muon::TimePointBetaFitter::FitResult::beta
float beta
status flag (0 = failed, 1 = ok)
Definition: TimePointBetaFitter.h:43
Muon::TimePointBetaFitter::fitWithOutlierLogic
FitResult fitWithOutlierLogic(HitVec &hits) const
fit beta with outlier logic
Definition: TimePointBetaFitter.cxx:83
Muon::TimePointBetaFitter::FitResult::chi2PerDOF
float chi2PerDOF() const
chi2/ndof, return 0 if ndof == 0 or status == 0
Definition: TimePointBetaFitter.h:39
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::TimePointBetaFitter::FitResult::FitResult
FitResult()
constructors
Definition: TimePointBetaFitter.h:35
Muon::TimePointBetaFitter::FitResult
simple struct holding the fit result
Definition: TimePointBetaFitter.h:33
Muon::TimePointBetaFitter::Hit::residual
float residual
flag to indicate whether to use the hit in the fit
Definition: TimePointBetaFitter.h:28
Muon::TimePointBetaFitter::Hit::weight2
float weight2
error on the time
Definition: TimePointBetaFitter.h:26
Muon::TimePointBetaFitter::fit
static FitResult fit(HitVec &hits)
fit beta
Definition: TimePointBetaFitter.cxx:12
python.PhysicalConstants.c_light
float c_light
Definition: PhysicalConstants.py:63
Muon::TimePointBetaFitter::HitVec
std::vector< Hit > HitVec
Definition: TimePointBetaFitter.h:30
Muon::TimePointBetaFitter::Hit::useInFit
bool useInFit
1./error^2
Definition: TimePointBetaFitter.h:27
Muon::TimePointBetaFitter::TimePointBetaFitter
TimePointBetaFitter()
constructor
Definition: TimePointBetaFitter.h:49
Muon::TimePointBetaFitter::Hit::distance
float distance
data memebers
Definition: TimePointBetaFitter.h:23
error
Definition: IImpactPoint3dEstimator.h:70
Muon::TimePointBetaFitter::Hit::error
float error
measured time
Definition: TimePointBetaFitter.h:25
Muon::TimePointBetaFitter::FitResult::status
int status
data members
Definition: TimePointBetaFitter.h:42