ATLAS Offline Software
AlgorithmHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #ifndef DQM_ALGORITHMS_TOOLS_ALGORITHMHELPER_CXX
9 #define DQM_ALGORITHMS_TOOLS_ALGORITHMHELPER_CXX
10 
11 #include <TF1.h>
12 #include <TH1.h>
13 #include <TH3F.h>
14 #include <TH2F.h>
15 #include <TH1F.h>
16 
17 #include <Math/ProbFuncMathCore.h>
18 #include <Math/DistFunc.h>
19 #include <TClass.h>
20 #include <iostream>
22 #include <ers/ers.h>
23 
24 #include <dqm_core/Result.h>
25 
26 #include <dqm_core/AlgorithmManager.h>
27 #include <dqm_core/LibraryManager.h>
28 
29 std::map<std::string, double >
31 {
32  std::map<std::string,double> fitparams;
33 
34  const int nPar =(int) func->GetNpar();
35 
36  for ( int i = 0; i< nPar; ++i ) {
37  std::string name = func->GetParName( i );
38  fitparams[name] = func->GetParameter( i );
39  }
40  return fitparams;
41 }
42 
43 std::map<std::string, double >
45 {
46  std::map<std::string,double> fitParamErrors;
47 
48  const int nPar =(int) func->GetNpar();
49 
50  for ( int i = 0; i< nPar; ++i ) {
51  std::string name = func->GetParName( i );
52  fitParamErrors[name] = func->GetParError( i );
53  }
54  return fitParamErrors;
55 }
56 
57 
58 
60 dqm_algorithms::tools::MakeComparisons( const std::map<std::string,double> & algparams,
61  const std::map<std::string,double> & gthreshold,
62  const std::map<std::string,double> & rthreshold )
63 {
64 
65  int red=0;
66  int yellow=0;
67  int green=0;
68 
69 
70  if (gthreshold.size() != rthreshold.size()) {
71  throw dqm_core::BadConfig( ERS_HERE, "MakeComparisons", "Need same number of Red and Green Threshold" );
72  }
73 
74  if (gthreshold.size() == 0 ) {
75  throw dqm_core::BadConfig( ERS_HERE, "MakeComparisons", "No Threshold specified" );
76  }
77 
78  std::map<std::string,double>::const_iterator g_iter;
79 
80  for (g_iter=gthreshold.begin();g_iter!=gthreshold.end();++g_iter){
81 
82  std::string name=(std::string) g_iter->first;
83  std::string findname=name;
84  double gtvalue=g_iter->second;
85 
86  if (name == "AbsMean" )
87  findname="Mean";
88  if (name == "AbsXMean" )
89  findname="XMean";
90  if (name == "AbsYMean" )
91  findname="YMean";
92 
93 
94  std::map<std::string,double>::const_iterator ait = algparams.find(findname);
95  std::map<std::string,double>::const_iterator rit = rthreshold.find(name);
96  double rtvalue=-999;
97  double avalue=-999;
98 
99  if ( ait != algparams.end() ) {
100  avalue=ait->second;
101  }
102  else {
103  throw dqm_core::BadConfig( ERS_HERE, "None", name );
104  }
105 
106  if ( rit != rthreshold.end() ) {
107  rtvalue=rit->second;
108  }
109  else {
110  throw dqm_core::BadConfig( ERS_HERE, "None", name );
111  }
112 
113 
114  if (name == "AbsMean" || name == "AbsXMean" || name== "AbsYMean") {
115  avalue = fabs(avalue);
116  if (gtvalue < 0 || rtvalue <0 ) {
117  throw dqm_core::BadConfig( ERS_HERE, "None", name );
118  }
119  }
120 
121  ERS_DEBUG(1, name<<" :red value "<<rtvalue<<" :green value "<<gtvalue<<" :param value "<<avalue);
122 
123  if (gtvalue < rtvalue) {
124 
125  if (avalue <= gtvalue ){
126  ++green;
127  }else if(avalue < rtvalue){
128  ++yellow;
129  }else {
130  ++red;
131  }
132  }
133  else if (gtvalue > rtvalue) {
134  if (avalue >= gtvalue ){
135  ++green;
136  }else if(avalue > rtvalue){
137  ++yellow;
138  }else {
139  ++red;
140  }
141  }
142  else {
143  ERS_DEBUG(0, "red threshold (" << rtvalue << ") same as green threshold "<< gtvalue <<") for parameter " << name << ": can't evaluate result");
144  throw dqm_core::BadConfig( ERS_HERE, "None", name );
145  }
146 
147  }
148  ERS_DEBUG(1, "red: "<<red<<" yellow: "<<yellow<<" green: "<<green);
149 
150 
152 
153  result->tags_ = algparams;
154 
155 
156  if (red>0) {
157  result->status_= dqm_core::Result::Red;
158  }else if (yellow>0) {
159  result->status_= dqm_core::Result::Yellow;
160  }else if (green>0) {
162  }
163 
164  return result;
165 }
166 
168 dqm_algorithms::tools::CompareWithErrors( const std::map<std::string,double> & algparams,
169  const std::map<std::string,double> & paramErrors,
170  const std::map<std::string,double> & gthreshold,
171  const std::map<std::string,double> & rthreshold, double minSig )
172 {
173 
174  int red = 0;
175  int yellow = 0;
176  int green = 0;
177  int undefined = 0;
178 
179 
180  if (gthreshold.size() != rthreshold.size()) {
181  throw dqm_core::BadConfig( ERS_HERE, "MakeComparisons", "Need same number of Red and Green Threshold" );
182  }
183 
184  if (gthreshold.size() == 0 ) {
185  throw dqm_core::BadConfig( ERS_HERE, "MakeComparisons", "No Threshold specified" );
186  }
187 
188  std::map<std::string,double>::const_iterator g_iter;
189 
190  for (g_iter=gthreshold.begin();g_iter!=gthreshold.end();++g_iter){
191 
192  std::string name=(std::string) g_iter->first;
193  std::string findname=name;
194  double gtvalue=g_iter->second;
195 
196  if (name == "AbsMean" )
197  findname="Mean";
198  if (name == "AbsXMean" )
199  findname="XMean";
200  if (name == "AbsYMean" )
201  findname="YMean";
202 
203 
204  std::map<std::string,double>::const_iterator ait = algparams.find(findname);
205  std::map<std::string,double>::const_iterator errItr = paramErrors.find(findname);
206  std::map<std::string,double>::const_iterator rit = rthreshold.find(name);
207 
208  double rtvalue = -999;
209  double avalue = -999;
210  double error = 0;
211 
212  if ( ait != algparams.end() ) {
213  avalue=ait->second;
214  }
215  else {
216  throw dqm_core::BadConfig( ERS_HERE, "None", name );
217  }
218 
219  if ( errItr != paramErrors.end() ) {
220  error = errItr->second;
221  }
222  else {
223  throw dqm_core::BadConfig( ERS_HERE, "Problem retrieving fit param error", name );
224  }
225  if ( error < 0 ) error = 0;
226 
227  if ( rit != rthreshold.end() ) {
228  rtvalue=rit->second;
229  }
230  else {
231  throw dqm_core::BadConfig( ERS_HERE, "None", name );
232  }
233 
234 
235  if (name == "AbsMean" || name == "AbsXMean" || name== "AbsYMean") {
236  avalue = fabs(avalue);
237  if (gtvalue < 0 || rtvalue <0 ) {
238  throw dqm_core::BadConfig( ERS_HERE, "None", name );
239  }
240  }
241 
242  ERS_DEBUG(1, name<<" :red value "<<rtvalue<<" :green value "<<gtvalue<<" :param value "<<avalue <<" :param error "<<error);
243 
244  double significanceBound = error * minSig;
245 
246 
247  if (gtvalue < rtvalue) {
248 
249  if ( avalue <= (gtvalue - significanceBound) ){
250  ++green;
251  }
252  else if( avalue > (rtvalue + significanceBound) ){
253  ++red;
254  }
255  else if( avalue > (gtvalue + significanceBound) ) {
256  ++yellow;
257  }
258  else {
259  ++undefined;
260  }
261  }
262  else if (gtvalue > rtvalue) {
263  if ( avalue >= (gtvalue + significanceBound) ){
264  ++green;
265  }
266  else if( avalue < (rtvalue - significanceBound) ){
267  ++red;
268  }
269  else if( avalue < (gtvalue - significanceBound) ){
270  ++yellow;
271  }
272  else {
273  ++undefined;
274  }
275  }
276  else {
277  ERS_DEBUG(0, "red threshold same as green threshold: can't evaluate result");
278  throw dqm_core::BadConfig( ERS_HERE, "None", name );
279  }
280 
281  }
282  ERS_DEBUG(1, "red: "<<red<<" yellow: "<<yellow<<" green: "<<green << " undefined: " <<undefined);
283 
284 
286 
287  result->tags_ = algparams;
288 
289  // We use a strung undefined here: if one of the test parameters was in the undefined region about gth,
290  // then the overall result will be undefined.
291  if (red>0) {
292  result->status_= dqm_core::Result::Red;
293  }
294  else if (yellow>0) {
295  result->status_= dqm_core::Result::Yellow;
296  }
297  else if (undefined>0) {
299  }
300  else if (green>0) {
302  }
303 
304  return result;
305 }
306 
308 dqm_algorithms::tools::GetFitResult (const TF1 * func, const dqm_core::AlgorithmConfig & config, double minSig )
309 {
310  std::map<std::string, double > params = GetFitParams(func);
311  std::map<std::string, double > greenthresh=config.getGreenThresholds();
312  std::map<std::string,double>::const_iterator ait = greenthresh.find("Chi2_per_NDF");
313  if ( ait != greenthresh.end() ) {
314  params["Chi2_per_NDF"]=func->GetChisquare()/ func->GetNDF();
315  }
316  double subtractfrommean = GetFirstFromMap( "SubtractFromMean", config.getParameters(), 0 );
317 
318  params["Mean"] = params["Mean"] - subtractfrommean;
320  std::map<std::string, double > paramErrors = GetFitParamErrors(func);
321  if( minSig == 0) {
322  result = MakeComparisons( params, config.getGreenThresholds(), config.getRedThresholds() );
323  //result->tags_ = params;
324  }
325  else {
326  result = CompareWithErrors( params, paramErrors, config.getGreenThresholds(), config.getRedThresholds(), minSig );
327  }
328 
329  result->tags_ = params;
330  for ( std::map<std::string,double>::const_iterator peItr = paramErrors.begin(); peItr != paramErrors.end(); ++peItr ) {
331  std::string errorName = peItr->first;
332  errorName += " Error";
333  result->tags_[errorName] = peItr->second;
334  }
335 
336  return result;
337 }
338 
339 double dqm_algorithms::tools::GetFirstFromMap(const std::string &paramName, const std::map<std::string, double > &params)
340 {
341  std::map<std::string, double >::const_iterator it = params.find(paramName);
342  if (it == params.end()) {
343  throw dqm_core::BadConfig(ERS_HERE, "None", paramName); // this is the only difference between the two overloaded versions
344  } else {
345  return it->second;
346  }
347 }
348 
349 double dqm_algorithms::tools::GetFirstFromMap(const std::string &paramName, const std::map<std::string, double > &params, double defaultValue)
350 {
351  std::map<std::string, double >::const_iterator it = params.find(paramName);
352  if (it == params.end()) {
353  return defaultValue; // this is the only difference between the two overloaded versions
354  } else {
355  return it->second;
356  }
357 }
358 
359 //string overloads
360 const std::string& dqm_algorithms::tools::GetFirstFromMap(const std::string &paramName, const std::map<std::string, std::string > &params)
361 {
362  std::map<std::string, std::string >::const_iterator it = params.find(paramName);
363  if (it == params.end()) {
364  throw dqm_core::BadConfig(ERS_HERE, "None", paramName); // this is the only difference between the two overloaded versions
365  } else {
366  return it->second;
367  }
368 }
369 
370 const std::string& dqm_algorithms::tools::GetFirstFromMap(const std::string &paramName, const std::map<std::string, std::string > &params, const std::string& defaultValue)
371 {
372  std::map<std::string, std::string >::const_iterator it = params.find(paramName);
373  if (it == params.end()) {
374  return defaultValue; // this is the only difference between the two overloaded versions
375  } else {
376  return it->second;
377  }
378 }
379 
380 std::vector<int> dqm_algorithms::tools::GetBinRange(const TH1 *h, const std::map<std::string, double > &params)
381 {
382  std::vector<int> range;
383  const TAxis *xAxis = h->GetXaxis();
384  const TAxis *yAxis = h->GetYaxis();
385 
386  if (h->GetDimension() > 2) {
387  throw dqm_core::BadConfig(ERS_HERE, h->GetName(), "histogram has more than 2 dimensions");
388  }
389 
390  const double notFound = -99999;
391  const double xmin = dqm_algorithms::tools::GetFirstFromMap("xmin", params, notFound);
392  const double xmax = dqm_algorithms::tools::GetFirstFromMap("xmax", params, notFound);
393  const double ymin = dqm_algorithms::tools::GetFirstFromMap("ymin", params, notFound);
394  const double ymax = dqm_algorithms::tools::GetFirstFromMap("ymax", params, notFound);
395 
401  const int xlow = (xmin == notFound) ? 1 : xAxis->FindBin(xmin);
402  const int xhigh = (xmax == notFound) ? xAxis->GetNbins() : (xAxis->GetBinLowEdge(xAxis->FindBin(xmax))== xmax) ? (xAxis->FindBin(xmax)-1) : xAxis->FindBin(xmax);
403  const int ylow = (ymin == notFound) ? 1 : yAxis->FindBin(ymin);
404  const int yhigh = (ymax == notFound) ? yAxis->GetNbins() : (yAxis->GetBinLowEdge(yAxis->FindBin(ymax))== ymax) ? (yAxis->FindBin(ymax)-1) : yAxis->FindBin(ymax);
405 
406 
407  if (xlow>xhigh) {
408  char temp[128];
409  sprintf(temp,"Bin Range Error: xmin = %.3g, xmax = %.3g",xmin,xmax);
410  throw dqm_core::BadConfig( ERS_HERE, h->GetName(), temp );
411  }
412  if (ylow>yhigh) {
413  char temp[128];
414  sprintf(temp,"Bin Range Error: xmin = %.3g, xmax = %.3g",xmin,xmax);
415  throw dqm_core::BadConfig( ERS_HERE, h->GetName(), temp );
416  }
417 
418  range.push_back(xlow);
419  range.push_back(xhigh);
420  range.push_back(ylow);
421  range.push_back(yhigh);
422  return range;
423 }
424 
425 void
426 dqm_algorithms::tools::PublishBin(const TH1 * histogram, int x, int y, double inputcont, dqm_core::Result *result) {
427 
428  std::string name = histogram->GetName();
429  double xbin = histogram->GetXaxis()->GetBinCenter(x);
430  std::string xbinlabel = (std::string)(histogram->GetXaxis()->GetBinLabel(x));
431  if (histogram->GetDimension() == 2){
432  double ybin = histogram->GetYaxis()->GetBinCenter(y);
433  std::string ybinlabel = (std::string)(histogram->GetYaxis()->GetBinLabel(y));
434  std::string badbin = Form("x-axis %s(%f) y-axis %s(%f))",xbinlabel.c_str(),xbin,ybinlabel.c_str(),ybin);
435  result->tags_[badbin.c_str()] = inputcont;
436  ERS_DEBUG(1,"x bin "<<xbin<<" y bin "<<ybin <<" value "<<inputcont);
437  } else {
438  std::string badbin = Form("%s(%f)",xbinlabel.c_str(),xbin);
439  result->tags_[badbin.c_str()] = inputcont;
440  ERS_DEBUG(1,"x bin "<<xbin<<" value "<<inputcont);
441  }
442 }
443 
444 
445 TH1*
446 dqm_algorithms::tools::DivideByHistogram(const TH1* hNumerator, const TH1* hDenominator)
447 {
448 
449  TH1 * hResult = 0;
450 
451  int hNdimension = hNumerator->GetDimension();
452  int hDdimension = hDenominator->GetDimension();
453 
454  if( hDdimension == hNdimension ) {
455  if( (hNumerator->GetNbinsX() != hDenominator->GetNbinsX()) || (hNumerator->GetNbinsY() != hDenominator->GetNbinsY()) ||
456  (hNumerator->GetNbinsZ() != hNumerator->GetNbinsZ()) ) {
457  throw dqm_core::BadConfig( ERS_HERE, "DivideByHistogram", "number of bins do not match");
458  }
459  //since the dimensions match, use the root TH1 division method
460  //as recommended in root documentation, we call Sumw2 first to keep the errors well behaved:
461 
462  if( hNdimension == 1) {
463  hResult = BookHistogramByExample(hNumerator,"hQuotient","Result of Division of One Histogram By Another",XAxis);
464  }
465  else if ( hNdimension == 2 ) {
466  hResult = BookHistogramByExample(hNumerator,"hQuotient","Result of Division of One Histogram By Another",XYAxes);
467  }
468  else if ( hNdimension == 3 ) {
469  hResult = BookHistogramByExample(hNumerator,"hQuotient","Result of Division of One Histogram By Another",XYZAxes);
470  }
471  else {
472  throw dqm_core::BadConfig( ERS_HERE, "DivideByHistogram", "Histograms with dimension greater than 3 are not supported");
473  }
474  hResult->Sumw2();
475 
476  hResult->Divide(hNumerator,hDenominator);
477  }
478  else if ( hNdimension > hDdimension ) {
479  //Handle division for case where denominator has lower dimension than numerator:
480  //There are only a few possibilities, hNdimension = 2 or 3, hDdimension = 1 or 2.
481 
482  const TAxis* xax = hNumerator->GetXaxis();
483  int nbinsx = xax->GetNbins();
484  const TAxis* yax = hNumerator->GetYaxis();
485  int nbinsy = yax->GetNbins();
486  const TAxis* zax = hNumerator->GetZaxis();
487  int nbinsz = zax->GetNbins();
488 
489  if( nbinsx != hDenominator->GetNbinsX() ) {
490  throw dqm_core::BadConfig( ERS_HERE, "DivideByHistogram", "number of bins in x-axis do not match");
491  }
492  if( (hDdimension == 2) && (nbinsy != hDenominator->GetNbinsY()) ) {
493  throw dqm_core::BadConfig( ERS_HERE, "DivideByHistogram", "number of bins in y-axis do not match");
494  }
495 
496  double numeratorCont = 0;
497  double denominatorCont = 0;
498  double numeratorError = 0;
499  double denominatorError = 0;
500 
501  if(hNdimension == 2) {
502  hResult = BookHistogramByExample(hNumerator,"hQuotient","Result of Division of One Histogram By Another",XYAxes);
503  }
504  else if(hNdimension == 3) {
505  hResult = BookHistogramByExample(hNumerator,"hQuotient","Result of Division of One Histogram By Another",XYZAxes);
506  }
507  else {
508  throw dqm_core::BadConfig( ERS_HERE, "DivideByHistogram", "Histograms with dimension greater than 3 are not supported");
509  }
510 
511  for (int i=1; i <= nbinsx; i++) {
512  if( hDdimension == 1){
513  denominatorCont = hDenominator->GetBinContent(i);
514  denominatorError = hDenominator->GetBinError(i);
515  }
516  for (int j=1; j <= nbinsy; j++) {
517  if( hDdimension == 2){
518  denominatorCont = hDenominator->GetBinContent(i,j);
519  denominatorError = hDenominator->GetBinError(i,j);
520  }
521  if( hNdimension == 2){
522  numeratorCont = hNumerator->GetBinContent(i,j);
523  numeratorError = hNumerator->GetBinError(i,j);
524  if(denominatorCont != 0){
525  hResult->SetBinContent(i,j,numeratorCont/denominatorCont);
526  hResult->SetBinError(i,j,sqrt( ( pow(numeratorError,2)/pow(denominatorCont,2) )
527  + ( pow(denominatorError,2) * pow(numeratorCont,2) / pow(denominatorCont,4) ) ) );
528  }
529  }
530  else {
531  for (int k=1; k <= nbinsz; k++) {
532  numeratorCont = hNumerator->GetBinContent(i,j,k);
533  numeratorError = hNumerator->GetBinError(i,j,k);
534  if(denominatorCont != 0){
535  hResult->SetBinContent(i,j,k,numeratorCont/denominatorCont);
536  hResult->SetBinError(i,j,k,sqrt( ( pow(numeratorError,2)/pow(denominatorCont,2) )
537  + ( pow(denominatorError,2) * pow(numeratorCont,2) / pow(denominatorCont,4) ) ) );
538  }
539  }
540  }
541  }
542  }
543  }
544  else {
545  //Handle division for case where the numerator has lower dimension than the denominator
546  //There are only a few possibilities, hNdimension = 1 or 2, hDdimension = 2 or 3.
547 
548  const TAxis* xax = hDenominator->GetXaxis();
549  int nbinsx = xax->GetNbins();
550  const TAxis* yax = hDenominator->GetYaxis();
551  int nbinsy = yax->GetNbins();
552  const TAxis* zax = hDenominator->GetZaxis();
553  int nbinsz = zax->GetNbins();
554 
555  if( nbinsx != hNumerator->GetNbinsX() ) {
556  throw dqm_core::BadConfig( ERS_HERE, "number of bins in x-axis", "do not match");
557  }
558  if( (hNdimension == 2) && (nbinsy != hNumerator->GetNbinsY()) ) {
559  throw dqm_core::BadConfig( ERS_HERE, "number of bins in y-axis", "do not match");
560  }
561 
562  double denominatorCont = 0;
563  double numeratorCont = 0;
564  double denominatorError = 0;
565  double numeratorError = 0;
566 
567  if(hDdimension == 2) {
568  hResult = BookHistogramByExample(hDenominator,"hQuotient","Result of Division of One Histogram By Another",XYAxes);
569  }
570  else if(hDdimension == 3) {
571  hResult = BookHistogramByExample(hDenominator,"hQuotient","Result of Division of One Histogram By Another",XYZAxes);
572  }
573  else {
574  throw dqm_core::BadConfig( ERS_HERE, "DivideByHistogram", "Histograms with dimension greater than 3 are not supported");
575  }
576 
577  // Always loop so at to handle over/underflows too
578  for (int i=1; i <= nbinsx; i++) {
579  if( hNdimension == 1){
580  numeratorCont = hNumerator->GetBinContent(i);
581  numeratorError = hNumerator->GetBinError(i);
582  }
583  for (int j=1; j <= nbinsy; j++) {
584  if( hNdimension == 2){
585  numeratorCont = hNumerator->GetBinContent(i,j);
586  numeratorError = hNumerator->GetBinError(i,j);
587  }
588  if( hDdimension == 2){
589  denominatorCont = hDenominator->GetBinContent(i,j);
590  denominatorError = hDenominator->GetBinError(i,j);
591  if(denominatorCont != 0){
592  hResult->SetBinContent(i,j,numeratorCont/denominatorCont);
593  hResult->SetBinError(i,j,sqrt( ( pow(numeratorError,2)/pow(denominatorCont,2) )
594  + ( pow(denominatorError,2) * pow(numeratorCont,2) / pow(denominatorCont,4) ) ) );
595  }
596  }
597  else {
598  for (int k=1; k <= nbinsz; k++) {
599  denominatorCont = hDenominator->GetBinContent(i,j,k);
600  denominatorError = hDenominator->GetBinError(i,j,k);
601  if(denominatorCont != 0){
602  hResult->SetBinContent(i,j,k,numeratorCont/denominatorCont);
603  hResult->SetBinError(i,j,sqrt( ( pow(numeratorError,2)/pow(denominatorCont,2) )
604  + ( pow(denominatorError,2) * pow(numeratorCont,2) / pow(denominatorCont,4) ) ) );
605  }
606  }
607  }
608  }
609  }
610  }
611  return hResult;
612 }
613 
614 std::string
615 dqm_algorithms::tools::ExtractAlgorithmName(const dqm_core::AlgorithmConfig& config)
616 {
617  // Function to extract the name of an auxiliary algorithm specified through an algorithm configuration parameter
618  // Uses syntax AuxAlgName::[Algorithm Name] = [value], where value is ignored.
619 
620  std::string algNameTag = "AuxAlgName--";
621  std::string algName = "None";
622 
623  if (config.getParameters().empty()){
624  throw dqm_core::BadConfig( ERS_HERE, "ExtractAlgorithmName","called with an empty config file");
625  }
626 
627  std::map<std::string,double > confParams = config.getParameters();//Copy is necessary as AlgorithmConfig does not return map by reference (bug?)
628  for ( std::map<std::string,double >::const_iterator itr = confParams.begin();itr != confParams.end();++itr ) {
629  size_t stringPos;
630  if ( (stringPos = itr->first.find(algNameTag)) != std::string::npos ){
631  stringPos += algNameTag.length();
632  algName = itr->first.substr(stringPos);
633  }
634  }
635 
636  return algName;
637 }
638 
640 dqm_algorithms::tools::ExecuteNamedAlgorithm(const std::string & name, const TObject & object, const dqm_core::AlgorithmConfig & config)
641 {
642  // Function to find and execute the named algorithm
643  dqm_core::Algorithm* algorithm = 0;
644 
645  if (name.compare("None") == 0 ) {
646  throw dqm_core::BadConfig( ERS_HERE,"no auxiliary algorithm specified", name);
647  }
648 
649  try {
651  }
652  catch( dqm_core::Exception& ex ) {
653  throw dqm_core::BadConfig( ERS_HERE,"unable to get algorithm of this name", name);
654  }
655 
656  return algorithm->execute(name,object,config);
657 }
658 
659 
660 void
661 dqm_algorithms::tools::ModifyHistogram(TH1 * histogram, const dqm_core::AlgorithmConfig & config)
662 {
663  if (config.getParameters().empty()){
664  //Nothing to do
665  return;
666  }
667  std::map<std::string,double > confParams = config.getParameters();//Copy is necessary as AlgorithmConfig does not return map by reference (bug?)
668  for ( std::map<std::string,double >::const_iterator itr = confParams.begin();itr != confParams.end();++itr ) {
669  if ( itr->first.find("MultiplyHistogramByValue") != std::string::npos ){
670  histogram->Scale(itr->second);
671  continue;
672  }
673  if ( itr->first.find("DivideHistogramByValue") != std::string::npos ){
674  histogram->Scale( (1./itr->second) );
675  continue;
676  }
677  size_t stringPos;
678  std::string configTag = "SetHistogramTitle";
679  if ( (stringPos = itr->first.find(configTag)) != std::string::npos ){
680  stringPos += configTag.length();
681  histogram->SetTitle( (itr->first.substr(stringPos)).c_str() );
682  continue;
683  }
684  }
685 }
686 
687 TH1*
688 dqm_algorithms::tools::BookHistogramByExample(const TH1* histogram, const std::string& name, const std::string& title, AxisType axisType){
689 
690  switch (axisType) {
691  case XYAxes:
692 
693  if (histogram->GetDimension() == 1){
694  throw dqm_core::BadConfig( ERS_HERE, name,"can't make a 2D histogram from a 1D histogram");
695  }
696  TH2F * resultXY;
697  if(histogram->GetXaxis()->IsVariableBinSize()) {
698  resultXY = new TH2F(name.c_str(),title.c_str(),
699  histogram->GetNbinsX(),histogram->GetXaxis()->GetXbins()->GetArray(),
700  histogram->GetNbinsY(),histogram->GetYaxis()->GetXbins()->GetArray());
701  }
702  else {
703  resultXY = new TH2F(name.c_str(),title.c_str(),
704  histogram->GetNbinsX(),histogram->GetXaxis()->GetXmin(),histogram->GetXaxis()->GetXmax(),
705  histogram->GetNbinsY(),histogram->GetYaxis()->GetXmin(),histogram->GetYaxis()->GetXmax());
706  }
707 
708  resultXY->SetXTitle(histogram->GetXaxis()->GetTitle());
709  resultXY->SetYTitle(histogram->GetYaxis()->GetTitle());
710  return (TH1*) resultXY;
711 
712  case YAxis:
713 
714  if (histogram->GetDimension() == 1){
715  throw dqm_core::BadConfig( ERS_HERE, name, "can't extract a Y-Axis from a 1D histogram");
716  }
717  TH1F *resultY;
718  if(histogram->GetYaxis()->IsVariableBinSize()) {
719  resultY = new TH1F(name.c_str(),title.c_str(),
720  histogram->GetNbinsY(),histogram->GetYaxis()->GetXbins()->GetArray());
721  }
722  else {
723  resultY = new TH1F(name.c_str(),title.c_str(),
724  histogram->GetNbinsY(),histogram->GetYaxis()->GetXmin(),histogram->GetYaxis()->GetXmax());
725  }
726  resultY->SetXTitle(histogram->GetYaxis()->GetTitle());
727  return (TH1*) resultY;
728 
729  case XYZAxes:
730 
731  if (histogram->GetDimension() < 3){
732  throw dqm_core::BadConfig( ERS_HERE, name, "can't make a 3D histrogram without at least a 3D histogram");
733  }
734  TH3F *resultXYZ;
735  if(histogram->GetXaxis()->IsVariableBinSize()) {
736  resultXYZ = new TH3F(name.c_str(),title.c_str(),
737  histogram->GetNbinsX(),histogram->GetXaxis()->GetXbins()->GetArray(),
738  histogram->GetNbinsY(),histogram->GetYaxis()->GetXbins()->GetArray(),
739  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXbins()->GetArray());
740  }
741  else {
742  resultXYZ = new TH3F(name.c_str(),title.c_str(),
743  histogram->GetNbinsX(),histogram->GetXaxis()->GetXmin(),histogram->GetXaxis()->GetXmax(),
744  histogram->GetNbinsY(),histogram->GetYaxis()->GetXmin(),histogram->GetYaxis()->GetXmax(),
745  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXmin(),histogram->GetZaxis()->GetXmax());
746  }
747  resultXYZ->SetXTitle(histogram->GetXaxis()->GetTitle());
748  resultXYZ->SetYTitle(histogram->GetYaxis()->GetTitle());
749  resultXYZ->SetZTitle(histogram->GetZaxis()->GetTitle());
750  return resultXYZ;
751 
752  case XZAxes:
753 
754  if (histogram->GetDimension() < 3){
755  throw dqm_core::BadConfig( ERS_HERE, name,"can't extract a Z-Axis from a dimension < 3 histogram");
756  }
757  TH2F * resultXZ;
758  if(histogram->GetXaxis()->IsVariableBinSize()) {
759  resultXZ = new TH2F(name.c_str(),title.c_str(),
760  histogram->GetNbinsX(),histogram->GetXaxis()->GetXbins()->GetArray(),
761  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXbins()->GetArray());
762  }
763  else {
764  resultXZ = new TH2F(name.c_str(),title.c_str(),
765  histogram->GetNbinsX(),histogram->GetXaxis()->GetXmin(),histogram->GetXaxis()->GetXmax(),
766  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXmin(),histogram->GetZaxis()->GetXmax());
767  }
768  resultXZ->SetXTitle(histogram->GetXaxis()->GetTitle());
769  resultXZ->SetYTitle(histogram->GetZaxis()->GetTitle());
770  return (TH1*) resultXZ;
771 
772  case YZAxes:
773 
774  if (histogram->GetDimension() < 3){
775  throw dqm_core::BadConfig( ERS_HERE, name,"can't extract a Z-Axis from a dimension < 3 histogram");
776  }
777  TH2F * resultYZ;
778  if(histogram->GetYaxis()->IsVariableBinSize()) {
779  resultYZ = new TH2F(name.c_str(),title.c_str(),
780  histogram->GetNbinsY(),histogram->GetYaxis()->GetXbins()->GetArray(),
781  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXbins()->GetArray());
782  }
783  else {
784  resultYZ = new TH2F(name.c_str(),title.c_str(),
785  histogram->GetNbinsY(),histogram->GetYaxis()->GetXmin(),histogram->GetYaxis()->GetXmax(),
786  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXmin(),histogram->GetZaxis()->GetXmax());
787  }
788  resultYZ->SetXTitle(histogram->GetYaxis()->GetTitle());
789  resultYZ->SetYTitle(histogram->GetZaxis()->GetTitle());
790  return (TH1*) resultYZ;
791 
792  case ZAxis:
793 
794  if (histogram->GetDimension() < 3){
795  throw dqm_core::BadConfig( ERS_HERE, name, "can't extract a Z-Axis from a dimension < 3 histogram");
796  }
797  TH1F *resultZ;
798  if(histogram->GetZaxis()->IsVariableBinSize()) {
799  resultZ = new TH1F(name.c_str(),title.c_str(),
800  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXbins()->GetArray());
801  }
802  else {
803  resultZ = new TH1F(name.c_str(),title.c_str(),
804  histogram->GetNbinsZ(),histogram->GetZaxis()->GetXmin(),histogram->GetZaxis()->GetXmax());
805  }
806  resultZ->SetXTitle(histogram->GetZaxis()->GetTitle());
807  return (TH1*) resultZ;
808 
809  case XAxis:
810  default:
811 
812  TH1F *resultX;
813  if(histogram->GetXaxis()->IsVariableBinSize()) {
814  resultX = new TH1F(name.c_str(),title.c_str(),
815  histogram->GetNbinsX(),histogram->GetXaxis()->GetXbins()->GetArray());
816  }
817  else {
818  resultX = new TH1F(name.c_str(),title.c_str(),
819  histogram->GetNbinsX(),histogram->GetXaxis()->GetXmin(),histogram->GetXaxis()->GetXmax());
820  }
821  resultX->SetXTitle(histogram->GetXaxis()->GetTitle());
822  return (TH1*) resultX ;
823  }
824 
825 }
826 
827 void
829  const TObject*& firstReference ,
830  TObject*& secondReference )
831 {
832  if ( ro.InheritsFrom("TH1") )
833  {
834  //Simple reference
835  firstReference = &ro;
836  secondReference = 0;
837  return;
838  }
839  else if ( ro.InheritsFrom("TCollection") )
840  {
841  //The reference is a collection of TObjects
842  const TCollection* coll = static_cast<const TCollection*>(&ro);
843  TIterator* it = coll->MakeIterator();
844  TObject* content = it->Next();
845  if ( content == 0 || content->InheritsFrom("TH1") == kFALSE )
846  {
847  throw dqm_core::BadRefHist(ERS_HERE,"handleReference"," Could not retreive reference");
848  }
849  firstReference = static_cast<TH1 *>(content);
850  Int_t csize = coll->GetEntries();
851  if ( csize == 1 )
852  {
853  //Only one element, no secondReference is available.
854  secondReference = 0;
855  return;
856  }
857  else if ( coll->GetEntries() == 2 )
858  {
859  //The collection is a pair, the second reference will be used directly
860  secondReference = it->Next();
861  return;
862  }
863  else
864  {
865  //This case is more complex, we basically want to create a new collection without the first element
866  secondReference = static_cast<TObject*>( (coll->IsA())->New() );//Create a new container of the same class as the original one
867  if ( secondReference == 0 || secondReference->InheritsFrom("TCollection") == kFALSE )
868  {
869  throw dqm_core::BadRefHist(ERS_HERE,"handleReference"," Could not retreive reference");
870  }
871  while ( (content = it->Next()) )//start from second element, since we already called Next()
872  {
873  static_cast<TCollection*>(secondReference)->Add(content);
874  }
875  return;
876  }
877  }
878  else
879  {
880  //This kind of reference is not supported
881  throw dqm_core::BadRefHist(ERS_HERE,"handleReference"," Could not retreive reference");
882  }
883 }
884 
885 
886 
887 void
888 dqm_algorithms::tools::findOutliers( std::vector<binContainer>& input, double& mean, double& scale, int& nIn,
889  int nIterations, double exponent, double threshold, double SBCF, double nStop) {
890 
891  int size = input.size();
892  if(size < 2) {
893  return;
894  }
895 
896  if (nStop < 0) nStop = 0;
897  if (SBCF < 0) SBCF = 0;
898 
899  std::vector<binContainer>::const_iterator cbegin = input.begin();
900  std::vector<binContainer>::const_iterator cend = input.end();
901 
904 
905  nIn = 0;
906  mean = 0;
907  scale = 0;
908 
909  double newMean = 0;
910  double newScale = 0;
911  for ( int j = 0; j < nIterations ; j++ ) {
912  mean = newMean;
913  scale = newScale;
914 
915  int newNin = 0;
916  double sum = 0;
917  //Loop to test, counting and summing elements that pass:
919  //The Test:
920  it->test = ( (fabs(it->value - mean) < (threshold * scale) ) || (j==0) );
921  if ( it->test ) {
922  sum += it->value;
923  newNin++;
924  }
925  }
926  int nOut = size - newNin;
927  // Check if the iteration process is complete (or failed):
928  if (newNin < (2 + nStop + SBCF * nOut) ) {
929  return;
930  }
931  newMean = newNin ? (sum / newNin) : 0; // avoid to divide by zero (should never happen)
932  // Check if the iteration process has stabilized:
933  if ( (newNin == nIn) && (newMean == mean) ) {
934  return;
935  }
936  nIn = newNin;
937 
938  // Calculate the scale parameter:
939  double scaleSum = 0;
940  for ( std::vector<binContainer>::const_iterator it = cbegin; it != cend; ++it ) {
941  if(it->test) {
942  scaleSum += pow( fabs(it->value - newMean) , exponent );
943  }
944  }
945  newScale = pow( scaleSum / (nIn - 1 - (SBCF * nOut) ), 1/exponent);
946  }
947  return;
948 }
949 
950 void
951 dqm_algorithms::tools::findOutliersUsingErrors( std::vector<binContainer>& input, double& mean, double& meanError, int& nIn, double minDiff, int minNin ) {
952 
953 
954  //Perform outlier determination using the bin errors and the relative pull on the mean,
955  // Taken from algorithm by Michele Petteni
956 
957  if( minDiff < 0 ) minDiff = 0;
958  if( minNin < 2) minNin = 3;
959 
960  nIn = input.size();
961  if(nIn < minNin) {
962  return;
963  }
964  meanError = 0;
965 
966 
969 
970  //First pass: calucalate the mean:
971  double sum = 0;
972  double sumError2 = 0;
974  sum += it->value;
975  sumError2 += pow(it->error,2);
976  it->test = true;
977  }
978  mean = sum / nIn;
979  meanError = sqrt( sumError2/ nIn );
980  //Loop to tag and remove outliers:
981  while( nIn > 2 ) {
982 
983  //Use map for ordering by distance from mean:
984  std::map<double,binContainer*> absDiffMap;
986  if( it->test ) {
987  absDiffMap[ fabs( it->value - mean ) ] = &(*it);
988  }
989  }
990 
991  //If max(absDiff) < minDiff, this is not considered an outlier: we are done.
992  std::map<double,binContainer*>::iterator outlierCandidate = absDiffMap.end();
993  --outlierCandidate;//<- the last element in a map is the largest.
994  if( outlierCandidate->first < minDiff ) {
995  return;
996  }
997 
998  //Find the mean and its error if we exclude the outlier candidate:
999  double newMean = 0;
1000  double newMeanError = 0;
1001  sum = 0;
1002  for( std::map<double,binContainer*>::iterator it = absDiffMap.begin(); it != outlierCandidate; ++it) {
1003  sum += it->second->value;
1004  sumError2 += pow(it->second->error,2);
1005  }
1006  newMean = sum/(nIn - 1);
1007  newMeanError = sqrt( sumError2/(nIn - 2) );
1008 
1009  double meanShift = fabs( mean - newMean );
1010 
1011  //If the shift is bigger than the new error the candidate is an outlier: mark it and move on to the next one.
1012  if( meanShift > newMeanError ) {
1013  outlierCandidate->second->test = false;
1014  mean = newMean;
1015  meanError = newMeanError;
1016  nIn--;
1017  }
1018  else {
1019  return;
1020  }
1021  }
1022 }
1023 
1025 dqm_algorithms::tools::buildCluster( binContainer& seed, const std::vector<std::vector<binContainer*> >& binMap,
1026  const std::vector<double>& xValues, const std::vector<double>& yValues, double threshold, int topology ) {
1027 
1028  binCluster cluster = {0.,0.,xValues[seed.ix],yValues[seed.iy],-1.,0,seed.ix,seed.ix,seed.iy,seed.iy};
1029  std::list<binContainer*> binsToCheck;
1030  std::vector<binContainer*> binsInCluster;
1031  binsToCheck.push_back(&seed);
1032  double pvpX = 0;
1033  double pvpY = 0;
1034  double error2 = 0;
1035 
1036  double maxDistanceX = -1;
1037  double maxDistanceY = -1;
1038  int ixRangeMax = (int)xValues.size() - 2;
1039  int iyRangeMax = (int)yValues.size() - 2;
1040 
1041  switch(topology) {
1042  case CylinderX:
1043  maxDistanceY = (yValues.back() - yValues.front()) / 2;
1044  break;
1045  case CylinderY:
1046  maxDistanceX = (xValues.back() - xValues.front()) / 2;
1047  break;
1048  case Torus:
1049  maxDistanceX = (xValues.back() - xValues.front()) / 2;
1050  maxDistanceY = (yValues.back() - yValues.front()) / 2;
1051  break;
1052  }
1053 
1054  while( binsToCheck.size() != 0) {
1055 
1056  std::list<binContainer*> newNeighbors;
1057  for( std::list<binContainer*>::const_iterator bin = binsToCheck.begin(); bin != binsToCheck.end(); ++bin ) {
1058 
1059  //If bin is a null pointer, continue to the next bin:
1060  if( *bin == 0) {
1061  continue;
1062  }
1063 
1064  //If the bin passes the threshold, add its values to the clusters and its neighbors to the list of bins to look at:
1065  //(As long as it hasn't already been added to another cluster or otherwise excluded)
1066  if( ( fabs((*bin)->value) > (threshold + 5*(*bin)->error ) ) && ( (*bin)->test == 0 ) && ((*bin)->error >= 0) ) {
1067  //Add bin to cluster:
1068  binsInCluster.push_back(*bin);
1069  (*bin)->test = 10;
1070 
1071  cluster.value += (*bin)->value;
1072  error2 += pow( (*bin)->error, 2);
1073  cluster.n++;
1074 
1075  int ix = (*bin)->ix;
1076  int iy = (*bin)->iy;
1077  double xPosition = xValues[ix];
1078  double yPosition = yValues[iy];
1079 
1080  //Adjust position information if it looks like we may have jumped a discontinuity
1081  // and such discontinuities are expected. Also check for max, min ix, iy:
1082  if( (maxDistanceX > 0) && (fabs(xPosition - cluster.x) > maxDistanceX) ) {
1083  //Correct for topological mapping difficulties:
1084  if( xPosition < maxDistanceX ) {
1085  xPosition += 2 * maxDistanceX;
1086  if( (ix + ixRangeMax) > cluster.ixmax ) {
1087  cluster.ixmax = ix + ixRangeMax;
1088  }
1089  }
1090  else {
1091  xPosition -= 2 * maxDistanceX;
1092  if( (ix - ixRangeMax) < cluster.ixmin ) {
1093  cluster.ixmin = ix - ixRangeMax;
1094  }
1095  }
1096  }
1097  else {
1098  //No topological difficulties:
1099  if( ix < cluster.ixmin ) {
1100  cluster.ixmin = ix;
1101  }
1102  if( ix > cluster.ixmax ) {
1103  cluster.ixmax = ix;
1104  }
1105  }
1106 
1107  if( (maxDistanceY > 0) && (fabs(yPosition - cluster.y) > maxDistanceY) ) {
1108  //Correct for topological mapping difficulties:
1109  if( yPosition < maxDistanceY ) {
1110  yPosition += 2 * maxDistanceY;
1111  if( (iy + iyRangeMax) > cluster.iymax ) {
1112  cluster.iymax = iy + iyRangeMax;
1113  }
1114  }
1115  else {
1116  yPosition -= 2 * maxDistanceY;
1117  if( (iy - iyRangeMax) < cluster.iymin ) {
1118  cluster.iymin = iy - iyRangeMax;
1119  }
1120  }
1121  }
1122  else {
1123  //No topological difficulties:
1124  if( iy < cluster.iymin ) {
1125  cluster.iymin = iy;
1126  }
1127  if( iy > cluster.iymax ) {
1128  cluster.iymax = iy;
1129  }
1130  }
1131 
1132  pvpX += xPosition * (*bin)->value;
1133  pvpY += yPosition * (*bin)->value;
1134 
1135 
1136  //Find neighbors
1137  newNeighbors.push_back( binMap[ix+1][iy+1] );
1138  newNeighbors.push_back( binMap[ix+1][iy] );
1139  newNeighbors.push_back( binMap[ix+1][iy-1] );
1140 
1141  newNeighbors.push_back( binMap[ix][iy+1] );
1142  newNeighbors.push_back( binMap[ix][iy-1] );
1143 
1144  newNeighbors.push_back( binMap[ix-1][iy+1] );
1145  newNeighbors.push_back( binMap[ix-1][iy] );
1146  newNeighbors.push_back( binMap[ix-1][iy-1] );
1147 
1148 
1149  }
1150  }//End looping over binsToCheck (last set of neighbors)
1151 
1152  //Remove repeated references to the same bin:
1153  newNeighbors.unique();
1154  //Perpare to check the cluster's new neighbors:
1155  binsToCheck = newNeighbors;
1156 
1157  cluster.x = pvpX / cluster.value;
1158  cluster.y = pvpY / cluster.value;
1159  }//Finished finding bins in cluster
1160 
1161  //Assume that the input errors are uncorrelated (or that the caller will deal with this)
1162  cluster.error = sqrt( error2 );
1163 
1164  //loop to calculate the radius of the cluster (the value weighted average distance from its center)
1165  double dvpSum = 0;
1166  for(std::vector<binContainer*>::const_iterator bin = binsInCluster.begin(); bin != binsInCluster.end(); ++bin) {
1167  double xDistance = fabs( xValues[(*bin)->ix] - cluster.x );
1168  double yDistance = fabs( yValues[(*bin)->iy] - cluster.y );
1169  if (maxDistanceX > 0 && (xDistance > maxDistanceX) ) {
1170  xDistance = 2 * maxDistanceX - xDistance;
1171  }
1172  if (maxDistanceY > 0 && (yDistance > maxDistanceY) ) {
1173  yDistance = 2 * maxDistanceY - yDistance;
1174  }
1175 
1176  dvpSum += (*bin)->value * sqrt( pow( xValues[(*bin)->ix] - cluster.x,2) + pow(yValues[(*bin)->iy] - cluster.y,2) );
1177  }
1178  cluster.radius = dvpSum / cluster.value;
1179 
1180  //Check that positions are within the bounds of the histogram and correct
1181  while( cluster.ixmin < 1 ){
1182  cluster.ixmin += ixRangeMax;
1183  }
1184  while( cluster.ixmax > ixRangeMax ){
1185  cluster.ixmax -= ixRangeMax;
1186  }
1187  while( cluster.iymin < 1 ){
1188  cluster.iymin += iyRangeMax;
1189  }
1190  while( cluster.iymax > iyRangeMax ){
1191  cluster.iymax -= iyRangeMax;
1192  }
1193 
1194  if( cluster.x < xValues.front() ) {
1195  cluster.x += 2 * maxDistanceX;
1196  }
1197  if( cluster.x > xValues.back() ) {
1198  cluster.x -= 2 * maxDistanceX;
1199  }
1200  if( cluster.y < yValues.front() ) {
1201  cluster.y += 2 * maxDistanceY;
1202  }
1203  if( cluster.y > yValues.back() ) {
1204  cluster.y -= 2 * maxDistanceY;
1205  }
1206 
1207 
1208  return cluster;
1209 }
1210 
1211 
1212 //Method to map bins in binContainer based on binContainer::ix, binContainer::iy, and chosen topology
1213 std::vector<std::vector<dqm_algorithms::tools::binContainer*> >
1214 dqm_algorithms::tools::makeBinMap(std::vector<dqm_algorithms::tools::binContainer>& bins, int ixmax, int iymax, int topology) {
1215 
1216  std::vector<binContainer*> emptyVector;
1217  for(int iy = 0; iy <= iymax + 1; ++iy) {
1218  binContainer* emptyPointer = 0;
1219  emptyVector.push_back(emptyPointer);
1220  }
1221  std::vector<std::vector<binContainer*> > binMap;
1222  for(int ix = 0; ix <= ixmax + 1; ++ix) {
1223  binMap.push_back(emptyVector);
1224  }
1225  switch(topology) {
1226  //The mapping depends on the topology of the histogram.
1227  case CylinderX:
1228  //Cylinder About X-Axis (default topology), wraps max Y to min Y.
1229  //Connect iy == 1 with iy == iymax while leaving hard (null pointer) walls at ix = 0 and ix = imax+1:
1230  for (std::vector<binContainer>::iterator it = bins.begin(); it != bins.end(); ++it) {
1231  binMap[it->ix][it->iy] = &(*it);
1232  if(it->iy == 1){
1233  binMap[it->ix][iymax+1] = &(*it);
1234  }
1235  else if(it->iy == iymax){
1236  binMap[it->ix][0] = &(*it);
1237  }
1238  }
1239  break;
1240 
1241  case CylinderY:
1242  //Cylinder About Y-Axis
1243  //Connect ix == 1 with ix == ixmax while leaving hard (null pointer) walls at iy = 0 and iy = imax+1:
1244  for (std::vector<binContainer>::iterator it = bins.begin(); it != bins.end(); ++it) {
1245  binMap[it->ix][it->iy] = &(*it);
1246  if(it->ix == 1){
1247  binMap[ixmax+1][it->iy] = &(*it);
1248  }
1249  else if(it->ix == ixmax){
1250  binMap[0][it->iy] = &(*it);
1251  }
1252  }
1253  break;
1254 
1255  case Torus:
1256  //Torus:
1257  //Connect iy == 1 with iy == iymax and ix == 1 with ix == ixmax
1258  for (std::vector<binContainer>::iterator it = bins.begin(); it != bins.end(); ++it) {
1259  binMap[it->ix][it->iy] = &(*it);
1260  if(it->ix == 1){
1261  binMap[ixmax+1][it->iy] = &(*it);
1262  if(it->iy == 1){
1263  binMap[ixmax+1][iymax+1] = &(*it);
1264  }
1265  if(it->iy == iymax){
1266  binMap[ixmax+1][0] = &(*it);
1267  }
1268  }
1269  else if(it->ix == ixmax){
1270  binMap[0][it->iy] = &(*it);
1271  if(it->iy == 1){
1272  binMap[0][iymax+1] = &(*it);
1273  }
1274  if(it->iy == iymax){
1275  binMap[0][0] = &(*it);
1276  }
1277  }
1278  if(it->iy == 1){
1279  binMap[it->ix][iymax+1] = &(*it);
1280  }
1281  else if(it->iy == iymax){
1282  binMap[it->ix][0] = &(*it);
1283  }
1284  }
1285  break;
1286 
1287  default:
1288  //Rectangle:
1289  //Treat the histogram as a simple rectangle, leaving null pointers at its boundaries:
1290  for (std::vector<binContainer>::iterator it = bins.begin(); it != bins.end(); ++it) {
1291  binMap[it->ix][it->iy] = &(*it);
1292  }
1293  }
1294  return binMap;
1295 }
1296 
1297 //An attempt to generalize the status combination process with the use of weights:
1298 //Worst Case:
1301  //-- Acts analogously to a logical OR -- (Red <-> True, etc.)
1302 
1303  if(baseStatus == dqm_core::Result::Red) {
1304  return dqm_core::Result::Red;
1305  }
1306  //apply the "weight" to addedstatus only:
1307  if( weight <= 0 ) {
1308  return baseStatus;
1309  }
1310 
1311  if( weight <= 0.25 ) {
1312  if( addedStatus == dqm_core::Result::Yellow ) {
1313  addedStatus = dqm_core::Result::Green;
1314  }
1315  }
1316  if( weight <= 0.5 ) {
1317  if( addedStatus == dqm_core::Result::Red) {
1318  addedStatus = dqm_core::Result::Yellow;
1319  }
1320  }
1321 
1322  if(addedStatus == dqm_core::Result::Red) {
1323  return dqm_core::Result::Red;
1324  }
1325 
1326  if(baseStatus == dqm_core::Result::Disabled) {
1327  return addedStatus;
1328  }
1329  if(addedStatus == dqm_core::Result::Disabled) {
1330  return baseStatus;
1331  }
1332  if(baseStatus == dqm_core::Result::Undefined) {
1333  return addedStatus;
1334  }
1335  if(addedStatus == dqm_core::Result::Undefined) {
1336  return baseStatus;
1337  }
1338 
1339  if( (baseStatus == dqm_core::Result::Green) && (addedStatus == dqm_core::Result::Green) ) {
1340  return dqm_core::Result::Green;
1341  }
1342 
1343  return dqm_core::Result::Yellow;
1344 }
1345 //Best Case:
1348  //-- Acts analogously to a logical AND -- (Red <-> True, etc.)
1349 
1350  //apply the "weight" to addedstatus only: (same scheme as in WorstCaseAddStatus)
1351  if( weight <= 0 ) {
1352  return baseStatus;
1353  }
1354  if( weight <= 0.25 ) {
1355  if( addedStatus == dqm_core::Result::Yellow ) {
1356  addedStatus = dqm_core::Result::Green;
1357  }
1358  }
1359  if( weight <= 0.5 ) {
1360  if( addedStatus == dqm_core::Result::Red) {
1361  addedStatus = dqm_core::Result::Yellow;
1362  }
1363  }
1364 
1365  if( (baseStatus == dqm_core::Result::Disabled) || (addedStatus == dqm_core::Result::Disabled) ) {
1366  return dqm_core::Result::Disabled;
1367  }
1368 
1369  if( (baseStatus == dqm_core::Result::Undefined) || (addedStatus == dqm_core::Result::Undefined) ) {
1371  }
1372 
1373  if( (baseStatus == dqm_core::Result::Green) || (addedStatus == dqm_core::Result::Green) ) {
1374  return dqm_core::Result::Green;
1375  }
1376 
1377  if( (baseStatus == dqm_core::Result::Red) && (addedStatus == dqm_core::Result::Red) ) {
1378  return dqm_core::Result::Red;
1379  }
1380 
1381  return dqm_core::Result::Yellow;
1382 
1383 }
1384 
1385 
1386 std::pair<double,double>
1387 dqm_algorithms::tools::CalcBinsProbChisq(const std::vector<double>& inputval,const std::vector<double>& inputerr,const std::vector<double>& x0,const std::vector<double>& x0err){
1388 
1389  double chisq = 0.;
1390  std::vector<double>::const_iterator iter_vals = inputval.begin();
1391  std::vector<double>::const_iterator iter_err = inputerr.begin();
1392 
1393  std::vector<double>::const_iterator iter_x0 = x0.begin();
1394  std::vector<double>::const_iterator iter_x0err = x0err.begin();
1395 
1396  int ndf = 0;
1397  for ( ; iter_vals != inputval.end(); ++iter_vals,++iter_err,++iter_x0,++iter_x0err){
1398  if (fabs(*iter_err) > 1.0e-5 || fabs(*iter_x0err) > 1.0e-5){
1399  double chisq_cont = pow(((*iter_vals)-(*iter_x0)),2.)/(pow(*iter_err,2.0)+pow(*iter_x0err,2.0));
1400  ++ndf;
1401  chisq += chisq_cont;
1402  }
1403  }
1404 
1405  double prob = ROOT::Math::chisquared_cdf_c(chisq,ndf);
1406  double sigma_chisq = ROOT::Math::normal_quantile_c(prob,1.);
1407  return std::make_pair(prob,sigma_chisq);
1408 }
1409 
1410 std::pair<double,double>
1411 dqm_algorithms::tools::CalcBinsProbChisq(const std::vector<double>& inputval,const std::vector<double>& inputerr,double x0,double x0_err){
1412 
1413  double chisq = 0.;
1414  std::vector<double>::const_iterator iter_vals = inputval.begin();
1415  std::vector<double>::const_iterator iter_err = inputerr.begin();
1416  int ndf = 0;
1417  for ( ; iter_vals != inputval.end(); ++iter_vals,++iter_err){
1418  if (fabs(*iter_err) > 1.0e-5){
1419  double chisq_cont = pow(((*iter_vals)-x0),2.)/(pow(*iter_err,2.0)+pow(x0_err,2.0));
1420  ++ndf;
1421  chisq += chisq_cont;
1422  }
1423  }
1424 
1425  double prob = ROOT::Math::chisquared_cdf_c(chisq,ndf);
1426  double sigma_chisq = ROOT::Math::normal_quantile_c(prob,1.);
1427  return std::make_pair(prob,sigma_chisq);
1428 }
1429 
1430 void
1431 dqm_algorithms::tools::MergePastMinStat(std::vector<std::vector<tools::binContainer> >& strips, int minStat) {
1432  //Method to merge neighboring vectors so that all non-empty vectors have a size of at least minStat
1433  //If two vectors are equally close to the vector with size < minstat, it will be merged with the one
1434  //with the smallest size.
1435 
1436  if(strips.size() < 2) {
1437  return;
1438  }
1439 
1440  std::vector<std::vector<tools::binContainer> >::iterator begining = strips.begin();
1441  std::vector<std::vector<tools::binContainer> >::iterator ending = strips.end();
1442  --ending;
1443 
1444  while ( begining != ending ) {
1445  std::vector<std::vector<tools::binContainer> >::iterator minBinsItr = begining;
1446  for( std::vector<std::vector<tools::binContainer> >::iterator itr = begining; itr != (ending+1); ++itr ) {
1447  if( (!itr->empty()) && ((itr->size() < minBinsItr->size()) || minBinsItr->empty()) ) {
1448  minBinsItr = itr;
1449  }
1450  }
1451 
1452  if( ((int)minBinsItr->size()) < minStat ) {
1453  if( minBinsItr == begining ) {
1454  //Merge right
1455  std::vector<std::vector<tools::binContainer> >::iterator mergeStripItr = minBinsItr;
1456  ++mergeStripItr;
1457  while( mergeStripItr->empty() ) {
1458  ++mergeStripItr;
1459  if( mergeStripItr == ending ) break;
1460  }
1461  mergeStripItr->insert( mergeStripItr->end(), minBinsItr->begin(), minBinsItr->end() );
1462  minBinsItr->clear();
1463  begining = mergeStripItr;
1464  }
1465  else if( minBinsItr == ending ) {
1466  //Merge left
1467  std::vector<std::vector<tools::binContainer> >::iterator mergeStripItr = minBinsItr;
1468  --mergeStripItr;
1469  while( mergeStripItr->empty() ) {
1470  --mergeStripItr;
1471  if( mergeStripItr == begining ) break;
1472  }
1473  mergeStripItr->insert( mergeStripItr->end(), minBinsItr->begin(), minBinsItr->end() );
1474  minBinsItr->clear();
1475  ending = mergeStripItr;
1476  }
1477  else {
1478  //Merge with the smallest of nearest neighbors:
1479  std::vector<std::vector<tools::binContainer> >::iterator mergeLeftItr = minBinsItr;
1480  std::vector<std::vector<tools::binContainer> >::iterator mergeRightItr = minBinsItr;
1481  --mergeLeftItr;
1482  ++mergeRightItr;
1483  while( mergeLeftItr->empty() && mergeRightItr->empty() ) {
1484  --mergeLeftItr;
1485  ++mergeRightItr;
1486  }
1487  if( mergeLeftItr->empty() ) {
1488  mergeRightItr->insert( mergeRightItr->end(), minBinsItr->begin(), minBinsItr->end() );
1489  minBinsItr->clear();
1490  }
1491  else if( mergeRightItr->empty() ) {
1492  mergeLeftItr->insert( mergeLeftItr->end(), minBinsItr->begin(), minBinsItr->end() );
1493  minBinsItr->clear();
1494  }
1495  else {
1496  if( mergeLeftItr->size() < mergeRightItr->size() ) {
1497  mergeLeftItr->insert( mergeLeftItr->end(), minBinsItr->begin(), minBinsItr->end() );
1498  minBinsItr->clear();
1499  }
1500  else {
1501  mergeRightItr->insert( mergeRightItr->end(), minBinsItr->begin(), minBinsItr->end() );
1502  minBinsItr->clear();
1503  }
1504  }
1505  }
1506  }
1507  else {
1508  break;
1509  }
1510  }
1511 }
1512 
1513 void
1515  if(bin.error < 0) {
1516  return;
1517  }
1518  tag += "(eta,phi)[err]= (";
1519  FormatToSize(bin.x,6,tag,true);
1520  tag += ",";
1521  FormatToSize(bin.y,6,tag,true);
1522  tag += ")[";
1523  FormatToSize(bin.error,5,tag,false);
1524  tag += "]";
1525 }
1526 
1527 void
1528 dqm_algorithms::tools::FormatToSize( double value, int size, std::string & str, bool showSign) {
1529  //Method to append size characters representing value to string str
1530 
1531  char temp[35];
1532 
1533  if( value == 0 ) {
1534  int prec = size - 2;
1535  if(prec < 0) prec = 0;
1536  sprintf(temp,"%.*f",prec,value);
1537  str += temp;
1538  return;
1539  }
1540 
1541  std::string format;
1542  if(showSign) {
1543  format = "%+0*.*";
1544  }
1545  else {
1546  format = "%0*.*";
1547  }
1548 
1549  int order = (int) floor( log10(fabs(value)) );
1550 
1551  if( (size > 34) || (size < 1) || ((size < 5) && (order > size)) ) {
1552  size = 5;
1553  }
1554 
1555  int prec = 0;
1556  if( (value > 0) && !showSign ) {
1557  if( ( (abs(order) > (size-3)) || (order < -2) ) && (size > 4) ) {
1558  prec = size-6;
1559  if(prec < 0) prec = 0;
1560  format += "e";
1561  }
1562  else if( order == -1 ) {
1563  prec = size - 2;
1564  if(prec < 0) prec = 0;
1565  format += "f";
1566  }
1567  else {
1568  prec = size - order -2;
1569  if(prec > (size - 2) ) prec = size - 2;
1570  if(prec < 0) prec = 0;
1571  format += "f";
1572  }
1573  }
1574  else {
1575  if( ( (abs(order) > (size-3)) || (order < -2) ) && (size > 4) ) {
1576  prec = size-7;
1577  if(prec < 0) prec = 0;
1578  format += "e";
1579  }
1580  else if( order == -1 ) {
1581  prec = size - 3;
1582  if(prec < 0) prec = 0;
1583  format += "f";
1584  }
1585  else {
1586  prec = size - order -3;
1587  if(prec > (size - 3) ) prec = size - 3;
1588  if(prec < 0) prec = 0;
1589  format += "f";
1590  }
1591  }
1592 
1593  sprintf(temp,format.c_str(),size,prec,value);
1594 
1595  str += temp;
1596 }
1597 
1598 #endif // #ifndef DQM_ALGORITHMS_TOOLS_ALGORITHMHELPER_CXX
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
dqm_algorithms::tools::FormatToSize
void FormatToSize(double value, int size, std::string &str, bool showSign=true)
Definition: AlgorithmHelper.cxx:1528
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
dqm_algorithms::tools::BookHistogramByExample
TH1 * BookHistogramByExample(const TH1 *histogram, const std::string &name, const std::string &title, AxisType axisType)
Definition: AlgorithmHelper.cxx:688
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
dqm_algorithms::tools::GetBinRange
std::vector< int > GetBinRange(const TH1 *histogram, const std::map< std::string, double > &params)
Definition: AlgorithmHelper.cxx:380
dqm_algorithms::tools::binCluster::y
double y
Definition: AlgorithmHelper.h:60
ymin
double ymin
Definition: listroot.cxx:63
Undefined
@ Undefined
Definition: MaterialTypes.h:8
dqm_algorithms::tools::findOutliers
void findOutliers(std::vector< binContainer > &input, double &mean, double &scale, int &nIn, int nIterations, double exponent, double threshold, double SBCF=1., double nStop=8.)
Definition: AlgorithmHelper.cxx:888
algorithm
std::string algorithm
Definition: hcg.cxx:82
mean
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:254
get_generator_info.result
result
Definition: get_generator_info.py:21
vtune_athena.format
format
Definition: vtune_athena.py:14
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::JetAlgorithmType::algName
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
Definition: JetContainerInfo.cxx:67
dqm_algorithms::tools::makeBinMap
std::vector< std::vector< binContainer * > > makeBinMap(std::vector< dqm_algorithms::tools::binContainer > &bins, int ixmax, int iymax, int topology=CylinderX)
Definition: AlgorithmHelper.cxx:1214
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
dqm_algorithms::tools::GetFitResult
dqm_core::Result * GetFitResult(const TF1 *func, const dqm_core::AlgorithmConfig &config, double minSig=0)
Definition: AlgorithmHelper.cxx:308
dqm_algorithms::tools::CalcBinsProbChisq
std::pair< double, double > CalcBinsProbChisq(const std::vector< double > &inputval, const std::vector< double > &inputerr, double x0, double x0_err)
Definition: AlgorithmHelper.cxx:1411
dqm_algorithms::tools::Torus
@ Torus
Definition: AlgorithmHelper.h:41
dqm_algorithms::tools::XYAxes
@ XYAxes
Definition: AlgorithmHelper.h:39
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
dqm_algorithms::tools::YZAxes
@ YZAxes
Definition: AlgorithmHelper.h:39
skel.it
it
Definition: skel.GENtoEVGEN.py:396
dqm_algorithms::tools::ModifyHistogram
void ModifyHistogram(TH1 *histogram, const dqm_core::AlgorithmConfig &config)
Definition: AlgorithmHelper.cxx:661
bin
Definition: BinsDiffFromStripMedian.h:43
dqm_algorithms::tools::CylinderY
@ CylinderY
Definition: AlgorithmHelper.h:41
athena.value
value
Definition: athena.py:124
dqm_algorithms::tools::ExecuteNamedAlgorithm
dqm_core::Result * ExecuteNamedAlgorithm(const std::string &name, const TObject &object, const dqm_core::AlgorithmConfig &config)
Definition: AlgorithmHelper.cxx:640
dqm_algorithms::tools::PublishBin
void PublishBin(const TH1 *histogram, int xbin, int ybin, double content, dqm_core::Result *result)
Definition: AlgorithmHelper.cxx:426
dqm_algorithms::tools::BestCaseAddStatus
dqm_core::Result::Status BestCaseAddStatus(dqm_core::Result::Status baseStatus, dqm_core::Result::Status addedStatus, float weight=1.0)
Definition: AlgorithmHelper.cxx:1347
dqm_algorithms::tools::binCluster::error
double error
Definition: AlgorithmHelper.h:58
dqm_algorithms::tools::binCluster::iymin
int iymin
Definition: AlgorithmHelper.h:65
dqm_algorithms::tools::WorstCaseAddStatus
dqm_core::Result::Status WorstCaseAddStatus(dqm_core::Result::Status baseStatus, dqm_core::Result::Status addedStatus, float weight=1.0)
Definition: AlgorithmHelper.cxx:1300
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
covarianceTool.prob
prob
Definition: covarianceTool.py:678
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
x
#define x
dqm_algorithms::tools::binCluster::value
double value
Definition: AlgorithmHelper.h:57
dqm_algorithms::tools::ExtractAlgorithmName
std::string ExtractAlgorithmName(const dqm_core::AlgorithmConfig &config)
Definition: AlgorithmHelper.cxx:615
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
dqm_algorithms::tools::buildCluster
binCluster buildCluster(binContainer &seed, const std::vector< std::vector< binContainer * > > &binMap, const std::vector< double > &xValues, const std::vector< double > &yValues, double threhold, int topology=CylinderX)
Definition: AlgorithmHelper.cxx:1025
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
dqm_algorithms::tools::binCluster::n
int n
Definition: AlgorithmHelper.h:62
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
grepfile.content
string content
Definition: grepfile.py:56
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
dqm_algorithms::tools::XAxis
@ XAxis
Definition: AlgorithmHelper.h:39
dqm_algorithms::tools::MergePastMinStat
void MergePastMinStat(std::vector< std::vector< tools::binContainer > > &strips, int minStat)
Definition: AlgorithmHelper.cxx:1431
dqm_algorithms::tools::CylinderX
@ CylinderX
Definition: AlgorithmHelper.h:41
dqm_algorithms::tools::binCluster
Definition: AlgorithmHelper.h:56
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
dqm_algorithms::tools::GetFitParamErrors
std::map< std::string, double > GetFitParamErrors(const TF1 *func)
Definition: AlgorithmHelper.cxx:44
yellow
@ yellow
Definition: BinsDiffFromStripMedian.h:18
lumiFormat.i
int i
Definition: lumiFormat.py:85
xmin
double xmin
Definition: listroot.cxx:60
dqm_algorithms::tools::YAxis
@ YAxis
Definition: AlgorithmHelper.h:39
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
covarianceTool.title
title
Definition: covarianceTool.py:542
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
dqm_algorithms::tools::MakeComparisons
dqm_core::Result * MakeComparisons(const std::map< std::string, double > &algparams, const std::map< std::string, double > &gthreshold, const std::map< std::string, double > &rthreshold)
Definition: AlgorithmHelper.cxx:60
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.handimod.Green
int Green
Definition: handimod.py:524
plotting.yearwise_luminosity_vs_mu.bins
bins
Definition: yearwise_luminosity_vs_mu.py:30
dqm_algorithms::tools::binCluster::iymax
int iymax
Definition: AlgorithmHelper.h:66
dqm_algorithms::tools::AxisType
AxisType
Definition: AlgorithmHelper.h:39
python.handimod.Red
Red
Definition: handimod.py:551
dqm_algorithms::tools::GetFitParams
std::map< std::string, double > GetFitParams(const TF1 *func)
Definition: AlgorithmHelper.cxx:30
dqm_algorithms::tools::DivideByHistogram
TH1 * DivideByHistogram(const TH1 *hNumerator, const TH1 *hDenominator)
Definition: AlgorithmHelper.cxx:446
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
threshold
Definition: chainparser.cxx:74
green
@ green
Definition: BinsDiffFromStripMedian.h:18
dqm_algorithms::tools::binContainer
Definition: AlgorithmHelper.h:44
y
#define y
Athena::Status
Status
Athena specific StatusCode values.
Definition: AthStatusCode.h:22
h
dqm_algorithms::tools::XZAxes
@ XZAxes
Definition: AlgorithmHelper.h:39
dqm_algorithms::tools::binCluster::ixmin
int ixmin
Definition: AlgorithmHelper.h:63
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
xmax
double xmax
Definition: listroot.cxx:61
dqm_algorithms::tools::binCluster::ixmax
int ixmax
Definition: AlgorithmHelper.h:64
AlgorithmHelper.h
dqm_algorithms::tools::handleReference
void handleReference(const TObject &inputReference, const TObject *&firstReference, TObject *&secondReference)
Helper function used to handle complex reference histograms This function gets as input a reference o...
Definition: AlgorithmHelper.cxx:828
dqm_algorithms::tools::CompareWithErrors
dqm_core::Result * CompareWithErrors(const std::map< std::string, double > &algparams, const std::map< std::string, double > &paramErrors, const std::map< std::string, double > &gthreshold, const std::map< std::string, double > &rthreshold, double minSig)
Definition: AlgorithmHelper.cxx:168
str
Definition: BTagTrackIpAccessor.cxx:11
jobOptions.prec
prec
Definition: jobOptions.Superchic_UPC_yyMuMu.py:20
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
dqm_algorithms::tools::binCluster::radius
double radius
Definition: AlgorithmHelper.h:61
dqm_algorithms::tools::XYZAxes
@ XYZAxes
Definition: AlgorithmHelper.h:39
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
dqm_algorithms::tools::GetFirstFromMap
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
Definition: AlgorithmHelper.cxx:339
error
Definition: IImpactPoint3dEstimator.h:70
dqm_algorithms::tools::MakeBinTag
void MakeBinTag(const binContainer &bin, std::string &tag)
Definition: AlgorithmHelper.cxx:1514
red
@ red
Definition: BinsDiffFromStripMedian.h:18
xAOD::undefined
@ undefined
Definition: TrackingPrimitives.h:205
dqm_algorithms::tools::binCluster::x
double x
Definition: AlgorithmHelper.h:59
histogram
std::string histogram
Definition: chains.cxx:52
fitman.k
k
Definition: fitman.py:528
dqm_algorithms::tools::ZAxis
@ ZAxis
Definition: AlgorithmHelper.h:39
ymax
double ymax
Definition: listroot.cxx:64
dqm_algorithms::tools::findOutliersUsingErrors
void findOutliersUsingErrors(std::vector< binContainer > &input, double &mean, double &meanError, int &nIn, double mindiff=0, int minNin=4)
Definition: AlgorithmHelper.cxx:951