+ Double_t nl=low*nc, nu =up*nc;
+ Float_t sumamp = 0;
+ Float_t sumweight =0;
+ for (Int_t i=0; i<nc; i++) {
+ Float_t weight =1;
+ if (i<nl+0.1) weight = TMath::Max(1.-(nl-i),0.);
+ if (i>nu-1) weight = TMath::Max(nu-i,0.);
+ sumamp+= dedx[i]*weight;
+ sumweight+=weight;
+ }
+ SetdEdx(sumamp/sumweight);