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

#include <TLorentzVector.h>

Check failure on line 36 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 @@ -45,7 +45,8 @@
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <iostream>

Check failure on line 48 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 <memory>
#include <string>
#include <utility>
#include <vector>
Expand All @@ -69,8 +70,8 @@
Configurable<float> cfgEventVtxCut{"cfgEventVtxCut", 10.0, "V_z cut selection"};
ConfigurableAxis cfgCentAxis{"cfgCentAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0}, "Binning of the centrality axis"};
Configurable<bool> cfgOccupancySel{"cfgOccupancySel", false, "Occupancy selection"};
Configurable<int> cfgOccupancyMax{"cfgOccupancyMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"};
Configurable<int> cfgOccupancyMin{"cfgOccupancyMin", -100, "minimum occupancy of tracks in neighbouring collisions in a given time range"};
Configurable<float> cfgOccupancyMax{"cfgOccupancyMax", 999999., "maximum occupancy of tracks in neighbouring collisions in a given time range"};
Configurable<float> cfgOccupancyMin{"cfgOccupancyMin", -100., "minimum occupancy of tracks in neighbouring collisions in a given time range"};

// Track Selection
// General
Expand Down Expand Up @@ -138,6 +139,7 @@
const AxisSpec axisDCAxy{binsDCAxy, "DCA_{XY}"};

if (cfgEventCutQA) {
histos.add("hEvent_Cut", "Number of event after cuts", kTH1D, {{12, 0, 12}});
histos.add("hPosZ_BC", "hPosZ_Bc", kTH1F, {{300, -15.0, 15.0}});
histos.add("hPosZ_AC", "hPosZ_AC", kTH1F, {{300, -15.0, 15.0}});
histos.add("hcentFT0C_BC", "centFT0C_BC", kTH1F, {{110, 0.0, 110.0}});
Expand Down Expand Up @@ -207,6 +209,24 @@
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});
}

std::shared_ptr<TH1> hCutFlow = histos.get<TH1>(HIST("hEvent_Cut"));
std::vector<std::string> eventCutLabels = {
"All Events",
"sel8",
Form("|Vz| < %.1f", cfgEventVtxCut.value),
"kIsGoodZvtxFT0vsPV",
"kNoSameBunchPileup",
"kNoTimeFrameBorder",
"kNoITSROFrameBorder",
"kNoCollInTimeRangeStandard",
"kIsGoodITSLayersAll",
Form("Occupancy < %.0f", cfgOccupancyMax.value),
"All passed events"};
for (size_t i = 0; i < eventCutLabels.size(); ++i) {
hCutFlow->GetXaxis()->SetBinLabel(i + 1, eventCutLabels[i].c_str());
}

} // end of init

using EventCandidates = soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::MultZeqs, aod::CentFT0Cs>; //, aod::CentFT0Ms, aod::CentFT0As
Expand Down Expand Up @@ -235,29 +255,57 @@
bool eventSelection(const EventType event)
{
if (cfgEventCutQA) {
histos.fill(HIST("hEvent_Cut"), 0);
histos.fill(HIST("hPosZ_BC"), event.posZ());
histos.fill(HIST("hcentFT0C_BC"), event.centFT0C());
}
if (!event.sel8())
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 1);

if (std::abs(event.posZ()) > cfgEventVtxCut)
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 2);

if (!event.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 3);

if (!event.selection_bit(aod::evsel::kNoSameBunchPileup))
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 4);

if (!event.selection_bit(aod::evsel::kNoTimeFrameBorder))
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 5);

if (!event.selection_bit(aod::evsel::kNoITSROFrameBorder))
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 6);

if (!event.selection_bit(aod::evsel::kNoCollInTimeRangeStandard))
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 7);

if (!event.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 8);

if (cfgOccupancySel && (event.trackOccupancyInTimeRange() > cfgOccupancyMax || event.trackOccupancyInTimeRange() < cfgOccupancyMin))
return false;
if (cfgEventCutQA)
histos.fill(HIST("hEvent_Cut"), 9);

if (cfgEventCutQA) {
histos.fill(HIST("hEvent_Cut"), 10);
histos.fill(HIST("hPosZ_AC"), event.posZ());
histos.fill(HIST("hcentFT0C_AC"), event.centFT0C());
}
Expand All @@ -279,7 +327,6 @@
histos.fill(HIST("hTPCChi2_BC"), track.tpcChi2NCl());
histos.fill(HIST("QA_track_pT_BC"), track.pt());
}

if (cfgTrackGlobalSel && !track.isGlobalTrack())
return false;
if (track.pt() < cfgTrackMinPt)
Expand Down Expand Up @@ -361,7 +408,7 @@
tofpid = 999;
}
}
if (std::sqrt(tpcpid * tpcpid + tofpid * tofpid) < cfgTrackCircleValue) {
if (tpcpid * tpcpid + tofpid * tofpid < cfgTrackCircleValue) {
tpcPIDPassed = true;
tofPIDPassed = true;
}
Expand Down Expand Up @@ -417,7 +464,7 @@
tofpid = 999;
}
}
if (std::sqrt(tpcpid * tpcpid + tofpid * tofpid) < cfgTrackCircleValue) {
if (tpcpid * tpcpid + tofpid * tofpid < cfgTrackCircleValue) {
tpcPIDPassed = true;
tofPIDPassed = true;
}
Expand Down Expand Up @@ -531,23 +578,23 @@
mothers2PDG.push_back(particle2_mom.pdgCode());
}

if (mothers1PDG[0] != 313)

Check failure on line 581 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 583 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 589 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 591 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 597 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 @@ -573,7 +620,7 @@
mcMemory.push_back(trk2.globalIndex());
}

TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance;

Check failure on line 623 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 Down Expand Up @@ -602,7 +649,7 @@
if (trk1.globalIndex() >= trk2.globalIndex())
return {-1.0, -1.0};

TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance;

Check failure on line 652 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 @@ -780,7 +827,7 @@
++nEventsTrue;
}

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

Check failure on line 830 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