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
111 changes: 58 additions & 53 deletions PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -158,7 +158,7 @@
if (skipAmbiTracks) {
svCreator.setSkipAmbiTracks();
}
for (int i = 0; i < 5; i++) {

Check failure on line 161 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.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.
mBBparamsDaug[i] = cfgBetheBlochParams->get("Daughter", Form("p%i", i));
}
mBBparamsDaug[5] = cfgBetheBlochParams->get("Daughter", "resolution");
Expand All @@ -170,9 +170,9 @@
// ITS-standalone (no TPC, no TOF)
if (!kaontopologhy) {
if (candidate.has_collision() && candidate.hasITS() && !candidate.hasTPC() && !candidate.hasTOF() &&
candidate.itsNCls() < 6 &&

Check failure on line 173 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.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.
candidate.itsNClsInnerBarrel() == 3 &&

Check failure on line 174 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.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.
candidate.itsChi2NCl() < 36 &&

Check failure on line 175 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.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.
candidate.pt() > minPtMoth) {
return true;
}
Expand Down Expand Up @@ -290,12 +290,12 @@
auto propDaugTrack = fitter.getTrack(1);
kinkCand.decVtx = fitter.getPCACandidatePos();

for (int i = 0; i < 3; i++) {

Check failure on line 293 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.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.
kinkCand.decVtx[i] -= kinkCand.primVtx[i];
}
propMothTrack.getPxPyPzGlo(kinkCand.momMoth);
propDaugTrack.getPxPyPzGlo(kinkCand.momDaug);
for (int i = 0; i < 3; i++) {

Check failure on line 298 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.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.
kinkCand.momMoth[i] *= charge;
kinkCand.momDaug[i] *= charge;
}
Expand Down Expand Up @@ -379,15 +379,15 @@
Configurable<float> maxqt{"maxqt", 0.3, "max qt for kaon"};

Configurable<int> centestimator{"centestimator", 0, "Select multiplicity estimator: 0 - FT0C, 1 - FT0A, 2 - FT0M, 3 - FV0A, 4 - PVTracks"};
Configurable<int> pid{"pidMother", 321, ""};

Check failure on line 382 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<int> dpid{"pidDaughter", 13, ""};

Check failure on line 383 in PWGLF/Tasks/Nuspex/spectraKinkPiKa.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<bool> d0pid{"dopid", 0, ""};
Configurable<bool> dptCut{"dptCut", 0, ""};
Configurable<bool> qa{"qa", 0, ""};
Configurable<int> maxtpcncle{"maxtpcncle", 0, "max tpc find ncle"};
Configurable<int> mintpcncle{"mintpcncle", 0, "min tpc find ncle"};
Configurable<bool> onlykaon{"onlykaon", 0, "kaon"};
Configurable<bool> onlypion{"onlypion", 0, "pion"};
Configurable<bool> additionalhist{"additionalhist", 1, "additional histogram"};

ConfigurableAxis ptAxis{"ptAxis", {150, 0, 15}, ""};
ConfigurableAxis qtAxis{"qtAxis", {2000, 0.0, 2.0}, ""};
Expand Down Expand Up @@ -470,6 +470,9 @@
rpiKkink.add("tr_tpcnclfindM_m", "tpcnclfindm", {HistType::kTH1F, {{300, 0.0, 300.0}}});
rpiKkink.add("tr_tpcnclfindD_m", "tpcnclfindd", {HistType::kTH1F, {{300, 0.0, 300.0}}});
rpiKkink.add("tr_itsChi2NClM_m", "itsChi2NClm", {HistType::kTH1F, {{200, 0.0, 200.0}}});

rpiKkink.add("h2_kinkradius_vs_pt_m", "kinkradius_vs_pt", {HistType::kTH2F, {{250, 0.0, 250.0}, ptAxis}});
rpiKkink.add("h2_kinkradius_vs_ncl_m", "kinkradius_vs_ncl", {HistType::kTH2F, {{250, 0.0, 250.0}, {300, 0.0, 300.0}}});
}
if (doprocessMC) {
rpiKkink.add("h2_dau_pt_vs_eta_gen", "pt_vs_eta_dau", {HistType::kTH2F, {ptAxis, etaAxis}});
Expand All @@ -489,8 +492,6 @@
rpiKkink.add("h2_kink_angle_m", "kink angle", {HistType::kTH2F, {kinkAxis, multAxis}});
rpiKkink.add("h2_invmass_kaon_m", "Inv mass vs Pt", {HistType::kTH3F, {massAxis, ptAxis, ptAxis}});
rpiKkink.add("h2_kaon_mc_rec_m", "h2_kaon_mc_rec_m", HistType::kTHnSparseF, {massAxis, ptAxis, etaAxis, qtAxis, multAxis}, true);

// qa
}
}

