diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 5938ec42cdd..cd8af5e0307 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -14,31 +14,34 @@ /// /// \author Josue Martinez Garcia, josuem@cern.ch -#include -#include -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonDataFormat/BunchFilling.h" #include "DataFormatsFDD/Digit.h" #include "DataFormatsFT0/Digit.h" #include "DataFormatsFV0/Digit.h" -#include "Framework/ASoA.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsParameters/GRPLHCIFData.h" #include "DataFormatsParameters/GRPECSObject.h" +#include "DataFormatsParameters/GRPLHCIFData.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; using BCsWithTimestamps = soa::Join; +// using CollisionWithFDD = soa::Join; struct LumiStabilityTask { // Histogram registry: an object to hold your histograms @@ -55,10 +58,13 @@ struct LumiStabilityTask { Configurable minEmpty{"minEmpty", 5, "number of BCs empty for leading BC"}; Service ccdb; + parameters::GRPLHCIFData* grplhcif = nullptr; int nBCsPerOrbit = 3564; int lastRunNumber = -1; + int64_t currentTFid = -1; int nOrbits = nOrbitsConf; double minOrbit = minOrbitConf; + int minTimeFDD = 30; int64_t bcSOR = 0; // global bc of the start of the first orbit, setting 0 by default for unanchored MC int64_t tsSOR; int64_t tsEOR; @@ -87,7 +93,8 @@ struct LumiStabilityTask { const AxisSpec axisTimeFDD{1000, -20, 100}; const AxisSpec axisCountsTime{2, -0.5, 1.5}; const AxisSpec axisOrbits{static_cast(nOrbits / nOrbitsPerTF), 0., static_cast(nOrbits), ""}; - const AxisSpec axisTimeRate{int(double(43200) / (nOrbitsPerTF * 89e-6)), 0., 43200, ""}; // t in seconds. Histo for 12 hrs. Each bin contain one time frame (128/32 orbits for Run2/3). + const AxisSpec axisTimeRate{static_cast(static_cast(43200) / (nOrbitsPerTF * 89e-6)), 0., 43200, ""}; // t in seconds. Histo for 12 hrs. Each bin contain one time frame (128/32 orbits for 2022/2023). + const AxisSpec timeAxis{1200, 0., 1200., "#bf{t-t_{SOF} (min)}"}; histos.add("hBcA", "BC pattern A; BC ; It is present", kTH1F, {axisTrigger}); histos.add("hBcC", "BC pattern C; BC ; It is present", kTH1F, {axisTrigger}); @@ -105,9 +112,15 @@ struct LumiStabilityTask { histos.add("hOrbitFT0vertex", "", kTH1F, {axisOrbits}); histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); histos.add("tsValues", "", kTH1D, {{2, -0.5, 1.5}}); + histos.add("TFsPerMinute", "TFs seen in this minute (to account for failed jobs);#bf{t-t_{SOF} (min)};#bf{#it{N}_{TFs}}", kTH1F, {timeAxis}); + // time 32.766 is dummy time + // histo about triggers histos.add("FDD/hCounts", "0 FDDCount - 1 FDDVertexCount - 2 FDDPPVertexCount - 3 FDDCoincidencesVertexCount - 4 FDDPPCoincidencesVertexCount - 5 FDDPPBotSidesCount; Number; counts", kTH1F, {axisCounts}); + histos.add("FDD/nBCsVsTime", "Time of TVX triggered BCs since the start of fill. FDD;;#bf{#it{N}_{BC}}", kTH1F, {timeAxis}); + histos.add("FDD/nBCsVsTimeLeadingBC", "Time of TVX triggered BCs since the start of fill. FDD;;#bf{#it{N}_{BC}}", kTH1F, {timeAxis}); + histos.add("FDD/bcVertexTriggerCTP", "vertex trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTrigger}); histos.add("FDD/bcVertexTrigger", "vertex trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTrigger}); histos.add("FDD/bcVertexTriggerPP", "vertex trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTrigger}); histos.add("FDD/bcVertexTriggerCoincidence", "vertex trigger per BC (FDD) with coincidences;BC in FDD; counts", kTH1F, {axisTrigger}); @@ -162,9 +175,14 @@ struct LumiStabilityTask { histos.add("FDD/hValidTimevsBC", "Valid Time vs BC id;BC in FT0;valid time counts", kTH1F, {axisTrigger}); histos.add("FDD/hInvTimevsBC", "Invalid Time vs BC id;BC in FT0;invalid time counts", kTH1F, {axisTrigger}); histos.add("FDD/hTimeForRate", "Counts by time in FDD;t (in seconds) in FDD; counts", kTH1F, {axisTimeRate}); + histos.add("FDD/hTimeForRateCTP", "Counts by time in FDD;t (in seconds) in FDD; counts", kTH1F, {axisTimeRate}); histos.add("FDD/hTimeForRateLeadingBC", "Counts by time in FDD;t (in seconds) in FDD; counts", kTH1F, {axisTimeRate}); + histos.add("FDD/hTimeForRateLeadingBCCTP", "Counts by time in FDD;t (in seconds) in FDD; counts", kTH1F, {axisTimeRate}); histos.add("FT0/hCounts", "0 FT0Count - 1 FT0VertexCount - 2 FT0PPVertexCount - 3 FT0PPBothSidesCount; Number; counts", kTH1F, {axisCounts}); + histos.add("FT0/nBCsVsTime", "Time of TVX triggered BCs since the start of fill. FT0;;#bf{#it{N}_{BC}}", kTH1F, {timeAxis}); + histos.add("FT0/nBCsVsTimeLeadingBC", "Time of TVX triggered BCs since the start of fill. FT0;;#bf{#it{N}_{BC}}", kTH1F, {timeAxis}); + histos.add("FT0/bcVertexTriggerCTP", "vertex trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTrigger}); histos.add("FT0/bcVertexTrigger", "vertex trigger per BC (FT0);BC in FT0; counts", kTH1F, {axisTrigger}); histos.add("FT0/bcVertexTriggerPP", "vertex trigger per BC (FT0) with Past Protection;BC in FT0; counts", kTH1F, {axisTrigger}); histos.add("FT0/bcVertexTriggerBothSidesPP", "vertex per BC (FDD) with coincidences, at least one side trigger and Past Protection;BC in FDD; counts", kTH1F, {axisTrigger}); @@ -193,9 +211,12 @@ struct LumiStabilityTask { histos.add("FT0/hValidTimevsBC", "Valid Time vs BC id;BC in FT0;valid time counts", kTH1F, {axisTrigger}); histos.add("FT0/hInvTimevsBC", "Invalid Time vs BC id;BC in FT0;invalid time counts", kTH1F, {axisTrigger}); histos.add("FT0/hTimeForRate", "Counts by time in FT0;t (in seconds) in FT0; counts", kTH1F, {axisTimeRate}); + histos.add("FT0/hTimeForRateCTP", "Counts by time in FT0;t (in seconds) in FT0; counts", kTH1F, {axisTimeRate}); histos.add("FT0/hTimeForRateLeadingBC", "Counts by time in FT0;t (in seconds) in FT0; counts", kTH1F, {axisTimeRate}); + histos.add("FT0/hTimeForRateLeadingBCCTP", "Counts by time in FT0;t (in seconds) in FT0; counts", kTH1F, {axisTimeRate}); histos.add("FV0/hCounts", "0 CountCentralFV0 - 1 CountPFPCentralFV0 - 2 CountPFPOutInFV0 - 3 CountPPCentralFV0 - 4 CountPPOutInFV0; Number; counts", kTH1F, {axisV0Counts}); + histos.add("FV0/bcChargeTriggerCTP", "Out trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTrigger}); histos.add("FV0/bcOutTrigger", "Out trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTrigger}); histos.add("FV0/bcInTrigger", "In trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTrigger}); histos.add("FV0/bcSCenTrigger", "SCen trigger per BC (FV0);BC in V0; counts", kTH1F, {axisTrigger}); @@ -212,6 +233,8 @@ struct LumiStabilityTask { histos.add("FV0/timeAbcA", "time bcA ; A (ns)", kTH1F, {{300, -15, 15}}); histos.add("FV0/timeAbcC", "time bcC ; A (ns)", kTH1F, {{300, -15, 15}}); histos.add("FV0/timeAbcE", "time bcE ; A (ns)", kTH1F, {{300, -15, 15}}); + histos.add("FV0/hTimeForRateCTP", "Counts by time in FV0;t (in seconds) in FV0; counts", kTH1F, {axisTimeRate}); + histos.add("FV0/hTimeForRateLeadingBCCTP", "Counts by time in FV0;t (in seconds) in FV0; counts", kTH1F, {axisTimeRate}); } bool checkAnyCoincidence(const std::vector& channels) @@ -231,6 +254,11 @@ struct LumiStabilityTask { return false; } + float getTimeSinceSOF(const auto& bc) + { + return (bc.timestamp() - grplhcif->getFillNumberTime()) / 1e3 / 60; // Convert to minutes + } + void processMain(aod::FDDs const& fdds, aod::FT0s const& ft0s, aod::FV0As const& fv0s, aod::BCsWithTimestamps const& bcs) { int executionCounter = 0; @@ -248,78 +276,77 @@ struct LumiStabilityTask { lastRunNumber = runNumber; // do it only once executionCounter++; - if (runNumber >= 500000) { // access CCDB for data or anchored MC only - int64_t ts = bcs.iteratorAt(0).timestamp(); - - // access colliding and beam-gas bc patterns - auto grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); - beamPatternA = grplhcif->getBunchFilling().getBeamPattern(0); - beamPatternC = grplhcif->getBunchFilling().getBeamPattern(1); - bcPatternA = beamPatternA & ~beamPatternC; - bcPatternC = ~beamPatternA & beamPatternC; - bcPatternB = beamPatternA & beamPatternC; - bcPatternE = ~beamPatternA & ~beamPatternC; - - for (int i = 0; i < nBCsPerOrbit; i++) { - if (bcPatternA[i]) { - histos.fill(HIST("hBcA"), i); - } - if (bcPatternC[i]) { - histos.fill(HIST("hBcC"), i); - } - if (bcPatternB[i]) { - histos.fill(HIST("hBcB"), i); - bool isLeadBC = true; - for (int jbit = i - minEmpty; jbit < i; jbit++) { - int kbit = jbit; - if (kbit < 0) - kbit += nbin; - if (bcPatternB[kbit]) { - isLeadBC = false; - break; - } + // access CCDB for data or anchored MC only + int64_t ts = bcs.iteratorAt(0).timestamp(); + + // access colliding and beam-gas bc patterns + grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); + beamPatternA = grplhcif->getBunchFilling().getBeamPattern(0); + beamPatternC = grplhcif->getBunchFilling().getBeamPattern(1); + bcPatternA = beamPatternA & ~beamPatternC; + bcPatternC = ~beamPatternA & beamPatternC; + bcPatternB = beamPatternA & beamPatternC; + bcPatternE = ~beamPatternA & ~beamPatternC; + + for (int i = 0; i < nBCsPerOrbit; i++) { + if (bcPatternA[i]) { + histos.fill(HIST("hBcA"), i); + } + if (bcPatternC[i]) { + histos.fill(HIST("hBcC"), i); + } + if (bcPatternB[i]) { + histos.fill(HIST("hBcB"), i); + bool isLeadBC = true; + for (int jbit = i - minEmpty; jbit < i; jbit++) { + int kbit = jbit; + if (kbit < 0) + kbit += nbin; + if (bcPatternB[kbit]) { + isLeadBC = false; + break; } - if (isLeadBC) - histos.fill(HIST("hBcBL"), i); - } - if (bcPatternE[i]) { - histos.fill(HIST("hBcE"), i); } + if (isLeadBC) + histos.fill(HIST("hBcBL"), i); + } + if (bcPatternE[i]) { + histos.fill(HIST("hBcE"), i); } - - EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", ts); - // access orbit-reset timestamp - auto ctpx = ccdb->getForTimeStamp>("CTP/Calib/OrbitReset", ts); - int64_t tsOrbitReset = (*ctpx)[0]; // us - // access TF duration, start-of-run and end-of-run timestamps from ECS GRP - std::map metadata; - metadata["runNumber"] = Form("%d", runNumber); - auto grpecs = ccdb->getSpecific("GLO/Config/GRPECS", ts, metadata); - nOrbitsPerTF = grpecs->getNHBFPerTF(); // assuming 1 orbit = 1 HBF; nOrbitsPerTF=128 in 2022, 32 in 2023 - tsSOR = grpecs->getTimeStart(); // ms - tsEOR = grpecs->getTimeEnd(); // ms - // calculate SOR and EOR orbits - int64_t orbitSOR = (tsSOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS; - int64_t orbitEOR = (tsEOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS; - // adjust to the nearest TF edge - orbitSOR = orbitSOR / nOrbitsPerTF * nOrbitsPerTF + par->fTimeFrameOrbitShift; - orbitEOR = orbitEOR / nOrbitsPerTF * nOrbitsPerTF + par->fTimeFrameOrbitShift; - // set nOrbits and minOrbit used for orbit-axis binning - nOrbits = orbitEOR - orbitSOR; - minOrbit = orbitSOR; - // first bc of the first orbit (should coincide with TF start) - bcSOR = orbitSOR * o2::constants::lhc::LHCMaxBunches; - // duration of TF in bcs - nBCsPerTF = nOrbitsPerTF * o2::constants::lhc::LHCMaxBunches; - LOGP(info, "tsOrbitReset={} us, SOR = {} ms, EOR = {} ms, orbitSOR = {}, nBCsPerTF = {}", tsOrbitReset, tsSOR, tsEOR, orbitSOR, nBCsPerTF); - - auto hTsValues = histos.get(HIST("tsValues")); - hTsValues->GetXaxis()->SetBinLabel(1, "tsSOR"); - hTsValues->GetXaxis()->SetBinLabel(2, "tsEOR"); - hTsValues->SetBinContent(1, tsSOR / 1000); // seconds - hTsValues->SetBinContent(2, tsEOR / 1000); // seconds } + EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", ts); + // access orbit-reset timestamp + auto ctpx = ccdb->getForTimeStamp>("CTP/Calib/OrbitReset", ts); + int64_t tsOrbitReset = (*ctpx)[0]; // us + // access TF duration, start-of-run and end-of-run timestamps from ECS GRP + std::map metadata; + metadata["runNumber"] = Form("%d", runNumber); + auto grpecs = ccdb->getSpecific("GLO/Config/GRPECS", ts, metadata); + nOrbitsPerTF = grpecs->getNHBFPerTF(); // assuming 1 orbit = 1 HBF; nOrbitsPerTF=128 in 2022, 32 in 2023 + tsSOR = grpecs->getTimeStart(); // ms + tsEOR = grpecs->getTimeEnd(); // ms + // calculate SOR and EOR orbits + int64_t orbitSOR = (tsSOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS; + int64_t orbitEOR = (tsEOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS; + // adjust to the nearest TF edge + orbitSOR = orbitSOR / nOrbitsPerTF * nOrbitsPerTF + par->fTimeFrameOrbitShift; + orbitEOR = orbitEOR / nOrbitsPerTF * nOrbitsPerTF + par->fTimeFrameOrbitShift; + // set nOrbits and minOrbit used for orbit-axis binning + nOrbits = orbitEOR - orbitSOR; + minOrbit = orbitSOR; + // first bc of the first orbit (should coincide with TF start) + bcSOR = orbitSOR * o2::constants::lhc::LHCMaxBunches; + // duration of TF in bcs + nBCsPerTF = nOrbitsPerTF * o2::constants::lhc::LHCMaxBunches; + LOGP(info, "tsOrbitReset={} us, SOR = {} ms, EOR = {} ms, orbitSOR = {}, nBCsPerTF = {}", tsOrbitReset, tsSOR, tsEOR, orbitSOR, nBCsPerTF); + + auto hTsValues = histos.get(HIST("tsValues")); + hTsValues->GetXaxis()->SetBinLabel(1, "tsSOR"); + hTsValues->GetXaxis()->SetBinLabel(2, "tsEOR"); + hTsValues->SetBinContent(1, tsSOR / 1000); // seconds + hTsValues->SetBinContent(2, tsEOR / 1000); // seconds + // create orbit-axis histograms on the fly with binning based on info from GRP if GRP is available // otherwise default minOrbit and nOrbits will be used // const AxisSpec axisOrbits{static_cast(nOrbits / nOrbitsPerTF), 0., static_cast(nOrbits), ""}; @@ -329,6 +356,69 @@ struct LumiStabilityTask { // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); } + for (auto const& bc : bcs) { + if (bc.timestamp() == 0) { + continue; + } + + std::bitset<64> ctpInputMask(bc.inputMask()); + bool trgFDD = ctpInputMask[15]; + bool trgFT0 = ctpInputMask[2]; + bool trgFV0 = ctpInputMask[9]; + + int64_t globalBC = bc.globalBC(); + int localBC = globalBC % nBCsPerOrbit; + + float timeSinceSOF = getTimeSinceSOF(bc); + + int64_t thisTFid = (globalBC - bcSOR) / nBCsPerTF; + + if (thisTFid != currentTFid) { + currentTFid = thisTFid; + histos.fill(HIST("TFsPerMinute"), timeSinceSOF); + } + + if (bcPatternB[localBC]) { + if (trgFDD) { + histos.fill(HIST("FDD/nBCsVsTime"), timeSinceSOF); + histos.fill(HIST("FDD/bcVertexTriggerCTP"), localBC + 7); + histos.fill(HIST("FDD/hTimeForRateCTP"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds + } + if (trgFT0) { + histos.fill(HIST("FT0/nBCsVsTime"), timeSinceSOF); + histos.fill(HIST("FT0/bcVertexTriggerCTP"), localBC); + histos.fill(HIST("FT0/hTimeForRateCTP"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds + } + if (trgFV0) { + histos.fill(HIST("FV0/bcChargeTriggerCTP"), localBC); + histos.fill(HIST("FV0/hTimeForRateCTP"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds + } + bool isLeadBC = true; + for (int jbit = localBC - minEmpty; jbit < localBC; jbit++) { + int kbit = jbit; + if (kbit < 0) + kbit += nbin; + if (bcPatternB[kbit]) { + isLeadBC = false; + break; + } + } + if (isLeadBC) { + if (trgFDD) { + histos.fill(HIST("FDD/nBCsVsTimeLeadingBCe"), timeSinceSOF); + histos.fill(HIST("FDD/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); + } + if (trgFT0) { + histos.fill(HIST("FT0/nBCsVsTimeLeadingBCe"), timeSinceSOF); + histos.fill(HIST("FT0/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); + } + if (trgFV0) { + histos.fill(HIST("FV0/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); + } + } + } + } // loop over bcs + for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); if (bc.timestamp() == 0) { @@ -348,11 +438,13 @@ struct LumiStabilityTask { auto sideC = fdd.chargeC(); std::vector channelA; std::vector channelC; - for (auto i = 0; i < 8; i++) { - if (sideA[i] > 0) { + int minLimit = 0; + int maxNChanels = 8; + for (auto i = 0; i < maxNChanels; i++) { + if (sideA[i] > minLimit) { channelA.push_back(i); } - if (sideC[i] > 0) { + if (sideC[i] > minLimit) { channelC.push_back(i); } } @@ -432,7 +524,7 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hTimeAVertex"), fdd.timeA()); histos.fill(HIST("FDD/hTimeCVertex"), fdd.timeC()); if (is2022Data) { - if (fdd.timeA() > 30) { + if (fdd.timeA() > minTimeFDD) { histos.fill(HIST("FDD/hCountsTimeA2022"), 0); histos.fill(HIST("FDD/hInvTimeAvsBC2022"), localBC); } else { @@ -440,7 +532,7 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hValidTimeAvsBC2022"), localBC); } - if (fdd.timeC() > 30) { + if (fdd.timeC() > minTimeFDD) { histos.fill(HIST("FDD/hCountsTimeC2022"), 0); histos.fill(HIST("FDD/hInvTimeCvsBC2022"), localBC); } else { @@ -448,11 +540,11 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hValidTimeCvsBC2022"), localBC); } - if (fdd.timeA() > 30 || fdd.timeC() > 30) { + if (fdd.timeA() > minTimeFDD || fdd.timeC() > minTimeFDD) { histos.fill(HIST("FDD/hCountsTime2022"), 0); histos.fill(HIST("FDD/hInvTimevsBC2022"), localBC); } - if (fdd.timeA() < 30 && fdd.timeC() < 30) { + if (fdd.timeA() < minTimeFDD && fdd.timeC() < minTimeFDD) { histos.fill(HIST("FDD/hCountsTime2022"), 1); histos.fill(HIST("FDD/hValidTimevsBC2022"), localBC); } @@ -495,7 +587,7 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hTimeACoinc"), fdd.timeA()); histos.fill(HIST("FDD/hTimeCCoinc"), fdd.timeC()); if (!is2022Data) { - if (fdd.timeA() > 30) { + if (fdd.timeA() > minTimeFDD) { histos.fill(HIST("FDD/hCountsTimeA"), 0); histos.fill(HIST("FDD/hInvTimeAvsBC"), localBC); } else { @@ -503,7 +595,7 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hValidTimeAvsBC"), localBC); } - if (fdd.timeC() > 30) { + if (fdd.timeC() > minTimeFDD) { histos.fill(HIST("FDD/hCountsTimeC"), 0); histos.fill(HIST("FDD/hInvTimeCvsBC"), localBC); } else { @@ -511,11 +603,11 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hValidTimeCvsBC"), localBC); } - if (fdd.timeA() > 30 || fdd.timeC() > 30) { + if (fdd.timeA() > minTimeFDD || fdd.timeC() > minTimeFDD) { histos.fill(HIST("FDD/hCountsTime"), 0); histos.fill(HIST("FDD/hInvTimevsBC"), localBC); } - if (fdd.timeA() < 30 && fdd.timeC() < 30) { + if (fdd.timeA() < minTimeFDD && fdd.timeC() < minTimeFDD) { histos.fill(HIST("FDD/hCountsTime"), 1); histos.fill(HIST("FDD/hValidTimevsBC"), localBC); } @@ -549,7 +641,8 @@ struct LumiStabilityTask { auto sideCPast = fddPast.chargeC(); std::vector channelAPast; std::vector channelCPast; - for (auto i = 0; i < 8; i++) { + int maxNChanels = 8; + for (auto i = 0; i < maxNChanels; i++) { if (sideAPast[i] > 0) { channelAPast.push_back(i); } @@ -657,7 +750,7 @@ struct LumiStabilityTask { histos.fill(HIST("FT0/hTimeA"), ft0.timeA()); histos.fill(HIST("FT0/hTimeC"), ft0.timeC()); - if (ft0.timeA() > 30) { + if (ft0.timeA() > minTimeFDD) { histos.fill(HIST("FT0/hCountsTimeA"), 0); histos.fill(HIST("FT0/hInvTimeAvsBC"), localBC); } else { @@ -665,7 +758,7 @@ struct LumiStabilityTask { histos.fill(HIST("FT0/hValidTimeAvsBC"), localBC); } - if (ft0.timeC() > 30) { + if (ft0.timeC() > minTimeFDD) { histos.fill(HIST("FT0/hCountsTimeC"), 0); histos.fill(HIST("FT0/hInvTimeCvsBC"), localBC); } else { @@ -673,11 +766,11 @@ struct LumiStabilityTask { histos.fill(HIST("FT0/hValidTimeCvsBC"), localBC); } - if (ft0.timeA() > 30 || ft0.timeC() > 30) { + if (ft0.timeA() > minTimeFDD || ft0.timeC() > minTimeFDD) { histos.fill(HIST("FT0/hCountsTime"), 0); histos.fill(HIST("FT0/hInvTimevsBC"), localBC); } - if (ft0.timeA() < 30 && ft0.timeC() < 30) { + if (ft0.timeA() < minTimeFDD && ft0.timeC() < minTimeFDD) { histos.fill(HIST("FT0/hCountsTime"), 1); histos.fill(HIST("FT0/hValidTimevsBC"), localBC); }