@@ -236,15 +236,15 @@ void multCalibrator::SetRun3AdaptiveBoundaries()
236236 // Function to set standard adaptive boundaries
237237 // Run 3 exclusive: goes to 0.00001% binning for highest multiplicity
238238 // Warning: this setting requires well filled input histograms
239- //
240- // -> at 0.00001%, one needs 10 million events to get a single one in the highest
241- // category. In Run 3, at 500 kHz, this corresponds to 20 seconds of dataking;
242- // any run lasting over 5 minutes should have enough to calibrate to the highest
243- // boundary.
244- //
245- // QA when using hyperfine binning is still advised:
246- // Selecting very fine percentages may select on spurious situations
247- // such as beam-background, pileup, etc.
239+ //
240+ // -> at 0.00001%, one needs 10 million events to get a single one in the highest
241+ // category. In Run 3, at 500 kHz, this corresponds to 20 seconds of dataking;
242+ // any run lasting over 5 minutes should have enough to calibrate to the highest
243+ // boundary.
244+ //
245+ // QA when using hyperfine binning is still advised:
246+ // Selecting very fine percentages may select on spurious situations
247+ // such as beam-background, pileup, etc.
248248
249249 lNDesiredBoundaries = 0 ;
250250 lDesiredBoundaries = new Double_t[1100 ];
@@ -293,28 +293,28 @@ void multCalibrator::SetStandardOnePercentBoundaries()
293293}
294294
295295// ________________________________________________________________
296- bool multCalibrator::IsBinningSane (TH1 * histogram)
296+ bool multCalibrator::IsBinningSane (TH1* histogram)
297297{
298298 // check if binning that will be attempted is too fine for this histogram
299- double minimumBinWidth = 1000 .0f ;
300- for (int ib = 0 ; ib< lNDesiredBoundaries- 1 ; ib++){
301- if (std::abs (lDesiredBoundaries[ib+ 1 ]- lDesiredBoundaries[ib])< minimumBinWidth){
302- minimumBinWidth = std::abs (lDesiredBoundaries[ib+ 1 ]- lDesiredBoundaries[ib]);
299+ double minimumBinWidth = 1000 .0f ;
300+ for (int ib = 0 ; ib < lNDesiredBoundaries - 1 ; ib++) {
301+ if (std::abs (lDesiredBoundaries[ib + 1 ] - lDesiredBoundaries[ib]) < minimumBinWidth) {
302+ minimumBinWidth = std::abs (lDesiredBoundaries[ib + 1 ] - lDesiredBoundaries[ib]);
303303 }
304304 }
305- if (minimumBinWidth< 1e-9 ){
306- cout << " Excessively fine binning requested: minimum bin width registers as " << minimumBinWidth << endl;
307- return false ; // not reasonable
305+ if (minimumBinWidth < 1e-9 ) {
306+ cout << " Excessively fine binning requested: minimum bin width registers as " << minimumBinWidth << endl;
307+ return false ; // not reasonable
308308 }
309- if (histogram->GetEntries () < 1000.0 / minimumBinWidth){
310- cout << " Histogram " << histogram->GetName ()<< " does not have enough entries (" << histogram->GetEntries ()<< " ) to calibrate!" << endl;
311- return false ;
309+ if (histogram->GetEntries () < 1000.0 / minimumBinWidth) {
310+ cout << " Histogram " << histogram->GetName () << " does not have enough entries (" << histogram->GetEntries () << " ) to calibrate!" << endl;
311+ return false ;
312312 }
313- if (std::abs (histogram->GetMean ())< 1e-9 ){
314- cout << " Histogram " << histogram->GetName ()<< " has suspicious mean: " << histogram->GetMean ()<< endl;
315- return false ;
313+ if (std::abs (histogram->GetMean ()) < 1e-9 ) {
314+ cout << " Histogram " << histogram->GetName () << " has suspicious mean: " << histogram->GetMean () << endl;
315+ return false ;
316316 }
317- cout << " Sanity check: " << histogram->GetName () << " , entries = " << histogram->GetEntries () << " , 1/(min bin width) = " <<100.0 / minimumBinWidth << " -> OK ! " << endl;
317+ cout << " Sanity check: " << histogram->GetName () << " , entries = " << histogram->GetEntries () << " , 1/(min bin width) = " << 100.0 / minimumBinWidth << " -> OK ! " << endl;
318318 return true ;
319319}
320320
@@ -334,13 +334,13 @@ TH1F* multCalibrator::GetCalibrationHistogram(TH1* histoRaw, TString lHistoName)
334334 cout << " Last boundary: " << lDesiredBoundaries[0 ] << endl;
335335 }
336336
337- // binning check
338- if (!IsBinningSane (histoRaw)){
339- cout << " Requested binning is not viable for input histogram named " << histoRaw->GetName ()<< " ! Will return 100.5 for all requests." <<endl;
340- Double_t lDummyBounds[2 ];
337+ // binning check
338+ if (!IsBinningSane (histoRaw)) {
339+ cout << " Requested binning is not viable for input histogram named " << histoRaw->GetName () << " ! Will return 100.5 for all requests." << endl;
340+ Double_t lDummyBounds[2 ];
341341 lDummyBounds[0 ] = 0 ;
342342 lDummyBounds[1 ] = 1.0 ;
343- TH1F * hCalib = new TH1F (lHistoName.Data (), " " , 1 , lDummyBounds);
343+ TH1F* hCalib = new TH1F (lHistoName.Data (), " " , 1 , lDummyBounds);
344344 hCalib->SetBinContent (0 , 100.5 );
345345 hCalib->SetBinContent (1 , 100.5 );
346346 hCalib->SetBinContent (2 , 100.5 );
@@ -369,16 +369,16 @@ TH1F* multCalibrator::GetCalibrationHistogram(TH1* histoRaw, TString lHistoName)
369369 TString lPrecisionString = " (Precision OK)" ;
370370 if (ii != 0 && ii != lNDesiredBoundaries - 1 ) {
371371 // check precision, please
372- if ((lPrecision[ii] / TMath::Abs (lDesiredBoundaries[ii + 1 ] - lDesiredBoundaries[ii])) > fkPrecisionWarningThreshold){
372+ if ((lPrecision[ii] / TMath::Abs (lDesiredBoundaries[ii + 1 ] - lDesiredBoundaries[ii])) > fkPrecisionWarningThreshold) {
373373 lPrecisionString = " (WARNING: BINNING MAY LEAD TO IMPRECISION!)" ;
374374 warnUser = true ;
375375 }
376- if ((lPrecision[ii] / TMath::Abs (lDesiredBoundaries[ii - 1 ] - lDesiredBoundaries[ii])) > fkPrecisionWarningThreshold){
376+ if ((lPrecision[ii] / TMath::Abs (lDesiredBoundaries[ii - 1 ] - lDesiredBoundaries[ii])) > fkPrecisionWarningThreshold) {
377377 lPrecisionString = " (WARNING: BINNING MAY LEAD TO IMPRECISION!)" ;
378378 warnUser = true ;
379379 }
380380 }
381- if (warnUser){
381+ if (warnUser) {
382382 cout << histoRaw->GetName () << " boundaries, percentile: " << lDesiredBoundaries[ii] << " %\t Signal value = " << lBounds[lDisplacedii] << " \t precision = " << lPrecision[ii] << " % " << lPrecisionString.Data () << endl;
383383 }
384384 }
0 commit comments