Skip to content

Commit 55cd24f

Browse files
rolavickalibuild
andauthored
[PWGUD] Adding simple test on RCT flags implementation in UD tables (#11813)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 7f277cf commit 55cd24f

File tree

3 files changed

+96
-7
lines changed

3 files changed

+96
-7
lines changed

PWGUD/Tasks/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ o2physics_add_dpl_workflow(upc-quarkonia-central-barrel
230230
COMPONENT_NAME Analysis)
231231

232232
o2physics_add_dpl_workflow(test-mc-std-tabs-rl
233-
SOURCES testMCstdTabsRL.cxx
233+
SOURCES testMcStdTabsRl.cxx
234234
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsBase O2::DetectorsCommonDataFormats
235235
COMPONENT_NAME Analysis)
236236

@@ -253,3 +253,8 @@ o2physics_add_dpl_workflow(analysis-mc-dpm-jet-sg-v3
253253
SOURCES analysisMCDPMJetSGv3.cxx
254254
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
255255
COMPONENT_NAME Analysis)
256+
257+
o2physics_add_dpl_workflow(upc-test-rct-tables
258+
SOURCES upcTestRctTables.cxx
259+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
260+
COMPONENT_NAME Analysis)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12-
/// \file testMCstdTabsRL.cxx
12+
/// \file testMcStdTabsRl.cxx
1313
/// \brief task to test the Monte Carlo UD production generatorIDs on hyperloop
1414
///
1515
/// \author Roman Lavicka <roman.lavicka@cern.ch>, Austrian Academy of Sciences & SMI
1616
/// \since 12.02.2025
1717
//
1818

1919
// C++ headers
20+
#include <algorithm>
2021
#include <set>
2122
#include <utility>
22-
#include <algorithm>
2323
#include <vector>
2424

2525
// O2 headers
26-
#include "Framework/AnalysisTask.h"
2726
#include "Framework/AnalysisDataModel.h"
27+
#include "Framework/AnalysisTask.h"
2828
#include "Framework/HistogramRegistry.h"
2929
#include "Framework/O2DatabasePDGPlugin.h"
3030
#include "Framework/runDataProcessing.h"
@@ -40,7 +40,7 @@ using namespace o2::framework;
4040
using namespace o2::framework::expressions;
4141
using namespace o2::constants::physics;
4242

43-
struct TestMCstdTabsRL {
43+
struct TestMcStdTabsRl {
4444

4545
// Global varialbes
4646
Service<o2::framework::O2DatabasePDG> pdg;
@@ -97,11 +97,11 @@ struct TestMCstdTabsRL {
9797

9898
} // end processMCgenDG
9999

100-
PROCESS_SWITCH(TestMCstdTabsRL, processMCgen, "Iterate Monte Carlo UD tables with truth data.", true);
100+
PROCESS_SWITCH(TestMcStdTabsRl, processMCgen, "Iterate Monte Carlo UD tables with truth data.", true);
101101
};
102102

103103
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
104104
{
105105
return WorkflowSpec{
106-
adaptAnalysisTask<TestMCstdTabsRL>(cfgc)};
106+
adaptAnalysisTask<TestMcStdTabsRl>(cfgc)};
107107
}

PWGUD/Tasks/upcTestRctTables.cxx

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
//
12+
/// \file upcTestRctTables.cxx
13+
/// \brief Tests Rct Tables in UD tabl;es
14+
///
15+
/// \author Roman Lavicka <roman.lavicka@cern.ch>, Austrian Academy of Sciences & SMI
16+
/// \since 27.06.2025
17+
//
18+
19+
// O2 headers
20+
#include "Framework/AnalysisDataModel.h"
21+
#include "Framework/AnalysisTask.h"
22+
#include "Framework/HistogramRegistry.h"
23+
#include "Framework/O2DatabasePDGPlugin.h"
24+
#include "Framework/runDataProcessing.h"
25+
26+
// O2Physics headers
27+
#include "PWGUD/Core/SGSelector.h"
28+
#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"
29+
#include "PWGUD/DataModel/UDTables.h"
30+
31+
using namespace o2;
32+
using namespace o2::framework;
33+
using namespace o2::framework::expressions;
34+
35+
struct UpcTestRctTables {
36+
37+
// Global varialbes
38+
SGSelector sgSelector;
39+
40+
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
41+
42+
// declare configurables
43+
Configurable<bool> verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}};
44+
45+
using FullSGUDCollisions = soa::Join<aod::UDCollisions, aod::UDCollisionsSels, aod::UDCollisionSelExtras, aod::SGCollisions>;
46+
using FullSGUDCollision = FullSGUDCollisions::iterator;
47+
48+
// init
49+
void init(InitContext&)
50+
{
51+
if (verboseInfo)
52+
printMediumMessage("INIT METHOD");
53+
54+
histos.add("OutputTable/hRCTflags", ";RCTflag (-);Number of passed collision (-)", HistType::kTH1D, {{5, -0.5, 4.5}});
55+
56+
} // end init
57+
58+
void processDataSG(FullSGUDCollision const& reconstructedCollision)
59+
{
60+
61+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(0);
62+
63+
if (sgSelector.isCBTOk(reconstructedCollision))
64+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(1);
65+
66+
if (sgSelector.isCBTZdcOk(reconstructedCollision))
67+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(2);
68+
69+
if (sgSelector.isCBTHadronOk(reconstructedCollision))
70+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(3);
71+
72+
if (sgSelector.isCBTHadronZdcOk(reconstructedCollision))
73+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(4);
74+
75+
} // end processDataSG
76+
77+
PROCESS_SWITCH(UpcTestRctTables, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", true);
78+
};
79+
80+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
81+
{
82+
return WorkflowSpec{
83+
adaptAnalysisTask<UpcTestRctTables>(cfgc)};
84+
}

0 commit comments

Comments
 (0)