Skip to content

Commit 79331e8

Browse files
authored
[PWGEM/Dilepton] update HFll in MC with status code (#13699)
1 parent ad0c827 commit 79331e8

File tree

2 files changed

+139
-69
lines changed

2 files changed

+139
-69
lines changed

PWGEM/Dilepton/Core/SingleTrackQCMC.h

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,6 @@ struct SingleTrackQCMC {
317317
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);
318318
fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false);
319319
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);
320-
// 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);
321-
// 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);
322-
// 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);
323-
// 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);
324320
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);
325321
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);
326322
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);
@@ -693,10 +689,6 @@ struct SingleTrackQCMC {
693689
fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa());
694690
fRegistry.fill(HIST("Track/PID/positive/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr());
695691
fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl());
696-
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu());
697-
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi());
698-
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa());
699-
// fRegistry.fill(HIST("Track/PID/positive/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr());
700692
}
701693
} else {
702694
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);
@@ -742,10 +734,6 @@ struct SingleTrackQCMC {
742734
fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaKa"), track.tpcInnerParam(), track.tpcNSigmaKa());
743735
fRegistry.fill(HIST("Track/PID/negative/hTPCNsigmaPr"), track.tpcInnerParam(), track.tpcNSigmaPr());
744736
fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaEl"), track.p(), track.tofNSigmaEl());
745-
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaMu"), track.p(), track.tofNSigmaMu());
746-
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPi"), track.p(), track.tofNSigmaPi());
747-
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaKa"), track.p(), track.tofNSigmaKa());
748-
// fRegistry.fill(HIST("Track/PID/negative/hTOFNsigmaPr"), track.p(), track.tofNSigmaPr());
749737
}
750738
}
751739
}
@@ -908,14 +896,14 @@ struct SingleTrackQCMC {
908896
} else {
909897
fillTrackInfo<5, TMCParticles>(track);
910898
}
911-
} else if (IsFromBeauty(mctrack, mcparticles) > 0) { // b is found in full decay chain.
912-
if (IsFromCharm(mctrack, mcparticles) > 0) { // c is found in full decay chain.
913-
fillTrackInfo<9, TMCParticles>(track);
899+
} else if (isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain.
900+
fillTrackInfo<8, TMCParticles>(track);
901+
} else if (isWeakDecayFromCharmHadron(mctrack, mcparticles)) { // hc->l is found in full decay chain.
902+
if (IsFromBeauty(mcmother, mcparticles) > 0) {
903+
fillTrackInfo<9, TMCParticles>(track); // hb->hc->l is fond.
914904
} else {
915-
fillTrackInfo<8, TMCParticles>(track);
905+
fillTrackInfo<7, TMCParticles>(track); // prompt hc->l is found.
916906
}
917-
} else if (IsFromCharm(mctrack, mcparticles) > 0) { // c is found in full decay chain. Not from b.
918-
fillTrackInfo<7, TMCParticles>(track);
919907
}
920908
} else {
921909
if (pdg_mother == 22) { // photon conversion
@@ -1013,14 +1001,14 @@ struct SingleTrackQCMC {
10131001
} else {
10141002
fRegistry.fill(HIST("Generated/PromptPsi2S/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
10151003
}
1016-
} else if (IsFromBeauty(lepton, mcparticles) > 0) { // b is found in full decay chain.
1017-
if (IsFromCharm(lepton, mcparticles) > 0) { // c is found in full decay chain.
1018-
fRegistry.fill(HIST("Generated/b2c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
1004+
} else if (isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found
1005+
fRegistry.fill(HIST("Generated/b2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
1006+
} else if (isWeakDecayFromCharmHadron(lepton, mcparticles)) { // hc->l is found in full decay chain.
1007+
if (IsFromBeauty(mcmother, mcparticles) > 0) {
1008+
fRegistry.fill(HIST("Generated/b2c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // hb->hc->l is found in full decay chain.
10191009
} else {
1020-
fRegistry.fill(HIST("Generated/b2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
1010+
fRegistry.fill(HIST("Generated/c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // prompt hc->l is found in full decay chain.
10211011
}
1022-
} else if (IsFromCharm(lepton, mcparticles) > 0) { // c is found in full decay chain. Not from b.
1023-
fRegistry.fill(HIST("Generated/c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton);
10241012
}
10251013
} // end of mc lepton loop per collision
10261014

PWGEM/Dilepton/Utils/MCUtilities.h

Lines changed: 127 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,127 @@ int hasFakeMatchMFTMCH(TTrack const& track)
7171
}
7272
}
7373
//_______________________________________________________________________
74+
template <typename T>
75+
bool isCharmonia(T const& track)
76+
{
77+
if (std::abs(track.pdgCode()) < 100) {
78+
return false;
79+
}
80+
81+
std::string pdgStr = std::to_string(std::abs(track.pdgCode()));
82+
int n = pdgStr.length();
83+
int pdg3 = std::stoi(pdgStr.substr(n - 3, 3));
84+
85+
if (pdg3 == 441 || pdg3 == 443 || pdg3 == 445 || pdg3 == 447) {
86+
return true;
87+
} else {
88+
return false;
89+
}
90+
}
91+
//_______________________________________________________________________
92+
template <typename T>
93+
bool isCharmMeson(T const& track)
94+
{
95+
if (isCharmonia(track)) {
96+
return false;
97+
}
98+
99+
if (400 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 500) {
100+
return true;
101+
} else {
102+
return false;
103+
}
104+
}
105+
//_______________________________________________________________________
106+
template <typename T>
107+
bool isCharmBaryon(T const& track)
108+
{
109+
if (4000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 5000) {
110+
return true;
111+
} else {
112+
return false;
113+
}
114+
}
115+
//_______________________________________________________________________
116+
template <typename T>
117+
bool isBottomonia(T const& track)
118+
{
119+
if (std::abs(track.pdgCode()) < 100) {
120+
return false;
121+
}
122+
123+
std::string pdgStr = std::to_string(std::abs(track.pdgCode()));
124+
int n = pdgStr.length();
125+
int pdg3 = std::stoi(pdgStr.substr(n - 3, 3));
126+
127+
if (pdg3 == 551 || pdg3 == 553 || pdg3 == 555 || pdg3 == 557) {
128+
return true;
129+
} else {
130+
return false;
131+
}
132+
}
133+
//_______________________________________________________________________
134+
template <typename T>
135+
bool isBeautyMeson(T const& track)
136+
{
137+
if (isBottomonia(track)) {
138+
return false;
139+
}
140+
141+
if (500 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 600) {
142+
return true;
143+
} else {
144+
return false;
145+
}
146+
}
147+
//_______________________________________________________________________
148+
template <typename T>
149+
bool isBeautyBaryon(T const& track)
150+
{
151+
if (5000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 6000) {
152+
return true;
153+
} else {
154+
return false;
155+
}
156+
}
157+
//_______________________________________________________________________
158+
template <typename T, typename U>
159+
bool isWeakDecayFromCharmHadron(T const& mcParticle, U const& mcParticles)
160+
{
161+
// require that the direct mother is charm hadron via semileptonic. e.g. hc->e, not hc->X->pi0->eegamma
162+
if (!mcParticle.has_mothers()) {
163+
return false;
164+
}
165+
if (mcParticle.getProcess() != 4) { // weak decay
166+
return false;
167+
}
168+
auto mp = mcParticles.iteratorAt(mcParticle.mothersIds()[0]);
169+
if (isCharmMeson(mp) || isCharmBaryon(mp)) {
170+
return true;
171+
} else {
172+
return false;
173+
}
174+
}
175+
//_______________________________________________________________________
176+
template <typename T, typename U>
177+
bool isWeakDecayFromBeautyHadron(T const& mcParticle, U const& mcParticles)
178+
{
179+
// require that the direct mother is beauty hadron via semileptonice decay. e.g. hb->e, not hb->X->pi0->eegamma
180+
if (!mcParticle.has_mothers()) {
181+
return false;
182+
}
183+
if (mcParticle.getProcess() != 4) { // weak decay
184+
return false;
185+
}
186+
auto mp = mcParticles.iteratorAt(mcParticle.mothersIds()[0]);
187+
if (isBeautyMeson(mp) || isBeautyBaryon(mp)) {
188+
return true;
189+
} else {
190+
return false;
191+
}
192+
}
193+
//_______________________________________________________________________
194+
//_______________________________________________________________________
74195
template <typename TMCParticle1, typename TMCParticle2>
75196
int FindCommonMotherFrom2ProngsWithoutPDG(TMCParticle1 const& p1, TMCParticle2 const& p2)
76197
{
@@ -436,12 +557,12 @@ int IsHF(TMCParticle1 const& p1, TMCParticle2 const& p2, TMCParticles const& mcp
436557
bool isFOFound1 = findFlavorOscillationB(p1, mcparticles);
437558
bool isFOFound2 = findFlavorOscillationB(p2, mcparticles);
438559

439-
bool is_direct_from_b1 = IsFromBeauty(p1, mcparticles) > 0 && IsFromCharm(p1, mcparticles) < 0;
440-
bool is_direct_from_b2 = IsFromBeauty(p2, mcparticles) > 0 && IsFromCharm(p2, mcparticles) < 0;
441-
bool is_prompt_c1 = IsFromBeauty(p1, mcparticles) < 0 && IsFromCharm(p1, mcparticles) > 0;
442-
bool is_prompt_c2 = IsFromBeauty(p2, mcparticles) < 0 && IsFromCharm(p2, mcparticles) > 0;
443-
bool is_c_from_b1 = IsFromBeauty(p1, mcparticles) > 0 && IsFromCharm(p1, mcparticles) > 0;
444-
bool is_c_from_b2 = IsFromBeauty(p2, mcparticles) > 0 && IsFromCharm(p2, mcparticles) > 0;
560+
bool is_direct_from_b1 = isWeakDecayFromBeautyHadron(p1, mcparticles);
561+
bool is_direct_from_b2 = isWeakDecayFromBeautyHadron(p2, mcparticles);
562+
bool is_prompt_c1 = isWeakDecayFromCharmHadron(p1, mcparticles) && IsFromBeauty(p1, mcparticles) < 0;
563+
bool is_prompt_c2 = isWeakDecayFromCharmHadron(p2, mcparticles) && IsFromBeauty(p2, mcparticles) < 0;
564+
bool is_c_from_b1 = isWeakDecayFromCharmHadron(p1, mcparticles) && IsFromBeauty(p1, mcparticles) > 0;
565+
bool is_c_from_b2 = isWeakDecayFromCharmHadron(p2, mcparticles) && IsFromBeauty(p2, mcparticles) > 0;
445566

446567
if (is_prompt_c1 && is_prompt_c2 && mpfh1.pdgCode() * mpfh2.pdgCode() < 0) { // charmed mesons never oscillate. only ULS
447568
mothers_id1.clear();
@@ -640,45 +761,6 @@ bool checkFromSameQuarkPair(T& p1, T& p2, U& mcParticles, int pdg)
640761
return id1 == id2 && id1 > -1 && id2 > -1;
641762
}
642763
//_______________________________________________________________________
643-
template <typename T>
644-
bool isCharmMeson(T const& track)
645-
{
646-
if (400 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 500) {
647-
return true;
648-
} else {
649-
return false;
650-
}
651-
}
652-
//_______________________________________________________________________
653-
template <typename T>
654-
bool isCharmBaryon(T const& track)
655-
{
656-
if (4000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 5000) {
657-
return true;
658-
} else {
659-
return false;
660-
}
661-
}
662-
//_______________________________________________________________________
663-
template <typename T>
664-
bool isBeautyMeson(T const& track)
665-
{
666-
if (500 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 600) {
667-
return true;
668-
} else {
669-
return false;
670-
}
671-
}
672-
//_______________________________________________________________________
673-
template <typename T>
674-
bool isBeautyBaryon(T const& track)
675-
{
676-
if (5000 < std::abs(track.pdgCode()) && std::abs(track.pdgCode()) < 6000) {
677-
return true;
678-
} else {
679-
return false;
680-
}
681-
}
682764
//_______________________________________________________________________
683765
//_______________________________________________________________________
684766
} // namespace o2::aod::pwgem::dilepton::utils::mcutil

0 commit comments

Comments
 (0)