From 7a6f6b1f8ee3721382b2346b57a1350e758a7539 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Thu, 21 Jul 2022 15:33:20 +0200 Subject: [PATCH 1/9] Dplus-Hadron Table added --- PWGHF/DataModel/HFSecondaryVertex.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index 27b10083359..63e41281bd2 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1019,6 +1019,24 @@ DECLARE_SOA_TABLE(DDbarRecoInfo, "AOD", "DDBARRECOINFO", aod::hf_correlation_ddbar::MD, aod::hf_correlation_ddbar::MDbar, aod::hf_correlation_ddbar::SignalStatus); + +// definition of columns and tables for Dplus-Hadron correlation pairs +namespace hf_correlation_dplushadron { +DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); +DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); +DECLARE_SOA_COLUMN(PtD, ptD, float); +DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); +DECLARE_SOA_COLUMN(MD, mD, float); +DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); +} // namespace hf_correlation_dplushadron +DECLARE_SOA_TABLE(DplusHadronPair, "AOD", "DPLUSHPAIR", + aod::hf_correlation_dplushadron::DeltaPhi, + aod::hf_correlation_dplushadron::DeltaEta, + aod::hf_correlation_dplushadron::PtD, + aod::hf_correlation_dplushadron::PtHadron); +DECLARE_SOA_TABLE(DplusHadronRecoInfo, "AOD", "DPLUSHRECOINFO", + aod::hf_correlation_dplushadron::MD, + aod::hf_correlation_dplushadron::SignalStatus); // specific Xicc candidate properties namespace hf_cand_xicc From d95a5611d1bc3b48354b4825472da83e1416063c Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Thu, 21 Jul 2022 15:37:54 +0200 Subject: [PATCH 2/9] fixed --- PWGHF/DataModel/HFSecondaryVertex.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index 63e41281bd2..66771651e52 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1021,7 +1021,8 @@ DECLARE_SOA_TABLE(DDbarRecoInfo, "AOD", "DDBARRECOINFO", aod::hf_correlation_ddbar::SignalStatus); // definition of columns and tables for Dplus-Hadron correlation pairs -namespace hf_correlation_dplushadron { +namespace hf_correlation_dplushadron +{ DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); DECLARE_SOA_COLUMN(PtD, ptD, float); From d3e949347fbe7fbb2dcb244b0e55a36b2b6762e8 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Thu, 21 Jul 2022 15:44:37 +0200 Subject: [PATCH 3/9] fixed --- PWGHF/DataModel/HFSecondaryVertex.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/DataModel/HFSecondaryVertex.h b/PWGHF/DataModel/HFSecondaryVertex.h index 66771651e52..978a8a9f0b3 100644 --- a/PWGHF/DataModel/HFSecondaryVertex.h +++ b/PWGHF/DataModel/HFSecondaryVertex.h @@ -1019,7 +1019,7 @@ DECLARE_SOA_TABLE(DDbarRecoInfo, "AOD", "DDBARRECOINFO", aod::hf_correlation_ddbar::MD, aod::hf_correlation_ddbar::MDbar, aod::hf_correlation_ddbar::SignalStatus); - + // definition of columns and tables for Dplus-Hadron correlation pairs namespace hf_correlation_dplushadron { From 2bc6d8e178ccfe83590e87b29d573dcbe323d735 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Thu, 21 Jul 2022 17:20:48 +0200 Subject: [PATCH 4/9] Correlator Task --- .../HFCorrelatorDplusHadrons.cxx | 343 ++++++++++++++++++ 1 file changed, 343 insertions(+) create mode 100644 PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx diff --git a/PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx new file mode 100644 index 00000000000..543952e355f --- /dev/null +++ b/PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx @@ -0,0 +1,343 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file HFCorrelatorDplusHadrons.cxx +/// \author Shyam Kumar + +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "PWGHF/DataModel/HFSecondaryVertex.h" +#include "PWGHF/DataModel/HFCandidateSelectionTables.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::hf_cand_prong3; +using namespace o2::aod::hf_correlation_dplushadron; +using namespace o2::analysis::hf_cuts_dplus_topikpi; +using namespace o2::constants::math; + +/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies + +double getDeltaPhi(double phiD, double phiHadron) +{ + return RecoDecay::constrainAngle(phiHadron - phiD, -o2::constants::math::PI / 2.); +} + +/// definition of variables for Dplus hadron pairs (in data-like, MC-reco and MC-kine tasks) +const int npTBinsMassAndEfficiency = o2::analysis::hf_cuts_dplus_topikpi::npTBins; +const double efficiencyDmesonDefault[npTBinsMassAndEfficiency] = {}; +auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsMassAndEfficiency}; + +// histogram binning definition +const int massAxisBins = 350; +const double massAxisMin = 1.7; +const double massAxisMax = 2.05; +const int phiAxisBins = 32; +const double phiAxisMin = -o2::constants::math::PI / 2.; +const double phiAxisMax = 3. * o2::constants::math::PI / 2.; +const int yAxisBins = 100; +const double yAxisMin = -2.; +const double yAxisMax = 2.; +const int ptDAxisBins = 180; +const double ptDAxisMin = 0.; +const double ptDAxisMax = 36.; + +using MCParticlesPlus3Prong = soa::Join; + +/// Dplus-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) +struct HfCorrelatorDplusHadrons { + Produces entryDplusHadronPair; + Produces entryDplusHadronRecoInfo; + + HistogramRegistry registry{ + "registry", + {{"hPtCand", "Dplus,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0", "Dplus,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1", "Dplus,Hadron candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng2", "Dplus,Hadron candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hSelectionStatus", "Dplus,Hadron candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, + {"hEta", "Dplus,Hadron candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhi", "Dplus,Hadron candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hY", "Dplus,Hadron candidates;candidate #it{#y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPtCandMCRec", "Dplus,Hadron candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0MCRec", "Dplus,Hadron candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1MCRec", "Dplus,Hadron candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng2MCRec", "Dplus,Hadron candidates - MC reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hSelectionStatusMCRec", "Dplus,Hadron candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, + {"hEtaMCRec", "Dplus,Hadron candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCRec", "Dplus,Hadron candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMCRec", "Dplus,Hadron candidates - MC reco;candidate #it{#y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hMCEvtCount", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, + {"hPtCandMCGen", "Dplus,Hadron particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisBins, ptDAxisMin, ptDAxisMax}}}}, + {"hEtaMCGen", "Dplus,Hadron particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMCGen", "Dplus,Hadron particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, 0., 2. * o2::constants::math::PI}}}}, + {"hYMCGen", "Dplus,Hadron candidates - MC gen;candidate #it{#y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hcountDplusHadronPerEvent", "Dplus,Hadron particles - MC gen;Number per event;entries", {HistType::kTH1F, {{20, 0., 20.}}}}, + {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}}}; + + Configurable selectionFlagDplus{"selectionFlagDplus", 1, "Selection Flag for Dplus"}; + Configurable cutYCandMax{"cutYCandMax", -1., "max. cand. rapidity"}; + Configurable cutTrackEtaMax{"cutTrackEtaMax", -1., "max. eta of tracks"}; + Configurable cutDCAxyMax{"cutDCAxyMax", -1., "max. DCAxy of tracks"}; + Configurable cutDCAzMax{"cutDCAzMax", -1., "max. DCAz of tracks"}; + Configurable cutPtCandMin{"cutPtCandMin", -1., "min. cand. pT"}; + Configurable cutPtTrackMin{"cutPtTrackMin", -1., "min. track pT"}; + Configurable cutPtCandMax{"cutPtCandMax", -1., "max. cand. pT"}; + Configurable> bins{"ptBinsForMassAndEfficiency", std::vector{o2::analysis::hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits for candidate mass plots and efficiency"}; + Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{efficiencyDmeson_v}, "Efficiency values for Dplus meson"}; + Configurable flagApplyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; + Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; + Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; + + void init(o2::framework::InitContext&) + { + auto vbins = (std::vector)bins; + registry.add("hMassDplus_2D", "Dplus candidates;inv. mass (K^{-}#pi^{+}#pi^{+}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusData", "Dplus candidates;inv. mass (K^{-}#pi^{+}#pi^{+}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); + registry.add("hMassDplusMCRec", "Dplus candidates;inv. mass (K^{-}#pi^{+}#pi^{+}) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); + registry.add("hMassDplusMCRecSig", "Dplus signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassDplusMCRecBkg", "Dplus background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hcountDplustriggersMCGen", "Dplus trigger particles - MC gen;;N of trigger Dplus", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + } + + Partition> selectedDPlusCandidates = aod::hf_selcandidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; + + /// Dplus-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) + void processData(aod::Collision const& collision, soa::Join& tracks, soa::Join const& candidates) + { + int nTracks = 0; + if (collision.numContrib() > 1) { + for (const auto& track : tracks) { + if (std::abs(track.eta()) > cutTrackEtaMax) { + continue; + } + if (std::abs(track.dcaXY()) > cutDCAxyMax || std::abs(track.dcaZ()) > cutDCAzMax) { + continue; + } + nTracks++; + } + } + + registry.fill(HIST("hMultiplicityPreSelection"), nTracks); + if (nTracks < multMin || nTracks > multMax) { + return; + } + registry.fill(HIST("hMultiplicity"), nTracks); + + for (auto& candidate1 : selectedDPlusCandidates) { + if (cutYCandMax >= 0. && std::abs(YDPlus(candidate1)) > cutYCandMax) { + continue; + } + if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { + continue; + } + if (candidate1.pt() > cutPtCandMax) { + continue; + } + // check decay channel flag for candidate1 + if (!(candidate1.hfflag() & 1 << DecayType::DPlusToPiKPi)) { + continue; + } + double efficiencyWeight = 1.; + if (flagApplyEfficiency) { + efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); + } + // fill invariant mass plots and generic info from all Dplus candidates + registry.fill(HIST("hMassDplus_2D"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); + registry.fill(HIST("hMassDplusData"), InvMassDPlus(candidate1), efficiencyWeight); + registry.fill(HIST("hPtCand"), candidate1.pt()); + registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); + registry.fill(HIST("hPtProng2"), candidate1.ptProng2()); + registry.fill(HIST("hEta"), candidate1.eta()); + registry.fill(HIST("hPhi"), candidate1.phi()); + registry.fill(HIST("hY"), YDPlus(candidate1)); + registry.fill(HIST("hSelectionStatus"), candidate1.isSelDplusToPiKPi()); + + // Dplus-Hadron correlation dedicated section + // if the candidate is a Dplus, search for Hadrons and evaluate correlations + for (const auto& track : tracks) { + if (std::abs(track.eta()) > cutTrackEtaMax) { + continue; + } + if (track.pt() < cutPtTrackMin) { + continue; + } + if (std::abs(track.dcaXY()) >= cutDCAxyMax || std::abs(track.dcaZ()) >= cutDCAzMax) { + continue; // Remove secondary tracks + } + // Removing Dplus daughters by checking track indices + if ((candidate1.index0Id() == track.mRowIndex) || (candidate1.index1Id() == track.mRowIndex) || (candidate1.index2Id() == track.mRowIndex)) { + continue; + } + entryDplusHadronPair(getDeltaPhi(track.phi(), candidate1.phi()), + track.eta() - candidate1.eta(), + candidate1.pt(), + track.pt()); + entryDplusHadronRecoInfo(InvMassDPlus(candidate1), 0); + } // Hadron Tracks loop + } // end outer Dplus loop + } + + PROCESS_SWITCH(HfCorrelatorDplusHadrons, processData, "Process data", false); + + /// Dplus-Hadron correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied) + Partition> recoFlagDPlusCandidates = aod::hf_selcandidate_dplus::isSelDplusToPiKPi > 0; + + void processMcRec(aod::Collision const& collision, soa::Join& tracks, soa::Join const& candidates) + { + int nTracks = 0; + if (collision.numContrib() > 1) { + for (const auto& track : tracks) { + if (std::abs(track.eta()) > cutTrackEtaMax) { + continue; + } + if (std::abs(track.dcaXY()) > cutDCAxyMax || std::abs(track.dcaZ()) > cutDCAzMax) { + continue; + } + nTracks++; + } + } + registry.fill(HIST("hMultiplicityPreSelection"), nTracks); + if (nTracks < multMin || nTracks > multMax) { + return; + } + registry.fill(HIST("hMultiplicity"), nTracks); + + // MC reco level + bool flagDplusSignal = false; + for (auto& candidate1 : recoFlagDPlusCandidates) { + // check decay channel flag for candidate1 + if (!(candidate1.hfflag() & 1 << DecayType::DPlusToPiKPi)) { + continue; + } + if (cutYCandMax >= 0. && std::abs(YDPlus(candidate1)) > cutYCandMax) { + continue; + } + if (cutPtCandMin >= 0. && candidate1.pt() < cutPtCandMin) { + continue; + } + if (candidate1.pt() >= cutPtCandMax) { + continue; + } + double efficiencyWeight = 1.; + if (flagApplyEfficiency) { + efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); + } + + if (std::abs(candidate1.flagMCMatchRec()) == 1 << DecayType::DPlusToPiKPi) { + // fill per-candidate distributions from Dplus true candidates + registry.fill(HIST("hPtCandMCRec"), candidate1.pt()); + registry.fill(HIST("hPtProng0MCRec"), candidate1.ptProng0()); + registry.fill(HIST("hPtProng1MCRec"), candidate1.ptProng1()); + registry.fill(HIST("hPtProng2MCRec"), candidate1.ptProng2()); + registry.fill(HIST("hEtaMCRec"), candidate1.eta()); + registry.fill(HIST("hPhiMCRec"), candidate1.phi()); + registry.fill(HIST("hYMCRec"), YDPlus(candidate1)); + registry.fill(HIST("hSelectionStatusMCRec"), candidate1.isSelDplusToPiKPi()); + } + // fill invariant mass plots from Dplus signal and background candidates + registry.fill(HIST("hMassDplusMCRec"), InvMassDPlus(candidate1), efficiencyWeight); + if (candidate1.flagMCMatchRec() == 1 << DecayType::DPlusToPiKPi) { // also matched as Dplus + registry.fill(HIST("hMassDplusMCRecSig"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); + } else { + registry.fill(HIST("hMassDplusMCRecBkg"), InvMassDPlus(candidate1), candidate1.pt(), efficiencyWeight); + } + + // Dplus-Hadron correlation dedicated section + // if the candidate is selected as Dplus, search for Hadron and evaluate correlations + flagDplusSignal = candidate1.flagMCMatchRec() == 1 << DecayType::DPlusToPiKPi; + for (const auto& track : tracks) { + if (std::abs(track.eta()) > cutTrackEtaMax) { + continue; + } + if (track.pt() < cutPtTrackMin) { + continue; + } + // Removing Dplus daughters by checking track indices + if ((candidate1.index0Id() == track.mRowIndex) || (candidate1.index1Id() == track.mRowIndex) || (candidate1.index2Id() == track.mRowIndex)) { + continue; + } + if (std::abs(track.dcaXY()) >= cutDCAxyMax || std::abs(track.dcaZ()) >= cutDCAzMax) { + continue; // Remove secondary tracks + } + entryDplusHadronPair(getDeltaPhi(track.phi(), candidate1.phi()), + track.eta() - candidate1.eta(), + candidate1.pt(), + track.pt()); + entryDplusHadronRecoInfo(InvMassDPlus(candidate1), (int)flagDplusSignal); + } // end inner loop (Tracks) + + } // end outer Dplus loop + } + + PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcRec, "Process MC Reco mode", true); + /// Dplus-Hadron correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) + void processMcGen(aod::McCollision const& mccollision, MCParticlesPlus3Prong const& particlesMC) + { + int counterDplusHadron = 0; + registry.fill(HIST("hMCEvtCount"), 0); + // MC gen level + for (auto& particle1 : particlesMC) { + // check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! + if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { + continue; + } + double yD = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); + if (cutYCandMax >= 0. && std::abs(yD) > cutYCandMax) { + continue; + } + if (cutPtCandMin >= 0. && particle1.pt() < cutPtCandMin) { + continue; + } + registry.fill(HIST("hPtCandMCGen"), particle1.pt()); + registry.fill(HIST("hEtaMCGen"), particle1.eta()); + registry.fill(HIST("hPhiMCGen"), particle1.phi()); + registry.fill(HIST("hYMCGen"), yD); + counterDplusHadron++; + // Dplus Hadron correlation dedicated section + // if it's a Dplus particle, search for Hadron and evaluate correlations + if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + continue; + } + registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus for normalisation) + for (auto& particle2 : particlesMC) { + if (std::abs(particle2.eta()) > cutTrackEtaMax) { + continue; + } + if (particle2.pt() < cutPtTrackMin) { + continue; + } + + if ((std::abs(particle2.pdgCode()) != 11) && (std::abs(particle2.pdgCode()) != 13) && (std::abs(particle2.pdgCode()) != 211) && (std::abs(particle2.pdgCode()) != 321) && (std::abs(particle2.pdgCode()) != 2212)) { + continue; + } + entryDplusHadronPair(getDeltaPhi(particle2.phi(), particle1.phi()), + particle2.eta() - particle1.eta(), + particle1.pt(), + particle2.pt()); + + } // end inner loop + } // end outer loop + registry.fill(HIST("hcountDplusHadronPerEvent"), counterDplusHadron); + } + PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcGen, "Process MC Gen mode", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 4593bf426b7d87889ee008fb35c9b56c0b0f5692 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Thu, 21 Jul 2022 17:22:44 +0200 Subject: [PATCH 5/9] Correlation task for Dplus-Hadron --- .../HFC/Tasks/taskCorrelationDplusHadrons.cxx | 270 ++++++++++++++++++ 1 file changed, 270 insertions(+) create mode 100644 PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx diff --git a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx new file mode 100644 index 00000000000..36a436279f7 --- /dev/null +++ b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx @@ -0,0 +1,270 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file taskCorrelationDplusHadrons.cxx +/// \author Shyam Kumar + +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "PWGHF/DataModel/HFSecondaryVertex.h" +#include "PWGHF/DataModel/HFCandidateSelectionTables.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::hf_cand_prong3; +using namespace o2::aod::hf_correlation_dplushadron; +using namespace o2::analysis::hf_cuts_dplus_topikpi; +using namespace o2::constants::math; + +namespace o2::aod +{ +using DplusHadronPairFull = soa::Join; +} // namespace o2::aod + +/// +/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies +/// +double getDeltaPhi(double phiD, double phiHadron) +{ + return RecoDecay::constrainAngle(phiHadron - phiD, -o2::constants::math::PI / 2.); +} + +/// +/// Returns phi of candidate/particle evaluated from x and y components of segment connecting primary and secondary vertices +/// +double evaluatePhiByVertex(double xVertex1, double xVertex2, double yVertex1, double yVertex2) +{ + return RecoDecay::Phi(xVertex2 - xVertex1, yVertex2 - yVertex1); +} + +// string definitions, used for histogram axis labels +const TString stringPtD = "#it{p}_{T}^{D} (GeV/#it{c});"; +const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; +const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{D};"; +const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{D} (rad);"; +const TString stringDHadron = "D,Hadron candidates "; +const TString stringSignal = "signal region;"; +const TString stringSideband = "sidebands;"; +const TString stringMCParticles = "MC gen - D,Hadron particles;"; +const TString stringMCReco = "MC reco - D,Hadron candidates "; + +const int npTBinsCorrelations = 8; +const double pTBinsCorrelations[npTBinsCorrelations + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; +auto pTBinsCorrelations_v = std::vector{pTBinsCorrelations, pTBinsCorrelations + npTBinsCorrelations + 1}; +const double signalRegionInnerDefault[npTBinsCorrelations] = {1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490, 1.8490}; +const double signalRegionOuterDefault[npTBinsCorrelations] = {1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890, 1.8890}; +const double sidebandLeftOuterDefault[npTBinsCorrelations] = {1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690, 1.7690}; +const double sidebandLeftInnerDefault[npTBinsCorrelations] = {1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250, 1.8250}; +const double sidebandRightInnerDefault[npTBinsCorrelations] = {1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130, 1.9130}; +const double sidebandRightOuterDefault[npTBinsCorrelations] = {1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690, 1.9690}; +auto signalRegionInner_v = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + npTBinsCorrelations}; +auto signalRegionOuter_v = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + npTBinsCorrelations}; +auto sidebandLeftInner_v = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + npTBinsCorrelations}; +auto sidebandLeftOuter_v = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + npTBinsCorrelations}; +auto sidebandRightInner_v = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + npTBinsCorrelations}; +auto sidebandRightOuter_v = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + npTBinsCorrelations}; +const int npTBinsEfficiency = o2::analysis::hf_cuts_dplus_topikpi::npTBins; +const double efficiencyDmesonDefault[npTBinsEfficiency] = {}; +auto efficiencyDmeson_v = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + npTBinsEfficiency}; + +/// Dplus-Hadron correlation pair filling task, from pair tables - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) +struct HfTaskCorrelationDplusHadrons { + + HistogramRegistry registry{ + "registry", + { + {"hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {{200, -10., 10.}}}}, + {"hDeltaPhiPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}}}}, + {"hCorrel2DPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, + {"hCorrel2DVsPtSignalRegion", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}}}}, // note: axes 3 and 4 (the pT) are updated in the init() + {"hDeltaEtaPtIntSidebands", stringDHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {{200, -10., 10.}}}}, + {"hDeltaPhiPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}}}}, + {"hCorrel2DPtIntSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, + {"hCorrel2DVsPtSidebands", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}}}}, // note: axes 3 and 4 (the pT) are updated in the init() + {"hDeltaEtaPtIntSignalRegionMCRec", stringDHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {{200, -10., 10.}}}}, + {"hDeltaPhiPtIntSignalRegionMCRec", stringDHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}}}}, + {"hDeltaEtaPtIntSidebandsMCRec", stringDHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {{200, -10., 10.}}}}, + {"hCorrel2DPtIntSignalRegionMCRec", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, + {"hCorrel2DVsPtSignalRegionMCRec", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}}}}, + {"hCorrel2DVsPtSignalMCRec", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}}}}, + {"hCorrel2DVsPtBkgMCRec", stringDHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}}}}, + {"hDeltaPhiPtIntSidebandsMCRec", stringDHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}}}}, + {"hCorrel2DPtIntSidebandsMCRec", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, + {"hCorrel2DVsPtSidebandsMCRec", stringDHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}}}}, + {"hDeltaEtaPtIntMCGen", stringMCParticles + stringDeltaEta + "entries", {HistType::kTH1F, {{200, -10., 10.}}}}, + {"hDeltaPhiPtIntMCGen", stringMCParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}}}}, + {"hCorrel2DPtIntMCGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {200, -10., 10.}}}}, + {"hCorrel2DVsPtMCGen", stringMCParticles + stringDeltaPhi + stringDeltaEta + stringPtD + "entries", {HistType::kTHnSparseD, {{64, -o2::constants::math::PI / 2., 3. * o2::constants::math::PI / 2.}, {40, -2., 2.}, {10, 0., 10.}, {11, 0., 11.}}}}, // note: axes 3 and 4 (the pT) are updated in the init() + }}; + // pT ranges for correlation plots: the default values are those embedded in hf_cuts_dplus_topikpi (i.e. the mass pT bins), but can be redefined via json files + Configurable> binsCorrelations{"ptBinsForCorrelations", std::vector{pTBinsCorrelations_v}, "pT bin limits for correlation plots"}; + Configurable> binsEfficiency{"ptBinsForEfficiency", std::vector{o2::analysis::hf_cuts_dplus_topikpi::pTBins_v}, "pT bin limits for efficiency"}; + // signal and sideband region edges, to be defined via json file (initialised to empty) + Configurable> signalRegionInner{"signalRegionInner", std::vector{signalRegionInner_v}, "Inner values of signal region vs pT"}; + Configurable> signalRegionOuter{"signalRegionOuter", std::vector{signalRegionOuter_v}, "Outer values of signal region vs pT"}; + Configurable> sidebandLeftInner{"sidebandLeftInner", std::vector{sidebandLeftInner_v}, "Inner values of left sideband vs pT"}; + Configurable> sidebandLeftOuter{"sidebandLeftOuter", std::vector{sidebandLeftOuter_v}, "Outer values of left sideband vs pT"}; + Configurable> sidebandRightInner{"sidebandRightInner", std::vector{sidebandRightInner_v}, "Inner values of right sideband vs pT"}; + Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{sidebandRightOuter_v}, "Outer values of right sideband vs pT"}; + Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{efficiencyDmeson_v}, "Efficiency values for D meson specie under study"}; + Configurable flagApplyEfficiency{"efficiencyFlagDplus", 1, "Flag for applying efficiency weights"}; + + void init(o2::framework::InitContext&) + { + // redefinition of pT axes for THnSparse holding correlation entries + int nBinspTaxis = binsCorrelations->size() - 1; + const double* valuespTaxis = binsCorrelations->data(); + + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->GetAxis(2)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtSidebands"))->GetAxis(2)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebands"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalRegionMCRec"))->GetAxis(2)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtSidebandsMCRec"))->GetAxis(2)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtSignalRegionMCRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSidebandsMCRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtSignalMCRec"))->GetAxis(2)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtSignalMCRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtBkgMCRec"))->GetAxis(2)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtBkgMCRec"))->Sumw2(); + registry.get(HIST("hCorrel2DVsPtMCGen"))->GetAxis(2)->Set(nBinspTaxis, valuespTaxis); + registry.get(HIST("hCorrel2DVsPtMCGen"))->Sumw2(); + } + + void processData(aod::DplusHadronPairFull const& pairEntries) + { + for (auto& pairEntry : pairEntries) { + // define variables for widely used quantities + double deltaPhi = pairEntry.deltaPhi(); + double deltaEta = pairEntry.deltaEta(); + double ptD = pairEntry.ptD(); + double ptHadron = pairEntry.ptHadron(); + double massD = pairEntry.mD(); + int effBinD = o2::analysis::findBin(binsEfficiency, ptD); + int pTBinD = o2::analysis::findBin(binsCorrelations, ptD); + // reject entries outside pT ranges of interest + if (pTBinD < 0 || effBinD < 0) { + continue; + } + if (ptHadron > 10.0) { + ptHadron = 10.5; + } + double efficiencyWeight = 1.; + double efficiencyHadron = 1.; // Note: To be implemented later on + if (flagApplyEfficiency) { + efficiencyWeight = 1. / (efficiencyDmeson->at(effBinD) * efficiencyHadron); + } + + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots + if (massD > signalRegionInner->at(pTBinD) && massD < signalRegionOuter->at(pTBinD)) { + // in signal region + registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, efficiencyWeight); + } + + if ((massD > sidebandLeftOuter->at(pTBinD) && massD < sidebandLeftInner->at(pTBinD)) || + (massD > sidebandRightInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD))) { + // in sideband region + registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebands"), deltaPhi, efficiencyWeight); + } + } // end loop + } + PROCESS_SWITCH(HfTaskCorrelationDplusHadrons, processData, "Process data", false); + + /// D-Hadron correlation pair filling task, from pair tables - for MC reco-level analysis (candidates matched to true signal only, but also bkg sources are studied) + void processMcRec(aod::DplusHadronPairFull const& pairEntries) + { + for (auto& pairEntry : pairEntries) { + // define variables for widely used quantities + double deltaPhi = pairEntry.deltaPhi(); + double deltaEta = pairEntry.deltaEta(); + double ptD = pairEntry.ptD(); + double ptHadron = pairEntry.ptHadron(); + double massD = pairEntry.mD(); + int effBinD = o2::analysis::findBin(binsEfficiency, ptD); + int pTBinD = o2::analysis::findBin(binsCorrelations, ptD); + if (pTBinD < 0 || effBinD < 0) { + continue; + } + if (ptHadron > 10.0) { + ptHadron = 10.5; + } + double efficiencyWeight = 1.; + double efficiencyHadron = 1.; // Note: To be implemented later on + if (flagApplyEfficiency) { + efficiencyWeight = 1. / (efficiencyDmeson->at(effBinD) * efficiencyHadron); + } + // fill correlation plots for signal/bagkground correlations + if (pairEntry.signalStatus()) { + registry.fill(HIST("hCorrel2DVsPtSignalMCRec"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtBkgMCRec"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); + } + // reject entries outside pT ranges of interest + + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots + if (massD > signalRegionInner->at(pTBinD) && massD < signalRegionOuter->at(pTBinD)) { + // in signal region + registry.fill(HIST("hCorrel2DVsPtSignalRegionMCRec"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSignalRegionMCRec"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSignalRegionMCRec"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSignalRegionMCRec"), deltaPhi, efficiencyWeight); + } + + if (((massD > sidebandLeftOuter->at(pTBinD)) && (massD < sidebandLeftInner->at(pTBinD))) || + ((massD > sidebandRightInner->at(pTBinD) && massD < sidebandRightOuter->at(pTBinD)))) { + // in sideband region + registry.fill(HIST("hCorrel2DVsPtSidebandsMCRec"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebandsMCRec"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebandsMCRec"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebandsMCRec"), deltaPhi, efficiencyWeight); + } + } // end loop + } + PROCESS_SWITCH(HfTaskCorrelationDplusHadrons, processMcRec, "Process MC Reco mode", true); + + /// D-Hadron correlation pair filling task, from pair tables - for MC gen-level analysis (no filter/selection, only true signal) + void processMcGen(aod::DplusHadronPair const& pairEntries) + { + for (auto& pairEntry : pairEntries) { + // define variables for widely used quantities + double deltaPhi = pairEntry.deltaPhi(); + double deltaEta = pairEntry.deltaEta(); + double ptD = pairEntry.ptD(); + double ptHadron = pairEntry.ptHadron(); + // reject entries outside pT ranges of interest + if (o2::analysis::findBin(binsCorrelations, ptD) < 0) { + continue; + } + if (ptHadron > 10.0) { + ptHadron = 10.5; + } + + registry.fill(HIST("hCorrel2DVsPtMCGen"), deltaPhi, deltaEta, ptD, ptHadron); + registry.fill(HIST("hCorrel2DPtIntMCGen"), deltaPhi, deltaEta); + registry.fill(HIST("hDeltaEtaPtIntMCGen"), deltaEta); + registry.fill(HIST("hDeltaPhiPtIntMCGen"), deltaPhi); + } // end loop + } + PROCESS_SWITCH(HfTaskCorrelationDplusHadrons, processMcGen, "Process MC Gen mode", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From dd42e8c2f1ee186043fe9e38e1446b4ddc756407 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Thu, 21 Jul 2022 17:25:40 +0200 Subject: [PATCH 6/9] Dplus-hadron correlator added --- PWGHF/HFC/TableProducer/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGHF/HFC/TableProducer/CMakeLists.txt b/PWGHF/HFC/TableProducer/CMakeLists.txt index 846a0ec6997..0bc84feba35 100644 --- a/PWGHF/HFC/TableProducer/CMakeLists.txt +++ b/PWGHF/HFC/TableProducer/CMakeLists.txt @@ -23,3 +23,8 @@ o2physics_add_dpl_workflow(correlator-dplusdminus SOURCES HFCorrelatorDplusDminus.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(correlator-dplus-hadrons + SOURCES HFCorrelatorDplusHadrons.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing + COMPONENT_NAME Analysis) From 86a1df0fe271e5c723451c7d2ea36a9d472e0b15 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Thu, 21 Jul 2022 17:28:27 +0200 Subject: [PATCH 7/9] Dplus-hadron correlation task --- PWGHF/HFC/Tasks/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGHF/HFC/Tasks/CMakeLists.txt b/PWGHF/HFC/Tasks/CMakeLists.txt index c0b3c73de16..8d9f03c98d2 100644 --- a/PWGHF/HFC/Tasks/CMakeLists.txt +++ b/PWGHF/HFC/Tasks/CMakeLists.txt @@ -13,3 +13,8 @@ o2physics_add_dpl_workflow(task-correlation-ddbar SOURCES taskCorrelationDDbar.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(task-correlation-dplus-hadrons + SOURCES taskCorrelationDplusHadrons.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::DetectorsVertexing + COMPONENT_NAME Analysis) From e9d8018d027f31f8f4684885f13ec97fcbc5328e Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Tue, 26 Jul 2022 10:57:27 +0200 Subject: [PATCH 8/9] Fixed for compilation: Phi->phi --- PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx index 36a436279f7..c23d5d2b78a 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDplusHadrons.cxx @@ -44,7 +44,7 @@ double getDeltaPhi(double phiD, double phiHadron) /// double evaluatePhiByVertex(double xVertex1, double xVertex2, double yVertex1, double yVertex2) { - return RecoDecay::Phi(xVertex2 - xVertex1, yVertex2 - yVertex1); + return RecoDecay::phi(xVertex2 - xVertex1, yVertex2 - yVertex1); } // string definitions, used for histogram axis labels From 89283e8eff9512dbae6ded08c994d82c438ef3e8 Mon Sep 17 00:00:00 2001 From: Shyam Kumar Date: Tue, 26 Jul 2022 10:58:54 +0200 Subject: [PATCH 9/9] Fixed for compilation Y()--> y() --- PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx index 543952e355f..cac5c3eb366 100644 --- a/PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/HFCorrelatorDplusHadrons.cxx @@ -296,7 +296,7 @@ struct HfCorrelatorDplusHadrons { if (std::abs(particle1.pdgCode()) != pdg::Code::kDPlus) { continue; } - double yD = RecoDecay::Y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); + double yD = RecoDecay::y(array{particle1.px(), particle1.py(), particle1.pz()}, RecoDecay::getMassPDG(particle1.pdgCode())); if (cutYCandMax >= 0. && std::abs(yD) > cutYCandMax) { continue; }