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
91 changes: 45 additions & 46 deletions PWGEM/Dilepton/Tasks/taggingHFE.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <array>
#include <cmath>
#include <cstdint>
#include <iostream>

Check failure on line 57 in PWGEM/Dilepton/Tasks/taggingHFE.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <random>
#include <string>
#include <string_view>
Expand Down Expand Up @@ -190,7 +190,7 @@
Configurable<float> cfg_max_mass_lambda_veto{"cfg_max_mass_lambda_veto", 1.12, "max mass for Lambda veto for K0S"};
Configurable<float> cfg_min_cospa{"cfg_min_cospa", 0.95, "min cospa for v0"};
Configurable<float> cfg_max_dca2legs{"cfg_max_dca2legs", 0.1, "max distance between 2 legs for v0"};
// Configurable<float> cfg_min_radius{"cfg_min_radius", 0.1, "min rxy for v"};
Configurable<float> cfg_min_radius{"cfg_min_radius", 0.1, "min rxy for v"};
Configurable<float> cfg_min_cr2findable_ratio_tpc{"cfg_min_cr2findable_ratio_tpc", 0.f, "min. TPC Ncr/Nf ratio"};
Configurable<float> cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"};
Configurable<int> cfg_min_ncrossedrows_tpc{"cfg_min_ncrossedrows_tpc", 70, "min ncrossed rows"};
Expand Down Expand Up @@ -224,20 +224,20 @@
std::string prefix = "cascadeCut";
Configurable<float> cfg_min_mass_lambda{"cfg_min_mass_lambda", 1.11, "min mass for lambda in cascade"};
Configurable<float> cfg_max_mass_lambda{"cfg_max_mass_lambda", 1.12, "max mass for lambda in cascade"};
Configurable<float> cfg_min_mass_Xi{"cfg_min_mass_Xi", 1.316, "min mass for Xi"};
Configurable<float> cfg_max_mass_Xi{"cfg_max_mass_Xi", 1.326, "max mass for Xi"};
Configurable<float> cfg_min_mass_Xi{"cfg_min_mass_Xi", 1.314, "min mass for Xi"};
Configurable<float> cfg_max_mass_Xi{"cfg_max_mass_Xi", 1.328, "max mass for Xi"};
Configurable<float> cfg_min_mass_Xi_veto{"cfg_min_mass_Xi_veto", 1.31, "min mass for Xi veto"};
Configurable<float> cfg_max_mass_Xi_veto{"cfg_max_mass_Xi_veto", 1.33, "max mass for Xi veto"};
Configurable<float> cfg_min_mass_Omega{"cfg_min_mass_Omega", 1.669, "min mass for Omega"};
Configurable<float> cfg_max_mass_Omega{"cfg_max_mass_Omega", 1.675, "max mass for Omega"};
Configurable<float> cfg_min_mass_Omega_veto{"cfg_min_mass_Omega_veto", 1.66, "min mass for Omega veto"};
Configurable<float> cfg_max_mass_Omega_veto{"cfg_max_mass_Omega_veto", 1.68, "max mass for Omega veto"};
Configurable<float> cfg_min_cospa_v0{"cfg_min_cospa_v0", 0.9, "minimum V0 CosPA in cascade"};
Configurable<float> cfg_min_mass_Omega{"cfg_min_mass_Omega", 1.668, "min mass for Omega"};
Configurable<float> cfg_max_mass_Omega{"cfg_max_mass_Omega", 1.678, "max mass for Omega"};
Configurable<float> cfg_min_mass_Omega_veto{"cfg_min_mass_Omega_veto", 1.665, "min mass for Omega veto"};
Configurable<float> cfg_max_mass_Omega_veto{"cfg_max_mass_Omega_veto", 1.680, "max mass for Omega veto"};
Configurable<float> cfg_min_cospa_v0{"cfg_min_cospa_v0", 0.95, "minimum V0 CosPA in cascade"};
Configurable<float> cfg_max_dcadau_v0{"cfg_max_dcadau_v0", 0.1, "max distance between V0 Daughters in cascade"};
Configurable<float> cfg_min_cospa{"cfg_min_cospa", 0.9, "minimum cascade CosPA"};
Configurable<float> cfg_min_cospa{"cfg_min_cospa", 0.95, "minimum cascade CosPA"};
Configurable<float> cfg_max_dcadau{"cfg_max_dcadau", 0.1, "max distance between bachelor and V0"};
Configurable<float> cfg_min_rxy_v0{"cfg_min_rxy_v0", 1.2, "minimum V0 rxy in cascade"};
Configurable<float> cfg_min_rxy{"cfg_min_rxy", 0.5, "minimum V0 rxy in cascade"};
Configurable<float> cfg_min_rxy_v0{"cfg_min_rxy_v0", 0.1, "minimum V0 rxy in cascade"};
Configurable<float> cfg_min_rxy{"cfg_min_rxy", 0.1, "minimum V0 rxy in cascade"};
Configurable<float> cfg_min_dcaxy_v0leg{"cfg_min_dcaxy_v0leg", 0.1, "min dca XY for v0 legs in cm"};
Configurable<float> cfg_min_dcaxy_bachelor{"cfg_min_dcaxy_bachelor", 0.05, "min dca XY for bachelor in cm"};
Configurable<float> cfg_min_dcaxy_v0{"cfg_min_dcaxy_v0", 0.05, "min dca XY for V0 in cm"};
Expand Down Expand Up @@ -1182,12 +1182,6 @@
auto pos = v0.template posTrack_as<TTracks>();
auto neg = v0.template negTrack_as<TTracks>();

