From b7fe5f06e23250b57d67a0a95dbbccc64780caf1 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:19:38 +0800 Subject: [PATCH 01/78] Add files via upload --- correlatorD0Hadrons.cxx | 953 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 953 insertions(+) create mode 100644 correlatorD0Hadrons.cxx diff --git a/correlatorD0Hadrons.cxx b/correlatorD0Hadrons.cxx new file mode 100644 index 00000000000..c5c2065d6f8 --- /dev/null +++ b/correlatorD0Hadrons.cxx @@ -0,0 +1,953 @@ +// 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 correlatorD0Hadrons.cxx +/// \brief D0-Hadron correlator task - data-like, MC-reco and MC-kine analyses. +/// +/// \author Samrangy Sadhu , INFN Bari +/// \author Swapnesh Santosh Khade , IIT Indore + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/HFC/DataModel/CorrelationTables.h" + +using namespace o2; +using namespace o2::analysis; +using namespace o2::constants::physics; +using namespace o2::framework; +using namespace o2::framework::expressions; + +/// +/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies +/// +double getDeltaPhi(double phiHadron, double phiD) +{ + return RecoDecay::constrainAngle(phiHadron - phiD, -o2::constants::math::PIHalf); +} + +const int nPtBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::nBinsPt; +const double efficiencyDmesonDefault[nPtBinsMassAndEfficiency] = {}; +auto vecEfficiencyDmeson = std::vector{ efficiencyDmesonDefault, efficiencyDmesonDefault + nPtBinsMassAndEfficiency }; + +// histogram binning definition +const int massAxisNBins = 200; +const double massAxisMin = 1.3848; +const double massAxisMax = 2.3848; +const int phiAxisNBins = 32; +const double phiAxisMin = 0.; +const double phiAxisMax = o2::constants::math::TwoPI; +const int yAxisNBins = 100; +const double yAxisMin = -5.; +const double yAxisMax = 5.; +const int ptDAxisNBins = 180; +const double ptDAxisMin = 0.; +const double ptDAxisMax = 36.; + +// Types +using BinningType = ColumnBinningPolicy>; +using SelectedCollisions = soa::Filtered>; +using SelectedTracks = soa::Filtered>; +using SelectedCandidatesData = soa::Filtered>; +using SelectedTracksMcRec = soa::Filtered>; +using SelectedCandidatesMcRec = soa::Filtered>; +using SelectedCollisionsMcGen = soa::Filtered>; +using SelectedParticlesMcGen = soa::Join; + +// Code to select collisions with at least one D0 +struct HfCorrelatorD0HadronsSelection { + SliceCache cache; + + Produces d0Sel; + + Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; + Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; + Configurable yCandMax{ "yCandMax", 4.0, "max. cand. rapidity" }; + Configurable ptCandMin{ "ptCandMin", -1., "min. cand. pT" }; + + HfHelper hfHelper; + + Preslice perCol = aod::hf_cand::collisionId; + Partition> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + Partition> selectedD0candidatesMc = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + + void processD0SelectionData(aod::Collision const& collision, + soa::Join const&) + { + bool isD0Found = 0; + if (selectedD0Candidates.size() > 0) { + auto selectedD0CandidatesGrouped = selectedD0Candidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + + for (const auto& candidate : selectedD0CandidatesGrouped) { + // check decay channel flag for candidate + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + continue; + } + if (std::abs(hfHelper.yD0(candidate)) > yCandMax || candidate.pt() < ptCandMin) { + continue; + } + isD0Found = 1; + break; + } + } + d0Sel(isD0Found); + } + PROCESS_SWITCH(HfCorrelatorD0HadronsSelection, processD0SelectionData, "Process D0 Selection Data", false); + + void processD0SelectionMcRec(aod::Collision const& collision, + soa::Join const&) + { + bool isD0Found = 0; + if (selectedD0candidatesMc.size() > 0) { + auto selectedD0CandidatesGroupedMc = selectedD0candidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + for (const auto& candidate : selectedD0CandidatesGroupedMc) { + // check decay channel flag for candidate + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + continue; + } + if (std::abs(hfHelper.yD0(candidate)) > yCandMax || candidate.pt() < ptCandMin) { + continue; + } + isD0Found = 1; + break; + } + } + d0Sel(isD0Found); + } + PROCESS_SWITCH(HfCorrelatorD0HadronsSelection, processD0SelectionMcRec, "Process D0 Selection MCRec", true); + + void processD0SelectionMcGen(aod::McCollision const&, + aod::McParticles const& mcParticles) + { + bool isD0Found = 0; + for (const auto& particle : mcParticles) { + if (std::abs(particle.pdgCode()) != Pdg::kD0) { + continue; + } + double yD = RecoDecay::y(particle.pVector(), MassD0); + if (std::abs(yD) > yCandMax || particle.pt() < ptCandMin) { + continue; + } + isD0Found = 1; + break; + } + d0Sel(isD0Found); + } + PROCESS_SWITCH(HfCorrelatorD0HadronsSelection, processD0SelectionMcGen, "Process D0 Selection MCGen", false); +}; + +/// D0-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) +struct HfCorrelatorD0Hadrons { + SliceCache cache; + + Produces entryD0HadronPair; + Produces entryD0HadronRecoInfo; + + Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; + Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; + Configurable yCandMax{ "yCandMax", 0.8, "max. cand. rapidity" }; + Configurable etaTrackMax{ "etaTrackMax", 0.8, "max. eta of tracks" }; + Configurable dcaXYTrackMax{ "dcaXYTrackMax", 1., "max. DCAxy of tracks" }; + Configurable dcaZTrackMax{ "dcaZTrackMax", 1., "max. DCAz of tracks" }; + Configurable ptCandMin{ "ptCandMin", 1., "min. cand. pT" }; + Configurable ptTrackMin{ "ptTrackMin", 0.3, "min. track pT" }; + Configurable ptTrackMax{ "ptTrackMax", 99., "max. track pT" }; + Configurable> bins{ "ptBinsForMassAndEfficiency", std::vector{ o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt }, "pT bin limits for candidate mass plots and efficiency" }; + Configurable> efficiencyDmeson{ "efficiencyDmeson", std::vector{ vecEfficiencyDmeson }, "Efficiency values for D0 meson" }; + Configurable applyEfficiency{ "efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights" }; + Configurable multMin{ "multMin", 0., "minimum multiplicity accepted" }; + 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" }; + Configurable numberEventsMixed{ "numberEventsMixed", 5, "Number of events mixed in ME process" }; + ConfigurableAxis zPoolBins{ "zPoolBins", { VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f }, "z vertex position pools" }; + ConfigurableAxis multPoolBins{ "multPoolBins", { VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f }, "event multiplicity pools (FT0M)" }; + ConfigurableAxis multPoolBinsMcGen{ "multPoolBinsMcGen", { VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f }, "Mixing bins - MC multiplicity" }; // In MCGen multiplicity is defined by counting tracks + + HfHelper hfHelper; + BinningType corrBinning{ { zPoolBins, multPoolBins }, true }; + + int leadingIndex = 0; + double massD0{ 0. }; + double massPi{ 0. }; + double massK{ 0. }; + double softPiMass = 0.14543; // pion mass + Q-value of the D*->D0pi decay + + Preslice perCol = aod::hf_cand::collisionId; + + Partition> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + Partition> selectedD0candidatesMc = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; + + Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; + Filter trackFilter = requireGlobalTrackWoDCAInFilter() && (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + Filter d0Filter = (aod::hf_sel_candidate_d0::isSelD0 >= 1) || (aod::hf_sel_candidate_d0::isSelD0bar >= 1); + Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true; + Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == static_cast(Pdg::kD0) || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); + + HistogramRegistry registry{ + "registry", + // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes + { { "hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hSelectionStatus", "D0,D0bar candidates;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, + { "hEta", "D0,D0bar candidates;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, + { "hY", "D0,D0bar candidates;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hMultiplicity", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hPtCandRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng0Rec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng1Rec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hSelectionStatusRec", "D0,D0bar candidates - MC reco;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, + { "hSignalStatusMERec", "Signal Status - MC reco ME;candidate sidnalStatus;entries", { HistType::kTH1F, { { 200, 0, 200 } } } }, + { "hEtaRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hPhiRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, + { "hYRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hEvtCountGen", "Event counter - MC gen;;entries", { HistType::kTH1F, { { 1, -0.5, 0.5 } } } }, + { "hPtCandGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hEtaGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hPhiGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, + { "hYGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hTrackCounter", "soft pion counter - Data", { HistType::kTH1F, { { 5, 0., 5. } } } }, + { "hTrackCounterRec", "soft pion counter - MC rec", { HistType::kTH1F, { { 5, 0., 5. } } } }, + { "hTrackCounterGen", "soft pion counter - MC gen", { HistType::kTH1F, { { 5, 0., 5. } } } }, + { "hMultV0M", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hZvtx", "z vertex;z vertex;entries", { HistType::kTH1F, { { 200, -20., 20. } } } }, + { "hMultFT0M", "Multiplicity FT0M", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hD0Bin", "D0 selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } }, + { "hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } } } + }; + + void init(InitContext&) + { + massD0 = MassD0; + massPi = MassPiPlus; + massK = MassKPlus; + + auto vbins = (std::vector)bins; + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMass1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); + registry.add("hMassD01D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); + registry.add("hMassD0bar1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); + // mass histogram for D0 signal candidates + registry.add("hMassD0RecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + // mass histogram for D0 Reflection candidates + registry.add("hMassD0RecRef", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + // mass histogram for D0 background candidates + registry.add("hMassD0RecBg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + // mass histogram for D0bar signal candidates + registry.add("hMassD0barRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + // mass histogram for D0bar Reflection candidates + registry.add("hMassD0barRecRef", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + // mass histogram for D0bar background candidates + registry.add("hMassD0barRecBg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hCountD0TriggersGen", "D0 trigger particles - MC gen;;N of trigger D0", { HistType::kTH2F, { { 1, -0.5, 0.5 }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + } + + // Find Leading Particle + template + int findLeadingParticle(TTracks const& tracks) + { + auto leadingParticle = tracks.begin(); + for (auto const& track : tracks) { + if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { + continue; + } + if (track.pt() > leadingParticle.pt()) { + leadingParticle = track; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } + // ======= Find Leading Particle for McGen ============ + template + int findLeadingParticleMcGen(TMcParticles const& mcParticles) + { + auto leadingParticle = mcParticles.begin(); + for (auto const& mcParticle : mcParticles) { + if (std::abs(mcParticle.eta()) > etaTrackMax) { + continue; + } + if (mcParticle.pt() < ptTrackMin) { + continue; + } + if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { + continue; + } + if (mcParticle.pt() > leadingParticle.pt()) { + leadingParticle = mcParticle; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } + // ======= Process starts for Data, Same event ============ + + /// D0-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) + void processData(SelectedCollisions::iterator const& collision, + SelectedTracks const& tracks, + soa::Join const&) + { + // protection against empty tables to be sliced + if (selectedD0Candidates.size() == 0) { + return; + } + // find leading particle + if (correlateD0WithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); + int nTracks = 0; + if (collision.numContrib() > 1) { + for (const auto& track : tracks) { + if (std::abs(track.eta()) > etaTrackMax) { + continue; + } + if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { + continue; + } + nTracks++; + } + } + registry.fill(HIST("hMultiplicityPreSelection"), nTracks); + registry.fill(HIST("hZvtx"), collision.posZ()); + registry.fill(HIST("hMultFT0M"), collision.multFT0M()); + if (nTracks < multMin || nTracks > multMax) { + return; + } + registry.fill(HIST("hMultiplicity"), nTracks); + + auto selectedD0CandidatesGrouped = selectedD0Candidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + + for (const auto& candidate1 : selectedD0CandidatesGrouped) { + if (std::abs(hfHelper.yD0(candidate1)) >= yCandMax || candidate1.pt() <= ptCandMin || candidate1.pt() >= ptTrackMax) { + continue; + } + // check decay channel flag for candidate1 + if (!TESTBIT(candidate1.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + continue; + } + + // ========================== Define parameters for soft pion removal ================================ + auto ePiK = RecoDecay::e(candidate1.pVectorProng0(), massPi) + RecoDecay::e(candidate1.pVectorProng1(), massK); + auto eKPi = RecoDecay::e(candidate1.pVectorProng0(), massK) + RecoDecay::e(candidate1.pVectorProng1(), massPi); + + // ========================== trigger efficiency ================================ + double efficiencyWeight = 1.; + if (applyEfficiency) { + efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); + } + // ========================== Fill mass histo ================================ + if (candidate1.isSelD0() >= selectionFlagD0) { + registry.fill(HIST("hMass"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); + registry.fill(HIST("hMass1D"), hfHelper.invMassD0ToPiK(candidate1), efficiencyWeight); + registry.fill(HIST("hMassD01D"), hfHelper.invMassD0ToPiK(candidate1), efficiencyWeight); + } + if (candidate1.isSelD0bar() >= selectionFlagD0bar) { + registry.fill(HIST("hMass"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); + registry.fill(HIST("hMass1D"), hfHelper.invMassD0barToKPi(candidate1), efficiencyWeight); + registry.fill(HIST("hMassD0bar1D"), hfHelper.invMassD0barToKPi(candidate1), efficiencyWeight); + } + // ========================== Fill general histos ================================ + registry.fill(HIST("hPtCand"), candidate1.pt()); + registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); + registry.fill(HIST("hEta"), candidate1.eta()); + registry.fill(HIST("hPhi"), candidate1.phi()); + registry.fill(HIST("hY"), hfHelper.yD0(candidate1)); + registry.fill(HIST("hSelectionStatus"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); + registry.fill(HIST("hD0Bin"), poolBin); + + // ============ D-h correlation dedicated section ================================== + + // ========================== track loop starts here ================================ + 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())) { + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + + registry.fill(HIST("hTrackCounter"), 2); // fill no. of tracks before soft pion removal + + // ========== soft pion removal =================================================== + double invMassDstar1 = 0., invMassDstar2 = 0.; + bool isSoftPiD0 = false, isSoftPiD0bar = false; + auto pSum2 = RecoDecay::p2(candidate1.pVector(), track.pVector()); + auto ePion = track.energy(massPi); + invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); + invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); + + if (candidate1.isSelD0() >= selectionFlagD0) { + if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0 = true; + continue; + } + } + + if (candidate1.isSelD0bar() >= selectionFlagD0bar) { + if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0bar = true; + continue; + } + } + registry.fill(HIST("hTrackCounter"), 3); // fill no. of tracks after soft pion removal + + int signalStatus = 0; + if ((candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { + signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0Only; + } + if ((candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnly; + } + + if (correlateD0WithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } + registry.fill(HIST("hTrackCounter"), 4); // fill no. of tracks have leading particle + } + entryD0HadronPair(getDeltaPhi(track.phi(), candidate1.phi()), + track.eta() - candidate1.eta(), + candidate1.pt(), + track.pt(), + poolBin, + correlationStatus); + entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); + + } // end inner loop (tracks) + + } // end outer loop + } + PROCESS_SWITCH(HfCorrelatorD0Hadrons, processData, "Process data", false); + + // ================ Process starts for MCRec, same event ======================== + + void processMcRec(SelectedCollisions::iterator const& collision, + SelectedTracksMcRec const& tracks, + soa::Join const&) + { + // protection against empty tables to be sliced + if (selectedD0candidatesMc.size() == 0) { + return; + } + // find leading particle + if (correlateD0WithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); + int nTracks = 0; + if (collision.numContrib() > 1) { + for (const auto& track : tracks) { + if (std::abs(track.eta()) > etaTrackMax) { + continue; + } + if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { + continue; + } + nTracks++; + } + } + registry.fill(HIST("hMultiplicityPreSelection"), nTracks); + if (nTracks < multMin || nTracks > multMax) { + return; + } + registry.fill(HIST("hMultiplicity"), nTracks); + + auto selectedD0CandidatesGroupedMc = selectedD0candidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + // MC reco level + bool flagD0 = false; + bool flagD0bar = false; + + for (const auto& candidate1 : selectedD0CandidatesGroupedMc) { + // check decay channel flag for candidate1 + if (!TESTBIT(candidate1.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { + continue; + } + if (std::abs(hfHelper.yD0(candidate1)) >= yCandMax || candidate1.pt() <= ptCandMin || candidate1.pt() >= ptTrackMax) { + continue; + } + + double efficiencyWeight = 1.; + if (applyEfficiency) { + efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); + } + + if (std::abs(candidate1.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + // fill per-candidate distributions from D0/D0bar true candidates + registry.fill(HIST("hPtCandRec"), candidate1.pt()); + registry.fill(HIST("hPtProng0Rec"), candidate1.ptProng0()); + registry.fill(HIST("hPtProng1Rec"), candidate1.ptProng1()); + registry.fill(HIST("hEtaRec"), candidate1.eta()); + registry.fill(HIST("hPhiRec"), candidate1.phi()); + registry.fill(HIST("hYRec"), hfHelper.yD0(candidate1)); + registry.fill(HIST("hSelectionStatusRec"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); + } + // fill invariant mass plots from D0/D0bar signal and background candidates + if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0 + if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // also matched as D0 + registry.fill(HIST("hMassD0RecSig"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); + } else if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + registry.fill(HIST("hMassD0RecRef"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); + } else { + registry.fill(HIST("hMassD0RecBg"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); + } + } + if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar + if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // also matched as D0bar + registry.fill(HIST("hMassD0barRecSig"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); + } else if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { + registry.fill(HIST("hMassD0barRecRef"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); + } else { + registry.fill(HIST("hMassD0barRecBg"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); + } + } + + // ===================== Define parameters for soft pion removal ======================== + auto ePiK = RecoDecay::e(candidate1.pVectorProng0(), massPi) + RecoDecay::e(candidate1.pVectorProng1(), massK); + auto eKPi = RecoDecay::e(candidate1.pVectorProng0(), massK) + RecoDecay::e(candidate1.pVectorProng1(), massPi); + + // ============== D-h correlation dedicated section ==================================== + + flagD0 = candidate1.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate1 matched to D0 (particle) + flagD0bar = candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + + // ========== track loop starts here ======================== + + for (const auto& track : tracks) { + registry.fill(HIST("hTrackCounterRec"), 1); // fill total no. of tracks + + // Removing D0 daughters by checking track indices + bool correlationStatus = false; + if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) { + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + registry.fill(HIST("hTrackCounterRec"), 2); // fill no. of tracks before soft pion removal + + // ===== soft pion removal =================================================== + double invMassDstar1 = 0, invMassDstar2 = 0; + bool isSoftPiD0 = false, isSoftPiD0bar = false; + auto pSum2 = RecoDecay::p2(candidate1.pVector(), track.pVector()); + auto ePion = track.energy(massPi); + invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); + invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); + + if (candidate1.isSelD0() >= selectionFlagD0) { + if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0 = true; + continue; + } + } + + if (candidate1.isSelD0bar() >= selectionFlagD0bar) { + if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0bar = true; + continue; + } + } + + registry.fill(HIST("hTrackCounterRec"), 3); // fill no. of tracks after soft pion removal + + if (correlateD0WithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } + registry.fill(HIST("hTrackCounterRec"), 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); + } // signal case D0 + if (flagD0bar && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Ref); + } // reflection case D0 + if (!flagD0 && !flagD0bar && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Bg); + } // background case D0 + + if (flagD0bar && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barSig); + } // signal case D0bar + if (flagD0 && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barRef); + } // reflection case D0bar + if (!flagD0 && !flagD0bar && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barBg); + } // background case D0bar + + entryD0HadronPair(getDeltaPhi(track.phi(), candidate1.phi()), + track.eta() - candidate1.eta(), + candidate1.pt(), + track.pt(), + poolBin, + correlationStatus); + entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); + } // end inner loop (Tracks) + } // end of outer loop (D0) + registry.fill(HIST("hZvtx"), collision.posZ()); + registry.fill(HIST("hMultV0M"), collision.multFT0M()); + } + + PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcRec, "Process MC Reco mode", true); + + // ================= Process starts for MCGen, same event =================== + + void processMcGen(aod::McCollision const& mcCollision, + soa::Join const& mcParticles) + { + registry.fill(HIST("hEvtCountGen"), 0); + // MC gen level + // find leading particle + if (correlateD0WithLeadingParticle) { + leadingIndex = findLeadingParticleMcGen(mcParticles); + } + for (const auto& particle1 : mcParticles) { + // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! + if (std::abs(particle1.pdgCode()) != Pdg::kD0) { + continue; + } + double yD = RecoDecay::y(particle1.pVector(), MassD0); + if (yCandMax >= 0. && std::abs(yD) > yCandMax) { + continue; + } + if (ptCandMin >= 0. && particle1.pt() < ptCandMin) { + continue; + } + registry.fill(HIST("hPtCandGen"), particle1.pt()); + registry.fill(HIST("hEtaGen"), particle1.eta()); + registry.fill(HIST("hPhiGen"), particle1.phi()); + registry.fill(HIST("hYGen"), yD); + + // =============== D-h correlation dedicated section ===================== + + if (std::abs(particle1.pdgCode()) != Pdg::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) + continue; + } + registry.fill(HIST("hCountD0TriggersGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) + + for (const auto& particle2 : mcParticles) { + registry.fill(HIST("hTrackCounterGen"), 1); // total no. of tracks + if (std::abs(particle2.eta()) > etaTrackMax) { + continue; + } + if (particle2.pt() < ptTrackMin) { + continue; + } + if ((std::abs(particle2.pdgCode()) != kElectron) && (std::abs(particle2.pdgCode()) != kMuonMinus) && (std::abs(particle2.pdgCode()) != kPiPlus) && (std::abs(particle2.pdgCode()) != kKPlus) && (std::abs(particle2.pdgCode()) != kProton)) { + continue; + } + + // ==============================soft pion removal================================ + registry.fill(HIST("hTrackCounterGen"), 2); // fill before soft pi removal + // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion + + auto indexMotherPi = RecoDecay::getMother(mcParticles, particle2, Pdg::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only + auto indexMotherD0 = RecoDecay::getMother(mcParticles, particle1, Pdg::kDStar, true, nullptr, 1); + bool correlationStatus = false; + if (std::abs(particle2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) { + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + + registry.fill(HIST("hTrackCounterGen"), 3); // fill after soft pion removal + + if (correlateD0WithLeadingParticle) { + if (particle2.globalIndex() != leadingIndex) { + continue; + } + registry.fill(HIST("hTrackCounterGen"), 4); // fill no. of tracks have leading particle + } + + auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { + int nTracks = 0; + for (const auto& track : mcParticles) { + if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { + nTracks++; + } + } + return nTracks; + }; + using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; + BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, true }; + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); + entryD0HadronPair(getDeltaPhi(particle2.phi(), particle1.phi()), + particle2.eta() - particle1.eta(), + particle1.pt(), + particle2.pt(), + poolBin, + correlationStatus); + entryD0HadronRecoInfo(massD0, massD0, 0); // dummy info + } // end inner loop (Tracks) + } // end outer loop (D0) + } + + PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcGen, "Process MC Gen mode", false); + + // ====================== Implement Event mixing on Data =================================== + + void processDataMixedEvent(SelectedCollisions const& collisions, + SelectedCandidatesData const& candidates, + SelectedTracks const& tracks) + { + for (const auto& collision : collisions) { + registry.fill(HIST("hMultFT0M"), collision.multFT0M()); + registry.fill(HIST("hZvtx"), collision.posZ()); + } + + auto tracksTuple = std::make_tuple(candidates, tracks); + Pair pairData{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; + + for (const auto& [c1, tracks1, c2, tracks2] : pairData) { + // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); // For debug + int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + + if (std::abs(hfHelper.yD0(t1)) >= yCandMax) { + continue; + } + + // soft pion removal, signal status 1,3 for D0 and 2,3 for D0bar (SoftPi removed), signal status 11,13 for D0 and 12,13 for D0bar (only SoftPi) + auto ePiK = RecoDecay::e(t1.pVectorProng0(), massPi) + RecoDecay::e(t1.pVectorProng1(), massK); + auto eKPi = RecoDecay::e(t1.pVectorProng0(), massK) + RecoDecay::e(t1.pVectorProng1(), massPi); + double invMassDstar1 = 0., invMassDstar2 = 0.; + bool isSoftPiD0 = false, isSoftPiD0bar = false; + auto pSum2 = RecoDecay::p2(t1.pVector(), t2.pVector()); + auto ePion = t2.energy(massPi); + invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); + invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); + + if (t1.isSelD0() >= selectionFlagD0) { + if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(t1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0 = true; + } + } + if (t1.isSelD0bar() >= selectionFlagD0bar) { + if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(t1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0bar = true; + } + } + + int signalStatus = 0; + if (t1.isSelD0() >= selectionFlagD0) { + if (!isSoftPiD0) { + signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0Only; + } else { + signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0OnlySoftPi; + } + } + if (t1.isSelD0bar() >= selectionFlagD0bar) { + if (!isSoftPiD0bar) { + signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnly; + } else { + signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnlySoftPi; + } + } + 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); + } + } + } + PROCESS_SWITCH(HfCorrelatorD0Hadrons, processDataMixedEvent, "Process data mixed event", false); + + // ====================== Implement Event mixing on McRec =================================== + + void processMcRecMixedEvent(SelectedCollisions const& collisions, + SelectedCandidatesMcRec const& candidates, + SelectedTracksMcRec const& tracks) + { + auto tracksTuple = std::make_tuple(candidates, tracks); + Pair pairMcRec{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; + bool flagD0 = false; + bool flagD0bar = false; + for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { + int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); + + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + + if (std::abs(hfHelper.yD0(t1)) >= yCandMax) { + continue; + } + + // soft pion removal + auto ePiK = RecoDecay::e(t1.pVectorProng0(), massPi) + RecoDecay::e(t1.pVectorProng1(), massK); + auto eKPi = RecoDecay::e(t1.pVectorProng0(), massK) + RecoDecay::e(t1.pVectorProng1(), massPi); + double invMassDstar1 = 0., invMassDstar2 = 0.; + bool isSoftPiD0 = false, isSoftPiD0bar = false; + auto pSum2 = RecoDecay::p2(t1.pVector(), t2.pVector()); + auto ePion = t2.energy(massPi); + invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); + invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); + + if (t1.isSelD0() >= selectionFlagD0) { + if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(t1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0 = true; + } + } + + if (t1.isSelD0bar() >= selectionFlagD0bar) { + if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(t1)) - softPiMass) < ptSoftPionMax) { + isSoftPiD0bar = true; + } + } + + flagD0 = t1.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate1 matched to D0 (particle) + flagD0bar = t1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) + int signalStatus = 0; + + if (flagD0 && (t1.isSelD0() >= selectionFlagD0)) { + if (!isSoftPiD0) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Sig); // signalStatus += 1; + } else { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); // signalStatus += 64; + } + } // signal case D0 + + if (flagD0bar && (t1.isSelD0() >= selectionFlagD0)) { + if (!isSoftPiD0) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Ref); // signalStatus += 2; + } else { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); // signalStatus += 64; + } + } // reflection case D0 + + if (!flagD0 && !flagD0bar && (t1.isSelD0() >= selectionFlagD0)) { + if (!isSoftPiD0) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Bg); // signalStatus += 4; + } else { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); + } + } // background case D0 + + if (flagD0bar && (t1.isSelD0bar() >= selectionFlagD0bar)) { + if (!isSoftPiD0bar) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barSig); // signalStatus += 8; + } else { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); + } + } // signal case D0bar + + if (flagD0 && (t1.isSelD0bar() >= selectionFlagD0bar)) { + if (!isSoftPiD0bar) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barRef); // signalStatus += 16; + } else { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); + } + } // reflection case D0bar + + if (!flagD0 && !flagD0bar && (t1.isSelD0bar() >= selectionFlagD0bar)) { + if (!isSoftPiD0bar) { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barBg); // signalStatus += 32; + } else { + SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); + } + } // background case D0bar + registry.fill(HIST("hSignalStatusMERec"), signalStatus); + 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); + } + } + } + PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcRecMixedEvent, "Process Mixed Event MCRec", false); + + // ====================== Implement Event mixing on McGen =================================== + + void processMcGenMixedEvent(SelectedCollisionsMcGen const& collisions, + SelectedParticlesMcGen const& mcParticles) + { + + auto getTracksSize = [&mcParticles, this](SelectedCollisionsMcGen::iterator const& collision) { + int nTracks = 0; + auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); + for (const auto& track : associatedTracks) { + if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { + nTracks++; + } + } + return nTracks; + }; + + using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; + BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, true }; + + auto tracksTuple = std::make_tuple(mcParticles, mcParticles); + Pair pairMcGen{ corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache }; + + for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + + // Check track t1 is D0 + if (std::abs(t1.pdgCode()) != Pdg::kD0) { + continue; + } + + double yD = RecoDecay::y(t1.pVector(), MassD0); + if (std::abs(yD) >= yCandMax || t1.pt() <= ptCandMin || std::abs(t2.eta()) >= etaTrackMax || t2.pt() <= ptTrackMin) { + continue; + } + if ((std::abs(t2.pdgCode()) != kElectron) && (std::abs(t2.pdgCode()) != kMuonMinus) && (std::abs(t2.pdgCode()) != kPiPlus) && (std::abs(t2.pdgCode()) != kKPlus) && (std::abs(t2.pdgCode()) != kProton)) { + continue; + } + if (!t2.isPhysicalPrimary()) { + continue; + } + + // ==============================soft pion removal================================ + // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion + + auto indexMotherPi = RecoDecay::getMother(mcParticles, t2, Pdg::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only + auto indexMotherD0 = RecoDecay::getMother(mcParticles, t1, Pdg::kDStar, true, nullptr, 1); + if (std::abs(t2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) { + continue; + } + int poolBin = corrBinningMcGen.getBin(std::make_tuple(c2.posZ(), getTracksSize(c2))); + 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 + } + } + } + PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcGenMixedEvent, "Process Mixed Event MCGen", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc) + }; +} From fe51b5c017461395614553d550ce660129892d49 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:20:22 +0800 Subject: [PATCH 02/78] Delete correlatorD0Hadrons.cxx --- correlatorD0Hadrons.cxx | 953 ---------------------------------------- 1 file changed, 953 deletions(-) delete mode 100644 correlatorD0Hadrons.cxx diff --git a/correlatorD0Hadrons.cxx b/correlatorD0Hadrons.cxx deleted file mode 100644 index c5c2065d6f8..00000000000 --- a/correlatorD0Hadrons.cxx +++ /dev/null @@ -1,953 +0,0 @@ -// 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 correlatorD0Hadrons.cxx -/// \brief D0-Hadron correlator task - data-like, MC-reco and MC-kine analyses. -/// -/// \author Samrangy Sadhu , INFN Bari -/// \author Swapnesh Santosh Khade , IIT Indore - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "PWGHF/Core/HfHelper.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/HFC/DataModel/CorrelationTables.h" - -using namespace o2; -using namespace o2::analysis; -using namespace o2::constants::physics; -using namespace o2::framework; -using namespace o2::framework::expressions; - -/// -/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies -/// -double getDeltaPhi(double phiHadron, double phiD) -{ - return RecoDecay::constrainAngle(phiHadron - phiD, -o2::constants::math::PIHalf); -} - -const int nPtBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::nBinsPt; -const double efficiencyDmesonDefault[nPtBinsMassAndEfficiency] = {}; -auto vecEfficiencyDmeson = std::vector{ efficiencyDmesonDefault, efficiencyDmesonDefault + nPtBinsMassAndEfficiency }; - -// histogram binning definition -const int massAxisNBins = 200; -const double massAxisMin = 1.3848; -const double massAxisMax = 2.3848; -const int phiAxisNBins = 32; -const double phiAxisMin = 0.; -const double phiAxisMax = o2::constants::math::TwoPI; -const int yAxisNBins = 100; -const double yAxisMin = -5.; -const double yAxisMax = 5.; -const int ptDAxisNBins = 180; -const double ptDAxisMin = 0.; -const double ptDAxisMax = 36.; - -// Types -using BinningType = ColumnBinningPolicy>; -using SelectedCollisions = soa::Filtered>; -using SelectedTracks = soa::Filtered>; -using SelectedCandidatesData = soa::Filtered>; -using SelectedTracksMcRec = soa::Filtered>; -using SelectedCandidatesMcRec = soa::Filtered>; -using SelectedCollisionsMcGen = soa::Filtered>; -using SelectedParticlesMcGen = soa::Join; - -// Code to select collisions with at least one D0 -struct HfCorrelatorD0HadronsSelection { - SliceCache cache; - - Produces d0Sel; - - Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; - Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; - Configurable yCandMax{ "yCandMax", 4.0, "max. cand. rapidity" }; - Configurable ptCandMin{ "ptCandMin", -1., "min. cand. pT" }; - - HfHelper hfHelper; - - Preslice perCol = aod::hf_cand::collisionId; - Partition> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - Partition> selectedD0candidatesMc = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - - void processD0SelectionData(aod::Collision const& collision, - soa::Join const&) - { - bool isD0Found = 0; - if (selectedD0Candidates.size() > 0) { - auto selectedD0CandidatesGrouped = selectedD0Candidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - - for (const auto& candidate : selectedD0CandidatesGrouped) { - // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { - continue; - } - if (std::abs(hfHelper.yD0(candidate)) > yCandMax || candidate.pt() < ptCandMin) { - continue; - } - isD0Found = 1; - break; - } - } - d0Sel(isD0Found); - } - PROCESS_SWITCH(HfCorrelatorD0HadronsSelection, processD0SelectionData, "Process D0 Selection Data", false); - - void processD0SelectionMcRec(aod::Collision const& collision, - soa::Join const&) - { - bool isD0Found = 0; - if (selectedD0candidatesMc.size() > 0) { - auto selectedD0CandidatesGroupedMc = selectedD0candidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - for (const auto& candidate : selectedD0CandidatesGroupedMc) { - // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { - continue; - } - if (std::abs(hfHelper.yD0(candidate)) > yCandMax || candidate.pt() < ptCandMin) { - continue; - } - isD0Found = 1; - break; - } - } - d0Sel(isD0Found); - } - PROCESS_SWITCH(HfCorrelatorD0HadronsSelection, processD0SelectionMcRec, "Process D0 Selection MCRec", true); - - void processD0SelectionMcGen(aod::McCollision const&, - aod::McParticles const& mcParticles) - { - bool isD0Found = 0; - for (const auto& particle : mcParticles) { - if (std::abs(particle.pdgCode()) != Pdg::kD0) { - continue; - } - double yD = RecoDecay::y(particle.pVector(), MassD0); - if (std::abs(yD) > yCandMax || particle.pt() < ptCandMin) { - continue; - } - isD0Found = 1; - break; - } - d0Sel(isD0Found); - } - PROCESS_SWITCH(HfCorrelatorD0HadronsSelection, processD0SelectionMcGen, "Process D0 Selection MCGen", false); -}; - -/// D0-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) -struct HfCorrelatorD0Hadrons { - SliceCache cache; - - Produces entryD0HadronPair; - Produces entryD0HadronRecoInfo; - - Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; - Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; - Configurable yCandMax{ "yCandMax", 0.8, "max. cand. rapidity" }; - Configurable etaTrackMax{ "etaTrackMax", 0.8, "max. eta of tracks" }; - Configurable dcaXYTrackMax{ "dcaXYTrackMax", 1., "max. DCAxy of tracks" }; - Configurable dcaZTrackMax{ "dcaZTrackMax", 1., "max. DCAz of tracks" }; - Configurable ptCandMin{ "ptCandMin", 1., "min. cand. pT" }; - Configurable ptTrackMin{ "ptTrackMin", 0.3, "min. track pT" }; - Configurable ptTrackMax{ "ptTrackMax", 99., "max. track pT" }; - Configurable> bins{ "ptBinsForMassAndEfficiency", std::vector{ o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt }, "pT bin limits for candidate mass plots and efficiency" }; - Configurable> efficiencyDmeson{ "efficiencyDmeson", std::vector{ vecEfficiencyDmeson }, "Efficiency values for D0 meson" }; - Configurable applyEfficiency{ "efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights" }; - Configurable multMin{ "multMin", 0., "minimum multiplicity accepted" }; - 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" }; - Configurable numberEventsMixed{ "numberEventsMixed", 5, "Number of events mixed in ME process" }; - ConfigurableAxis zPoolBins{ "zPoolBins", { VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f }, "z vertex position pools" }; - ConfigurableAxis multPoolBins{ "multPoolBins", { VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f }, "event multiplicity pools (FT0M)" }; - ConfigurableAxis multPoolBinsMcGen{ "multPoolBinsMcGen", { VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f }, "Mixing bins - MC multiplicity" }; // In MCGen multiplicity is defined by counting tracks - - HfHelper hfHelper; - BinningType corrBinning{ { zPoolBins, multPoolBins }, true }; - - int leadingIndex = 0; - double massD0{ 0. }; - double massPi{ 0. }; - double massK{ 0. }; - double softPiMass = 0.14543; // pion mass + Q-value of the D*->D0pi decay - - Preslice perCol = aod::hf_cand::collisionId; - - Partition> selectedD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - Partition> selectedD0candidatesMc = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlagD0 || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlagD0bar; - - Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true; - Filter trackFilter = requireGlobalTrackWoDCAInFilter() && (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); - Filter d0Filter = (aod::hf_sel_candidate_d0::isSelD0 >= 1) || (aod::hf_sel_candidate_d0::isSelD0bar >= 1); - Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true; - Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == static_cast(Pdg::kD0) || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); - - HistogramRegistry registry{ - "registry", - // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - { { "hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hSelectionStatus", "D0,D0bar candidates;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, - { "hEta", "D0,D0bar candidates;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, - { "hY", "D0,D0bar candidates;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hMultiplicity", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hPtCandRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng0Rec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng1Rec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hSelectionStatusRec", "D0,D0bar candidates - MC reco;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, - { "hSignalStatusMERec", "Signal Status - MC reco ME;candidate sidnalStatus;entries", { HistType::kTH1F, { { 200, 0, 200 } } } }, - { "hEtaRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hPhiRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, - { "hYRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hEvtCountGen", "Event counter - MC gen;;entries", { HistType::kTH1F, { { 1, -0.5, 0.5 } } } }, - { "hPtCandGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hEtaGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hPhiGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, - { "hYGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hTrackCounter", "soft pion counter - Data", { HistType::kTH1F, { { 5, 0., 5. } } } }, - { "hTrackCounterRec", "soft pion counter - MC rec", { HistType::kTH1F, { { 5, 0., 5. } } } }, - { "hTrackCounterGen", "soft pion counter - MC gen", { HistType::kTH1F, { { 5, 0., 5. } } } }, - { "hMultV0M", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hZvtx", "z vertex;z vertex;entries", { HistType::kTH1F, { { 200, -20., 20. } } } }, - { "hMultFT0M", "Multiplicity FT0M", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hD0Bin", "D0 selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } }, - { "hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } } } - }; - - void init(InitContext&) - { - massD0 = MassD0; - massPi = MassPiPlus; - massK = MassKPlus; - - auto vbins = (std::vector)bins; - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - registry.add("hMass1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); - registry.add("hMassD01D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); - registry.add("hMassD0bar1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); - // mass histogram for D0 signal candidates - registry.add("hMassD0RecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - // mass histogram for D0 Reflection candidates - registry.add("hMassD0RecRef", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - // mass histogram for D0 background candidates - registry.add("hMassD0RecBg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - // mass histogram for D0bar signal candidates - registry.add("hMassD0barRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - // mass histogram for D0bar Reflection candidates - registry.add("hMassD0barRecRef", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - // mass histogram for D0bar background candidates - registry.add("hMassD0barRecBg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - registry.add("hCountD0TriggersGen", "D0 trigger particles - MC gen;;N of trigger D0", { HistType::kTH2F, { { 1, -0.5, 0.5 }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - } - - // Find Leading Particle - template - int findLeadingParticle(TTracks const& tracks) - { - auto leadingParticle = tracks.begin(); - for (auto const& track : tracks) { - if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { - continue; - } - if (track.pt() > leadingParticle.pt()) { - leadingParticle = track; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } - // ======= Find Leading Particle for McGen ============ - template - int findLeadingParticleMcGen(TMcParticles const& mcParticles) - { - auto leadingParticle = mcParticles.begin(); - for (auto const& mcParticle : mcParticles) { - if (std::abs(mcParticle.eta()) > etaTrackMax) { - continue; - } - if (mcParticle.pt() < ptTrackMin) { - continue; - } - if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { - continue; - } - if (mcParticle.pt() > leadingParticle.pt()) { - leadingParticle = mcParticle; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } - // ======= Process starts for Data, Same event ============ - - /// D0-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) - void processData(SelectedCollisions::iterator const& collision, - SelectedTracks const& tracks, - soa::Join const&) - { - // protection against empty tables to be sliced - if (selectedD0Candidates.size() == 0) { - return; - } - // find leading particle - if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); - } - - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); - int nTracks = 0; - if (collision.numContrib() > 1) { - for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { - continue; - } - nTracks++; - } - } - registry.fill(HIST("hMultiplicityPreSelection"), nTracks); - registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultFT0M"), collision.multFT0M()); - if (nTracks < multMin || nTracks > multMax) { - return; - } - registry.fill(HIST("hMultiplicity"), nTracks); - - auto selectedD0CandidatesGrouped = selectedD0Candidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - - for (const auto& candidate1 : selectedD0CandidatesGrouped) { - if (std::abs(hfHelper.yD0(candidate1)) >= yCandMax || candidate1.pt() <= ptCandMin || candidate1.pt() >= ptTrackMax) { - continue; - } - // check decay channel flag for candidate1 - if (!TESTBIT(candidate1.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { - continue; - } - - // ========================== Define parameters for soft pion removal ================================ - auto ePiK = RecoDecay::e(candidate1.pVectorProng0(), massPi) + RecoDecay::e(candidate1.pVectorProng1(), massK); - auto eKPi = RecoDecay::e(candidate1.pVectorProng0(), massK) + RecoDecay::e(candidate1.pVectorProng1(), massPi); - - // ========================== trigger efficiency ================================ - double efficiencyWeight = 1.; - if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); - } - // ========================== Fill mass histo ================================ - if (candidate1.isSelD0() >= selectionFlagD0) { - registry.fill(HIST("hMass"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - registry.fill(HIST("hMass1D"), hfHelper.invMassD0ToPiK(candidate1), efficiencyWeight); - registry.fill(HIST("hMassD01D"), hfHelper.invMassD0ToPiK(candidate1), efficiencyWeight); - } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { - registry.fill(HIST("hMass"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - registry.fill(HIST("hMass1D"), hfHelper.invMassD0barToKPi(candidate1), efficiencyWeight); - registry.fill(HIST("hMassD0bar1D"), hfHelper.invMassD0barToKPi(candidate1), efficiencyWeight); - } - // ========================== Fill general histos ================================ - registry.fill(HIST("hPtCand"), candidate1.pt()); - registry.fill(HIST("hPtProng0"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate1.ptProng1()); - registry.fill(HIST("hEta"), candidate1.eta()); - registry.fill(HIST("hPhi"), candidate1.phi()); - registry.fill(HIST("hY"), hfHelper.yD0(candidate1)); - registry.fill(HIST("hSelectionStatus"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); - registry.fill(HIST("hD0Bin"), poolBin); - - // ============ D-h correlation dedicated section ================================== - - // ========================== track loop starts here ================================ - 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())) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - - registry.fill(HIST("hTrackCounter"), 2); // fill no. of tracks before soft pion removal - - // ========== soft pion removal =================================================== - double invMassDstar1 = 0., invMassDstar2 = 0.; - bool isSoftPiD0 = false, isSoftPiD0bar = false; - auto pSum2 = RecoDecay::p2(candidate1.pVector(), track.pVector()); - auto ePion = track.energy(massPi); - invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); - invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); - - if (candidate1.isSelD0() >= selectionFlagD0) { - if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0 = true; - continue; - } - } - - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { - if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0bar = true; - continue; - } - } - registry.fill(HIST("hTrackCounter"), 3); // fill no. of tracks after soft pion removal - - int signalStatus = 0; - if ((candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { - signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0Only; - } - if ((candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { - signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnly; - } - - if (correlateD0WithLeadingParticle) { - if (track.globalIndex() != leadingIndex) { - continue; - } - registry.fill(HIST("hTrackCounter"), 4); // fill no. of tracks have leading particle - } - entryD0HadronPair(getDeltaPhi(track.phi(), candidate1.phi()), - track.eta() - candidate1.eta(), - candidate1.pt(), - track.pt(), - poolBin, - correlationStatus); - entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); - - } // end inner loop (tracks) - - } // end outer loop - } - PROCESS_SWITCH(HfCorrelatorD0Hadrons, processData, "Process data", false); - - // ================ Process starts for MCRec, same event ======================== - - void processMcRec(SelectedCollisions::iterator const& collision, - SelectedTracksMcRec const& tracks, - soa::Join const&) - { - // protection against empty tables to be sliced - if (selectedD0candidatesMc.size() == 0) { - return; - } - // find leading particle - if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); - } - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); - int nTracks = 0; - if (collision.numContrib() > 1) { - for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { - continue; - } - nTracks++; - } - } - registry.fill(HIST("hMultiplicityPreSelection"), nTracks); - if (nTracks < multMin || nTracks > multMax) { - return; - } - registry.fill(HIST("hMultiplicity"), nTracks); - - auto selectedD0CandidatesGroupedMc = selectedD0candidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - // MC reco level - bool flagD0 = false; - bool flagD0bar = false; - - for (const auto& candidate1 : selectedD0CandidatesGroupedMc) { - // check decay channel flag for candidate1 - if (!TESTBIT(candidate1.hfflag(), aod::hf_cand_2prong::DecayType::D0ToPiK)) { - continue; - } - if (std::abs(hfHelper.yD0(candidate1)) >= yCandMax || candidate1.pt() <= ptCandMin || candidate1.pt() >= ptTrackMax) { - continue; - } - - double efficiencyWeight = 1.; - if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyDmeson->at(o2::analysis::findBin(bins, candidate1.pt())); - } - - if (std::abs(candidate1.flagMcMatchRec()) == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { - // fill per-candidate distributions from D0/D0bar true candidates - registry.fill(HIST("hPtCandRec"), candidate1.pt()); - registry.fill(HIST("hPtProng0Rec"), candidate1.ptProng0()); - registry.fill(HIST("hPtProng1Rec"), candidate1.ptProng1()); - registry.fill(HIST("hEtaRec"), candidate1.eta()); - registry.fill(HIST("hPhiRec"), candidate1.phi()); - registry.fill(HIST("hYRec"), hfHelper.yD0(candidate1)); - registry.fill(HIST("hSelectionStatusRec"), candidate1.isSelD0bar() + (candidate1.isSelD0() * 2)); - } - // fill invariant mass plots from D0/D0bar signal and background candidates - if (candidate1.isSelD0() >= selectionFlagD0) { // only reco as D0 - if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { // also matched as D0 - registry.fill(HIST("hMassD0RecSig"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { - registry.fill(HIST("hMassD0RecRef"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - } else { - registry.fill(HIST("hMassD0RecBg"), hfHelper.invMassD0ToPiK(candidate1), candidate1.pt(), efficiencyWeight); - } - } - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { // only reco as D0bar - if (candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { // also matched as D0bar - registry.fill(HIST("hMassD0barRecSig"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - } else if (candidate1.flagMcMatchRec() == 1 << aod::hf_cand_2prong::DecayType::D0ToPiK) { - registry.fill(HIST("hMassD0barRecRef"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - } else { - registry.fill(HIST("hMassD0barRecBg"), hfHelper.invMassD0barToKPi(candidate1), candidate1.pt(), efficiencyWeight); - } - } - - // ===================== Define parameters for soft pion removal ======================== - auto ePiK = RecoDecay::e(candidate1.pVectorProng0(), massPi) + RecoDecay::e(candidate1.pVectorProng1(), massK); - auto eKPi = RecoDecay::e(candidate1.pVectorProng0(), massK) + RecoDecay::e(candidate1.pVectorProng1(), massPi); - - // ============== D-h correlation dedicated section ==================================== - - flagD0 = candidate1.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0bar = candidate1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) - - // ========== track loop starts here ======================== - - for (const auto& track : tracks) { - registry.fill(HIST("hTrackCounterRec"), 1); // fill total no. of tracks - - // Removing D0 daughters by checking track indices - bool correlationStatus = false; - if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - registry.fill(HIST("hTrackCounterRec"), 2); // fill no. of tracks before soft pion removal - - // ===== soft pion removal =================================================== - double invMassDstar1 = 0, invMassDstar2 = 0; - bool isSoftPiD0 = false, isSoftPiD0bar = false; - auto pSum2 = RecoDecay::p2(candidate1.pVector(), track.pVector()); - auto ePion = track.energy(massPi); - invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); - invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); - - if (candidate1.isSelD0() >= selectionFlagD0) { - if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(candidate1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0 = true; - continue; - } - } - - if (candidate1.isSelD0bar() >= selectionFlagD0bar) { - if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(candidate1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0bar = true; - continue; - } - } - - registry.fill(HIST("hTrackCounterRec"), 3); // fill no. of tracks after soft pion removal - - if (correlateD0WithLeadingParticle) { - if (track.globalIndex() != leadingIndex) { - continue; - } - registry.fill(HIST("hTrackCounterRec"), 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); - } // signal case D0 - if (flagD0bar && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Ref); - } // reflection case D0 - if (!flagD0 && !flagD0bar && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Bg); - } // background case D0 - - if (flagD0bar && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barSig); - } // signal case D0bar - if (flagD0 && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barRef); - } // reflection case D0bar - if (!flagD0 && !flagD0bar && (candidate1.isSelD0bar() >= selectionFlagD0bar) && !isSoftPiD0bar) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barBg); - } // background case D0bar - - entryD0HadronPair(getDeltaPhi(track.phi(), candidate1.phi()), - track.eta() - candidate1.eta(), - candidate1.pt(), - track.pt(), - poolBin, - correlationStatus); - entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus); - } // end inner loop (Tracks) - } // end of outer loop (D0) - registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultV0M"), collision.multFT0M()); - } - - PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcRec, "Process MC Reco mode", true); - - // ================= Process starts for MCGen, same event =================== - - void processMcGen(aod::McCollision const& mcCollision, - soa::Join const& mcParticles) - { - registry.fill(HIST("hEvtCountGen"), 0); - // MC gen level - // find leading particle - if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticleMcGen(mcParticles); - } - for (const auto& particle1 : mcParticles) { - // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != Pdg::kD0) { - continue; - } - double yD = RecoDecay::y(particle1.pVector(), MassD0); - if (yCandMax >= 0. && std::abs(yD) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && particle1.pt() < ptCandMin) { - continue; - } - registry.fill(HIST("hPtCandGen"), particle1.pt()); - registry.fill(HIST("hEtaGen"), particle1.eta()); - registry.fill(HIST("hPhiGen"), particle1.phi()); - registry.fill(HIST("hYGen"), yD); - - // =============== D-h correlation dedicated section ===================== - - if (std::abs(particle1.pdgCode()) != Pdg::kD0) { // just checking the particle PDG, not the decay channel (differently from Reco: you have a BR factor btw such levels!) - continue; - } - registry.fill(HIST("hCountD0TriggersGen"), 0, particle1.pt()); // to count trigger D0 (for normalisation) - - for (const auto& particle2 : mcParticles) { - registry.fill(HIST("hTrackCounterGen"), 1); // total no. of tracks - if (std::abs(particle2.eta()) > etaTrackMax) { - continue; - } - if (particle2.pt() < ptTrackMin) { - continue; - } - if ((std::abs(particle2.pdgCode()) != kElectron) && (std::abs(particle2.pdgCode()) != kMuonMinus) && (std::abs(particle2.pdgCode()) != kPiPlus) && (std::abs(particle2.pdgCode()) != kKPlus) && (std::abs(particle2.pdgCode()) != kProton)) { - continue; - } - - // ==============================soft pion removal================================ - registry.fill(HIST("hTrackCounterGen"), 2); // fill before soft pi removal - // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion - - auto indexMotherPi = RecoDecay::getMother(mcParticles, particle2, Pdg::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only - auto indexMotherD0 = RecoDecay::getMother(mcParticles, particle1, Pdg::kDStar, true, nullptr, 1); - bool correlationStatus = false; - if (std::abs(particle2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - - registry.fill(HIST("hTrackCounterGen"), 3); // fill after soft pion removal - - if (correlateD0WithLeadingParticle) { - if (particle2.globalIndex() != leadingIndex) { - continue; - } - registry.fill(HIST("hTrackCounterGen"), 4); // fill no. of tracks have leading particle - } - - auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { - int nTracks = 0; - for (const auto& track : mcParticles) { - if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { - nTracks++; - } - } - return nTracks; - }; - using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, true }; - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); - entryD0HadronPair(getDeltaPhi(particle2.phi(), particle1.phi()), - particle2.eta() - particle1.eta(), - particle1.pt(), - particle2.pt(), - poolBin, - correlationStatus); - entryD0HadronRecoInfo(massD0, massD0, 0); // dummy info - } // end inner loop (Tracks) - } // end outer loop (D0) - } - - PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcGen, "Process MC Gen mode", false); - - // ====================== Implement Event mixing on Data =================================== - - void processDataMixedEvent(SelectedCollisions const& collisions, - SelectedCandidatesData const& candidates, - SelectedTracks const& tracks) - { - for (const auto& collision : collisions) { - registry.fill(HIST("hMultFT0M"), collision.multFT0M()); - registry.fill(HIST("hZvtx"), collision.posZ()); - } - - auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; - - for (const auto& [c1, tracks1, c2, tracks2] : pairData) { - // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); // For debug - int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - - if (std::abs(hfHelper.yD0(t1)) >= yCandMax) { - continue; - } - - // soft pion removal, signal status 1,3 for D0 and 2,3 for D0bar (SoftPi removed), signal status 11,13 for D0 and 12,13 for D0bar (only SoftPi) - auto ePiK = RecoDecay::e(t1.pVectorProng0(), massPi) + RecoDecay::e(t1.pVectorProng1(), massK); - auto eKPi = RecoDecay::e(t1.pVectorProng0(), massK) + RecoDecay::e(t1.pVectorProng1(), massPi); - double invMassDstar1 = 0., invMassDstar2 = 0.; - bool isSoftPiD0 = false, isSoftPiD0bar = false; - auto pSum2 = RecoDecay::p2(t1.pVector(), t2.pVector()); - auto ePion = t2.energy(massPi); - invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); - invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); - - if (t1.isSelD0() >= selectionFlagD0) { - if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(t1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0 = true; - } - } - if (t1.isSelD0bar() >= selectionFlagD0bar) { - if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(t1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0bar = true; - } - } - - int signalStatus = 0; - if (t1.isSelD0() >= selectionFlagD0) { - if (!isSoftPiD0) { - signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0Only; - } else { - signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0OnlySoftPi; - } - } - if (t1.isSelD0bar() >= selectionFlagD0bar) { - if (!isSoftPiD0bar) { - signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnly; - } else { - signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnlySoftPi; - } - } - 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); - } - } - } - PROCESS_SWITCH(HfCorrelatorD0Hadrons, processDataMixedEvent, "Process data mixed event", false); - - // ====================== Implement Event mixing on McRec =================================== - - void processMcRecMixedEvent(SelectedCollisions const& collisions, - SelectedCandidatesMcRec const& candidates, - SelectedTracksMcRec const& tracks) - { - auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; - bool flagD0 = false; - bool flagD0bar = false; - for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { - int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - - if (std::abs(hfHelper.yD0(t1)) >= yCandMax) { - continue; - } - - // soft pion removal - auto ePiK = RecoDecay::e(t1.pVectorProng0(), massPi) + RecoDecay::e(t1.pVectorProng1(), massK); - auto eKPi = RecoDecay::e(t1.pVectorProng0(), massK) + RecoDecay::e(t1.pVectorProng1(), massPi); - double invMassDstar1 = 0., invMassDstar2 = 0.; - bool isSoftPiD0 = false, isSoftPiD0bar = false; - auto pSum2 = RecoDecay::p2(t1.pVector(), t2.pVector()); - auto ePion = t2.energy(massPi); - invMassDstar1 = std::sqrt((ePiK + ePion) * (ePiK + ePion) - pSum2); - invMassDstar2 = std::sqrt((eKPi + ePion) * (eKPi + ePion) - pSum2); - - if (t1.isSelD0() >= selectionFlagD0) { - if ((std::abs(invMassDstar1 - hfHelper.invMassD0ToPiK(t1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0 = true; - } - } - - if (t1.isSelD0bar() >= selectionFlagD0bar) { - if ((std::abs(invMassDstar2 - hfHelper.invMassD0barToKPi(t1)) - softPiMass) < ptSoftPionMax) { - isSoftPiD0bar = true; - } - } - - flagD0 = t1.flagMcMatchRec() == (1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Signal 'true' if candidate1 matched to D0 (particle) - flagD0bar = t1.flagMcMatchRec() == -(1 << aod::hf_cand_2prong::DecayType::D0ToPiK); // flagD0Reflection 'true' if candidate1, selected as D0 (particle), is matched to D0bar (antiparticle) - int signalStatus = 0; - - if (flagD0 && (t1.isSelD0() >= selectionFlagD0)) { - if (!isSoftPiD0) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Sig); // signalStatus += 1; - } else { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); // signalStatus += 64; - } - } // signal case D0 - - if (flagD0bar && (t1.isSelD0() >= selectionFlagD0)) { - if (!isSoftPiD0) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Ref); // signalStatus += 2; - } else { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); // signalStatus += 64; - } - } // reflection case D0 - - if (!flagD0 && !flagD0bar && (t1.isSelD0() >= selectionFlagD0)) { - if (!isSoftPiD0) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Bg); // signalStatus += 4; - } else { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); - } - } // background case D0 - - if (flagD0bar && (t1.isSelD0bar() >= selectionFlagD0bar)) { - if (!isSoftPiD0bar) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barSig); // signalStatus += 8; - } else { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); - } - } // signal case D0bar - - if (flagD0 && (t1.isSelD0bar() >= selectionFlagD0bar)) { - if (!isSoftPiD0bar) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barRef); // signalStatus += 16; - } else { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); - } - } // reflection case D0bar - - if (!flagD0 && !flagD0bar && (t1.isSelD0bar() >= selectionFlagD0bar)) { - if (!isSoftPiD0bar) { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0barBg); // signalStatus += 32; - } else { - SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi); - } - } // background case D0bar - registry.fill(HIST("hSignalStatusMERec"), signalStatus); - 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); - } - } - } - PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcRecMixedEvent, "Process Mixed Event MCRec", false); - - // ====================== Implement Event mixing on McGen =================================== - - void processMcGenMixedEvent(SelectedCollisionsMcGen const& collisions, - SelectedParticlesMcGen const& mcParticles) - { - - auto getTracksSize = [&mcParticles, this](SelectedCollisionsMcGen::iterator const& collision) { - int nTracks = 0; - auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); - for (const auto& track : associatedTracks) { - if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { - nTracks++; - } - } - return nTracks; - }; - - using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, true }; - - auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{ corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache }; - - for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - - // Check track t1 is D0 - if (std::abs(t1.pdgCode()) != Pdg::kD0) { - continue; - } - - double yD = RecoDecay::y(t1.pVector(), MassD0); - if (std::abs(yD) >= yCandMax || t1.pt() <= ptCandMin || std::abs(t2.eta()) >= etaTrackMax || t2.pt() <= ptTrackMin) { - continue; - } - if ((std::abs(t2.pdgCode()) != kElectron) && (std::abs(t2.pdgCode()) != kMuonMinus) && (std::abs(t2.pdgCode()) != kPiPlus) && (std::abs(t2.pdgCode()) != kKPlus) && (std::abs(t2.pdgCode()) != kProton)) { - continue; - } - if (!t2.isPhysicalPrimary()) { - continue; - } - - // ==============================soft pion removal================================ - // method used: indexMother = -1 by default if the mother doesn't match with given PID of the mother. We find mother of pion if it is D* and mother of D0 if it is D*. If they are both positive and they both match each other, then it is detected as a soft pion - - auto indexMotherPi = RecoDecay::getMother(mcParticles, t2, Pdg::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only - auto indexMotherD0 = RecoDecay::getMother(mcParticles, t1, Pdg::kDStar, true, nullptr, 1); - if (std::abs(t2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) { - continue; - } - int poolBin = corrBinningMcGen.getBin(std::make_tuple(c2.posZ(), getTracksSize(c2))); - 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 - } - } - } - PROCESS_SWITCH(HfCorrelatorD0Hadrons, processMcGenMixedEvent, "Process Mixed Event MCGen", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc) - }; -} From aee2cc9d3c2e8890276111b9b68829e3d9118cda Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:21:06 +0800 Subject: [PATCH 03/78] Add files via upload --- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 202 +++++++++++------- 1 file changed, 120 insertions(+), 82 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 3fc2a915496..c5c2065d6f8 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -47,7 +47,7 @@ double getDeltaPhi(double phiHadron, double phiD) const int nPtBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::nBinsPt; const double efficiencyDmesonDefault[nPtBinsMassAndEfficiency] = {}; -auto vecEfficiencyDmeson = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + nPtBinsMassAndEfficiency}; +auto vecEfficiencyDmeson = std::vector{ efficiencyDmesonDefault, efficiencyDmesonDefault + nPtBinsMassAndEfficiency }; // histogram binning definition const int massAxisNBins = 200; @@ -79,10 +79,10 @@ struct HfCorrelatorD0HadronsSelection { Produces d0Sel; - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable yCandMax{"yCandMax", 4.0, "max. cand. rapidity"}; - Configurable ptCandMin{"ptCandMin", -1., "min. cand. pT"}; + Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; + Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; + Configurable yCandMax{ "yCandMax", 4.0, "max. cand. rapidity" }; + Configurable ptCandMin{ "ptCandMin", -1., "min. cand. pT" }; HfHelper hfHelper; @@ -162,35 +162,35 @@ struct HfCorrelatorD0Hadrons { Produces entryD0HadronPair; Produces entryD0HadronRecoInfo; - Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; - Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; - Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; - Configurable etaTrackMax{"etaTrackMax", 0.8, "max. eta of tracks"}; - Configurable dcaXYTrackMax{"dcaXYTrackMax", 1., "max. DCAxy of tracks"}; - Configurable dcaZTrackMax{"dcaZTrackMax", 1., "max. DCAz of tracks"}; - Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - Configurable ptTrackMin{"ptTrackMin", 0.3, "min. track pT"}; - Configurable ptTrackMax{"ptTrackMax", 99., "max. track pT"}; - Configurable> bins{"ptBinsForMassAndEfficiency", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{vecEfficiencyDmeson}, "Efficiency values for D0 meson"}; - Configurable applyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; - Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; - 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"}; - Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; - ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"}; - ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; - ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; + Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; + Configurable yCandMax{ "yCandMax", 0.8, "max. cand. rapidity" }; + Configurable etaTrackMax{ "etaTrackMax", 0.8, "max. eta of tracks" }; + Configurable dcaXYTrackMax{ "dcaXYTrackMax", 1., "max. DCAxy of tracks" }; + Configurable dcaZTrackMax{ "dcaZTrackMax", 1., "max. DCAz of tracks" }; + Configurable ptCandMin{ "ptCandMin", 1., "min. cand. pT" }; + Configurable ptTrackMin{ "ptTrackMin", 0.3, "min. track pT" }; + Configurable ptTrackMax{ "ptTrackMax", 99., "max. track pT" }; + Configurable> bins{ "ptBinsForMassAndEfficiency", std::vector{ o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt }, "pT bin limits for candidate mass plots and efficiency" }; + Configurable> efficiencyDmeson{ "efficiencyDmeson", std::vector{ vecEfficiencyDmeson }, "Efficiency values for D0 meson" }; + Configurable applyEfficiency{ "efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights" }; + Configurable multMin{ "multMin", 0., "minimum multiplicity accepted" }; + 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" }; + Configurable numberEventsMixed{ "numberEventsMixed", 5, "Number of events mixed in ME process" }; + ConfigurableAxis zPoolBins{ "zPoolBins", { VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f }, "z vertex position pools" }; + ConfigurableAxis multPoolBins{ "multPoolBins", { VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f }, "event multiplicity pools (FT0M)" }; + ConfigurableAxis multPoolBinsMcGen{ "multPoolBinsMcGen", { VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f }, "Mixing bins - MC multiplicity" }; // In MCGen multiplicity is defined by counting tracks HfHelper hfHelper; - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; + BinningType corrBinning{ { zPoolBins, multPoolBins }, true }; int leadingIndex = 0; - double massD0{0.}; - double massPi{0.}; - double massK{0.}; + double massD0{ 0. }; + double massPi{ 0. }; + double massK{ 0. }; double softPiMass = 0.14543; // pion mass + Q-value of the D*->D0pi decay Preslice perCol = aod::hf_cand::collisionId; @@ -207,36 +207,37 @@ struct HfCorrelatorD0Hadrons { HistogramRegistry registry{ "registry", // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, - {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, - {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, - {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, - {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisNBins, phiAxisMin, phiAxisMax}}}}, - {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, - {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hPtCandRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, - {"hPtProng0Rec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, - {"hPtProng1Rec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, - {"hSelectionStatusRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, - {"hSignalStatusMERec", "Signal Status - MC reco ME;candidate sidnalStatus;entries", {HistType::kTH1F, {{200, 0, 200}}}}, - {"hEtaRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, - {"hPhiRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisNBins, phiAxisMin, phiAxisMax}}}}, - {"hYRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, - {"hEvtCountGen", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, - {"hPtCandGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, - {"hEtaGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, - {"hPhiGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisNBins, phiAxisMin, phiAxisMax}}}}, - {"hYGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, - {"hTrackCounter", "soft pion counter - Data", {HistType::kTH1F, {{5, 0., 5.}}}}, - {"hTrackCounterRec", "soft pion counter - MC rec", {HistType::kTH1F, {{5, 0., 5.}}}}, - {"hTrackCounterGen", "soft pion counter - MC gen", {HistType::kTH1F, {{5, 0., 5.}}}}, - {"hMultV0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hZvtx", "z vertex;z vertex;entries", {HistType::kTH1F, {{200, -20., 20.}}}}, - {"hMultFT0M", "Multiplicity FT0M", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hD0Bin", "D0 selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}, - {"hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}}}; + { { "hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hSelectionStatus", "D0,D0bar candidates;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, + { "hEta", "D0,D0bar candidates;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, + { "hY", "D0,D0bar candidates;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hMultiplicity", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hPtCandRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng0Rec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hPtProng1Rec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hSelectionStatusRec", "D0,D0bar candidates - MC reco;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, + { "hSignalStatusMERec", "Signal Status - MC reco ME;candidate sidnalStatus;entries", { HistType::kTH1F, { { 200, 0, 200 } } } }, + { "hEtaRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hPhiRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, + { "hYRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hEvtCountGen", "Event counter - MC gen;;entries", { HistType::kTH1F, { { 1, -0.5, 0.5 } } } }, + { "hPtCandGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, + { "hEtaGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hPhiGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, + { "hYGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, + { "hTrackCounter", "soft pion counter - Data", { HistType::kTH1F, { { 5, 0., 5. } } } }, + { "hTrackCounterRec", "soft pion counter - MC rec", { HistType::kTH1F, { { 5, 0., 5. } } } }, + { "hTrackCounterGen", "soft pion counter - MC gen", { HistType::kTH1F, { { 5, 0., 5. } } } }, + { "hMultV0M", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hZvtx", "z vertex;z vertex;entries", { HistType::kTH1F, { { 200, -20., 20. } } } }, + { "hMultFT0M", "Multiplicity FT0M", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, + { "hD0Bin", "D0 selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } }, + { "hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } } } + }; void init(InitContext&) { @@ -245,23 +246,23 @@ struct HfCorrelatorD0Hadrons { massK = MassKPlus; auto vbins = (std::vector)bins; - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMass1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisNBins, massAxisMin, massAxisMax}}}); - registry.add("hMassD01D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisNBins, massAxisMin, massAxisMax}}}); - registry.add("hMassD0bar1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisNBins, massAxisMin, massAxisMax}}}); + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMass1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); + registry.add("hMassD01D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); + registry.add("hMassD0bar1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); // mass histogram for D0 signal candidates - registry.add("hMassD0RecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0RecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); // mass histogram for D0 Reflection candidates - registry.add("hMassD0RecRef", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0RecRef", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); // mass histogram for D0 background candidates - registry.add("hMassD0RecBg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0RecBg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); // mass histogram for D0bar signal candidates - registry.add("hMassD0barRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); // mass histogram for D0bar Reflection candidates - registry.add("hMassD0barRecRef", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barRecRef", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); // mass histogram for D0bar background candidates - registry.add("hMassD0barRecBg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCountD0TriggersGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassD0barRecBg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hCountD0TriggersGen", "D0 trigger particles - MC gen;;N of trigger D0", { HistType::kTH2F, { { 1, -0.5, 0.5 }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); } // Find Leading Particle @@ -280,6 +281,28 @@ struct HfCorrelatorD0Hadrons { int leadingIndex = leadingParticle.globalIndex(); return leadingIndex; } + // ======= Find Leading Particle for McGen ============ + template + int findLeadingParticleMcGen(TMcParticles const& mcParticles) + { + auto leadingParticle = mcParticles.begin(); + for (auto const& mcParticle : mcParticles) { + if (std::abs(mcParticle.eta()) > etaTrackMax) { + continue; + } + if (mcParticle.pt() < ptTrackMin) { + continue; + } + if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { + continue; + } + if (mcParticle.pt() > leadingParticle.pt()) { + leadingParticle = mcParticle; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } // ======= Process starts for Data, Same event ============ /// D0-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) @@ -559,7 +582,7 @@ struct HfCorrelatorD0Hadrons { if (track.globalIndex() != leadingIndex) { continue; } - registry.fill(HIST("hTrackCounter"), 4); // fill no. of tracks have leading particle + registry.fill(HIST("hTrackCounterRec"), 4); // fill no. of tracks have leading particle } int signalStatus = 0; @@ -605,6 +628,10 @@ struct HfCorrelatorD0Hadrons { { registry.fill(HIST("hEvtCountGen"), 0); // MC gen level + // find leading particle + if (correlateD0WithLeadingParticle) { + leadingIndex = findLeadingParticleMcGen(mcParticles); + } for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! if (std::abs(particle1.pdgCode()) != Pdg::kD0) { @@ -647,11 +674,23 @@ struct HfCorrelatorD0Hadrons { auto indexMotherPi = RecoDecay::getMother(mcParticles, particle2, Pdg::kDStar, true, nullptr, 1); // last arguement 1 is written to consider immediate decay mother only auto indexMotherD0 = RecoDecay::getMother(mcParticles, particle1, Pdg::kDStar, true, nullptr, 1); - if (std::abs(particle2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) - continue; + bool correlationStatus = false; + if (std::abs(particle2.pdgCode()) == kPiPlus && indexMotherPi >= 0 && indexMotherD0 >= 0 && indexMotherPi == indexMotherD0) { + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } registry.fill(HIST("hTrackCounterGen"), 3); // fill after soft pion removal + if (correlateD0WithLeadingParticle) { + if (particle2.globalIndex() != leadingIndex) { + continue; + } + registry.fill(HIST("hTrackCounterGen"), 4); // fill no. of tracks have leading particle + } + auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { int nTracks = 0; for (const auto& track : mcParticles) { @@ -662,10 +701,8 @@ struct HfCorrelatorD0Hadrons { return nTracks; }; using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zPoolBins, multPoolBinsMcGen}, true}; + BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, 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(), @@ -691,7 +728,7 @@ struct HfCorrelatorD0Hadrons { } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair pairData{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); // For debug @@ -753,7 +790,7 @@ struct HfCorrelatorD0Hadrons { SelectedTracksMcRec const& tracks) { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair pairMcRec{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; bool flagD0 = false; bool flagD0bar = false; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { @@ -865,10 +902,10 @@ struct HfCorrelatorD0Hadrons { }; using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zPoolBins, multPoolBinsMcGen}, true}; + BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, true }; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + Pair pairMcGen{ corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache }; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { @@ -911,5 +948,6 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc) + }; } From dce95e340413323e214cb4b2f493f9c883646fd7 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:51:24 +0800 Subject: [PATCH 04/78] Add files via upload --- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 156 +++++++++--------- 1 file changed, 77 insertions(+), 79 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index c5c2065d6f8..89465eb50b2 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -47,7 +47,7 @@ double getDeltaPhi(double phiHadron, double phiD) const int nPtBinsMassAndEfficiency = o2::analysis::hf_cuts_d0_to_pi_k::nBinsPt; const double efficiencyDmesonDefault[nPtBinsMassAndEfficiency] = {}; -auto vecEfficiencyDmeson = std::vector{ efficiencyDmesonDefault, efficiencyDmesonDefault + nPtBinsMassAndEfficiency }; +auto vecEfficiencyDmeson = std::vector{efficiencyDmesonDefault, efficiencyDmesonDefault + nPtBinsMassAndEfficiency}; // histogram binning definition const int massAxisNBins = 200; @@ -79,10 +79,10 @@ struct HfCorrelatorD0HadronsSelection { Produces d0Sel; - Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; - Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; - Configurable yCandMax{ "yCandMax", 4.0, "max. cand. rapidity" }; - Configurable ptCandMin{ "ptCandMin", -1., "min. cand. pT" }; + Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; + Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; + Configurable yCandMax{"yCandMax", 4.0, "max. cand. rapidity"}; + Configurable ptCandMin{"ptCandMin", -1., "min. cand. pT"}; HfHelper hfHelper; @@ -162,35 +162,35 @@ struct HfCorrelatorD0Hadrons { Produces entryD0HadronPair; Produces entryD0HadronRecoInfo; - Configurable selectionFlagD0{ "selectionFlagD0", 1, "Selection Flag for D0" }; - Configurable selectionFlagD0bar{ "selectionFlagD0bar", 1, "Selection Flag for D0bar" }; - Configurable yCandMax{ "yCandMax", 0.8, "max. cand. rapidity" }; - Configurable etaTrackMax{ "etaTrackMax", 0.8, "max. eta of tracks" }; - Configurable dcaXYTrackMax{ "dcaXYTrackMax", 1., "max. DCAxy of tracks" }; - Configurable dcaZTrackMax{ "dcaZTrackMax", 1., "max. DCAz of tracks" }; - Configurable ptCandMin{ "ptCandMin", 1., "min. cand. pT" }; - Configurable ptTrackMin{ "ptTrackMin", 0.3, "min. track pT" }; - Configurable ptTrackMax{ "ptTrackMax", 99., "max. track pT" }; - Configurable> bins{ "ptBinsForMassAndEfficiency", std::vector{ o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt }, "pT bin limits for candidate mass plots and efficiency" }; - Configurable> efficiencyDmeson{ "efficiencyDmeson", std::vector{ vecEfficiencyDmeson }, "Efficiency values for D0 meson" }; - Configurable applyEfficiency{ "efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights" }; - Configurable multMin{ "multMin", 0., "minimum multiplicity accepted" }; - 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" }; - Configurable numberEventsMixed{ "numberEventsMixed", 5, "Number of events mixed in ME process" }; - ConfigurableAxis zPoolBins{ "zPoolBins", { VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f }, "z vertex position pools" }; - ConfigurableAxis multPoolBins{ "multPoolBins", { VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f }, "event multiplicity pools (FT0M)" }; - ConfigurableAxis multPoolBinsMcGen{ "multPoolBinsMcGen", { VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f }, "Mixing bins - MC multiplicity" }; // In MCGen multiplicity is defined by counting tracks + Configurable selectionFlagD0{"selectionFlagD0", 1, "Selection Flag for D0"}; + Configurable selectionFlagD0bar{"selectionFlagD0bar", 1, "Selection Flag for D0bar"}; + Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable etaTrackMax{"etaTrackMax", 0.8, "max. eta of tracks"}; + Configurable dcaXYTrackMax{"dcaXYTrackMax", 1., "max. DCAxy of tracks"}; + Configurable dcaZTrackMax{"dcaZTrackMax", 1., "max. DCAz of tracks"}; + Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + Configurable ptTrackMin{"ptTrackMin", 0.3, "min. track pT"}; + Configurable ptTrackMax{"ptTrackMax", 99., "max. track pT"}; + Configurable> bins{"ptBinsForMassAndEfficiency", std::vector{o2::analysis::hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; + Configurable> efficiencyDmeson{"efficiencyDmeson", std::vector{vecEfficiencyDmeson}, "Efficiency values for D0 meson"}; + Configurable applyEfficiency{"efficiencyFlagD", 1, "Flag for applying D-meson efficiency weights"}; + Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; + 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"}; + Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; + ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks HfHelper hfHelper; - BinningType corrBinning{ { zPoolBins, multPoolBins }, true }; + BinningType corrBinning{{zPoolBins, multPoolBins}, true}; int leadingIndex = 0; - double massD0{ 0. }; - double massPi{ 0. }; - double massK{ 0. }; + double massD0{0.}; + double massPi{0.}; + double massK{0.}; double softPiMass = 0.14543; // pion mass + Q-value of the D*->D0pi decay Preslice perCol = aod::hf_cand::collisionId; @@ -207,37 +207,36 @@ struct HfCorrelatorD0Hadrons { HistogramRegistry registry{ "registry", // NOTE: use hMassD0 for trigger normalisation (S*0.955), and hMass2DCorrelationPairs (in final task) for 2D-sideband-subtraction purposes - { { "hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hSelectionStatus", "D0,D0bar candidates;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, - { "hEta", "D0,D0bar candidates;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, - { "hY", "D0,D0bar candidates;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hMultiplicity", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hPtCandRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng0Rec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hPtProng1Rec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hSelectionStatusRec", "D0,D0bar candidates - MC reco;selection status;entries", { HistType::kTH1F, { { 4, -0.5, 3.5 } } } }, - { "hSignalStatusMERec", "Signal Status - MC reco ME;candidate sidnalStatus;entries", { HistType::kTH1F, { { 200, 0, 200 } } } }, - { "hEtaRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hPhiRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, - { "hYRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hEvtCountGen", "Event counter - MC gen;;entries", { HistType::kTH1F, { { 1, -0.5, 0.5 } } } }, - { "hPtCandGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", { HistType::kTH1F, { { ptDAxisNBins, ptDAxisMin, ptDAxisMax } } } }, - { "hEtaGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hPhiGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", { HistType::kTH1F, { { phiAxisNBins, phiAxisMin, phiAxisMax } } } }, - { "hYGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", { HistType::kTH1F, { { yAxisNBins, yAxisMin, yAxisMax } } } }, - { "hTrackCounter", "soft pion counter - Data", { HistType::kTH1F, { { 5, 0., 5. } } } }, - { "hTrackCounterRec", "soft pion counter - MC rec", { HistType::kTH1F, { { 5, 0., 5. } } } }, - { "hTrackCounterGen", "soft pion counter - MC gen", { HistType::kTH1F, { { 5, 0., 5. } } } }, - { "hMultV0M", "multiplicity;multiplicity;entries", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hZvtx", "z vertex;z vertex;entries", { HistType::kTH1F, { { 200, -20., 20. } } } }, - { "hMultFT0M", "Multiplicity FT0M", { HistType::kTH1F, { { 10000, 0., 10000. } } } }, - { "hD0Bin", "D0 selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } }, - { "hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", { HistType::kTH1F, { { 9, 0., 9. } } } } } - }; + {{"hPtCand", "D0,D0bar candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0", "D0,D0bar candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1", "D0,D0bar candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, + {"hSelectionStatus", "D0,D0bar candidates;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, + {"hEta", "D0,D0bar candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, + {"hPhi", "D0,D0bar candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisNBins, phiAxisMin, phiAxisMax}}}}, + {"hY", "D0,D0bar candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, + {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hPtCandRec", "D0,D0bar candidates - MC reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng0Rec", "D0,D0bar candidates - MC reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, + {"hPtProng1Rec", "D0,D0bar candidates - MC reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, + {"hSelectionStatusRec", "D0,D0bar candidates - MC reco;selection status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, + {"hSignalStatusMERec", "Signal Status - MC reco ME;candidate sidnalStatus;entries", {HistType::kTH1F, {{200, 0, 200}}}}, + {"hEtaRec", "D0,D0bar candidates - MC reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, + {"hPhiRec", "D0,D0bar candidates - MC reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisNBins, phiAxisMin, phiAxisMax}}}}, + {"hYRec", "D0,D0bar candidates - MC reco;candidate #it{y};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, + {"hEvtCountGen", "Event counter - MC gen;;entries", {HistType::kTH1F, {{1, -0.5, 0.5}}}}, + {"hPtCandGen", "D0,D0bar particles - MC gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptDAxisNBins, ptDAxisMin, ptDAxisMax}}}}, + {"hEtaGen", "D0,D0bar particles - MC gen;particle #it{#eta};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, + {"hPhiGen", "D0,D0bar particles - MC gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisNBins, phiAxisMin, phiAxisMax}}}}, + {"hYGen", "D0,D0bar candidates - MC gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisNBins, yAxisMin, yAxisMax}}}}, + {"hTrackCounter", "soft pion counter - Data", {HistType::kTH1F, {{5, 0., 5.}}}}, + {"hTrackCounterRec", "soft pion counter - MC rec", {HistType::kTH1F, {{5, 0., 5.}}}}, + {"hTrackCounterGen", "soft pion counter - MC gen", {HistType::kTH1F, {{5, 0., 5.}}}}, + {"hMultV0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hZvtx", "z vertex;z vertex;entries", {HistType::kTH1F, {{200, -20., 20.}}}}, + {"hMultFT0M", "Multiplicity FT0M", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hD0Bin", "D0 selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}, + {"hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}}}; void init(InitContext&) { @@ -246,23 +245,23 @@ struct HfCorrelatorD0Hadrons { massK = MassKPlus; auto vbins = (std::vector)bins; - registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - registry.add("hMass1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); - registry.add("hMassD01D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); - registry.add("hMassD0bar1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH1F, { { massAxisNBins, massAxisMin, massAxisMax } } }); + registry.add("hMass", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMass1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisNBins, massAxisMin, massAxisMax}}}); + registry.add("hMassD01D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisNBins, massAxisMin, massAxisMax}}}); + registry.add("hMassD0bar1D", "D0,D0bar candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisNBins, massAxisMin, massAxisMax}}}); // mass histogram for D0 signal candidates - registry.add("hMassD0RecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMassD0RecSig", "D0 signal candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // mass histogram for D0 Reflection candidates - registry.add("hMassD0RecRef", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMassD0RecRef", "D0 reflection candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // mass histogram for D0 background candidates - registry.add("hMassD0RecBg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMassD0RecBg", "D0 background candidates - MC reco;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // mass histogram for D0bar signal candidates - registry.add("hMassD0barRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMassD0barRecSig", "D0bar signal candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // mass histogram for D0bar Reflection candidates - registry.add("hMassD0barRecRef", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMassD0barRecRef", "D0bar reflection candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); // mass histogram for D0bar background candidates - registry.add("hMassD0barRecBg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", { HistType::kTH2F, { { massAxisNBins, massAxisMin, massAxisMax }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); - registry.add("hCountD0TriggersGen", "D0 trigger particles - MC gen;;N of trigger D0", { HistType::kTH2F, { { 1, -0.5, 0.5 }, { vbins, "#it{p}_{T} (GeV/#it{c})" } } }); + registry.add("hMassD0barRecBg", "D0bar background candidates - MC reco;inv. mass D0bar only (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisNBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountD0TriggersGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } // Find Leading Particle @@ -701,7 +700,7 @@ struct HfCorrelatorD0Hadrons { return nTracks; }; using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, true }; + BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zPoolBins, multPoolBinsMcGen}, true}; int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); entryD0HadronPair(getDeltaPhi(particle2.phi(), particle1.phi()), particle2.eta() - particle1.eta(), @@ -728,7 +727,7 @@ struct HfCorrelatorD0Hadrons { } auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; + Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairData) { // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M()))); // For debug @@ -790,7 +789,7 @@ struct HfCorrelatorD0Hadrons { SelectedTracksMcRec const& tracks) { auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{ corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache }; + Pair pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; bool flagD0 = false; bool flagD0bar = false; for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { @@ -902,10 +901,10 @@ struct HfCorrelatorD0Hadrons { }; using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{ { getTracksSize }, { zPoolBins, multPoolBinsMcGen }, true }; + BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zPoolBins, multPoolBinsMcGen}, true}; auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{ corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache }; + Pair pairMcGen{corrBinningMcGen, numberEventsMixed, -1, collisions, tracksTuple, &cache}; for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { @@ -948,6 +947,5 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc) - }; + adaptAnalysisTask(cfgc)}; } From bbb77f074ef6b446ad895eb7d07103db060143e5 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:55:29 +0800 Subject: [PATCH 05/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 58 ++++++++++++++++++-- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index 9ac7c6ae3de..23411030dfc 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -52,7 +52,7 @@ 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 axisCorrelationState = {2, 0., 1., ""}; +AxisSpec axisCorrelationState = {2, 0., 2., ""}; ConfigurableAxis axisMass{"axisMass", {250, 1.65f, 2.15f}, ""}; // definition of vectors for standard ptbin and invariant mass configurables @@ -180,7 +180,16 @@ struct HfTaskCorrelationD0Hadrons { // Toward Transverse Away {"hToward", "Toward invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, {"hTransverse", "Transverse invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, - {"hAway", "Away invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}}}; + {"hAway", "Away invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, + + // Toward Transverse Away for McRec + {"hTowardRec", "Toward invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, + {"hTransverseRec", "Transverse invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, + {"hAwayRec", "Away invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, + // Toward Transverse Away for McGen + {"hTowardGen", "Toward invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, + {"hTransverseGen", "Transverse invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}, + {"hAwayGen", "Away invmass; ptD; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtD}, {axisCorrelationState}}}}}}; void init(InitContext&) { int nBinsPtAxis = binsCorrelations->size() - 1; @@ -395,12 +404,32 @@ struct HfTaskCorrelationD0Hadrons { int signalStatus = pairEntry.signalStatus(); int ptBinD = o2::analysis::findBin(binsCorrelations, ptD); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); double efficiencyWeight = 1.; if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptD))); } - + if (isTowardTransverseAway) { + // Divide into three regions: toward, transverse, and away + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardRec"), massD, ptD, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAwayRec"), massD, ptD, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverseRec"), massD, ptD, isAutoCorrelated, efficiencyWeight); + break; + default: + break; + } + } // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { registry.fill(HIST("hCorrel2DVsPtRecSig"), deltaPhi, deltaEta, ptD, ptHadron, efficiencyWeight); @@ -589,6 +618,8 @@ struct HfTaskCorrelationD0Hadrons { double ptD = pairEntry.ptD(); double ptHadron = pairEntry.ptHadron(); int poolBin = pairEntry.poolBin(); + double massD = pairEntry.mD(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside pT ranges of interest if (o2::analysis::findBin(binsCorrelations, ptD) < 0) { continue; @@ -596,7 +627,26 @@ struct HfTaskCorrelationD0Hadrons { if (ptHadron > ptHadronMax) { ptHadron = ptHadronMax + 0.5; } - + if (isTowardTransverseAway) { + // Divide into three regions: toward, transverse, and away + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardGen"), massD, ptD, isAutoCorrelated); + break; + case Away: + registry.fill(HIST("hAwayGen"), massD, ptD, isAutoCorrelated); + break; + case Transverse: + registry.fill(HIST("hTransverseGen"), massD, ptD, isAutoCorrelated); + break; + default: + break; + } + } registry.fill(HIST("hCorrel2DVsPtGen"), deltaPhi, deltaEta, ptD, ptHadron, poolBin); registry.fill(HIST("hCorrel2DPtIntGen"), deltaPhi, deltaEta); registry.fill(HIST("hDeltaEtaPtIntGen"), deltaEta); From 9abfe224f882269f6843fb7412ff1d3150535222 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:44:38 +0800 Subject: [PATCH 06/78] Add files via upload From 116a8e8fb6808de3f9e35bbf6977f77b11a2c82d Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:45:49 +0800 Subject: [PATCH 07/78] Add files via upload --- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 141ad2e9b4c..b1a86a3a9e4 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -505,7 +505,7 @@ struct HfCorrelatorLcHadrons { { int counterLcHadron = 0; registry.fill(HIST("hMcEvtCount"), 0); - + auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { int nTracks = 0; for (const auto& track : mcParticles) { @@ -539,6 +539,10 @@ struct HfCorrelatorLcHadrons { for (const auto& particleAssoc : mcParticles) { bool flagMotherFound = false; + /*const auto mothers = particleAssoc.daughters_as(); + if (mothers.empty()) { + std::cout << "No mother particles found." << std::endl; + }*/ for (const auto& m : particleAssoc.mothers_as()) { if (m.globalIndex() == particle.globalIndex()) { flagMotherFound = true; From 03cc985aac076435d84c13a2a02ade8d82e2af6a Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:49:58 +0800 Subject: [PATCH 08/78] Add files via upload --- PWGHF/HFC/DataModel/CorrelationTables.h | 20 +- PWGHF/HFC/DataModel/correlatorLcHadrons.cxx | 811 ++++++++++++++++++ .../DataModel/taskCorrelationLcHadrons.cxx | 379 ++++++++ 3 files changed, 1193 insertions(+), 17 deletions(-) create mode 100644 PWGHF/HFC/DataModel/correlatorLcHadrons.cxx create mode 100644 PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index e486e7bb33b..a3db9ff1277 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -104,6 +104,7 @@ DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of DECLARE_SOA_COLUMN(MLc, mLc, float); //! Invariant mass of Lc DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for LcToPKPi/LcToPiKP DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent +DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status } // namespace hf_correlation_lc_hadron DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informations @@ -111,7 +112,8 @@ DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informati aod::hf_correlation_lc_hadron::DeltaEta, aod::hf_correlation_lc_hadron::PtLc, aod::hf_correlation_lc_hadron::PtHadron, - aod::hf_correlation_lc_hadron::PoolBin); + aod::hf_correlation_lc_hadron::PoolBin, + aod::hf_correlation_lc_hadron::IsAutoCorrelated); DECLARE_SOA_TABLE(LcHadronRecoInfo, "AOD", "LCHRECOINFO", //! Lc-Hadrons pairs Reconstructed Informations aod::hf_correlation_lc_hadron::MLc, @@ -347,22 +349,6 @@ DECLARE_SOA_COLUMN(DmesonSel, dmesonSel, bool); //! Selection flag for D meson i DECLARE_SOA_TABLE(DmesonSelection, "AOD", "DINCOLL", // Selection of D meson in collisions aod::hf_selection_dmeson_collision::DmesonSel); - -// Note: definition of columns and tables for Electron Hadron correlation pairs -namespace hf_correlation_electron_hadron -{ -DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Electron and Hadrons -DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Electron and Hadrons -DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of Electron -DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron; -DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity -} // namespace hf_correlation_electron_hadron -DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs Informations - hf_correlation_electron_hadron::DeltaPhi, - hf_correlation_electron_hadron::DeltaEta, - hf_correlation_electron_hadron::PtElectron, - hf_correlation_electron_hadron::PtHadron, - hf_correlation_electron_hadron::PoolBin); } // namespace o2::aod #endif // PWGHF_HFC_DATAMODEL_CORRELATIONTABLES_H_ diff --git a/PWGHF/HFC/DataModel/correlatorLcHadrons.cxx b/PWGHF/HFC/DataModel/correlatorLcHadrons.cxx new file mode 100644 index 00000000000..83bd31dbff2 --- /dev/null +++ b/PWGHF/HFC/DataModel/correlatorLcHadrons.cxx @@ -0,0 +1,811 @@ +// 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 correlatorLcHadrons.cxx +/// \brief Lc-Hadrons correlator task - data-like, Mc-Reco and Mc-Gen analyses +/// +/// \author Marianna Mazzilli +/// \author Zhen Zhang + +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "PWGHF/Core/HfHelper.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/HFC/DataModel/CorrelationTables.h" + +using namespace o2; +using namespace o2::analysis; +using namespace o2::constants::physics; +using namespace o2::framework; +using namespace o2::framework::expressions; + +/// +/// Returns deltaPhi values in range [-pi/2., 3.*pi/2.], typically used for correlation studies +/// +double getDeltaPhi(double phiLc, double phiHadron) +{ + return RecoDecay::constrainAngle(phiHadron - phiLc, -o2::constants::math::PIHalf); +} + +/// definition of variables for Lc hadron pairs (in data-like, Mc-reco and Mc-kine tasks) +const int nBinsPtMassAndEfficiency = o2::analysis::hf_cuts_lc_to_p_k_pi::nBinsPt; +const double efficiencyLcDefault[nBinsPtMassAndEfficiency] = {}; +auto vecEfficiencyLc = std::vector{efficiencyLcDefault, efficiencyLcDefault + nBinsPtMassAndEfficiency}; + +// histogram binning definition +const int massAxisBins = 120; +const double massAxisMin = 1.98; +const double massAxisMax = 2.58; +const int phiAxisBins = 32; +const double phiAxisMin = -o2::constants::math::PIHalf; +const double phiAxisMax = 3. * o2::constants::math::PIHalf; +const int yAxisBins = 100; +const double yAxisMin = -2.; +const double yAxisMax = 2.; +const int ptLcAxisBins = 180; +const double ptLcAxisMin = 0.; +const double ptLcAxisMax = 36.; + +// definition of ME variables +using BinningType = ColumnBinningPolicy>; + +using SelectedCollisions = soa::Filtered>; +using SelectedTracks = soa::Filtered; +using SelectedCandidatesData = soa::Filtered>; +using SelectedCandidatesMcRec = soa::Filtered>; +using SelectedCollisionsMcGen = soa::Filtered>; +using SelectedTracksMcGen = soa::Filtered; + +// Code to select collisions with at least one Lambda_c +struct HfCorrelatorLcHadronsSelection { + Produces lcSel; + + Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; + Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + + HfHelper hfHelper; + SliceCache cache; + + Partition> selectedLcCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; + Partition> selectedLcCandidatesMc = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; + + // Returns false if the candidate does not pass cuts on decay type, y max, and pt min. Used for data and MC reco. + template + bool kinematicCuts(const T& candidate) + { + // check decay channel flag for candidate + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + return false; + } + if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { + return false; + } + if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { + return false; + } + return true; + } + + void processLcSelectionData(aod::Collision const& collision, + soa::Join const&) + { + int isLcFound = 0; + if (selectedLcCandidates.size() > 0) { + auto selectedLcCandidatesGrouped = selectedLcCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + + for (const auto& candidate : selectedLcCandidatesGrouped) { + if (!kinematicCuts(candidate)) { + continue; + } + isLcFound = 1; + break; + } + } + lcSel(isLcFound); + } + PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionData, "Process Lc Collision Selection Data", true); + + void processLcSelectionMcRec(aod::Collision const& collision, + soa::Join const&) + { + int isLcFound = 0; + if (selectedLcCandidatesMc.size() > 0) { + auto selectedLcCandidatesGroupedMc = selectedLcCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + for (const auto& candidate : selectedLcCandidatesGroupedMc) { + if (!kinematicCuts(candidate)) { + continue; + } + isLcFound = 1; + break; + } + } + lcSel(isLcFound); + } + PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionMcRec, "Process Lc Selection McRec", false); + + void processLcSelectionMcGen(aod::McCollision const&, + aod::McParticles const& mcParticles) + { + int isLcFound = 0; + for (const auto& particle : mcParticles) { + if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { + continue; + } + double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); + if (yCandMax >= 0. && std::abs(yL) > yCandMax) { + continue; + } + if (ptCandMin >= 0. && particle.pt() < ptCandMin) { + continue; + } + isLcFound = 1; + break; + } + lcSel(isLcFound); + } + PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionMcGen, "Process Lc Selection McGen", false); +}; + +// Lc-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) +struct HfCorrelatorLcHadrons { + Produces entryLcHadronPair; + Produces entryLcHadronRecoInfo; + + Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; + Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying Lc efficiency weights"}; + Configurable filterFlagLc{"filterFlagLc", true, "Flag for applying Collision Filter with Lc"}; + Configurable filterFlagLcMc{"filterFlagLcMc", false, "Flag for applying Mc Collision Filter with Lc"}; + Configurable nEventForMixedEvent{"nEventForMixedEvent", 5, "number of event to be mixed"}; + Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; + Configurable etaTrackMax{"etaTrackMax", 0.8, "max. eta of tracks"}; + Configurable dcaXYTrackMax{"dcaXYTrackMax", 0.0025, "max. DCAxy of tracks"}; + Configurable dcaZTrackMax{"dcaZTrackMax", 0.0025, "max. DCAz of tracks"}; + Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; + Configurable ptTrackMin{"ptTrackMin", 0.3, "min. track pT"}; + Configurable ptTrackMax{"ptTrackMax", 50., "max. track pT"}; + Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; + Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; + Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; + Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc"}; + ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; + ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; + ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; + Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; + + HfHelper hfHelper; + SliceCache cache; + BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; + int leadingIndex = 0; + bool correlationStatus = false; + + // Filters for ME + Filter collisionFilter = aod::hf_selection_lc_collision::lcSel >= filterFlagLc; + Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); + Filter lcFilter = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1) || (aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1); + Filter collisionFilterGen = aod::hf_selection_lc_collision::lcSel >= filterFlagLcMc; + Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 4122 || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); + + Preslice perCol = aod::hf_cand::collisionId; + + Partition> selectedLcCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; + Partition> selectedLcCandidatesMc = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; + + HistogramRegistry registry{ + "registry", + {{"hPtCand", "Lc,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtProng0", "Lc,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtProng1", "Lc,Hadron candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtProng2", "Lc,Hadron candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hSelectionStatusLcToPKPi", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, + {"hSelectionStatusLcToPiKP", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, + {"hEta", "Lc,Hadron candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhi", "Lc,Hadron candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hY", "Lc,Hadron candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPtCandMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtProng0McRec", "Lc,Hadron candidates - Mc reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtProng1McRec", "Lc,Hadron candidates - Mc reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtProng2McRec", "Lc,Hadron candidates - Mc reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hSelectionStatusMcRec", "Lc,Hadron candidates - Mc reco;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, + {"hEtaMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMcRec", "Lc,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", "Lc,Hadron particles - Mc gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtParticleAssocMcRec", "Associated Particles - Mc Rec;Hadron #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hPtParticleAssocMcGen", "Associated Particles - Mc Gen;Hadron #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, + {"hEtaMcGen", "Lc,Hadron particles - Mc Gen;particle #it{#varphi};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hPhiMcGen", "Lc,Hadron particles - Mc Gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, + {"hYMcGen", "Lc,Hadron candidates - Mc Gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, + {"hCountLcHadronPerEvent", "Lc,Hadron particles - Mc Gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}}, + {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hMultT0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, + {"hZvtx", "z vertex;z vertex;entries", {HistType::kTH1F, {{200, -20., 20.}}}}, + {"hLcPoolBin", "Lc selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}, + {"hTracksPoolBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}}}; + + void init(InitContext&) + { + auto vbins = (std::vector)binsPt; + registry.add("hMassLcVsPt", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassLcData", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); + registry.add("hMassLcMcRec", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); + registry.add("hMassLcVsPtMcRec", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hMassLcMcRecSig", "Lc signal candidates - Mc reco;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // mass histogram for Lc background candidates only + registry.add("hMassLcMcRecBkg", "Lc background candidates - Mc reco;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + registry.add("hCountLctriggersMcGen", "Lc trigger particles - Mc gen;;N of trigger Lc", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + corrBinning = {{binsZVtx, binsMultiplicity}, true}; + } + + // Find Leading Particle + template + int findLeadingParticle(TTracks const& tracks) + { + auto leadingParticle = tracks.begin(); + for (auto const& track : tracks) { + if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { + continue; + } + if (track.pt() > leadingParticle.pt()) { + leadingParticle = track; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } + + // ======= Find Leading Particle for McGen ============ + template + int findLeadingParticleMcGen(TMcParticles const& mcParticles) + { + auto leadingParticle = mcParticles.begin(); + for (auto const& mcParticle : mcParticles) { + if (std::abs(mcParticle.eta()) > etaTrackMax) { + continue; + } + if (mcParticle.pt() < ptTrackMin) { + continue; + } + if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { + continue; + } + if (mcParticle.pt() > leadingParticle.pt()) { + leadingParticle = mcParticle; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } + + /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) + void processData(soa::Join::iterator const& collision, + aod::TracksWDca const& tracks, + soa::Join const&) + { + // protection against empty tables to be sliced + if (selectedLcCandidates.size() == 0) { + return; + } + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); + int nTracks = 0; + if (collision.numContrib() > 1) { + for (const auto& track : tracks) { + if (std::abs(track.eta()) > etaTrackMax) { + continue; + } + if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { + continue; + } + nTracks++; + registry.fill(HIST("hTracksPoolBin"), poolBin); + } + } + registry.fill(HIST("hMultiplicityPreSelection"), nTracks); + if (nTracks < multMin || nTracks > multMax) { + return; + } + registry.fill(HIST("hMultiplicity"), nTracks); + + auto selectedLcCandidatesGrouped = selectedLcCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + + for (const auto& candidate : selectedLcCandidatesGrouped) { + if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { + continue; + } + if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { + continue; + } + if (candidate.pt() > ptTrackMax) { + continue; + } + // check decay channel flag for candidate + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + continue; + } + + double efficiencyWeight = 1.; + if (applyEfficiency) { + efficiencyWeight = 1. / efficiencyLc->at(o2::analysis::findBin(binsPt, candidate.pt())); + } + registry.fill(HIST("hPtCand"), candidate.pt()); + registry.fill(HIST("hPtProng0"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1"), candidate.ptProng1()); + registry.fill(HIST("hPtProng2"), candidate.ptProng2()); + registry.fill(HIST("hEta"), candidate.eta()); + registry.fill(HIST("hPhi"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); + registry.fill(HIST("hY"), hfHelper.yLc(candidate)); + registry.fill(HIST("hLcPoolBin"), poolBin); + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); + registry.fill(HIST("hSelectionStatusLcToPKPi"), candidate.isSelLcToPKPi()); + } + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); + registry.fill(HIST("hSelectionStatusLcToPiKP"), candidate.isSelLcToPiKP()); + } + // Lc-Hadron correlation dedicated section + // if the candidate is a Lc, search for Hadrons and evaluate correlations + + for (const auto& track : tracks) { + if (std::abs(track.eta()) > etaTrackMax) { + continue; + } + if (track.pt() < ptTrackMin) { + continue; + } + if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { + continue; // Remove secondary tracks + } + + // Remove Lc daughters by checking track indices + if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + + if (correlateLcWithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } + } + + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), + track.eta() - candidate.eta(), + candidate.pt(), + track.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false); + } + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), + track.eta() - candidate.eta(), + candidate.pt(), + track.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false); + } + } // Hadron Tracks loop + } // end outer Lc loop + registry.fill(HIST("hZvtx"), collision.posZ()); + registry.fill(HIST("hMultT0M"), collision.multFT0M()); + } + PROCESS_SWITCH(HfCorrelatorLcHadrons, processData, "Process data", true); + + /// Lc-Hadron correlation process starts for McRec + void processMcRec(soa::Join::iterator const& collision, + aod::TracksWDca const& tracks, + soa::Join const&) + { + if (selectedLcCandidatesMc.size() == 0) { + return; + } + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); + int nTracks = 0; + if (collision.numContrib() > 1) { + for (const auto& track : tracks) { + if (std::abs(track.eta()) > etaTrackMax) { + continue; + } + if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { + continue; + } + nTracks++; + registry.fill(HIST("hTracksPoolBin"), poolBin); + } + } + registry.fill(HIST("hMultiplicityPreSelection"), nTracks); + if (nTracks < multMin || nTracks > multMax) { + return; + } + registry.fill(HIST("hMultiplicity"), nTracks); + + auto selectedLcCandidatesGroupedMc = selectedLcCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); + + // Mc reco level + bool isLcSignal = false; + for (const auto& candidate : selectedLcCandidatesGroupedMc) { + // check decay channel flag for candidate + if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + continue; + } + if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { + continue; + } + if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { + continue; + } + if (candidate.pt() >= ptTrackMax) { + continue; + } + double efficiencyWeight = 1.; + if (applyEfficiency) { + efficiencyWeight = 1. / efficiencyLc->at(o2::analysis::findBin(binsPt, candidate.pt())); + } + isLcSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi; + if (isLcSignal) { + registry.fill(HIST("hPtCandMcRec"), candidate.pt()); + registry.fill(HIST("hPtProng0McRec"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1McRec"), candidate.ptProng1()); + registry.fill(HIST("hPtProng2McRec"), candidate.ptProng2()); + registry.fill(HIST("hEtaMcRec"), candidate.eta()); + registry.fill(HIST("hPhiMcRec"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); + registry.fill(HIST("hYMcRec"), hfHelper.yLc(candidate)); + // LcToPKPi and LcToPiKP division + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); + registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); + } + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); + registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); + } + } else { + registry.fill(HIST("hPtCandMcRec"), candidate.pt()); + registry.fill(HIST("hPtProng0McRec"), candidate.ptProng0()); + registry.fill(HIST("hPtProng1McRec"), candidate.ptProng1()); + registry.fill(HIST("hPtProng2McRec"), candidate.ptProng2()); + registry.fill(HIST("hEtaMcRec"), candidate.eta()); + registry.fill(HIST("hPhiMcRec"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); + registry.fill(HIST("hYMcRec"), hfHelper.yLc(candidate)); + // LcToPKPi and LcToPiKP division + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); + registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); + } + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); + registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); + registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); + } + } + registry.fill(HIST("hLcPoolBin"), poolBin); + + // Lc-Hadron correlation dedicated section + // if the candidate is selected as Lc, search for Hadron ad evaluate correlations + for (const auto& track : tracks) { + if (std::abs(track.eta()) > etaTrackMax) { + continue; + } + if (track.pt() < ptTrackMin) { + continue; + } + if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { + continue; // Remove secondary tracks + } + // Removing Lc daughters by checking track indices + if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + registry.fill(HIST("hPtParticleAssocMcRec"), track.pt()); + + if (correlateLcWithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } + } + + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), + track.eta() - candidate.eta(), + candidate.pt(), + track.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); + } + if (candidate.isSelLcToPiKP() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), + track.eta() - candidate.eta(), + candidate.pt(), + track.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); + } + } // end inner loop (Tracks) + } // end outer Lc loop + registry.fill(HIST("hZvtx"), collision.posZ()); + registry.fill(HIST("hMultT0M"), collision.multFT0M()); + } + PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRec, "Process Mc Reco mode", false); + + /// Lc-Hadron correlation pair builder - for Mc gen-level analysis + void processMcGen(aod::McCollision const& mcCollision, + soa::Join const& mcParticles) + { + int counterLcHadron = 0; + registry.fill(HIST("hMcEvtCount"), 0); + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticleMcGen(mcParticles); + } + + auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { + int nTracks = 0; + for (const auto& track : mcParticles) { + if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { + nTracks++; + } + } + return nTracks; + }; + using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; + BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {binsZVtx, binsMultiplicityMc}, true}; + + // Mc gen level + for (const auto& particle : mcParticles) { + if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { + continue; + } + if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { + double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); + if (yCandMax >= 0. && std::abs(yL) > yCandMax) { + continue; + } + if (ptCandMin >= 0. && particle.pt() < ptCandMin) { + continue; + } + registry.fill(HIST("hPtCandMcGen"), particle.pt()); + registry.fill(HIST("hEtaMcGen"), particle.eta()); + registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -o2::constants::math::PIHalf)); + registry.fill(HIST("hYMcGen"), yL); + counterLcHadron++; + + for (const auto& particleAssoc : mcParticles) { + bool flagMotherFound = false; + for (const auto& m : particleAssoc.mothers_as()) { + if (m.globalIndex() == particle.globalIndex()) { + flagMotherFound = true; + break; + } + } + if (flagMotherFound) { + continue; + } + if (std::abs(particleAssoc.eta()) > etaTrackMax) { + continue; + } + if (particleAssoc.pt() < ptTrackMin) { + continue; + } + + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + + if (correlateLcWithLeadingParticle) { + if (particleAssoc.globalIndex() != leadingIndex) { + continue; + } + } + + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); + registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); + entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), + particleAssoc.eta() - particle.eta(), + particle.pt(), + particleAssoc.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(MassLambdaCPlus, true); + } // end inner loop + } + } // end outer loop + registry.fill(HIST("hCountLcHadronPerEvent"), counterLcHadron); + registry.fill(HIST("hZvtx"), mcCollision.posZ()); + registry.fill(HIST("hMultiplicity"), getTracksSize(mcCollision)); + } + PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcGen, "Process Mc Gen mode", false); + + void processDataMixedEvent(SelectedCollisions const& collisions, + SelectedCandidatesData const& candidates, + SelectedTracks const& tracks) + { + if (candidates.size() == 0) { + return; + } + auto tracksTuple = std::make_tuple(candidates, tracks); + Pair pairData{corrBinning, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; + + for (const auto& [c1, tracks1, c2, tracks2] : pairData) { + int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (!TESTBIT(t1.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { + continue; + } + if (yCandMax >= 0. && std::abs(hfHelper.yLc(t1)) > yCandMax) { + continue; + } + // LcToPKPi and LcToPiKP division + if (t1.isSelLcToPKPi() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), + t1.eta() - t2.eta(), + t1.pt(), + t2.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); + } + if (t1.isSelLcToPiKP() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), + t1.eta() - t2.eta(), + t1.pt(), + t2.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); + } + } + } + } + PROCESS_SWITCH(HfCorrelatorLcHadrons, processDataMixedEvent, "Process Mixed Event Data", false); + + void processMcRecMixedEvent(SelectedCollisions const& collisions, + SelectedCandidatesMcRec const& candidates, + SelectedTracks const& tracks) + { + auto tracksTuple = std::make_tuple(candidates, tracks); + Pair pairMcRec{corrBinning, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; + + for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { + int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + if (yCandMax >= 0. && std::abs(hfHelper.yLc(t1)) > yCandMax) { + continue; + } + if (t1.isSelLcToPKPi() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), + t1.eta() - t2.eta(), + t1.pt(), + t2.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); + } + if (t1.isSelLcToPiKP() >= selectionFlagLc) { + entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), + t1.eta() - t2.eta(), + t1.pt(), + t2.pt(), + poolBin, + correlationStatus); + entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); + } + } + } + } + PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRecMixedEvent, "Process Mixed Event McRec", false); + + void processMcGenMixedEvent(SelectedCollisionsMcGen const& collisions, + SelectedTracksMcGen const& mcParticles) + { + auto getTracksSize = [&mcParticles, this](SelectedCollisionsMcGen::iterator const& collision) { + int nTracks = 0; + auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); + for (const auto& track : associatedTracks) { + if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { + nTracks++; + } + } + return nTracks; + }; + + using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; + BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {binsZVtx, binsMultiplicityMc}, true}; + + auto tracksTuple = std::make_tuple(mcParticles, mcParticles); + Pair pairMcGen{corrBinningMcGen, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; + + for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { + for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { + // Check track t1 is Lc + if (std::abs(t1.pdgCode()) != Pdg::kLambdaCPlus) { + continue; + } + + double yL = RecoDecay::y(t1.pVector(), MassLambdaCPlus); + if (yCandMax >= 0. && std::abs(yL) > yCandMax) { + continue; + } + if (ptCandMin >= 0. && t1.pt() < ptCandMin) { + continue; + } + + if (std::abs(t2.eta()) > etaTrackMax) { + continue; + } + if (t2.pt() < ptTrackMin) { + continue; + } + int poolBin = corrBinningMcGen.getBin(std::make_tuple(c2.posZ(), getTracksSize(c2))); + entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), + t1.eta() - t2.eta(), + t1.pt(), + t2.pt(), + poolBin, + correlationStatus); + } + } + } + PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcGenMixedEvent, "Process Mixed Event McGen", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx new file mode 100644 index 00000000000..5fbf4dd6221 --- /dev/null +++ b/PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx @@ -0,0 +1,379 @@ +// 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 taskCorrelationLcHadrons.cxx +/// \brief Lc-Hadrons azimuthal correlations analysis task - data-like, Mc-Reco and Mc-Gen analyses +/// \author Marianna Mazzilli +/// \author Zhen Zhang + +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" +#include "PWGHF/HFC/DataModel/CorrelationTables.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +/// +/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies +/// +double getDeltaPhi(double phiLc, double phiHadron) +{ + return RecoDecay::constrainAngle(phiHadron - phiLc, -o2::constants::math::PIHalf); +} + +/// +/// 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 stringPtLc = "#it{p}_{T}^{#Lambda_c} (GeV/#it{c});"; +const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; +const TString stringPoolBin = "poolBin;"; +const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{#Lambda_c};"; +const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{#Lambda_c} (rad);"; +const TString stringLcHadron = "#Lambda_c,Hadron candidates "; +const TString stringSignal = "signal region;"; +const TString stringSideband = "sidebands;"; +const TString stringMcParticles = "Mc gen - #Lambda_c,Hadron particles;"; +const TString stringMcReco = "Mc reco - #Lambda_c,Hadron candidates "; + +// histogram axes definition +AxisSpec axisDeltaEta = {100, -2., 2.}; +AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; +AxisSpec axisPtLc = {10, 0., 10.}; +AxisSpec axisPtHadron = {11, 0., 11.}; +AxisSpec axisPoolBin = {9, 0., 9.}; +AxisSpec axisCorrelationState = {2, 0., 2., ""}; +ConfigurableAxis axisMass{"axisMass", {120, 1.98f, 2.58f}, ""}; + +// definition of vectors for standard ptbin and invariant mass configurables +const int nPtBinsCorrelations = 8; +const double pTBinsCorrelations[nPtBinsCorrelations + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; +auto vecBinsPtCorrelations = std::vector{pTBinsCorrelations, pTBinsCorrelations + nPtBinsCorrelations + 1}; +const double signalRegionInnerDefault[nPtBinsCorrelations] = {2.269, 2.269, 2.269, 2.269, 2.269, 2.269, 2.269, 2.269}; +const double signalRegionOuterDefault[nPtBinsCorrelations] = {2.309, 2.309, 2.309, 2.309, 2.309, 2.309, 2.309, 2.309}; +const double sidebandLeftOuterDefault[nPtBinsCorrelations] = {2.209, 2.209, 2.209, 2.209, 2.209, 2.209, 2.209, 2.209}; +const double sidebandLeftInnerDefault[nPtBinsCorrelations] = {2.249, 2.249, 2.249, 2.249, 2.249, 2.249, 2.249, 2.249}; +const double sidebandRightInnerDefault[nPtBinsCorrelations] = {2.329, 2.329, 2.329, 2.329, 2.329, 2.329, 2.329, 2.329}; +const double sidebandRightOuterDefault[nPtBinsCorrelations] = {2.369, 2.369, 2.369, 2.369, 2.369, 2.369, 2.369, 2.369}; +auto vecSignalRegionInner = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + nPtBinsCorrelations}; +auto vecSignalRegionOuter = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + nPtBinsCorrelations}; +auto vecSidebandLeftInner = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nPtBinsCorrelations}; +auto vecSidebandLeftOuter = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nPtBinsCorrelations}; +auto vecSidebandRightInner = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nPtBinsCorrelations}; +auto vecSidebandRightOuter = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nPtBinsCorrelations}; +const int nPtBinsEfficiency = o2::analysis::hf_cuts_lc_to_p_k_pi::nBinsPt; +const double efficiencyLcDefault[nPtBinsEfficiency] = {}; +auto vecEfficiencyLc = std::vector{efficiencyLcDefault, efficiencyLcDefault + nPtBinsEfficiency}; + +/// Lc-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 HfTaskCorrelationLcHadrons { + // Pt ranges for correlation plots: the default values are those embedded in hf_cuts_lc_to_p_k_pi (i.e. the mass Pt bins), but can be redefined via json files + Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; + Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{vecBinsPtCorrelations}, "Pt bin limits for correlation plots"}; + Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "Pt bin limits for efficiency"}; + // signal and sideband region edges, to be defined via json file (initialised to empty) + Configurable> signalRegionInner{"signalRegionInner", std::vector{vecSignalRegionInner}, "Inner values of signal region vs Pt"}; + Configurable> signalRegionOuter{"signalRegionOuter", std::vector{vecSignalRegionOuter}, "Outer values of signal region vs Pt"}; + Configurable> sidebandLeftInner{"sidebandLeftInner", std::vector{vecSidebandLeftInner}, "Inner values of left sideband vs Pt"}; + Configurable> sidebandLeftOuter{"sidebandLeftOuter", std::vector{vecSidebandLeftOuter}, "Outer values of left sideband vs Pt"}; + Configurable> sidebandRightInner{"sidebandRightInner", std::vector{vecSidebandRightInner}, "Inner values of right sideband vs Pt"}; + Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{vecSidebandRightOuter}, "Outer values of right sideband vs Pt"}; + Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc "}; + Configurable isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"}; + Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; + + using LcHadronPairFull = soa::Join; + + enum Region { + Default = 0, // 默认值 + Toward, + Away, + Transverse + }; + + HistogramRegistry registry{ + "registry", + { + {"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + // Toward Transverse Away + {"hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + // Toward Transverse Away for McRec + {"hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + // Toward Transverse Away for McGen + {"hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}}}; + + void init(InitContext&) + { + // redefinition of Pt axes for THnSparse holding correlation entries + int nBinsPtAxis = binsPtCorrelations->size() - 1; + const double* valuesPtAxis = binsPtCorrelations->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(); + } + + Region getRegion(double deltaPhi) + { + if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { + return Toward; + } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { + return Away; + } else { + return Transverse; + } + } + + void processData(LcHadronPairFull const& pairEntries) + { + for (const auto& pairEntry : pairEntries) { + // define variables for widely used quantities + double deltaPhi = pairEntry.deltaPhi(); + double deltaEta = pairEntry.deltaEta(); + double ptLc = pairEntry.ptLc(); + double ptHadron = pairEntry.ptHadron(); + double massLc = pairEntry.mLc(); + int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); + int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); + int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + // reject entries outside Pt ranges of interest + if (ptBinLc < 0 || effBinLc < 0) { + continue; + } + if (ptHadron > 10.0) { + ptHadron = 10.5; + } + double efficiencyWeight = 1.; + double efficiencyHadron = 1.; // Note: To be implemented later on + if (applyEfficiency) { + efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); + } + + // Divide into three regions: toward, transverse, and away + if (isTowardTransverseAway) { + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hToward"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAway"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverse"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + default: + break; + } + }; + + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots + if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { + // in signal region + registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, efficiencyWeight); + } + + if ((massLc > sidebandLeftOuter->at(ptBinLc) && massLc < sidebandLeftInner->at(ptBinLc)) || + (massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc))) { + // in sideband region + registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebands"), deltaPhi, efficiencyWeight); + } + } // end loop + } + PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processData, "Process data", true); + + /// Lc-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(LcHadronPairFull const& pairEntries) + { + for (const auto& pairEntry : pairEntries) { + // define variables for widely used quantities + double deltaPhi = pairEntry.deltaPhi(); + double deltaEta = pairEntry.deltaEta(); + double ptLc = pairEntry.ptLc(); + double ptHadron = pairEntry.ptHadron(); + double massLc = pairEntry.mLc(); + double efficiencyWeight = 1.; + double efficiencyHadron = 1.; + int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); + int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); + int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + if (ptBinLc < 0 || effBinLc < 0) { + continue; + } + if (ptHadron > 10.0) { + ptHadron = 10.5; + } + if (applyEfficiency) { + efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); + } + + // Divide into three regions: toward, transverse, and away + if (isTowardTransverseAway) { + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAwayRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverseRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + default: + break; + } + }; + + // fill correlation plots for signal/bagkground correlations + if (pairEntry.signalStatus()) { + registry.fill(HIST("hCorrel2DVsPtSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + } else { + registry.fill(HIST("hCorrel2DVsPtBkgMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, 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 (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { + // in signal region + registry.fill(HIST("hCorrel2DVsPtSignalRegionMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSignalRegionMcRec"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSignalRegionMcRec"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSignalRegionMcRec"), deltaPhi, efficiencyWeight); + } + + if (((massLc > sidebandLeftOuter->at(ptBinLc)) && (massLc < sidebandLeftInner->at(ptBinLc))) || + ((massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc)))) { + // in sideband region + registry.fill(HIST("hCorrel2DVsPtSidebandsMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); + registry.fill(HIST("hCorrel2DPtIntSidebandsMcRec"), deltaPhi, deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaEtaPtIntSidebandsMcRec"), deltaEta, efficiencyWeight); + registry.fill(HIST("hDeltaPhiPtIntSidebandsMcRec"), deltaPhi, efficiencyWeight); + } + } // end loop + } + PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processMcRec, "Process Mc Reco mode", false); + + /// Lc-Hadron correlation pair filling task, from pair tables - for Mc gen-level analysis (no filter/selection, only true signal) + void processMcGen(aod::LcHadronPair const& pairEntries) + { + for (const auto& pairEntry : pairEntries) { + // define variables for widely used quantities + double deltaPhi = pairEntry.deltaPhi(); + double deltaEta = pairEntry.deltaEta(); + double ptLc = pairEntry.ptLc(); + double ptHadron = pairEntry.ptHadron(); + int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); + // reject entries outside Pt ranges of interest + if (o2::analysis::findBin(binsPtCorrelations, ptLc) < 0) { + continue; + } + if (ptHadron > 10.0) { + ptHadron = 10.5; + } + + if (isTowardTransverseAway) { + // Divide into three regions: toward, transverse, and away + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + case Away: + registry.fill(HIST("hAwayRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + case Transverse: + registry.fill(HIST("hTransverseRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + default: + break; + } + } + registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); + registry.fill(HIST("hCorrel2DPtIntMcGen"), deltaPhi, deltaEta); + registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); + registry.fill(HIST("hDeltaPhiPtIntMcGen"), deltaPhi); + } // end loop + } + PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processMcGen, "Process Mc Gen mode", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 1b38757b452f49c20c51d09c22859e3d368b835e Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:51:16 +0800 Subject: [PATCH 09/78] Delete PWGHF/HFC/DataModel/correlatorLcHadrons.cxx --- PWGHF/HFC/DataModel/correlatorLcHadrons.cxx | 811 -------------------- 1 file changed, 811 deletions(-) delete mode 100644 PWGHF/HFC/DataModel/correlatorLcHadrons.cxx diff --git a/PWGHF/HFC/DataModel/correlatorLcHadrons.cxx b/PWGHF/HFC/DataModel/correlatorLcHadrons.cxx deleted file mode 100644 index 83bd31dbff2..00000000000 --- a/PWGHF/HFC/DataModel/correlatorLcHadrons.cxx +++ /dev/null @@ -1,811 +0,0 @@ -// 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 correlatorLcHadrons.cxx -/// \brief Lc-Hadrons correlator task - data-like, Mc-Reco and Mc-Gen analyses -/// -/// \author Marianna Mazzilli -/// \author Zhen Zhang - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "PWGHF/Core/HfHelper.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/HFC/DataModel/CorrelationTables.h" - -using namespace o2; -using namespace o2::analysis; -using namespace o2::constants::physics; -using namespace o2::framework; -using namespace o2::framework::expressions; - -/// -/// Returns deltaPhi values in range [-pi/2., 3.*pi/2.], typically used for correlation studies -/// -double getDeltaPhi(double phiLc, double phiHadron) -{ - return RecoDecay::constrainAngle(phiHadron - phiLc, -o2::constants::math::PIHalf); -} - -/// definition of variables for Lc hadron pairs (in data-like, Mc-reco and Mc-kine tasks) -const int nBinsPtMassAndEfficiency = o2::analysis::hf_cuts_lc_to_p_k_pi::nBinsPt; -const double efficiencyLcDefault[nBinsPtMassAndEfficiency] = {}; -auto vecEfficiencyLc = std::vector{efficiencyLcDefault, efficiencyLcDefault + nBinsPtMassAndEfficiency}; - -// histogram binning definition -const int massAxisBins = 120; -const double massAxisMin = 1.98; -const double massAxisMax = 2.58; -const int phiAxisBins = 32; -const double phiAxisMin = -o2::constants::math::PIHalf; -const double phiAxisMax = 3. * o2::constants::math::PIHalf; -const int yAxisBins = 100; -const double yAxisMin = -2.; -const double yAxisMax = 2.; -const int ptLcAxisBins = 180; -const double ptLcAxisMin = 0.; -const double ptLcAxisMax = 36.; - -// definition of ME variables -using BinningType = ColumnBinningPolicy>; - -using SelectedCollisions = soa::Filtered>; -using SelectedTracks = soa::Filtered; -using SelectedCandidatesData = soa::Filtered>; -using SelectedCandidatesMcRec = soa::Filtered>; -using SelectedCollisionsMcGen = soa::Filtered>; -using SelectedTracksMcGen = soa::Filtered; - -// Code to select collisions with at least one Lambda_c -struct HfCorrelatorLcHadronsSelection { - Produces lcSel; - - Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; - Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; - Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - - HfHelper hfHelper; - SliceCache cache; - - Partition> selectedLcCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - Partition> selectedLcCandidatesMc = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - - // Returns false if the candidate does not pass cuts on decay type, y max, and pt min. Used for data and MC reco. - template - bool kinematicCuts(const T& candidate) - { - // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { - return false; - } - if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { - return false; - } - if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { - return false; - } - return true; - } - - void processLcSelectionData(aod::Collision const& collision, - soa::Join const&) - { - int isLcFound = 0; - if (selectedLcCandidates.size() > 0) { - auto selectedLcCandidatesGrouped = selectedLcCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - - for (const auto& candidate : selectedLcCandidatesGrouped) { - if (!kinematicCuts(candidate)) { - continue; - } - isLcFound = 1; - break; - } - } - lcSel(isLcFound); - } - PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionData, "Process Lc Collision Selection Data", true); - - void processLcSelectionMcRec(aod::Collision const& collision, - soa::Join const&) - { - int isLcFound = 0; - if (selectedLcCandidatesMc.size() > 0) { - auto selectedLcCandidatesGroupedMc = selectedLcCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - for (const auto& candidate : selectedLcCandidatesGroupedMc) { - if (!kinematicCuts(candidate)) { - continue; - } - isLcFound = 1; - break; - } - } - lcSel(isLcFound); - } - PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionMcRec, "Process Lc Selection McRec", false); - - void processLcSelectionMcGen(aod::McCollision const&, - aod::McParticles const& mcParticles) - { - int isLcFound = 0; - for (const auto& particle : mcParticles) { - if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { - continue; - } - double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); - if (yCandMax >= 0. && std::abs(yL) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && particle.pt() < ptCandMin) { - continue; - } - isLcFound = 1; - break; - } - lcSel(isLcFound); - } - PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionMcGen, "Process Lc Selection McGen", false); -}; - -// Lc-Hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) -struct HfCorrelatorLcHadrons { - Produces entryLcHadronPair; - Produces entryLcHadronRecoInfo; - - Configurable selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"}; - Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying Lc efficiency weights"}; - Configurable filterFlagLc{"filterFlagLc", true, "Flag for applying Collision Filter with Lc"}; - Configurable filterFlagLcMc{"filterFlagLcMc", false, "Flag for applying Mc Collision Filter with Lc"}; - Configurable nEventForMixedEvent{"nEventForMixedEvent", 5, "number of event to be mixed"}; - Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; - Configurable etaTrackMax{"etaTrackMax", 0.8, "max. eta of tracks"}; - Configurable dcaXYTrackMax{"dcaXYTrackMax", 0.0025, "max. DCAxy of tracks"}; - Configurable dcaZTrackMax{"dcaZTrackMax", 0.0025, "max. DCAz of tracks"}; - Configurable ptCandMin{"ptCandMin", 1., "min. cand. pT"}; - Configurable ptTrackMin{"ptTrackMin", 0.3, "min. track pT"}; - Configurable ptTrackMax{"ptTrackMax", 50., "max. track pT"}; - Configurable multMin{"multMin", 0., "minimum multiplicity accepted"}; - Configurable multMax{"multMax", 10000., "maximum multiplicity accepted"}; - Configurable> binsPt{"binsPt", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "pT bin limits for candidate mass plots and efficiency"}; - Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc"}; - ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; - ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; - ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks - Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; - Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; - - HfHelper hfHelper; - SliceCache cache; - BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; - int leadingIndex = 0; - bool correlationStatus = false; - - // Filters for ME - Filter collisionFilter = aod::hf_selection_lc_collision::lcSel >= filterFlagLc; - Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); - Filter lcFilter = (aod::hf_sel_candidate_lc::isSelLcToPKPi >= 1) || (aod::hf_sel_candidate_lc::isSelLcToPiKP >= 1); - Filter collisionFilterGen = aod::hf_selection_lc_collision::lcSel >= filterFlagLcMc; - Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 4122 || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); - - Preslice perCol = aod::hf_cand::collisionId; - - Partition> selectedLcCandidates = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - Partition> selectedLcCandidatesMc = aod::hf_sel_candidate_lc::isSelLcToPKPi >= selectionFlagLc || aod::hf_sel_candidate_lc::isSelLcToPiKP >= selectionFlagLc; - - HistogramRegistry registry{ - "registry", - {{"hPtCand", "Lc,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng0", "Lc,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng1", "Lc,Hadron candidates;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng2", "Lc,Hadron candidates;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hSelectionStatusLcToPKPi", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, - {"hSelectionStatusLcToPiKP", "Lc,Hadron candidates;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, - {"hEta", "Lc,Hadron candidates;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPhi", "Lc,Hadron candidates;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, - {"hY", "Lc,Hadron candidates;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPtCandMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng0McRec", "Lc,Hadron candidates - Mc reco;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng1McRec", "Lc,Hadron candidates - Mc reco;prong 1 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtProng2McRec", "Lc,Hadron candidates - Mc reco;prong 2 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hSelectionStatusMcRec", "Lc,Hadron candidates - Mc reco;selection status;entries", {HistType::kTH1F, {{8, -0.5, 7.5}}}}, - {"hEtaMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{#eta};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPhiMcRec", "Lc,Hadron candidates - Mc reco;candidate #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, - {"hYMcRec", "Lc,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", "Lc,Hadron particles - Mc gen;particle #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtParticleAssocMcRec", "Associated Particles - Mc Rec;Hadron #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hPtParticleAssocMcGen", "Associated Particles - Mc Gen;Hadron #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{ptLcAxisBins, ptLcAxisMin, ptLcAxisMax}}}}, - {"hEtaMcGen", "Lc,Hadron particles - Mc Gen;particle #it{#varphi};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hPhiMcGen", "Lc,Hadron particles - Mc Gen;particle #it{#varphi};entries", {HistType::kTH1F, {{phiAxisBins, phiAxisMin, phiAxisMax}}}}, - {"hYMcGen", "Lc,Hadron candidates - Mc Gen;candidate #it{y};entries", {HistType::kTH1F, {{yAxisBins, yAxisMin, yAxisMax}}}}, - {"hCountLcHadronPerEvent", "Lc,Hadron particles - Mc Gen;Number per event;entries", {HistType::kTH1F, {{21, -0.5, 20.5}}}}, - {"hMultiplicityPreSelection", "multiplicity prior to selection;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hMultT0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}}}, - {"hZvtx", "z vertex;z vertex;entries", {HistType::kTH1F, {{200, -20., 20.}}}}, - {"hLcPoolBin", "Lc selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}, - {"hTracksPoolBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}}}}}; - - void init(InitContext&) - { - auto vbins = (std::vector)binsPt; - registry.add("hMassLcVsPt", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassLcData", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); - registry.add("hMassLcMcRec", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{massAxisBins, massAxisMin, massAxisMax}}}); - registry.add("hMassLcVsPtMcRec", "Lc candidates;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hMassLcMcRecSig", "Lc signal candidates - Mc reco;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - // mass histogram for Lc background candidates only - registry.add("hMassLcMcRecBkg", "Lc background candidates - Mc reco;inv. mass (p k #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{massAxisBins, massAxisMin, massAxisMax}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - registry.add("hCountLctriggersMcGen", "Lc trigger particles - Mc gen;;N of trigger Lc", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); - corrBinning = {{binsZVtx, binsMultiplicity}, true}; - } - - // Find Leading Particle - template - int findLeadingParticle(TTracks const& tracks) - { - auto leadingParticle = tracks.begin(); - for (auto const& track : tracks) { - if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { - continue; - } - if (track.pt() > leadingParticle.pt()) { - leadingParticle = track; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } - - // ======= Find Leading Particle for McGen ============ - template - int findLeadingParticleMcGen(TMcParticles const& mcParticles) - { - auto leadingParticle = mcParticles.begin(); - for (auto const& mcParticle : mcParticles) { - if (std::abs(mcParticle.eta()) > etaTrackMax) { - continue; - } - if (mcParticle.pt() < ptTrackMin) { - continue; - } - if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { - continue; - } - if (mcParticle.pt() > leadingParticle.pt()) { - leadingParticle = mcParticle; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } - - /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) - void processData(soa::Join::iterator const& collision, - aod::TracksWDca const& tracks, - soa::Join const&) - { - // protection against empty tables to be sliced - if (selectedLcCandidates.size() == 0) { - return; - } - - // find leading particle - if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); - } - - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); - int nTracks = 0; - if (collision.numContrib() > 1) { - for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { - continue; - } - nTracks++; - registry.fill(HIST("hTracksPoolBin"), poolBin); - } - } - registry.fill(HIST("hMultiplicityPreSelection"), nTracks); - if (nTracks < multMin || nTracks > multMax) { - return; - } - registry.fill(HIST("hMultiplicity"), nTracks); - - auto selectedLcCandidatesGrouped = selectedLcCandidates->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - - for (const auto& candidate : selectedLcCandidatesGrouped) { - if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { - continue; - } - if (candidate.pt() > ptTrackMax) { - continue; - } - // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { - continue; - } - - double efficiencyWeight = 1.; - if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyLc->at(o2::analysis::findBin(binsPt, candidate.pt())); - } - registry.fill(HIST("hPtCand"), candidate.pt()); - registry.fill(HIST("hPtProng0"), candidate.ptProng0()); - registry.fill(HIST("hPtProng1"), candidate.ptProng1()); - registry.fill(HIST("hPtProng2"), candidate.ptProng2()); - registry.fill(HIST("hEta"), candidate.eta()); - registry.fill(HIST("hPhi"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); - registry.fill(HIST("hY"), hfHelper.yLc(candidate)); - registry.fill(HIST("hLcPoolBin"), poolBin); - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); - registry.fill(HIST("hSelectionStatusLcToPKPi"), candidate.isSelLcToPKPi()); - } - if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); - registry.fill(HIST("hSelectionStatusLcToPiKP"), candidate.isSelLcToPiKP()); - } - // Lc-Hadron correlation dedicated section - // if the candidate is a Lc, search for Hadrons and evaluate correlations - - for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (track.pt() < ptTrackMin) { - continue; - } - if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { - continue; // Remove secondary tracks - } - - // Remove Lc daughters by checking track indices - if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - - if (correlateLcWithLeadingParticle) { - if (track.globalIndex() != leadingIndex) { - continue; - } - } - - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), - track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false); - } - if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), - track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false); - } - } // Hadron Tracks loop - } // end outer Lc loop - registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultT0M"), collision.multFT0M()); - } - PROCESS_SWITCH(HfCorrelatorLcHadrons, processData, "Process data", true); - - /// Lc-Hadron correlation process starts for McRec - void processMcRec(soa::Join::iterator const& collision, - aod::TracksWDca const& tracks, - soa::Join const&) - { - if (selectedLcCandidatesMc.size() == 0) { - return; - } - - // find leading particle - if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); - } - - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); - int nTracks = 0; - if (collision.numContrib() > 1) { - for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (std::abs(track.dcaXY()) > dcaXYTrackMax || std::abs(track.dcaZ()) > dcaZTrackMax) { - continue; - } - nTracks++; - registry.fill(HIST("hTracksPoolBin"), poolBin); - } - } - registry.fill(HIST("hMultiplicityPreSelection"), nTracks); - if (nTracks < multMin || nTracks > multMax) { - return; - } - registry.fill(HIST("hMultiplicity"), nTracks); - - auto selectedLcCandidatesGroupedMc = selectedLcCandidatesMc->sliceByCached(aod::hf_cand::collisionId, collision.globalIndex(), cache); - - // Mc reco level - bool isLcSignal = false; - for (const auto& candidate : selectedLcCandidatesGroupedMc) { - // check decay channel flag for candidate - if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { - continue; - } - if (yCandMax >= 0. && std::abs(hfHelper.yLc(candidate)) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && candidate.pt() < ptCandMin) { - continue; - } - if (candidate.pt() >= ptTrackMax) { - continue; - } - double efficiencyWeight = 1.; - if (applyEfficiency) { - efficiencyWeight = 1. / efficiencyLc->at(o2::analysis::findBin(binsPt, candidate.pt())); - } - isLcSignal = std::abs(candidate.flagMcMatchRec()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi; - if (isLcSignal) { - registry.fill(HIST("hPtCandMcRec"), candidate.pt()); - registry.fill(HIST("hPtProng0McRec"), candidate.ptProng0()); - registry.fill(HIST("hPtProng1McRec"), candidate.ptProng1()); - registry.fill(HIST("hPtProng2McRec"), candidate.ptProng2()); - registry.fill(HIST("hEtaMcRec"), candidate.eta()); - registry.fill(HIST("hPhiMcRec"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); - registry.fill(HIST("hYMcRec"), hfHelper.yLc(candidate)); - // LcToPKPi and LcToPiKP division - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); - } - if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecSig"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); - } - } else { - registry.fill(HIST("hPtCandMcRec"), candidate.pt()); - registry.fill(HIST("hPtProng0McRec"), candidate.ptProng0()); - registry.fill(HIST("hPtProng1McRec"), candidate.ptProng1()); - registry.fill(HIST("hPtProng2McRec"), candidate.ptProng2()); - registry.fill(HIST("hEtaMcRec"), candidate.eta()); - registry.fill(HIST("hPhiMcRec"), RecoDecay::constrainAngle(candidate.phi(), -o2::constants::math::PIHalf)); - registry.fill(HIST("hYMcRec"), hfHelper.yLc(candidate)); - // LcToPKPi and LcToPiKP division - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPKPi()); - } - if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - registry.fill(HIST("hMassLcMcRec"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeight); - registry.fill(HIST("hMassLcMcRecBkg"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hMassLcVsPtMcRec"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeight); - registry.fill(HIST("hSelectionStatusMcRec"), candidate.isSelLcToPiKP()); - } - } - registry.fill(HIST("hLcPoolBin"), poolBin); - - // Lc-Hadron correlation dedicated section - // if the candidate is selected as Lc, search for Hadron ad evaluate correlations - for (const auto& track : tracks) { - if (std::abs(track.eta()) > etaTrackMax) { - continue; - } - if (track.pt() < ptTrackMin) { - continue; - } - if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { - continue; // Remove secondary tracks - } - // Removing Lc daughters by checking track indices - if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - registry.fill(HIST("hPtParticleAssocMcRec"), track.pt()); - - if (correlateLcWithLeadingParticle) { - if (track.globalIndex() != leadingIndex) { - continue; - } - } - - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), - track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); - } - if (candidate.isSelLcToPiKP() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), - track.eta() - candidate.eta(), - candidate.pt(), - track.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); - } - } // end inner loop (Tracks) - } // end outer Lc loop - registry.fill(HIST("hZvtx"), collision.posZ()); - registry.fill(HIST("hMultT0M"), collision.multFT0M()); - } - PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRec, "Process Mc Reco mode", false); - - /// Lc-Hadron correlation pair builder - for Mc gen-level analysis - void processMcGen(aod::McCollision const& mcCollision, - soa::Join const& mcParticles) - { - int counterLcHadron = 0; - registry.fill(HIST("hMcEvtCount"), 0); - - // find leading particle - if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticleMcGen(mcParticles); - } - - auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { - int nTracks = 0; - for (const auto& track : mcParticles) { - if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { - nTracks++; - } - } - return nTracks; - }; - using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {binsZVtx, binsMultiplicityMc}, true}; - - // Mc gen level - for (const auto& particle : mcParticles) { - if (std::abs(particle.pdgCode()) != Pdg::kLambdaCPlus) { - continue; - } - if (std::abs(particle.flagMcMatchGen()) == 1 << aod::hf_cand_3prong::DecayType::LcToPKPi) { - double yL = RecoDecay::y(particle.pVector(), MassLambdaCPlus); - if (yCandMax >= 0. && std::abs(yL) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && particle.pt() < ptCandMin) { - continue; - } - registry.fill(HIST("hPtCandMcGen"), particle.pt()); - registry.fill(HIST("hEtaMcGen"), particle.eta()); - registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -o2::constants::math::PIHalf)); - registry.fill(HIST("hYMcGen"), yL); - counterLcHadron++; - - for (const auto& particleAssoc : mcParticles) { - bool flagMotherFound = false; - for (const auto& m : particleAssoc.mothers_as()) { - if (m.globalIndex() == particle.globalIndex()) { - flagMotherFound = true; - break; - } - } - if (flagMotherFound) { - continue; - } - if (std::abs(particleAssoc.eta()) > etaTrackMax) { - continue; - } - if (particleAssoc.pt() < ptTrackMin) { - continue; - } - - if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - - if (correlateLcWithLeadingParticle) { - if (particleAssoc.globalIndex() != leadingIndex) { - continue; - } - } - - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); - registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); - entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), - particleAssoc.eta() - particle.eta(), - particle.pt(), - particleAssoc.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(MassLambdaCPlus, true); - } // end inner loop - } - } // end outer loop - registry.fill(HIST("hCountLcHadronPerEvent"), counterLcHadron); - registry.fill(HIST("hZvtx"), mcCollision.posZ()); - registry.fill(HIST("hMultiplicity"), getTracksSize(mcCollision)); - } - PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcGen, "Process Mc Gen mode", false); - - void processDataMixedEvent(SelectedCollisions const& collisions, - SelectedCandidatesData const& candidates, - SelectedTracks const& tracks) - { - if (candidates.size() == 0) { - return; - } - auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairData{corrBinning, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; - - for (const auto& [c1, tracks1, c2, tracks2] : pairData) { - int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if (!TESTBIT(t1.hfflag(), aod::hf_cand_3prong::DecayType::LcToPKPi)) { - continue; - } - if (yCandMax >= 0. && std::abs(hfHelper.yLc(t1)) > yCandMax) { - continue; - } - // LcToPKPi and LcToPiKP division - if (t1.isSelLcToPKPi() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); - } - if (t1.isSelLcToPiKP() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); - } - } - } - } - PROCESS_SWITCH(HfCorrelatorLcHadrons, processDataMixedEvent, "Process Mixed Event Data", false); - - void processMcRecMixedEvent(SelectedCollisions const& collisions, - SelectedCandidatesMcRec const& candidates, - SelectedTracks const& tracks) - { - auto tracksTuple = std::make_tuple(candidates, tracks); - Pair pairMcRec{corrBinning, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; - - for (const auto& [c1, tracks1, c2, tracks2] : pairMcRec) { - int poolBin = corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M())); - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - if (yCandMax >= 0. && std::abs(hfHelper.yLc(t1)) > yCandMax) { - continue; - } - if (t1.isSelLcToPKPi() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); - } - if (t1.isSelLcToPiKP() >= selectionFlagLc) { - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), - poolBin, - correlationStatus); - entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); - } - } - } - } - PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcRecMixedEvent, "Process Mixed Event McRec", false); - - void processMcGenMixedEvent(SelectedCollisionsMcGen const& collisions, - SelectedTracksMcGen const& mcParticles) - { - auto getTracksSize = [&mcParticles, this](SelectedCollisionsMcGen::iterator const& collision) { - int nTracks = 0; - auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, collision.globalIndex(), this->cache); - for (const auto& track : associatedTracks) { - if (track.isPhysicalPrimary() && std::abs(track.eta()) < 1.0) { - nTracks++; - } - } - return nTracks; - }; - - using BinningTypeMcGen = FlexibleBinningPolicy, aod::mccollision::PosZ, decltype(getTracksSize)>; - BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {binsZVtx, binsMultiplicityMc}, true}; - - auto tracksTuple = std::make_tuple(mcParticles, mcParticles); - Pair pairMcGen{corrBinningMcGen, nEventForMixedEvent, -1, collisions, tracksTuple, &cache}; - - for (const auto& [c1, tracks1, c2, tracks2] : pairMcGen) { - for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { - // Check track t1 is Lc - if (std::abs(t1.pdgCode()) != Pdg::kLambdaCPlus) { - continue; - } - - double yL = RecoDecay::y(t1.pVector(), MassLambdaCPlus); - if (yCandMax >= 0. && std::abs(yL) > yCandMax) { - continue; - } - if (ptCandMin >= 0. && t1.pt() < ptCandMin) { - continue; - } - - if (std::abs(t2.eta()) > etaTrackMax) { - continue; - } - if (t2.pt() < ptTrackMin) { - continue; - } - int poolBin = corrBinningMcGen.getBin(std::make_tuple(c2.posZ(), getTracksSize(c2))); - entryLcHadronPair(getDeltaPhi(t1.phi(), t2.phi()), - t1.eta() - t2.eta(), - t1.pt(), - t2.pt(), - poolBin, - correlationStatus); - } - } - } - PROCESS_SWITCH(HfCorrelatorLcHadrons, processMcGenMixedEvent, "Process Mixed Event McGen", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc), - adaptAnalysisTask(cfgc)}; -} From 3baaa6067057049a38cbb22f9886929462cc79c0 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:51:33 +0800 Subject: [PATCH 10/78] Delete PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx --- .../DataModel/taskCorrelationLcHadrons.cxx | 379 ------------------ 1 file changed, 379 deletions(-) delete mode 100644 PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx diff --git a/PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx deleted file mode 100644 index 5fbf4dd6221..00000000000 --- a/PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx +++ /dev/null @@ -1,379 +0,0 @@ -// 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 taskCorrelationLcHadrons.cxx -/// \brief Lc-Hadrons azimuthal correlations analysis task - data-like, Mc-Reco and Mc-Gen analyses -/// \author Marianna Mazzilli -/// \author Zhen Zhang - -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Utils/utilsAnalysis.h" -#include "PWGHF/HFC/DataModel/CorrelationTables.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -/// -/// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies -/// -double getDeltaPhi(double phiLc, double phiHadron) -{ - return RecoDecay::constrainAngle(phiHadron - phiLc, -o2::constants::math::PIHalf); -} - -/// -/// 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 stringPtLc = "#it{p}_{T}^{#Lambda_c} (GeV/#it{c});"; -const TString stringPtHadron = "#it{p}_{T}^{Hadron} (GeV/#it{c});"; -const TString stringPoolBin = "poolBin;"; -const TString stringDeltaEta = "#it{#eta}^{Hadron}-#it{#eta}^{#Lambda_c};"; -const TString stringDeltaPhi = "#it{#varphi}^{Hadron}-#it{#varphi}^{#Lambda_c} (rad);"; -const TString stringLcHadron = "#Lambda_c,Hadron candidates "; -const TString stringSignal = "signal region;"; -const TString stringSideband = "sidebands;"; -const TString stringMcParticles = "Mc gen - #Lambda_c,Hadron particles;"; -const TString stringMcReco = "Mc reco - #Lambda_c,Hadron candidates "; - -// histogram axes definition -AxisSpec axisDeltaEta = {100, -2., 2.}; -AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::math::PIHalf}; -AxisSpec axisPtLc = {10, 0., 10.}; -AxisSpec axisPtHadron = {11, 0., 11.}; -AxisSpec axisPoolBin = {9, 0., 9.}; -AxisSpec axisCorrelationState = {2, 0., 2., ""}; -ConfigurableAxis axisMass{"axisMass", {120, 1.98f, 2.58f}, ""}; - -// definition of vectors for standard ptbin and invariant mass configurables -const int nPtBinsCorrelations = 8; -const double pTBinsCorrelations[nPtBinsCorrelations + 1] = {0., 2., 4., 6., 8., 12., 16., 24., 99.}; -auto vecBinsPtCorrelations = std::vector{pTBinsCorrelations, pTBinsCorrelations + nPtBinsCorrelations + 1}; -const double signalRegionInnerDefault[nPtBinsCorrelations] = {2.269, 2.269, 2.269, 2.269, 2.269, 2.269, 2.269, 2.269}; -const double signalRegionOuterDefault[nPtBinsCorrelations] = {2.309, 2.309, 2.309, 2.309, 2.309, 2.309, 2.309, 2.309}; -const double sidebandLeftOuterDefault[nPtBinsCorrelations] = {2.209, 2.209, 2.209, 2.209, 2.209, 2.209, 2.209, 2.209}; -const double sidebandLeftInnerDefault[nPtBinsCorrelations] = {2.249, 2.249, 2.249, 2.249, 2.249, 2.249, 2.249, 2.249}; -const double sidebandRightInnerDefault[nPtBinsCorrelations] = {2.329, 2.329, 2.329, 2.329, 2.329, 2.329, 2.329, 2.329}; -const double sidebandRightOuterDefault[nPtBinsCorrelations] = {2.369, 2.369, 2.369, 2.369, 2.369, 2.369, 2.369, 2.369}; -auto vecSignalRegionInner = std::vector{signalRegionInnerDefault, signalRegionInnerDefault + nPtBinsCorrelations}; -auto vecSignalRegionOuter = std::vector{signalRegionOuterDefault, signalRegionOuterDefault + nPtBinsCorrelations}; -auto vecSidebandLeftInner = std::vector{sidebandLeftInnerDefault, sidebandLeftInnerDefault + nPtBinsCorrelations}; -auto vecSidebandLeftOuter = std::vector{sidebandLeftOuterDefault, sidebandLeftOuterDefault + nPtBinsCorrelations}; -auto vecSidebandRightInner = std::vector{sidebandRightInnerDefault, sidebandRightInnerDefault + nPtBinsCorrelations}; -auto vecSidebandRightOuter = std::vector{sidebandRightOuterDefault, sidebandRightOuterDefault + nPtBinsCorrelations}; -const int nPtBinsEfficiency = o2::analysis::hf_cuts_lc_to_p_k_pi::nBinsPt; -const double efficiencyLcDefault[nPtBinsEfficiency] = {}; -auto vecEfficiencyLc = std::vector{efficiencyLcDefault, efficiencyLcDefault + nPtBinsEfficiency}; - -/// Lc-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 HfTaskCorrelationLcHadrons { - // Pt ranges for correlation plots: the default values are those embedded in hf_cuts_lc_to_p_k_pi (i.e. the mass Pt bins), but can be redefined via json files - Configurable applyEfficiency{"applyEfficiency", 1, "Flag for applying efficiency weights"}; - Configurable> binsPtCorrelations{"binsPtCorrelations", std::vector{vecBinsPtCorrelations}, "Pt bin limits for correlation plots"}; - Configurable> binsPtEfficiency{"binsPtEfficiency", std::vector{o2::analysis::hf_cuts_lc_to_p_k_pi::vecBinsPt}, "Pt bin limits for efficiency"}; - // signal and sideband region edges, to be defined via json file (initialised to empty) - Configurable> signalRegionInner{"signalRegionInner", std::vector{vecSignalRegionInner}, "Inner values of signal region vs Pt"}; - Configurable> signalRegionOuter{"signalRegionOuter", std::vector{vecSignalRegionOuter}, "Outer values of signal region vs Pt"}; - Configurable> sidebandLeftInner{"sidebandLeftInner", std::vector{vecSidebandLeftInner}, "Inner values of left sideband vs Pt"}; - Configurable> sidebandLeftOuter{"sidebandLeftOuter", std::vector{vecSidebandLeftOuter}, "Outer values of left sideband vs Pt"}; - Configurable> sidebandRightInner{"sidebandRightInner", std::vector{vecSidebandRightInner}, "Inner values of right sideband vs Pt"}; - Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{vecSidebandRightOuter}, "Outer values of right sideband vs Pt"}; - Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc "}; - Configurable isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"}; - Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; - - using LcHadronPairFull = soa::Join; - - enum Region { - Default = 0, // 默认值 - Toward, - Away, - Transverse - }; - - HistogramRegistry registry{ - "registry", - { - {"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - // Toward Transverse Away - {"hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - // Toward Transverse Away for McRec - {"hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - // Toward Transverse Away for McGen - {"hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}}}; - - void init(InitContext&) - { - // redefinition of Pt axes for THnSparse holding correlation entries - int nBinsPtAxis = binsPtCorrelations->size() - 1; - const double* valuesPtAxis = binsPtCorrelations->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(); - } - - Region getRegion(double deltaPhi) - { - if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { - return Toward; - } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { - return Away; - } else { - return Transverse; - } - } - - void processData(LcHadronPairFull const& pairEntries) - { - for (const auto& pairEntry : pairEntries) { - // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptLc = pairEntry.ptLc(); - double ptHadron = pairEntry.ptHadron(); - double massLc = pairEntry.mLc(); - int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); - int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); - int poolBin = pairEntry.poolBin(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - // reject entries outside Pt ranges of interest - if (ptBinLc < 0 || effBinLc < 0) { - continue; - } - if (ptHadron > 10.0) { - ptHadron = 10.5; - } - double efficiencyWeight = 1.; - double efficiencyHadron = 1.; // Note: To be implemented later on - if (applyEfficiency) { - efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); - } - - // Divide into three regions: toward, transverse, and away - if (isTowardTransverseAway) { - if (ptHadron < leadingParticlePtMin) { - continue; - } - Region region = getRegion(deltaPhi); - switch (region) { - case Toward: - registry.fill(HIST("hToward"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Away: - registry.fill(HIST("hAway"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Transverse: - registry.fill(HIST("hTransverse"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - default: - break; - } - }; - - // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots - if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { - // in signal region - registry.fill(HIST("hCorrel2DVsPtSignalRegion"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSignalRegion"), deltaPhi, deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSignalRegion"), deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSignalRegion"), deltaPhi, efficiencyWeight); - } - - if ((massLc > sidebandLeftOuter->at(ptBinLc) && massLc < sidebandLeftInner->at(ptBinLc)) || - (massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc))) { - // in sideband region - registry.fill(HIST("hCorrel2DVsPtSidebands"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSidebands"), deltaPhi, deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSidebands"), deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSidebands"), deltaPhi, efficiencyWeight); - } - } // end loop - } - PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processData, "Process data", true); - - /// Lc-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(LcHadronPairFull const& pairEntries) - { - for (const auto& pairEntry : pairEntries) { - // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptLc = pairEntry.ptLc(); - double ptHadron = pairEntry.ptHadron(); - double massLc = pairEntry.mLc(); - double efficiencyWeight = 1.; - double efficiencyHadron = 1.; - int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); - int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); - int poolBin = pairEntry.poolBin(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - if (ptBinLc < 0 || effBinLc < 0) { - continue; - } - if (ptHadron > 10.0) { - ptHadron = 10.5; - } - if (applyEfficiency) { - efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); - } - - // Divide into three regions: toward, transverse, and away - if (isTowardTransverseAway) { - if (ptHadron < leadingParticlePtMin) { - continue; - } - Region region = getRegion(deltaPhi); - switch (region) { - case Toward: - registry.fill(HIST("hTowardRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Away: - registry.fill(HIST("hAwayRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Transverse: - registry.fill(HIST("hTransverseRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - default: - break; - } - }; - - // fill correlation plots for signal/bagkground correlations - if (pairEntry.signalStatus()) { - registry.fill(HIST("hCorrel2DVsPtSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); - } else { - registry.fill(HIST("hCorrel2DVsPtBkgMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, 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 (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { - // in signal region - registry.fill(HIST("hCorrel2DVsPtSignalRegionMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSignalRegionMcRec"), deltaPhi, deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSignalRegionMcRec"), deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSignalRegionMcRec"), deltaPhi, efficiencyWeight); - } - - if (((massLc > sidebandLeftOuter->at(ptBinLc)) && (massLc < sidebandLeftInner->at(ptBinLc))) || - ((massLc > sidebandRightInner->at(ptBinLc) && massLc < sidebandRightOuter->at(ptBinLc)))) { - // in sideband region - registry.fill(HIST("hCorrel2DVsPtSidebandsMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); - registry.fill(HIST("hCorrel2DPtIntSidebandsMcRec"), deltaPhi, deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaEtaPtIntSidebandsMcRec"), deltaEta, efficiencyWeight); - registry.fill(HIST("hDeltaPhiPtIntSidebandsMcRec"), deltaPhi, efficiencyWeight); - } - } // end loop - } - PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processMcRec, "Process Mc Reco mode", false); - - /// Lc-Hadron correlation pair filling task, from pair tables - for Mc gen-level analysis (no filter/selection, only true signal) - void processMcGen(aod::LcHadronPair const& pairEntries) - { - for (const auto& pairEntry : pairEntries) { - // define variables for widely used quantities - double deltaPhi = pairEntry.deltaPhi(); - double deltaEta = pairEntry.deltaEta(); - double ptLc = pairEntry.ptLc(); - double ptHadron = pairEntry.ptHadron(); - int poolBin = pairEntry.poolBin(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); - // reject entries outside Pt ranges of interest - if (o2::analysis::findBin(binsPtCorrelations, ptLc) < 0) { - continue; - } - if (ptHadron > 10.0) { - ptHadron = 10.5; - } - - if (isTowardTransverseAway) { - // Divide into three regions: toward, transverse, and away - if (ptHadron < leadingParticlePtMin) { - continue; - } - Region region = getRegion(deltaPhi); - switch (region) { - case Toward: - registry.fill(HIST("hTowardRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); - break; - case Away: - registry.fill(HIST("hAwayRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); - break; - case Transverse: - registry.fill(HIST("hTransverseRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); - break; - default: - break; - } - } - registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); - registry.fill(HIST("hCorrel2DPtIntMcGen"), deltaPhi, deltaEta); - registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); - registry.fill(HIST("hDeltaPhiPtIntMcGen"), deltaPhi); - } // end loop - } - PROCESS_SWITCH(HfTaskCorrelationLcHadrons, processMcGen, "Process Mc Gen mode", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} From 9e6244283f6f1ffdbc04f248258f872b46a3ee7d Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:57:09 +0800 Subject: [PATCH 11/78] Add files via upload --- .../HFC/TableProducer/correlatorLcHadrons.cxx | 137 +++++++++++++++--- 1 file changed, 117 insertions(+), 20 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index b1a86a3a9e4..83bd31dbff2 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -189,10 +189,14 @@ struct HfCorrelatorLcHadrons { ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; + Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; HfHelper hfHelper; SliceCache cache; BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; + int leadingIndex = 0; + bool correlationStatus = false; // Filters for ME Filter collisionFilter = aod::hf_selection_lc_collision::lcSel >= filterFlagLc; @@ -253,6 +257,46 @@ struct HfCorrelatorLcHadrons { registry.add("hCountLctriggersMcGen", "Lc trigger particles - Mc gen;;N of trigger Lc", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); corrBinning = {{binsZVtx, binsMultiplicity}, true}; } + + // Find Leading Particle + template + int findLeadingParticle(TTracks const& tracks) + { + auto leadingParticle = tracks.begin(); + for (auto const& track : tracks) { + if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { + continue; + } + if (track.pt() > leadingParticle.pt()) { + leadingParticle = track; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } + + // ======= Find Leading Particle for McGen ============ + template + int findLeadingParticleMcGen(TMcParticles const& mcParticles) + { + auto leadingParticle = mcParticles.begin(); + for (auto const& mcParticle : mcParticles) { + if (std::abs(mcParticle.eta()) > etaTrackMax) { + continue; + } + if (mcParticle.pt() < ptTrackMin) { + continue; + } + if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { + continue; + } + if (mcParticle.pt() > leadingParticle.pt()) { + leadingParticle = mcParticle; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) void processData(soa::Join::iterator const& collision, @@ -263,6 +307,12 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidates.size() == 0) { return; } + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -335,16 +385,28 @@ struct HfCorrelatorLcHadrons { if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { continue; // Remove secondary tracks } + // Remove Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + + if (correlateLcWithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } } + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -352,7 +414,8 @@ struct HfCorrelatorLcHadrons { track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false); } } // Hadron Tracks loop @@ -370,6 +433,12 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidatesMc.size() == 0) { return; } + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -472,16 +541,26 @@ struct HfCorrelatorLcHadrons { } // Removing Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; } registry.fill(HIST("hPtParticleAssocMcRec"), track.pt()); + + if (correlateLcWithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } + } if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -489,7 +568,8 @@ struct HfCorrelatorLcHadrons { track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); } } // end inner loop (Tracks) @@ -501,11 +581,16 @@ struct HfCorrelatorLcHadrons { /// Lc-Hadron correlation pair builder - for Mc gen-level analysis void processMcGen(aod::McCollision const& mcCollision, - soa::Join const& mcParticles) + soa::Join const& mcParticles) { int counterLcHadron = 0; registry.fill(HIST("hMcEvtCount"), 0); - + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticleMcGen(mcParticles); + } + auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { int nTracks = 0; for (const auto& track : mcParticles) { @@ -539,11 +624,7 @@ struct HfCorrelatorLcHadrons { for (const auto& particleAssoc : mcParticles) { bool flagMotherFound = false; - /*const auto mothers = particleAssoc.daughters_as(); - if (mothers.empty()) { - std::cout << "No mother particles found." << std::endl; - }*/ - for (const auto& m : particleAssoc.mothers_as()) { + for (const auto& m : particleAssoc.mothers_as()) { if (m.globalIndex() == particle.globalIndex()) { flagMotherFound = true; break; @@ -560,15 +641,26 @@ struct HfCorrelatorLcHadrons { } if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; } + + if (correlateLcWithLeadingParticle) { + if (particleAssoc.globalIndex() != leadingIndex) { + continue; + } + } + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), particleAssoc.eta() - particle.eta(), particle.pt(), particleAssoc.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(MassLambdaCPlus, true); } // end inner loop } @@ -604,7 +696,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); } if (t1.isSelLcToPiKP() >= selectionFlagLc) { @@ -612,7 +705,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); } } @@ -638,7 +732,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); } if (t1.isSelLcToPiKP() >= selectionFlagLc) { @@ -646,7 +741,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); } } @@ -700,7 +796,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); } } } From 34af6aa6a7dd001c5f7e5e6a9d739c2c05d99583 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:06:16 +0800 Subject: [PATCH 12/78] Add files via upload --- .../HFC/TableProducer/correlatorLcHadrons.cxx | 131 ++---------------- 1 file changed, 15 insertions(+), 116 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 83bd31dbff2..141ad2e9b4c 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -189,14 +189,10 @@ struct HfCorrelatorLcHadrons { ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks - Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; - Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; HfHelper hfHelper; SliceCache cache; BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; - int leadingIndex = 0; - bool correlationStatus = false; // Filters for ME Filter collisionFilter = aod::hf_selection_lc_collision::lcSel >= filterFlagLc; @@ -257,46 +253,6 @@ struct HfCorrelatorLcHadrons { registry.add("hCountLctriggersMcGen", "Lc trigger particles - Mc gen;;N of trigger Lc", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); corrBinning = {{binsZVtx, binsMultiplicity}, true}; } - - // Find Leading Particle - template - int findLeadingParticle(TTracks const& tracks) - { - auto leadingParticle = tracks.begin(); - for (auto const& track : tracks) { - if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { - continue; - } - if (track.pt() > leadingParticle.pt()) { - leadingParticle = track; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } - - // ======= Find Leading Particle for McGen ============ - template - int findLeadingParticleMcGen(TMcParticles const& mcParticles) - { - auto leadingParticle = mcParticles.begin(); - for (auto const& mcParticle : mcParticles) { - if (std::abs(mcParticle.eta()) > etaTrackMax) { - continue; - } - if (mcParticle.pt() < ptTrackMin) { - continue; - } - if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { - continue; - } - if (mcParticle.pt() > leadingParticle.pt()) { - leadingParticle = mcParticle; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) void processData(soa::Join::iterator const& collision, @@ -307,12 +263,6 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidates.size() == 0) { return; } - - // find leading particle - if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); - } - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -385,28 +335,16 @@ struct HfCorrelatorLcHadrons { if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { continue; // Remove secondary tracks } - // Remove Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - - if (correlateLcWithLeadingParticle) { - if (track.globalIndex() != leadingIndex) { - continue; - } + continue; } - if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -414,8 +352,7 @@ struct HfCorrelatorLcHadrons { track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false); } } // Hadron Tracks loop @@ -433,12 +370,6 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidatesMc.size() == 0) { return; } - - // find leading particle - if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); - } - int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -541,26 +472,16 @@ struct HfCorrelatorLcHadrons { } // Removing Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; + continue; } registry.fill(HIST("hPtParticleAssocMcRec"), track.pt()); - - if (correlateLcWithLeadingParticle) { - if (track.globalIndex() != leadingIndex) { - continue; - } - } if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -568,8 +489,7 @@ struct HfCorrelatorLcHadrons { track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); } } // end inner loop (Tracks) @@ -581,15 +501,10 @@ struct HfCorrelatorLcHadrons { /// Lc-Hadron correlation pair builder - for Mc gen-level analysis void processMcGen(aod::McCollision const& mcCollision, - soa::Join const& mcParticles) + soa::Join const& mcParticles) { int counterLcHadron = 0; registry.fill(HIST("hMcEvtCount"), 0); - - // find leading particle - if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticleMcGen(mcParticles); - } auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { int nTracks = 0; @@ -624,7 +539,7 @@ struct HfCorrelatorLcHadrons { for (const auto& particleAssoc : mcParticles) { bool flagMotherFound = false; - for (const auto& m : particleAssoc.mothers_as()) { + for (const auto& m : particleAssoc.mothers_as()) { if (m.globalIndex() == particle.globalIndex()) { flagMotherFound = true; break; @@ -641,26 +556,15 @@ struct HfCorrelatorLcHadrons { } if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { - if (!storeAutoCorrelationFlag) { - continue; - } - correlationStatus = true; - } - - if (correlateLcWithLeadingParticle) { - if (particleAssoc.globalIndex() != leadingIndex) { - continue; - } + continue; } - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), particleAssoc.eta() - particle.eta(), particle.pt(), particleAssoc.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(MassLambdaCPlus, true); } // end inner loop } @@ -696,8 +600,7 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); } if (t1.isSelLcToPiKP() >= selectionFlagLc) { @@ -705,8 +608,7 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); } } @@ -732,8 +634,7 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); } if (t1.isSelLcToPiKP() >= selectionFlagLc) { @@ -741,8 +642,7 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin, - correlationStatus); + poolBin); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); } } @@ -796,8 +696,7 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin, - correlationStatus); + poolBin); } } } From d0f102b2bd63e5e7b20b88a0f1090d9f25e46fb4 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:07:30 +0800 Subject: [PATCH 13/78] Add files via upload From e2524729170d6e04523eea20ea9a82add81612b0 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 19:21:35 +0800 Subject: [PATCH 14/78] Add files via upload --- .../HFC/TableProducer/correlatorLcHadrons.cxx | 127 ++++++++++++++++-- 1 file changed, 114 insertions(+), 13 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 141ad2e9b4c..c1bf17a87a4 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -189,10 +189,14 @@ struct HfCorrelatorLcHadrons { ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; ConfigurableAxis binsMultiplicityMc{"binsMultiplicityMc", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks + Configurable storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"}; + Configurable correlateLcWithLeadingParticle{"correlateLcWithLeadingParticle", false, "Switch for correlation of Lc baryons with leading particle only"}; HfHelper hfHelper; SliceCache cache; BinningType corrBinning{{binsZVtx, binsMultiplicity}, true}; + int leadingIndex = 0; + bool correlationStatus = false; // Filters for ME Filter collisionFilter = aod::hf_selection_lc_collision::lcSel >= filterFlagLc; @@ -254,6 +258,46 @@ struct HfCorrelatorLcHadrons { corrBinning = {{binsZVtx, binsMultiplicity}, true}; } + // Find Leading Particle + template + int findLeadingParticle(TTracks const& tracks) + { + auto leadingParticle = tracks.begin(); + for (auto const& track : tracks) { + if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { + continue; + } + if (track.pt() > leadingParticle.pt()) { + leadingParticle = track; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } + + // ======= Find Leading Particle for McGen ============ + template + int findLeadingParticleMcGen(TMcParticles const& mcParticles) + { + auto leadingParticle = mcParticles.begin(); + for (auto const& mcParticle : mcParticles) { + if (std::abs(mcParticle.eta()) > etaTrackMax) { + continue; + } + if (mcParticle.pt() < ptTrackMin) { + continue; + } + if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { + continue; + } + if (mcParticle.pt() > leadingParticle.pt()) { + leadingParticle = mcParticle; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; + } + /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) void processData(soa::Join::iterator const& collision, aod::TracksWDca const& tracks, @@ -263,6 +307,12 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidates.size() == 0) { return; } + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -335,16 +385,28 @@ struct HfCorrelatorLcHadrons { if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { continue; // Remove secondary tracks } + // Remove Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + + if (correlateLcWithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } } + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -352,7 +414,8 @@ struct HfCorrelatorLcHadrons { track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false); } } // Hadron Tracks loop @@ -370,6 +433,12 @@ struct HfCorrelatorLcHadrons { if (selectedLcCandidatesMc.size() == 0) { return; } + + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticle(tracks); + } + int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; if (collision.numContrib() > 1) { @@ -472,16 +541,26 @@ struct HfCorrelatorLcHadrons { } // Removing Lc daughters by checking track indices if ((candidate.prong0Id() == track.globalIndex()) || (candidate.prong1Id() == track.globalIndex()) || (candidate.prong2Id() == track.globalIndex())) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; } registry.fill(HIST("hPtParticleAssocMcRec"), track.pt()); + if (correlateLcWithLeadingParticle) { + if (track.globalIndex() != leadingIndex) { + continue; + } + } + if (candidate.isSelLcToPKPi() >= selectionFlagLc) { entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()), track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal); } if (candidate.isSelLcToPiKP() >= selectionFlagLc) { @@ -489,7 +568,8 @@ struct HfCorrelatorLcHadrons { track.eta() - candidate.eta(), candidate.pt(), track.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal); } } // end inner loop (Tracks) @@ -506,6 +586,11 @@ struct HfCorrelatorLcHadrons { int counterLcHadron = 0; registry.fill(HIST("hMcEvtCount"), 0); + // find leading particle + if (correlateLcWithLeadingParticle) { + leadingIndex = findLeadingParticleMcGen(mcParticles); + } + auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { int nTracks = 0; for (const auto& track : mcParticles) { @@ -556,15 +641,26 @@ struct HfCorrelatorLcHadrons { } if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particle.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { - continue; + if (!storeAutoCorrelationFlag) { + continue; + } + correlationStatus = true; + } + + if (correlateLcWithLeadingParticle) { + if (particleAssoc.globalIndex() != leadingIndex) { + continue; + } } + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision))); registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); entryLcHadronPair(getDeltaPhi(particleAssoc.phi(), particle.phi()), particleAssoc.eta() - particle.eta(), particle.pt(), particleAssoc.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(MassLambdaCPlus, true); } // end inner loop } @@ -600,7 +696,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); } if (t1.isSelLcToPiKP() >= selectionFlagLc) { @@ -608,7 +705,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); } } @@ -634,7 +732,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(t1), false); } if (t1.isSelLcToPiKP() >= selectionFlagLc) { @@ -642,7 +741,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false); } } @@ -696,7 +796,8 @@ struct HfCorrelatorLcHadrons { t1.eta() - t2.eta(), t1.pt(), t2.pt(), - poolBin); + poolBin, + correlationStatus); } } } From 67785fb82124ce22da763b1aa6879ef10d068a7a Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 19:22:13 +0800 Subject: [PATCH 15/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 148 ++++++++++++++++--- 1 file changed, 124 insertions(+), 24 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 889ded1486e..1dbe8c58729 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -61,6 +61,8 @@ AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::m AxisSpec axisPtLc = {10, 0., 10.}; AxisSpec axisPtHadron = {11, 0., 11.}; AxisSpec axisPoolBin = {9, 0., 9.}; +AxisSpec axisCorrelationState = {2, 0., 2., ""}; +ConfigurableAxis axisMass{"axisMass", {120, 1.98f, 2.58f}, ""}; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 8; @@ -96,35 +98,54 @@ struct HfTaskCorrelationLcHadrons { Configurable> sidebandRightInner{"sidebandRightInner", std::vector{vecSidebandRightInner}, "Inner values of right sideband vs Pt"}; Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{vecSidebandRightOuter}, "Outer values of right sideband vs Pt"}; Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc "}; + Configurable isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"}; + Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; using LcHadronPairFull = soa::Join; + enum Region { + Default = 0, // 默认值 + Toward, + Away, + Transverse + }; + HistogramRegistry registry{ "registry", - { - {"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - }}; + {{"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + // Toward Transverse Away + {"hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + // Toward Transverse Away for McRec + {"hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + // Toward Transverse Away for McGen + {"hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}}}; void init(InitContext&) { @@ -148,8 +169,20 @@ struct HfTaskCorrelationLcHadrons { registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); } + Region getRegion(double deltaPhi) + { + if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { + return Toward; + } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { + return Away; + } else { + return Transverse; + } + } + void processData(LcHadronPairFull const& pairEntries) { + std::cout << " "; for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities double deltaPhi = pairEntry.deltaPhi(); @@ -160,6 +193,7 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside Pt ranges of interest if (ptBinLc < 0 || effBinLc < 0) { continue; @@ -172,6 +206,28 @@ struct HfTaskCorrelationLcHadrons { if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); } + + // Divide into three regions: toward, transverse, and away + if (isTowardTransverseAway) { + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hToward"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAway"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverse"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + default: + break; + } + }; + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { // in signal region @@ -208,6 +264,7 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); if (ptBinLc < 0 || effBinLc < 0) { continue; } @@ -217,6 +274,28 @@ struct HfTaskCorrelationLcHadrons { if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); } + + // Divide into three regions: toward, transverse, and away + if (isTowardTransverseAway) { + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAwayRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverseRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + default: + break; + } + }; + // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { registry.fill(HIST("hCorrel2DVsPtSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); @@ -256,6 +335,7 @@ struct HfTaskCorrelationLcHadrons { double ptLc = pairEntry.ptLc(); double ptHadron = pairEntry.ptHadron(); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside Pt ranges of interest if (o2::analysis::findBin(binsPtCorrelations, ptLc) < 0) { continue; @@ -264,6 +344,26 @@ struct HfTaskCorrelationLcHadrons { ptHadron = 10.5; } + if (isTowardTransverseAway) { + // Divide into three regions: toward, transverse, and away + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + case Away: + registry.fill(HIST("hAwayRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + case Transverse: + registry.fill(HIST("hTransverseRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + default: + break; + } + } registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); registry.fill(HIST("hCorrel2DPtIntMcGen"), deltaPhi, deltaEta); registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); From 922386477c21b81ac341f3e1fb9b4cd32b94b71d Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 20:57:47 +0800 Subject: [PATCH 16/78] Add files via upload --- PWGHF/HFC/DataModel/CorrelationTables.h | 30 +++++++++++++++++++------ 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index a3db9ff1277..4609b21df95 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -97,13 +97,13 @@ DECLARE_SOA_TABLE(DHadronRecoInfo, "AOD", "DHADRONRECOINFO", //! D0-Hadrons pair // Note: definition of columns and tables for Lc-Hadron correlation pairs namespace hf_correlation_lc_hadron { -DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Lc and Hadrons -DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Lc and Hadrons -DECLARE_SOA_COLUMN(PtLc, ptLc, float); //! Transverse momentum of Lc -DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron -DECLARE_SOA_COLUMN(MLc, mLc, float); //! Invariant mass of Lc -DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for LcToPKPi/LcToPiKP -DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent +DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Lc and Hadrons +DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Lc and Hadrons +DECLARE_SOA_COLUMN(PtLc, ptLc, float); //! Transverse momentum of Lc +DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron +DECLARE_SOA_COLUMN(MLc, mLc, float); //! Invariant mass of Lc +DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for LcToPKPi/LcToPiKP +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status } // namespace hf_correlation_lc_hadron @@ -349,6 +349,22 @@ DECLARE_SOA_COLUMN(DmesonSel, dmesonSel, bool); //! Selection flag for D meson i DECLARE_SOA_TABLE(DmesonSelection, "AOD", "DINCOLL", // Selection of D meson in collisions aod::hf_selection_dmeson_collision::DmesonSel); + +// Note: definition of columns and tables for Electron Hadron correlation pairs +namespace hf_correlation_electron_hadron +{ +DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between Electron and Hadrons +DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between Electron and Hadrons +DECLARE_SOA_COLUMN(PtElectron, ptElectron, float); //! Transverse momentum of Electron +DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron; +DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin of event defined using zvtx and multiplicity +} // namespace hf_correlation_electron_hadron +DECLARE_SOA_TABLE(HfEHadronPair, "AOD", "HFEHADRONPAIR", //! Hfe-Hadrons pairs Informations + hf_correlation_electron_hadron::DeltaPhi, + hf_correlation_electron_hadron::DeltaEta, + hf_correlation_electron_hadron::PtElectron, + hf_correlation_electron_hadron::PtHadron, + hf_correlation_electron_hadron::PoolBin); } // namespace o2::aod #endif // PWGHF_HFC_DATAMODEL_CORRELATIONTABLES_H_ From f78678105a3fc616a50f400e8d0d64bfa46d48a0 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:04:33 +0800 Subject: [PATCH 17/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 148 +++---------------- 1 file changed, 24 insertions(+), 124 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 1dbe8c58729..889ded1486e 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -61,8 +61,6 @@ AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::m AxisSpec axisPtLc = {10, 0., 10.}; AxisSpec axisPtHadron = {11, 0., 11.}; AxisSpec axisPoolBin = {9, 0., 9.}; -AxisSpec axisCorrelationState = {2, 0., 2., ""}; -ConfigurableAxis axisMass{"axisMass", {120, 1.98f, 2.58f}, ""}; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 8; @@ -98,54 +96,35 @@ struct HfTaskCorrelationLcHadrons { Configurable> sidebandRightInner{"sidebandRightInner", std::vector{vecSidebandRightInner}, "Inner values of right sideband vs Pt"}; Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{vecSidebandRightOuter}, "Outer values of right sideband vs Pt"}; Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc "}; - Configurable isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"}; - Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; using LcHadronPairFull = soa::Join; - enum Region { - Default = 0, // 默认值 - Toward, - Away, - Transverse - }; - HistogramRegistry registry{ "registry", - {{"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - // Toward Transverse Away - {"hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - // Toward Transverse Away for McRec - {"hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - // Toward Transverse Away for McGen - {"hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, - {"hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}}}; + { + {"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + }}; void init(InitContext&) { @@ -169,20 +148,8 @@ struct HfTaskCorrelationLcHadrons { registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); } - Region getRegion(double deltaPhi) - { - if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { - return Toward; - } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { - return Away; - } else { - return Transverse; - } - } - void processData(LcHadronPairFull const& pairEntries) { - std::cout << " "; for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities double deltaPhi = pairEntry.deltaPhi(); @@ -193,7 +160,6 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); int poolBin = pairEntry.poolBin(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside Pt ranges of interest if (ptBinLc < 0 || effBinLc < 0) { continue; @@ -206,28 +172,6 @@ struct HfTaskCorrelationLcHadrons { if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); } - - // Divide into three regions: toward, transverse, and away - if (isTowardTransverseAway) { - if (ptHadron < leadingParticlePtMin) { - continue; - } - Region region = getRegion(deltaPhi); - switch (region) { - case Toward: - registry.fill(HIST("hToward"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Away: - registry.fill(HIST("hAway"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Transverse: - registry.fill(HIST("hTransverse"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - default: - break; - } - }; - // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { // in signal region @@ -264,7 +208,6 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); int poolBin = pairEntry.poolBin(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); if (ptBinLc < 0 || effBinLc < 0) { continue; } @@ -274,28 +217,6 @@ struct HfTaskCorrelationLcHadrons { if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); } - - // Divide into three regions: toward, transverse, and away - if (isTowardTransverseAway) { - if (ptHadron < leadingParticlePtMin) { - continue; - } - Region region = getRegion(deltaPhi); - switch (region) { - case Toward: - registry.fill(HIST("hTowardRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Away: - registry.fill(HIST("hAwayRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - case Transverse: - registry.fill(HIST("hTransverseRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); - break; - default: - break; - } - }; - // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { registry.fill(HIST("hCorrel2DVsPtSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); @@ -335,7 +256,6 @@ struct HfTaskCorrelationLcHadrons { double ptLc = pairEntry.ptLc(); double ptHadron = pairEntry.ptHadron(); int poolBin = pairEntry.poolBin(); - bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside Pt ranges of interest if (o2::analysis::findBin(binsPtCorrelations, ptLc) < 0) { continue; @@ -344,26 +264,6 @@ struct HfTaskCorrelationLcHadrons { ptHadron = 10.5; } - if (isTowardTransverseAway) { - // Divide into three regions: toward, transverse, and away - if (ptHadron < leadingParticlePtMin) { - continue; - } - Region region = getRegion(deltaPhi); - switch (region) { - case Toward: - registry.fill(HIST("hTowardRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); - break; - case Away: - registry.fill(HIST("hAwayRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); - break; - case Transverse: - registry.fill(HIST("hTransverseRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); - break; - default: - break; - } - } registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); registry.fill(HIST("hCorrel2DPtIntMcGen"), deltaPhi, deltaEta); registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); From 13f7d6fd03bc8338ef6af91685b4a3a1ecf4de76 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:06:35 +0800 Subject: [PATCH 18/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 148 ++++++++++++++++--- 1 file changed, 124 insertions(+), 24 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 889ded1486e..c54fe8725b7 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -61,6 +61,8 @@ AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::m AxisSpec axisPtLc = {10, 0., 10.}; AxisSpec axisPtHadron = {11, 0., 11.}; AxisSpec axisPoolBin = {9, 0., 9.}; +AxisSpec axisCorrelationState = {2, 0., 2., ""}; +ConfigurableAxis axisMass{"axisMass", {120, 1.98f, 2.58f}, ""}; // definition of vectors for standard ptbin and invariant mass configurables const int nPtBinsCorrelations = 8; @@ -96,35 +98,54 @@ struct HfTaskCorrelationLcHadrons { Configurable> sidebandRightInner{"sidebandRightInner", std::vector{vecSidebandRightInner}, "Inner values of right sideband vs Pt"}; Configurable> sidebandRightOuter{"sidebandRightOuter", std::vector{vecSidebandRightOuter}, "Outer values of right sideband vs Pt"}; Configurable> efficiencyLc{"efficiencyLc", std::vector{vecEfficiencyLc}, "Efficiency values for Lc "}; + Configurable isTowardTransverseAway{"isTowardTransverseAway", false, "Divide into three regions: toward, transverse, and away"}; + Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; using LcHadronPairFull = soa::Join; + enum Region { + Default = 0, // 默认值 + Toward, + Away, + Transverse + }; + HistogramRegistry registry{ "registry", - { - {"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, - {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, - {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, - {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, - {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() - }}; + {{"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSidebands", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebands", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + {"hDeltaEtaPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSignalRegionMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtSignalMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hCorrel2DVsPtBkgMcRec", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtSidebandsMcRec", stringLcHadron + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, + {"hDeltaEtaPtIntMcGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, + {"hDeltaPhiPtIntMcGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}, + {"hCorrel2DPtIntMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}}, + {"hCorrel2DVsPtMcGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPoolBin + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the Pt) are updated in the init() + // Toward Transverse Away + {"hToward", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverse", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAway", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + // Toward Transverse Away for McRec + {"hTowardRec", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverseRec", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAwayRec", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + // Toward Transverse Away for McGen + {"hTowardGen", "Toward invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hTransverseGen", "Transverse invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}, + {"hAwayGen", "Away invmass; ptLc; correlationState;entries", {HistType::kTH3F, {{axisMass}, {axisPtLc}, {axisCorrelationState}}}}}}; void init(InitContext&) { @@ -148,8 +169,20 @@ struct HfTaskCorrelationLcHadrons { registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); } + Region getRegion(double deltaPhi) + { + if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { + return Toward; + } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { + return Away; + } else { + return Transverse; + } + } + void processData(LcHadronPairFull const& pairEntries) { + std::cout << " "; for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities double deltaPhi = pairEntry.deltaPhi(); @@ -160,6 +193,7 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside Pt ranges of interest if (ptBinLc < 0 || effBinLc < 0) { continue; @@ -172,6 +206,28 @@ struct HfTaskCorrelationLcHadrons { if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); } + + // Divide into three regions: toward, transverse, and away + if (isTowardTransverseAway) { + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hToward"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAway"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverse"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + default: + break; + } + }; + // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { // in signal region @@ -208,6 +264,7 @@ struct HfTaskCorrelationLcHadrons { int effBinLc = o2::analysis::findBin(binsPtEfficiency, ptLc); int ptBinLc = o2::analysis::findBin(binsPtCorrelations, ptLc); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); if (ptBinLc < 0 || effBinLc < 0) { continue; } @@ -217,6 +274,28 @@ struct HfTaskCorrelationLcHadrons { if (applyEfficiency) { efficiencyWeight = 1. / (efficiencyLc->at(effBinLc) * efficiencyHadron); } + + // Divide into three regions: toward, transverse, and away + if (isTowardTransverseAway) { + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAwayRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverseRec"), massLc, ptLc, isAutoCorrelated, efficiencyWeight); + break; + default: + break; + } + } + // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { registry.fill(HIST("hCorrel2DVsPtSignalMcRec"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, efficiencyWeight); @@ -256,6 +335,7 @@ struct HfTaskCorrelationLcHadrons { double ptLc = pairEntry.ptLc(); double ptHadron = pairEntry.ptHadron(); int poolBin = pairEntry.poolBin(); + bool isAutoCorrelated = pairEntry.isAutoCorrelated(); // reject entries outside Pt ranges of interest if (o2::analysis::findBin(binsPtCorrelations, ptLc) < 0) { continue; @@ -264,6 +344,26 @@ struct HfTaskCorrelationLcHadrons { ptHadron = 10.5; } + if (isTowardTransverseAway) { + // Divide into three regions: toward, transverse, and away + if (ptHadron < leadingParticlePtMin) { + continue; + } + Region region = getRegion(deltaPhi); + switch (region) { + case Toward: + registry.fill(HIST("hTowardRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + case Away: + registry.fill(HIST("hAwayRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + case Transverse: + registry.fill(HIST("hTransverseRec"), o2::constants::physics::MassLambdaCPlus, ptLc, isAutoCorrelated); + break; + default: + break; + } + } registry.fill(HIST("hCorrel2DVsPtMcGen"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin); registry.fill(HIST("hCorrel2DPtIntMcGen"), deltaPhi, deltaEta); registry.fill(HIST("hDeltaEtaPtIntMcGen"), deltaEta); From c8d568511981dd2d4cdcfbcba6fc799d2bf39a5d Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:13:18 +0800 Subject: [PATCH 19/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index c54fe8725b7..918a77b76c2 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -226,7 +226,7 @@ struct HfTaskCorrelationLcHadrons { default: break; } - }; + } // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) { From 2e05b4cdca22f3fd0a07400aaccebf955ad22334 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:15:05 +0800 Subject: [PATCH 20/78] Update PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index c1bf17a87a4..cdbfbecd071 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -271,8 +271,7 @@ struct HfCorrelatorLcHadrons { leadingParticle = track; } } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; + return leadingParticle.globalIndex(); } // ======= Find Leading Particle for McGen ============ From 0bc14428ad83b7eebbb518dd5afcc9b71006deb5 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:19:14 +0800 Subject: [PATCH 21/78] Update PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 918a77b76c2..24e1931507a 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -182,7 +182,6 @@ struct HfTaskCorrelationLcHadrons { void processData(LcHadronPairFull const& pairEntries) { - std::cout << " "; for (const auto& pairEntry : pairEntries) { // define variables for widely used quantities double deltaPhi = pairEntry.deltaPhi(); From 071a32f75c032938e1d0acd35abbc7ccafb2ef07 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:22:01 +0800 Subject: [PATCH 22/78] Update taskCorrelationLcHadrons.cxx --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 24e1931507a..df07d111782 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -104,7 +104,7 @@ struct HfTaskCorrelationLcHadrons { using LcHadronPairFull = soa::Join; enum Region { - Default = 0, // 默认值 + Default = 0, Toward, Away, Transverse From 2d2d070294a1a87c256be8289bb8cf1d486b9203 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:22:48 +0800 Subject: [PATCH 23/78] Update PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index cdbfbecd071..17104a6d250 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -293,8 +293,7 @@ struct HfCorrelatorLcHadrons { leadingParticle = mcParticle; } } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; + return leadingParticle.globalIndex(); } /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) From db40ff3da8024b23ea5501aa52067c4049ddb6b5 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:08:57 +0800 Subject: [PATCH 24/78] Create utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 PWGHF/HFC/Utils/utilsCorrelations.h diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -0,0 +1 @@ + From 65397d103cb5fea16dcae3e462e67da37473dff4 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:23:42 +0800 Subject: [PATCH 25/78] Add files via upload --- PWGHF/HFC/Utils/utilsCorrelations.h | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 8b137891791..157e7710541 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -1 +1,36 @@ +// 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 utilsCorrelations.h +/// \brief Utilities for HFC analyses + +#ifndef UTILS_CORRELATIONS_H +#define UTILS_CORRELATIONS_H + +#include +#include + +enum Region { Toward, + Away, + Transverse }; + +Region getRegion(double deltaPhi) +{ + if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { + return Toward; + } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { + return Away; + } else { + return Transverse; + } +} + +#endif // UTILS_CORRELATIONS_H \ No newline at end of file From 6e51674fab6c5f51443b83061f68726752ef3159 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:25:40 +0800 Subject: [PATCH 26/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 21 ++------------------ 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index df07d111782..704e5f66c40 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -22,6 +22,7 @@ #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsAnalysis.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/HFC/Utils/utilsCorrelations.h" using namespace o2; using namespace o2::framework; @@ -103,13 +104,6 @@ struct HfTaskCorrelationLcHadrons { using LcHadronPairFull = soa::Join; - enum Region { - Default = 0, - Toward, - Away, - Transverse - }; - HistogramRegistry registry{ "registry", {{"hDeltaEtaPtIntSignalRegion", stringLcHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, @@ -169,17 +163,6 @@ struct HfTaskCorrelationLcHadrons { registry.get(HIST("hCorrel2DVsPtMcGen"))->Sumw2(); } - Region getRegion(double deltaPhi) - { - if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { - return Toward; - } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { - return Away; - } else { - return Transverse; - } - } - void processData(LcHadronPairFull const& pairEntries) { for (const auto& pairEntry : pairEntries) { @@ -293,7 +276,7 @@ struct HfTaskCorrelationLcHadrons { default: break; } - } + }; // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { From 12ce305ecd9823edecc1575dbda59a767e53589f Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:45:33 +0800 Subject: [PATCH 27/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index 23411030dfc..f5f6b40d09d 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -24,6 +24,7 @@ #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsAnalysis.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/HFC/Utils/utilsCorrelations.h" using namespace o2; using namespace o2::framework; @@ -94,13 +95,6 @@ struct HfTaskCorrelationD0Hadrons { Configurable leadingParticlePtMin{"leadingParticlePtMin", 0., "Min for leading particle pt"}; Configurable applyEfficiency{"efficiencyFlagD", 1, "Flag for applying efficiency weights"}; - enum Region { - Default = 0, // 默认值 - Toward, - Away, - Transverse - }; - HistogramRegistry registry{ "registry", {{"hDeltaEtaPtIntSignalRegion", stringDHadron + stringSignal + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}}, @@ -234,16 +228,6 @@ struct HfTaskCorrelationD0Hadrons { registry.get(HIST("hCorrel2DVsPtGen"))->Sumw2(); } - Region getRegion(double deltaPhi) - { - if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { - return Toward; - } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { - return Away; - } else { - return Transverse; - } - } /// D-h 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) /// Works on both USL and LS analyses pair tables void processData(aod::DHadronPairFull const& pairEntries) From aa65ff092139cb847bfc59409924225464ee2b8b Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:05:22 +0800 Subject: [PATCH 28/78] Add files via upload --- utilsCorrelations.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 utilsCorrelations.h diff --git a/utilsCorrelations.h b/utilsCorrelations.h new file mode 100644 index 00000000000..fe896f8e1ad --- /dev/null +++ b/utilsCorrelations.h @@ -0,0 +1,39 @@ +// 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 utilsCorrelations.h +/// \brief Utilities for HFC analyses + +#ifndef UTILS_CORRELATIONS_H +#define UTILS_CORRELATIONS_H + +#include +#include + +enum Region { + Default = 0, + Toward, + Away, + Transverse +}; + +Region getRegion(double deltaPhi) +{ + if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { + return Toward; + } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { + return Away; + } else { + return Transverse; + } +} + +#endif // UTILS_CORRELATIONS_H \ No newline at end of file From 5c398eaf17e98463ffe418ad15bd07e2e117d0c3 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:06:23 +0800 Subject: [PATCH 29/78] Delete utilsCorrelations.h --- utilsCorrelations.h | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 utilsCorrelations.h diff --git a/utilsCorrelations.h b/utilsCorrelations.h deleted file mode 100644 index fe896f8e1ad..00000000000 --- a/utilsCorrelations.h +++ /dev/null @@ -1,39 +0,0 @@ -// 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 utilsCorrelations.h -/// \brief Utilities for HFC analyses - -#ifndef UTILS_CORRELATIONS_H -#define UTILS_CORRELATIONS_H - -#include -#include - -enum Region { - Default = 0, - Toward, - Away, - Transverse -}; - -Region getRegion(double deltaPhi) -{ - if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { - return Toward; - } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { - return Away; - } else { - return Transverse; - } -} - -#endif // UTILS_CORRELATIONS_H \ No newline at end of file From 8d3652f4bcf20f4f9ab821260ac7c133a8affb6c Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:06:56 +0800 Subject: [PATCH 30/78] Add files via upload --- PWGHF/HFC/Utils/utilsCorrelations.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 157e7710541..fe896f8e1ad 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -18,9 +18,12 @@ #include #include -enum Region { Toward, - Away, - Transverse }; +enum Region { + Default = 0, + Toward, + Away, + Transverse +}; Region getRegion(double deltaPhi) { From 4736d2d7af48579a3e572dc8d79f2afab28a61ef Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:16:40 +0800 Subject: [PATCH 31/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index fe896f8e1ad..8f2118465d3 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -36,4 +36,4 @@ Region getRegion(double deltaPhi) } } -#endif // UTILS_CORRELATIONS_H \ No newline at end of file +#endif // UTILS_CORRELATIONS_H From e37616016175f97e983d2bc7e1fb9471c1492c6c Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:21:58 +0800 Subject: [PATCH 32/78] Update taskCorrelationLcHadrons.cxx --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index 704e5f66c40..d0f4e5608c6 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -276,7 +276,7 @@ struct HfTaskCorrelationLcHadrons { default: break; } - }; + } // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { From f5fcd0e37a022e7a29f66321f1722a1ee898fb2e Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 12:26:31 +0800 Subject: [PATCH 33/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 8f2118465d3..648123e103a 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -12,8 +12,8 @@ /// \file utilsCorrelations.h /// \brief Utilities for HFC analyses -#ifndef UTILS_CORRELATIONS_H -#define UTILS_CORRELATIONS_H +#ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +#define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include #include @@ -36,4 +36,4 @@ Region getRegion(double deltaPhi) } } -#endif // UTILS_CORRELATIONS_H +#endif // PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ From 695c77e8a67c90bf87d203967b9152a23d9d7889 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:49:39 +0800 Subject: [PATCH 34/78] Update PWGHF/HFC/Utils/utilsCorrelations.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 648123e103a..602fad19c55 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -15,8 +15,8 @@ #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ -#include #include +#include enum Region { Default = 0, From 6f330f4310eef9612128773e620c777b0a044122 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:05:37 +0800 Subject: [PATCH 35/78] Add files via upload --- PWGHF/HFC/Utils/utilsCorrelations.h | 53 +++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 602fad19c55..6848ce55df2 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -10,14 +10,15 @@ // or submit itself to any jurisdiction. /// \file utilsCorrelations.h -/// \brief Utilities for HFC analyses +/// \brief Xu Wang -#ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ -#define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +#ifndef UTILS_CORRELATIONS_H +#define UTILS_CORRELATIONS_H #include -#include +namespace o2::analysis::hf_correlations +{ enum Region { Default = 0, Toward, @@ -25,7 +26,8 @@ enum Region { Transverse }; -Region getRegion(double deltaPhi) +template +Region getRegion(T deltaPhi) { if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { return Toward; @@ -36,4 +38,43 @@ Region getRegion(double deltaPhi) } } -#endif // PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +// Find Leading Particle +template +int findLeadingParticle(TTracks const& tracks) +{ + auto leadingParticle = tracks.begin(); + for (auto const& track : tracks) { + if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { + continue; + } + if (track.pt() > leadingParticle.pt()) { + leadingParticle = track; + } + } + int leadingIndex = leadingParticle.globalIndex(); + return leadingIndex; +} + +// ======= Find Leading Particle for McGen ============ +template +int findLeadingParticleMcGen(TMcParticles const& mcParticles, const float etaTrackMax, const float ptTrackMin) +{ + auto leadingParticle = mcParticles.begin(); + for (auto const& mcParticle : mcParticles) { + if (std::abs(mcParticle.eta()) > etaTrackMax) { + continue; + } + if (mcParticle.pt() < ptTrackMin) { + continue; + } + if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { + continue; + } + if (mcParticle.pt() > leadingParticle.pt()) { + leadingParticle = mcParticle; + } + } + return leadingParticle.globalIndex(); +} +} // namespace o2::analysis::hf_correlations +#endif // UTILS_CORRELATIONS_H \ No newline at end of file From 561541d8f21288fef9ac0738c0cebd0e9f401b5a Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:06:31 +0800 Subject: [PATCH 36/78] Add files via upload --- .../HFC/TableProducer/correlatorD0Hadrons.cxx | 42 ++----------------- .../HFC/TableProducer/correlatorLcHadrons.cxx | 42 ++----------------- 2 files changed, 6 insertions(+), 78 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 89465eb50b2..38a6be2ad14 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -30,12 +30,14 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/HFC/Utils/utilsCorrelations.h" using namespace o2; using namespace o2::analysis; using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::analysis::hf_correlations; /// /// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies @@ -264,44 +266,6 @@ struct HfCorrelatorD0Hadrons { registry.add("hCountD0TriggersGen", "D0 trigger particles - MC gen;;N of trigger D0", {HistType::kTH2F, {{1, -0.5, 0.5}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); } - // Find Leading Particle - template - int findLeadingParticle(TTracks const& tracks) - { - auto leadingParticle = tracks.begin(); - for (auto const& track : tracks) { - if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { - continue; - } - if (track.pt() > leadingParticle.pt()) { - leadingParticle = track; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } - // ======= Find Leading Particle for McGen ============ - template - int findLeadingParticleMcGen(TMcParticles const& mcParticles) - { - auto leadingParticle = mcParticles.begin(); - for (auto const& mcParticle : mcParticles) { - if (std::abs(mcParticle.eta()) > etaTrackMax) { - continue; - } - if (mcParticle.pt() < ptTrackMin) { - continue; - } - if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { - continue; - } - if (mcParticle.pt() > leadingParticle.pt()) { - leadingParticle = mcParticle; - } - } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; - } // ======= Process starts for Data, Same event ============ /// D0-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) @@ -629,7 +593,7 @@ struct HfCorrelatorD0Hadrons { // MC gen level // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticleMcGen(mcParticles); + leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax, ptTrackMin); } for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 17104a6d250..24f15143f5a 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -30,12 +30,14 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/HFC/Utils/utilsCorrelations.h" using namespace o2; using namespace o2::analysis; using namespace o2::constants::physics; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::analysis::hf_correlations; /// /// Returns deltaPhi values in range [-pi/2., 3.*pi/2.], typically used for correlation studies @@ -258,44 +260,6 @@ struct HfCorrelatorLcHadrons { corrBinning = {{binsZVtx, binsMultiplicity}, true}; } - // Find Leading Particle - template - int findLeadingParticle(TTracks const& tracks) - { - auto leadingParticle = tracks.begin(); - for (auto const& track : tracks) { - if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { - continue; - } - if (track.pt() > leadingParticle.pt()) { - leadingParticle = track; - } - } - return leadingParticle.globalIndex(); - } - - // ======= Find Leading Particle for McGen ============ - template - int findLeadingParticleMcGen(TMcParticles const& mcParticles) - { - auto leadingParticle = mcParticles.begin(); - for (auto const& mcParticle : mcParticles) { - if (std::abs(mcParticle.eta()) > etaTrackMax) { - continue; - } - if (mcParticle.pt() < ptTrackMin) { - continue; - } - if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { - continue; - } - if (mcParticle.pt() > leadingParticle.pt()) { - leadingParticle = mcParticle; - } - } - return leadingParticle.globalIndex(); - } - /// Lc-h correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via Mc truth) void processData(soa::Join::iterator const& collision, aod::TracksWDca const& tracks, @@ -586,7 +550,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticleMcGen(mcParticles); + leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax, ptTrackMin); } auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { From a4fd5516b7c5d440ba92248b14dd6f7cc32a3416 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:07:18 +0800 Subject: [PATCH 37/78] Add files via upload --- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 43 +++++++------------- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 3 +- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index f5f6b40d09d..f198af20797 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -30,6 +30,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod::hf_correlation_d0_hadron; +using namespace o2::analysis::hf_correlations; namespace o2::aod { @@ -268,35 +269,19 @@ struct HfTaskCorrelationD0Hadrons { continue; } Region region = getRegion(deltaPhi); - if (signalStatus == ParticleTypeData::D0Only || signalStatus == ParticleTypeData::D0D0barBoth) { - switch (region) { - case Toward: - registry.fill(HIST("hToward"), massD, ptD, isAutoCorrelated, efficiencyWeight); - break; - case Away: - registry.fill(HIST("hAway"), massD, ptD, isAutoCorrelated, efficiencyWeight); - break; - case Transverse: - registry.fill(HIST("hTransverse"), massD, ptD, isAutoCorrelated, efficiencyWeight); - break; - default: - break; - } - } - if (signalStatus == ParticleTypeData::D0barOnly || signalStatus == ParticleTypeData::D0D0barBoth) { - switch (region) { - case Toward: - registry.fill(HIST("hToward"), massD, ptD, isAutoCorrelated, efficiencyWeight); - break; - case Away: - registry.fill(HIST("hAway"), massD, ptD, isAutoCorrelated, efficiencyWeight); - break; - case Transverse: - registry.fill(HIST("hTransverse"), massD, ptD, isAutoCorrelated, efficiencyWeight); - break; - default: - break; - } + + switch (region) { + case Toward: + registry.fill(HIST("hToward"), massD, ptD, isAutoCorrelated, efficiencyWeight); + break; + case Away: + registry.fill(HIST("hAway"), massD, ptD, isAutoCorrelated, efficiencyWeight); + break; + case Transverse: + registry.fill(HIST("hTransverse"), massD, ptD, isAutoCorrelated, efficiencyWeight); + break; + default: + break; } } // check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index d0f4e5608c6..aca81b45fc1 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -27,6 +27,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::analysis::hf_correlations; /// /// Returns deltaPhi value in range [-pi/2., 3.*pi/2], typically used for correlation studies @@ -276,7 +277,7 @@ struct HfTaskCorrelationLcHadrons { default: break; } - } + }; // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { From fcc5986656acbe2a76ab0229cac3e67da075ffa1 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:09:55 +0800 Subject: [PATCH 38/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 6848ce55df2..b719f866349 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -77,4 +77,4 @@ int findLeadingParticleMcGen(TMcParticles const& mcParticles, const float etaTra return leadingParticle.globalIndex(); } } // namespace o2::analysis::hf_correlations -#endif // UTILS_CORRELATIONS_H \ No newline at end of file +#endif // UTILS_CORRELATIONS_H From f27a066b800ed34bd668e27dbc97b0d520b96b4f Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:15:02 +0800 Subject: [PATCH 39/78] Update taskCorrelationLcHadrons.cxx --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index aca81b45fc1..ab575ae994e 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -277,7 +277,7 @@ struct HfTaskCorrelationLcHadrons { default: break; } - }; + } // fill correlation plots for signal/bagkground correlations if (pairEntry.signalStatus()) { From 8f11ad6615e0ab93076cc9de11c6b30416ee9f42 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:15:47 +0800 Subject: [PATCH 40/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index b719f866349..62954e8025d 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -12,8 +12,8 @@ /// \file utilsCorrelations.h /// \brief Xu Wang -#ifndef UTILS_CORRELATIONS_H -#define UTILS_CORRELATIONS_H +#ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +#define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include @@ -77,4 +77,4 @@ int findLeadingParticleMcGen(TMcParticles const& mcParticles, const float etaTra return leadingParticle.globalIndex(); } } // namespace o2::analysis::hf_correlations -#endif // UTILS_CORRELATIONS_H +#endif // PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ From e0c2b91046b6a5862ba3c42af9474a76f4c10f75 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:43:12 +0800 Subject: [PATCH 41/78] Add files via upload --- PWGHF/HFC/Utils/utilsCorrelations.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 62954e8025d..85efaba08b1 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -56,8 +56,8 @@ int findLeadingParticle(TTracks const& tracks) } // ======= Find Leading Particle for McGen ============ -template -int findLeadingParticleMcGen(TMcParticles const& mcParticles, const float etaTrackMax, const float ptTrackMin) +template +int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 etaTrackMax, T2 ptTrackMin) { auto leadingParticle = mcParticles.begin(); for (auto const& mcParticle : mcParticles) { From aac7a2e78d9511d9218b75a4e9e6b4a8814fe564 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:51:56 +0800 Subject: [PATCH 42/78] Update PWGHF/HFC/Utils/utilsCorrelations.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 85efaba08b1..8e7359d1e72 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -57,7 +57,7 @@ int findLeadingParticle(TTracks const& tracks) // ======= Find Leading Particle for McGen ============ template -int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 etaTrackMax, T2 ptTrackMin) +int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 const etaTrackMax, T2 const ptTrackMin) { auto leadingParticle = mcParticles.begin(); for (auto const& mcParticle : mcParticles) { From cbde5975d72306b8db8ef60122aab46dd1dfdb81 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:26:56 +0800 Subject: [PATCH 43/78] Update PWGHF/HFC/Utils/utilsCorrelations.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 8e7359d1e72..1baa77c0a87 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -31,7 +31,7 @@ Region getRegion(T deltaPhi) { if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { return Toward; - } else if (deltaPhi > 2. * o2::constants::math::PI / 3. && deltaPhi < 4. * o2::constants::math::PI / 3.) { + } else if (deltaPhi > 2. * o2::constants::math::PIThird && deltaPhi < 4. * o2::constants::math::PIThird) { return Away; } else { return Transverse; From 68cdf15e2b6bbaa991fc6b26210e6c8b748b1a12 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:27:12 +0800 Subject: [PATCH 44/78] Update PWGHF/HFC/Utils/utilsCorrelations.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 1baa77c0a87..051a29a3982 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -29,7 +29,7 @@ enum Region { template Region getRegion(T deltaPhi) { - if (std::abs(deltaPhi) < o2::constants::math::PI / 3.) { + if (std::abs(deltaPhi) < o2::constants::math::PIThird) { return Toward; } else if (deltaPhi > 2. * o2::constants::math::PIThird && deltaPhi < 4. * o2::constants::math::PIThird) { return Away; From 2daaed131d4aaae9d1a9e885a6c311620dc990aa Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:29:35 +0800 Subject: [PATCH 45/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 051a29a3982..b6dc889f991 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -57,7 +57,7 @@ int findLeadingParticle(TTracks const& tracks) // ======= Find Leading Particle for McGen ============ template -int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 const etaTrackMax, T2 const ptTrackMin) +int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 etaTrackMax, T2 ptTrackMin) { auto leadingParticle = mcParticles.begin(); for (auto const& mcParticle : mcParticles) { From 2aaf12e901c3edbc8302f2622272cf9a7b8f56e8 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:57:30 +0800 Subject: [PATCH 46/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index b6dc889f991..4704357fd49 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file utilsCorrelations.h -/// \brief Xu Wang +/// \author Xu Wang #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ From edb5a0c49a243e2fb6d55a16229adea0698679d9 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:10:17 +0800 Subject: [PATCH 47/78] Add files via upload --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 4 ++-- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 38a6be2ad14..8a34e8b3071 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -279,7 +279,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); + leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -423,7 +423,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); + leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 24f15143f5a..42c7e32c88e 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -272,7 +272,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); + leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -398,7 +398,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks); + leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); From df5a2d9f21397c7e8a1ce4cebaa40420a0e30143 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:11:13 +0800 Subject: [PATCH 48/78] Add files via upload --- PWGHF/HFC/Utils/utilsCorrelations.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 4704357fd49..6021e188bd6 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -16,6 +16,7 @@ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include +#include namespace o2::analysis::hf_correlations { @@ -39,12 +40,12 @@ Region getRegion(T deltaPhi) } // Find Leading Particle -template -int findLeadingParticle(TTracks const& tracks) +template +int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const dcaZTrackMax) { auto leadingParticle = tracks.begin(); for (auto const& track : tracks) { - if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) { + if (std::abs(track.dcaXY()) >= dcaXYTrackMax.value || std::abs(track.dcaZ()) >= dcaZTrackMax.value) { continue; } if (track.pt() > leadingParticle.pt()) { @@ -57,14 +58,14 @@ int findLeadingParticle(TTracks const& tracks) // ======= Find Leading Particle for McGen ============ template -int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 etaTrackMax, T2 ptTrackMin) +int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 const etaTrackMax, T2 const ptTrackMin) { auto leadingParticle = mcParticles.begin(); for (auto const& mcParticle : mcParticles) { - if (std::abs(mcParticle.eta()) > etaTrackMax) { + if (std::abs(mcParticle.eta()) > etaTrackMax.value) { continue; } - if (mcParticle.pt() < ptTrackMin) { + if (mcParticle.pt() < ptTrackMin.value) { continue; } if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { From 3b7d85d9db11298532e535bf7a782e710404faf1 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:16:55 +0800 Subject: [PATCH 49/78] Add files via upload --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 4 ++-- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 8a34e8b3071..e714bea78b8 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -279,7 +279,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -423,7 +423,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 42c7e32c88e..bf61fa63ec7 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -272,7 +272,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -398,7 +398,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks,dcaXYTrackMax,dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); From cc7e0fbe9572dc1bb5f13fbf25b0947eb39c60bc Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:26:08 +0800 Subject: [PATCH 50/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 6021e188bd6..0aeecee26b5 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -10,6 +10,7 @@ // or submit itself to any jurisdiction. /// \file utilsCorrelations.h +/// \brief Utilities for HF analyses /// \author Xu Wang #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ From 255d5fe6521147b6692c52d20dff77a4c692595b Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:20:15 +0800 Subject: [PATCH 51/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 0aeecee26b5..f3937e76caa 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -10,7 +10,7 @@ // or submit itself to any jurisdiction. /// \file utilsCorrelations.h -/// \brief Utilities for HF analyses +/// \brief Utilities for HFC analyses /// \author Xu Wang #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ From f3928022ebb2c63fae28de76ffbf68474fa458e4 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:32:42 +0800 Subject: [PATCH 52/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index f3937e76caa..b163e2fca4b 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -16,6 +16,7 @@ #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +#include "CommonConstants/PhysicsConstants.h" #include #include From 0a3dfc58b9967349ffcad78ea14d3fb0a80f6247 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:43:26 +0800 Subject: [PATCH 53/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index b163e2fca4b..3993d5e9e4a 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -47,7 +47,7 @@ int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const { auto leadingParticle = tracks.begin(); for (auto const& track : tracks) { - if (std::abs(track.dcaXY()) >= dcaXYTrackMax.value || std::abs(track.dcaZ()) >= dcaZTrackMax.value) { + if (std::abs(track.dcaXY()) >= dcaXYTrackMax || std::abs(track.dcaZ()) >= dcaZTrackMax) { continue; } if (track.pt() > leadingParticle.pt()) { @@ -64,10 +64,10 @@ int findLeadingParticleMcGen(TMcParticles const& mcParticles, T1 const etaTrackM { auto leadingParticle = mcParticles.begin(); for (auto const& mcParticle : mcParticles) { - if (std::abs(mcParticle.eta()) > etaTrackMax.value) { + if (std::abs(mcParticle.eta()) > etaTrackMax) { continue; } - if (mcParticle.pt() < ptTrackMin.value) { + if (mcParticle.pt() < ptTrackMin) { continue; } if ((std::abs(mcParticle.pdgCode()) != kElectron) && (std::abs(mcParticle.pdgCode()) != kMuonMinus) && (std::abs(mcParticle.pdgCode()) != kPiPlus) && (std::abs(mcParticle.pdgCode()) != kKPlus) && (std::abs(mcParticle.pdgCode()) != kProton)) { From 2cce6cbf5629fade9f37c0f636806579031fc08d Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:45:17 +0800 Subject: [PATCH 54/78] Update correlatorD0Hadrons.cxx --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index e714bea78b8..5cf58b651e9 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -279,7 +279,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -423,7 +423,7 @@ struct HfCorrelatorD0Hadrons { } // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); int nTracks = 0; @@ -593,7 +593,7 @@ struct HfCorrelatorD0Hadrons { // MC gen level // find leading particle if (correlateD0WithLeadingParticle) { - leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax, ptTrackMin); + leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax.value, ptTrackMin.value); } for (const auto& particle1 : mcParticles) { // check if the particle is D0 or D0bar (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! From c0d1ad04a48f9d06e24d6fe11d18ca26a748b0ed Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:46:28 +0800 Subject: [PATCH 55/78] Update correlatorLcHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index bf61fa63ec7..0dbfde592c3 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -272,7 +272,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -398,7 +398,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax); + leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax.value, dcaZTrackMax.value); } int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M())); @@ -550,7 +550,7 @@ struct HfCorrelatorLcHadrons { // find leading particle if (correlateLcWithLeadingParticle) { - leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax, ptTrackMin); + leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax.value, ptTrackMin.value); } auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) { From 1961dd65b9b869e0aadc86c83ecace5e9a869f56 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:52:03 +0800 Subject: [PATCH 56/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 3993d5e9e4a..10d64e6962d 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -54,8 +54,7 @@ int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const leadingParticle = track; } } - int leadingIndex = leadingParticle.globalIndex(); - return leadingIndex; + return leadingParticle.globalIndex(); } // ======= Find Leading Particle for McGen ============ From d3234ef535b76e1d5f220912ff169351e1e058c1 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:58:57 +0800 Subject: [PATCH 57/78] Add files via upload --- PWGHF/HFC/Utils/utilsCorrelations.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 10d64e6962d..b797b8657dc 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -17,8 +17,8 @@ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include "CommonConstants/PhysicsConstants.h" -#include #include +#include namespace o2::analysis::hf_correlations { @@ -30,7 +30,7 @@ enum Region { }; template -Region getRegion(T deltaPhi) +Region getRegion(T const deltaPhi) { if (std::abs(deltaPhi) < o2::constants::math::PIThird) { return Toward; @@ -41,7 +41,7 @@ Region getRegion(T deltaPhi) } } -// Find Leading Particle +// ========= Find Leading Particle ============== template int findLeadingParticle(TTracks const& tracks, T1 const dcaXYTrackMax, T2 const dcaZTrackMax) { From 839ee139924bfec6413df231174cab57ca485331 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:19:42 +0800 Subject: [PATCH 58/78] Add files via upload From e96231dea13e3dfbf973bd89dea78e4dbd948a28 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:24:41 +0800 Subject: [PATCH 59/78] Add files via upload From dd4602cf442f162f035e9702180b809507b5034c Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:29:44 +0800 Subject: [PATCH 60/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index b797b8657dc..77f7b1374dd 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -16,7 +16,6 @@ #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ -#include "CommonConstants/PhysicsConstants.h" #include #include From 51cf5bec06495aa2f38c94f231ac946922a00d5e Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:33:43 +0800 Subject: [PATCH 61/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 77f7b1374dd..b797b8657dc 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -16,6 +16,7 @@ #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +#include "CommonConstants/PhysicsConstants.h" #include #include From d486ef0fb1065202b8880954cb5376c6974ca51c Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:44:42 +0800 Subject: [PATCH 62/78] Update CorrelationTables.h --- PWGHF/HFC/DataModel/CorrelationTables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 4609b21df95..9ed03f92402 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -38,7 +38,7 @@ DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); } // namespace hf_correlation_d_dbar DECLARE_SOA_TABLE(DDbarPair, "AOD", "DDBARPAIR", - aod::hf_correlation_d_dbar::DeltaPhi, + aod::hf_correlation_d_dbar::DeltaPhi, aod::hf_correlation_d_dbar::DeltaEta, aod::hf_correlation_d_dbar::PtD, aod::hf_correlation_d_dbar::PtDbar); From 3d22ea68ed054a3a12c92f34fa3b68e41bdae230 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:46:32 +0800 Subject: [PATCH 63/78] Update CorrelationTables.h --- PWGHF/HFC/DataModel/CorrelationTables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/DataModel/CorrelationTables.h b/PWGHF/HFC/DataModel/CorrelationTables.h index 9ed03f92402..4609b21df95 100644 --- a/PWGHF/HFC/DataModel/CorrelationTables.h +++ b/PWGHF/HFC/DataModel/CorrelationTables.h @@ -38,7 +38,7 @@ DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); } // namespace hf_correlation_d_dbar DECLARE_SOA_TABLE(DDbarPair, "AOD", "DDBARPAIR", - aod::hf_correlation_d_dbar::DeltaPhi, + aod::hf_correlation_d_dbar::DeltaPhi, aod::hf_correlation_d_dbar::DeltaEta, aod::hf_correlation_d_dbar::PtD, aod::hf_correlation_d_dbar::PtDbar); From 7e7a32dbeb181be6b44c9311fb9e018b0e5c722b Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:58:02 +0800 Subject: [PATCH 64/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index b797b8657dc..e229057a7be 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -17,8 +17,8 @@ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include "CommonConstants/PhysicsConstants.h" -#include #include +#include namespace o2::analysis::hf_correlations { From 1d8d2d9bc9157cf18fb436b07959eacc4fb53e80 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:03:49 +0800 Subject: [PATCH 65/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index e229057a7be..9cb25741bab 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -16,7 +16,6 @@ #ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ -#include "CommonConstants/PhysicsConstants.h" #include #include From f6ffa1fa95539b7100b5d6c6b636cc82ff92e0fb Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:08:59 +0800 Subject: [PATCH 66/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index 9cb25741bab..ed99e0b0d4a 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -17,6 +17,7 @@ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include +#include "CommonConstants/PhysicsConstants.h" #include namespace o2::analysis::hf_correlations From add0904472966413ad4db3bcd15acad3ea318f9d Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 21:27:37 +0800 Subject: [PATCH 67/78] Update utilsCorrelations.h From dbb7606aa3c19ffff75238f029a10e2cc3ffecce Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 21:35:38 +0800 Subject: [PATCH 68/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index ed99e0b0d4a..a25c6c7a205 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -13,7 +13,7 @@ /// \brief Utilities for HFC analyses /// \author Xu Wang -#ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +# ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include From e5e0871acda2f5509cad8477bcd028bacd2fa704 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 21:37:06 +0800 Subject: [PATCH 69/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index a25c6c7a205..ed99e0b0d4a 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -13,7 +13,7 @@ /// \brief Utilities for HFC analyses /// \author Xu Wang -# ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ +#ifndef PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include From 7c8975789d3e9be5a259503e0611524b52604966 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:12:31 +0800 Subject: [PATCH 70/78] Update correlatorD0Hadrons.cxx --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 5cf58b651e9..1df0b42909b 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -31,6 +31,7 @@ #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" +#include using namespace o2; using namespace o2::analysis; From b2a4ba6839200d99f45009671677571afc01be38 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:30:39 +0800 Subject: [PATCH 71/78] Update correlatorD0Hadrons.cxx --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 1df0b42909b..0a5da2063ea 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -25,13 +25,13 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" +#include #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" -#include using namespace o2; using namespace o2::analysis; From 28d8b2166dc2ad3b57562a348f584f4182036a95 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:34:06 +0800 Subject: [PATCH 72/78] Update correlatorD0Hadrons.cxx --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 0a5da2063ea..3518b019d11 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -19,13 +19,13 @@ #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" +#include #include "Common/Core/TrackSelection.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" From 096e648893d7db374791d55fbc48657476ebb8a4 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Thu, 31 Oct 2024 22:40:30 +0800 Subject: [PATCH 73/78] Update correlatorD0Hadrons.cxx --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index 3518b019d11..a1b33b939bf 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -19,7 +19,6 @@ #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" -#include #include "Common/Core/TrackSelection.h" #include "Common/DataModel/Centrality.h" @@ -33,6 +32,8 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" +#include + using namespace o2; using namespace o2::analysis; using namespace o2::constants::physics; From 7521b2e8b79ac862d5f001c0e7c2b0604b4ad5cb Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:27:53 +0800 Subject: [PATCH 74/78] Update correlatorD0Hadrons.cxx --- PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index a1b33b939bf..3d8bf16dd31 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -15,6 +15,8 @@ /// \author Samrangy Sadhu , INFN Bari /// \author Swapnesh Santosh Khade , IIT Indore +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" @@ -32,8 +34,6 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/HFC/Utils/utilsCorrelations.h" -#include - using namespace o2; using namespace o2::analysis; using namespace o2::constants::physics; From a3bb0c32b677c90941e8aa77e2260482a9e42b92 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:32:28 +0800 Subject: [PATCH 75/78] Update correlatorLcHadrons.cxx --- PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx index 0dbfde592c3..a2f57e21a9f 100644 --- a/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx @@ -15,6 +15,8 @@ /// \author Marianna Mazzilli /// \author Zhen Zhang +#include + #include "CommonConstants/PhysicsConstants.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" From 983ae66487e764804bde4241f1d69f225673164b Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:32:47 +0800 Subject: [PATCH 76/78] Update taskCorrelationD0Hadrons.cxx --- PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx index f198af20797..416460e4689 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx @@ -16,6 +16,8 @@ /// \author Samrangy Sadhu , INFN Bari /// \author Swapnesh Santosh Khade , IIT Indore +#include + #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" From ab227c2e86de917c9482c7466d91e8c3d08d1774 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:33:10 +0800 Subject: [PATCH 77/78] Update taskCorrelationLcHadrons.cxx --- PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx index ab575ae994e..3acc221d30f 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx @@ -14,6 +14,8 @@ /// \author Marianna Mazzilli /// \author Zhen Zhang +#include + #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" From f0a6fc7498752e782028f2a5e42bf14b3a782de9 Mon Sep 17 00:00:00 2001 From: Xu wang <113404602+1481014945@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:37:37 +0800 Subject: [PATCH 78/78] Update utilsCorrelations.h --- PWGHF/HFC/Utils/utilsCorrelations.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGHF/HFC/Utils/utilsCorrelations.h b/PWGHF/HFC/Utils/utilsCorrelations.h index ed99e0b0d4a..0c214cb1c6f 100644 --- a/PWGHF/HFC/Utils/utilsCorrelations.h +++ b/PWGHF/HFC/Utils/utilsCorrelations.h @@ -17,9 +17,10 @@ #define PWGHF_HFC_UTILS_UTILSCORRELATIONS_H_ #include -#include "CommonConstants/PhysicsConstants.h" #include +#include "CommonConstants/PhysicsConstants.h" + namespace o2::analysis::hf_correlations { enum Region {