Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ALCA] Replace abs with std::abs to fix clang warnings #46969

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
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
16 changes: 8 additions & 8 deletions Alignment/OfflineValidation/src/PlotAlignmentValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable,
}

// Skip strip detectors if plotting any "Y" variable
if (i != 1 && i != 2 && variable.length() > 0 && variable[variable.length() - 1] == 'Y') {
if (i != 1 && i != 2 && !variable.empty() && variable[variable.length() - 1] == 'Y') {
continue;
}

Expand Down Expand Up @@ -2261,7 +2261,7 @@ double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int n
std::vector<double> diff;
diff.clear();
//"true" (in bootstrap terms) difference of the samples' RMS
double rmsdiff = abs(h1->GetRMS() - h2->GetRMS());
double rmsdiff = std::abs(h1->GetRMS() - h2->GetRMS());
//means of the samples to calculate RMS
double m1 = h1->GetMean();
double m2 = h2->GetMean();
Expand All @@ -2281,8 +2281,8 @@ double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int n
}
d1 /= h1->GetEntries();
d2 /= h2->GetEntries();
diff.push_back(abs(d1 - d2 - rmsdiff));
test_mean += abs(d1 - d2 - rmsdiff);
diff.push_back(std::abs(d1 - d2 - rmsdiff));
test_mean += std::abs(d1 - d2 - rmsdiff);
}
test_mean /= numSamples;
edm::LogPrint("") << "test mean:" << test_mean;
Expand All @@ -2309,7 +2309,7 @@ double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int
std::vector<double> diff;
diff.clear();
//"true" (in bootstrap terms) difference of the samples' means
double meandiff = abs(h1->GetMean() - h2->GetMean());
double meandiff = std::abs(h1->GetMean() - h2->GetMean());
//realization of random variable
double d1 = 0;
double d2 = 0;
Expand All @@ -2326,8 +2326,8 @@ double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int
}
d1 /= h1->GetEntries();
d2 /= h2->GetEntries();
diff.push_back(abs(d1 - d2 - meandiff));
test_mean += abs(d1 - d2 - meandiff);
diff.push_back(std::abs(d1 - d2 - meandiff));
test_mean += std::abs(d1 - d2 - meandiff);
}
test_mean /= numSamples;
edm::LogPrint("") << "test mean:" << test_mean;
Expand All @@ -2344,7 +2344,7 @@ double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int
}

float PlotAlignmentValidation::twotailedStudentTTestEqualMean(float t, float v) {
return 2 * (1 - ROOT::Math::tdistribution_cdf(abs(t), v));
return 2 * (1 - ROOT::Math::tdistribution_cdf(std::abs(t), v));
}

const TString PlotAlignmentValidation::summaryfilename = "OfflineValidationSummary";
Expand Down
2 changes: 1 addition & 1 deletion Calibration/HcalCalibAlgos/src/hcalCalib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ void hcalCalib::GetCoefFromMtrxInvOfAve() {

std::map<Int_t, Float_t>::iterator n_it = aveHitE[iEtaList[i]].begin();
for (; n_it != aveHitE[iEtaList[i]].end(); ++n_it) {
if (fabs(n_it->first) > CALIB_ABS_IETA_MAX || fabs(n_it->first) < CALIB_ABS_IETA_MIN)
if (std::abs(n_it->first) > CALIB_ABS_IETA_MAX || std::abs(n_it->first) < CALIB_ABS_IETA_MIN)
continue;
Int_t j = Int_t(find(iEtaList.begin(), iEtaList.end(), n_it->first) - iEtaList.begin());
A(i, j) = n_it->second;
Expand Down