]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add 2 functions to return the number of degrees of freedom and the normalized chi2...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Nov 2010 10:43:23 +0000 (10:43 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Nov 2010 10:43:23 +0000 (10:43 +0000)
STEER/AliESDMuonTrack.cxx
STEER/AliESDMuonTrack.h

index ad9db0989d584cae064440a21d6f1080eeae119f..d3d3861038ce682a4b4a581e691d01839e31b06a 100644 (file)
@@ -517,6 +517,24 @@ void AliESDMuonTrack::LorentzPUncorrected(TLorentzVector& vP) const
   vP.SetPxPyPzE(pX, pY, pZ, e);
 }
 
+//_____________________________________________________________________________
+Int_t AliESDMuonTrack::GetNDF() const
+{
+  /// return the number of degrees of freedom
+  
+  Int_t ndf = 2 * static_cast<Int_t>(fNHit) - 5;
+  return (ndf > 0) ? ndf : 0;
+}
+
+//_____________________________________________________________________________
+Double_t AliESDMuonTrack::GetNormalizedChi2() const
+{
+  /// return the chi2 value divided by the number of degrees of freedom
+  
+  Int_t ndf = GetNDF();
+  return (ndf > 0) ? fChi2 / static_cast<Double_t>(ndf) : 0.;
+}
+
 //_____________________________________________________________________________
 Int_t AliESDMuonTrack::GetMatchTrigger() const
 {
index a7a457806faafe6f4f4e1fc76ba8c91cde9098b3..18ed1b377ce5acc97a77a7a5b9ab16c137d6e4d2 100644 (file)
@@ -98,6 +98,8 @@ public:
   void     SetChi2(Double_t Chi2) {fChi2 = Chi2;}
   UChar_t  GetNHit(void) const {return fNHit;}
   void     SetNHit(UInt_t NHit) {fNHit = NHit;}
+  Int_t    GetNDF() const;
+  Double_t GetNormalizedChi2() const;
   
   // Get and Set methods for trigger matching
   Int_t    GetMatchTrigger() const;