+
+//_____________________________________________________________________________
+void AliDCSSensorArray::RemoveGraphDuplicates(Double_t tolerance){
+//
+// Remove points with same y value as the previous measured point
+// (to save space for non-fitted graphs -- i.e. last measured point used)
+//
+ Int_t nsensors = fSensors->GetEntries();
+ for ( Int_t isensor=0; isensor<nsensors; isensor++) {
+ AliDCSSensor *entry = (AliDCSSensor*)fSensors->At(isensor);
+ TGraph *graph = entry->GetGraph();
+ Double_t x=-999.,y=-999., x0=-999.,y0=-999.;
+ if (graph) {
+ Int_t npoints=graph->GetN();
+ if (npoints>1) {
+ for (Int_t i=npoints-1;i>0;i--) {
+ graph->GetPoint(i,x,y);
+ graph->GetPoint(i-1,x0,y0);
+ if ( fabs(y-y0) < fabs(tolerance*y0) ) graph->RemovePoint(i);
+ }
+ }
+ }
+ }
+}
+