#include <DTResidualFitter.h>
Public Member Functions | |
DTResidualFitter (bool debug=false) | |
DTResidualFitResult | fitResiduals (TH1F &histo, int nSigmas=1) |
~DTResidualFitter () | |
Private Attributes | |
bool | debug_ |
Definition at line 25 of file DTResidualFitter.h.
DTResidualFitter::DTResidualFitter | ( | bool | debug = false | ) |
Definition at line 16 of file DTResidualFitter.cc.
DTResidualFitter::~DTResidualFitter | ( | ) |
Definition at line 18 of file DTResidualFitter.cc.
{}
DTResidualFitResult DTResidualFitter::fitResiduals | ( | TH1F & | histo, |
int | nSigmas = 1 |
||
) |
Definition at line 20 of file DTResidualFitter.cc.
References debug_.
Referenced by dtCalibration::DTVDriftSegment::compute().
{ TString option("R"); if(!debug_) option += "Q"; float minFit = histo.GetMean() - histo.GetRMS(); float maxFit = histo.GetMean() + histo.GetRMS(); TString funcName = TString(histo.GetName()) + "_gaus"; TF1* fitFunc = new TF1(funcName,"gaus",minFit,maxFit); histo.Fit(fitFunc,option); minFit = fitFunc->GetParameter(1) - nSigmas*fitFunc->GetParameter(2); maxFit = fitFunc->GetParameter(1) + nSigmas*fitFunc->GetParameter(2); fitFunc->SetRange(minFit,maxFit); histo.Fit(fitFunc,option); return DTResidualFitResult( fitFunc->GetParameter(1), fitFunc->GetParError(1), fitFunc->GetParameter(2), fitFunc->GetParError(2) ); }
bool DTResidualFitter::debug_ [private] |
Definition at line 33 of file DTResidualFitter.h.
Referenced by fitResiduals().