From a1b4482fc0a22715040166d23657a9a580506fec Mon Sep 17 00:00:00 2001 From: Roman Lavicka Date: Tue, 18 Feb 2025 13:02:54 +0100 Subject: [PATCH 1/7] Adding plot to count PV contributors per ITSROF against n collisions per ITSROF --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 1da6fbfd26c..2794711a374 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -14,7 +14,9 @@ #include "Framework/AnalysisDataModel.h" #include "ITSMFTBase/DPLAlpideParam.h" #include "CCDB/BasicCCDBManager.h" +#include "ReconstructionDataFormats/Vertex.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" #include "PWGUD/DataModel/UDTables.h" @@ -25,6 +27,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::dataformats; using BCsWithRun3Matchings = soa::Join; using CCs = soa::Join; @@ -53,6 +56,9 @@ struct UpcEventITSROFcounter { histos.add("Events/hCountCollisionsInROFborderMatching", ";;Number of collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}}); histos.add("Events/hCountUPCcollisionsInROFborderMatching", ";;Number of UPC (mult < 17) collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}}); + histos.add("Events/hPVcontribsVsCollisionsPerITSROFstd", "Collisions reconstructed with standard mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5},{11, -0.5, 10.5}}); + histos.add("Events/hPVcontribsVsCollisionsPerITSROFupc", "Collisions reconstructed with upc mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5},{11, -0.5, 10.5}}); + histos.add("Runs/hStdModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); histos.add("Runs/hUpcModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); histos.add("Runs/hStdModeCollSG1", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); @@ -138,6 +144,32 @@ struct UpcEventITSROFcounter { histos.get(HIST("Events/hCountCollisionsInROFborderMatching"))->Fill(ncol, arrAllColls[ncol]); histos.get(HIST("Events/hCountUPCcollisionsInROFborderMatching"))->Fill(ncol, arrUPCcolls[ncol]); } + + // TEST vertex contributors per reconstruction flag (std vs upc) + // matching of collision bc within ITSROF range in bcs + for (auto& itsrofBorder : vecITSROFborders) { + std::vector vecNumContribsStd; + std::vector vecNumContribsUpc; + for (auto& collision : collisions) { + if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) { + if (collision.flags() & dataformats::Vertex>::Flags::UPCMode) { + vecNumContribsUpc.push_back(collision.numContrib()); + } else { + vecNumContribsStd.push_back(collision.numContrib()); + } + } + } // end loop over collisions + + for (auto& numContribs : vecNumContribsStd) { + histos.get(HIST("Events/hPVcontribsVsCollisionsPerITSROFstd"))->Fill(numContribs, vecNumContribsStd.size()); + } + for (auto& numContribs : vecNumContribsUpc) { + histos.get(HIST("Events/hPVcontribsVsCollisionsPerITSROFupc"))->Fill(numContribs, vecNumContribsUpc.size()); + } + + } // end loop over ITSROFs + + } void processCounterPerRun(FullSGUDCollision const& coll) From be3ef905aea707de38f56d4ecac2801f968d8980 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 19 Feb 2025 09:54:05 +0000 Subject: [PATCH 2/7] Please consider the following formatting changes --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 2794711a374..75af23532af 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -56,8 +56,8 @@ struct UpcEventITSROFcounter { histos.add("Events/hCountCollisionsInROFborderMatching", ";;Number of collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}}); histos.add("Events/hCountUPCcollisionsInROFborderMatching", ";;Number of UPC (mult < 17) collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}}); - histos.add("Events/hPVcontribsVsCollisionsPerITSROFstd", "Collisions reconstructed with standard mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5},{11, -0.5, 10.5}}); - histos.add("Events/hPVcontribsVsCollisionsPerITSROFupc", "Collisions reconstructed with upc mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5},{11, -0.5, 10.5}}); + histos.add("Events/hPVcontribsVsCollisionsPerITSROFstd", "Collisions reconstructed with standard mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5}, {11, -0.5, 10.5}}); + histos.add("Events/hPVcontribsVsCollisionsPerITSROFupc", "Collisions reconstructed with upc mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5}, {11, -0.5, 10.5}}); histos.add("Runs/hStdModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); histos.add("Runs/hUpcModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); @@ -168,8 +168,6 @@ struct UpcEventITSROFcounter { } } // end loop over ITSROFs - - } void processCounterPerRun(FullSGUDCollision const& coll) From 7558ac9757a475183e9759ef578a1780fab31d12 Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 19 Feb 2025 11:07:39 +0100 Subject: [PATCH 3/7] Fixing megalinter and o2linter --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 75af23532af..ca893abc4e4 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -9,6 +9,15 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// \file upcEventITSROFcounter.cxx +/// \brief Personal task to analyze tau events from UPC collisions +/// +/// \author Roman Lavicka , Austrian Academy of Sciences & SMI +/// \since 09.08.2024 + +#include +#include + #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" @@ -84,7 +93,7 @@ struct UpcEventITSROFcounter { int64_t ts = bcs.iteratorAt(0).timestamp(); auto alppar = ccdb->getForTimeStamp>("ITS/Config/AlpideParam", ts); - for (auto bc : bcs) { + for (const auto& bc : bcs) { uint64_t globalBC = bc.globalBC(); uint64_t globalIndex = bc.globalIndex(); if (isFirst) { @@ -104,7 +113,7 @@ struct UpcEventITSROFcounter { previousBCinITSROF = bcInITSROF; previousBCglobalIndex = globalIndex; // next is based on exact matching of bc and collision - for (auto& collision : collisions) { + for (const auto& collision : collisions) { if (collision.has_foundBC()) { if (collision.foundBCId() == bc.globalIndex()) { nAllColls++; @@ -125,10 +134,10 @@ struct UpcEventITSROFcounter { int arrUPCcolls[1000] = {0}; // next is based on matching of collision bc within ITSROF range in bcs - for (auto& itsrofBorder : vecITSROFborders) { + for (const auto& itsrofBorder : vecITSROFborders) { int nAllCollsInROF = 0; int nUpcCollsInROF = 0; - for (auto& collision : collisions) { + for (const auto& collision : collisions) { if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) { nAllCollsInROF++; if (collision.numContrib() < nTracksForUPCevent + 1) { @@ -147,10 +156,10 @@ struct UpcEventITSROFcounter { // TEST vertex contributors per reconstruction flag (std vs upc) // matching of collision bc within ITSROF range in bcs - for (auto& itsrofBorder : vecITSROFborders) { + for (const auto& itsrofBorder : vecITSROFborders) { std::vector vecNumContribsStd; std::vector vecNumContribsUpc; - for (auto& collision : collisions) { + for (const auto& collision : collisions) { if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) { if (collision.flags() & dataformats::Vertex>::Flags::UPCMode) { vecNumContribsUpc.push_back(collision.numContrib()); @@ -160,10 +169,10 @@ struct UpcEventITSROFcounter { } } // end loop over collisions - for (auto& numContribs : vecNumContribsStd) { + for (const auto& numContribs : vecNumContribsStd) { histos.get(HIST("Events/hPVcontribsVsCollisionsPerITSROFstd"))->Fill(numContribs, vecNumContribsStd.size()); } - for (auto& numContribs : vecNumContribsUpc) { + for (const auto& numContribs : vecNumContribsUpc) { histos.get(HIST("Events/hPVcontribsVsCollisionsPerITSROFupc"))->Fill(numContribs, vecNumContribsUpc.size()); } From b605a3407b9038a0d81063c1071583cb9676d431 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 19 Feb 2025 10:08:15 +0000 Subject: [PATCH 4/7] Please consider the following formatting changes --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index ca893abc4e4..4c34b854af4 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -128,7 +128,7 @@ struct UpcEventITSROFcounter { } } } // end loop over collisions - } // end loop over bcs + } // end loop over bcs int arrAllColls[1000] = {0}; int arrUPCcolls[1000] = {0}; From f440c8fb9d685dcb82ddc8b7bc5a1d8564b486b7 Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 19 Feb 2025 11:26:15 +0100 Subject: [PATCH 5/7] o2linter --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 4c34b854af4..5899eacb83e 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -51,10 +51,10 @@ struct UpcEventITSROFcounter { Configurable nTracksForUPCevent{"nTracksForUPCevent", 16, {"Maximum of tracks defining a UPC collision"}}; Configurable useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}}; - Configurable cutMyGapSideFV0{"FV0", -1, "FV0A threshold for SG selector"}; - Configurable cutMyGapSideFT0A{"FT0A", 150., "FT0A threshold for SG selector"}; - Configurable cutMyGapSideFT0C{"FT0C", 50., "FT0C threshold for SG selector"}; - Configurable cutMyGapSideZDC{"ZDC", 10., "ZDC threshold for SG selector"}; + Configurable cutMyGapSideFV0{"cutMyGapSideFV0", -1, "FV0A threshold for SG selector"}; + Configurable cutMyGapSideFT0A{"FcutMyGapSideFT0AT0A", 150., "FT0A threshold for SG selector"}; + Configurable cutMyGapSideFT0C{"cutMyGapSideFT0C", 50., "FT0C threshold for SG selector"}; + Configurable cutMyGapSideZDC{"cutMyGapSideZDC", 10., "ZDC threshold for SG selector"}; ConfigurableAxis axisRunNumbers{"axisRunNumbers", {1400, 544000.5, 545400.5}, "Range of run numbers"}; void init(InitContext&) @@ -218,5 +218,5 @@ struct UpcEventITSROFcounter { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc, TaskName{"upc-event-itsrof-counter"})}; + adaptAnalysisTask(cfgc)}; } From 342f85fd6b61c249c0e9e214dfbf49798c5772b6 Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 19 Feb 2025 11:27:27 +0100 Subject: [PATCH 6/7] typo --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 5899eacb83e..f6783152314 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -52,7 +52,7 @@ struct UpcEventITSROFcounter { Configurable useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}}; Configurable cutMyGapSideFV0{"cutMyGapSideFV0", -1, "FV0A threshold for SG selector"}; - Configurable cutMyGapSideFT0A{"FcutMyGapSideFT0AT0A", 150., "FT0A threshold for SG selector"}; + Configurable cutMyGapSideFT0A{"cutMyGapSideFT0AT0A", 150., "FT0A threshold for SG selector"}; Configurable cutMyGapSideFT0C{"cutMyGapSideFT0C", 50., "FT0C threshold for SG selector"}; Configurable cutMyGapSideZDC{"cutMyGapSideZDC", 10., "ZDC threshold for SG selector"}; ConfigurableAxis axisRunNumbers{"axisRunNumbers", {1400, 544000.5, 545400.5}, "Range of run numbers"}; From 5e44f40dadd97f67cd41e8571e5a0c2ee9867125 Mon Sep 17 00:00:00 2001 From: rolavick Date: Wed, 19 Feb 2025 11:28:40 +0100 Subject: [PATCH 7/7] typo --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index f6783152314..51241be5d69 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -52,7 +52,7 @@ struct UpcEventITSROFcounter { Configurable useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}}; Configurable cutMyGapSideFV0{"cutMyGapSideFV0", -1, "FV0A threshold for SG selector"}; - Configurable cutMyGapSideFT0A{"cutMyGapSideFT0AT0A", 150., "FT0A threshold for SG selector"}; + Configurable cutMyGapSideFT0A{"cutMyGapSideFT0A", 150., "FT0A threshold for SG selector"}; Configurable cutMyGapSideFT0C{"cutMyGapSideFT0C", 50., "FT0C threshold for SG selector"}; Configurable cutMyGapSideZDC{"cutMyGapSideZDC", 10., "ZDC threshold for SG selector"}; ConfigurableAxis axisRunNumbers{"axisRunNumbers", {1400, 544000.5, 545400.5}, "Range of run numbers"};