From c1d516b03dbd9331d313706663bf891b0c04596a Mon Sep 17 00:00:00 2001 From: Rafael Manhart Date: Mon, 9 Jan 2023 16:30:00 +0100 Subject: [PATCH 1/3] Feature; implemented manual track cuts --- PWGLF/Tasks/NucleiHistTask.cxx | 45 ++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/NucleiHistTask.cxx b/PWGLF/Tasks/NucleiHistTask.cxx index fa194c7b8d5..496b37fad37 100644 --- a/PWGLF/Tasks/NucleiHistTask.cxx +++ b/PWGLF/Tasks/NucleiHistTask.cxx @@ -37,6 +37,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; + namespace o2::aod { namespace NucleiTableHist @@ -236,9 +237,23 @@ struct NucleiHistTask { Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; Configurable nsigmacutLow{"nsigmacutLow", -3.0, "Value of the Nsigma cut"}; Configurable nsigmacutHigh{"nsigmacutHigh", +3.0, "Value of the Nsigma cut"}; + + // Replacement for globalTrack filter + Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70.0f, "min number of crossed rows TPC"}; + Configurable minRatioCrossedRowsTPC{"minRatioCrossedRowsTPC", 0.8f, "min ratio of crossed rows over findable clusters TPC"}; + Configurable maxChi2TPC{"maxChi2TPC", 4.0f, "max chi2 per cluster TPC"}; + Configurable maxChi2ITS{"maxChi2ITS", 36.0f, "max chi2 per cluster ITS"}; + Configurable reqTPCrefit{"reqTPCrefit", true, "require TPC refit"}; + Configurable reqITSrefit{"reqITSrefit", true, "require ITS refit"}; + Configurable maxDCA_Z{"maxDCA_Z", 2.0f, "max DCA to vertex z"}; + Configurable maxDCA_XY{"maxDCA_XY", 0.5f, "max DCA to vertex xy"}; + Configurable minReqClusterITS{"minReqClusterITS", 1.0, "min number of clusters required in ITS"}; + Configurable pTmin{"pTmin", 0.1f, "min pT"}; + Configurable pTmax{"pTmax", 1e+10f, "max pT"}; + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (requireGlobalTrackInFilter()); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta);// && (requireGlobalTrackInFilter()); using TrackCandidates = soa::Filtered>; // aod::ReducedTracks, aod::CentFV0As @@ -257,6 +272,29 @@ struct NucleiHistTask { spectra.fill(HIST("histRecVtxZData"), collision.posZ()); for (auto track : tracks) { // start loop over tracks + + float TPCnumberCls = track.tpcNClsFound(); + float RatioCrossedRowsOverFindableTPC = track.tpcCrossedRowsOverFindableCls(); + float Chi2perClusterTPC = track.tpcChi2NCl(); + float Chi2perClusterITS = track.itsChi2NCl(); + + if ( TPCnumberCls < minNCrossedRowsTPC || RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || Chi2perClusterTPC > maxChi2TPC || Chi2perClusterITS > maxChi2ITS || !(track.passedTPCRefit()) || !(track.passedITSRefit()) || track.itsNCls() < minReqClusterITS || track.pt() < pTmin || track.pt() > pTmax) { + continue; + } + + if (track.sign() > 0) { + spectra.fill(HIST("histDcaVsPtData_particle"), track.pt(), track.dcaXY()); + spectra.fill(HIST("histDcaZVsPtData_particle"), track.pt(), track.dcaZ()); + } + + if (track.sign() < 0) { + spectra.fill(HIST("histDcaVsPtData_antiparticle"), track.pt(), track.dcaXY()); + spectra.fill(HIST("histDcaZVsPtData_antiparticle"), track.pt(), track.dcaZ()); + } + + if (TMath::Abs(track.dcaXY()) > maxDCA_XY || TMath::Abs(track.dcaZ()) > maxDCA_Z) { + continue; + } // cut on rapidity TLorentzVector lorentzVector_proton{}; @@ -283,13 +321,12 @@ struct NucleiHistTask { spectra.fill(HIST("histNClusterITS"), track.pt(), track.itsNCls()); spectra.fill(HIST("histChi2TPC"), track.pt(), track.tpcChi2NCl()); spectra.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); + if (track.sign() > 0) { proton_erg.fill(HIST("histTpcNsigmaData"), track.pt(), nSigmaProton); deuteron_reg.fill(HIST("histTpcNsigmaData"), track.pt(), nSigmaDeut); Helium3_reg.fill(HIST("histTpcNsigmaData"), track.pt() * 2.0, nSigmaHe3); - spectra.fill(HIST("histDcaVsPtData_particle"), track.pt(), track.dcaXY()); - spectra.fill(HIST("histDcaZVsPtData_particle"), track.pt(), track.dcaZ()); /* if (track.centFV0A() > 0.0 && track.centFV0A() < 5.0) { proton_erg.fill(HIST("histTpcNsigmaData_cent_0-5"), track.pt(), nSigmaProton); @@ -329,8 +366,6 @@ struct NucleiHistTask { aproton_erg.fill(HIST("histTpcNsigmaData"), track.pt(), nSigmaProton); adeuteron_reg.fill(HIST("histTpcNsigmaData"), track.pt(), nSigmaDeut); aHelium3_reg.fill(HIST("histTpcNsigmaData"), track.pt() * 2.0, nSigmaHe3); - spectra.fill(HIST("histDcaVsPtData_antiparticle"), track.pt(), track.dcaXY()); - spectra.fill(HIST("histDcaZVsPtData_antiparticle"), track.pt(), track.dcaZ()); /* if (track.centFV0A() > 0.0 && track.centFV0A() < 5.0) { aproton_erg.fill(HIST("histTpcNsigmaData_cent_0-5"), track.pt(), nSigmaProton); From 408eaf35d94b7a2bcb0319ae754df5ca27fc34e4 Mon Sep 17 00:00:00 2001 From: Rafael Manhart Date: Mon, 9 Jan 2023 17:11:10 +0100 Subject: [PATCH 2/3] Feature; added manual implementation for track cuts. --- PWGLF/Tasks/NucleiHistTask.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PWGLF/Tasks/NucleiHistTask.cxx b/PWGLF/Tasks/NucleiHistTask.cxx index 496b37fad37..43e5bd55309 100644 --- a/PWGLF/Tasks/NucleiHistTask.cxx +++ b/PWGLF/Tasks/NucleiHistTask.cxx @@ -100,14 +100,14 @@ struct NucleiHistTask { spectra.add("histRecVtxZData", "collision z position", HistType::kTH1F, {{200, -20., +20., "z position (cm)"}}); spectra.add("histTpcSignalData", "Specific energy loss", HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {1400, 0, 1400, "d#it{E} / d#it{X} (a. u.)"}}); spectra.add("histTofSignalData", "TOF signal", HistType::kTH2F, {{600, -6., 6., "#it{p} (GeV/#it{c})"}, {550, 0.0, 1.1, "#beta (TOF)"}}); - spectra.add("histDcaVsPtData_particle", "dcaXY vs Pt (particle)", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); - spectra.add("histDcaZVsPtData_particle", "dcaZ vs Pt (particle)", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); - spectra.add("histDcaVsPtData_wo_ambiguous_particle", "dcaXY vs Pt (particle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); - spectra.add("histDcaZVsPtData_wo_ambiguous_particle", "dcaZ vs Pt (particle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); - spectra.add("histDcaVsPtData_antiparticle", "dcaXY vs Pt (antiparticle)", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); - spectra.add("histDcaZVsPtData_antiparticle", "dcaZ vs Pt (antiparticle)", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); - spectra.add("histDcaVsPtData_wo_ambiguous_antiparticle", "dcaXY vs Pt (antiparticle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); - spectra.add("histDcaZVsPtData_wo_ambiguous_antiparticle", "dcaZ vs Pt (antiparticle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -0.1, 0.1, "dca"}}); + spectra.add("histDcaVsPtData_particle", "dcaXY vs Pt (particle)", HistType::kTH2F, {ptAxis, {200, -0.5, 0.5, "dca"}}); + spectra.add("histDcaZVsPtData_particle", "dcaZ vs Pt (particle)", HistType::kTH2F, {ptAxis, {200, -2.0, 2.0, "dca"}}); + spectra.add("histDcaVsPtData_wo_ambiguous_particle", "dcaXY vs Pt (particle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -0.5, 0.5, "dca"}}); + spectra.add("histDcaZVsPtData_wo_ambiguous_particle", "dcaZ vs Pt (particle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -2.0, 2.0, "dca"}}); + spectra.add("histDcaVsPtData_antiparticle", "dcaXY vs Pt (antiparticle)", HistType::kTH2F, {ptAxis, {200, -0.5, 0.5, "dca"}}); + spectra.add("histDcaZVsPtData_antiparticle", "dcaZ vs Pt (antiparticle)", HistType::kTH2F, {ptAxis, {200, -2.0, 2.0, "dca"}}); + spectra.add("histDcaVsPtData_wo_ambiguous_antiparticle", "dcaXY vs Pt (antiparticle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -0.5, 0.5, "dca"}}); + spectra.add("histDcaZVsPtData_wo_ambiguous_antiparticle", "dcaZ vs Pt (antiparticle) w/o ambiguous", HistType::kTH2F, {ptAxis, {200, -2.0, 2.0, "dca"}}); spectra.add("histTOFm2", "TOF m^2 vs Pt", HistType::kTH2F, {ptAxis, {400, 0.0, 10.0, "m^2"}}); spectra.add("histNClusterTPC", "Number of Clusters in TPC vs Pt", HistType::kTH2F, {ptAxis, {160, 0.0, 160.0, "nCluster"}}); @@ -599,7 +599,6 @@ struct NucleiHistTask { track.passedITSChi2NDF(), track.passedTPCChi2NDF(), track.passedITSNCls(), - track.passedTPCNCls(), 0., 0., 0., From 8b9d4e38a91310658dad8e17d5f1f399720eff3d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 9 Jan 2023 16:14:07 +0000 Subject: [PATCH 3/3] Please consider the following formatting changes --- PWGLF/Tasks/NucleiHistTask.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/PWGLF/Tasks/NucleiHistTask.cxx b/PWGLF/Tasks/NucleiHistTask.cxx index 43e5bd55309..b3423a3e8e8 100644 --- a/PWGLF/Tasks/NucleiHistTask.cxx +++ b/PWGLF/Tasks/NucleiHistTask.cxx @@ -37,7 +37,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; - namespace o2::aod { namespace NucleiTableHist @@ -237,7 +236,7 @@ struct NucleiHistTask { Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; Configurable nsigmacutLow{"nsigmacutLow", -3.0, "Value of the Nsigma cut"}; Configurable nsigmacutHigh{"nsigmacutHigh", +3.0, "Value of the Nsigma cut"}; - + // Replacement for globalTrack filter Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70.0f, "min number of crossed rows TPC"}; Configurable minRatioCrossedRowsTPC{"minRatioCrossedRowsTPC", 0.8f, "min ratio of crossed rows over findable clusters TPC"}; @@ -251,9 +250,8 @@ struct NucleiHistTask { Configurable pTmin{"pTmin", 0.1f, "min pT"}; Configurable pTmax{"pTmax", 1e+10f, "max pT"}; - Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; - Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta);// && (requireGlobalTrackInFilter()); + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta); // && (requireGlobalTrackInFilter()); using TrackCandidates = soa::Filtered>; // aod::ReducedTracks, aod::CentFV0As @@ -272,26 +270,26 @@ struct NucleiHistTask { spectra.fill(HIST("histRecVtxZData"), collision.posZ()); for (auto track : tracks) { // start loop over tracks - + float TPCnumberCls = track.tpcNClsFound(); float RatioCrossedRowsOverFindableTPC = track.tpcCrossedRowsOverFindableCls(); float Chi2perClusterTPC = track.tpcChi2NCl(); float Chi2perClusterITS = track.itsChi2NCl(); - - if ( TPCnumberCls < minNCrossedRowsTPC || RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || Chi2perClusterTPC > maxChi2TPC || Chi2perClusterITS > maxChi2ITS || !(track.passedTPCRefit()) || !(track.passedITSRefit()) || track.itsNCls() < minReqClusterITS || track.pt() < pTmin || track.pt() > pTmax) { + + if (TPCnumberCls < minNCrossedRowsTPC || RatioCrossedRowsOverFindableTPC < minRatioCrossedRowsTPC || Chi2perClusterTPC > maxChi2TPC || Chi2perClusterITS > maxChi2ITS || !(track.passedTPCRefit()) || !(track.passedITSRefit()) || track.itsNCls() < minReqClusterITS || track.pt() < pTmin || track.pt() > pTmax) { continue; } - + if (track.sign() > 0) { spectra.fill(HIST("histDcaVsPtData_particle"), track.pt(), track.dcaXY()); spectra.fill(HIST("histDcaZVsPtData_particle"), track.pt(), track.dcaZ()); } - + if (track.sign() < 0) { spectra.fill(HIST("histDcaVsPtData_antiparticle"), track.pt(), track.dcaXY()); spectra.fill(HIST("histDcaZVsPtData_antiparticle"), track.pt(), track.dcaZ()); } - + if (TMath::Abs(track.dcaXY()) > maxDCA_XY || TMath::Abs(track.dcaZ()) > maxDCA_Z) { continue; } @@ -321,7 +319,6 @@ struct NucleiHistTask { spectra.fill(HIST("histNClusterITS"), track.pt(), track.itsNCls()); spectra.fill(HIST("histChi2TPC"), track.pt(), track.tpcChi2NCl()); spectra.fill(HIST("histChi2ITS"), track.pt(), track.itsChi2NCl()); - if (track.sign() > 0) { proton_erg.fill(HIST("histTpcNsigmaData"), track.pt(), nSigmaProton);