#include "AliLog.h"
#include "TF1.h"
#include "TObject.h"
+#include "TMath.h"
//_____________________________________________________________________
ClassImp(AliFMDPedestalDA)
// det,ring,sec,strip));
return;
}
-
+
AliDebug(50, Form("Fitting FMD%d%c_%d_%d with %d entries",det,ring,sec,strip,
hChannel->GetEntries()));
+ TF1 fitFunc("fitFunc","gausn",0,300);
+ fitFunc.SetParameters(100,100,1);
+ hChannel->Fit("fitFunc","Q0+","",10,200);
Float_t mean = hChannel->GetMean();
Float_t rms = hChannel->GetRMS();
- hChannel->GetXaxis()->SetRangeUser(mean-4*rms,mean+4*rms);
+
+
+ hChannel->GetXaxis()->SetRangeUser(mean-5*rms,mean+5*rms);
mean = hChannel->GetMean();
rms = hChannel->GetRMS();
- hChannel->Fit("gaus","Q0+","",mean-5*rms,mean+5*rms);
- TF1* fitFunc = hChannel->GetFunction("gaus");
-
- Float_t chi2ndf = 0;
- if(fitFunc->GetNDF())
- chi2ndf = fitFunc->GetChisquare() / fitFunc->GetNDF();
+
+ Float_t chi2ndf = 0;
+ if(fitFunc.GetNDF())
+ chi2ndf = fitFunc.GetChisquare() / fitFunc.GetNDF();
+
fOutputFile << det << ','
<< ring << ','
<< sec << ','
<< strip << ','
<< mean << ','
<< rms << ','
- << fitFunc->GetParameter(1) << ','
- << fitFunc->GetParameter(2) << ','
+ << fitFunc.GetParameter(1) << ','
+ << fitFunc.GetParameter(2) << ','
<< chi2ndf <<"\n";
if(fSaveHistograms) {
hChannel->Write();
}
+
}
//_____________________________________________________________________
return hChannel;
#endif
}
+
//_____________________________________________________________________
//
//EOF