Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Common/Tools/Multiplicity/multCalibrator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
#include <TH1D.h>
#include <TH1F.h>
#include <TList.h>
#include <TMath.h>
#include <TProfile.h>
#include <TStopwatch.h>
#include <TMath.h>

#include <iostream> // FIXME

Check failure on line 32 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.

using namespace std;

Expand Down Expand Up @@ -85,7 +85,7 @@
}

//________________________________________________________________
Bool_t multCalibrator::Calibrate()

Check failure on line 88 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
{
// Function meant to generate calibration OADB
//
Expand All @@ -106,7 +106,7 @@

// Step 1: verify if input file contains desired histograms
TH1D* hRaw[kNCentEstim];
for (Int_t iv = 0; iv < kNCentEstim; iv++) {

Check failure on line 109 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
hRaw[iv] = reinterpret_cast<TH1D*>(fileInput->Get(Form("multiplicity-qa/multiplicityQa/h%s", fCentEstimName[iv].Data())));
if (!hRaw[iv]) {
cout << Form("File does not contain histogram h%s, which is necessary for calibration!", fCentEstimName[iv].Data()) << endl;
Expand All @@ -119,7 +119,7 @@
// Create output file
TFile* fOut = new TFile(fOutputFileName.Data(), "RECREATE");
TH1F* hCalib[kNCentEstim];
for (Int_t iv = 0; iv < kNCentEstim; iv++) {

Check failure on line 122 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
cout << Form("Calibrating estimator: %s", fCentEstimName[iv].Data()) << endl;
hCalib[iv] = GetCalibrationHistogram(hRaw[iv], Form("hCalib%s", fCentEstimName[iv].Data()));
hCalib[iv]->Write();
Expand All @@ -131,17 +131,17 @@
return kTRUE;
}

Double_t multCalibrator::GetRawMax(TH1* histo)

Check failure on line 134 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
{
// This function gets the max X value (right edge) which is filled.
for (Int_t ii = histo->GetNbinsX(); ii > 0; ii--) {

Check failure on line 137 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
if (histo->GetBinContent(ii) < 1e-10)
return histo->GetBinLowEdge(ii + 1);
}
return 1e+6;
}

Double_t multCalibrator::GetBoundaryForPercentile(TH1* histo, Double_t lPercentileRequested, Double_t& lPrecisionEstimate)

Check failure on line 144 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
{
// This function returns the boundary for a specific percentile.
// It uses a linear interpolation in an attempt to get more precision
Expand All @@ -153,16 +153,16 @@
// that corresponds to those bins. If this percentage is O(percentile bin
// width requested), then the user should worry and we print out a warning.

const Double_t lPrecisionConstant = 2.0;

Check failure on line 156 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.

Double_t lRawMax = GetRawMax(histo);

Check failure on line 158 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.

if (lPercentileRequested < 1e-7)
return lRawMax; // safeguard
if (lPercentileRequested > 100 - 1e-7)
return 0.0; // safeguard

Double_t lReturnValue = 0.0;

Check failure on line 165 in Common/Tools/Multiplicity/multCalibrator.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
Double_t lPercentile = 100.0 - lPercentileRequested;
Double_t lPercentileAnchor = 100.0 - fAnchorPointPercentage;
lPrecisionEstimate = -1;
Expand Down
Loading