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
108 changes: 51 additions & 57 deletions PWGLF/Tasks/Resonances/kstarqa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@
Configurable<bool> onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"};
Configurable<bool> onlyTPC{"onlyTPC", true, "only TPC tracks"};
Configurable<int> cRotations{"cRotations", 3, "Number of random rotations in the rotational background"};
Configurable<int> cSelectMultEstimator{"cSelectMultEstimator", 0, "Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"};
Configurable<bool> applyRecMotherRapidity{"applyRecMotherRapidity", true, "Apply rapidity cut on reconstructed mother track"};

// Configurables for track selections
Configurable<int> rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"};
Expand Down Expand Up @@ -203,7 +205,7 @@
hInvMass.add("hk892GenpT2", "pT distribution of True MC K(892)0", kTHnSparseF, {ptAxis, multiplicityAxis});
hInvMass.add("h1KstarRecMass", "Invariant mass of kstar meson", kTH1F, {invmassAxis});
hInvMass.add("h2KstarRecpt1", "pT of kstar meson", kTHnSparseF, {ptAxis, multiplicityAxis, invmassAxis});
hInvMass.add("h2KstarRecpt2", "pT of generated kstar meson", kTHnSparseF, {ptAxis, multiplicityAxis});
hInvMass.add("h2KstarRecpt2", "pT of generated kstar meson", kTHnSparseF, {ptAxis, multiplicityAxis, invmassAxis});
hInvMass.add("h1genmass", "Invariant mass of generated kstar meson", kTH1F, {invmassAxis});
hInvMass.add("h1GenMult", "Multiplicity generated", kTH1F, {multiplicityAxis});
hInvMass.add("h1RecMult", "Multiplicity reconstructed", kTH1F, {multiplicityAxis});
Expand Down Expand Up @@ -579,7 +581,16 @@
rEventSelection.fill(HIST("events_check_data"), 3.5);

multiplicity = -1;
multiplicity = collision.centFT0M();

if (cSelectMultEstimator == 0) {
multiplicity = collision.centFT0M();
} else if (cSelectMultEstimator == 1) {
multiplicity = collision.centFT0A();
} else if (cSelectMultEstimator == 2) {
multiplicity = collision.centFT0C();
} else {
multiplicity = collision.multFT0M();
}

// Fill the event counter
if (cQAevents) {
Expand Down Expand Up @@ -690,76 +701,58 @@
ConfigurableAxis axisMultiplicity{"axisMultiplicity", {2000, 0, 10000}, "TPC multiplicity axis for ME mixing"};

// using BinningTypeTPCMultiplicity = ColumnBinningPolicy<aod::collision::PosZ, aod::mult::MultTPC>;
// using BinningTypeCentralityM = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;
using BinningTypeCentralityM = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;
using BinningTypeVertexContributor = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0M>;
using BinningTypeFT0A = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0A>;

BinningTypeVertexContributor binningOnPositions{{axisVertex, axisMultiplicity}, true};
// BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicity}, true};
BinningTypeCentralityM binningOnCentrality{{axisVertex, axisMultiplicity}, true};
BinningTypeFT0A binningOnFT0A{{axisVertex, axisMultiplicity}, true};

SameKindPair<EventCandidates, TrackCandidates, BinningTypeVertexContributor> pair1{binningOnPositions, cfgNoMixedEvents, -1, &cache};
// SameKindPair<EventCandidates, TrackCandidates, BinningTypeCentralityM> pair2{binningOnCentrality, cfgNoMixedEvents, -1, &cache};
SameKindPair<EventCandidates, TrackCandidates, BinningTypeCentralityM> pair2{binningOnCentrality, cfgNoMixedEvents, -1, &cache};
SameKindPair<EventCandidates, TrackCandidates, BinningTypeFT0A> pair3{binningOnFT0A, cfgNoMixedEvents, -1, &cache};

void processME(EventCandidates const&, TrackCandidates const&)
{
for (const auto& [c1, tracks1, c2, tracks2] : pair1) {

if (!c1.sel8()) {
continue;
}
if (!c2.sel8()) {
continue;
}

if (timFrameEvsel && (!c1.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !c1.selection_bit(aod::evsel::kNoITSROFrameBorder) || !c2.selection_bit(aod::evsel::kNoITSROFrameBorder))) {
continue;
}

if (cTVXEvsel && (!c1.selection_bit(aod::evsel::kIsTriggerTVX) || !c2.selection_bit(aod::evsel::kIsTriggerTVX))) {
return;
}

if (rctCut.requireRCTFlagChecker && !rctChecker(c1)) {
continue;
}
if (rctCut.requireRCTFlagChecker && !rctChecker(c2)) {
continue;
}

multiplicity = c1.centFT0M();

for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {

if (!selectionTrack(t1)) // Kaon
// Map estimator to pair and multiplicity accessor
auto runMixing = [&](auto& pair, auto multiplicityGetter) {
for (const auto& [c1, tracks1, c2, tracks2] : pair) {
if (!c1.sel8() || !c2.sel8())
continue;
if (!selectionTrack(t2)) // Pion
continue;
if (!selectionPID(t1, 1)) // Kaon
continue;
if (!selectionPID(t2, 0)) // Pion

if (rctCut.requireRCTFlagChecker && (!rctChecker(c1) || !rctChecker(c2)))
continue;

// if (cMID) {
// if (cMIDselectionPID(t1, 0)) // misidentified as pion
// continue;
// if (cMIDselectionPID(t1, 2)) // misidentified as proton
// continue;
// if (cMIDselectionPID(t2, 1)) // misidentified as kaon
// continue;
// }
multiplicity = multiplicityGetter(c1);

daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa);
daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massPi);
mother = daughter1 + daughter2; // Kstar meson
for (const auto& [t1, t2] : o2::soa::combinations(
o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
if (!selectionTrack(t1) || !selectionTrack(t2))
continue;
if (!selectionPID(t1, 1) || !selectionPID(t2, 0))
continue;

isMix = true;
daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa);
daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massPi);
mother = daughter1 + daughter2;

// if (std::abs(kstar.Rapidity()) < 0.5) {
// fillInvMass(t1, t2, vPION, kstar, multiplicity, isMix);
isMix = true;

if (std::abs(mother.Rapidity()) < 0.5) {
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, t1, t2);
if (std::abs(mother.Rapidity()) < 0.5) {
fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, t1, t2);
}
}
}
};