if (v0.dcaV0daughters() > v0Cut.cfg_max_dca2legs) {
continue;
}
if (v0.v0cosPA() < v0Cut.cfg_min_cospa) {
continue;
}
if (pos.sign() * neg.sign() > 0) {
continue;
}
Expand Down Expand Up @@ -1268,35 +1262,6 @@
continue;
}

if (cascade.cascradius() > cascade.v0radius()) {
continue;
}

if (cascade.dcaV0daughters() > cascadeCut.cfg_max_dcadau_v0) {
continue;
}
if (cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_cospa_v0) {
continue;
}
if (cascade.v0radius() < cascadeCut.cfg_min_rxy_v0) {
continue;
}

if (cascade.cascradius() < cascadeCut.cfg_min_rxy) {
continue;
}

if (cascade.dcacascdaughters() > cascadeCut.cfg_max_dcadau) {
continue;
}
if (cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_cospa) {
continue;
}

if (cascade.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_dcaxy_v0) {
continue;
}

if (!isSelectedV0Leg(pos) || !isSelectedV0Leg(neg) || !isSelectedV0Leg(bachelor)) {
continue;
}
Expand Down Expand Up @@ -1559,6 +1524,18 @@
continue;
}

if (v0.dcaV0daughters() > v0Cut.cfg_max_dca2legs) {
continue;
}

if (v0.v0radius() < v0Cut.cfg_min_radius) {
continue;
}

if (v0.v0cosPA() < v0Cut.cfg_min_cospa) {
continue;
}

fillV0Histograms(collision, v0);

if (std::sqrt(std::pow(v0.alpha() / v0Cut.cfg_max_alpha_veto, 2) + std::pow(v0.qtarm() / v0Cut.cfg_max_qt_veto, 2)) < 1.f) { // photon conversion rejection at small qT
Expand Down Expand Up @@ -1607,6 +1584,28 @@
continue;
}

if (cascade.cascradius() > cascade.v0radius()) {
continue;
}

if (cascade.dcaV0daughters() > cascadeCut.cfg_max_dcadau_v0) {
continue;
}
if (cascade.v0radius() < cascadeCut.cfg_min_rxy_v0) {
continue;
}
if (cascade.cascradius() < cascadeCut.cfg_min_rxy) {
continue;
}

if (cascade.dcacascdaughters() > cascadeCut.cfg_max_dcadau) {
continue;
}

// if (cascade.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascadeCut.cfg_min_dcaxy_v0) {
// continue;
// }

fillCascadeHistograms(collision, cascade);

