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
48 changes: 24 additions & 24 deletions PWGLF/Tasks/Resonances/kstarInOO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <Framework/OutputObjHeader.h>
#include <Framework/runDataProcessing.h>

#include <TLorentzVector.h>

Check failure on line 35 in PWGLF/Tasks/Resonances/kstarInOO.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
#include <TMath.h>
#include <TMathBase.h>
#include <TVector2.h>
Expand All @@ -44,7 +44,7 @@
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <iostream>

Check failure on line 47 in PWGLF/Tasks/Resonances/kstarInOO.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <string>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -179,10 +179,10 @@
}

if (cfgMcHistos) {
// histos.add("hPion_PID_Purity", "hPion_PID_Purity", kTH1F, {{3, -1.5, 1.5}});
// histos.add("hKaon_PID_Purity", "hKaon_PID_Purity", kTH1F, {{3, -1.5, 1.5}});
// histos.add("hSimplePion_PID_Purity", "hSimplePion_PID_Purity", kTH1F, {{3, -1.5, 1.5}});
// histos.add("hSimpleKaon_PID_Purity", "hSimpleKaon_PID_Purity", kTH1F, {{3, -1.5, 1.5}});
histos.add("hPion_PID_Purity", "hPion_PID_Purity", kTH1F, {{3, -1.5, 1.5}});
histos.add("hKaon_PID_Purity", "hKaon_PID_Purity", kTH1F, {{3, -1.5, 1.5}});
histos.add("hSimplePion_PID_Purity", "hSimplePion_PID_Purity", kTH1F, {{3, -1.5, 1.5}});
histos.add("hSimpleKaon_PID_Purity", "hSimpleKaon_PID_Purity", kTH1F, {{3, -1.5, 1.5}});

histos.add("nEvents_MC", "nEvents_MC", kTH1F, {{4, 0.0, 4.0}});
histos.add("nEvents_MC_True", "nEvents_MC_True", kTH1F, {{4, 0.0, 4.0}});
Expand All @@ -191,8 +191,13 @@

histos.add("hMC_USS_True", "hMC_USS_True", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});
histos.add("hMC_USS_KPi", "hMC_USS_KPi", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});
histos.add("hMC_USS_PiK", "hMC_USS_PiK", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});
histos.add("hMC_LSS_KPi", "hMC_LSS_KPi", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});
histos.add("hMC_LSS_PiK", "hMC_LSS_PiK", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});

histos.add("hMC_USS_KPi_Mix", "hMC_USS_KPi_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});
histos.add("hMC_USS_PiK_Mix", "hMC_USS_PiK_Mix", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});

histos.add("hMC_USS_KPi_True", "hMC_USS_KPi_True", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});
histos.add("hMC_USS_PiK_True", "hMC_USS_PiK_True", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis});
}
Expand Down Expand Up @@ -279,13 +284,11 @@
return false;
if (cfgTrackGlobalWoDCATrack && !track.isGlobalTrackWoDCA())
return false;
// if (cfgTracknFindableTPCClusters > 0 && track.tpcNClsFindable() < cfgTracknFindableTPCClusters)
if (track.tpcNClsFindable() < cfgTracknFindableTPCClusters)
if (cfgTracknFindableTPCClusters > 0 && track.tpcNClsFindable() < cfgTracknFindableTPCClusters)
return false;
if (track.tpcNClsCrossedRows() < cfgTracknTPCCrossedRows)
return false;
// if (cfgTracknRowsOverFindable > 0 && track.tpcCrossedRowsOverFindableCls() > cfgTracknRowsOverFindable)
if (track.tpcCrossedRowsOverFindableCls() > cfgTracknRowsOverFindable)
if (cfgTracknRowsOverFindable > 0 && track.tpcCrossedRowsOverFindableCls() > cfgTracknRowsOverFindable)
return false;
if (track.tpcChi2NCl() > cfgTracknTPCChi2)
return false;
Expand Down Expand Up @@ -416,17 +419,17 @@
std::vector<int> PIDPurityKey_Kaon;
std::vector<int> PIDPurityKey_Pion;

double KstarPt_Kpi, Minv_Kpi;
// double KstarPt_Kpi, Minv_Kpi;

