X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliCaloFastAltroFitv0.cxx;h=798f69b715a664a3282e571c415eadf28438529b;hb=232daaa876bddda00ffd27548c7cc84f7f228929;hp=9fa38f0858d934465356168629a5421b245d991f;hpb=276d61fd48076260110f395327fe64daf0ed75af;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliCaloFastAltroFitv0.cxx b/RAW/AliCaloFastAltroFitv0.cxx index 9fa38f0858d..798f69b715a 100644 --- a/RAW/AliCaloFastAltroFitv0.cxx +++ b/RAW/AliCaloFastAltroFitv0.cxx @@ -130,7 +130,8 @@ void AliCaloFastAltroFitv0::FastFit(TH1F* h, Double_t sig, Double_t tau, Double_ 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; @@ -140,12 +141,16 @@ Double_t ped, Double_t tMax) Int_t* t = new Int_t[nPoints]; Int_t* y = new Int_t[nPoints]; + Int_t nPositive=0; for(Int_t i=0; iGetBinContent(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++;