if (cascade.sign() < 0) { // Xi- or Omega-
Expand Down Expand Up @@ -1640,10 +1639,10 @@
bool isMotherFromB = IsFromBeauty(mcMother, mcParticles) > -1;
auto mcCollision = mcpos.template mcCollision_as<aod::McCollisions>();

bool is_e_from_dy = std::abs(mcMother.pdgCode()) == 23; // virtual photon is Z in simulation.

Check failure on line 1642 in PWGEM/Dilepton/Tasks/taggingHFE.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.
bool is_e_from_jpsi = std::abs(mcMother.pdgCode()) == 443; // e from prompt J/psi is treated as the same as Z. // e from nonprompt J/psi is treated as the same as B.

Check failure on line 1643 in PWGEM/Dilepton/Tasks/taggingHFE.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.
bool is_e_from_hc = (std::abs(mcMother.pdgCode()) == 411 || std::abs(mcMother.pdgCode()) == 421 || std::abs(mcMother.pdgCode()) == 431 || std::abs(mcMother.pdgCode()) == 4122 || std::abs(mcMother.pdgCode()) == 4132 || std::abs(mcMother.pdgCode()) == 4232 || std::abs(mcMother.pdgCode()) == 4332) && isSemiLeptonic(mcMother, mcParticles, -cfgPdgLepton, cfgPdgLepton + 1);

Check failure on line 1644 in PWGEM/Dilepton/Tasks/taggingHFE.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.
bool is_e_from_hb = (std::abs(mcMother.pdgCode()) == 511 || std::abs(mcMother.pdgCode()) == 521 || std::abs(mcMother.pdgCode()) == 531 || std::abs(mcMother.pdgCode()) == 541 || std::abs(mcMother.pdgCode()) == 5122 || std::abs(mcMother.pdgCode()) == 5132 || std::abs(mcMother.pdgCode()) == 5232 || std::abs(mcMother.pdgCode()) == 5332) && isSemiLeptonic(mcMother, mcParticles, -cfgPdgLepton, cfgPdgLepton + 1);

Check failure on line 1645 in PWGEM/Dilepton/Tasks/taggingHFE.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.
if (!(is_e_from_dy || is_e_from_jpsi || is_e_from_hc || is_e_from_hb)) {
continue;
}
Expand Down Expand Up @@ -1680,7 +1679,7 @@
bool foundCommonMother = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mckaon) > 0;
if (mckaon.has_mothers() && !foundCommonMother) {
auto mcMother_of_kaon = mckaon.template mothers_first_as<aod::McParticles>();
if (mcMother_of_kaon.pdgCode() == -323 || mcMother_of_kaon.pdgCode() == -313 || mcMother_of_kaon.pdgCode() == 333 || mcMother_of_kaon.pdgCode() == -413) { // accept short-lived resonances such as phi->KK, K*(892)->Kpi for D+ -> anti-K*0(892) e+ nu_e -> (K- pi+) e+ nu_e and Ds+ -> phi e+ nu_e

Check failure on line 1682 in PWGEM/Dilepton/Tasks/taggingHFE.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.
int commonMotherId = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mcMother_of_kaon);
if (commonMotherId > 0) {
foundCommonMother = true;
Expand Down Expand Up @@ -1744,7 +1743,7 @@
bool foundCommonMother = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mckaon) > 0;
if (mckaon.has_mothers() && !foundCommonMother) {
auto mcMother_of_kaon = mckaon.template mothers_first_as<aod::McParticles>();
if (mcMother_of_kaon.pdgCode() == -323 || mcMother_of_kaon.pdgCode() == -313 || mcMother_of_kaon.pdgCode() == 333 || mcMother_of_kaon.pdgCode() == -413) { // accept short-lived resonances such as phi->KK, K*(892)->Kpi for D+ -> anti-K*0(892) e+ nu_e -> (K- pi+) e+ nu_e and Ds+ -> phi e+ nu_e

Check failure on line 1746 in PWGEM/Dilepton/Tasks/taggingHFE.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.
int commonMotherId = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mcMother_of_kaon);
if (commonMotherId > 0) {
foundCommonMother = true;
Expand Down Expand Up @@ -1821,18 +1820,18 @@
bool foundCommonMother = false;
int pdgCodeIM = 0;
if (mcK0SId > 0) { // true K0S
pdgCodeV0 = 310;

Check failure on line 1823 in PWGEM/Dilepton/Tasks/taggingHFE.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.
auto mcK0S = mcParticles.rawIteratorAt(mcK0SId);
auto mcK0 = mcK0S.template mothers_first_as<aod::McParticles>(); // mother of K0S is K0 in simulation.
// LOGF(info, "mcK0S.pdgCode() = %d, mcK0.pdgCode() = %d", mcK0S.pdgCode(), mcK0.pdgCode());
if (std::abs(mcK0.pdgCode()) == 311) {

Check failure on line 1827 in PWGEM/Dilepton/Tasks/taggingHFE.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.
mcK0S = mcK0;
}
foundCommonMother = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mcK0S) > 0;

if (mcK0S.has_mothers() && !foundCommonMother) {
auto mcMother_of_k0s = mcK0S.template mothers_first_as<aod::McParticles>();
if (mcMother_of_k0s.pdgCode() == -323 || mcMother_of_k0s.pdgCode() == -313 || mcMother_of_k0s.pdgCode() == 333) { // accept short-lived resonances such as phi->KK, K*(892)->Kpi for D+ -> anti-K*0(892) e+ nu_e -> (K- pi+) e+ nu_e and Ds+ -> phi e+ nu_e

Check failure on line 1834 in PWGEM/Dilepton/Tasks/taggingHFE.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.
int commonMotherId = FindCommonMotherFrom2ProngsWithoutPDG(mcpos, mcMother_of_k0s);
if (commonMotherId > 0) {
foundCommonMother = true;
Expand Down
Loading