Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWGHF: Add finding leading particle in correlatorLcHadrons #8183

Open
wants to merge 50 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b7fe5f0
Add files via upload
1481014945 Sep 18, 2024
fe51b5c
Delete correlatorD0Hadrons.cxx
1481014945 Sep 18, 2024
aee2cc9
Add files via upload
1481014945 Sep 18, 2024
dce95e3
Add files via upload
1481014945 Sep 18, 2024
bbb77f0
Add files via upload
1481014945 Sep 18, 2024
3ee34b0
Merge branch 'AliceO2Group:master' into master
1481014945 Oct 28, 2024
9abfe22
Add files via upload
1481014945 Oct 28, 2024
116a8e8
Add files via upload
1481014945 Oct 28, 2024
03cc985
Add files via upload
1481014945 Oct 28, 2024
1b38757
Delete PWGHF/HFC/DataModel/correlatorLcHadrons.cxx
1481014945 Oct 28, 2024
3baaa60
Delete PWGHF/HFC/DataModel/taskCorrelationLcHadrons.cxx
1481014945 Oct 28, 2024
9e62442
Add files via upload
1481014945 Oct 28, 2024
34af6aa
Add files via upload
1481014945 Oct 28, 2024
d0f102b
Add files via upload
1481014945 Oct 28, 2024
e252472
Add files via upload
1481014945 Oct 28, 2024
67785fb
Add files via upload
1481014945 Oct 28, 2024
9223864
Add files via upload
1481014945 Oct 28, 2024
f786781
Add files via upload
1481014945 Oct 28, 2024
13f7d6f
Add files via upload
1481014945 Oct 28, 2024
c8d5685
Add files via upload
1481014945 Oct 28, 2024
2e05b4c
Update PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx
1481014945 Oct 28, 2024
0bc1442
Update PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx
1481014945 Oct 28, 2024
071a32f
Update taskCorrelationLcHadrons.cxx
1481014945 Oct 28, 2024
2d2d070
Update PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx
1481014945 Oct 28, 2024
db40ff3
Create utilsCorrelations.h
1481014945 Oct 29, 2024
65397d1
Add files via upload
1481014945 Oct 29, 2024
6e51674
Add files via upload
1481014945 Oct 29, 2024
12ce305
Add files via upload
1481014945 Oct 29, 2024
aa65ff0
Add files via upload
1481014945 Oct 29, 2024
5c398ea
Delete utilsCorrelations.h
1481014945 Oct 29, 2024
8d3652f
Add files via upload
1481014945 Oct 29, 2024
4736d2d
Update utilsCorrelations.h
1481014945 Oct 29, 2024
e376160
Update taskCorrelationLcHadrons.cxx
1481014945 Oct 29, 2024
f5fcd0e
Update utilsCorrelations.h
1481014945 Oct 29, 2024
695c77e
Update PWGHF/HFC/Utils/utilsCorrelations.h
1481014945 Oct 29, 2024
6f330f4
Add files via upload
1481014945 Oct 29, 2024
561541d
Add files via upload
1481014945 Oct 29, 2024
a4fd551
Add files via upload
1481014945 Oct 29, 2024
fcc5986
Update utilsCorrelations.h
1481014945 Oct 29, 2024
f27a066
Update taskCorrelationLcHadrons.cxx
1481014945 Oct 29, 2024
8f11ad6
Update utilsCorrelations.h
1481014945 Oct 29, 2024
e0c2b91
Add files via upload
1481014945 Oct 29, 2024
aac7a2e
Update PWGHF/HFC/Utils/utilsCorrelations.h
1481014945 Oct 29, 2024
cbde597
Update PWGHF/HFC/Utils/utilsCorrelations.h
1481014945 Oct 29, 2024
68cdf15
Update PWGHF/HFC/Utils/utilsCorrelations.h
1481014945 Oct 29, 2024
2daaed1
Update utilsCorrelations.h
1481014945 Oct 29, 2024
2aaf12e
Update utilsCorrelations.h
1481014945 Oct 29, 2024
edb5a0c
Add files via upload
1481014945 Oct 29, 2024
df5a2d9
Add files via upload
1481014945 Oct 29, 2024
3b7d85d
Add files via upload
1481014945 Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions PWGHF/HFC/DataModel/CorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,23 @@ 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

DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informations
aod::hf_correlation_lc_hadron::DeltaPhi,
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,
Expand Down
46 changes: 5 additions & 41 deletions PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <typename TTracks>
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 <typename TMcParticles>
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)
Expand All @@ -315,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()));
Expand Down Expand Up @@ -459,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;
Expand Down Expand Up @@ -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!
Expand Down
89 changes: 76 additions & 13 deletions PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -189,10 +191,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<bool> storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"};
Configurable<bool> 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;
Expand Down Expand Up @@ -263,6 +269,12 @@ struct HfCorrelatorLcHadrons {
if (selectedLcCandidates.size() == 0) {
return;
}

// find leading particle
if (correlateLcWithLeadingParticle) {
leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax);
}

int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M()));
int nTracks = 0;
if (collision.numContrib() > 1) {
Expand Down Expand Up @@ -335,24 +347,37 @@ 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) {
entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()),
track.eta() - candidate.eta(),
candidate.pt(),
track.pt(),
poolBin);
poolBin,
correlationStatus);
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false);
}
} // Hadron Tracks loop
Expand All @@ -370,6 +395,12 @@ struct HfCorrelatorLcHadrons {
if (selectedLcCandidatesMc.size() == 0) {
return;
}

// find leading particle
if (correlateLcWithLeadingParticle) {
leadingIndex = findLeadingParticle(tracks, dcaXYTrackMax, dcaZTrackMax);
}

int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M()));
int nTracks = 0;
if (collision.numContrib() > 1) {
Expand Down Expand Up @@ -472,24 +503,35 @@ 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) {
entryLcHadronPair(getDeltaPhi(track.phi(), candidate.phi()),
track.eta() - candidate.eta(),
candidate.pt(),
track.pt(),
poolBin);
poolBin,
correlationStatus);
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal);
}
} // end inner loop (Tracks)
Expand All @@ -506,6 +548,11 @@ struct HfCorrelatorLcHadrons {
int counterLcHadron = 0;
registry.fill(HIST("hMcEvtCount"), 0);

// find leading particle
if (correlateLcWithLeadingParticle) {
leadingIndex = findLeadingParticleMcGen(mcParticles, etaTrackMax, ptTrackMin);
}

auto getTracksSize = [&mcParticles](aod::McCollision const& /*collision*/) {
int nTracks = 0;
for (const auto& track : mcParticles) {
Expand Down Expand Up @@ -556,15 +603,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
}
Expand Down Expand Up @@ -600,15 +658,17 @@ struct HfCorrelatorLcHadrons {
t1.eta() - t2.eta(),
t1.pt(),
t2.pt(),
poolBin);
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);
poolBin,
correlationStatus);
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false);
}
}
Expand All @@ -634,15 +694,17 @@ struct HfCorrelatorLcHadrons {
t1.eta() - t2.eta(),
t1.pt(),
t2.pt(),
poolBin);
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);
poolBin,
correlationStatus);
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(t1), false);
}
}
Expand Down Expand Up @@ -696,7 +758,8 @@ struct HfCorrelatorLcHadrons {
t1.eta() - t2.eta(),
t1.pt(),
t2.pt(),
poolBin);
poolBin,
correlationStatus);
}
}
}
Expand Down
Loading
Loading