From: hristov Date: Wed, 24 Nov 2010 10:43:23 +0000 (+0000) Subject: Add 2 functions to return the number of degrees of freedom and the normalized chi2... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=e0ab39d21383b855e6f6b7aad02e855f19f989ce;p=u%2Fmrichter%2FAliRoot.git Add 2 functions to return the number of degrees of freedom and the normalized chi2 of the track. (P.Pillot) --- diff --git a/STEER/AliESDMuonTrack.cxx b/STEER/AliESDMuonTrack.cxx index ad9db0989d5..d3d3861038c 100644 --- a/STEER/AliESDMuonTrack.cxx +++ b/STEER/AliESDMuonTrack.cxx @@ -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(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(ndf) : 0.; +} + //_____________________________________________________________________________ Int_t AliESDMuonTrack::GetMatchTrigger() const { diff --git a/STEER/AliESDMuonTrack.h b/STEER/AliESDMuonTrack.h index a7a457806fa..18ed1b377ce 100644 --- a/STEER/AliESDMuonTrack.h +++ b/STEER/AliESDMuonTrack.h @@ -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;