for (const auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {
if (!trk1.has_mcParticle() || !trk2.has_mcParticle())
continue;

// auto [KstarPt_Kpi, Minv_Kpi] = minvReconstruction(trk1, trk2, QA, false);
// auto [KstarPt_piK, Minv_piK] = minvReconstruction(trk1, trk2, QA, true);
auto [KstarPt_Kpi, Minv_Kpi] = minvReconstruction(trk1, trk2, QA, false);
auto [KstarPt_piK, Minv_piK] = minvReconstruction(trk1, trk2, QA, true);

std::tie(KstarPt_Kpi, Minv_Kpi) = minvReconstruction(trk1, trk2, QA, false);
std::tie(KstarPt_Kpi, Minv_Kpi) = minvReconstruction(trk1, trk2, QA, true);
// std::tie(KstarPt_Kpi, Minv_Kpi) = minvReconstruction(trk1, trk2, QA, false);
// std::tie(KstarPt_Kpi, Minv_Kpi) = minvReconstruction(trk1, trk2, QA, true);

if (Minv_Kpi < 0)
continue;
Expand All @@ -436,12 +439,15 @@
if (!IsMix) {
if (conjugate < 0) {
histos.fill(HIST("hMC_USS_KPi"), centrality, KstarPt_Kpi, Minv_Kpi);
histos.fill(HIST("hMC_USS_PiK"), centrality, KstarPt_piK, Minv_piK);
} else if (conjugate > 0) {
histos.fill(HIST("hMC_LSS_KPi"), centrality, KstarPt_Kpi, Minv_Kpi);
histos.fill(HIST("hMC_LSS_PiK"), centrality, KstarPt_piK, Minv_piK);
}
} else {
if (conjugate < 0) {
histos.fill(HIST("hMC_USS_KPi_Mix"), centrality, KstarPt_Kpi, Minv_Kpi);
histos.fill(HIST("hMC_USS_PiK_Mix"), centrality, KstarPt_piK, Minv_piK);
}
}
}
Expand Down Expand Up @@ -470,23 +476,23 @@
mothers2PDG.push_back(particle2_mom.pdgCode());
}

if (mothers1PDG[0] != 313)

Check failure on line 479 in PWGLF/Tasks/Resonances/kstarInOO.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; // mother not K*0
if (mothers2PDG[0] != 313)

Check failure on line 481 in PWGLF/Tasks/Resonances/kstarInOO.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; // mothers not K*0

if (mothers1[0] != mothers2[0])
continue; // Kaon and pion not from the same K*0

if (std::fabs(particle1.pdgCode()) != 211 && std::fabs(particle1.pdgCode()) != 321)

Check failure on line 487 in PWGLF/Tasks/Resonances/kstarInOO.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 (std::fabs(particle2.pdgCode()) != 211 && std::fabs(particle2.pdgCode()) != 321)

Check failure on line 489 in PWGLF/Tasks/Resonances/kstarInOO.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;

double track1_mass, track2_mass;
bool track1f{false}; // true means pion

if (std::fabs(particle1.pdgCode()) == 211) {

Check failure on line 495 in PWGLF/Tasks/Resonances/kstarInOO.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.
track1f = true;
track1_mass = massPi;
} else {
Expand All @@ -512,7 +518,7 @@
mcMemory.push_back(trk2.globalIndex());
}

TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance;

Check failure on line 521 in PWGLF/Tasks/Resonances/kstarInOO.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), track1_mass);
lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), track2_mass);
lResonance = lDecayDaughter1 + lDecayDaughter2;
Expand All @@ -535,22 +541,16 @@
if (!trackSelection(trk1, false) || !trackSelection(trk2, false))
return {-1.0, -1.0};

if (!flip) {
if (!trackPIDKaon(trk1, QA) || !trackPIDPion(trk2, QA)) {
return {-1.0, -1.0};
}
} else {
if (!trackPIDPion(trk1, false) || !trackPIDKaon(trk2, false))
return {-1.0, -1.0};
}

if (trk1.index() >= trk2.index())
if (!trackPIDKaon(trk1, QA) || !trackPIDPion(trk2, QA))
return {-1.0, -1.0};

// if (trk1.globalIndex() == trk2.globalIndex())
// if (trk1.index() >= trk2.index())
// return {-1.0, -1.0};
// I checked that index and globalIndex was same function
if (trk1.globalIndex() >= trk2.globalIndex())
return {-1.0, -1.0};

TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance;

Check failure on line 553 in PWGLF/Tasks/Resonances/kstarInOO.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/lorentz-vector]

Do not use the TLorentzVector legacy class. Use std::array with RecoDecay methods or the ROOT::Math::LorentzVector template instead.
if (!flip) {
lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massKa);
lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi);
Expand Down Expand Up @@ -747,7 +747,7 @@
++nEventsTrue;
}

if (fabs(collision.posZ()) > cfgEventVtxCut)

Check failure on line 750 in PWGLF/Tasks/Resonances/kstarInOO.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return;
if (recocolls.size() <= 0) { // not reconstructed
if (cfgForceGenReco) {
Expand Down
Loading