From f72f55fb521d7e75ec83f3060c8676b7c6472be3 Mon Sep 17 00:00:00 2001 From: Andreas Loeschcke Centeno Date: Wed, 17 Sep 2025 16:06:13 +0200 Subject: [PATCH 1/2] Added [[maybe_unused]] to skeleton --- .../src/components/MoliereRadius.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GaudiTutorial/MoliereRadiusFunctional/src/components/MoliereRadius.cpp b/GaudiTutorial/MoliereRadiusFunctional/src/components/MoliereRadius.cpp index 19ddd00..a6e2442 100644 --- a/GaudiTutorial/MoliereRadiusFunctional/src/components/MoliereRadius.cpp +++ b/GaudiTutorial/MoliereRadiusFunctional/src/components/MoliereRadius.cpp @@ -61,9 +61,10 @@ struct MoliereRadius final double moliereRadius = 0.0; // Retrieve barycentre and total energy - double barycentre_x = InputBarycenter[0]->at(0); - double barycentre_y = InputBarycenter[1]->at(0); - double totalEnergy = InputTotalEnergy.at(0); + // [[maybe_unused]] used to avoid downstream build failures due to unused variables + [[maybe_unused]] double barycentre_x = InputBarycenter[0]->at(0); + [[maybe_unused]] double barycentre_y = InputBarycenter[1]->at(0); + [[maybe_unused]] double totalEnergy = InputTotalEnergy.at(0); // Step 1: Calculate radius for each hit and store with energy // You can use the HitData struct defined below to store the relevant information From 701312e08e5d8537d9e93b46049613d923676e25 Mon Sep 17 00:00:00 2001 From: Andreas Loeschcke Centeno Date: Wed, 17 Sep 2025 16:13:05 +0200 Subject: [PATCH 2/2] Further additions of [[maybe_unused]] --- .../src/components/RandomNoiseDigitizer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GaudiTutorial/RandomNoiseDigitizer/src/components/RandomNoiseDigitizer.cpp b/GaudiTutorial/RandomNoiseDigitizer/src/components/RandomNoiseDigitizer.cpp index 722173e..c194f5b 100644 --- a/GaudiTutorial/RandomNoiseDigitizer/src/components/RandomNoiseDigitizer.cpp +++ b/GaudiTutorial/RandomNoiseDigitizer/src/components/RandomNoiseDigitizer.cpp @@ -77,13 +77,15 @@ struct RandomNoiseDigitizer final random_engine.seed(engine_seed); // Create the random distributions for smearing the hit energy - std::normal_distribution gaussian_noise{0.0, 0.0}; // Replace with mean and width from properties + // [[maybe_unused]] used to avoid downstream build failures due to unused variables + [[maybe_unused]] std::normal_distribution gaussian_noise{ + 0.0, 0.0}; // Replace with mean and width from properties // Loop over the input hits for (const auto& hit : InputCaloSimHitCollection) { auto digihit = CaloDigiHits.create(); - double noise = gaussian_noise(random_engine); + [[maybe_unused]] double noise = gaussian_noise(random_engine); digihit.setCellID(hit.getCellID()); // Use the EDM4hep yaml file to "guess" the names of the getter and setter functions