Expand Down Expand Up @@ -576,14 +577,14 @@

rpiKkink.fill(HIST("tr_chi2nclM"), mothTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_chi2nclD"), dauTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_tpcnclfindM"), mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindD"), dauTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindM"), mothTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_tpcnclfindD"), dauTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_itsChi2NClM"), mothTrack.itsChi2NCl());
}
if (mothTrack.tpcChi2NCl() > tpcChi2Cut)
continue;

if (mothTrack.tpcNClsFindable() > maxtpcncle || mothTrack.tpcNClsFindable() < mintpcncle)
if (mothTrack.tpcNClsFound() > maxtpcncle || mothTrack.tpcNClsFound() < mintpcncle)
continue;

if (std::abs(mothTrack.tpcNSigmaKa()) < cutNSigmaKa) {
Expand All @@ -610,9 +611,9 @@
rpiKkink.fill(HIST("h2_kinkradius_vs_vz"), kinkCand.zDecVtx(), radiusxy);
rpiKkink.fill(HIST("h2_kink_vx_vs_vy"), kinkCand.xDecVtx(), kinkCand.yDecVtx());
rpiKkink.fill(HIST("h2_kinkradius_vs_pt"), radiusxy, v0.Pt());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl"), radiusxy, mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl"), radiusxy, mothTrack.tpcNClsFound());
}
if (kinkCand.dcaMothPv() > dcaXYcut)
if (std::abs(kinkCand.dcaMothPv()) > dcaXYcut)
continue;

if (kinkCand.dcaKinkTopo() > dcaXYcutkink)
Expand All @@ -632,12 +633,14 @@

if (kaon && onlykaon && std::abs(v0.Rapidity()) < rapCut) {
v0.SetCoordinates(mothTrack.px(), mothTrack.py(), mothTrack.pz(), o2::constants::physics::MassKaonCharged);
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle"), kinkangle, multiplicity);
if (additionalhist) {
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle"), kinkangle, multiplicity);
rpiKkink.fill(HIST("h2_qt_vs_pt"), ptd, v1.Pt());
}
double mass = computeMotherMass(v0, v1);
rpiKkink.fill(HIST("h2_qt_vs_pt"), ptd, v1.Pt());
rpiKkink.fill(HIST("h2_kaon_data"), mass, v0.Pt(), v0.Rapidity(), ptd, multiplicity);

if (qa && ptd > minqt && ptd < maxqt) {
Expand All @@ -650,26 +653,28 @@

rpiKkink.fill(HIST("tr_chi2nclM_m"), mothTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_chi2nclD_m"), dauTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_tpcnclfindM_m"), mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindD_m"), dauTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindM_m"), mothTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_tpcnclfindD_m"), dauTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_itsChi2NClM_m"), mothTrack.itsChi2NCl());

rpiKkink.fill(HIST("tr_dcaxyM_m"), kinkCand.dcaMothPv());
rpiKkink.fill(HIST("tr_dcaxyD_m"), kinkCand.dcaDaugPv());
rpiKkink.fill(HIST("tr_dcaxykink_topo_m"), kinkCand.dcaKinkTopo());