// Call mixing based on selected estimator
if (cSelectMultEstimator == 0) {
runMixing(pair1, [](const auto& c) { return c.centFT0M(); });
} else if (cSelectMultEstimator == 1) {
runMixing(pair2, [](const auto& c) { return c.centFT0A(); });
} else if (cSelectMultEstimator == 2) {
runMixing(pair3, [](const auto& c) { return c.centFT0C(); });
}
}

Expand All @@ -775,7 +768,7 @@
int nChInel = 0;
for (const auto& mcParticle : mcParticles) {
auto pdgcode = std::abs(mcParticle.pdgCode());
if (mcParticle.isPhysicalPrimary() && (pdgcode == 211 || pdgcode == 321 || pdgcode == 2212 || pdgcode == 11 || pdgcode == 13)) {

Check failure on line 771 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
if (std::abs(mcParticle.eta()) < 1.0) {
nChInel = nChInel + 1;
}
Expand Down Expand Up @@ -822,7 +815,7 @@
}
rEventSelection.fill(HIST("events_check"), 5.5);

if (std::abs(mcParticle.pdgCode()) != 313) {

Check failure on line 818 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
}
rEventSelection.fill(HIST("events_check"), 6.5);
Expand All @@ -841,11 +834,11 @@
}
rEventSelection.fill(HIST("events_check"), 8.5);

if (std::abs(kCurrentDaughter.pdgCode()) == 321) {

Check failure on line 837 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
passkaon = true;
daughter1 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), massKa);

} else if (std::abs(kCurrentDaughter.pdgCode()) == 211) {

Check failure on line 841 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
passpion = true;
daughter2 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), massPi);
}
Expand Down Expand Up @@ -932,19 +925,19 @@
int track1PDG = std::abs(mctrack1.pdgCode());
int track2PDG = std::abs(mctrack2.pdgCode());

if (cQAplots && (mctrack1.pdgCode() == 211 || mctrack2.pdgCode() == 211)) { // pion

Check failure on line 928 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
hPID.fill(HIST("Before/h1PID_TPC_pos_pion"), track2.tpcNSigmaPi());
hPID.fill(HIST("Before/h1PID_TOF_pos_pion"), track2.tofNSigmaPi());
}
if (cQAplots && (mctrack1.pdgCode() == 321 || mctrack2.pdgCode() == 321)) { // kaon

Check failure on line 932 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
hPID.fill(HIST("Before/h1PID_TPC_pos_kaon"), track2.tpcNSigmaKa());
hPID.fill(HIST("Before/h1PID_TOF_pos_kaon"), track2.tofNSigmaKa());
}
if (cQAplots && (mctrack1.pdgCode() == -211 || mctrack2.pdgCode() == -211)) { // negative track pion

Check failure on line 936 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
hPID.fill(HIST("Before/h1PID_TPC_neg_pion"), track1.tpcNSigmaPi());
hPID.fill(HIST("Before/h1PID_TOF_neg_pion"), track1.tofNSigmaPi());
}
if (cQAplots && (mctrack1.pdgCode() == -321 || mctrack2.pdgCode() == -321)) { // negative track kaon

Check failure on line 940 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
hPID.fill(HIST("Before/h1PID_TPC_neg_kaon"), track1.tpcNSigmaKa());
hPID.fill(HIST("Before/h1PID_TOF_neg_kaon"), track1.tofNSigmaKa());
}
Expand All @@ -962,7 +955,7 @@
// if (!(track1PDG == 321 && track2PDG == 211)) {
// continue;
// }
if ((track1PDG != 211) && (track1PDG != 321)) {

Check failure on line 958 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
}
if ((track2PDG != 211) && (track2PDG != 321)) {
Expand Down Expand Up @@ -1017,13 +1010,14 @@
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
mother = daughter1 + daughter2; // Kstar meson

if (mother.Rapidity() >= 0) {
hInvMass.fill(HIST("h2KstarRecpt2"), mothertrack1.pt(), multiplicity, TMath::Sqrt(mothertrack1.e() * mothertrack1.e() - mothertrack1.p() * mothertrack1.p()));

Check failure on line 1013 in PWGLF/Tasks/Resonances/kstarqa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.

if (applyRecMotherRapidity && mother.Rapidity() >= 0) {
continue;
}

hInvMass.fill(HIST("h1KstarRecMass"), mother.M());
hInvMass.fill(HIST("h2KstarRecpt1"), mother.Pt(), multiplicity, mother.M());
hInvMass.fill(HIST("h2KstarRecpt2"), mothertrack1.pt(), multiplicity);
}
}
}
Expand Down
Loading