Skip to content
Merged
Changes from all 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
146 changes: 109 additions & 37 deletions PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr,
aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
using DaughterTracksMC = soa::Join<DaughterTracks, aod::McTrackLabels>;
using DaughterTracksMB = soa::Join<DaughterTracks, aod::TrackSelection>;

struct StrangenessInJetsIons {

Expand Down Expand Up @@ -135,6 +136,7 @@
Configurable<int> centrEstimator{"centrEstimator", 1, "Select centrality estimator. Options: 0 = FT0C, 1 = FT0M. CCDB objects available only for FT0M."};
Configurable<bool> calculateFeeddownMatrix{"calculateFeeddownMatrix", true, "Fill feeddown matrix for Lambda if MC"};
Configurable<bool> useV0inJetRec{"useV0inJetRec", true, "Include V0s in jet reconstruction"};
Configurable<bool> saveChargedParticleMB{"saveChargedParticleMB", false, "Store charged particle information to build inclusive spectra."};

// Event selection
Configurable<bool> requireNoSameBunchPileup{"requireNoSameBunchPileup", true, "Require kNoSameBunchPileup selection"};
Expand Down Expand Up @@ -287,7 +289,7 @@
registryData.add("number_of_events_vsmultiplicity", "number of events in data vs multiplicity", HistType::kTH1D, {{101, 0, 101, "Multiplicity percentile"}});

// For MB
registryData.add("number_of_events_vsmultiplicity_MB", "number of events in data vs multiplicity (MB)", HistType::kTH1D, {{101, 0, 101, "Multiplicity percentile"}});
// registryData.add("number_of_events_vsmultiplicity_MB", "number of events in data vs multiplicity (MB)", HistType::kTH1D, {{101, 0, 101, "Multiplicity percentile"}});

registryData.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(1, "All collisions");
registryData.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(2, "Zorro selection");
Expand Down Expand Up @@ -555,17 +557,17 @@
if (doprocessDataMB) {

// Event counters
registryDataMB.add("number_of_events_data", "number of events in data", HistType::kTH1D, {{20, 0, 20, "Event Cuts"}});
registryDataMB.add("number_of_events_vsmultiplicity", "number of events in data vs multiplicity", HistType::kTH1D, {{101, 0, 101, "Multiplicity percentile"}});

registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(1, "All collisions");
registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(2, "Zorro selection");
registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(3, "sel8");
registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(4, "posZ cut");
registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(5, "kNoSameBunchPileup");
registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV");
registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(7, "No empty events");
registryDataMB.get<TH1>(HIST("number_of_events_data"))->GetXaxis()->SetBinLabel(8, "At least one jet");
registryDataMB.add("number_of_events_data_MB", "number of events in data (MB)", HistType::kTH1D, {{20, 0, 20, "Event Cuts"}});
registryDataMB.add("number_of_events_vsmultiplicity_MB", "number of events in data vs multiplicity (MB)", HistType::kTH1D, {{101, 0, 101, "Multiplicity percentile"}});

registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(1, "All collisions");
registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(2, "Zorro selection");
registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(3, "sel8");
registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(4, "posZ cut");
registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(5, "kNoSameBunchPileup");
registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(6, "kIsGoodZvtxFT0vsPV");
registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(7, "No empty events");
registryDataMB.get<TH1>(HIST("number_of_events_data_MB"))->GetXaxis()->SetBinLabel(8, "At least one jet");

// Histograms for analysis of strange hadrons
if (particleOfInterestDict[ParticleOfInterest::kV0Particles]) {
Expand All @@ -588,6 +590,9 @@
if (particleOfInterestDict[ParticleOfInterest::kProtons]) {
registryDataMB.add("Proton_in_MB", "Proton_in_MB", HistType::kTHnSparseF, {multAxis, ptAxisLongLived, nsigmaTPCAxis, nsigmaTOFAxis, dcaAxis});
}
if (saveChargedParticleMB) {
registryDataMB.add("ChargedTrack_in_MB", "ChargedTrack_in_MB", HistType::kTH2F, {multAxis, ptAxis});
}
}
}

Expand Down Expand Up @@ -1189,6 +1194,64 @@
return true;
}

