From 6e6989777dc1707bda391b3d354f51dc76ef3b90 Mon Sep 17 00:00:00 2001 From: Roman Lavicka Date: Fri, 27 Jun 2025 16:41:56 +0200 Subject: [PATCH 1/8] Adding simple test on RCT tables --- PWGUD/Tasks/CMakeLists.txt | 5 ++ PWGUD/Tasks/upcTestRctTables.cxx | 88 ++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 PWGUD/Tasks/upcTestRctTables.cxx diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index d828261167c..b66f9578aca 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -253,3 +253,8 @@ o2physics_add_dpl_workflow(analysis-mc-dpm-jet-sg-v3 SOURCES analysisMCDPMJetSGv3.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(upc-test-rct-tables + SOURCES upcTestRctTables.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis) \ No newline at end of file diff --git a/PWGUD/Tasks/upcTestRctTables.cxx b/PWGUD/Tasks/upcTestRctTables.cxx new file mode 100644 index 00000000000..dca49a834ee --- /dev/null +++ b/PWGUD/Tasks/upcTestRctTables.cxx @@ -0,0 +1,88 @@ +// 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +// +/// \file upcTestRctTables.cxx +/// \brief Tests Rct Tables in UD tabl;es +/// +/// \author Roman Lavicka , Austrian Academy of Sciences & SMI +/// \since 27.06.2025 +// + +// O2 headers +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" + +// O2Physics headers +#include "PWGUD/DataModel/UDTables.h" +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" + + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + + +struct UpcTestRctTables { + + // Global varialbes + SGSelector sgSelector; + + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // declare configurables + Configurable verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}}; + + using FullSGUDCollisions = soa::Join; + using FullSGUDCollision = FullSGUDCollisions::iterator; + + + // init + void init(InitContext&) + { + if (verboseInfo) + printMediumMessage("INIT METHOD"); + + histos.add("OutputTable/hRCTflags", ";RCTflag (-);Number of passed collision (-)", HistType::kTH1D, {{5, -0.5, 4.5}}); + + } // end init + + void processDataSG(FullSGUDCollision const& reconstructedCollision) + { + + histos.get(HIST("OutputTable/hRCTflags"))->Fill(0); + + if (sgSelector.isCBTOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(1); + + if (sgSelector.isCBTZdcOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(2); + + if (sgSelector.isCBTHadronOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(3); + + if (sgSelector.isCBTHadronZdcOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(4); + + + } // end processDataSG + + PROCESS_SWITCH(UpcTestRctTables, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 07718d6522edefc35c9e6fb709698b8edea77174 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 27 Jun 2025 14:43:10 +0000 Subject: [PATCH 2/8] Please consider the following formatting changes --- PWGUD/Tasks/upcTestRctTables.cxx | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/PWGUD/Tasks/upcTestRctTables.cxx b/PWGUD/Tasks/upcTestRctTables.cxx index dca49a834ee..62bfb35549f 100644 --- a/PWGUD/Tasks/upcTestRctTables.cxx +++ b/PWGUD/Tasks/upcTestRctTables.cxx @@ -17,23 +17,21 @@ // // O2 headers -#include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" // O2Physics headers -#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" - +#include "PWGUD/DataModel/UDTables.h" using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; - struct UpcTestRctTables { // Global varialbes @@ -41,13 +39,12 @@ struct UpcTestRctTables { HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // declare configurables - Configurable verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}}; + // declare configurables + Configurable verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}}; using FullSGUDCollisions = soa::Join; using FullSGUDCollision = FullSGUDCollisions::iterator; - // init void init(InitContext&) { @@ -61,20 +58,19 @@ struct UpcTestRctTables { void processDataSG(FullSGUDCollision const& reconstructedCollision) { - histos.get(HIST("OutputTable/hRCTflags"))->Fill(0); - - if (sgSelector.isCBTOk(reconstructedCollision)) - histos.get(HIST("OutputTable/hRCTflags"))->Fill(1); + histos.get(HIST("OutputTable/hRCTflags"))->Fill(0); - if (sgSelector.isCBTZdcOk(reconstructedCollision)) - histos.get(HIST("OutputTable/hRCTflags"))->Fill(2); + if (sgSelector.isCBTOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(1); - if (sgSelector.isCBTHadronOk(reconstructedCollision)) - histos.get(HIST("OutputTable/hRCTflags"))->Fill(3); + if (sgSelector.isCBTZdcOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(2); - if (sgSelector.isCBTHadronZdcOk(reconstructedCollision)) - histos.get(HIST("OutputTable/hRCTflags"))->Fill(4); + if (sgSelector.isCBTHadronOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(3); + if (sgSelector.isCBTHadronZdcOk(reconstructedCollision)) + histos.get(HIST("OutputTable/hRCTflags"))->Fill(4); } // end processDataSG From 980a150f1283ada674ffac7803ac4d5b44769df2 Mon Sep 17 00:00:00 2001 From: rolavick Date: Fri, 27 Jun 2025 16:47:52 +0200 Subject: [PATCH 3/8] Make it a bit more versatile --- PWGUD/Tasks/upcTestRctTables.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/upcTestRctTables.cxx b/PWGUD/Tasks/upcTestRctTables.cxx index 62bfb35549f..5f6d1bd8db1 100644 --- a/PWGUD/Tasks/upcTestRctTables.cxx +++ b/PWGUD/Tasks/upcTestRctTables.cxx @@ -42,7 +42,7 @@ struct UpcTestRctTables { // declare configurables Configurable verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}}; - using FullSGUDCollisions = soa::Join; + using FullSGUDCollisions = soa::Join; using FullSGUDCollision = FullSGUDCollisions::iterator; // init From a2bdd7719c5fdf360c25ecf02e6bef66904bf968 Mon Sep 17 00:00:00 2001 From: rolavick Date: Fri, 27 Jun 2025 16:50:01 +0200 Subject: [PATCH 4/8] Update and rename testMCstdTabsRL.cxx to testMcStdTabsRl.cxx --- PWGUD/Tasks/{testMCstdTabsRL.cxx => testMcStdTabsRl.cxx} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename PWGUD/Tasks/{testMCstdTabsRL.cxx => testMcStdTabsRl.cxx} (97%) diff --git a/PWGUD/Tasks/testMCstdTabsRL.cxx b/PWGUD/Tasks/testMcStdTabsRl.cxx similarity index 97% rename from PWGUD/Tasks/testMCstdTabsRL.cxx rename to PWGUD/Tasks/testMcStdTabsRl.cxx index 34bd3085e64..ac8faaa5997 100644 --- a/PWGUD/Tasks/testMCstdTabsRL.cxx +++ b/PWGUD/Tasks/testMcStdTabsRl.cxx @@ -40,7 +40,7 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; -struct TestMCstdTabsRL { +struct TestMcStdTabsRl { // Global varialbes Service pdg; @@ -97,11 +97,11 @@ struct TestMCstdTabsRL { } // end processMCgenDG - PROCESS_SWITCH(TestMCstdTabsRL, processMCgen, "Iterate Monte Carlo UD tables with truth data.", true); + PROCESS_SWITCH(TestMcStdTabsRl, processMCgen, "Iterate Monte Carlo UD tables with truth data.", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From b038236fb87c6f9a73584dea510cb0970864057e Mon Sep 17 00:00:00 2001 From: rolavick Date: Fri, 27 Jun 2025 16:50:54 +0200 Subject: [PATCH 5/8] See what will be an effect on hyperloop when changing this --- PWGUD/Tasks/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index b66f9578aca..b97d4e13c1c 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -230,7 +230,7 @@ o2physics_add_dpl_workflow(upc-quarkonia-central-barrel COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(test-mc-std-tabs-rl - SOURCES testMCstdTabsRL.cxx + SOURCES TestMcStdTabsRl.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsBase O2::DetectorsCommonDataFormats COMPONENT_NAME Analysis) @@ -257,4 +257,4 @@ o2physics_add_dpl_workflow(analysis-mc-dpm-jet-sg-v3 o2physics_add_dpl_workflow(upc-test-rct-tables SOURCES upcTestRctTables.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) \ No newline at end of file + COMPONENT_NAME Analysis) From ff58b7385048df4c25ddbb9b96ec14de8664a54b Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 27 Jun 2025 14:51:25 +0000 Subject: [PATCH 6/8] Please consider the following formatting changes --- PWGUD/Tasks/testMcStdTabsRl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGUD/Tasks/testMcStdTabsRl.cxx b/PWGUD/Tasks/testMcStdTabsRl.cxx index ac8faaa5997..5294d315c01 100644 --- a/PWGUD/Tasks/testMcStdTabsRl.cxx +++ b/PWGUD/Tasks/testMcStdTabsRl.cxx @@ -17,14 +17,14 @@ // // C++ headers +#include #include #include -#include #include // O2 headers -#include "Framework/AnalysisTask.h" #include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" From 70d0335c1085e9cc14eb6ae8f954517e560266e1 Mon Sep 17 00:00:00 2001 From: rolavick Date: Fri, 27 Jun 2025 16:53:53 +0200 Subject: [PATCH 7/8] Update testMcStdTabsRl.cxx --- PWGUD/Tasks/testMcStdTabsRl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGUD/Tasks/testMcStdTabsRl.cxx b/PWGUD/Tasks/testMcStdTabsRl.cxx index 5294d315c01..ced8f2fdc66 100644 --- a/PWGUD/Tasks/testMcStdTabsRl.cxx +++ b/PWGUD/Tasks/testMcStdTabsRl.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -/// \file testMCstdTabsRL.cxx +/// \file testMcStdTabsRl.cxx /// \brief task to test the Monte Carlo UD production generatorIDs on hyperloop /// /// \author Roman Lavicka , Austrian Academy of Sciences & SMI From 46f42f9aaa76080ba46f6326911ab33c577103ea Mon Sep 17 00:00:00 2001 From: rolavick Date: Tue, 1 Jul 2025 09:41:53 +0200 Subject: [PATCH 8/8] Update CMakeLists.txt --- PWGUD/Tasks/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index b97d4e13c1c..37811e8dd4e 100644 --- a/PWGUD/Tasks/CMakeLists.txt +++ b/PWGUD/Tasks/CMakeLists.txt @@ -230,7 +230,7 @@ o2physics_add_dpl_workflow(upc-quarkonia-central-barrel COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(test-mc-std-tabs-rl - SOURCES TestMcStdTabsRl.cxx + SOURCES testMcStdTabsRl.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsBase O2::DetectorsCommonDataFormats COMPONENT_NAME Analysis) @@ -255,6 +255,6 @@ o2physics_add_dpl_workflow(analysis-mc-dpm-jet-sg-v3 COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(upc-test-rct-tables - SOURCES upcTestRctTables.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES upcTestRctTables.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + COMPONENT_NAME Analysis)