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
133 changes: 123 additions & 10 deletions PWGLF/Tasks/Resonances/kstarqa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
hInvMass.add("MCcorrections/hKstarGenAfterEvtSel", "K*0 after event selections", kTH2F, {ptAxis, impactParAxis});
}

if (doprocessEvSigLossFactors) {
if (doprocessEvSigLossFactors || doprocessEvSigLossFactorsPhi) {
hInvMass.add("CorrFactors/hMultiplicityVsMultMC", "Event centrality vs MC centrality", kTH2F, {{101, 0.0f, 101.0f}, axisNch});
hInvMass.add("CorrFactors/hEventCentrality", "Event centrality", kTH1F, {{101, 0, 101}});
hInvMass.add("CorrFactors/hNrecInGen", "Number of collisions in MC", kTH1F, {{4, -0.5, 3.5}});
Expand All @@ -382,8 +382,8 @@

hInvMass.add("CorrFactors/h2dGenKstar", "Centrality vs p_{T}", kTH2D, {{101, 0.0f, 101.0f}, ptAxis});
hInvMass.add("CorrFactors/h3dGenKstarVsMultMCVsMultiplicity", "MC centrality vs centrality vs p_{T}", kTH3D, {axisNch, {101, 0.0f, 101.0f}, ptAxis});
hInvMass.add("CorrFactors/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {axisNch}});
hInvMass.add("CorrFactors/hSignalLossNumerator", "Kstar generated after event selection", kTH2F, {{ptAxis}, {axisNch}});
hInvMass.add("CorrFactors/hSignalLoss1", "Kstar generated before event selection", kTH2F, {{ptAxis}, {axisNch}});
hInvMass.add("CorrFactors/hSignalLoss2", "Kstar generated after event selection", kTH2F, {{ptAxis}, {axisNch}});
hInvMass.add("CorrFactors/MultiplicityRec", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {axisNch});
hInvMass.add("CorrFactors/MultiplicityGen", "Multiplicity in generated MC", kTH1F, {axisNch});
}
Expand Down Expand Up @@ -425,7 +425,8 @@
hGenTracks->GetXaxis()->SetBinLabel(1, "All events");
hGenTracks->GetXaxis()->SetBinLabel(2, "INELgt0+vtz");
hGenTracks->GetXaxis()->SetBinLabel(3, "INELgt0");
hGenTracks->GetXaxis()->SetBinLabel(4, "Event Reconstructed");
hGenTracks->GetXaxis()->SetBinLabel(4, "All Collisions");
hGenTracks->GetXaxis()->SetBinLabel(5, "Event Reconstructed");

// Multplicity distribution
if (cQAevents) {
Expand Down Expand Up @@ -765,11 +766,11 @@
bool selectionMIDPtDep(const T& candidate, int PID)
{
if (PID == PIDParticle::kPion) {
if (candidate.pt() >= 1.0 && candidate.pt() < 2.5 && !candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCMID) {

Check failure on line 769 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
} else if (PID == PIDParticle::kKaon) {
if (candidate.pt() >= 0.7 && candidate.pt() < 2.5 && !candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCMID) {

Check failure on line 773 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
}
Expand All @@ -787,13 +788,13 @@
if (candidate.pt() < 1.0 && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi) {
return true;
}
if (candidate.pt() >= 1.0 && candidate.pt() < 2.0 && candidate.tpcNSigmaPi() > -1.5 && candidate.tpcNSigmaPi() < selectionConfig.nsigmaCutTPCPi) {

Check failure on line 791 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
if (candidate.pt() >= 2.0 && candidate.pt() < 5.0 && candidate.tpcNSigmaPi() > -1.0 && candidate.tpcNSigmaPi() < selectionConfig.nsigmaCutTPCPi) {

Check failure on line 794 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
if (candidate.pt() >= 5.0 && candidate.tpcNSigmaPi() > -0.5 && candidate.tpcNSigmaPi() < selectionConfig.nsigmaCutTPCPi) {

Check failure on line 797 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
}
Expand All @@ -801,20 +802,20 @@
return true;
}
} else if (PID == PIDParticle::kKaon) {
if (candidate.pt() < selectionConfig.lowPtCutPID && candidate.tpcNSigmaKa() > -2.0 && candidate.tpcNSigmaKa() < selectionConfig.nsigmaCutTPCKa) {

Check failure on line 805 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
if (candidate.pt() >= selectionConfig.lowPtCutPID && !candidate.hasTOF()) {
if (candidate.pt() >= 0.5 && candidate.pt() < 0.6 && candidate.tpcNSigmaKa() > -1.5 && candidate.tpcNSigmaKa() < selectionConfig.nsigmaCutTPCKa) {

Check failure on line 809 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
if (candidate.pt() >= 0.6 && candidate.pt() < 0.7 && candidate.tpcNSigmaKa() > -1.0 && candidate.tpcNSigmaKa() < selectionConfig.nsigmaCutTPCKa) {

Check failure on line 812 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
if (candidate.pt() >= 0.7 && candidate.pt() < 0.8 && candidate.tpcNSigmaKa() > -0.5 && candidate.tpcNSigmaKa() < selectionConfig.nsigmaCutTPCKa) {

Check failure on line 815 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
if (candidate.pt() >= 0.8 && candidate.pt() < 1.0 && candidate.tpcNSigmaKa() > 0.0 && candidate.tpcNSigmaKa() < selectionConfig.nsigmaCutTPCKa) {

Check failure on line 818 in PWGLF/Tasks/Resonances/kstarqa.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 true;
}
if (candidate.pt() >= 1.0 && candidate.pt() < 2.0 && candidate.tpcNSigmaKa() > -selectionConfig.nsigmaCutTPCKa && candidate.tpcNSigmaKa() < 0.0) {
Expand Down Expand Up @@ -1676,6 +1677,8 @@
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);

for (const auto& collision : collisions) {
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);

if (!selectionEvent(collision, false)) { // don't fill event cut histogram
continue;
}
Expand Down Expand Up @@ -1722,7 +1725,7 @@
hInvMass.fill(HIST("sigEvLossFromGenRec/MultiplicityRec"), genMultiplicity);
hInvMass.fill(HIST("h1GenMult2"), genMultiplicity);
hInvMass.fill(HIST("hAllGenCollisions1Rec"), multiplicity);
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
rEventSelection.fill(HIST("eventsCheckGen"), 4.5);
}

for (const auto& mcParticle : mcParticles) {
Expand Down Expand Up @@ -1821,7 +1824,7 @@
return;
}

if (selectionConfig.checkVzEvSigLoss && (std::abs(mcCollision.posZ()) >= selectionConfig.cutzvertex)) {
if (selectionConfig.checkVzEvSigLoss && (std::abs(mcCollision.posZ()) > selectionConfig.cutzvertex)) {
return;
}

Expand Down Expand Up @@ -1944,9 +1947,9 @@

hInvMass.fill(HIST("CorrFactors/h2dGenKstar"), multiplicity, mother.Pt());
hInvMass.fill(HIST("CorrFactors/h3dGenKstarVsMultMCVsMultiplicity"), multiplicityNch, multiplicity, mother.Pt());
hInvMass.fill(HIST("CorrFactors/hSignalLossDenominator"), mother.pt(), multiplicityNch);
hInvMass.fill(HIST("CorrFactors/hSignalLoss1"), mother.pt(), multiplicityNch);
if (isSelectedEvent) {
hInvMass.fill(HIST("CorrFactors/hSignalLossNumerator"), mother.pt(), multiplicityNch);
hInvMass.fill(HIST("CorrFactors/hSignalLoss2"), mother.pt(), multiplicityNch);
}
}
}
Expand Down Expand Up @@ -2723,6 +2726,8 @@
rEventSelection.fill(HIST("eventsCheckGen"), 2.5);

for (const auto& collision : collisions) {
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);

if (!selectionEvent(collision, false)) { // don't fill event cut histogram
continue;
}
Expand Down Expand Up @@ -2762,7 +2767,7 @@
double genMultiplicity = mcCollision.centFT0M();
hInvMass.fill(HIST("h1GenMult2"), genMultiplicity);
hInvMass.fill(HIST("hAllGenCollisions1Rec"), multiplicity);
rEventSelection.fill(HIST("eventsCheckGen"), 3.5);
rEventSelection.fill(HIST("eventsCheckGen"), 4.5);

for (const auto& mcParticle : mcParticles) {

Expand Down Expand Up @@ -2815,6 +2820,114 @@
}
PROCESS_SWITCH(Kstarqa, processGenPhi, "Process Generated for Phi meson", false);

void processEvSigLossFactorsPhi(McCollisionMults::iterator const& mcCollision, soa::SmallGroups<EventCandidatesMC> const& collisions, LabeledTracks const&, aod::McParticles const& mcParticles)
{
auto multiplicityNch = -1;
multiplicityNch = mcCollision.multMCNParticlesEta05();
hInvMass.fill(HIST("CorrFactors/hGenEvents"), multiplicityNch, 0.5);

if (selectionConfig.checkVzEvSigLoss && std::abs(mcCollision.posZ()) > selectionConfig.cutzvertex)
return;

hInvMass.fill(HIST("CorrFactors/hGenEvents"), multiplicityNch, 1.5);

if (selectionConfig.isINELgt0 && !mcCollision.isInelGt0()) {
return;
}
hInvMass.fill(HIST("CorrFactors/hGenEvents"), multiplicityNch, 2.5);

float multiplicity = -1.0;
bool isSelectedEvent = false;

for (auto const& collision : collisions) {
if (!collision.has_mcCollision())
continue;
if (!selectionEvent(collision, false)) // don't fill event cut histogram
continue;

if (cSelectMultEstimator == kFT0M) {
multiplicity = collision.centFT0M();
} else if (cSelectMultEstimator == kFT0A) {
multiplicity = collision.centFT0A();
} else if (cSelectMultEstimator == kFT0C) {
multiplicity = collision.centFT0C();
} else if (cSelectMultEstimator == kFV0A) {
multiplicity = collision.centFV0A();
} else {
multiplicity = collision.centFT0M(); // default
}
isSelectedEvent = true;
}

// auto multiplicityGen = -1;
// multiplicityGen = mcCollision.centFT0M();

hInvMass.fill(HIST("CorrFactors/hMultiplicityVsMultMC"), multiplicity, multiplicityNch);
hInvMass.fill(HIST("CorrFactors/hNrecInGen"), collisions.size());
hInvMass.fill(HIST("CorrFactors/MultiplicityGen"), multiplicityNch);
if (isSelectedEvent) {
hInvMass.fill(HIST("CorrFactors/MultiplicityRec"), multiplicityNch);
}

for (const auto& mcParticle : mcParticles) {

if (std::abs(mcParticle.y()) >= selectionConfig.rapidityMotherData)
continue;

if (std::abs(mcParticle.pdgCode()) == o2::constants::physics::kPhi) {

auto kDaughters = mcParticle.daughters_as<aod::McParticles>();
if (kDaughters.size() != selectionConfig.noOfDaughters) {
continue;
}

bool hasPos = false;
bool hasNeg = false;

auto passkaon = false;
auto passpion = false;
for (const auto& kCurrentDaughter : kDaughters) {
// if (!kCurrentDaughter.isPhysicalPrimary())
// continue;

int pdgDau = kCurrentDaughter.pdgCode();
int sign = (pdgDau > 0) - (pdgDau < 0);

if (sign > 0)
hasPos = true;
if (sign < 0)
hasNeg = true;

if (kCurrentDaughter.pdgCode() == PDG_t::kKPlus) {
passkaon = true;
daughter1 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), massKa);

} else if (kCurrentDaughter.pdgCode() == PDG_t::kKMinus) {
passpion = true;
daughter2 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), massKa);
}
}

if ((passkaon && passpion) && (hasPos && hasNeg)) {
mother = daughter1 + daughter2; // Kstar meson

hInvMass.fill(HIST("CorrFactors/h2dGenKstar"), multiplicity, mother.Pt());
hInvMass.fill(HIST("CorrFactors/h3dGenKstarVsMultMCVsMultiplicity"), multiplicityNch, multiplicity, mother.Pt());
hInvMass.fill(HIST("CorrFactors/hSignalLoss1"), mother.pt(), multiplicityNch);
if (isSelectedEvent) {
hInvMass.fill(HIST("CorrFactors/hSignalLoss2"), mother.pt(), multiplicityNch);
}
}
}
}

if (collisions.size() == 0)
return;

hInvMass.fill(HIST("CorrFactors/hGenEvents"), multiplicityNch, 3.5);
}
PROCESS_SWITCH(Kstarqa, processEvSigLossFactorsPhi, "Process Event and Signal loss", false);

void processRecPhi(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&)
{

Expand Down Expand Up @@ -3093,7 +3206,7 @@
return;
}

if (selectionConfig.checkVzEvSigLoss && (std::abs(mcCollision.posZ()) >= selectionConfig.cutzvertex)) {
if (selectionConfig.checkVzEvSigLoss && (std::abs(mcCollision.posZ()) > selectionConfig.cutzvertex)) {
return;
}

Expand Down
Loading