// --- MB Selections ------------------------------------
// The rapidty cut is added, which is not required in jet and UE
// K0s selections (MB)
template <typename K0short, typename TrackPos, typename TrackNeg>
bool passedK0ShortSelectionMB(const K0short& v0, const TrackPos& ptrack, const TrackNeg& ntrack, const TVector3& vtxPos)
{
bool passedSel = passedK0ShortSelection(v0, ptrack, ntrack, vtxPos);

if (!passedRapidityCut(v0.yK0Short(), configV0.rapidityMax))
return false;
return passedSel;
}

// Lambda selections (MB)
template <typename Lambda, typename TrackPos, typename TrackNeg>
bool passedLambdaSelectionMB(const Lambda& v0, const TrackPos& ptrack, const TrackNeg& ntrack, const TVector3& vtxPos)
{
bool passedSel = passedLambdaSelection(v0, ptrack, ntrack, vtxPos);

if (!passedRapidityCut(v0.yLambda(), configV0.rapidityMax))
return false;
return passedSel;
}

// AntiLambda selections (MB)
template <typename AntiLambda, typename TrackPos, typename TrackNeg>
bool passedAntiLambdaSelectionMB(const AntiLambda& v0, const TrackPos& ptrack, const TrackNeg& ntrack, const TVector3& vtxPos)
{
bool passedSel = passedAntiLambdaSelection(v0, ptrack, ntrack, vtxPos);

if (!passedRapidityCut(v0.yLambda(), configV0.rapidityMax))
return false;
return passedSel;
}

// Xi Selections (MB)
template <typename Xi, typename TrackPos, typename TrackNeg, typename TrackBac, typename Coll>
bool passedXiSelectionMB(const Xi& casc, const TrackPos& ptrack, const TrackNeg& ntrack, const TrackBac& btrack, const Coll& coll)
{
bool passedSel = passedXiSelection(casc, ptrack, ntrack, btrack, coll);

if (!passedRapidityCut(casc.yXi(), configV0.rapidityMax))
return false;
return passedSel;
}

// Omega selections (MB)
template <typename Omega, typename TrackPos, typename TrackNeg, typename TrackBac, typename Coll>
bool passedOmegaSelectionMB(const Omega& casc, const TrackPos& ptrack, const TrackNeg& ntrack, const TrackBac& btrack, const Coll& coll)
{
bool passedSel = passedOmegaSelection(casc, ptrack, ntrack, btrack, coll);

if (!passedRapidityCut(casc.yOmega(), configV0.rapidityMax))
return false;
return passedSel;
}
// ------------------------------------------------------

// Event selection for MC Reco collision
template <typename coll>
bool selectRecoEvent(const coll& recoColl)
Expand Down Expand Up @@ -1358,7 +1421,7 @@
if (motherPos != motherNeg)
continue;

if (std::abs(motherPos.eta()) > 0.8)

Check failure on line 1424 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;

// Vertex position vector
Expand Down Expand Up @@ -1457,7 +1520,7 @@
if (!motherBach.isPhysicalPrimary())
continue;

if (std::abs(motherPos.eta()) > 0.8)

Check failure on line 1523 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;

// Xi+
Expand Down Expand Up @@ -1495,7 +1558,7 @@
continue;
}

if (std::abs(mcParticle.eta()) > 0.8) {

Check failure on line 1561 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;
}

Expand Down Expand Up @@ -1552,7 +1615,7 @@
if (std::abs(v0mother.pdgCode()) == o2::constants::physics::Pdg::kXi0)
rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXi0);

if (std::fabs(rapidityXi) > 0.5f)

Check failure on line 1618 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return; // not a valid mother rapidity (PDG selection is later)

