Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 12 additions & 24 deletions PWGEM/Dilepton/Core/SingleTrackQCMC.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
#include <unordered_map>
#include <vector>

using namespace o2;

Check failure on line 50 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod;

Check failure on line 51 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::framework;

Check failure on line 52 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::framework::expressions;

Check failure on line 53 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::soa;

Check failure on line 54 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod::pwgem::dilepton::utils::mcutil;

Check failure on line 55 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod::pwgem::dilepton::utils::emtrackutil;

Check failure on line 56 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMMCEventLabels>;
using MyCollision = MyCollisions::iterator;
Expand Down Expand Up @@ -317,10 +317,6 @@
fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false);
fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false);
fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false);
// fRegistry.add("Track/PID/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false);
// fRegistry.add("Track/PID/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false);
// fRegistry.add("Track/PID/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false);
// fRegistry.add("Track/PID/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false);
fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c);<cluster size> on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false);
fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c);<cluster size> on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false);
fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c);<cluster size> on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false);
Expand Down Expand Up @@ -407,10 +403,10 @@
addhistograms();

if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) {
pdg_lepton = 11;

Check failure on line 406 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

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.
DefineDielectronCut();
} else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) {
pdg_lepton = 13;

Check failure on line 409 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

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.
DefineDimuonCut();
}
if (doprocessNorm) {
Expand Down Expand Up @@ -693,10 +689,6 @@
fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa());
fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr());
fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl());
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu());
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi());
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa());
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr());
}
} else {
fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hs"), track.pt(), track.eta(), track.phi(), dca3D, dcaXY, dcaZ, -mctrack.pdgCode() / pdg_lepton, weight);
Expand Down Expand Up @@ -742,10 +734,6 @@
fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa());
fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr());
fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl());
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu());
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi());
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa());
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr());
}
}
}
Expand Down Expand Up @@ -891,7 +879,7 @@
int pdg_mother = std::abs(mcmother.pdgCode());

