Skip to content

Commit a89cdd0

Browse files
authored
Merge pull request #46969 from iarspider/iarspider-patch-20241217-1
[ALCA] Replace abs with std::abs to fix clang warnings
2 parents 285f25b + c2bd665 commit a89cdd0

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Alignment/OfflineValidation/src/PlotAlignmentValidation.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ void PlotAlignmentValidation::plotDMR(const std::string& variable,
857857
}
858858

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

@@ -2261,7 +2261,7 @@ double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int n
22612261
std::vector<double> diff;
22622262
diff.clear();
22632263
//"true" (in bootstrap terms) difference of the samples' RMS
2264-
double rmsdiff = abs(h1->GetRMS() - h2->GetRMS());
2264+
double rmsdiff = std::abs(h1->GetRMS() - h2->GetRMS());
22652265
//means of the samples to calculate RMS
22662266
double m1 = h1->GetMean();
22672267
double m2 = h2->GetMean();
@@ -2281,8 +2281,8 @@ double PlotAlignmentValidation::resampleTestOfEqualRMS(TH1F* h1, TH1F* h2, int n
22812281
}
22822282
d1 /= h1->GetEntries();
22832283
d2 /= h2->GetEntries();
2284-
diff.push_back(abs(d1 - d2 - rmsdiff));
2285-
test_mean += abs(d1 - d2 - rmsdiff);
2284+
diff.push_back(std::abs(d1 - d2 - rmsdiff));
2285+
test_mean += std::abs(d1 - d2 - rmsdiff);
22862286
}
22872287
test_mean /= numSamples;
22882288
edm::LogPrint("") << "test mean:" << test_mean;
@@ -2309,7 +2309,7 @@ double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int
23092309
std::vector<double> diff;
23102310
diff.clear();
23112311
//"true" (in bootstrap terms) difference of the samples' means
2312-
double meandiff = abs(h1->GetMean() - h2->GetMean());
2312+
double meandiff = std::abs(h1->GetMean() - h2->GetMean());
23132313
//realization of random variable
23142314
double d1 = 0;
23152315
double d2 = 0;
@@ -2326,8 +2326,8 @@ double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int
23262326
}
23272327
d1 /= h1->GetEntries();
23282328
d2 /= h2->GetEntries();
2329-
diff.push_back(abs(d1 - d2 - meandiff));
2330-
test_mean += abs(d1 - d2 - meandiff);
2329+
diff.push_back(std::abs(d1 - d2 - meandiff));
2330+
test_mean += std::abs(d1 - d2 - meandiff);
23312331
}
23322332
test_mean /= numSamples;
23332333
edm::LogPrint("") << "test mean:" << test_mean;
@@ -2344,7 +2344,7 @@ double PlotAlignmentValidation::resampleTestOfEqualMeans(TH1F* h1, TH1F* h2, int
23442344
}
23452345

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

23502350
const TString PlotAlignmentValidation::summaryfilename = "OfflineValidationSummary";

Calibration/HcalCalibAlgos/src/hcalCalib.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ void hcalCalib::GetCoefFromMtrxInvOfAve() {
536536

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

0 commit comments

Comments
 (0)