diff --git a/PWGUD/Tasks/CMakeLists.txt b/PWGUD/Tasks/CMakeLists.txt index d828261167c..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) @@ -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) 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..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 @@ -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" @@ -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)}; } diff --git a/PWGUD/Tasks/upcTestRctTables.cxx b/PWGUD/Tasks/upcTestRctTables.cxx new file mode 100644 index 00000000000..5f6d1bd8db1 --- /dev/null +++ b/PWGUD/Tasks/upcTestRctTables.cxx @@ -0,0 +1,84 @@ +// 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/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" + +// O2Physics headers +#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 + 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)}; +}