if (mctrack.isPhysicalPrimary() || mctrack.producedByGenerator()) {
if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) {

Check failure on line 882 in PWGEM/Dilepton/Core/SingleTrackQCMC.h

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.
fillTrackInfo<0, TMCParticles>(track); // lf
if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) {
fillTrackInfo<1, TMCParticles>(track); // lf_prompt
Expand All @@ -908,14 +896,14 @@
} else {
fillTrackInfo<5, TMCParticles>(track);
}
} else if (IsFromBeauty(mctrack, mcparticles) > 0) { // b is found in full decay chain.
if (IsFromCharm(mctrack, mcparticles) > 0) { // c is found in full decay chain.
fillTrackInfo<9, TMCParticles>(track);
} else if (isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain.
fillTrackInfo<8, TMCParticles>(track);
} else if (isWeakDecayFromCharmHadron(mctrack, mcparticles)) { // hc->l is found in full decay chain.
if (IsFromBeauty(mcmother, mcparticles) > 0) {
fillTrackInfo<9, TMCParticles>(track); // hb->hc->l is fond.
} else {
fillTrackInfo<8, TMCParticles>(track);
fillTrackInfo<7, TMCParticles>(track); // prompt hc->l is found.
}
} else if (IsFromCharm(mctrack, mcparticles) > 0) { // c is found in full decay chain. Not from b.
fillTrackInfo<7, TMCParticles>(track);
}
} else {
if (pdg_mother == 22) { // photon conversion
Expand Down Expand Up @@ -1013,14 +1001,14 @@
} else {
fRegistry.fill(HIST("Generated/PromptPsi2S/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
}
} else if (IsFromBeauty(lepton, mcparticles) > 0) { // b is found in full decay chain.
if (IsFromCharm(lepton, mcparticles) > 0) { // c is found in full decay chain.
fRegistry.fill(HIST("Generated/b2c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
} else if (isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found
fRegistry.fill(HIST("Generated/b2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
} else if (isWeakDecayFromCharmHadron(lepton, mcparticles)) { // hc->l is found in full decay chain.
if (IsFromBeauty(mcmother, mcparticles) > 0) {
fRegistry.fill(HIST("Generated/b2c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // hb->hc->l is found in full decay chain.
} else {
fRegistry.fill(HIST("Generated/b2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
fRegistry.fill(HIST("Generated/c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // prompt hc->l is found in full decay chain.
}
} else if (IsFromCharm(lepton, mcparticles) > 0) { // c is found in full decay chain. Not from b.
fRegistry.fill(HIST("Generated/c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
}
} // end of mc lepton loop per collision

Expand Down
172 changes: 127 additions & 45 deletions PWGEM/Dilepton/Utils/MCUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,127 @@ int hasFakeMatchMFTMCH(TTrack const& track)
}
}
//_______________________________________________________________________
template <typename T>
bool isCharmonia(T const& track)
{
if (std::abs(track.pdgCode()) < 100) {
return false;
}

std::string pdgStr = std::to_string(std::abs(track.pdgCode()));
int n = pdgStr.length();
int pdg3 = std::stoi(pdgStr.substr(n - 3, 3));

if (pdg3 == 441 || pdg3 == 443 || pdg3 == 445 || pdg3 == 447) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isCharmMeson(T const& track)
{
if (isCharmonia(track)) {
return false;
}

if (400 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 500) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isCharmBaryon(T const& track)
{
if (4000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 5000) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isBottomonia(T const& track)
{
if (std::abs(track.pdgCode()) < 100) {
return false;
}

std::string pdgStr = std::to_string(std::abs(track.pdgCode()));
int n = pdgStr.length();
int pdg3 = std::stoi(pdgStr.substr(n - 3, 3));

if (pdg3 == 551 || pdg3 == 553 || pdg3 == 555 || pdg3 == 557) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isBeautyMeson(T const& track)
{
if (isBottomonia(track)) {
return false;
}

if (500 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 600) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isBeautyBaryon(T const& track)
{
if (5000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 6000) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T, typename U>
bool isWeakDecayFromCharmHadron(T const& mcParticle, U const& mcParticles)
{
// require that the direct mother is charm hadron via semileptonic. e.g. hc->e, not hc->X->pi0->eegamma
if (!mcParticle.has_mothers()) {
return false;
}
if (mcParticle.getProcess() != 4) { // weak decay
return false;
}
auto mp = mcParticles.iteratorAt(mcParticle.mothersIds()[0]);
if (isCharmMeson(mp) || isCharmBaryon(mp)) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T, typename U>
bool isWeakDecayFromBeautyHadron(T const& mcParticle, U const& mcParticles)
{
// require that the direct mother is beauty hadron via semileptonice decay. e.g. hb->e, not hb->X->pi0->eegamma
if (!mcParticle.has_mothers()) {
return false;
}
if (mcParticle.getProcess() != 4) { // weak decay
return false;
}
auto mp = mcParticles.iteratorAt(mcParticle.mothersIds()[0]);
if (isBeautyMeson(mp) || isBeautyBaryon(mp)) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
//_______________________________________________________________________
template <typename TMCParticle1, typename TMCParticle2>
int FindCommonMotherFrom2ProngsWithoutPDG(TMCParticle1 const& p1, TMCParticle2 const& p2)
{
Expand Down Expand Up @@ -436,12 +557,12 @@ int IsHF(TMCParticle1 const& p1, TMCParticle2 const& p2, TMCParticles const& mcp
bool isFOFound1 = findFlavorOscillationB(p1, mcparticles);
bool isFOFound2 = findFlavorOscillationB(p2, mcparticles);

bool is_direct_from_b1 = IsFromBeauty(p1, mcparticles) > 0 && IsFromCharm(p1, mcparticles) < 0;
bool is_direct_from_b2 = IsFromBeauty(p2, mcparticles) > 0 && IsFromCharm(p2, mcparticles) < 0;
bool is_prompt_c1 = IsFromBeauty(p1, mcparticles) < 0 && IsFromCharm(p1, mcparticles) > 0;
bool is_prompt_c2 = IsFromBeauty(p2, mcparticles) < 0 && IsFromCharm(p2, mcparticles) > 0;
bool is_c_from_b1 = IsFromBeauty(p1, mcparticles) > 0 && IsFromCharm(p1, mcparticles) > 0;
bool is_c_from_b2 = IsFromBeauty(p2, mcparticles) > 0 && IsFromCharm(p2, mcparticles) > 0;
bool is_direct_from_b1 = isWeakDecayFromBeautyHadron(p1, mcparticles);
bool is_direct_from_b2 = isWeakDecayFromBeautyHadron(p2, mcparticles);
bool is_prompt_c1 = isWeakDecayFromCharmHadron(p1, mcparticles) && IsFromBeauty(p1, mcparticles) < 0;
bool is_prompt_c2 = isWeakDecayFromCharmHadron(p2, mcparticles) && IsFromBeauty(p2, mcparticles) < 0;
bool is_c_from_b1 = isWeakDecayFromCharmHadron(p1, mcparticles) && IsFromBeauty(p1, mcparticles) > 0;
bool is_c_from_b2 = isWeakDecayFromCharmHadron(p2, mcparticles) && IsFromBeauty(p2, mcparticles) > 0;

if (is_prompt_c1 && is_prompt_c2 && mpfh1.pdgCode() * mpfh2.pdgCode() < 0) { // charmed mesons never oscillate. only ULS
mothers_id1.clear();
Expand Down Expand Up @@ -640,45 +761,6 @@ bool checkFromSameQuarkPair(T& p1, T& p2, U& mcParticles, int pdg)
return id1 == id2 && id1 > -1 && id2 > -1;
}
//_______________________________________________________________________
template <typename T>
bool isCharmMeson(T const& track)
{
if (400 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 500) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isCharmBaryon(T const& track)
{
if (4000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 5000) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isBeautyMeson(T const& track)
{
if (500 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 600) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
template <typename T>
bool isBeautyBaryon(T const& track)
{
if (5000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 6000) {
return true;
} else {
return false;
}
}
//_______________________________________________________________________
//_______________________________________________________________________
} // namespace o2::aod::pwgem::dilepton::utils::mcutil
Expand Down
Loading