Skip to content

Commit 4d5ea6d

Browse files
authored
[PWGEM] CheckMcPairTemp, differentiate between b2cc2ll and b2cc2l_b2cc2l (#14986)
1 parent f33a60b commit 4d5ea6d

File tree

2 files changed

+81
-12
lines changed

2 files changed

+81
-12
lines changed

PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ struct checkMCPairTemplate {
309309
HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false};
310310
static constexpr std::string_view event_cut_types[2] = {"before/", "after/"};
311311
static constexpr std::string_view pair_sign_types[3] = {"uls/", "lspp/", "lsmm/"};
312-
static constexpr std::string_view dilepton_source_types[22] = {
312+
static constexpr std::string_view dilepton_source_types[23] = {
313313
"sm/Photon/", // 0
314314
"sm/PromptPi0/", // 1
315315
"sm/NonPromptPi0/", // 2
@@ -332,6 +332,7 @@ struct checkMCPairTemplate {
332332
"bbbar/b2c2l_b2l_diffb/", // 19
333333
"bbbar/b2cc2l_b2c2l/", // 20
334334
"bbbar/b2cc2l_b2cc2l/", // 21
335+
"bbbar/b2cc2ll/", // 22
335336
}; // unordered_map is better, but cannot be constexpr.
336337
static constexpr std::string_view unfolding_dilepton_source_types[3] = {"sm/", "ccbar/", "bbbar/"};
337338

@@ -568,6 +569,7 @@ struct checkMCPairTemplate {
568569
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2c2l_b2l_diffb/"); // LS
569570
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2l_b2c2l/");
570571
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2l_b2cc2l/");
572+
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2ll/");
571573

572574
if (cfgFillSeparateCharmHadronPairs) {
573575
for (int im = 0; im < nm_c; im++) {
@@ -641,6 +643,12 @@ struct checkMCPairTemplate {
641643
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2l_b2cc2l/Hc_ctau50_ctau130/");
642644
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2l_b2cc2l/Hc_ctau50_ctau300/");
643645
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2l_b2cc2l/Hc_ctau130_ctau300/");
646+
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2ll/Hc_ctau50/");
647+
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2ll/Hc_ctau130/");
648+
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2ll/Hc_ctau300/");
649+
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2ll/Hc_ctau50_ctau130/");
650+
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2ll/Hc_ctau50_ctau300/");
651+
fRegistry.addClone("Pair/ccbar/c2l_c2l/", "Pair/bbbar/b2cc2ll/Hc_ctau130_ctau300/");
644652
}
645653

646654
// for correlated bkg due to mis-identified hadrons, and true combinatorial bkg
@@ -1908,6 +1916,56 @@ struct checkMCPairTemplate {
19081916
fRegistry.fill(HIST("Pair/bbbar/b2cc2l_b2cc2l/Hc_ctau130_ctau300/lsmm/hs"), mass, pt, pair_dca, weight);
19091917
}
19101918
}
1919+
} else if (sourceId == 22) { // (Hb->Hc+Hc->l) (Hb->Hc+Hc->l) combinations categorized by Hc lifetime
1920+
if ((std::abs(pdgMotherC1) == kLambdaCPlus || std::abs(pdgMotherC1) == kXiC0) && (std::abs(pdgMotherC2) == kLambdaCPlus || std::abs(pdgMotherC2) == kXiC0)) {
1921+
if (sign1 * sign2 < 0) { // ULS
1922+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50/uls/hs"), mass, pt, pair_dca, weight);
1923+
} else if (sign1 > 0 && sign2 > 0) { // LS++
1924+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50/lspp/hs"), mass, pt, pair_dca, weight);
1925+
} else if (sign1 < 0 && sign2 < 0) { // LS--
1926+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50/lsmm/hs"), mass, pt, pair_dca, weight);
1927+
}
1928+
} else if ((std::abs(pdgMotherC1) == kD0 || std::abs(pdgMotherC1) == kDS || std::abs(pdgMotherC1) == kXiCPlus) && (std::abs(pdgMotherC2) == kD0 || std::abs(pdgMotherC2) == kDS || std::abs(pdgMotherC2) == kXiCPlus)) {
1929+
if (sign1 * sign2 < 0) { // ULS
1930+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau130/uls/hs"), mass, pt, pair_dca, weight);
1931+
} else if (sign1 > 0 && sign2 > 0) { // LS++
1932+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau130/lspp/hs"), mass, pt, pair_dca, weight);
1933+
} else if (sign1 < 0 && sign2 < 0) { // LS--
1934+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau130/lsmm/hs"), mass, pt, pair_dca, weight);
1935+
}
1936+
} else if (std::abs(pdgMotherC1) == kDPlus && std::abs(pdgMotherC2) == kDPlus) {
1937+
if (sign1 * sign2 < 0) { // ULS
1938+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau300/uls/hs"), mass, pt, pair_dca, weight);
1939+
} else if (sign1 > 0 && sign2 > 0) { // LS++
1940+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau300/lspp/hs"), mass, pt, pair_dca, weight);
1941+
} else if (sign1 < 0 && sign2 < 0) { // LS--
1942+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau300/lsmm/hs"), mass, pt, pair_dca, weight);
1943+
}
1944+
} else if (((std::abs(pdgMotherC1) == kLambdaCPlus || std::abs(pdgMotherC1) == kXiC0) && (std::abs(pdgMotherC2) == kD0 || std::abs(pdgMotherC2) == kDS || std::abs(pdgMotherC2) == kXiCPlus)) || ((std::abs(pdgMotherC2) == kLambdaCPlus || std::abs(pdgMotherC2) == kXiC0) && (std::abs(pdgMotherC1) == kD0 || std::abs(pdgMotherC1) == kDS || std::abs(pdgMotherC1) == kXiCPlus))) {
1945+
if (sign1 * sign2 < 0) { // ULS
1946+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50_ctau130/uls/hs"), mass, pt, pair_dca, weight);
1947+
} else if (sign1 > 0 && sign2 > 0) { // LS++
1948+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50_ctau130/lspp/hs"), mass, pt, pair_dca, weight);
1949+
} else if (sign1 < 0 && sign2 < 0) { // LS--
1950+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50_ctau130/lsmm/hs"), mass, pt, pair_dca, weight);
1951+
}
1952+
} else if (((std::abs(pdgMotherC1) == kLambdaCPlus || std::abs(pdgMotherC1) == kXiC0) && (std::abs(pdgMotherC2) == kDPlus)) || ((std::abs(pdgMotherC2) == kLambdaCPlus || std::abs(pdgMotherC2) == kXiC0) && (std::abs(pdgMotherC1) == kDPlus))) {
1953+
if (sign1 * sign2 < 0) { // ULS
1954+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50_ctau300/uls/hs"), mass, pt, pair_dca, weight);
1955+
} else if (sign1 > 0 && sign2 > 0) { // LS++
1956+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50_ctau300/lspp/hs"), mass, pt, pair_dca, weight);
1957+
} else if (sign1 < 0 && sign2 < 0) { // LS--
1958+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau50_ctau300/lsmm/hs"), mass, pt, pair_dca, weight);
1959+
}
1960+
} else if (((std::abs(pdgMotherC1) == kD0 || std::abs(pdgMotherC1) == kDS || std::abs(pdgMotherC1) == kXiCPlus) && (std::abs(pdgMotherC2) == kDPlus)) || ((std::abs(pdgMotherC2) == kD0 || std::abs(pdgMotherC2) == kDS || std::abs(pdgMotherC2) == kXiCPlus) && (std::abs(pdgMotherC1) == kDPlus))) {
1961+
if (sign1 * sign2 < 0) { // ULS
1962+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau130_ctau300/uls/hs"), mass, pt, pair_dca, weight);
1963+
} else if (sign1 > 0 && sign2 > 0) { // LS++
1964+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau130_ctau300/lspp/hs"), mass, pt, pair_dca, weight);
1965+
} else if (sign1 < 0 && sign2 < 0) { // LS--
1966+
fRegistry.fill(HIST("Pair/bbbar/b2cc2ll/Hc_ctau130_ctau300/lsmm/hs"), mass, pt, pair_dca, weight);
1967+
}
1968+
}
19111969
}
19121970
}
19131971
}
@@ -2266,6 +2324,9 @@ struct checkMCPairTemplate {
22662324
case static_cast<int>(EM_HFeeType::kBCCe_BCCe):
22672325
fillRecHistograms<21>(t1.sign(), t2.sign(), mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), pair_dca, weight); // b2cc2l_b2cc2l
22682326
break;
2327+
case static_cast<int>(EM_HFeeType::kBCCee):
2328+
fillRecHistograms<22>(t1.sign(), t2.sign(), mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), pair_dca, weight); // b2cc2ll
2329+
break;
22692330
default:
22702331
break;
22712332
}

