Skip to content

Commit d985c30

Browse files
dsekihatalibuild
andauthored
[PWGEM/Dilepton] remove sign check of HFll in MC (#13494)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent fcd0067 commit d985c30

File tree

2 files changed

+58
-72
lines changed

2 files changed

+58
-72
lines changed

PWGEM/Dilepton/Core/DileptonMC.h

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,7 +1639,7 @@ struct DileptonMC {
16391639
}
16401640
}
16411641
break;
1642-
case 443: {
1642+
case 443:
16431643
if (IsFromBeauty(mcmother, mcparticles) > 0) {
16441644
fillRecHistograms<9>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // non-prompt J/psi
16451645
if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) {
@@ -1670,15 +1670,13 @@ struct DileptonMC {
16701670
}
16711671
}
16721672
break;
1673-
}
1674-
case 100443: {
1673+
case 100443:
16751674
if (IsFromBeauty(mcmother, mcparticles) > 0) {
16761675
fillRecHistograms<11>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // non-prompt psi2S
16771676
} else {
16781677
fillRecHistograms<10>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // prompt psi2S
16791678
}
16801679
break;
1681-
}
16821680
default:
16831681
break;
16841682
}
@@ -1702,23 +1700,19 @@ struct DileptonMC {
17021700
auto mp1 = mcparticles.iteratorAt(t1mc.mothersIds()[0]);
17031701
auto mp2 = mcparticles.iteratorAt(t2mc.mothersIds()[0]);
17041702
switch (hfee_type) {
1705-
case static_cast<int>(EM_HFeeType::kCe_Ce): { // ULS
1703+
case static_cast<int>(EM_HFeeType::kCe_Ce):
17061704
fillRecHistograms<15>(t1.sign(), t2.sign(), mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // c2l_c2l
17071705
break;
1708-
}
1709-
case static_cast<int>(EM_HFeeType::kBe_Be): { // ULS
1706+
case static_cast<int>(EM_HFeeType::kBe_Be):
17101707
fillRecHistograms<16>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2l_b2l
17111708
break;
1712-
}
1713-
case static_cast<int>(EM_HFeeType::kBCe_BCe): { // ULS
1709+
case static_cast<int>(EM_HFeeType::kBCe_BCe):
17141710
fillRecHistograms<17>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2c2l
17151711
break;
1716-
}
1717-
case static_cast<int>(EM_HFeeType::kBCe_Be_SameB): { // ULS
1712+
case static_cast<int>(EM_HFeeType::kBCe_Be_SameB):
17181713
fillRecHistograms<18>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2l_sameb
17191714
break;
1720-
}
1721-
case static_cast<int>(EM_HFeeType::kBCe_Be_DiffB): // LS
1715+
case static_cast<int>(EM_HFeeType::kBCe_Be_DiffB):
17221716
fillRecHistograms<19>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2l_diffb
17231717
break;
17241718
default:
@@ -1869,22 +1863,20 @@ struct DileptonMC {
18691863
fRegistry.fill(HIST("Generated/sm/Phi2ll/uls/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee)); // phi->ee
18701864
}
18711865
break;
1872-
case 443: {
1866+
case 443:
18731867
if (IsFromBeauty(mcmother, mcparticles) > 0) {
18741868
fillGenHistograms<9>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt J/psi
18751869
} else {
18761870
fillGenHistograms<8>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt J/psi
18771871
}
18781872
break;
1879-
}
1880-
case 100443: {
1873+
case 100443:
18811874
if (IsFromBeauty(mcmother, mcparticles) > 0) {
18821875
fillGenHistograms<11>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt psi2S
18831876
} else {
18841877
fillGenHistograms<10>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt psi2S
18851878
}
18861879
break;
1887-
}
18881880
default:
18891881
break;
18901882
}
@@ -1893,22 +1885,18 @@ struct DileptonMC {
18931885
auto mp1 = mcparticles.iteratorAt(t1.mothersIds()[0]);
18941886
auto mp2 = mcparticles.iteratorAt(t2.mothersIds()[0]);
18951887
switch (hfee_type) {
1896-
case static_cast<int>(EM_HFeeType::kCe_Ce): {
1888+
case static_cast<int>(EM_HFeeType::kCe_Ce):
18971889
fillGenHistograms<15>(sign1, sign2, mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // c2l_c2l
18981890
break;
1899-
}
1900-
case static_cast<int>(EM_HFeeType::kBe_Be): {
1891+
case static_cast<int>(EM_HFeeType::kBe_Be):
19011892
fillGenHistograms<16>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2l_b2l
19021893
break;
1903-
}
1904-
case static_cast<int>(EM_HFeeType::kBCe_BCe): {
1894+
case static_cast<int>(EM_HFeeType::kBCe_BCe):
19051895
fillGenHistograms<17>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2c2l
19061896
break;
1907-
}
1908-
case static_cast<int>(EM_HFeeType::kBCe_Be_SameB): { // ULS
1897+
case static_cast<int>(EM_HFeeType::kBCe_Be_SameB):
19091898
fillGenHistograms<18>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2l_sameb
19101899
break;
1911-
}
19121900
case static_cast<int>(EM_HFeeType::kBCe_Be_DiffB): // LS
19131901
fillGenHistograms<19>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2l_diffb
19141902
break;

PWGEM/Dilepton/Utils/MCUtilities.h

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ int IsHF(TMCParticle1 const& p1, TMCParticle2 const& p2, TMCParticles const& mcp
355355
bool is_c_from_b1 = IsFromBeauty(p1, mcparticles) > 0 && IsFromCharm(p1, mcparticles) > 0;
356356
bool is_c_from_b2 = IsFromBeauty(p2, mcparticles) > 0 && IsFromCharm(p2, mcparticles) > 0;
357357

358-
if (is_direct_from_b1 && is_direct_from_b2 && p1.pdgCode() * p2.pdgCode() < 0) {
358+
if (is_direct_from_b1 && is_direct_from_b2) {
359359
mothers_id1.clear();
360360
mothers_pdg1.clear();
361361
mothers_id2.clear();
@@ -366,7 +366,7 @@ int IsHF(TMCParticle1 const& p1, TMCParticle2 const& p2, TMCParticles const& mcp
366366
mothers_pdg2.shrink_to_fit();
367367
return static_cast<int>(EM_HFeeType::kBe_Be); // bb->ee, decay type = 2
368368
}
369-
if (is_prompt_c1 && is_prompt_c2 && p1.pdgCode() * p2.pdgCode() < 0) {
369+
if (is_prompt_c1 && is_prompt_c2) {
370370
mothers_id1.clear();
371371
mothers_pdg1.clear();
372372
mothers_id2.clear();
@@ -377,7 +377,7 @@ int IsHF(TMCParticle1 const& p1, TMCParticle2 const& p2, TMCParticles const& mcp
377377
mothers_pdg2.shrink_to_fit();
378378
return static_cast<int>(EM_HFeeType::kCe_Ce); // cc->ee, decay type = 0
379379
}
380-
if (is_c_from_b1 && is_c_from_b2 && p1.pdgCode() * p2.pdgCode() < 0) {
380+
if (is_c_from_b1 && is_c_from_b2) {
381381
mothers_id1.clear();
382382
mothers_pdg1.clear();
383383
mothers_id2.clear();
@@ -389,52 +389,50 @@ int IsHF(TMCParticle1 const& p1, TMCParticle2 const& p2, TMCParticles const& mcp
389389
return static_cast<int>(EM_HFeeType::kBCe_BCe); // b->c->e and b->c->e, decay type = 1
390390
}
391391
if ((is_direct_from_b1 && is_c_from_b2) || (is_direct_from_b2 && is_c_from_b1)) {
392-
if (p1.pdgCode() * p2.pdgCode() < 0) { // ULS
393-
for (auto& mid1 : mothers_id1) {
394-
for (auto& mid2 : mothers_id2) {
395-
if (mid1 == mid2) {
396-
auto common_mp = mcparticles.iteratorAt(mid1);
397-
int mp_pdg = common_mp.pdgCode();
398-
bool is_mp_diquark = (1100 < std::abs(mp_pdg) && std::abs(mp_pdg) < 5600) && std::to_string(mp_pdg)[std::to_string(mp_pdg).length() - 2] == '0';
399-
if (!is_mp_diquark && std::abs(mp_pdg) < 1e+9 && (std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 3] == '5' || std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 4] == '5')) {
400-
mothers_id1.clear();
401-
mothers_pdg1.clear();
402-
mothers_id2.clear();
403-
mothers_pdg2.clear();
404-
mothers_id1.shrink_to_fit();
405-
mothers_pdg1.shrink_to_fit();
406-
mothers_id2.shrink_to_fit();
407-
mothers_pdg2.shrink_to_fit();
408-
return static_cast<int>(EM_HFeeType::kBCe_Be_SameB); // b->c->e and b->e, decay type = 3. this should happen only in ULS.
409-
}
392+
for (const auto& mid1 : mothers_id1) {
393+
for (const auto& mid2 : mothers_id2) {
394+
if (mid1 == mid2) {
395+
auto common_mp = mcparticles.iteratorAt(mid1);
396+
int mp_pdg = common_mp.pdgCode();
397+
bool is_mp_diquark = (1100 < std::abs(mp_pdg) && std::abs(mp_pdg) < 5600) && std::to_string(mp_pdg)[std::to_string(mp_pdg).length() - 2] == '0';
398+
if (!is_mp_diquark && std::abs(mp_pdg) < 1e+9 && (std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 3] == '5' || std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 4] == '5')) {
399+
mothers_id1.clear();
400+
mothers_pdg1.clear();
401+
mothers_id2.clear();
402+
mothers_pdg2.clear();
403+
mothers_id1.shrink_to_fit();
404+
mothers_pdg1.shrink_to_fit();
405+
mothers_id2.shrink_to_fit();
406+
mothers_pdg2.shrink_to_fit();
407+
return static_cast<int>(EM_HFeeType::kBCe_Be_SameB); // b->c->e and b->e, decay type = 3. this should happen only in ULS.
410408
}
411-
} // end of motherid2
412-
} // end of motherid1
413-
} else { // LS
414-
bool is_same_mother_found = false;
415-
for (auto& mid1 : mothers_id1) {
416-
for (auto& mid2 : mothers_id2) {
417-
if (mid1 == mid2) {
418-
auto common_mp = mcparticles.iteratorAt(mid1);
419-
int mp_pdg = common_mp.pdgCode();
420-
bool is_mp_diquark = (1100 < std::abs(mp_pdg) && std::abs(mp_pdg) < 5600) && std::to_string(mp_pdg)[std::to_string(mp_pdg).length() - 2] == '0';
421-
if (!is_mp_diquark && std::abs(mp_pdg) < 1e+9 && (std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 3] == '5' || std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 4] == '5')) {
422-
is_same_mother_found = true;
423-
}
409+
}
410+
} // end of motherid2
411+
} // end of motherid1
412+
413+
bool is_same_mother_found = false;
414+
for (const auto& mid1 : mothers_id1) {
415+
for (const auto& mid2 : mothers_id2) {
416+
if (mid1 == mid2) {
417+
auto common_mp = mcparticles.iteratorAt(mid1);
418+
int mp_pdg = common_mp.pdgCode();
419+
bool is_mp_diquark = (1100 < std::abs(mp_pdg) && std::abs(mp_pdg) < 5600) && std::to_string(mp_pdg)[std::to_string(mp_pdg).length() - 2] == '0';
420+
if (!is_mp_diquark && std::abs(mp_pdg) < 1e+9 && (std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 3] == '5' || std::to_string(std::abs(mp_pdg))[std::to_string(std::abs(mp_pdg)).length() - 4] == '5')) {
421+
is_same_mother_found = true;
424422
}
425-
} // end of motherid2
426-
} // end of motherid1
427-
if (!is_same_mother_found) {
428-
mothers_id1.clear();
429-
mothers_pdg1.clear();
430-
mothers_id2.clear();
431-
mothers_pdg2.clear();
432-
mothers_id1.shrink_to_fit();
433-
mothers_pdg1.shrink_to_fit();
434-
mothers_id2.shrink_to_fit();
435-
mothers_pdg2.shrink_to_fit();
436-
return static_cast<int>(EM_HFeeType::kBCe_Be_DiffB); // b->c->e and b->e, decay type = 4. this should happen only in LS. But, this may happen, when ele/pos is reconstructed as pos/ele wrongly. and create LS pair
437-
}
423+
}
424+
} // end of motherid2
425+
} // end of motherid1
426+
if (!is_same_mother_found) {
427+
mothers_id1.clear();
428+
mothers_pdg1.clear();
429+
mothers_id2.clear();
430+
mothers_pdg2.clear();
431+
mothers_id1.shrink_to_fit();
432+
mothers_pdg1.shrink_to_fit();
433+
mothers_id2.shrink_to_fit();
434+
mothers_pdg2.shrink_to_fit();
435+
return static_cast<int>(EM_HFeeType::kBCe_Be_DiffB); // b->c->e and b->e, decay type = 4. this should happen only in LS. But, this may happen, when ele/pos is reconstructed as pos/ele wrongly. and create LS pair
438436
}
439437
}
440438

0 commit comments

Comments
 (0)