From 0929ca8ea83ae66b21741589083a11bd70640d32 Mon Sep 17 00:00:00 2001 From: cblume Date: Sun, 10 Jul 2016 13:01:45 +0200 Subject: [PATCH] bugfix by Raphaelle See ALIROOT-6776 --- TRD/TRDbase/AliTRDCalDet.cxx | 36 ++++++++++++++++++++++++++++++++ TRD/TRDbase/AliTRDCalDet.h | 1 + TRD/TRDbase/AliTRDCalibraFit.cxx | 3 ++- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/TRD/TRDbase/AliTRDCalDet.cxx b/TRD/TRDbase/AliTRDCalDet.cxx index 537779a274e..375f7582321 100644 --- a/TRD/TRDbase/AliTRDCalDet.cxx +++ b/TRD/TRDbase/AliTRDCalDet.cxx @@ -207,6 +207,42 @@ Double_t AliTRDCalDet::GetRMSRobust(Double_t robust) const delete [] index; return mean; } +//____________________________________________________________________________________________ +Double_t AliTRDCalDet::GetMeanRobust(Double_t robust) const +{ + // + // Calculate the robust mean + // + + // sorted + Int_t *index = new Int_t[kNdet]; + TMath::Sort((Int_t)kNdet,fData,index); + + // reject + Double_t reject = (Int_t) (kNdet*(1-robust)/2.0); + if(reject <= 0.0) reject = 0.0; + if(reject >= kNdet) reject = 0.0; + //printf("Rejecter %f\n",reject); + + Double_t *ddata = new Double_t[kNdet]; + Int_t nPoints = 0; + for (Int_t i=0;i 0.0000001) && (TMath::Abs(param[0]) > 0.0000001)){