diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 839f6415982..4f82aaaa64c 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -63,6 +63,7 @@ namespace { constexpr int kNpart = 2; constexpr float kTrackSels[12]{/* 60, */ 80, 100, 2, 3, /* 4, */ 0.05, 0.1, /* 0.15, */ 0.5, 1, /* 1.5, */ 2, 3 /* , 4 */, 2, 3, /*, 4 */}; +constexpr float kDcaSelsParam[3][3]{{-1.e32, -1.e32, -1.e32}, {-1.e32, -1.e32, -1.e32}, {-1.e32, -1.e32, -1.e32}}; constexpr float kDcaSels[3]{10., 10., 10.}; constexpr double kBetheBlochDefault[kNpart][6]{{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}, {-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}}; constexpr double kBetheBlochDefaultITS[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}; @@ -72,11 +73,11 @@ constexpr double kDeltaEstimatorNsigma[2]{5.5, 5.}; constexpr double kPartMass[kNpart]{o2::constants::physics::MassProton, o2::constants::physics::MassDeuteron}; constexpr double kPartPdg[kNpart]{PDG_t::kProton, o2::constants::physics::kDeuteron}; static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; +static const std::vector dcaParNames{"p0", "p1", "p2"}; static const std::vector particleNamesPar{"p", "d"}; static const std::vector trackSelsNames{"tpcClsMid", "tpcClsTight", "chi2TpcTight", "chi2TpcMid", "dcaxyTight", "dcaxyMid", "dcazTight", "dcazMid", "tpcNsigmaTight", "tpcNsigmaMid", "itsNsigmaTight", "itsNsigmaMid"}; static const std::vector dcaSelsNames{"dcaxy", "dcaz", "dca"}; static const std::vector particleName{"p"}; -std::array, kNpart> tofMass; void momTotXYZ(std::array& momA, std::array const& momB, std::array const& momC) { for (uint64_t i = 0; i < momA.size(); ++i) { @@ -190,9 +191,11 @@ struct EbyeMaker { Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault[0], 2, 6, particleNamesPar, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; Configurable> cfgBetheBlochParamsITS{"cfgBetheBlochParamsITS", {kBetheBlochDefaultITS, 1, 6, particleName, betheBlochParNames}, "ITS Bethe-Bloch parameterisation for deuteron"}; - ConfigurableAxis centAxis{"centAxis", {106, 0, 106}, "binning for the centrality"}; - ConfigurableAxis zVtxAxis{"zVtxBins", {100, -20.f, 20.f}, "Binning for the vertex z in cm"}; ConfigurableAxis multAxis{"multAxis", {100, 0, 10000}, "Binning for the multiplicity axis"}; + const AxisSpec centAxis{106, 0, 106, "centrality"}; + const AxisSpec zVtxAxis{100, -20.f, 20.f, "vertex z in cm"}; + const AxisSpec nTpcAxis{160, 0, 160, "N TPC"}; + const AxisSpec dcaAxis{600, -3., 3., "DCA in cm"}; // binning of (anti)lambda mass QA histograms ConfigurableAxis massLambdaAxis{"massLambdaAxis", {400, o2::constants::physics::MassLambda0 - 0.03f, o2::constants::physics::MassLambda0 + 0.03f}, "binning for the lambda invariant-mass"}; @@ -200,7 +203,6 @@ struct EbyeMaker { // binning of PID QA histograms ConfigurableAxis momAxis{"momAxisFine", {5.e2, 0.f, 5.f}, "momentum axis binning"}; ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"}; - ConfigurableAxis tofMassAxis{"tofMassAxis", {1000, 0., 3.f}, "tof mass axis"}; Configurable zVtxMax{"zVtxMax", 10.0f, "maximum z position of the primary vertex"}; Configurable etaMax{"etaMax", 0.8f, "maximum eta"}; @@ -214,7 +216,6 @@ struct EbyeMaker { Configurable kUsePileUpCut{"kUsePileUpCut", false, "toggle strong correlation cuts (Run 2)"}; Configurable kUseEstimatorsCorrelationCut{"kUseEstimatorsCorrelationCut", false, "toggle cut on the correlation between centrality estimators (2018 Pb-Pb)"}; - Configurable kCentCutMin{"kCentCutMin", 0, "minimum accepted centrality"}; Configurable kCentCutMax{"kCentCutMax", 100, "maximum accepted centrality"}; Configurable antidPtMin{"antidPtMin", 0.6f, "minimum antideuteron pT (GeV/c)"}; @@ -232,7 +233,6 @@ struct EbyeMaker { Configurable trackNclusItsCut{"trackNclusITScut", 2, "Minimum number of ITS clusters"}; Configurable trackNclusTpcCut{"trackNclusTPCcut", 60, "Minimum number of TPC clusters"}; Configurable trackChi2Cut{"trackChi2Cut", 4.f, "Maximum chi2/ncls in TPC"}; - Configurable> cfgDcaSels{"cfgDcaSels", {kDcaSels, 1, 3, particleName, dcaSelsNames}, "DCA selections"}; Configurable v0trackNcrossedRows{"v0trackNcrossedRows", 100, "Minimum number of crossed TPC rows for V0 daughter"}; Configurable v0trackNclusItsCut{"v0trackNclusITScut", 0, "Minimum number of ITS clusters for V0 daughter"}; @@ -244,11 +244,9 @@ struct EbyeMaker { Configurable antidNsigmaTpcCutLow{"antidNsigmaTpcCutLow", -4.f, "TPC PID cut low"}; Configurable antidNsigmaTpcCutUp{"antidNsigmaTpcCutUp", 4.f, "TPC PID cut up"}; - Configurable antidTpcInnerParamMax{"tpcInnerParamMax", 0.f, "(temporary) tpc inner param cut"}; Configurable antipNsigmaTpcCutLow{"antipNsigmaTpcCutLow", -4.f, "TPC PID cut low"}; Configurable antipNsigmaTpcCutUp{"antipNsigmaTpcCutUp", 4.f, "TPC PID cut up"}; - Configurable antipTpcInnerParamMax{"antipTpcInnerParamMax", 0.f, "(temporary) tpc inner param cut"}; Configurable v0settingDcaV0Dau{"v0setting_dcav0dau", 0.5f, "DCA V0 Daughters"}; Configurable v0settingDcaV0Pv{"v0setting_dcav0pv", 1.f, "DCA V0 to Pv"}; @@ -259,18 +257,15 @@ struct EbyeMaker { Configurable v0settingNSigmaTpc{"v0setting_nsigmatpc", 4.f, "nsigmatpc"}; Configurable lambdaMassCut{"lambdaMassCut", 0.02f, "maximum deviation from PDG mass (for QA histograms)"}; - Configurable constDCASel{"constDCASel", true, "use DCA selections independent of pt"}; - Configurable antidItsClsSizeCut{"antidItsClsSizeCut", 1.e-10f, "cluster size cut for antideuterons"}; - Configurable antidPtItsClsSizeCut{"antidPtItsClsSizeCut", 10.f, "pt for cluster size cut for antideuterons"}; - Configurable> cfgTrackSels{"cfgTrackSels", {kTrackSels, 1, 12, particleName, trackSelsNames}, "Track selections"}; + Configurable> cfgDcaSels{"cfgDcaSels", {kDcaSels, 1, 3, particleName, dcaSelsNames}, "DCA selections"}; + Configurable> cfgDcaSelsParam{"cfgDcaSelsParam", {kDcaSelsParam[0], 3, 3, dcaSelsNames, dcaParNames}, "DCA threshold settings"}; std::array ptMin; std::array ptTof; std::array ptMax; std::array nSigmaTpcCutLow; std::array nSigmaTpcCutUp; - std::array tpcInnerParamMax; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -346,8 +341,6 @@ struct EbyeMaker { return false; } if (track.itsNCls() < trackNclusItsCut || - track.tpcNClsFound() < trackNclusTpcCut || - track.tpcNClsCrossedRows() < trackNcrossedRows || track.tpcNClsCrossedRows() < defNClCROverFind * track.tpcNClsFindable() || track.tpcChi2NCl() > trackChi2Cut || track.tpcChi2NCl() < defMinChi2Cut || @@ -364,20 +357,9 @@ struct EbyeMaker { return true; } - template - float getITSClSize(T const& track) - { - float sum{0.f}; - const int nLayers = 7; - for (int iL{0}; iL < nLayers; ++iL) { - sum += (track.itsClusterSizes() >> (iL * 4)) & 0xf; - } - return sum / track.itsNCls(); - } - - float dcaSigma(float const& pt) + float dcaSigma(float const& pt, const char* var) { - return 0.0105 + 0.0350 / std::pow(std::abs(pt), 1.1); + return cfgDcaSelsParam->get(var, "p0") + cfgDcaSelsParam->get(var, "p1") / std::pow(std::abs(pt), cfgDcaSelsParam->get(var, "p2")); } template @@ -467,13 +449,13 @@ struct EbyeMaker { mask |= kChi2TPCTight; else if (track.tpcchi2 < cfgTrackSels->get("chi2TpcMid")) mask |= kChi2TPCMid; - if (std::abs(track.dcaxypv) < cfgTrackSels->get("dcaxyTight") * (constDCASel ? 1. : dcaSigma(track.pt))) + if (std::abs(track.dcaxypv) < cfgTrackSels->get("dcaxyTight") * dcaSigma(track.pt, "dcaxy")) mask |= kDCAxyTight; - else if (std::abs(track.dcaxypv) < cfgTrackSels->get("dcaxyMid") * (constDCASel ? 1. : dcaSigma(track.pt))) + else if (std::abs(track.dcaxypv) < cfgTrackSels->get("dcaxyMid") * dcaSigma(track.pt, "dcaxy")) mask |= kDCAxyMid; - if (std::abs(track.dcazpv) < cfgTrackSels->get("dcazTight")) + if (std::abs(track.dcazpv) < cfgTrackSels->get("dcazTight") * dcaSigma(track.pt, "dcaz")) mask |= kDCAzTight; - else if (std::abs(track.dcazpv) < cfgTrackSels->get("dcazMid")) + else if (std::abs(track.dcazpv) < cfgTrackSels->get("dcazMid") * dcaSigma(track.pt, "dcaz")) mask |= kDCAzMid; if (std::abs(track.tpcnsigma) < cfgTrackSels->get("tpcNsigmaTight")) mask |= kTPCPIDTight; @@ -524,8 +506,11 @@ struct EbyeMaker { histos.add("QA/tpcSignal", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); histos.add("QA/tpcSignalPr", ";#it{p}_{TPC} (GeV/#it{c});d#it{E}/d#it{x}_{TPC} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); histos.add("QA/itsSignal", ";#it{p}_{glo} (GeV/#it{c});d#it{E}/d#it{x}_{ITS} (a.u.)", HistType::kTH2F, {momAxis, tpcAxis}); - tofMass[0] = histos.add("QA/tofMass_p", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); - tofMass[1] = histos.add("QA/tofMass_d", ";Centrality (%);#it{p}_{T} (GeV/#it{c});Mass (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, tofMassAxis}); + + // tracking variables QA + histos.add("QA/tpcCRvsCls", ";#it{N}_{TPCCR};#it{N}_{TPCcls}", HistType::kTH2F, {nTpcAxis, nTpcAxis}); + histos.add("QA/dcaxyVsPt", ";#it{p}_{T} (GeV/#it{c});DCA_{#it{xy}} (cm)", HistType::kTH2F, {momAxis, dcaAxis}); + histos.add("QA/dcazVsPt", ";#it{p}_{T} (GeV/#it{c});DCA_{#it{z}} (cm)", HistType::kTH2F, {momAxis, dcaAxis}); ptMin = std::array{antipPtMin, antidPtMin}; ptMax = std::array{antipPtMax, antidPtMax}; @@ -533,7 +518,6 @@ struct EbyeMaker { nSigmaTpcCutLow = std::array{antipNsigmaTpcCutLow, antidNsigmaTpcCutLow}; nSigmaTpcCutUp = std::array{antipNsigmaTpcCutUp, antidNsigmaTpcCutUp}; - tpcInnerParamMax = std::array{antipTpcInnerParamMax, antidTpcInnerParamMax}; } template @@ -568,12 +552,18 @@ struct EbyeMaker { continue; } + histos.fill(HIST("QA/tpcCRvsCls"), track.tpcNClsCrossedRows(), track.tpcNClsFound()); + if (track.tpcNClsFound() < trackNclusTpcCut || track.tpcNClsCrossedRows() < trackNcrossedRows) + continue; + auto trackParCov = getTrackParCov(track); o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParCov, 2.f, fitter.getMatCorrType(), &dcaInfo); auto dca = std::hypot(dcaInfo[0], dcaInfo[1]); auto trackPt = trackParCov.getPt(); auto trackEta = trackParCov.getEta(); - if (std::abs(dcaInfo[0]) > cfgDcaSels->get("dcaxy") * (constDCASel ? 1. : dcaSigma(track.pt())) || std::abs(dcaInfo[1]) > cfgDcaSels->get("dcaz") || dca > cfgDcaSels->get("dca")) { // dcaxy + histos.fill(HIST("QA/dcaxyVsPt"), track.pt(), dcaInfo[0]); + histos.fill(HIST("QA/dcazVsPt"), track.pt(), dcaInfo[1]); + if (std::abs(dcaInfo[0]) > cfgDcaSels->get("dcaxy") * dcaSigma(track.pt(), "dcaxy") || std::abs(dcaInfo[1]) > cfgDcaSels->get("dcaz") * dcaSigma(track.pt(), "dcaz") || dca > cfgDcaSels->get("dca") * dcaSigma(track.pt(), "dca")) { // dcaxy continue; } histos.fill(HIST("QA/tpcSignal"), track.tpcInnerParam(), track.tpcSignal()); @@ -585,13 +575,6 @@ struct EbyeMaker { continue; } - if (doprocessRun3 || doprocessMcRun3) { - float cosL = 1 / std::sqrt(1.f + track.tgl() * track.tgl()); - if (iP && getITSClSize(track) * cosL < antidItsClsSizeCut && trackPt < antidPtItsClsSizeCut) { - continue; - } - } - auto nSigmaTPC = getCustomTPCPID(track, kPartMass[iP], iP); float beta{track.hasTOF() ? track.length() / (track.tofSignal() - track.tofEvTime()) * o2::constants::physics::invLightSpeedCm2PS : -999.f}; @@ -600,18 +583,10 @@ struct EbyeMaker { const float maxTofChi2 = 3.f; // TODO: check if this is still needed bool hasTof = track.hasTOF() && track.tofChi2() < maxTofChi2; - if ((trackPt <= ptTof[iP] || (trackPt > ptTof[iP] && hasTof)) && nSigmaTPC > nSigmaTpcCutLow[iP] && nSigmaTPC < nSigmaTpcCutUp[iP]) { // for QA histograms - tofMass[iP]->Fill(centrality, trackPt, mass); - } - if (nSigmaTPC < nSigmaTpcCutLow[iP] || nSigmaTPC > nSigmaTpcCutUp[iP]) { continue; } - // temporary cut to reject fake matches (run 3) - if (track.tpcInnerParam() < tpcInnerParamMax[iP]) { - continue; - } if (trackPt > ptTof[iP] && !hasTof) { continue; } @@ -916,7 +891,7 @@ struct EbyeMaker { } } - void processRun3(soa::Join const& collisions, TracksFullIUPID const& tracks, aod::V0s const& V0s, aod::BCsWithTimestamps const&) + void processRun3(soa::Join const& collisions, TracksFullIUPID const& tracks, aod::V0s const& V0s, aod::BCsWithTimestamps const&) { for (const auto& collision : collisions) { auto bc = collision.bc_as(); @@ -925,8 +900,8 @@ struct EbyeMaker { if (std::abs(collision.posZ()) > zVtxMax || !collision.selection_bit(aod::evsel::kNoITSROFrameBorder) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kIsTriggerTVX) || ((!collision.selection_bit(aod::evsel::kIsGoodITSLayersAll) || !collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && useAllEvSel)) continue; - auto centrality = collision.centFT0C(); - if (centrality < kCentCutMin || centrality > kCentCutMax) + auto centrality = collision.centFT0M(); + if (centrality > kCentCutMax) continue; histos.fill(HIST("QA/zVtx"), collision.posZ()); @@ -1097,7 +1072,7 @@ struct EbyeMaker { } PROCESS_SWITCH(EbyeMaker, processMiniRun2, "process mini tables(Run 2)", false); - void processMcRun3(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFullIUPID const& tracks, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, aod::BCsWithTimestamps const&) + void processMcRun3(soa::Join const& collisions, aod::McCollisions const& /*mcCollisions*/, TracksFullIUPID const& tracks, aod::V0s const& V0s, aod::McParticles const& mcParticles, aod::McTrackLabels const& mcLab, aod::BCsWithTimestamps const&) { for (const auto& collision : collisions) { auto bc = collision.bc_as(); @@ -1106,7 +1081,7 @@ struct EbyeMaker { if (std::abs(collision.posZ()) > zVtxMax || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision.selection_bit(aod::evsel::kIsTriggerTVX) || ((!collision.selection_bit(aod::evsel::kIsGoodITSLayersAll) || !collision.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) && useAllEvSel)) continue; - auto centrality = collision.centFT0C(); + auto centrality = collision.centFT0M(); histos.fill(HIST("QA/zVtx"), collision.posZ());