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

#include "TRandom.h"
#include <TLorentzVector.h>

Check failure on line 37 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 @@ -47,7 +46,7 @@
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <iostream>

Check failure on line 49 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 All @@ -61,7 +60,7 @@
struct kstarInOO {
SliceCache cache;
Preslice<aod::Tracks> perCollision = aod::track::collisionId;
HistogramRegistry OOhistos{"OOhistos", {}, OutputObjHandlingPolicy::AnalysisObject};

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

//==================================
//||
Expand Down Expand Up @@ -102,16 +101,17 @@
Configurable<int> cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"};

// Mixing
ConfigurableAxis cfg_bins_MixVtx{"cfg_bins_MixVtx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};
ConfigurableAxis cfg_bins_MixMult{"cfg_bins_MixMult", {VARIABLE_WIDTH, 0.0f, 1.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f}, "Mixing bins - z-vertex"};
Configurable<int> cfg_Mix_NMixedEvents{"cfg_Mix_NMixedEvents", 5, "Number of mixed events per event"};
ConfigurableAxis cfg_bins_MixMult{"cfg_bins_Cent", {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, 110.0}, "Binning of the centrality axis"};
ConfigurableAxis cfg_bins_MixVtx{"cfg_bins_MixVtx", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins - z-vertex"};
Configurable<int> cfg_Mix_NMixedEvents{"cfg_Mix_NMixedEvents", 10, "Number of mixed events per event"};

// Pair
Configurable<int> cfg_MinvNBins{"cfg_MinvNBins", 300, "Number of bins for Minv axis"};
Configurable<float> cfg_MinvMin{"cfg_MinvMin", 0.60, "Minimum Minv value"};
Configurable<float> cfg_MinvMax{"cfg_MinvMax", 1.20, "Maximum Minv value"};

// Histogram
Configurable<bool> cfg_Event_CutQA{"cfg_Event_CutsQA", false, "Enable Event QA Hists"};
Configurable<bool> cfg_Track_CutQA{"cfg_Track_CutQA", false, "Enable Track QA Hists"};

// std::vector<int> eventSelectionBits;
Expand All @@ -125,6 +125,11 @@
const AxisSpec PIDAxis = {120, -6, 6};
const AxisSpec MinvAxis = {cfg_MinvNBins, cfg_MinvMin, cfg_MinvMax};

if (cfg_Event_CutQA) {
OOhistos.add("hPosZ_BC", "PosZ_Bc", kTH1F, {{100, 0.0, 15.0}});
OOhistos.add("hPosZ_AC", "PosZ_AC", kTH1F, {{100, 0.0, 15.0}});
}

if (cfg_Track_CutQA) {
OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}});
OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}});
Expand Down Expand Up @@ -165,8 +170,8 @@
// For Mixed Event
using BinningType = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;

Partition<TrackCandidates_MC> Kaon_MC = (!cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig));
Partition<TrackCandidates_MC> Pion_MC = (!cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig));
Partition<TrackCandidates_MC> Kaon_MC = nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig;
Partition<TrackCandidates_MC> Pion_MC = nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig;

double massKa = o2::constants::physics::MassKPlus;
double massPi = o2::constants::physics::MassPiMinus;
Expand All @@ -181,17 +186,16 @@
{
if (!event.sel8())
return false;

if (std::abs(event.posZ()) > cfg_Event_VtxCut)
return false;
if (!event.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))
return false;
if (!event.selection_bit(aod::evsel::kNoSameBunchPileup))
return false;

if (!event.selection_bit(aod::evsel::kNoTimeFrameBorder))
return false;
if (!event.selection_bit(aod::evsel::kNoITSROFrameBorder))
return false;

if (!event.selection_bit(aod::evsel::kNoCollInTimeRangeStandard))
return false;

Expand Down Expand Up @@ -303,7 +307,7 @@
auto tracks2 = Pion_MC->sliceByCached(aod::track::collisionId, collision2.globalIndex(), cache);
auto centrality = collision1.centFT0C();

for (auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
auto [KstarPt, Minv] = minvReconstruction(trk1, trk2);
if (Minv < 0)
continue;
Expand All @@ -328,16 +332,18 @@
template <typename TracksType>
std::pair<double, double> minvReconstruction(const TracksType& trk1, const TracksType& trk2)
{
TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance;

Check failure on line 335 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 (!trackSelection(trk1) || !trackSelection(trk2))
return {-1.0, -1.0};
if (!trackPIDKaon(trk1) || !trackPIDPion(trk2))
return {-1.0, -1.0};

if (trk1.globalIndex() == trk2.globalIndex())
return {-1.0, -1.0}; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not neede.
if (trk1.globalIndex() == trk2.globalIndex()) {
// std::cout<<"This happens"<<std::endl;

return {-1.0, -1.0}; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not neede.
}
lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massKa);
lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi);
lResonance = lDecayDaughter1 + lDecayDaughter2;
Expand All @@ -359,10 +365,10 @@
{
if (cDebugLevel > 0) {
nEvents_MC++;
if ((nEvents_MC + 1) % 10000 == 0) {

Check failure on line 368 in PWGLF/Tasks/Resonances/kstarInOO.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.
double histmem = OOhistos.getSize();
std::cout << histmem << std::endl;

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

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
std::cout << "process_SameEvent_MC: " << nEvents_MC << std::endl;

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

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}

Expand All @@ -371,9 +377,6 @@
if (!goodEv)
return;

if (std::fabs(collision.posZ()) > cfg_Event_VtxCut)
return;

bool INELgt0 = false;
for (const auto& track : tracks) {
if (std::fabs(track.eta()) < cfg_Track_MaxEta) {
Expand All @@ -385,7 +388,6 @@
return;

OOhistos.fill(HIST("nEvents_MC"), 1.5);

TrackSlicing_MC(collision, tracks, collision, tracks, false);

} // processSameEvents_MC
Expand All @@ -406,11 +408,10 @@
for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) {
if (cDebugLevel > 0) {
nEvents_MC_Mix++;
if ((nEvents_MC_Mix + 1) % 10000 == 0) {

Check failure on line 411 in PWGLF/Tasks/Resonances/kstarInOO.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.
std::cout << "Processed Mixed Events: " << nEvents_MC_Mix << std::endl;

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

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}

auto goodEv1 = eventSelection(collision1);
auto goodEv2 = eventSelection(collision2);
OOhistos.fill(HIST("nEvents_MC_Mix"), 0.5);
Expand Down
Loading