#include <Simple_gaus_Fit.h>
Definition at line 16 of file Simple_gaus_Fit.h.
◆ Simple_gaus_Fit()
dqm_algorithms::Simple_gaus_Fit::Simple_gaus_Fit |
( |
| ) |
|
|
inline |
◆ clone()
◆ execute()
Definition at line 83 of file RootFit.cxx.
89 if(
object.
IsA()->InheritsFrom(
"TH1" ))
93 throw dqm_core::BadConfig( ERS_HERE,
name,
"dimension > 1 for Fit" );
101 throw dqm_core::BadConfig( ERS_HERE,
name,
"does not inherit from TH1" );
121 if (
histogram->GetEffectiveEntries() < minstat ||
histogram->GetEffectiveEntries()==0) {
123 result->tags_[
"InsufficientEffectiveEntries"] =
histogram->GetEffectiveEntries();
128 int nbins =
x->GetNbins();
129 double high =
x->GetBinUpEdge(
nbins);
130 double low =
x->GetBinUpEdge(0);
132 if (
xmin>high || xmin<low || xmax>high ||
xmax<low) {
133 throw dqm_core::BadConfig( ERS_HERE,
name,
"xmin and/or xmax value not in histogram bin range" );
150 if(
lf == 1.0 ) option +=
"L";
151 else if (
lf == 2.0 ) option +=
"LL";
159 std::cout <<
" histo name " <<
histogram->GetName() << std::endl;
160 std::cout <<
" fit option " << option << std::endl;
163 if (
m_name ==
"gauspluspol1"){
165 m_func->SetParNames (
"Constant",
"Mean",
"Sigma",
"pol1[0]",
"pol1[1]");
167 else if (
m_name ==
"pol1"){
168 m_func->SetParNames (
"pol1[0]",
"pol1[1]");
170 else if (
m_name ==
"sinusoid") {
171 m_func->SetParameters(4.0,-1.0);
172 m_func->SetParNames(
"s1",
"s2");
174 else if (
m_name ==
"doublegaus"){
179 f1.GetParameters(
par);
184 m_func->SetParNames(
"Constant",
"Mean",
"Sigma",
"Constant1",
"Mean1",
"Sigma1");
191 else if (
m_name ==
"gausplusexpo") {
193 m_func->SetParNames(
"Constant",
"Mean",
"Sigma",
"ConstantExpo",
"Slope");
195 else if (
m_name ==
"fermi") {
196 m_func->SetParameter(0,0.99);
197 m_func->SetParameter(1,5);
198 m_func->SetParameter(2,1);
199 m_func->SetParNames(
"Plateau",
"Threshold",
"Resolution");
201 else if(
m_name ==
"flat") {
202 if(
verbose)std::cout <<
"set "<<
name<<
" parameters" << std::endl;
203 m_func->SetParNames(
"Height");
215 if(ignoreFirstLastBin) {
216 int firstNonEmptyBin=0;
217 int lastNonEmptyBin=0;
231 if( lastNonEmptyBin-firstNonEmptyBin>2) {
232 if (
x->GetBinLowEdge(firstNonEmptyBin+1) >
xmin ) {
233 xmin=
x->GetBinLowEdge(firstNonEmptyBin+1);
235 if (
x->GetBinUpEdge(lastNonEmptyBin-1) <
xmax ) {
236 xmax=
x->GetBinUpEdge(lastNonEmptyBin-1);
242 if (
m_name ==
"doublegaus") {
245 if (std::abs(
par[2]) > std::abs(
par[5])) {
246 m_func->SetParNames(
"Constant1",
"Mean1",
"Sigma1",
"Constant",
"Mean",
"Sigma");
251 m_func->SetParNames(
"Constant",
"Mean",
"Sigma",
"Constant1",
"Mean1",
"Sigma1");
257 const int numsig =
m_func->GetParNumber(
"Sigma");
267 catch ( dqm_core::Exception & ex ) {
268 throw dqm_core::BadConfig( ERS_HERE,
name, ex.what(), ex );
◆ printDescription()
void dqm_algorithms::RootFit::printDescription |
( |
std::ostream & |
out | ) |
|
|
inherited |
Definition at line 273 of file RootFit.cxx.
275 out<<
"Simple_"+
m_name+
"_Fit: Does simple "+
m_name+
" fit to histogram and checks fit parameters against thresholds\n"<<std::endl;
277 out<<
"The following fit Parameters can be checked with Red and Green Thresholds; only one parameter is needed to get back real result"<<std::endl;
278 out<<
"Green/Red Treshold: Mean : Mean fit value to give Green/Red Result"<<std::endl;
279 out<<
"Green/Red Treshold: AbsMean : AbsMean fit value to give Green/Red Result"<<std::endl;
280 out<<
"Green/Red Treshold: Simga : Sigma fit value to give Green/Red Result"<<std::endl;
281 out<<
"Green/Red Treshold: Constant : Constant fit value to give Green/Red Result\n"<<std::endl;
282 }
else if (
m_name ==
"sinusoid"){
283 out<<
"The sinusoid fit has the following functional form: s1*sin(x) + s2*cos(x)."<<std::endl
284 <<
"Checks can be configured on both parameters, s1 and s2, with green and red thresholds:"<<std::endl;
285 }
else if (
m_name ==
"doublegaus"){
286 out<<
"The following fit Parameters can be checked with Red and Green Thresholds; only one parameter is needed to get back real result"<<std::endl;
287 out<<
"smaller width will be assigned to Sigma"<<std::endl;
288 out<<
"Green/Red Treshold: Mean : Mean fit value to give Green/Red Result"<<std::endl;
289 out<<
"Green/Red Treshold: AbsMean : AbsMean fit value to give Green/Red Result"<<std::endl;
290 out<<
"Green/Red Treshold: Sigma : Sigma fit value to give Green/Red Result"<<std::endl;
291 out<<
"Green/Red Treshold: Constant : Constant fit value to give Green/Red Result\n"<<std::endl;
292 out<<
"Green/Red Treshold: Mean1 : Mean fit value to give Green/Red Result"<<std::endl;
293 out<<
"Green/Red Treshold: AbsMean1 : AbsMean fit value to give Green/Red Result"<<std::endl;
294 out<<
"Green/Red Treshold: Simga1 : Sigma fit value to give Green/Red Result"<<std::endl;
295 out<<
"Green/Red Treshold: Constant1 : Constant fit value to give Green/Red Result\n"<<std::endl;
296 }
else if (
m_name ==
"pol1") {
297 out<<
"The following fit Parameters can be checked with Red and Green Thresholds; only one parameter is needed to get back real result"<<std::endl;
298 out<<
"Green/Red Treshold: pol1[0] : Constant linear fit value to give Green/Red Result"<<std::endl;
299 out<<
"Green/Red Treshold: pol1[1] : Slope linear fit value to give Green/Red Result\n"<<std::endl;
300 }
else if (
m_name ==
"gauspluspol1"){
301 out<<
"The following fit Parameters can be checked with Red and Green Thresholds; only one parameter is needed to get back real result"<<std::endl;
302 out<<
"Green/Red Treshold: Mean : Mean fit value to give Green/Red Result"<<std::endl;
303 out<<
"Green/Red Treshold: AbsMean : AbsMean fit value to give Green/Red Result"<<std::endl;
304 out<<
"Green/Red Treshold: Sigma : Sigma fit value to give Green/Red Result"<<std::endl;
305 out<<
"Green/Red Treshold: Constant : Constant fit value to give Green/Red Result"<<std::endl;
306 out<<
"Green/Red Treshold: pol1[0] : Constant linear fit value to give Green/Red Result"<<std::endl;
307 out<<
"Green/Red Treshold: pol1[1] : Slope linear fit value to give Green/Red Result\n"<<std::endl;
308 }
else if (
m_name ==
"gausplusexpo"){
309 out<<
"The following fit Parameters can be checked with Red and Green Thresholds; only one parameter is needed to get back real result"<<std::endl;
310 out<<
"Green/Red Treshold: Mean : Mean fit value to give Green/Red Result"<<std::endl;
311 out<<
"Green/Red Treshold: AbsMean : AbsMean fit value to give Green/Red Result"<<std::endl;
312 out<<
"Green/Red Treshold: Sigma : Sigma fit value to give Green/Red Result"<<std::endl;
313 out<<
"Green/Red Treshold: Constant : Constant fit value to give Green/Red Result"<<std::endl;
314 out<<
"Green/Red Treshold: ConstantExpo : ConstantExpo fit value to give Green/Red Result"<<std::endl;
315 out<<
"Green/Red Treshold: Slope : Slope fit value to give Green/Red Result\n"<<std::endl;
316 }
else if (
m_name ==
"landau") {
317 out<<
"The following fit Parameters can be checked with Red and Green Thresholds; only one parameter is needed to get back real result"<<std::endl;
318 out<<
"Green/Red Treshold: MPV : MPV fit value to give Green/Red Result"<<std::endl;
319 out<<
"Green/Red Treshold: Sigma : Sigma fit value to give Green/Red Result"<<std::endl;
320 out<<
"Green/Red Treshold: Constant : Constant fit value to give Green/Red Result\n"<<std::endl;
321 }
else if (
m_name ==
"fermi" ) {
322 out<<
"The following fit Parameters can be checked with Red and Green Thresholds; only one parameter is needed to get back real result"<<std::endl;
323 out<<
"Green/Red Threshold: Plateau : Plateau fit value to give Green/Red Result"<<std::endl;
324 out<<
"Green/Red Threshold: Threshold : Fermi energy fit value to give Green/Red Result"<<std::endl;
325 out<<
"Green/Red Threshold: Resolution : Templature fit value to give Green/Red Result\n"<<std::endl;
327 out<<
"Optional Parameter: Verbose: Write out fit results to log file (set to 1)"<<std::endl;
328 out<<
"Optional Parameter: LikelihoodFit: Fit with L or LL option if 1 or 2"<<std::endl;
329 out<<
"Optional Parameter: MinStat: Minimum histogram statistics needed to perform Algorithm"<<std::endl;
330 out<<
"Optional Parameter: MinSignificance : Minimum multiple of the error in fit paramenter by which the parameter must exceed the thresholds"<<std::endl;
331 out<<
"Optional Parameter: xmin: minimum x range"<<std::endl;
332 out<<
"Optional Parameter: xmax: maximum x range"<<std::endl;
333 out<<
"Optional Parameter: SubtractFromMean: value subtracted from XMean before test is applied: allows using AbsXMean for non-zero expected mean"<<std::endl;
334 out<<
"Optional Parameter: ignoreFirstLastBin: ignores the first and last non-empty bin"<<std::endl;
◆ m_func
std::unique_ptr<TF1> dqm_algorithms::RootFit::m_func |
|
privateinherited |
◆ m_name
std::string dqm_algorithms::RootFit::m_name |
|
privateinherited |
The documentation for this struct was generated from the following file: