Skip to content
Merged
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
105 changes: 105 additions & 0 deletions PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
/// \author Abhi Modak (abhi.modak@cern.ch), Lucas José (lucas.jose.franco.da.silva@cern.ch)
/// \since September 10, 2025

#include "PWGLF/DataModel/LFStrangenessTables.h"

#include "Common/CCDB/EventSelectionParams.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/McCollisionExtra.h"
Expand All @@ -35,6 +37,7 @@
#include <Framework/runDataProcessing.h>

#include <TH1.h>
#include <TPDGCode.h>

#include <cmath>
#include <cstdint>
Expand Down Expand Up @@ -74,6 +77,7 @@ AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"};
AxisSpec axisPhi{629, 0, o2::constants::math::TwoPI, "#phi"};
AxisSpec axisCollSel{5, 0.5, 5.5, "#Event", "CollSelAxis"};
auto static constexpr kMinCharge = 3.f;
auto static constexpr kMinPtCut = 0.1f;

struct StudyPnch {

Expand Down Expand Up @@ -105,6 +109,12 @@ struct StudyPnch {
Configurable<bool> isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"};
Configurable<bool> isApplyCheckID{"isApplyCheckID", true, "Select Tracks evaluating Collision ID"};
Configurable<bool> isApplyDuplicatedTrack{"isApplyDuplicatedTrack", true, "Select tracks that are not duplicated"};
Configurable<bool> isApplyPhiSelection{"isApplyPhiSelection", false, "Select tracks in specific phi range"};
Configurable<float> minPhi{"minPhi", 0.f, "Minimum phi value for track selection"};
Configurable<float> maxPhi{"maxPhi", 6.283185f, "Maximum phi value for track selection"};
Configurable<bool> ispTincrease{"ispTincrease", false, "Varies low pT particles by a conservative amount of +100%"};
Configurable<bool> ispTdecrease{"ispTdecrease", false, "Varies low pT particles by a conservative amount of -50%"};
Configurable<bool> isApplyStrangenessSysUncert{"isApplyStrangenessSysUncert", false, "Enable the evaluation of systematics due to strange particle contribution"};

void init(InitContext const&)
{
Expand Down Expand Up @@ -163,6 +173,16 @@ struct StudyPnch {
histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true);
histos.add("hCountNTracks", "hCountNTracks", kTH1F, {axisCountNumberTracks}, true);
}
if (ispTincrease || ispTdecrease) {
histos.add("hMultiplicityMCgenPtCut", "hMultiplicityMCgenPtCut", kTH1F, {axisMult}, true);
histos.add("hResponseMatrixPtCut", "hResponseMatrixPtCut", kTH2F, {axisMult, axisMult}, true);
}
if (isApplyStrangenessSysUncert) {
histos.add("hMultiplicityMCStangeDecay", "hMultiplicityMCStangeDecay", kTH1F, {axisMult}, true);
histos.add("hMultiplicityMCSubtractionSDecay", "hMultiplicityMCSubtractionSDecay", kTH1F, {axisMult}, true);
histos.add("hResponseMatrixStrangeDecay", "hResponseMatrixStrangeDecay", kTH2F, {axisMult, axisMult}, true);
histos.add("hResponseMatrixSubtractionSDecay", "hResponseMatrixSubtractionSDecay", kTH2F, {axisMult, axisMult}, true);
}
if (doprocessEvtLossSigLossMC) {
histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false);
auto hstat = histos.get<TH1>(HIST("MCEventHist"));
Expand Down Expand Up @@ -251,6 +271,9 @@ struct StudyPnch {
if (!isTrackSelected(track)) {
continue;
}
if (isApplyPhiSelection && (track.phi() < minPhi || track.phi() > maxPhi)) {
continue;
}
histos.fill(HIST("hdcaxy"), track.dcaXY());
histos.fill(HIST("hdcaz"), track.dcaZ());
histos.fill(HIST("EtaHist"), track.eta());
Expand All @@ -272,6 +295,9 @@ struct StudyPnch {
if (track.mcCollisionId() != McCol.mcCollisionId()) {
continue;
}
if (isApplyPhiSelection && (track.phi() < minPhi || track.phi() > maxPhi)) {
continue;
}
histos.fill(HIST("EtaGenHist"), track.eta());
histos.fill(HIST("PhiGenHist"), track.phi());
histos.fill(HIST("PhiVsEtaGenHist"), track.phi(), track.eta());
Expand All @@ -298,6 +324,9 @@ struct StudyPnch {
continue;
}
mcRecIDs.push_back(particle.globalIndex());
if (isApplyPhiSelection && (track.phi() < minPhi || track.phi() > maxPhi)) {
continue;
}
nTrk++;
}
histos.fill(HIST("hdcaxy"), track.dcaXY());
Expand All @@ -309,6 +338,65 @@ struct StudyPnch {
return nTrk;
}

template <typename countTrk, typename McColType>
int countStrangeTracksMcCol(countTrk const& tracks, McColType const& McCol)
{
auto nTrk_strange = 0;
std::vector<int> mcRecIDs;
for (const auto& track : tracks) {
if (!isTrackSelected(track)) {
continue;
}
if (track.has_mcParticle()) {
auto particle = track.mcParticle();
if (isApplyCheckID && particle.mcCollisionId() != McCol.mcCollisionId()) {
continue;
}
if (isApplyDuplicatedTrack && find(mcRecIDs.begin(), mcRecIDs.end(), particle.globalIndex()) != mcRecIDs.end()) {
continue;
}
mcRecIDs.push_back(particle.globalIndex());
if (particle.has_mothers()) {
auto mcMother = particle.template mothers_as<aod::McParticles>().front();
if (mcMother.pdgCode() == PDG_t::kK0Short || std::abs(mcMother.pdgCode()) == PDG_t::kLambda0) {
nTrk_strange++;
}
}
}
}
return nTrk_strange;
}

template <typename countTrk, typename McColType>
int countTracksPtCut(countTrk const& tracks, McColType const& McCol)
{
auto nTrk_lowpT = 0;
auto nTrk_highpT = 0;
auto nTrk = 0;
for (const auto& track : tracks) {
if (!isGenTrackSelected(track)) {
continue;
}
if (track.mcCollisionId() != McCol.mcCollisionId()) {
continue;
}
// Evaluate low pT extrapolation
if (track.pt() < kMinPtCut) {
// nTrk_lowpT++;
if (ispTincrease) {
nTrk_lowpT += 2 - 10 * track.pt();
}
if (ispTdecrease) {
nTrk_lowpT += 0.5 + 5 * track.pt();
}
} else {
nTrk_highpT++;
}
}
nTrk = nTrk_lowpT + nTrk_highpT;
return nTrk;
}

Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::ITS) &&
ncheckbit(aod::track::trackCutFlag, TrackSelectionIts);
Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t)o2::aod::track::TPC),
Expand Down Expand Up @@ -366,6 +454,23 @@ struct StudyPnch {
histos.fill(HIST("hMultiplicityMCgen"), multgen);
histos.fill(HIST("hResponseMatrix"), multrec, multgen);
}
if (ispTincrease || ispTdecrease) {
auto nTrkPtCut = countTracksPtCut(GenParticles, RecCol);
if (nTrkPtCut > 0) {
histos.fill(HIST("hMultiplicityMCgenPtCut"), nTrkPtCut);
histos.fill(HIST("hResponseMatrixPtCut"), multrec, nTrkPtCut);
}
}
if (isApplyStrangenessSysUncert) {
auto nTrk_strange = countStrangeTracksMcCol(recTracksPart, RecCol);
auto nSubtract_strange = multrec - nTrk_strange;
if (multrec > 0) {
histos.fill(HIST("hMultiplicityMCStangeDecay"), nTrk_strange);
histos.fill(HIST("hMultiplicityMCSubtractionSDecay"), nSubtract_strange);
histos.fill(HIST("hResponseMatrixStrangeDecay"), nTrk_strange, multgen);
histos.fill(HIST("hResponseMatrixSubtractionSDecay"), nSubtract_strange, multgen);
}
}
}
}

Expand Down
Loading