}
void AliCaloFastAltroFitv0::FastFit(Int_t* t, Int_t* y, Int_t nPoints, Double_t sig, Double_t tau,
- Double_t n, Double_t ped, Double_t tMax)
+ Double_t /*n*/, Double_t ped, Double_t tMax)
{
- // n 2 here and unused
- n = 2.;
Reset();
fSig = sig;
Double_t ped, Double_t tMax)
{
// Service method for convinience only
- // h - hist with altro response
+ // h - hist with altro response, could have empty bin
+ // and center of bin could be different from bin number
Reset();
if(h==0) return;
Int_t* t = new Int_t[nPoints];
Int_t* y = new Int_t[nPoints];
+ Int_t nPositive=0;
for(Int_t i=0; i<nPoints; i++) {
- t[i] = i+1;
- y[i] = Int_t(h->GetBinContent(i+1));
+ if(h->GetBinContent(i+1) > 0.0){ // Get only positive
+ y[nPositive] = Int_t(h->GetBinContent(i+1));
+ t[nPositive] = Int_t(h->GetBinCenter(i+1)+0.0001);
+ nPositive++;
+ }
}
- if(nPoints>=2) {
+ if(nPositive >= 2) {
FastFit(t,y,nPoints, sig,tau,n,ped, tMax);
}
if(fChi2<=0.0) fNoFit++;