// __________________________________________
Expand Down Expand Up @@ -1911,13 +1974,13 @@
registryData.fill(HIST("number_of_events_data"), 5.5);

// Event multiplicity
float centrality;
if (centrEstimator == 0) {
centrality = collision.centFT0C();
} else {
centrality = collision.centFT0M();
}
registryData.fill(HIST("number_of_events_vsmultiplicity_MB"), centrality);
// float centrality;
// if (centrEstimator == 0) {
// centrality = collision.centFT0C();
// } else {
// centrality = collision.centFT0M();
// }
// registryData.fill(HIST("number_of_events_vsmultiplicity_MB"), centrality);

// Loop over reconstructed tracks
std::vector<fastjet::PseudoJet> fjParticles;
Expand Down Expand Up @@ -2225,7 +2288,7 @@
}
}

if (multiplicity == -999)

Check failure on line 2291 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue; */

// Clear containers at the start of the event loop
Expand Down Expand Up @@ -2331,7 +2394,7 @@

// Set up two perpendicular cone axes for underlying event estimation
TVector3 jetAxis(jet.px(), jet.py(), jet.pz());
double coneRadius = std::sqrt(jet.area() / PI);
double coneRadius = std::sqrt(jet.area() / PI); // TODO: replace with rJet (similar results)
TVector3 ueAxis1(0, 0, 0), ueAxis2(0, 0, 0);
getPerpendicularDirections(jetAxis, ueAxis1, ueAxis2);
if (ueAxis1.Mag() == 0 || ueAxis2.Mag() == 0) {
Expand Down Expand Up @@ -2663,7 +2726,7 @@
// ------------------------------------------------
// --- Generated hadrons in reconstructed jets ----
for (const auto& particle : mcParticlesPerColl) {
if (!particle.isPhysicalPrimary() || std::abs(particle.eta()) > 0.8)

Check failure on line 2729 in PWGLF/Tasks/Strangeness/strangenessInJetsIons.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue;

int absPdg = std::abs(particle.pdgCode());
Expand Down Expand Up @@ -3225,14 +3288,14 @@
// --- Process Minimum Bias events ---
// Process data MB
void processDataMB(SelCollisions::iterator const& collision, aod::V0Datas const& fullV0s,
aod::CascDataExt const& Cascades, DaughterTracks const& tracks,
aod::CascDataExt const& Cascades, DaughterTracksMB const& tracks,
aod::BCsWithTimestamps const&)
{
// Vertex position vector
TVector3 vtxPos(collision.posX(), collision.posY(), collision.posZ());

// Fill event counter before event selection
registryDataMB.fill(HIST("number_of_events_data"), 0.5);
registryDataMB.fill(HIST("number_of_events_data_MB"), 0.5);

// Get the bunch crossing (BC) information associated with the collision
auto bc = collision.template bc_as<aod::BCsWithTimestamps>();
Expand All @@ -3246,35 +3309,35 @@
}

// Fill event counter after zorro selection
registryDataMB.fill(HIST("number_of_events_data"), 1.5);
registryDataMB.fill(HIST("number_of_events_data_MB"), 1.5);

// Event selection
if (!collision.sel8())
return;

// Fill event counter after sel8 selection
registryDataMB.fill(HIST("number_of_events_data"), 2.5);
registryDataMB.fill(HIST("number_of_events_data_MB"), 2.5);

// Require vertex position within the allowed z range
if (std::fabs(collision.posZ()) > zVtx)
return;

// Fill event counter after z vertex selection
registryDataMB.fill(HIST("number_of_events_data"), 3.5);
registryDataMB.fill(HIST("number_of_events_data_MB"), 3.5);

// Reject collisions associated to the same found BC
if (requireNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))
return;

// Fill event counter after selection kNoSameBunchPileup
registryDataMB.fill(HIST("number_of_events_data"), 4.5);
registryDataMB.fill(HIST("number_of_events_data_MB"), 4.5);

// Compatible z_vtx from FT0 and from PV
if (requireGoodZvtxFT0vsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV))
return;

