Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
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
4 changes: 3 additions & 1 deletion PWGHF/HFC/DataModel/CorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ DECLARE_SOA_COLUMN(IsSignal, isSignal, bool); //! U
DECLARE_SOA_COLUMN(IsPrompt, isPrompt, bool); //! Used in MC-Rec, Lc Prompt or Non-Prompt
DECLARE_SOA_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, bool); //! Used in MC-Rec, primary associated particles
DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status
DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality of Collision
DECLARE_SOA_COLUMN(PrNsigmTPC, prNsigmTPC, float); //! Associated Particle TPC nSigma proton
DECLARE_SOA_COLUMN(KaNsigmTPC, kaNsigmTPC, float); //! Associated Particle TPC nSigma Kaon
DECLARE_SOA_COLUMN(PiNsigmTPC, piNsigmTPC, float); //! Associated Particle TPC nSigma Pion
Expand All @@ -175,7 +176,8 @@ DECLARE_SOA_TABLE(LcHadronPair, "AOD", "LCHPAIR", //! Lc-Hadrons pairs Informati
aod::hf_correlation_lc_hadron::PtLc,
aod::hf_correlation_lc_hadron::PtHadron,
aod::hf_correlation_lc_hadron::PoolBin,
aod::hf_correlation_lc_hadron::IsAutoCorrelated);
aod::hf_correlation_lc_hadron::IsAutoCorrelated,
aod::hf_correlation_lc_hadron::Cent);

