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 PWGLF/Tasks/QC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
# granted to it by virtue of its status as an Intergovernmental Organization
# or submit itself to any jurisdiction.

o2physics_add_dpl_workflow(v0cascades-qa

Check failure on line 12 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name v0cascades-qa does not match its file name v0cascadesqa.cxx. (Matches v0cascadesQa.cxx.)
SOURCES v0cascadesqa.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(track-checks

Check failure on line 17 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name track-checks does not match its file name trackchecks.cxx. (Matches trackChecks.cxx.)
SOURCES trackchecks.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -24,27 +24,27 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(pid-qa

Check failure on line 27 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name pid-qa does not match its file name lfpidqa.cxx. (Matches pidQa.cxx.)
SOURCES lfpidqa.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(strarecostudy

Check failure on line 32 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name strarecostudy does not match its file name straRecoStudy.cxx. (Matches strarecostudy.cxx.)
SOURCES straRecoStudy.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(kfperformancestudy

Check failure on line 37 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name kfperformancestudy does not match its file name kfPerformanceStudy.cxx. (Matches kfperformancestudy.cxx.)
SOURCES kfPerformanceStudy.cxx
PUBLIC_LINK_LIBRARIES O2::DetectorsBase O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(its-tpc-matching-qa

Check failure on line 42 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name its-tpc-matching-qa does not match its file name lfITSTPCMatchingQA.cxx. (Matches itsTpcMatchingQa.cxx.)
SOURCES lfITSTPCMatchingQA.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(strangeness-tracking-qc

Check failure on line 47 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name strangeness-tracking-qc does not match its file name strangenessTrackingQC.cxx. (Matches strangenessTrackingQc.cxx.)
SOURCES strangenessTrackingQC.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::ReconstructionDataFormats O2Physics::AnalysisCore O2::DetectorsBase
COMPONENT_NAME Analysis)
Expand All @@ -55,17 +55,17 @@
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(lfpropstudy

Check failure on line 58 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name lfpropstudy does not match its file name lfpropStudy.cxx. (Matches lfpropstudy.cxx.)
SOURCES lfpropStudy.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(tpc-dedx-postcalibration

Check failure on line 63 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name tpc-dedx-postcalibration does not match its file name tpc_dEdx_postcalibration.cxx. (Matches tpcDedxPostcalibration.cxx.)
SOURCES tpc_dEdx_postcalibration.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(tpc-dedx-qa

Check failure on line 68 in PWGLF/Tasks/QC/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name tpc-dedx-qa does not match its file name tpc_dedx_qa.cxx. (Matches tpcDedxQa.cxx.)
SOURCES tpc_dedx_qa.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand Down Expand Up @@ -138,4 +138,9 @@
o2physics_add_dpl_workflow(v0assoqa
SOURCES v0assoqa.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(systematics-mapping
SOURCES systematicsMapping.cxx
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
152 changes: 152 additions & 0 deletions PWGLF/Tasks/QC/systematicsMapping.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// 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 systematicsMapping.cxx
/// \brief Task to perform a systematics study for K0s and charged Kaons
/// \author Nicolò Jacazio, Universita del Piemonte Orientale (IT)
/// \since September 22, 2025

#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/PIDResponseTOF.h"
#include "Common/DataModel/PIDResponseTPC.h"

#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisTask.h>
#include <Framework/HistogramRegistry.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/Track.h>

#include <algorithm>

using namespace o2;
using namespace o2::framework;

struct SystematicsMapping {
// Returns a unique index for the combination of cuts
ConfigurableAxis ptBins{"ptBins", {100, 0.f, 10.f}, "Binning for pT (GeV/c)"};
ConfigurableAxis etaBins{"etaBins", {40, -1.0f, 1.0f}, "Binning for #eta"};
ConfigurableAxis phiBins{"phiBins", {36, 0.f, o2::constants::math::TwoPI}, "Binning for #phi (rad)"};
// Define the Signal axis
ConfigurableAxis invariantMassBins{"invariantMassBins", {100, -0.1f, 0.1f}, "Binning for the invariant mass (GeV/c^2)"};
ConfigurableAxis nsigmaBins{"nsigmaBins", {100, -10.f, 10.f}, "Binning for nSigma"};
// Selection bins
ConfigurableAxis tpcClusterBins{"tpcClusterBins", {5, 70, 100, 120, 135, 150}, "Min TPC clusters for tracks"};
ConfigurableAxis itsClustersBins{"itsClustersBins", {5, 0, 6}, "Min ITS clusters for tracks"};
// Selection configurables
Configurable<float> selectionPosZ{"selectionPosZ", 10.f, "Max |z| of the primary vertex"};

HistogramRegistry registry{"registry"};

template <typename T>
bool isCollisionSelected(T const& collision)
{
return collision.sel8() && std::abs(collision.posZ()) <= selectionPosZ;
}

void init(InitContext const&)
{
const AxisSpec ptAxis{ptBins, "#it{p}_{T} (GeV/c)"};
const AxisSpec etaAxis{etaBins, "#eta"};
const AxisSpec phiAxis{phiBins, "#phi (rad)"};

if (doprocessData) {

// First we define the histograms on which we are cutting (tpc clusters, its clusters, ..)
registry.add("K/hTPCClusters", "", HistType::kTH1F, {{100, 0, 200}});
registry.add("K/hITSClusters", "", HistType::kTH1F, {{10, 0, 10}});
registry.addClone("K/", "K0s/");

// Add the signal histograms
registry.add("K/SignalPositive", "", HistType::kTHnSparseF, {ptBins, etaBins, phiBins, nsigmaBins, tpcClusterBins, itsClustersBins});
registry.add("K/SignalNegative", "", HistType::kTHnSparseF, {ptBins, etaBins, phiBins, nsigmaBins, tpcClusterBins, itsClustersBins});
registry.add("K0s/Signal", "", HistType::kTHnSparseF, {ptBins, etaBins, phiBins, invariantMassBins, tpcClusterBins, itsClustersBins});
}

if (doprocessMc) {
registry.add("K/GeneratedPositive", "", HistType::kTHnSparseF, {ptBins, etaBins, phiBins});
registry.add("K/GeneratedNegative", "", HistType::kTHnSparseF, {ptBins, etaBins, phiBins});
registry.add("K0s/Generated", "", HistType::kTHnSparseF, {ptBins, etaBins, phiBins});
}
}

using TrackType = soa::Join<aod::Tracks, aod::TracksExtra, aod::pidTPCFullKa, aod::pidTOFFullPi>;
using CollisionType = soa::Join<aod::Collisions, aod::EvSels>;

void processData(CollisionType const& collisions,
TrackType const& tracks,
aod::V0Datas const& v0s)
{
for (const auto& collision : collisions) {
if (isCollisionSelected(collision))
continue; // MB selection

// Kaon loop
for (const auto& track : tracks) {
if (track.collisionId() != collision.globalIndex())
continue;
registry.fill(HIST("hTPCClusters"), track.tpcNClsFound());
registry.fill(HIST("hITSClusters"), track.itsNCls());
if (track.sign() > 0)
registry.fill(HIST("K/SignalPositive"), track.pt(), track.eta(), track.phi(), track.tpcNSigmaKa(), track.tpcNClsFound(), track.itsNCls());
else
registry.fill(HIST("K/SignalNegative"), track.pt(), track.eta(), track.phi(), track.tpcNSigmaKa(), track.tpcNClsFound(), track.itsNCls());
}

// K0s loop
for (const auto& v0 : v0s) {
if (v0.collisionId() != collision.globalIndex())
continue;
const auto& posTrack = v0.posTrack_as<TrackType>();
const auto& negTrack = v0.negTrack_as<TrackType>();
registry.fill(HIST("K0s/Signal"), v0.pt(), v0.eta(), v0.phi(), v0.mK0Short() - constants::physics::MassK0Short, std::min(posTrack.tpcNClsFound(), negTrack.tpcNClsFound()), std::min(posTrack.itsNCls(), negTrack.itsNCls()));
}
}
}
PROCESS_SWITCH(SystematicsMapping, processData, "Systematics study for K0s and charged Kaons", true);

void processMc(soa::Join<CollisionType, aod::McCollisionLabels> const& collisions,
aod::McParticles const& particles,
aod::McCollisions const&)
{
for (const auto& collision : collisions) {
if (!isCollisionSelected(collision))
continue; // MB selection
if (!collision.has_mcCollision())
continue;
const auto& mcCollision = collision.mcCollision();

for (const auto& particle : particles) {
if (particle.mcCollisionId() != mcCollision.globalIndex())
continue;
if (!particle.isPhysicalPrimary())
continue;
switch (particle.pdgCode()) {
case 321: // K+
registry.fill(HIST("K/GeneratedPositive"), particle.pt(), particle.eta(), particle.phi());
break;
case -321: // K-
registry.fill(HIST("K/GeneratedNegative"), particle.pt(), particle.eta(), particle.phi());
break;
case 310: // K0s
registry.fill(HIST("K0s/Generated"), particle.pt(), particle.eta(), particle.phi());
break;
default:
break;
}
}
}
}
PROCESS_SWITCH(SystematicsMapping, processMc, "Systematics study for K0s and charged Kaons on MC", false);
};

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