Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions DPG/Tasks/AOTTrack/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Use kebab-case for names of workflows and match the name of the workflow file.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -12,7 +12,7 @@
add_subdirectory(PID)
add_subdirectory(V0Cascades)

o2physics_add_dpl_workflow(qa-trackselection

Check failure on line 15 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qa-trackselection does not match its file name qaTrackSelection.cxx. (Matches qaTrackselection.cxx.)
SOURCES qaTrackSelection.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -32,7 +32,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::ReconstructionDataFormats
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(qa-fakehits

Check failure on line 35 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qa-fakehits does not match its file name qaFakeHits.cxx. (Matches qaFakehits.cxx.)
SOURCES qaFakeHits.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -42,12 +42,12 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(qa-dca-mc

Check failure on line 45 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qa-dca-mc does not match its file name qaDcaMC.cxx. (Matches qaDcaMc.cxx.)
SOURCES qaDcaMC.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(qa-sign-charge-mc

Check failure on line 50 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qa-sign-charge-mc does not match its file name qaSignChargeMC.cxx. (Matches qaSignChargeMc.cxx.)
SOURCES qaSignChargeMC.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing
COMPONENT_NAME Analysis)
Expand All @@ -57,7 +57,7 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(qa-impact-parameter

Check failure on line 60 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qa-impact-parameter does not match its file name qaImpPar.cxx. (Matches qaImpactParameter.cxx.)
SOURCES qaImpPar.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
O2::ReconstructionDataFormats
Expand All @@ -65,7 +65,7 @@
O2::DetectorsVertexing
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(monitorfilterbit

Check failure on line 68 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name monitorfilterbit does not match its file name MonitorFilterBit.cxx. (Matches monitorfilterbit.cxx.)
SOURCES MonitorFilterBit.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -75,11 +75,16 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(qa-tracksplitting

Check failure on line 78 in DPG/Tasks/AOTTrack/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name qa-tracksplitting does not match its file name qaTrackSplitting.cxx. (Matches qaTracksplitting.cxx.)
SOURCES qaTrackSplitting.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(unit-test-for-reconstruction
SOURCES unitTestForReconstruction.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(tag-and-probe-dmesons
SOURCES tagAndProbeDmesons.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing O2Physics::MLCore
Expand Down
102 changes: 102 additions & 0 deletions DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// 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 unitTestForReconstruction.cxx
///
/// \brief Unit test for validating the reconstruction software
/// \author Alberto Caliva (alberto.caliva@cern.ch), Catalin-Lucian Ristea (catalin.ristea@cern.ch)
/// \since September 9, 2025

#include "Framework/ASoA.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/DataTypes.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/Logger.h"
#include "Framework/RunningWorkflowInfo.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/DCA.h"
#include "ReconstructionDataFormats/Track.h"

#include <cmath>
#include <memory>
#include <random>
#include <string>
#include <unordered_set>
#include <vector>

using namespace o2::soa;
using namespace o2::aod;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::constants::physics;
using namespace o2::constants::math;

struct UnitTestForReconstruction {

// Histogram registry
HistogramRegistry registryData{"registryData", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};

// global IDs of events to be inspected
Configurable<std::vector<int>> eventNr{"eventNr", {1, 5, 12, 44, 76, 99, 102, 115, 180, 220}, "eventNr"};
std::unordered_set<int> eventSet;

void init(InitContext const&)
{
// Define histogram to monitor event counts at different selection stages
registryData.add("eventCounter", "eventCounter", HistType::kTH1F, {{10, 0, 10, ""}});

// Define histogram for the transverse momentum spectrum of reconstructed charged tracks
registryData.add("ptChargedTracks", "ptChargedTracks", HistType::kTH2F, {{11, 0, 11, "event"}, {1000, 0, 10, "#it{p}_{T} (GeV/#it{c})"}});

// Fast lookup set from configurable event list
eventSet = std::unordered_set<int>(eventNr->begin(), eventNr->end());
}

// Process Data
void processData(o2::aod::Collisions const& collisions, o2::aod::Tracks const& tracks)
{
// Event index
int eventIndex = 0;
static constexpr int indexAllEvts = 0;

Check failure on line 70 in DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".

// Loop over reconstructed events
for (const auto& collision : collisions) {

// Event counter: before event selection
registryData.fill(HIST("eventCounter"), 0.5);

// Check if event global index is in the list of events to process
int ev = collision.globalIndex();
if (eventSet.count(ev)) {

// Increment event index
eventIndex++;

// Fill event counter
registryData.fill(HIST("eventCounter"), 1.5);

// Loop over reconstructed tracks
for (auto const& track : tracks) {
registryData.fill(HIST("ptChargedTracks"), indexAllEvts, track.pt());
registryData.fill(HIST("ptChargedTracks"), eventIndex, track.pt());
}
}
}
}
PROCESS_SWITCH(UnitTestForReconstruction, processData, "Process Data", true);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<UnitTestForReconstruction>(cfgc)};
}
Loading