DECLARE_SOA_TABLE(LcHadronRecoInfo, "AOD", "LCHRECOINFO", //! Lc-Hadrons pairs Reconstructed Informations
aod::hf_correlation_lc_hadron::MLc,
Expand Down
79 changes: 61 additions & 18 deletions PWGHF/HFC/TableProducer/correlatorLcHadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "Common/CCDB/EventSelectionParams.h"
#include "Common/Core/RecoDecay.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponseTOF.h"
Expand Down Expand Up @@ -65,7 +66,6 @@ using namespace o2::constants::math;
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 All @@ -88,11 +88,13 @@ struct HfCorrelatorLcHadronsSelection {
Configurable<int> selectionFlagLc{"selectionFlagLc", 1, "Selection Flag for Lc"};
Configurable<float> yCandMax{"yCandMax", 0.8, "max. cand. rapidity"};
Configurable<float> ptCandMin{"ptCandMin", 1., "min. cand. pT"};
Configurable<float> centMin{"centMin", 0., "Minimum Centrality"};
Configurable<float> centMax{"centMax", 100., "Maximum Centrality"};

HfHelper hfHelper;
SliceCache cache;

using SelCollisions = soa::Join<aod::Collisions, aod::EvSels>;
using SelCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>;
using CandidatesLcData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelLc>>;
using CandidatesLcMcRec = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelLc, aod::HfCand3ProngMcRec>>;
using CandidatesLcMcGen = soa::Join<aod::McParticles, aod::HfCand3ProngMcGen>;
Expand All @@ -108,6 +110,7 @@ struct HfCorrelatorLcHadronsSelection {
bool isLcFound = true;
bool isSel8 = true;
bool isNosameBunchPileUp = true;
bool isCentInRange = false;
if (doSelLcCollision) {
for (const auto& candidate : candidates) {
if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin) {
Expand All @@ -118,13 +121,18 @@ struct HfCorrelatorLcHadronsSelection {
break;
}
}

float cent = collision.centFT0M();

Comment thread
vkucera marked this conversation as resolved.
if (useSel8) {
isSel8 = collision.sel8();
}
if (selNoSameBunchPileUpColl) {
isNosameBunchPileUp = static_cast<bool>(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup));
}
isSelColl = isLcFound && isSel8 && isNosameBunchPileUp;

isCentInRange = (cent >= centMin && cent < centMax);
isSelColl = isLcFound && isSel8 && isNosameBunchPileUp && isCentInRange;
lcSel(isSelColl);
}
PROCESS_SWITCH(HfCorrelatorLcHadronsSelection, processLcSelectionData, "Process Lc Collision Selection Data", true);
Expand Down Expand Up @@ -226,6 +234,7 @@ struct HfCorrelatorLcHadrons {
Configurable<bool> isRecTrkPhyPrimary{"isRecTrkPhyPrimary", true, "Calculate the efficiency of reconstructed primary physical tracks"};
Configurable<bool> calEffLcEvent{"calEffLcEvent", true, "Calculate the efficiency of Lc candidate"};
Configurable<float> eventFractionToAnalyze{"eventFractionToAnalyze", -1, "Fraction of events to analyze (use only for ME offline on very large samples)"};
Configurable<bool> isMultiplicityDependent{"isMultiplicityDependent", false, "Flag for multiplicity dependent analyses"};

HfHelper hfHelper;
SliceCache cache;
Expand All @@ -236,7 +245,7 @@ struct HfCorrelatorLcHadrons {
TRandom3* rnd = new TRandom3(0);

// Event Mixing for the Data Mode
using SelCollisionsWithLc = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection>>;
using SelCollisionsWithLc = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::EvSels, aod::LcSelection, aod::CentFT0Ms>>;
using SelCollisionsWithLcMc = soa::Filtered<soa::Join<aod::McCollisions, aod::LcSelection, aod::MultsExtraMC>>; // collisionFilter applied
using CandidatesLcData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelLc, aod::HfMlLcToPKPi>>;
// Event Mixing for the MCRec Mode
Expand Down Expand Up @@ -267,6 +276,7 @@ struct HfCorrelatorLcHadrons {
ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"};
ConfigurableAxis binsMultFT0M{"binsMultFT0M", {600, 0., 6000.}, "Multiplicity as FT0M signal amplitude"};
ConfigurableAxis binsMassLc{"binsMassLc", {200, 1.98, 2.58}, "inv. mass (p K #pi) (GeV/#it{c}^{2})"};
ConfigurableAxis binsCentFt0m{"binsCentFt0m", {100, 0., 100.}, "Centrality percentile (FT0M)"};

BinningType corrBinning{{binsZVtx, binsMultiplicity}, true};

Expand All @@ -286,6 +296,7 @@ struct HfCorrelatorLcHadrons {
AxisSpec axisPoolBin = {binsPoolBin, "PoolBin"};
AxisSpec axisRapidity = {100, -2, 2, "Rapidity"};
AxisSpec axisSign = {2, -1, 1, "Sign"};
AxisSpec axisCent = {binsCentFt0m, "Centrality"};

registry.add("hPtCand", "Lc,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}});
registry.add("hPtProng0", "Lc,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {axisPtLc}});
Expand All @@ -301,9 +312,14 @@ struct HfCorrelatorLcHadrons {
registry.add("hMultiplicity", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}});
registry.add("hMultFT0M", "multiplicity;multiplicity;entries", {HistType::kTH1F, {{10000, 0., 10000.}}});
registry.add("hZvtx", "z vertex;z vertex;entries", {HistType::kTH1F, {{200, -20., 20.}}});
registry.add("hCentFT0M", "Centrality FT0M; Centrality;entries", {HistType::kTH1D, {{100, 0., 100.}}});
registry.add("hLcBin", "Lc selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}});
registry.add("hTracksBin", "Tracks selected in pool Bin;pool Bin;entries", {HistType::kTH1F, {{9, 0., 9.}}});
registry.add("hMassLcVsPt", "Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}});
if (isMultiplicityDependent) {
registry.add("hMassLcVsPtvsmult", "Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH3F, {{axisMassLc}, {axisPtLc}, {axisCent}}});
Comment thread
vkucera marked this conversation as resolved.
Outdated
} else {
registry.add("hMassLcVsPt", "Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{axisMassLc}, {axisPtLc}}});
}
registry.add("hMassLcData", "Lc candidates;inv. mass (p K #pi) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{axisMassLc}}});
registry.add("hLcPoolBin", "Lc candidates pool bin", {HistType::kTH1F, {axisPoolBin}});
registry.add("hTracksPoolBin", "Particles associated pool bin", {HistType::kTH1F, {axisPoolBin}});
Expand Down Expand Up @@ -346,7 +362,6 @@ struct HfCorrelatorLcHadrons {
registry.add("hEtaMcGen", "Lc,Hadron particles - MC Gen", {HistType::kTH1F, {axisEta}});
registry.add("hPhiMcGen", "Lc,Hadron particles - MC Gen", {HistType::kTH1F, {axisPhi}});
registry.add("hMultFT0AMcGen", "Lc,Hadron multiplicity FT0A - MC Gen", {HistType::kTH1F, {axisMultiplicity}});

corrBinning = {{binsZVtx, binsMultiplicity}, true};
}

Expand Down Expand Up @@ -374,6 +389,8 @@ struct HfCorrelatorLcHadrons {
int gCollisionId = collision.globalIndex();
int64_t timeStamp = bc.timestamp();

float cent = collision.centFT0M();

int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFT0M()));
int nTracks = 0;
if (collision.numContrib() > 1) {
Expand Down Expand Up @@ -412,8 +429,13 @@ struct HfCorrelatorLcHadrons {
registry.fill(HIST("hPhi"), RecoDecay::constrainAngle(candidate.phi(), -PIHalf));
registry.fill(HIST("hY"), hfHelper.yLc(candidate));
registry.fill(HIST("hLcBin"), poolBin);

if (candidate.isSelLcToPKPi() >= selectionFlagLc) {
registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc);
if (isMultiplicityDependent) {
registry.fill(HIST("hMassLcVsPtvsmult"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), cent, efficiencyWeightLc);
} else {
registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc);
}
registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPKPi(candidate), efficiencyWeightLc);
registry.fill(HIST("hSelectionStatusLcToPKPi"), candidate.isSelLcToPKPi());
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
Expand All @@ -423,7 +445,11 @@ struct HfCorrelatorLcHadrons {
entryLc(candidate.phi(), candidate.eta(), candidate.pt() * chargeLc, hfHelper.invMassLcToPKPi(candidate), poolBin, gCollisionId, timeStamp);
}
if (candidate.isSelLcToPiKP() >= selectionFlagLc) {
registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPiKP(candidate), candidate.pt(), efficiencyWeightLc);
if (isMultiplicityDependent) {
registry.fill(HIST("hMassLcVsPtvsmult"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), cent, efficiencyWeightLc);
} else {
registry.fill(HIST("hMassLcVsPt"), hfHelper.invMassLcToPKPi(candidate), candidate.pt(), efficiencyWeightLc);
}
registry.fill(HIST("hMassLcData"), hfHelper.invMassLcToPiKP(candidate), efficiencyWeightLc);
registry.fill(HIST("hSelectionStatusLcToPiKP"), candidate.isSelLcToPiKP());
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
Expand Down Expand Up @@ -463,7 +489,8 @@ struct HfCorrelatorLcHadrons {
candidate.pt() * chargeLc,
track.pt() * track.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(track.rapidity(MassProton) - hfHelper.yLc(candidate)); // only for proton as of now
entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), false);
entryLcHadronGenInfo(false, false, 0);
Expand All @@ -479,7 +506,8 @@ struct HfCorrelatorLcHadrons {
candidate.pt() * chargeLc,
track.pt() * track.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(track.rapidity(MassProton) - hfHelper.yLc(candidate)); // only for proton as of now
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), false);
entryLcHadronGenInfo(false, false, 0);
Expand All @@ -503,6 +531,7 @@ struct HfCorrelatorLcHadrons {
} // end outer Lc loop
registry.fill(HIST("hZvtx"), collision.posZ());
registry.fill(HIST("hMultFT0M"), collision.multFT0M());
registry.fill(HIST("hCentFT0M"), cent);
}
PROCESS_SWITCH(HfCorrelatorLcHadrons, processData, "Process data", true);

Expand Down Expand Up @@ -667,6 +696,7 @@ struct HfCorrelatorLcHadrons {
}
//}
}
float cent = 100.0; // will be updated later

// Lc-Hadron correlation dedicated section
// if the candidate is selected as Lc, search for Hadron ad evaluate correlations
Expand Down Expand Up @@ -716,7 +746,8 @@ struct HfCorrelatorLcHadrons {
candidate.pt() * chargeLc,
track.pt() * track.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(track.rapidity(MassProton) - hfHelper.yLc(candidate)); // only for proton as of now
entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal);
if (fillTrkPID) {
Expand Down Expand Up @@ -746,7 +777,8 @@ struct HfCorrelatorLcHadrons {
candidate.pt() * chargeLc,
track.pt() * track.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(track.rapidity(MassProton) - hfHelper.yLc(candidate)); // only for proton as of now
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal);
if (fillTrkPID) {
Expand Down Expand Up @@ -790,6 +822,7 @@ struct HfCorrelatorLcHadrons {

bool isLcPrompt = false;
bool isLcNonPrompt = false;
float cent = 100.0; // will be updated later

// find leading particle
if (correlateLcWithLeadingParticle) {
Expand Down Expand Up @@ -878,7 +911,8 @@ struct HfCorrelatorLcHadrons {
particle.pt() * chargeLc / std::abs(chargeLc),
particleAssoc.pt() * chargeAssoc / std::abs(chargeAssoc),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(particleAssoc.y() - yL);
entryLcHadronRecoInfo(MassLambdaCPlus, true);
entryLcHadronGenInfo(isLcPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin);
Expand Down Expand Up @@ -911,6 +945,8 @@ struct HfCorrelatorLcHadrons {
auto trackPos1 = trigLc.template prong0_as<TracksData>(); // positive daughter (negative for the antiparticles)
int8_t chargeLc = trackPos1.sign(); // charge of 1st prong will be the charge of Lc candidate

float cent = 100.0; // will be updated later

std::vector<float> outputMl = {-1., -1., -1.};
// LcToPKPi and LcToPiKP division
if (trigLc.isSelLcToPKPi() >= selectionFlagLc) {
Expand All @@ -919,7 +955,8 @@ struct HfCorrelatorLcHadrons {
trigLc.pt() * chargeLc,
assocParticle.pt() * assocParticle.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(assocParticle.y() - hfHelper.yLc(trigLc));
entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(trigLc), false);
entryLcHadronGenInfo(false, false, 0);
Expand All @@ -938,7 +975,8 @@ struct HfCorrelatorLcHadrons {
trigLc.pt() * chargeLc,
assocParticle.pt() * assocParticle.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(assocParticle.y() - hfHelper.yLc(trigLc));
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(trigLc), false);
entryLcHadronGenInfo(false, false, 0);
Expand Down Expand Up @@ -1006,6 +1044,7 @@ struct HfCorrelatorLcHadrons {
registry.fill(HIST("hZvtx"), c1.posZ());
registry.fill(HIST("hTracksPoolBin"), poolBin);
registry.fill(HIST("hLcPoolBin"), poolBinLc);
float cent = 100.0; // will be updated later
for (const auto& [candidate, pAssoc] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
if (std::abs(hfHelper.yLc(candidate)) > yCandMax || candidate.pt() < ptCandMin || candidate.pt() > ptCandMax) {
continue;
Expand Down Expand Up @@ -1038,7 +1077,8 @@ struct HfCorrelatorLcHadrons {
candidate.pt() * chargeLc,
pAssoc.pt() * pAssoc.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(pAssoc.y() - hfHelper.yLc(candidate));
entryLcHadronRecoInfo(hfHelper.invMassLcToPKPi(candidate), isLcSignal);
entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin);
Expand All @@ -1057,7 +1097,8 @@ struct HfCorrelatorLcHadrons {
candidate.pt() * chargeLc,
pAssoc.pt() * pAssoc.sign(),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(pAssoc.y() - hfHelper.yLc(candidate));
entryLcHadronRecoInfo(hfHelper.invMassLcToPiKP(candidate), isLcSignal);
entryLcHadronGenInfo(isLcPrompt, isPhysicalPrimary, trackOrigin);
Expand Down Expand Up @@ -1105,6 +1146,7 @@ struct HfCorrelatorLcHadrons {
}
int8_t chargeLc = pdg->GetParticle(candidate.pdgCode())->Charge(); // Retrieve charge
int8_t chargeAssoc = pdg->GetParticle(particleAssoc.pdgCode())->Charge(); // Retrieve charge
float cent = 100.0; // will be updated later

int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true);
bool isLcPrompt = candidate.originMcGen() == RecoDecay::OriginType::Prompt;
Expand All @@ -1113,7 +1155,8 @@ struct HfCorrelatorLcHadrons {
candidate.pt() * chargeLc / std::abs(chargeLc),
particleAssoc.pt() * chargeAssoc / std::abs(chargeAssoc),
poolBin,
correlationStatus);
correlationStatus,
cent);
entryLcHadronPairY(particleAssoc.y() - yL);
entryLcHadronRecoInfo(MassLambdaCPlus, true);
entryLcHadronGenInfo(isLcPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin);
Expand Down
Loading
Loading