Skip to content

Commit d4d4845

Browse files
committed
Fix unused variables, parameters, values
Fixes errors from the following Clang-Tidy categories: - `clang-analyzer-deadcode.DeadStores` - `clang-diagnostic-unused-parameter` - `clang-diagnostic-unused-variable` Most errors are fixed temporarily by commenting out the unused bits and by adding a `FIXME: unused` comment. The final fix is to either remove the unused bits or to fix the bugs which has to be done by someone who knows the intended behaviour.
1 parent d561ab2 commit d4d4845

8 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎Common/Core/macros/testCollisionTypeHelper.C‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ void testCollisionTypeHelper(int runNumber = 544124)
2626
o2::parameters::GRPLHCIFData* grpo = ccdb.getSpecificForRun<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF",
2727
runNumber);
2828
grpo->print();
29-
int collsys = o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(grpo);
29+
[[maybe_unused]] int collsys = o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(grpo);
3030
}

‎Common/TableProducer/PID/pidTOFBase.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ struct tofEventTime {
469469
// Reset the event time
470470
eventTime = 0.f;
471471
sumOfWeights = 0.f;
472-
weight = 0.f;
472+
// weight = 0.f; // FIXME: unused
473473
// Remove the bias on TOF ev. time
474474
if constexpr (removeTOFEvTimeBias) {
475475
evTimeTOF.removeBias<TrksEvTime::iterator, filterForTOFEventTime>(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2);

‎Common/TableProducer/PID/pidTOFMerge.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ struct tofEventTime {
435435
// Reset the event time
436436
eventTime = 0.f;
437437
sumOfWeights = 0.f;
438-
weight = 0.f;
438+
// weight = 0.f; // FIXME: unused
439439
// Remove the bias on TOF ev. time
440440
if constexpr (kRemoveTOFEvTimeBias) {
441441
evTimeMakerTOF.removeBias<Run3TrksWtof::iterator, filterForTOFEventTime>(trk, nGoodTracksForTOF, t0TOF[0], t0TOF[1], 2);

‎Common/TableProducer/caloClusterProducer.cxx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,9 +1116,9 @@ struct CaloClusterProducer {
11161116
if (cpvdist != 99.) { // was evaluated
11171117
cpvdist = std::sqrt(cpvdist); // was squared
11181118
}
1119-
if (trackdist != 99.) { // was evaluated
1120-
trackdist = std::sqrt(trackdist); // was squared
1121-
}
1119+
// if (trackdist != 99.) { // was evaluated
1120+
// trackdist = std::sqrt(trackdist); // was squared // FIXME: unused
1121+
// }
11221122

11231123
float lambdaShort = 0., lambdaLong = 0.;
11241124
clu.getElipsAxis(lambdaShort, lambdaLong);
@@ -1544,9 +1544,9 @@ struct CaloClusterProducer {
15441544
if (cpvdist != 99.) { // was evaluated
15451545
cpvdist = std::sqrt(cpvdist); // was squared
15461546
}
1547-
if (trackdist != 99.) { // was evaluated
1548-
trackdist = std::sqrt(trackdist); // was squared
1549-
}
1547+
// if (trackdist != 99.) { // was evaluated
1548+
// trackdist = std::sqrt(trackdist); // was squared // FIXME: unused
1549+
// }
15501550

15511551
float lambdaShort = 0., lambdaLong = 0.;
15521552
clu.getElipsAxis(lambdaShort, lambdaLong);

‎Common/TableProducer/match-mft-ft0.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ struct matchmftft0 {
367367

368368
auto ft0s = bc.ft0s();
369369
i = 0; // reinitialise
370-
D = 0.0;
370+
// D = 0.0; // FIXME: unused
371371
minD = 999.9;
372372
for (auto const& ft0 : ft0s) {
373373
// printf("---------ft0.bcId %d\n", ft0.bcId());

‎Common/Tools/Multiplicity/macros/runCalibration.C‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void runCalibration(const TString& lInputFileName = "results/AR_544122_glauberNB
4040

4141
TH1F* hData = dynamic_cast<TH1F*>(file->Get("hV0MUltraFine"));
4242
TH1F* hGlauberParameters = dynamic_cast<TH1F*>(file->Get("hGlauberParameters"));
43-
TH1F* hGlauberFitRange = dynamic_cast<TH1F*>(file->Get("hGlauberFitRange"));
43+
[[maybe_unused]] TH1F* hGlauberFitRange = dynamic_cast<TH1F*>(file->Get("hGlauberFitRange"));
4444
hData->SetName("hData");
4545
TH1F* hStitched = dynamic_cast<TH1F*>(hData->Clone("hStitched"));
4646
TH1F* hFit = dynamic_cast<TH1F*>(file->Get("hGlauber"));

‎Common/Tools/Multiplicity/macros/runGlauberFit.C‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ int runGlauberFit(const TString& lInputFileName = "AnalysisResultsLHC24ar.root",
357357
c1->cd(1);
358358
TLatex* lat = new TLatex();
359359
lat->SetNDC();
360-
Float_t lPosText = 0.76;
361-
Float_t lYShift = 0.25;
360+
// Float_t lPosText = 0.76; // FIXME: unused
361+
// Float_t lYShift = 0.25; // FIXME: unused
362362
lat->SetTextSize(0.042);
363363

364364
// save the glauber parameters explicitly

‎Common/Tools/Multiplicity/macros/saveCorrelation.C‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ void saveCorrelation(const TString& filename = "gmc-PbPb-snn68.21-md0.40-nd-1.0-
5959

6060
// 2D correlation plot necessary for Glauber + NBD fitting
6161
// The provided range should be enough for Pb-Pb
62+
// NOLINTNEXTLINE(clang-analyzer-deadcode.DeadStores,clang-diagnostic-unused-variable)
6263
TH2D* hNpNc = new TH2D("hNpNc", "", 500, -0.5, 499.5, 2500, -0.5, 2499.5);
6364

6465
// let's draw this on screen for inspection

0 commit comments

Comments
 (0)