Skip to content

Commit

Permalink
PWGHF:Set the correlation status (AliceO2Group#6290)
Browse files Browse the repository at this point in the history
* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Delete PWGHF/DataModel/correlatorD0Hadrons.cxx

* Add files via upload

* Delete PWGHF/HFC/TableProducer/CorrelationTables.h

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload

* Add files via upload
  • Loading branch information
1481014945 authored May 30, 2024
1 parent ea70b68 commit d93d6c3
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 22 deletions.
20 changes: 11 additions & 9 deletions PWGHF/HFC/DataModel/CorrelationTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ DECLARE_SOA_TABLE(DDbarRecoInfo, "AOD", "DDBARRECOINFO",
// definition of columns and tables for D0-Hadron correlation pairs
namespace hf_correlation_d0_hadron
{
DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between D0 and Hadrons
DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between D0 and Hadrons
DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D0
DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron
DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D0
DECLARE_SOA_COLUMN(MDbar, mDbar, float); //! Invariant mass of D0bar
DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for D0,D0bar
DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent
DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between D0 and Hadrons
DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between D0 and Hadrons
DECLARE_SOA_COLUMN(PtD, ptD, float); //! Transverse momentum of D0
DECLARE_SOA_COLUMN(PtHadron, ptHadron, float); //! Transverse momentum of Hadron
DECLARE_SOA_COLUMN(MD, mD, float); //! Invariant mass of D0
DECLARE_SOA_COLUMN(MDbar, mDbar, float); //! Invariant mass of D0bar
DECLARE_SOA_COLUMN(SignalStatus, signalStatus, int); //! Tag for D0,D0bar
DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent
DECLARE_SOA_COLUMN(IsAutoCorrelated, isAutoCorrelated, bool); //! Correlation Status

enum ParticleTypeData {
D0Only = 1, // Identified as D0
Expand All @@ -85,7 +86,8 @@ DECLARE_SOA_TABLE(DHadronPair, "AOD", "DHADRONPAIR", //! D0-Hadrons pairs Inform
aod::hf_correlation_d0_hadron::DeltaEta,
aod::hf_correlation_d0_hadron::PtD,
aod::hf_correlation_d0_hadron::PtHadron,
aod::hf_correlation_d0_hadron::PoolBin);
aod::hf_correlation_d0_hadron::PoolBin,
aod::hf_correlation_d0_hadron::IsAutoCorrelated);

DECLARE_SOA_TABLE(DHadronRecoInfo, "AOD", "DHADRONRECOINFO", //! D0-Hadrons pairs Reconstructed Informations
aod::hf_correlation_d0_hadron::MD,
Expand Down
45 changes: 35 additions & 10 deletions PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ struct HfCorrelatorD0Hadrons {
Configurable<float> multMax{"multMax", 10000., "maximum multiplicity accepted"};
Configurable<float> ptSoftPionMax{"ptSoftPionMax", 3 * 800. * pow(10., -6.), "max. pT cut for soft pion identification"};
Configurable<bool> correlateD0WithLeadingParticle{"correlateD0WithLeadingParticle", false, "Switch for correlation of D0 mesons with leading particle only"};
Configurable<bool> storeAutoCorrelationFlag{"storeAutoCorrelationFlag", false, "Store flag that indicates if the track is paired to its D-meson mother instead of skipping it"};

HfHelper hfHelper;

Expand Down Expand Up @@ -367,8 +368,12 @@ struct HfCorrelatorD0Hadrons {
for (const auto& track : tracks) {
registry.fill(HIST("hTrackCounter"), 1); // fill total no. of tracks
// Remove D0 daughters by checking track indices
bool correlationStatus = false;
if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) {
continue;
if (!storeAutoCorrelationFlag) {
continue;
}
correlationStatus = true;
}
if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.)
continue; // Remove secondary tracks
Expand Down Expand Up @@ -416,7 +421,8 @@ struct HfCorrelatorD0Hadrons {
track.eta() - candidate1.eta(),
candidate1.pt(),
track.pt(),
poolBin);
poolBin,
correlationStatus);
entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus);

} // end inner loop (tracks)
Expand All @@ -435,6 +441,10 @@ struct HfCorrelatorD0Hadrons {
if (selectedD0candidatesMc.size() == 0) {
return;
}
// find leading particle
if (correlateD0WithLeadingParticle) {
leadingIndex = findLeadingParticle(tracks);
}
int poolBin = corrBinning.getBin(std::make_tuple(collision.posZ(), collision.multFV0M()));
int nTracks = 0;
if (collision.numContrib() > 1) {
Expand Down Expand Up @@ -526,8 +536,12 @@ struct HfCorrelatorD0Hadrons {
continue;
}
// Removing D0 daughters by checking track indices
bool correlationStatus = false;
if ((candidate1.prong0Id() == track.globalIndex()) || (candidate1.prong1Id() == track.globalIndex())) {
continue;
if (!storeAutoCorrelationFlag) {
continue;
}
correlationStatus = true;
}
if (std::abs(track.dcaXY()) >= 1. || std::abs(track.dcaZ()) >= 1.) {
continue; // Remove secondary tracks
Expand Down Expand Up @@ -558,6 +572,13 @@ struct HfCorrelatorD0Hadrons {

registry.fill(HIST("hTrackCounterRec"), 3); // fill no. of tracks after soft pion removal

if (correlateD0WithLeadingParticle) {
if (track.globalIndex() != leadingIndex) {
continue;
}
registry.fill(HIST("hTrackCounter"), 4); // fill no. of tracks have leading particle
}

int signalStatus = 0;
if (flagD0 && (candidate1.isSelD0() >= selectionFlagD0) && !isSoftPiD0) {
SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::D0Sig);
Expand All @@ -583,7 +604,8 @@ struct HfCorrelatorD0Hadrons {
track.eta() - candidate1.eta(),
candidate1.pt(),
track.pt(),
poolBin);
poolBin,
correlationStatus);
entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(candidate1), hfHelper.invMassD0barToKPi(candidate1), signalStatus);
} // end inner loop (Tracks)
} // end of outer loop (D0)
Expand Down Expand Up @@ -660,11 +682,13 @@ struct HfCorrelatorD0Hadrons {
BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zBins, multBinsMcGen}, true};
int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), getTracksSize(mcCollision)));