PWGEM/Dilepton/Utils/MCUtilities.h

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include <algorithm>
2222
#include <string>
23+
#include <utility>
2324
#include <vector>
2425

2526
//_______________________________________________________________________
@@ -34,6 +35,7 @@ enum class EM_HFeeType : int {
3435
kBCe_Be_DiffB = 4, // LS
3536
kBCCe_BCe = 5, // ULS
3637
kBCCe_BCCe = 6, // ULS
38+
kBCCee = 7, // ULS
3739
};
3840

3941
//_______________________________________________________________________
@@ -464,19 +466,18 @@ int IsFromCharm(TMCParticle const& p, TMCParticles const& mcparticles)
464466
}
465467
//_______________________________________________________________________
466468
template <typename T, typename U>
467-
int hasNCharmHadronsInBeautyDecay(T const& mcParticle, U const& mcParticles)
469+
std::pair<int, int> getBeautyHadronIDandNCharmHadronDaughters(T const& mcParticle, U const& mcParticles)
468470
{
469-
// require that the direct mother is beauty hadron via semileptonice decay. e.g. hb->e, not hb->X->pi0->eegamma
470471
if (!mcParticle.has_mothers()) {
471-
return -999;
472+
return {-999, -999};
472473
}
473474
if (!IsFromBeauty(mcParticle, mcParticles)) {
474-
return -999;
475+
return {-999, -999};
475476
}
476477

477478
auto mp = mcParticles.iteratorAt(mcParticle.mothersIds()[0]);
478479
if (!isCharmMeson(mp) && !isCharmBaryon(mp)) {
479-
return -999;
480+
return {-999, -999};
480481
}
481482

482483
int motherid = mcParticle.mothersIds()[0]; // first mother index
@@ -496,21 +497,22 @@ int hasNCharmHadronsInBeautyDecay(T const& mcParticle, U const& mcParticles)
496497
}
497498
}
498499
}
499-
return count_charm_hadron;
500+
return {motherid, count_charm_hadron};
500501
} else {
501502
LOGF(debug, "Something went wrong: Did not find any daughter for the current mother! Can't be a mother if there are no daughters\n");
502503
}
504+
return {-999, -999};
503505
}
504506
if (mp.has_mothers()) {
505507
motherid = mp.mothersIds()[0];
506508
} else {
507-
return -999;
509+
return {-999, -999};
508510
}
509511
} else {
510512
LOGF(info, "Mother label(%d) exceeds the McParticles size(%d)", motherid, mcParticles.size());
511513
}
512514
}
513-
return -999;
515+
return {-999, -999};
514516
}
515517
//_______________________________________________________________________
516518
template <typename TMCParticle>
@@ -717,12 +719,18 @@ int IsHF(TMCParticle1 const& p1, TMCParticle2 const& p2, TMCParticles const& mcp
717719
if constexpr (!doMoreDifferentially) {
718720
return static_cast<int>(EM_HFeeType::kBCe_BCe); // default to b->c->e and b->c->e, decay type = 1
719721
} else {
720-
int n_c_from_b1 = hasNCharmHadronsInBeautyDecay(p1, mcparticles);
721-
int n_c_from_b2 = hasNCharmHadronsInBeautyDecay(p2, mcparticles);
722+
int beauty_motherid1 = getBeautyHadronIDandNCharmHadronDaughters(p1, mcparticles).first;
723+
int beauty_motherid2 = getBeautyHadronIDandNCharmHadronDaughters(p2, mcparticles).first;
724+
int n_c_from_b1 = getBeautyHadronIDandNCharmHadronDaughters(p1, mcparticles).second;
725+
int n_c_from_b2 = getBeautyHadronIDandNCharmHadronDaughters(p2, mcparticles).second;
722726
if (n_c_from_b1 == 1 && n_c_from_b2 == 1) {
723727
return static_cast<int>(EM_HFeeType::kBCe_BCe); // b->c->e and b->c->e, decay type = 1
724728
} else if (n_c_from_b1 == 2 && n_c_from_b2 == 2) {
725-
return static_cast<int>(EM_HFeeType::kBCCe_BCCe); // b->cc->e and b->cc->e, decay type = 6
729+
if (beauty_motherid1 == beauty_motherid2) { // same beauty hadron decays into 2 charm hadrons which then decay semileptonically
730+
return static_cast<int>(EM_HFeeType::kBCCee); // b->cc->ee, decay type = 7
731+
} else {
732+
return static_cast<int>(EM_HFeeType::kBCCe_BCCe); // b->cc->e and b->cc->e, decay type = 6
733+
}
726734
} else if ((n_c_from_b1 == 1 && n_c_from_b2 == 2) || (n_c_from_b1 == 2 && n_c_from_b2 == 1)) {
727735
return static_cast<int>(EM_HFeeType::kBCCe_BCe); // b->cc->e and b->c->e, decay type = 5
728736
} else {

0 commit comments

Comments
 (0)