From 1f947f02639f2f5a98d60a4167360bbdff8e86ff Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Thu, 24 Jul 2025 13:01:40 +0200 Subject: [PATCH] Add changes in track selection --- .../GlobalEventProperties/flattenictyPikp.cxx | 109 ++++++++++-------- 1 file changed, 63 insertions(+), 46 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index cf9c401c16b..51511ece0cf 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -90,7 +90,6 @@ static constexpr std::string_view kSpeciesAll[Npart] = {"El", "Mu", "Pi", "Ka", // histogram naming static constexpr std::string_view kCharge[] = {"all/", "pos/", "neg/"}; static constexpr std::string_view kPrefix = "Tracks/"; -static constexpr std::string_view kQA = "QA/"; static constexpr std::string_view kPrefixCleanTof = "Tracks/CleanTof/"; static constexpr std::string_view kPrefixCleanV0 = "Tracks/CleanV0/"; static constexpr std::string_view kStatus[] = {"preSel/", "postSel/"}; @@ -122,6 +121,7 @@ enum TrkSelNoFilt { trkSelEta, trkSelPt, trkSelDCA, + trkNRowsTPC, trkSelNCls, trkSelTPCBndr, nTrkSel @@ -226,7 +226,7 @@ struct FlattenictyPikp { } flatSelOpt; struct : ConfigurableGroup { - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0}, "pT binning"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT binning"}; ConfigurableAxis axisMultPerc{"axisMultPerc", {100, 0, 100}, "Multiplicity percentiles binning"}; ConfigurableAxis axisVertexZ{"axisVertexZ", {60, -15., 15.}, "Vertex z binning"}; ConfigurableAxis axisMult{"axisMult", {301, -0.5, 300.5}, "Multiplicity binning"}; @@ -244,9 +244,12 @@ struct FlattenictyPikp { Configurable cfgTrkEtaMax{"cfgTrkEtaMax", 0.8f, "Eta range for tracks"}; Configurable cfgRapMax{"cfgRapMax", 0.5f, "Maximum range of rapidity for tracks"}; Configurable cfgTrkPtMin{"cfgTrkPtMin", 0.15f, "Minimum pT of tracks"}; + Configurable cfgNclTPCMin{"cfgNclTPCMin", 100.0f, "Minimum of number of TPC clusters"}; Configurable cfgPhiCutPtMin{"cfgPhiCutPtMin", 2.0f, "Minimum pT for phi cut"}; Configurable cfgTOFBetaPion{"cfgTOFBetaPion", 1.0f, "Minimum beta for TOF pions"}; Configurable cfgUseExtraTrkCut{"cfgUseExtraTrkCut", true, "Use extra track cut"}; + Configurable cfgGeoTrkCutMin{"cfgGeoTrkCutMin", "0.06/x+pi/18.0-0.06", "ROOT TF1 formula for minimum phi cut in TPC"}; + Configurable cfgGeoTrkCutMax{"cfgGeoTrkCutMax", "0.1/x+pi/18.0+0.06", "ROOT TF1 formula for maximum phi cut in TPC"}; Configurable cfgMomMIPMax{"cfgMomMIPMax", 0.6f, "Maximum momentum of MIP pions"}; Configurable cfgMomMIPMin{"cfgMomMIPMin", 0.4f, "Minimum momentum of MIP pions"}; Configurable cfgDeDxMIPMax{"cfgDeDxMIPMax", 60.0f, "Maximum range of MIP dedx"}; @@ -301,7 +304,7 @@ struct FlattenictyPikp { Configurable minITSnClusters{"minITSnClusters", 5, "minimum number of found ITS clusters"}; Configurable maxDcaXYFactor{"maxDcaXYFactor", 1.f, "Multiplicative factor on the maximum value of the DCA xy"}; Configurable maxDcaZ{"maxDcaZ", 2.f, "Additional cut on the maximum value of the DCA z"}; - Configurable minTPCNClsFound{"minTPCNClsFound", 0.f, "Additional cut on the minimum value of the number of found clusters in the TPC"}; + Configurable minTPCNClsFound{"minTPCNClsFound", 70.0f, "Additional cut on the minimum value of the number of found clusters in the TPC"}; TF1* fPhiCutLow = nullptr; TF1* fPhiCutHigh = nullptr; @@ -398,12 +401,13 @@ struct FlattenictyPikp { flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelEta + 1, "Eta"); flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPt + 1, "Pt"); flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelDCA + 1, "DCA"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNCls + 1, "NCls"); + flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkNRowsTPC + 1, "trkNRowsTPC"); + flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNCls + 1, "NClsTPC"); flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelTPCBndr + 1, "TPC Boundary"); if (trkSelOpt.cfgUseExtraTrkCut) { - fPhiCutLow = new TF1("fPhiCutLow", "0.06/x+pi/18.0-0.06", 0, 100); - fPhiCutHigh = new TF1("fPhiCutHigh", "0.1/x+pi/18.0+0.06", 0, 100); + fPhiCutLow = new TF1("fPhiCutLow", trkSelOpt.cfgGeoTrkCutMin.value.c_str(), 0, 100); + fPhiCutHigh = new TF1("fPhiCutHigh", trkSelOpt.cfgGeoTrkCutMax.value.c_str(), 0, 100); } if (doprocessFlat) { @@ -413,25 +417,26 @@ struct FlattenictyPikp { if (cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillNsigmaQAHist) { if (cfgFillTrackQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {HistType::kTH2D, {ptAxis, phiAxisMod}}); - flatchrg.add("Tracks/QA/hPtVsWOcutDCA", "hPtVsWOcutDCA", HistType::kTH2D, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/QA/hPt", "", HistType::kTH1D, {ptAxis}); - flatchrg.add("Tracks/QA/hPhi", "", HistType::kTH1D, {phiAxis}); - flatchrg.add("Tracks/QA/hEta", "", HistType::kTH1D, {etaAxis}); - flatchrg.add("Tracks/QA/hDCAXYvsPt", "", HistType::kTH2D, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/QA/hDCAZvsPt", "", HistType::kTH2D, {ptAxis, dcaZAxis}); + flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", HistType::kTH2D, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hPt", "", HistType::kTH1D, {ptAxis}); + flatchrg.add("Tracks/postSel/hPhi", "", HistType::kTH1D, {phiAxis}); + flatchrg.add("Tracks/postSel/hEta", "", HistType::kTH1D, {etaAxis}); + flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", HistType::kTH2D, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hDCAZvsPt", "", HistType::kTH2D, {ptAxis, dcaZAxis}); // tpc - flatchrg.add("Tracks/QA/hShTpcClvsPt", "", {HistType::kTH2D, {ptAxis, shCluserAxis}}); - flatchrg.add("Tracks/QA/hCrossTPCvsPt", "", {HistType::kTH2D, {ptAxis, clTpcAxis}}); - flatchrg.add("Tracks/QA/hTPCCluster", "N_{cluster}", HistType::kTH1D, {{200, -0.5, 199.5}}); - flatchrg.add("Tracks/QA/tpcNClsShared", " ; # shared TPC clusters TPC", HistType::kTH1D, {{165, -0.5, 164.5}}); - flatchrg.add("Tracks/QA/tpcCrossedRows", " ; # crossed TPC rows", HistType::kTH1D, {{165, -0.5, 164.5}}); - flatchrg.add("Tracks/QA/tpcCrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", HistType::kTH1D, {{60, 0.7, 1.3}}); + flatchrg.add("Tracks/postSel/hPtPhiTPCCluster", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {HistType::kTHnSparseD, {ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hShTpcClvsPt", "", {HistType::kTH2D, {ptAxis, shCluserAxis}}); + flatchrg.add("Tracks/postSel/hCrossTPCvsPt", "", {HistType::kTH2D, {ptAxis, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hTPCCluster", "N_{cluster}", HistType::kTH1D, {clTpcAxis}); + flatchrg.add("Tracks/postSel/tpcNClsShared", " ; # shared TPC clusters TPC", HistType::kTH1D, {{165, -0.5, 164.5}}); + flatchrg.add("Tracks/postSel/tpcCrossedRows", " ; # crossed TPC rows", HistType::kTH1D, {{165, -0.5, 164.5}}); + flatchrg.add("Tracks/postSel/tpcCrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", HistType::kTH1D, {{60, 0.7, 1.3}}); // its - flatchrg.add("Tracks/QA/itsNCls", " ; # ITS clusters", HistType::kTH1D, {{8, -0.5, 7.5}}); - flatchrg.add("Tracks/QA/hChi2ITSTrkSegment", "chi2ITS", HistType::kTH1D, {{100, -0.5, 99.5}}); + flatchrg.add("Tracks/postSel/itsNCls", " ; # ITS clusters", HistType::kTH1D, {{8, -0.5, 7.5}}); + flatchrg.add("Tracks/postSel/hChi2ITSTrkSegment", "chi2ITS", HistType::kTH1D, {{100, -0.5, 99.5}}); // tof - flatchrg.add("Tracks/QA/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {HistType::kTH2D, {pAxis, {120, 0.0, 1.2}}}); - flatchrg.add("Tracks/QA/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {HistType::kTHnSparseD, {etaAxis, pAxis, dEdxAxis}}); + flatchrg.add("Tracks/postSel/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {HistType::kTH2D, {pAxis, {120, 0.0, 1.2}}}); + flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {HistType::kTHnSparseD, {etaAxis, pAxis, dEdxAxis}}); } if (cfgFilldEdxQaHist) { flatchrg.add("Tracks/postCalib/all/hMIP", "; mult; flat; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {HistType::kTHnSparseD, {multAxis, flatAxis, etaAxis, dEdxAxis}}); @@ -707,22 +712,22 @@ struct FlattenictyPikp { fillTrackQA(track); } if (cfgFilldEdxQaHist) { - filldEdxQA(track, collision); + filldEdxQA(track, collision, dEdx); if (posP) { - filldEdxQA(track, collision); + filldEdxQA(track, collision, dEdx); } else { - filldEdxQA(track, collision); + filldEdxQA(track, collision, dEdx); } } if (applyCalibDeDx) { dEdx *= (50.0 / getCalibration(true, track.eta())); } if (cfgFilldEdxQaHist) { - filldEdxQA(track, collision); + filldEdxQA(track, collision, dEdx); if (posP) { - filldEdxQA(track, collision); + filldEdxQA(track, collision, dEdx); } else { - filldEdxQA(track, collision); + filldEdxQA(track, collision, dEdx); } } @@ -788,6 +793,7 @@ struct FlattenictyPikp { if (eta < 0.) { if (isMIP) { valCalib = fDeDxVsEtaNeg->Eval(eta); + // LOGF(info, "--------> \t fDeDxVsEtaNeg->Eval(%f) = %f", eta, valCalib); } else { valCalib = fEDeDxVsEtaNeg->Eval(eta); } @@ -830,12 +836,18 @@ struct FlattenictyPikp { if (cfgFillTrackQaHist) { flatchrg.fill(HIST("Tracks/preSel/hPtPhi"), track.pt(), phimodn); + if (track.hasTPC() && track.hasITS()) { + flatchrg.fill(HIST("Tracks/preSel/hPtPhiTPCCluster"), track.pt(), phimodn, track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()); + } } if (phimodn < fphiCutHigh->Eval(track.pt()) && phimodn > fphiCutLow->Eval(track.pt())) { return false; } if (cfgFillTrackQaHist) { flatchrg.fill(HIST("Tracks/postSel/hPtPhi"), track.pt(), phimodn); + if (track.hasTPC() && track.hasITS()) { + flatchrg.fill(HIST("Tracks/postSel/hPtPhiTPCCluster"), track.pt(), phimodn, track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()); + } } return true; } @@ -858,6 +870,11 @@ struct FlattenictyPikp { if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC) { return false; } + flatchrg.fill(HIST("Tracks/hTrkSel"), trkNRowsTPC); + auto nClusterTPC = track.tpcNClsFindable() - track.tpcNClsFindableMinusFound(); + if (nClusterTPC < trkSelOpt.cfgNclTPCMin) { + return false; + } flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNCls); if (trkSelOpt.cfgUseExtraTrkCut && !phiCut(track, magfield, fPhiCutLow, fPhiCutHigh)) { return false; @@ -1009,34 +1026,34 @@ struct FlattenictyPikp { inline void fillTrackQA(T const& track) { if constexpr (fillHist) { - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hPt"), track.pt()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hPhi"), track.phi()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hEta"), track.eta()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hDCAXYvsPt"), track.pt(), track.dcaXY()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hDCAZvsPt"), track.pt(), track.dcaZ()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hPt"), track.pt()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hPhi"), track.phi()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hEta"), track.eta()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hDCAXYvsPt"), track.pt(), track.dcaXY()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hDCAZvsPt"), track.pt(), track.dcaZ()); if (track.hasTPC() && track.hasITS()) { int nFindable = track.tpcNClsFindable(); int nMinusFound = track.tpcNClsFindableMinusFound(); int nCluster = nFindable - nMinusFound; - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hTPCCluster"), nCluster); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hShTpcClvsPt"), track.pt(), track.tpcFractionSharedCls()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hCrossTPCvsPt"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("tpcNClsShared"), track.tpcNClsShared()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("tpcCrossedRows"), track.tpcNClsCrossedRows()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("tpcCrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hChi2ITSTrkSegment"), track.itsChi2NCl()); - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("itsNCls"), track.itsNCls()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hTPCCluster"), nCluster); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hShTpcClvsPt"), track.pt(), track.tpcFractionSharedCls()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hCrossTPCvsPt"), track.pt(), track.tpcNClsFound()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("tpcNClsShared"), track.tpcNClsShared()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("tpcCrossedRows"), track.tpcNClsCrossedRows()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("tpcCrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hChi2ITSTrkSegment"), track.itsChi2NCl()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("itsNCls"), track.itsNCls()); } - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hTOFPvsBeta"), track.tpcInnerParam(), track.beta()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hTOFPvsBeta"), track.tpcInnerParam(), track.beta()); if (track.beta() > trkSelOpt.cfgTOFBetaPion && track.beta() < trkSelOpt.cfgTOFBetaPion + 0.05) { // TOF pions - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hTOFpi"), track.eta(), track.tpcInnerParam(), track.tpcSignal()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hTOFpi"), track.eta(), track.tpcInnerParam(), track.tpcSignal()); } if (std::abs(track.eta()) < trkSelOpt.cfgTrkEtaMax) { if (isDCAxyWoCut(track)) { - flatchrg.fill(HIST(kPrefix) + HIST(kQA) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); + flatchrg.fill(HIST(kPrefix) + HIST(kStatus[ft]) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); } } } @@ -1044,11 +1061,11 @@ struct FlattenictyPikp { } template - inline void filldEdxQA(T const& track, C const& collision) + inline void filldEdxQA(T const& track, C const& collision, const float dEdx) { const float mult = getMult(collision); const float flat = fillFlat(collision); - float dEdx = track.tpcSignal(); + // float dEdx = track.tpcSignal(); if constexpr (fillHist) { if (track.tpcInnerParam() >= trkSelOpt.cfgMomMIPMin && track.tpcInnerParam() <= trkSelOpt.cfgMomMIPMax) { if (dEdx > trkSelOpt.cfgDeDxMIPMin && dEdx < trkSelOpt.cfgDeDxMIPMax) { // MIP pions