66 const TEfficiency *
eff;
67 if(
object.
IsA()->InheritsFrom(
"TEfficiency" ))
69 eff =
static_cast<const TEfficiency*
>(&
object);
72 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TEfficiency" );
96 const TH1* eff_hist =
eff->GetTotalHistogram();
97 const Int_t eff_points = eff_hist->GetNbinsX();
98 if (eff_points < minpoint || eff_points==0) {
99 if(
verbose)std::cout <<
name <<
" number of points are too small " << eff_points << std::endl;
101 result->tags_[
"InsufficientN"] = eff_points;
104 if(
verbose)std::cout <<
name <<
" enough number of points " << eff_points << std::endl;
106 const TAxis *
x = eff_hist->GetXaxis();
107 int nbins =
x->GetNbins();
108 double high =
x->GetBinUpEdge(
nbins);
109 double low =
x->GetBinUpEdge(0);
112 if (
xmin>high || xmin<low || xmax>high ||
xmax<low) {
113 throw dqm_core::BadConfig( ERS_HERE,
name,
"xmin and/or xmax value not in eff bin range" );
131 if ( minSig != 0 ) option +=
"E";
132 if ( improve ) option +=
"M";
135 std::cout <<
" eff name " <<
eff->GetName() << std::endl;
136 std::cout <<
" fit option " << option << std::endl;
140 if(
verbose)std::cout <<
"set "<<
name<<
" parameters" << std::endl;
142 m_func->SetParameter(1,xaxismean);
143 m_func->SetParameter(2,xdiff/50.);
144 m_func->SetParNames(
"Plateau",
"Threshold",
"Resolution");
148 m_func->SetParLimits(2, 0., xdiff/4. );
150 else if(
m_name ==
"erf") {
151 if(
verbose)std::cout <<
"set "<<
name<<
" parameters" << std::endl;
153 m_func->SetParameter(1,xaxismean);
154 m_func->SetParameter(2,xdiff/50.);
155 m_func->SetParNames(
"Plateau",
"Threshold",
"Resolution");
159 m_func->SetParLimits(2, 0., xdiff/4. );
161 else if(
m_name ==
"flat") {
162 if(
verbose)std::cout <<
"set "<<
name<<
" parameters" << std::endl;
163 m_func->SetParNames(
"Height");
177 if(
verbose)std::cout <<
"fit "<<
name<<
" with interval cut " <<
xmin <<
" - " <<
xmax << std::endl;
178 std::shared_ptr<TGraphAsymmErrors> graph(
eff->CreateGraph());
179 graph->Fit(
m_func.get(), option.c_str());
181 const int numsig =
m_func->GetParNumber(
"Sigma");
191 catch ( dqm_core::Exception & ex ) {
192 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );