Skip to content

Commit

Permalink
Merge pull request alisw#251 from haavardh/master
Browse files Browse the repository at this point in the history
Updated RemoveGraphDuplicates so that always first and last points are kept
  • Loading branch information
alibuild authored Jun 14, 2017
2 parents a6af871 + 4f94a35 commit 0724cf8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions STEER/CDB/AliDCSSensorArray.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,11 @@ void AliDCSSensorArray::RemoveGraphDuplicates(Double_t tolerance){
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--) {

// Keep first and last point anyway ( i.e. npoints-2 ...)

if (npoints>2) {
for (Int_t i=npoints-2;i>0;i--) {
graph->GetPoint(i,x,y);
graph->GetPoint(i-1,x0,y0);
if ( TMath::Abs(y-y0) < TMath::Abs(tolerance*y0) ) graph->RemovePoint(i);
Expand Down

0 comments on commit 0724cf8

Please sign in to comment.