rpiKkink.fill(HIST("h2_kinkradius_vs_pt"), radiusxy, v0.Pt());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl"), radiusxy, mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl"), radiusxy, mothTrack.tpcNClsFound());
}
}
if (pion && onlypion && std::abs(v0.Rapidity()) < rapCut) {
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec_pion"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec_pion"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec_pion"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle_pion"), kinkangle, multiplicity);
v0.SetCoordinates(mothTrack.px(), mothTrack.py(), mothTrack.pz(), o2::constants::physics::MassPionCharged);
if (additionalhist) {
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec_pion"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec_pion"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec_pion"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle_pion"), kinkangle, multiplicity);
rpiKkink.fill(HIST("h2_qt_vs_ptpion"), ptd, v1.Pt());
}
double mass = computeMotherMass(v0, v1);
rpiKkink.fill(HIST("h2_qt_vs_ptpion"), ptd, v1.Pt());
rpiKkink.fill(HIST("h2_pion_data"), mass, v0.Pt(), v0.Rapidity(), ptd, multiplicity);
}
}
Expand Down Expand Up @@ -724,14 +729,14 @@

rpiKkink.fill(HIST("tr_chi2nclM"), mothTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_chi2nclD"), dauTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_tpcnclfindM"), mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindD"), dauTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindM"), mothTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_tpcnclfindD"), dauTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_itsChi2NClM"), mothTrack.itsChi2NCl());
}
if (mothTrack.tpcChi2NCl() > tpcChi2Cut)
continue;

if (mothTrack.tpcNClsFindable() > maxtpcncle || mothTrack.tpcNClsFindable() < mintpcncle)
if (mothTrack.tpcNClsFound() > maxtpcncle || mothTrack.tpcNClsFound() < mintpcncle)
continue;

bool kaon = false;
Expand All @@ -756,9 +761,9 @@
rpiKkink.fill(HIST("h2_kink_vx_vs_vy"), kinkCand.xDecVtx(), kinkCand.yDecVtx());

rpiKkink.fill(HIST("h2_kinkradius_vs_pt"), radiusxy, v0.Pt());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl"), radiusxy, mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl"), radiusxy, mothTrack.tpcNClsFound());
}
if (kinkCand.dcaMothPv() > dcaXYcut)
if (std::abs(kinkCand.dcaMothPv()) > dcaXYcut)
continue;

if (kinkCand.dcaKinkTopo() > dcaXYcutkink)
Expand All @@ -771,12 +776,12 @@
float radToDeg = o2::constants::math::Rad2Deg;
if (kinkangle * radToDeg < kinkanglecut)
continue;

rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle"), kinkangle, multiplicity);

if (additionalhist) {
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle"), kinkangle, multiplicity);
}
TVector3 pdlab(v1.Px(), v1.Py(), v1.Pz());
// Compute transverse component
TVector3 motherDir(v0.Px(), v0.Py(), v0.Pz());
Expand All @@ -796,6 +801,7 @@

auto mcTrackMoth = mcLabMoth.mcParticle_as<aod::McParticles>();
auto mcTrackDau = mcLabDau.mcParticle_as<aod::McParticles>();

if (!mcTrackDau.has_mothers()) {
continue;
}
Expand All @@ -806,10 +812,12 @@
if (std::abs(mcTrackMoth.pdgCode()) != pid || std::abs(mcTrackDau.pdgCode()) != dpid) {
continue;
}
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec_m"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec_m"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec_m"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle_m"), kinkangle, multiplicity);
if (additionalhist) {
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_rec_m"), v0.Pt(), v0.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_rec_m"), v1.Pt(), v1.Eta(), multiplicity);
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_rec_m"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle_m"), kinkangle, multiplicity);
}
rpiKkink.fill(HIST("h2_kaon_mc_rec_m"), mass, v0.Pt(), v0.Rapidity(), ptd, multiplicity);

