From e94d29e1d0cc83c1e7b71b0c27bb638b6eb680ab Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 20 May 2024 11:13:55 -0600 Subject: [PATCH 01/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 5938ec42cdd..f3e12950019 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -724,6 +724,11 @@ struct LumiStabilityTask { histos.fill(HIST("FT0/hCounts"), 3); histos.fill(HIST("FT0/bcVertexTriggerBothSidesPP"), localBC); } + if (pastActivityFT0Vertex == true) { + histos.fill(HIST("FT0/hCounts"), 3); + } else { + histos.fill(HIST("FT0/bcVertexTriggerPP"), localBC); + } } // vertex true if (sCentral) { From 0f17c52c9aa5d5c5859f38550467f996483b33af Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 15 Aug 2024 13:19:33 -0600 Subject: [PATCH 02/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index f3e12950019..e6d2b521e98 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -729,6 +729,10 @@ struct LumiStabilityTask { } else { histos.fill(HIST("FT0/bcVertexTriggerPP"), localBC); } + if (pastActivityFT0TriggerA == false || pastActivityFT0TriggerC == false) { + histos.fill(HIST("FT0/hCounts"), 3); + histos.fill(HIST("FT0/bcVertexTriggerBothSidesPP"), localBC); + } } // vertex true if (sCentral) { From c509336dee683052f8098c6cbe4ef66dcfeabbe9 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Fri, 27 Sep 2024 12:52:06 -0600 Subject: [PATCH 03/28] Adding informatioon about collision table --- PWGMM/Lumi/Tasks/lumiStability.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index e6d2b521e98..b0e5d090001 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -39,6 +39,7 @@ 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 From 8a56c942b93da39cde808bf7a0eeaec887cc4b92 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 30 Sep 2024 03:18:50 -0600 Subject: [PATCH 04/28] Adding informatioon about valid/invalid time flags of FDD and FT0 --- PWGMM/Lumi/Tasks/lumiStability.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index b0e5d090001..b6a9bd48b1a 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -39,7 +39,7 @@ using namespace o2; using namespace o2::framework; using BCsWithTimestamps = soa::Join; -//using CollisionWithFDD = soa::Join; +// using CollisionWithFDD = soa::Join; struct LumiStabilityTask { // Histogram registry: an object to hold your histograms @@ -107,6 +107,7 @@ struct LumiStabilityTask { histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); histos.add("tsValues", "", kTH1D, {{2, -0.5, 1.5}}); // 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/bcVertexTrigger", "vertex trigger per BC (FDD);BC in FDD; counts", kTH1F, {axisTrigger}); From 92968ec180ad874388bb89e399d69328892ac88f Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Wed, 2 Oct 2024 03:49:44 -0600 Subject: [PATCH 05/28] Ordering the kind of trigger to be used in the histogram entries --- PWGMM/Lumi/Tasks/lumiStability.cxx | 50 ++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index b6a9bd48b1a..fcb87521f10 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -466,14 +466,21 @@ struct LumiStabilityTask { } } - if (isCoinA && isCoinC) { - histos.fill(HIST("FDD/bcVertexTriggerCoincidence"), localBC); - histos.fill(HIST("FDD/hCounts"), 3); - histos.fill(HIST("hOrbitFDDVertexCoinc"), orbit - minOrbit); + if (deltaBC < myMaxDeltaBCFDD) { + std::bitset<8> fddTriggersPast = fdd_past.triggerMask(); + bool vertexPast = fddTriggersPast[o2::fdd::Triggers::bitVertex]; + pastActivityFDDVertex |= (vertexPast); + } + } + deltaIndex = 0; + deltaBC = 0; + if (pastActivityFDDVertex == false) { + histos.fill(HIST("FDD/hCounts"), 2); + histos.fill(HIST("FDD/bcVertexTriggerPP"), localBC); if (bcPatternA[localBC]) { - histos.fill(HIST("FDD/timeACbcA"), fdd.timeA(), fdd.timeC()); - histos.fill(HIST("FDD/hBcA"), localBC); + histos.fill(HIST("FDD/timeACbcAVertex"), fdd.timeA(), fdd.timeC()); + histos.fill(HIST("FDD/hBcAVertex"), localBC); } if (bcPatternC[localBC]) { histos.fill(HIST("FDD/timeACbcC"), fdd.timeA(), fdd.timeC()); @@ -523,6 +530,37 @@ struct LumiStabilityTask { } } } + if (bcPatternB[localBC]) { + histos.fill(HIST("FDD/timeACbcBVertex"), fdd.timeA(), fdd.timeC()); + histos.fill(HIST("FDD/hBcBVertex"), localBC); + } + if (bcPatternE[localBC]) { + histos.fill(HIST("FDD/timeACbcEVertex"), fdd.timeA(), fdd.timeC()); + histos.fill(HIST("FDD/hBcEVertex"), localBC); + } + } + + + if (isCoinA && isCoinC) { + histos.fill(HIST("FDD/bcVertexTriggerCoincidence"), localBC); + histos.fill(HIST("FDD/hCounts"), 3); + histos.fill(HIST("hOrbitFDDVertexCoinc"), orbit - minOrbit); + + if (bcPatternA[localBC]) { + histos.fill(HIST("FDD/timeACbcA"), fdd.timeA(), fdd.timeC()); + histos.fill(HIST("FDD/hBcA"), localBC); + } + if (bcPatternC[localBC]) { + histos.fill(HIST("FDD/timeACbcC"), fdd.timeA(), fdd.timeC()); + histos.fill(HIST("FDD/hBcC"), localBC); + } + if (bcPatternB[localBC]) { + histos.fill(HIST("FDD/timeACbcB"), fdd.timeA(), fdd.timeC()); + histos.fill(HIST("FDD/hBcB"), localBC); + histos.fill(HIST("FDD/hTimeA"), fdd.timeA()); + histos.fill(HIST("FDD/hTimeC"), fdd.timeC()); + + } if (bcPatternE[localBC]) { histos.fill(HIST("FDD/timeACbcE"), fdd.timeA(), fdd.timeC()); histos.fill(HIST("FDD/hBcE"), localBC); From 7503f6ebdfcfce9c1b4344de5d429f4632aad903 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 7 Oct 2024 10:31:41 -0600 Subject: [PATCH 06/28] correcting the histo of time for fdd --- PWGMM/Lumi/Tasks/lumiStability.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index fcb87521f10..e3747ec63f9 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -530,14 +530,6 @@ struct LumiStabilityTask { } } } - if (bcPatternB[localBC]) { - histos.fill(HIST("FDD/timeACbcBVertex"), fdd.timeA(), fdd.timeC()); - histos.fill(HIST("FDD/hBcBVertex"), localBC); - } - if (bcPatternE[localBC]) { - histos.fill(HIST("FDD/timeACbcEVertex"), fdd.timeA(), fdd.timeC()); - histos.fill(HIST("FDD/hBcEVertex"), localBC); - } } @@ -557,8 +549,8 @@ struct LumiStabilityTask { if (bcPatternB[localBC]) { histos.fill(HIST("FDD/timeACbcB"), fdd.timeA(), fdd.timeC()); histos.fill(HIST("FDD/hBcB"), localBC); - histos.fill(HIST("FDD/hTimeA"), fdd.timeA()); - histos.fill(HIST("FDD/hTimeC"), fdd.timeC()); + histos.fill(HIST("FDD/hTimeACoinc"), fdd.timeA()); + histos.fill(HIST("FDD/hTimeCCoinc"), fdd.timeC()); } if (bcPatternE[localBC]) { From 73931553c1a23e0d01e33393c8306c8fde8d7276 Mon Sep 17 00:00:00 2001 From: Josue laptop Date: Tue, 8 Oct 2024 14:26:26 +0200 Subject: [PATCH 07/28] adding the flags to 2022 data --- PWGMM/Lumi/Tasks/lumiStability.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index e3747ec63f9..90a3c71aadb 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -551,7 +551,6 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hBcB"), localBC); histos.fill(HIST("FDD/hTimeACoinc"), fdd.timeA()); histos.fill(HIST("FDD/hTimeCCoinc"), fdd.timeC()); - } if (bcPatternE[localBC]) { histos.fill(HIST("FDD/timeACbcE"), fdd.timeA(), fdd.timeC()); From 4f74f015e8bf4107e496e7118b6752cc2f954ff3 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 31 Oct 2024 00:32:00 -0600 Subject: [PATCH 08/28] Issue with access histos --- PWGMM/Lumi/Tasks/lumiStability.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 90a3c71aadb..282b5913c06 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -244,6 +244,7 @@ struct LumiStabilityTask { nOrbitsPerTF = 32; // 128 in 2022, 32 in 2023 } int runNumber = bcs.iteratorAt(0).runNumber(); + // std::string histName = "hOrbitFDDVertexCoinc_" + std::to_string(runNumber); if (runNumber != lastRunNumber && executionCounter < 1) { tsSOR = 0; tsEOR = 1; @@ -366,7 +367,7 @@ struct LumiStabilityTask { if (vertex) { histos.fill(HIST("FDD/bcVertexTrigger"), localBC); histos.fill(HIST("FDD/hCounts"), 1); - histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); + // histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); if (bcPatternB[localBC]) { histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds @@ -657,7 +658,7 @@ struct LumiStabilityTask { histos.fill(HIST("FT0/hCounts"), 0); if (vertex) { histos.fill(HIST("FT0/bcVertexTrigger"), localBC); - histos.fill(HIST("hOrbitFT0vertex"), orbit - minOrbit); + // histos.fill(HIST("hOrbitFT0vertex"), orbit - minOrbit); if (bcPatternA[localBC]) { histos.fill(HIST("FT0/timeACbcA"), ft0.timeA(), ft0.timeC()); @@ -813,7 +814,7 @@ struct LumiStabilityTask { } if (aCen) { - histos.fill(HIST("hOrbitFV0Central"), orbit - minOrbit); + // histos.fill(HIST("hOrbitFV0Central"), orbit - minOrbit); histos.fill(HIST("FV0/bcCenTrigger"), localBC); if (bcPatternA[localBC]) { From 053ba2d2dd91c85fad29ef3f3cfea2b3b1140917 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 31 Oct 2024 00:45:38 -0600 Subject: [PATCH 09/28] resolving issues --- PWGMM/Lumi/Tasks/lumiStability.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 282b5913c06..0c4e8605c56 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -35,6 +35,11 @@ #include "DataFormatsParameters/GRPLHCIFData.h" #include "DataFormatsParameters/GRPECSObject.h" +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; From 6f8b4c2e41cdd52c834af98d70cbb11eaa656f20 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 31 Oct 2024 00:51:10 -0600 Subject: [PATCH 10/28] resolving issues --- PWGMM/Lumi/Tasks/lumiStability.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 0c4e8605c56..e7852b4cd67 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -19,6 +19,11 @@ #include #include +#include +#include +#include +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -35,11 +40,6 @@ #include "DataFormatsParameters/GRPLHCIFData.h" #include "DataFormatsParameters/GRPECSObject.h" -#include -#include -#include -#include - using namespace o2; using namespace o2::framework; From d1907e35a42bc46a2dad21ef258baa52bb601889 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 31 Oct 2024 12:13:10 -0600 Subject: [PATCH 11/28] a solution for histo acces --- PWGMM/Lumi/Tasks/lumiStability.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index e7852b4cd67..92266573535 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -295,7 +295,7 @@ struct LumiStabilityTask { } } - EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", ts); + /*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 @@ -326,6 +326,7 @@ struct LumiStabilityTask { hTsValues->GetXaxis()->SetBinLabel(2, "tsEOR"); hTsValues->SetBinContent(1, tsSOR / 1000); // seconds hTsValues->SetBinContent(2, tsEOR / 1000); // seconds + std::cout << "<<<<<<<<<<<<<<<<<<<<<<<<< Orbits per second: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << nOrbits << std::endl;*/ } // create orbit-axis histograms on the fly with binning based on info from GRP if GRP is available @@ -337,6 +338,8 @@ struct LumiStabilityTask { // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); } + + for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); if (bc.timestamp() == 0) { @@ -372,7 +375,7 @@ struct LumiStabilityTask { if (vertex) { histos.fill(HIST("FDD/bcVertexTrigger"), localBC); histos.fill(HIST("FDD/hCounts"), 1); - // histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); + histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); if (bcPatternB[localBC]) { histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds @@ -663,7 +666,7 @@ struct LumiStabilityTask { histos.fill(HIST("FT0/hCounts"), 0); if (vertex) { histos.fill(HIST("FT0/bcVertexTrigger"), localBC); - // histos.fill(HIST("hOrbitFT0vertex"), orbit - minOrbit); + histos.fill(HIST("hOrbitFT0vertex"), orbit - minOrbit); if (bcPatternA[localBC]) { histos.fill(HIST("FT0/timeACbcA"), ft0.timeA(), ft0.timeC()); @@ -819,7 +822,7 @@ struct LumiStabilityTask { } if (aCen) { - // histos.fill(HIST("hOrbitFV0Central"), orbit - minOrbit); + histos.fill(HIST("hOrbitFV0Central"), orbit - minOrbit); histos.fill(HIST("FV0/bcCenTrigger"), localBC); if (bcPatternA[localBC]) { From abee8a4908ded2b24da83c61806c8fc8859f8735 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 31 Oct 2024 12:16:07 -0600 Subject: [PATCH 12/28] a solution for histo acces --- PWGMM/Lumi/Tasks/lumiStability.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 92266573535..434629dd879 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -338,8 +338,6 @@ struct LumiStabilityTask { // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); } - - for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); if (bc.timestamp() == 0) { From c442a7f6e6e0f850009c19d6d064ac8c8a00b40f Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 9 Dec 2024 23:28:28 -0600 Subject: [PATCH 13/28] new changes, --- PWGMM/Lumi/Tasks/lumiStability.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 434629dd879..c1bb1aca261 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -249,6 +249,8 @@ struct LumiStabilityTask { nOrbitsPerTF = 32; // 128 in 2022, 32 in 2023 } int runNumber = bcs.iteratorAt(0).runNumber(); + int64_t tsSOR = 0; + int64_t tsEOR = 1; // std::string histName = "hOrbitFDDVertexCoinc_" + std::to_string(runNumber); if (runNumber != lastRunNumber && executionCounter < 1) { tsSOR = 0; @@ -295,7 +297,7 @@ struct LumiStabilityTask { } } - /*EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", ts); + 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 @@ -374,6 +376,7 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/bcVertexTrigger"), localBC); histos.fill(HIST("FDD/hCounts"), 1); histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); + histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1000); // Converting ms into seconds if (bcPatternB[localBC]) { histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds From b501334053dee7582df53d01bc47044a3da7c775 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Tue, 17 Dec 2024 17:10:39 -0600 Subject: [PATCH 14/28] new changes, histo for rate calculus added --- PWGMM/Lumi/Tasks/lumiStability.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index c1bb1aca261..237cb03c0ce 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -249,8 +249,8 @@ struct LumiStabilityTask { nOrbitsPerTF = 32; // 128 in 2022, 32 in 2023 } int runNumber = bcs.iteratorAt(0).runNumber(); - int64_t tsSOR = 0; - int64_t tsEOR = 1; + int64_t tsSOR; + int64_t tsEOR; // std::string histName = "hOrbitFDDVertexCoinc_" + std::to_string(runNumber); if (runNumber != lastRunNumber && executionCounter < 1) { tsSOR = 0; @@ -339,6 +339,7 @@ struct LumiStabilityTask { // histos.add("hOrbitFT0vertex", "", kTH1F, {axisOrbits}); // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); } + // std::cout << "****************** tsSOR: " << (tsSOR) * 1.e-3 << " ************************* " << std::endl; for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); @@ -376,7 +377,10 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/bcVertexTrigger"), localBC); histos.fill(HIST("FDD/hCounts"), 1); histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); - histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1000); // Converting ms into seconds + // std::cout << "****************** timestamp - tsSOR: " << (bc.timestamp() - tsSOR) * 1000 << " ************************* " << std::endl; + // std::cout << "****************** timestamp: " << (bc.timestamp()) * 1000 << " ************************* " << std::endl; //1660925892880000 + // std::cout << "****************** tsSOR: " << (tsSOR) * 1000 << " ************************* " << std::endl; + histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds if (bcPatternB[localBC]) { histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds @@ -668,6 +672,7 @@ struct LumiStabilityTask { if (vertex) { histos.fill(HIST("FT0/bcVertexTrigger"), localBC); histos.fill(HIST("hOrbitFT0vertex"), orbit - minOrbit); + histos.fill(HIST("FT0/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds if (bcPatternA[localBC]) { histos.fill(HIST("FT0/timeACbcA"), ft0.timeA(), ft0.timeC()); From 1b8c8fb31780fa7a28371a6656b929311e5c37e6 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Thu, 19 Dec 2024 22:15:46 -0600 Subject: [PATCH 15/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 237cb03c0ce..5c8e89aa091 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -251,7 +251,6 @@ struct LumiStabilityTask { int runNumber = bcs.iteratorAt(0).runNumber(); int64_t tsSOR; int64_t tsEOR; - // std::string histName = "hOrbitFDDVertexCoinc_" + std::to_string(runNumber); if (runNumber != lastRunNumber && executionCounter < 1) { tsSOR = 0; tsEOR = 1; @@ -339,7 +338,6 @@ struct LumiStabilityTask { // histos.add("hOrbitFT0vertex", "", kTH1F, {axisOrbits}); // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); } - // std::cout << "****************** tsSOR: " << (tsSOR) * 1.e-3 << " ************************* " << std::endl; for (auto const& fdd : fdds) { auto bc = fdd.bc_as(); @@ -377,9 +375,6 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/bcVertexTrigger"), localBC); histos.fill(HIST("FDD/hCounts"), 1); histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); - // std::cout << "****************** timestamp - tsSOR: " << (bc.timestamp() - tsSOR) * 1000 << " ************************* " << std::endl; - // std::cout << "****************** timestamp: " << (bc.timestamp()) * 1000 << " ************************* " << std::endl; //1660925892880000 - // std::cout << "****************** tsSOR: " << (tsSOR) * 1000 << " ************************* " << std::endl; histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds if (bcPatternB[localBC]) { From 590410e8d619511b6005c228fb9fabba8997c084 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 23 Dec 2024 23:50:02 -0600 Subject: [PATCH 16/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 5c8e89aa091..dc34adbbc62 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -1,3 +1,9 @@ +/** + * \file lumiStability.cxx + * \brief Analysis over BCs to study the luminosity stability along time. + * \author josuem@cern.ch + */ + // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. From 4c0d8c728f5c00afdb65836d142b2ab6ebacc86b Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 23 Dec 2024 23:51:44 -0600 Subject: [PATCH 17/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index dc34adbbc62..4ca41d26965 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -1,9 +1,3 @@ -/** - * \file lumiStability.cxx - * \brief Analysis over BCs to study the luminosity stability along time. - * \author josuem@cern.ch - */ - // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. @@ -15,6 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // +<<<<<<< HEAD /// \file lumiStability.cxx /// \brief Analysis over BCs to study the luminosity stability along time. /// @@ -24,6 +19,12 @@ #include #include #include +======= +// \file lumiStability.cxx +// \brief Analysis over BCs to study the luminosity stability along time. +// \author josuem@cern.ch + +>>>>>>> d97ed2dd7 (new changes) #include #include From 4b4ea945089ad11ec19012d185a1eb451146ba4d Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Mon, 23 Dec 2024 23:56:52 -0600 Subject: [PATCH 18/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 4ca41d26965..6649c86394a 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -9,23 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -<<<<<<< HEAD /// \file lumiStability.cxx /// \brief Analysis over BCs to study the luminosity stability along time. /// /// \author Josue Martinez Garcia, josuem@cern.ch -#include -#include -#include -#include -======= -// \file lumiStability.cxx -// \brief Analysis over BCs to study the luminosity stability along time. -// \author josuem@cern.ch - ->>>>>>> d97ed2dd7 (new changes) - #include #include #include From a7cd73201350779f6ac7f6b6895de48b699520d4 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Tue, 24 Dec 2024 14:10:54 -0600 Subject: [PATCH 19/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 6649c86394a..91985b82260 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -244,8 +244,8 @@ struct LumiStabilityTask { nOrbitsPerTF = 32; // 128 in 2022, 32 in 2023 } int runNumber = bcs.iteratorAt(0).runNumber(); - int64_t tsSOR; - int64_t tsEOR; + int64_t tsSOR = 0; + int64_t tsEOR = 1; if (runNumber != lastRunNumber && executionCounter < 1) { tsSOR = 0; tsEOR = 1; From 789d0d8c9d9c969efc4f5ce76ec8e77409c52a5d Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Tue, 1 Apr 2025 08:32:09 -0600 Subject: [PATCH 20/28] adding leading BC pattern and corrections for rate --- PWGMM/Lumi/Tasks/lumiStability.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 91985b82260..c597c6a8cfc 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -244,8 +244,6 @@ struct LumiStabilityTask { nOrbitsPerTF = 32; // 128 in 2022, 32 in 2023 } int runNumber = bcs.iteratorAt(0).runNumber(); - int64_t tsSOR = 0; - int64_t tsEOR = 1; if (runNumber != lastRunNumber && executionCounter < 1) { tsSOR = 0; tsEOR = 1; From cfab3d1e603e704c8d33f42f2c25b5df9cadbf04 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Tue, 1 Apr 2025 13:16:08 -0600 Subject: [PATCH 21/28] adding leading BC pattern and corrections for rate --- PWGMM/Lumi/Tasks/lumiStability.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index c597c6a8cfc..f9cfe3d652a 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -289,7 +289,7 @@ struct LumiStabilityTask { } } - EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", ts); + /*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 From 465c2fcaf83e42bc389f4d64d822402743962198 Mon Sep 17 00:00:00 2001 From: Josue-MiniPC Date: Fri, 11 Apr 2025 03:14:38 -0600 Subject: [PATCH 22/28] new changes --- PWGMM/Lumi/Tasks/lumiStability.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index f9cfe3d652a..825ddbd9d7b 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -368,7 +368,22 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/bcVertexTrigger"), localBC); histos.fill(HIST("FDD/hCounts"), 1); histos.fill(HIST("hOrbitFDDVertex"), orbit - minOrbit); - histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds + + if (bcPatternB[localBC]) { + histos.fill(HIST("FDD/hTimeForRate"), (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) + histos.fill(HIST("FDD/hTimeForRateLeadingBC"), (bc.timestamp() - tsSOR) * 1.e-3); + } if (bcPatternB[localBC]) { histos.fill(HIST("FDD/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds @@ -660,7 +675,6 @@ struct LumiStabilityTask { if (vertex) { histos.fill(HIST("FT0/bcVertexTrigger"), localBC); histos.fill(HIST("hOrbitFT0vertex"), orbit - minOrbit); - histos.fill(HIST("FT0/hTimeForRate"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds if (bcPatternA[localBC]) { histos.fill(HIST("FT0/timeACbcA"), ft0.timeA(), ft0.timeC()); From b29ff3a09105df61bda45081937a83a78d864b4c Mon Sep 17 00:00:00 2001 From: josue-MiniPC-Ubuntu Date: Thu, 23 Oct 2025 16:33:06 -0600 Subject: [PATCH 23/28] adding histos for CTP triggers masks FDD, FT0, FV0 --- PWGMM/Lumi/Tasks/lumiStability.cxx | 86 +++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 825ddbd9d7b..44ced80cde5 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -14,26 +14,27 @@ /// /// \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/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; @@ -110,6 +111,7 @@ struct LumiStabilityTask { // 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/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}); @@ -164,9 +166,12 @@ 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/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}); @@ -195,9 +200,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}); @@ -214,6 +222,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) @@ -332,6 +342,54 @@ struct LumiStabilityTask { // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); } + for (auto& 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; + + if (bcPatternB[localBC]) { + if (trgFDD) { + histos.fill(HIST("FDD/bcVertexTriggerCTP"), localBC); + histos.fill(HIST("FDD/hTimeForRateCTP"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds + } + if (trgFT0) { + 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/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); + } + if (trgFT0) { + 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) { From a039d9b52e61e15891e558a2ec4bd1b5840aedfc Mon Sep 17 00:00:00 2001 From: Josue Martinez Garcia Date: Wed, 12 Nov 2025 21:27:57 -0600 Subject: [PATCH 24/28] doing a rebase from master branch --- PWGMM/Lumi/Tasks/lumiStability.cxx | 69 +++--------------------------- 1 file changed, 7 insertions(+), 62 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 44ced80cde5..600c32d8696 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -299,7 +299,7 @@ struct LumiStabilityTask { } } - /*EventSelectionParams* par = ccdb->getForTimeStamp("EventSelection/EventSelectionParams", ts); + 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 @@ -330,7 +330,6 @@ struct LumiStabilityTask { hTsValues->GetXaxis()->SetBinLabel(2, "tsEOR"); hTsValues->SetBinContent(1, tsSOR / 1000); // seconds hTsValues->SetBinContent(2, tsEOR / 1000); // seconds - std::cout << "<<<<<<<<<<<<<<<<<<<<<<<<< Orbits per second: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << nOrbits << std::endl;*/ } // create orbit-axis histograms on the fly with binning based on info from GRP if GRP is available @@ -443,22 +442,6 @@ struct LumiStabilityTask { histos.fill(HIST("FDD/hTimeForRateLeadingBC"), (bc.timestamp() - tsSOR) * 1.e-3); } - if (bcPatternB[localBC]) { - histos.fill(HIST("FDD/hTimeForRate"), (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) - histos.fill(HIST("FDD/hTimeForRateLeadingBC"), (bc.timestamp() - tsSOR) * 1.e-3); - } - int deltaIndex = 0; // backward move counts int deltaBC = 0; // current difference wrt globalBC bool pastActivityFDDVertex = false; @@ -541,21 +524,14 @@ struct LumiStabilityTask { } } - if (deltaBC < myMaxDeltaBCFDD) { - std::bitset<8> fddTriggersPast = fdd_past.triggerMask(); - bool vertexPast = fddTriggersPast[o2::fdd::Triggers::bitVertex]; - pastActivityFDDVertex |= (vertexPast); - } - } - deltaIndex = 0; - deltaBC = 0; + if (isCoinA && isCoinC) { + histos.fill(HIST("FDD/bcVertexTriggerCoincidence"), localBC); + histos.fill(HIST("FDD/hCounts"), 3); + histos.fill(HIST("hOrbitFDDVertexCoinc"), orbit - minOrbit); - if (pastActivityFDDVertex == false) { - histos.fill(HIST("FDD/hCounts"), 2); - histos.fill(HIST("FDD/bcVertexTriggerPP"), localBC); if (bcPatternA[localBC]) { - histos.fill(HIST("FDD/timeACbcAVertex"), fdd.timeA(), fdd.timeC()); - histos.fill(HIST("FDD/hBcAVertex"), localBC); + histos.fill(HIST("FDD/timeACbcA"), fdd.timeA(), fdd.timeC()); + histos.fill(HIST("FDD/hBcA"), localBC); } if (bcPatternC[localBC]) { histos.fill(HIST("FDD/timeACbcC"), fdd.timeA(), fdd.timeC()); @@ -605,28 +581,6 @@ struct LumiStabilityTask { } } } - } - - - if (isCoinA && isCoinC) { - histos.fill(HIST("FDD/bcVertexTriggerCoincidence"), localBC); - histos.fill(HIST("FDD/hCounts"), 3); - histos.fill(HIST("hOrbitFDDVertexCoinc"), orbit - minOrbit); - - if (bcPatternA[localBC]) { - histos.fill(HIST("FDD/timeACbcA"), fdd.timeA(), fdd.timeC()); - histos.fill(HIST("FDD/hBcA"), localBC); - } - if (bcPatternC[localBC]) { - histos.fill(HIST("FDD/timeACbcC"), fdd.timeA(), fdd.timeC()); - histos.fill(HIST("FDD/hBcC"), localBC); - } - if (bcPatternB[localBC]) { - histos.fill(HIST("FDD/timeACbcB"), fdd.timeA(), fdd.timeC()); - histos.fill(HIST("FDD/hBcB"), localBC); - histos.fill(HIST("FDD/hTimeACoinc"), fdd.timeA()); - histos.fill(HIST("FDD/hTimeCCoinc"), fdd.timeC()); - } if (bcPatternE[localBC]) { histos.fill(HIST("FDD/timeACbcE"), fdd.timeA(), fdd.timeC()); histos.fill(HIST("FDD/hBcE"), localBC); @@ -830,15 +784,6 @@ struct LumiStabilityTask { histos.fill(HIST("FT0/hCounts"), 3); histos.fill(HIST("FT0/bcVertexTriggerBothSidesPP"), localBC); } - if (pastActivityFT0Vertex == true) { - histos.fill(HIST("FT0/hCounts"), 3); - } else { - histos.fill(HIST("FT0/bcVertexTriggerPP"), localBC); - } - if (pastActivityFT0TriggerA == false || pastActivityFT0TriggerC == false) { - histos.fill(HIST("FT0/hCounts"), 3); - histos.fill(HIST("FT0/bcVertexTriggerBothSidesPP"), localBC); - } } // vertex true if (sCentral) { From f6dc2ff3397d5a8b44818bcf98eccd8e59d33600 Mon Sep 17 00:00:00 2001 From: Josue Martinez Garcia Date: Tue, 18 Nov 2025 01:45:00 -0600 Subject: [PATCH 25/28] adding histo for rate correction by filled jobs in alihyperloop --- PWGMM/Lumi/Tasks/lumiStability.cxx | 89 +++++++++++++++++++----------- 1 file changed, 57 insertions(+), 32 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 600c32d8696..11387e7556b 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -15,6 +15,7 @@ /// \author Josue Martinez Garcia, josuem@cern.ch #include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -57,8 +58,10 @@ 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; int64_t bcSOR = 0; // global bc of the start of the first orbit, setting 0 by default for unanchored MC @@ -90,6 +93,7 @@ struct LumiStabilityTask { 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 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}); @@ -107,10 +111,13 @@ 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/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}); @@ -171,6 +178,7 @@ struct LumiStabilityTask { 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/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}); @@ -243,6 +251,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; @@ -264,7 +277,7 @@ struct LumiStabilityTask { int64_t ts = bcs.iteratorAt(0).timestamp(); // access colliding and beam-gas bc patterns - auto grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); + grplhcif = ccdb->getForTimeStamp("GLO/Config/GRPLHCIF", ts); beamPatternA = grplhcif->getBunchFilling().getBeamPattern(0); beamPatternC = grplhcif->getBunchFilling().getBeamPattern(1); bcPatternA = beamPatternA & ~beamPatternC; @@ -345,6 +358,7 @@ struct LumiStabilityTask { if (bc.timestamp() == 0) { continue; } + std::bitset<64> ctpInputMask(bc.inputMask()); bool trgFDD = ctpInputMask[15]; bool trgFT0 = ctpInputMask[2]; @@ -353,40 +367,51 @@ struct LumiStabilityTask { int64_t globalBC = bc.globalBC(); int localBC = globalBC % nBCsPerOrbit; - if (bcPatternB[localBC]) { - if (trgFDD) { - histos.fill(HIST("FDD/bcVertexTriggerCTP"), localBC); - histos.fill(HIST("FDD/hTimeForRateCTP"), (bc.timestamp() - tsSOR) * 1.e-3); // Converting ms into seconds - } - if (trgFT0) { - 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/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); - } - if (trgFT0) { - histos.fill(HIST("FT0/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); + 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 (trgFV0) { - histos.fill(HIST("FV0/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); + } + if (isLeadBC) + if (trgFDD) { + histos.fill(HIST("FDD/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); } + if (trgFT0) { + 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) { From d141b09cc8923d09cf32db814b9113d22da7ebd3 Mon Sep 17 00:00:00 2001 From: Josue Martinez Garcia Date: Tue, 18 Nov 2025 01:59:38 -0600 Subject: [PATCH 26/28] fixing O2 linter issues --- PWGMM/Lumi/Tasks/lumiStability.cxx | 168 +++++++++++++++-------------- 1 file changed, 85 insertions(+), 83 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 11387e7556b..6b281dd2e41 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -64,6 +64,7 @@ struct LumiStabilityTask { 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; @@ -273,78 +274,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 - 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), ""}; @@ -354,7 +354,7 @@ struct LumiStabilityTask { // histos.add("hOrbitFV0Central", "", kTH1F, {axisOrbits}); } - for (auto& bc : bcs) { + for (auto const& bc : bcs) { if (bc.timestamp() == 0) { continue; } @@ -433,11 +433,12 @@ struct LumiStabilityTask { auto sideC = fdd.chargeC(); std::vector channelA; std::vector channelC; + int minLimit = 0; for (auto i = 0; i < 8; i++) { - if (sideA[i] > 0) { + if (sideA[i] > minLimit) { channelA.push_back(i); } - if (sideC[i] > 0) { + if (sideC[i] > minLimit) { channelC.push_back(i); } } @@ -517,7 +518,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 { @@ -525,7 +526,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 { @@ -533,11 +534,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); } @@ -580,7 +581,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 { @@ -588,7 +589,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 { @@ -596,11 +597,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); } @@ -634,7 +635,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); } @@ -742,7 +744,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 { @@ -750,7 +752,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 { @@ -758,11 +760,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); } From cd7d8a210de72f18ae1560a6944956f2b31400ee Mon Sep 17 00:00:00 2001 From: Josue Martinez Garcia Date: Tue, 18 Nov 2025 02:05:38 -0600 Subject: [PATCH 27/28] fixing O2 linter issues --- PWGMM/Lumi/Tasks/lumiStability.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 6b281dd2e41..195631d640b 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -93,7 +93,7 @@ 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}); @@ -434,7 +434,8 @@ struct LumiStabilityTask { std::vector channelA; std::vector channelC; int minLimit = 0; - for (auto i = 0; i < 8; i++) { + int maxNChanels = 8; + for (auto i = 0; i < maxNChanels; i++) { if (sideA[i] > minLimit) { channelA.push_back(i); } @@ -635,7 +636,7 @@ struct LumiStabilityTask { auto sideCPast = fddPast.chargeC(); std::vector channelAPast; std::vector channelCPast; - int maxNChanels = 8 + int maxNChanels = 8; for (auto i = 0; i < maxNChanels; i++) { if (sideAPast[i] > 0) { channelAPast.push_back(i); From 02188cc552b6945e87231c9c3a158887c9d3328d Mon Sep 17 00:00:00 2001 From: Josue Martinez Garcia Date: Tue, 18 Nov 2025 02:16:21 -0600 Subject: [PATCH 28/28] fixing Megalinter issues --- PWGMM/Lumi/Tasks/lumiStability.cxx | 71 ++++++++++++++++-------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 195631d640b..cd8af5e0307 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -119,6 +119,7 @@ struct LumiStabilityTask { // 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}); @@ -180,6 +181,7 @@ struct LumiStabilityTask { 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}); @@ -376,42 +378,45 @@ struct LumiStabilityTask { 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 (bcPatternB[localBC]) { if (trgFDD) { - histos.fill(HIST("FDD/hTimeForRateLeadingBCCTP"), (bc.timestamp() - tsSOR) * 1.e-3); + 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); + } } - if (trgFT0) { - 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) {