diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index e5d6fe35a0a..9a9530be44d 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -51,14 +51,15 @@ DECLARE_SOA_TABLE(DDbarRecoInfo, "AOD", "DDBARRECOINFO", // definition of columns and tables for D0-Hadron correlation pairs namespace hf_correlation_d0_hadron { -DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between D0 and Hadrons -DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between D0 and Hadrons -DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D0 -DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron -DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D0 -DECLARE_SOA_COLUMN(MDbar, mDbar, float); //! Invariant mass of D0bar -DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for D0,D0bar -DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent +DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between D0 and Hadrons +DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between D0 and Hadrons +DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D0 +DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron +DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D0 +DECLARE_SOA_COLUMN(MDbar, mDbar, float); //! Invariant mass of D0bar +DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for D0,D0bar +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent +DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status enum ParticleTypeData { D0Only = 1, // Identified as D0 @@ -85,7 +86,8 @@ DECLARE_SOA_TABLE(DHadronPair, "AOD", "DHADRONPAIR", //! D0-Hadrons pairs Inform aod::hf_correlation_d0_hadron::DeltaEta, aod::hf_correlation_d0_hadron::PtD, aod::hf_correlation_d0_hadron::PtHadron, - aod::hf_correlation_d0_hadron::PoolBin); + aod::hf_correlation_d0_hadron::PoolBin, + aod::hf_correlation_d0_hadron::IsAutoCorrelated); DECLARE_SOA_TABLE(DHadronRecoInfo, "AOD", "DHADRONRECOINFO", //! D0-Hadrons pairs Reconstructed Informations aod::hf_correlation_d0_hadron::MD, diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 5c9bf60277a..881f01f24b4 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -185,6 +185,7 @@ struct HfCorrelatorD0Hadrons { Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; Configurable ptSoftPionMax{"ptSoftPionMax", 3 * 800. * pow(10., -6.), "max. pT cut for soft pion identification"}; Configurable correlateD0WithLeadingParticle{"correlateD0WithLeadingParticle", false, "Switch for correlation of D0 mesons with leading particle only"}; + Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; HfHelper hfHelper; @@ -367,8 +368,12 @@ struct HfCorrelatorD0Hadrons { for (const auto& track : tracks) { registry.fill(HIST("hTrackCounter"), 1); // fill total no. of tracks // Remove D0 daughters by checking track indices + bool correlationStatus = false; if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; } if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) continue; // Remove secondary tracks @@ -416,7 +421,8 @@ struct HfCorrelatorD0Hadrons { track.eta() - candidate1.eta(), candidate1.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); } // end inner loop (tracks) @@ -435,6 +441,10 @@ struct HfCorrelatorD0Hadrons { if (selectedD0candidatesMc.size() == 0) { return; } + // find leading particle + if (correlateD0WithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFV0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -526,8 +536,12 @@ struct HfCorrelatorD0Hadrons { continue; } // Removing D0 daughters by checking track indices + bool correlationStatus = false; if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; } if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { continue; // Remove secondary tracks @@ -558,6 +572,13 @@ struct HfCorrelatorD0Hadrons { registry.fill(HIST("hTrackCounterRec"), 3); // fill no. of tracks after soft pion removal + if (correlateD0WithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } + registry.fill(HIST("hTrackCounter"), 4); // fill no. of tracks have leading particle + } + int signalStatus = 0; if (flagD0 && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Sig); @@ -583,7 +604,8 @@ struct HfCorrelatorD0Hadrons { track.eta() - candidate1.eta(), candidate1.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); } // end inner loop (Tracks) } // end of outer loop (D0) @@ -660,11 +682,13 @@ struct HfCorrelatorD0Hadrons { BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zBins, multBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); + bool correlationStatus = false; entryD0HadronPair(getDeltaPhi(particle2.phi(), particle1.phi()), particle2.eta() - particle1.eta(), particle1.pt(), particle2.pt(), - poolBin); + poolBin, + correlationStatus); entryD0HadronRecoInfo(massD0, massD0, 0); // dummy info } // end inner loop (Tracks) } // end outer loop (D0) @@ -727,8 +751,8 @@ struct HfCorrelatorD0Hadrons { signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnlySoftPi; } } - - entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin); + bool correlationStatus = false; + entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin, correlationStatus); entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(t1), hfHelper.invMassD0barToKPi(t1), signalStatus); } } @@ -827,9 +851,9 @@ struct HfCorrelatorD0Hadrons { SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); } } // background case D0bar - registry.fill(HIST("hSignalStatusMERec"), signalStatus); - entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin); + bool correlationStatus = false; + entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin, correlationStatus); entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(t1), hfHelper.invMassD0barToKPi(t1), signalStatus); } } @@ -891,7 +915,8 @@ struct HfCorrelatorD0Hadrons { continue; } int poolBin = corrBinningMcGen.getBin(std::make_tuple(c2.posZ(), getTracksSize(c2))); - entryD0HadronPair(getDeltaPhi(t2.phi(), t1.phi()), t2.eta() - t1.eta(), t1.pt(), t2.pt(), poolBin); + bool correlationStatus = false; + entryD0HadronPair(getDeltaPhi(t2.phi(), t1.phi()), t2.eta() - t1.eta(), t1.pt(), t2.pt(), poolBin, correlationStatus); entryD0HadronRecoInfo(massD0, massD0, 0); // dummy info } } diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index c6f732c2d62..353328e4a88 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -52,6 +52,8 @@ AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::m AxisSpec axisPtD = {10, 0., 10., ""}; AxisSpec axisPtHadron = {11, 0., 11., ""}; AxisSpec axisPoolBin = {9, 0., 9., ""}; +AxisSpec axisInvmass = {200, 1.3848, 2.3848, ""}; +AxisSpec axisCorrelationState = {2, 0., 1., ""}; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 12; @@ -165,8 +167,9 @@ struct HfTaskCorrelationD0Hadrons { {"hCorrel2DVsPtGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtD + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the pT) are updated in the init(), {"hCorrel2DPtIntGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, {"hDeltaEtaPtIntGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}}}; - + {"hDeltaPhiPtIntGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + // Toward Transverse Away + {"hCorInfoWithCorrelationState", stringDHadron + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPoolBin}, {axisInvmass}, {axisCorrelationState}}}}}}; void init(InitContext&) { int nBinsPtAxis = binsCorrelations->size() - 1; @@ -227,6 +230,7 @@ struct HfTaskCorrelationD0Hadrons { int effBinD = o2::analysis::findBin(binsEfficiency, ptD); int ptBinD = o2::analysis::findBin(binsCorrelations, ptD); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside pT ranges of interest if (ptBinD < 0 || effBinD < 0) { @@ -240,11 +244,17 @@ struct HfTaskCorrelationD0Hadrons { if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptD))); // ***** track efficiency to be implemented ***** } - // reject entries outside pT ranges of interest if (ptBinD == -1) { // at least one particle outside accepted pT range continue; } + //============================================================================================================== + if (signalStatus == ParticleTypeData::D0Only || (signalStatus == ParticleTypeData::D0D0barBoth)) { + registry.fill(HIST("hCorInfoWithCorrelationState"), deltaPhi, deltaEta, ptD, ptHadron, poolBin, massD, isAutoCorrelated, efficiencyWeight); + } + if (signalStatus == ParticleTypeData::D0barOnly || (signalStatus == ParticleTypeData::D0D0barBoth)) { + registry.fill(HIST("hCorInfoWithCorrelationState"), deltaPhi, deltaEta, ptD, ptHadron, poolBin, massDbar, isAutoCorrelated, efficiencyWeight); + } // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if ((massD > signalRegionLeft->at(ptBinD) && massD < signalRegionRight->at(ptBinD)) && ((signalStatus == ParticleTypeData::D0Only) || (signalStatus == ParticleTypeData::D0D0barBoth))) { // in signal region