if (qa && ptd > minqt && ptd < maxqt) {
Expand All @@ -822,16 +830,16 @@

rpiKkink.fill(HIST("tr_chi2nclM_m"), mothTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_chi2nclD_m"), dauTrack.tpcChi2NCl());
rpiKkink.fill(HIST("tr_tpcnclfindM_m"), mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindD_m"), dauTrack.tpcNClsFindable());
rpiKkink.fill(HIST("tr_tpcnclfindM_m"), mothTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_tpcnclfindD_m"), dauTrack.tpcNClsFound());
rpiKkink.fill(HIST("tr_itsChi2NClM_m"), mothTrack.itsChi2NCl());

rpiKkink.fill(HIST("tr_dcaxyM_m"), kinkCand.dcaMothPv());
rpiKkink.fill(HIST("tr_dcaxyD_m"), kinkCand.dcaDaugPv());
rpiKkink.fill(HIST("tr_dcaxykink_topo_m"), kinkCand.dcaKinkTopo());

rpiKkink.fill(HIST("h2_kinkradius_vs_pt_m"), radiusxy, v0.Pt());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl_m"), radiusxy, mothTrack.tpcNClsFindable());
rpiKkink.fill(HIST("h2_kinkradius_vs_ncl_m"), radiusxy, mothTrack.tpcNClsFound());
}
}
}
Expand All @@ -842,13 +850,10 @@
ROOT::Math::PxPyPzMVector v0;
ROOT::Math::PxPyPzMVector v1;

if (!d0pid && (std::abs(mcPart.pdgCode()) != pid || std::abs(mcPart.eta()) > etaCut)) {
continue;
}
bool isDmeson = std::abs(mcPart.pdgCode()) == kD0 || std::abs(mcPart.pdgCode()) == kDPlus || std::abs(mcPart.pdgCode()) == kDStar;
if (d0pid && (!isDmeson || std::abs(mcPart.eta()) > etaCut)) {
if (std::abs(mcPart.pdgCode()) != pid) {
continue;
}

if (!mcPart.has_daughters()) {
continue; // Skip if no daughters
}
Expand All @@ -863,27 +868,27 @@
if (!hasKaonpionDaughter) {
continue; // Skip if no muon daughter found
}
if (!d0pid && pid == kKPlus) {
if (pid == kKPlus) {
v0.SetCoordinates(mcPart.px(), mcPart.py(), mcPart.pz(), o2::constants::physics::MassKaonCharged);
}

if (!d0pid && pid == kPiPlus) {
if (pid == kPiPlus) {
v0.SetCoordinates(mcPart.px(), mcPart.py(), mcPart.pz(), o2::constants::physics::MassPionCharged);
}
if (d0pid) {
v0.SetCoordinates(mcPart.px(), mcPart.py(), mcPart.pz(), o2::constants::physics::MassD0);
}

float pMoth = v0.P();
float pDaug = v1.P();
float spKink = v0.Px() * v1.Px() + v0.Py() * v1.Py() + v0.Pz() * v1.Pz();
float kinkangle = std::acos(spKink / (pMoth * pDaug));
float radToDeg = o2::constants::math::Rad2Deg;
if (kinkangle * radToDeg < kinkanglecut)
continue;
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_gen"), v0.Pt(), v0.Eta());
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_gen"), v1.Pt(), v1.Eta());
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_gen"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle_gen"), kinkangle);
if (additionalhist) {
rpiKkink.fill(HIST("h2_moth_pt_vs_eta_gen"), v0.Pt(), v0.Eta());
rpiKkink.fill(HIST("h2_dau_pt_vs_eta_gen"), v1.Pt(), v1.Eta());
rpiKkink.fill(HIST("h2_pt_moth_vs_dau_gen"), v0.Pt(), v1.Pt());
rpiKkink.fill(HIST("h2_kink_angle_gen"), kinkangle);
}
TVector3 pdlab(v1.Px(), v1.Py(), v1.Pz());
// Compute transverse component
TVector3 motherDir(v0.Px(), v0.Py(), v0.Pz());
Expand Down
Loading