From 1cf9b6b5958bc3546bdd205373f0fe0fd1bd2328 Mon Sep 17 00:00:00 2001 From: Roman Lavicka Date: Wed, 16 Oct 2024 22:13:19 +0200 Subject: [PATCH 1/2] adapting task to do run-level analysis --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 60 ++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index a49ee0c8f07..8c2f7ef5c4d 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -17,6 +17,9 @@ #include "Common/DataModel/EventSelection.h" +#include "PWGUD/DataModel/UDTables.h" +#include "PWGUD/Core/SGSelector.h" + #include using namespace o2; @@ -25,14 +28,23 @@ using namespace o2::framework::expressions; using BCsWithRun3Matchings = soa::Join; using CCs = soa::Join; +using FullSGUDCollision = soa::Join::iterator; struct UpcEventITSROFcounter { Service ccdb; + SGSelector sgSelector; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; 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"}; + ConfigurableAxis axisRunNumbers{"axisRunNumbers", {1400, 544000.5, 545400.5}, "Range of run numbers"}; + void init(InitContext&) { @@ -41,9 +53,18 @@ 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("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}); + histos.add("Runs/hUpcModeCollSG1", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); + histos.add("Runs/hStdModeCollSG0", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); + histos.add("Runs/hUpcModeCollSG0", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); + histos.add("Runs/hStdModeCollNG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); + histos.add("Runs/hUpcModeCollNG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers}); + } // end init - void process(BCsWithRun3Matchings const& bcs, CCs const& collisions) + void processCounterPerITSROF(BCsWithRun3Matchings const& bcs, CCs const& collisions) { int nAllColls = 0; int nUPCcolls = 0; @@ -119,7 +140,42 @@ struct UpcEventITSROFcounter { } } - PROCESS_SWITCH(UpcEventITSROFcounter, process, "Counts number of collisions within ITSROF", true); + + void processCounterPerRun(FullSGUDCollision const& coll) + { + + int gapSide = coll.gapSide(); + int trueGapSide = sgSelector.trueGap(coll, cutMyGapSideFV0, cutMyGapSideFT0A, cutMyGapSideFT0C, cutMyGapSideZDC); + if (useTrueGap) { + gapSide = trueGapSide; + } + + if (coll.flags() == 0){ + if (gapSide == 2){ + histos.get(HIST("Runs/hStdModeCollDG"))->Fill(coll.runNumber()); + } else if (gapSide == 1){ + histos.get(HIST("Runs/hStdModeCollSG1"))->Fill(coll.runNumber()); + } else if (gapSide == 0){ + histos.get(HIST("Runs/hStdModeCollSG0"))->Fill(coll.runNumber()); + } else { + histos.get(HIST("Runs/hStdModeCollNG"))->Fill(coll.runNumber()); + } + } else { + if (gapSide == 2) { + histos.get(HIST("Runs/hUpcModeCollDG"))->Fill(coll.runNumber()); + } else if (gapSide == 1) { + histos.get(HIST("Runs/hUpcModeCollSG1"))->Fill(coll.runNumber()); + } else if (gapSide == 0) { + histos.get(HIST("Runs/hUpcModeCollSG0"))->Fill(coll.runNumber()); + } else { + histos.get(HIST("Runs/hUpcModeCollNG"))->Fill(coll.runNumber()); + } + } + + } + + PROCESS_SWITCH(UpcEventITSROFcounter, processCounterPerITSROF, "Counts number of collisions per ITSROF", false); + PROCESS_SWITCH(UpcEventITSROFcounter, processCounterPerRun, "Counts number of whatever per RUN", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From 34e6688b8e6f51e3669d1d6bcf007d9d783f84e6 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 16 Oct 2024 20:14:50 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- PWGUD/Tasks/upcEventITSROFcounter.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 8c2f7ef5c4d..1da6fbfd26c 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -140,7 +140,6 @@ struct UpcEventITSROFcounter { } } - void processCounterPerRun(FullSGUDCollision const& coll) { @@ -150,12 +149,12 @@ struct UpcEventITSROFcounter { gapSide = trueGapSide; } - if (coll.flags() == 0){ - if (gapSide == 2){ + if (coll.flags() == 0) { + if (gapSide == 2) { histos.get(HIST("Runs/hStdModeCollDG"))->Fill(coll.runNumber()); - } else if (gapSide == 1){ + } else if (gapSide == 1) { histos.get(HIST("Runs/hStdModeCollSG1"))->Fill(coll.runNumber()); - } else if (gapSide == 0){ + } else if (gapSide == 0) { histos.get(HIST("Runs/hStdModeCollSG0"))->Fill(coll.runNumber()); } else { histos.get(HIST("Runs/hStdModeCollNG"))->Fill(coll.runNumber()); @@ -171,7 +170,6 @@ struct UpcEventITSROFcounter { histos.get(HIST("Runs/hUpcModeCollNG"))->Fill(coll.runNumber()); } } - } PROCESS_SWITCH(UpcEventITSROFcounter, processCounterPerITSROF, "Counts number of collisions per ITSROF", false);