bool correlationStatus = false;
entryD0HadronPair(getDeltaPhi(particle2.phi(), particle1.phi()),
particle2.eta() - particle1.eta(),
particle1.pt(),
particle2.pt(),
poolBin);
poolBin,
correlationStatus);
entryD0HadronRecoInfo(massD0, massD0, 0); // dummy info
} // end inner loop (Tracks)
} // end outer loop (D0)
Expand Down Expand Up @@ -727,8 +751,8 @@ struct HfCorrelatorD0Hadrons {
signalStatus += aod::hf_correlation_d0_hadron::ParticleTypeData::D0barOnlySoftPi;
}
}

entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin);
bool correlationStatus = false;
entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin, correlationStatus);
entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(t1), hfHelper.invMassD0barToKPi(t1), signalStatus);
}
}
Expand Down Expand Up @@ -827,9 +851,9 @@ struct HfCorrelatorD0Hadrons {
SETBIT(signalStatus, aod::hf_correlation_d0_hadron::ParticleTypeMcRec::SoftPi);
}
} // background case D0bar

registry.fill(HIST("hSignalStatusMERec"), signalStatus);
entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin);
bool correlationStatus = false;
entryD0HadronPair(getDeltaPhi(t1.phi(), t2.phi()), t1.eta() - t2.eta(), t1.pt(), t2.pt(), poolBin, correlationStatus);
entryD0HadronRecoInfo(hfHelper.invMassD0ToPiK(t1), hfHelper.invMassD0barToKPi(t1), signalStatus);
}
}
Expand Down Expand Up @@ -891,7 +915,8 @@ struct HfCorrelatorD0Hadrons {
continue;
}
int poolBin = corrBinningMcGen.getBin(std::make_tuple(c2.posZ(), getTracksSize(c2)));
entryD0HadronPair(getDeltaPhi(t2.phi(), t1.phi()), t2.eta() - t1.eta(), t1.pt(), t2.pt(), poolBin);
bool correlationStatus = false;
entryD0HadronPair(getDeltaPhi(t2.phi(), t1.phi()), t2.eta() - t1.eta(), t1.pt(), t2.pt(), poolBin, correlationStatus);
entryD0HadronRecoInfo(massD0, massD0, 0); // dummy info
}
}
Expand Down
16 changes: 13 additions & 3 deletions PWGHF/HFC/Tasks/taskCorrelationD0Hadrons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ AxisSpec axisDeltaPhi = {64, -o2::constants::math::PIHalf, 3. * o2::constants::m
AxisSpec axisPtD = {10, 0., 10., ""};
AxisSpec axisPtHadron = {11, 0., 11., ""};
AxisSpec axisPoolBin = {9, 0., 9., ""};
AxisSpec axisInvmass = {200, 1.3848, 2.3848, ""};
AxisSpec axisCorrelationState = {2, 0., 1., ""};

// definition of vectors for standard ptbin and invariant mass configurables
const int nPtBinsCorrelations = 12;
Expand Down Expand Up @@ -165,8 +167,9 @@ struct HfTaskCorrelationD0Hadrons {
{"hCorrel2DVsPtGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + stringPtD + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPoolBin}}}}, // note: axes 3 and 4 (the pT) are updated in the init(),
{"hCorrel2DPtIntGen", stringMcParticles + stringDeltaPhi + stringDeltaEta + "entries", {HistType::kTH2F, {{axisDeltaPhi}, {axisDeltaEta}}}},
{"hDeltaEtaPtIntGen", stringMcParticles + stringDeltaEta + "entries", {HistType::kTH1F, {axisDeltaEta}}},
{"hDeltaPhiPtIntGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}}}};

{"hDeltaPhiPtIntGen", stringMcParticles + stringDeltaPhi + "entries", {HistType::kTH1F, {axisDeltaPhi}}},
// Toward Transverse Away
{"hCorInfoWithCorrelationState", stringDHadron + stringDeltaPhi + stringDeltaEta + stringPtD + stringPtHadron + "entries", {HistType::kTHnSparseD, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtD}, {axisPtHadron}, {axisPoolBin}, {axisInvmass}, {axisCorrelationState}}}}}};
void init(InitContext&)
{
int nBinsPtAxis = binsCorrelations->size() - 1;
Expand Down Expand Up @@ -227,6 +230,7 @@ struct HfTaskCorrelationD0Hadrons {
int effBinD = o2::analysis::findBin(binsEfficiency, ptD);
int ptBinD = o2::analysis::findBin(binsCorrelations, ptD);
int poolBin = pairEntry.poolBin();
bool isAutoCorrelated = pairEntry.isAutoCorrelated();

// reject entries outside pT ranges of interest
if (ptBinD < 0 || effBinD < 0) {
Expand All @@ -240,11 +244,17 @@ struct HfTaskCorrelationD0Hadrons {
if (applyEfficiency) {
efficiencyWeight = 1. / (efficiencyDmeson->at(o2::analysis::findBin(binsEfficiency, ptD))); // ***** track efficiency to be implemented *****
}

// reject entries outside pT ranges of interest
if (ptBinD == -1) { // at least one particle outside accepted pT range
continue;
}
//==============================================================================================================
if (signalStatus == ParticleTypeData::D0Only || (signalStatus == ParticleTypeData::D0D0barBoth)) {
registry.fill(HIST("hCorInfoWithCorrelationState"), deltaPhi, deltaEta, ptD, ptHadron, poolBin, massD, isAutoCorrelated, efficiencyWeight);
}
if (signalStatus == ParticleTypeData::D0barOnly || (signalStatus == ParticleTypeData::D0D0barBoth)) {
registry.fill(HIST("hCorInfoWithCorrelationState"), deltaPhi, deltaEta, ptD, ptHadron, poolBin, massDbar, isAutoCorrelated, efficiencyWeight);
}
// check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots
if ((massD > signalRegionLeft->at(ptBinD) && massD < signalRegionRight->at(ptBinD)) && ((signalStatus == ParticleTypeData::D0Only) || (signalStatus == ParticleTypeData::D0D0barBoth))) {
// in signal region
Expand Down

0 comments on commit d93d6c3

Please sign in to comment.