// Fill event counter after selection kIsGoodZvtxFT0vsPV
registryDataMB.fill(HIST("number_of_events_data"), 5.5);
registryDataMB.fill(HIST("number_of_events_data_MB"), 5.5);

// Event multiplicity
float centrality;
Expand All @@ -3283,26 +3346,35 @@
} else {
centrality = collision.centFT0M();
}
registryDataMB.fill(HIST("number_of_events_vsmultiplicity"), centrality);
registryDataMB.fill(HIST("number_of_events_vsmultiplicity_MB"), centrality);

if (saveChargedParticleMB) {
for (const auto& trk : tracks) {
if (!passedTrackSelectionForJetReconstruction(trk) || !trk.isGlobalTrack()) {
continue;
}
registryDataMB.fill(HIST("ChargedTrack_in_MB"), centrality, trk.pt());
}
}

if (particleOfInterestDict[ParticleOfInterest::kV0Particles]) { // V0s
for (const auto& v0 : fullV0s) {

// Get V0 daughters
const auto& pos = v0.posTrack_as<DaughterTracks>();
const auto& neg = v0.negTrack_as<DaughterTracks>();
const auto& pos = v0.posTrack_as<DaughterTracksMB>();
const auto& neg = v0.negTrack_as<DaughterTracksMB>();
TVector3 v0dir(v0.px(), v0.py(), v0.pz());

// K0s
if (passedK0ShortSelection(v0, pos, neg, vtxPos)) {
if (passedK0ShortSelectionMB(v0, pos, neg, vtxPos)) {
registryDataMB.fill(HIST("K0s_in_MB"), centrality, v0.pt(), v0.mK0Short());
}
// Lambda
if (passedLambdaSelection(v0, pos, neg, vtxPos)) {
if (passedLambdaSelectionMB(v0, pos, neg, vtxPos)) {
registryDataMB.fill(HIST("Lambda_in_MB"), centrality, v0.pt(), v0.mLambda());
}
// AntiLambda
if (passedAntiLambdaSelection(v0, pos, neg, vtxPos)) {
if (passedAntiLambdaSelectionMB(v0, pos, neg, vtxPos)) {
registryDataMB.fill(HIST("AntiLambda_in_MB"), centrality, v0.pt(), v0.mAntiLambda());
}
}
Expand All @@ -3317,19 +3389,19 @@
TVector3 cascadeDir(casc.px(), casc.py(), casc.pz());

// Xi+
if (passedXiSelection(casc, pos, neg, bach, collision) && bach.sign() > 0) {
if (passedXiSelectionMB(casc, pos, neg, bach, collision) && bach.sign() > 0) {
registryDataMB.fill(HIST("XiPos_in_MB"), centrality, casc.pt(), casc.mXi());
}
// Xi-
if (passedXiSelection(casc, pos, neg, bach, collision) && bach.sign() < 0) {
if (passedXiSelectionMB(casc, pos, neg, bach, collision) && bach.sign() < 0) {
registryDataMB.fill(HIST("XiNeg_in_MB"), centrality, casc.pt(), casc.mXi());
}
// Omega+
if (passedOmegaSelection(casc, pos, neg, bach, collision) && bach.sign() > 0) {
if (passedOmegaSelectionMB(casc, pos, neg, bach, collision) && bach.sign() > 0) {
registryDataMB.fill(HIST("OmegaPos_in_MB"), centrality, casc.pt(), casc.mOmega());
}
// Omega-
if (passedOmegaSelection(casc, pos, neg, bach, collision) && bach.sign() < 0) {
if (passedOmegaSelectionMB(casc, pos, neg, bach, collision) && bach.sign() < 0) {
registryDataMB.fill(HIST("OmegaNeg_in_MB"), centrality, casc.pt(), casc.mOmega());
}
}
Expand Down
Loading