Skip to content

Commit 6e69897

Browse files
committed
Adding simple test on RCT tables
1 parent 0ed7e05 commit 6e69897

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

PWGUD/Tasks/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

PWGUD/Tasks/upcTestRctTables.cxx

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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/AnalysisTask.h"
21+
#include "Framework/AnalysisDataModel.h"
22+
#include "Framework/HistogramRegistry.h"
23+
#include "Framework/O2DatabasePDGPlugin.h"
24+
#include "Framework/runDataProcessing.h"
25+
26+
// O2Physics headers
27+
#include "PWGUD/DataModel/UDTables.h"
28+
#include "PWGUD/Core/SGSelector.h"
29+
#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"
30+
31+
32+
using namespace o2;
33+
using namespace o2::framework;
34+
using namespace o2::framework::expressions;
35+
36+
37+
struct UpcTestRctTables {
38+
39+
// Global varialbes
40+
SGSelector sgSelector;
41+
42+
HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
43+
44+
// declare configurables
45+
Configurable<bool> verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}};
46+
47+
using FullSGUDCollisions = soa::Join<aod::UDCollisions, aod::UDCollisionsSels, aod::UDCollisionSelExtras, aod::SGCollisions, aod::UDZdcsReduced>;
48+
using FullSGUDCollision = FullSGUDCollisions::iterator;
49+
50+
51+
// init
52+
void init(InitContext&)
53+
{
54+
if (verboseInfo)
55+
printMediumMessage("INIT METHOD");
56+
57+
histos.add("OutputTable/hRCTflags", ";RCTflag (-);Number of passed collision (-)", HistType::kTH1D, {{5, -0.5, 4.5}});
58+
59+
} // end init
60+
61+
void processDataSG(FullSGUDCollision const& reconstructedCollision)
62+
{
63+
64+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(0);
65+
66+
if (sgSelector.isCBTOk(reconstructedCollision))
67+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(1);
68+
69+
if (sgSelector.isCBTZdcOk(reconstructedCollision))
70+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(2);
71+
72+
if (sgSelector.isCBTHadronOk(reconstructedCollision))
73+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(3);
74+
75+
if (sgSelector.isCBTHadronZdcOk(reconstructedCollision))
76+
histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(4);
77+
78+
79+
} // end processDataSG
80+
81+
PROCESS_SWITCH(UpcTestRctTables, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", true);
82+
};
83+
84+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
85+
{
86+
return WorkflowSpec{
87+
adaptAnalysisTask<UpcTestRctTables>(cfgc)};
88+
}

0 commit comments

Comments
 (0)