Skip to content

Commit 6aea84f

Browse files
[PWGCF] Adding selection on V0 rapidity in cf correlation (#12210)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent f7ac0a3 commit 6aea84f

File tree

1 file changed

+49
-4
lines changed

1 file changed

+49
-4
lines changed

PWGCF/Tasks/correlations.cxx

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct CorrelationTask {
9696
O2_DEFINE_CONFIGURABLE(cfgVerbosity, int, 1, "Verbosity level (0 = major, 1 = per collision)")
9797

9898
O2_DEFINE_CONFIGURABLE(cfgDecayParticleMask, int, 0, "Selection bitmask for the decay particles: 0 = no selection")
99+
O2_DEFINE_CONFIGURABLE(cfgV0RapidityMax, float, 0.8, "Maximum rapidity for the decay particles (0 = no selection)")
99100
O2_DEFINE_CONFIGURABLE(cfgMassAxis, int, 0, "Use invariant mass axis (0 = OFF, 1 = ON)")
100101
O2_DEFINE_CONFIGURABLE(cfgMcTriggerPDGs, std::vector<int>, {}, "MC PDG codes to use exclusively as trigger particles and exclude from associated particles. Empty = no selection.")
101102

@@ -175,6 +176,7 @@ struct CorrelationTask {
175176
}
176177
}
177178
registry.add("multiplicity", "event multiplicity", {HistType::kTH1F, {{1000, 0, 100, "/multiplicity/centrality"}}});
179+
registry.add("yvspt", "y vs pT", {HistType::kTH2F, {{100, -1, 1, "y"}, {100, 0, 20, "p_{T}"}}}); // y vs pT for all tracks (control histogram)
178180

179181
const int maxMixBin = AxisSpec(axisMultiplicity).getNbins() * AxisSpec(axisVertex).getNbins();
180182
// The bin numbers for the control histograms (eventcount_*) come from getBin(...) and are the following: #mult_bin * #number_of_z_bins + #zbin
@@ -398,6 +400,40 @@ struct CorrelationTask {
398400
template <class T>
399401
using HasPartDaugh1Id = decltype(std::declval<T&>().cfParticleDaugh1Id());
400402

403+
template <typename T>
404+
float getV0Rapidity(const T& track)
405+
{
406+
const float pt = track.pt();
407+
const float eta = track.eta();
408+
const float phi = track.phi();
409+
410+
const float px = pt * std::cos(phi);
411+
const float py = pt * std::sin(phi);
412+
const float pz = pt * std::sinh(eta);
413+
414+
const float p2 = px * px + py * py + pz * pz;
415+
416+
if constexpr (std::experimental::is_detected<HasDecay, T>::value) {
417+
const auto decayType = track.decay();
418+
float mass = 0.f;
419+
420+
if (decayType == aod::cf2prongtrack::K0stoPiPi) {
421+
mass = o2::constants::physics::MassK0Short;
422+
} else if (decayType == aod::cf2prongtrack::LambdatoPPi || decayType == aod::cf2prongtrack::AntiLambdatoPiP) {
423+
mass = o2::constants::physics::MassLambda;
424+
} else if (decayType == aod::cf2prongtrack::PhiToKK) {
425+
mass = o2::constants::physics::MassPhi;
426+
} else {
427+
return -999.f; // unsupported decay type, return dummy rapidity
428+
}
429+
430+
const float E = std::sqrt(p2 + mass * mass);
431+
return 0.5f * std::log((E + pz) / (E - pz));
432+
}
433+
434+
return -999.f; // no decay type, return dummy rapidity
435+
}
436+
401437
template <CorrelationContainer::CFStep step, typename TTarget, typename TTracks1, typename TTracks2>
402438
void fillCorrelations(TTarget target, TTracks1& tracks1, TTracks2& tracks2, float multiplicity, float posZ, int magField, float eventWeight)
403439
{
@@ -445,8 +481,13 @@ struct CorrelationTask {
445481
if (((track1.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (track1.mcDecay() != aod::cf2prongtrack::D0barToKPi)) || (track1.decay() & aod::cf2prongmcpart::Prompt) == 0)
446482
continue;
447483
} else if constexpr (std::experimental::is_detected<HasDecay, typename TTracks1::iterator>::value) {
448-
if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast<uint32_t>(track1.decay()))) == 0u)
449-
continue;
484+
if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast<uint32_t>(track1.decay()))) == 0u) {
485+
continue; // skip particles that do not match the decay mask
486+
}
487+
if (cfgV0RapidityMax > 0 && std::abs(getV0Rapidity(track1)) > cfgV0RapidityMax) {
488+
continue; // V0s are not allowed to be outside the rapidity range
489+
}
490+
registry.fill(HIST("yvspt"), getV0Rapidity(track1), track1.pt());
450491
}
451492

452493
if constexpr (std::experimental::is_detected<HasPartDaugh0Id, typename TTracks1::iterator>::value) {
@@ -521,8 +562,12 @@ struct CorrelationTask {
521562
if ((((track2.mcDecay()) != aod::cf2prongtrack::D0ToPiK) && ((track2.mcDecay()) != aod::cf2prongtrack::D0barToKPi)) || (track2.decay() & aod::cf2prongmcpart::Prompt) == 0)
522563
continue;
523564
} else if constexpr (std::experimental::is_detected<HasDecay, typename TTracks2::iterator>::value) {
524-
if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast<uint32_t>(track2.decay()))) == 0u)
525-
continue;
565+
if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast<uint32_t>(track2.decay()))) == 0u) {
566+
continue; // skip particles that do not match the decay mask
567+
}
568+
if (cfgV0RapidityMax > 0 && std::abs(getV0Rapidity(track1)) > cfgV0RapidityMax) {
569+
continue; // V0s are not allowed to be outside the rapidity range
570+
}
526571
}
527572

528573
if constexpr (std::experimental::is_detected<HasDecay, typename TTracks1::iterator>::value && std::experimental::is_detected<HasDecay, typename TTracks2::iterator>::value) {

0 commit comments

Comments
 (0)