diff --git a/PWGDQ/Core/MCProng.cxx b/PWGDQ/Core/MCProng.cxx index 14fa645eb77..b9e79931aed 100644 --- a/PWGDQ/Core/MCProng.cxx +++ b/PWGDQ/Core/MCProng.cxx @@ -146,7 +146,11 @@ void MCProng::Print() const for (int i = 0; i < fNGenerations; i++) { std::cout << "Generation #" << i << " PDGcode(" << fPDGcodes[i] << ") CheckBothCharges(" << fCheckBothCharges[i] << ") ExcludePDG(" << fExcludePDG[i] << ") SourceBits(" << fSourceBits[i] << ") ExcludeSource(" << fExcludeSource[i] - << ") UseANDonSource(" << fUseANDonSourceBitMap[i] << ") CheckGenerationsInTime(" << fCheckGenerationsInTime << ") PDGInHistory(" << fPDGInHistory[i] << ") ExcludePDGInHistory(" << fExcludePDGInHistory[i] << ")" << std::endl; + << ") UseANDonSource(" << fUseANDonSourceBitMap[i] << ") CheckGenerationsInTime(" << fCheckGenerationsInTime << ")"; + for (int j = 0; j < fPDGInHistory.size(); j++) { + std::cout << " #" << j << " PDGInHistory(" << fPDGInHistory[j] << ") ExcludePDGInHistory(" << fExcludePDGInHistory[j] << ")"; + } + std::cout << std::endl; } } diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index a86b0f8aa8d..e66ebea3687 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -21,6 +21,7 @@ MCSignal::MCSignal() : TNamed("", ""), fProngs({}), fNProngs(0), fCommonAncestorIdxs({}), + fExcludeCommonAncestor(false), fTempAncestorLabel(-1) { } @@ -30,17 +31,19 @@ MCSignal::MCSignal(int nProngs, const char* name /*= ""*/, const char* title /*= fProngs({}), fNProngs(nProngs), fCommonAncestorIdxs({}), + fExcludeCommonAncestor(false), fTempAncestorLabel(-1) { fProngs.reserve(nProngs); } //________________________________________________________________________________________________ -MCSignal::MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors) : TNamed(name, title), - fProngs(prongs), - fNProngs(prongs.size()), - fCommonAncestorIdxs(commonAncestors), - fTempAncestorLabel(-1) +MCSignal::MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors, bool excludeCommonAncestor) : TNamed(name, title), + fProngs(prongs), + fNProngs(prongs.size()), + fCommonAncestorIdxs(commonAncestors), + fExcludeCommonAncestor(excludeCommonAncestor), + fTempAncestorLabel(-1) { } @@ -67,10 +70,11 @@ void MCSignal::AddProng(MCProng prong, short commonAncestor) void MCSignal::PrintConfig() { cout << "Name/Title: " << fName << " / " << fTitle << endl; + cout << "Exclude common ancestor combinations: " << fExcludeCommonAncestor << endl; cout << "Printing " << fNProngs << "/" << fProngs.size() << " prongs:" << endl; int i = 0; for (auto& pr : fProngs) { - cout << "Prong #" << i << " commonAncestor" << fCommonAncestorIdxs[i] << " ================ " << endl; + cout << "Prong #" << i << " commonAncestor: " << fCommonAncestorIdxs[i] << " ================ " << endl; i++; pr.Print(); } diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index 787aa443b22..c2fa8227de2 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -67,7 +67,7 @@ class MCSignal : public TNamed public: MCSignal(); MCSignal(int nProngs, const char* name = "", const char* title = ""); - MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors); + MCSignal(const char* name, const char* title, std::vector prongs, std::vector commonAncestors, bool excludeCommonAncestor = false); MCSignal(const MCSignal& c) = default; ~MCSignal() override = default; @@ -100,6 +100,7 @@ class MCSignal : public TNamed std::vector fProngs; unsigned int fNProngs; std::vector fCommonAncestorIdxs; + bool fExcludeCommonAncestor; int fTempAncestorLabel; template @@ -139,14 +140,15 @@ bool MCSignal::CheckProng(int i, bool checkSources, const T& track) if (i == 0) { fTempAncestorLabel = currentMCParticle.globalIndex(); } else { - if (currentMCParticle.globalIndex() != fTempAncestorLabel) { + if (currentMCParticle.globalIndex() != fTempAncestorLabel && !fExcludeCommonAncestor) + return false; + else if (currentMCParticle.globalIndex() == fTempAncestorLabel && fExcludeCommonAncestor) return false; - } } } // Update the currentMCParticle by moving either back in time (towards mothers, grandmothers, etc) - // or in time (towards daughters) depending on how this was configured in the MSignal + // or in time (towards daughters) depending on how this was configured in the MC Signal if (!fProngs[i].fCheckGenerationsInTime) { // make sure that a mother exists in the stack before moving one generation further in history if (!currentMCParticle.has_mothers() && j < fProngs[i].fNGenerations - 1) { diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index 72e5028b2f3..7950f5666ad 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -911,26 +911,92 @@ MCSignal* o2::aod::dqmcsignals::GetMCSignal(const char* name) return signal; } - // Any b->e and Any b->c->e - if (!nameStr.compare("eeFromBandBtoC")) { - MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); // check if mother pdg code is in history + // Any b->e and Any b->X->c->e + // Looking at such decays: B -> (e) D -> (e)e and bar{B} -> e + // Signal allows combinations of ee from the same B meson + // + the combination of e fom B and e from bar{B} + if (!nameStr.compare("eeFromBandAnyBtoC")) { + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); MCProng prongBtoC(2, {11, 402}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {502}, {false}); // check if mother pdg code is in history prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); - signal = new MCSignal(name, "ee pairs from b->e and b->c->e", {prongB, prongBtoC}, {-1, -1}); // signal at pair level + signal = new MCSignal(name, "ee pairs from b->e and b->X->c->e", {prongB, prongBtoC}, {-1, -1}); // signal at pair level + return signal; + } + + // Any b->e and Any b->X->c->e + if (!nameStr.compare("eeFromBandAnyBtoCBis")) { + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); + MCProng prongBtoC(2, {11, 402}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {502}, {false}); // check if mother pdg code is in history + prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs from b->X->c->e and b->e", {prongBtoC, prongB}, {-1, -1}); // signal at pair level + return signal; + } + + if (!nameStr.compare("eeFromBandBtoC")) { + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); + MCProng prongBtoC(3, {11, 402, 502}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}, false); // check if mother pdg code is in history + prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "direkt ee pairs from b->e and b->c->e", {prongB, prongBtoC}, {-1, -1}); // signal at pair level return signal; } // Any b->e and Any b->c->e if (!nameStr.compare("eeFromBandBtoCBis")) { - MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); // check if mother pdg code is in history + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); - MCProng prongBtoC(2, {11, 402}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {502}, {false}); // check if mother pdg code is in history + MCProng prongBtoC(3, {11, 402, 502}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}, false); // check if mother pdg code is in history prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); signal = new MCSignal(name, "ee pairs from b->c->e and b->e", {prongBtoC, prongB}, {-1, -1}); // signal at pair level return signal; } + // Any b->e and Any b->c->e (same mother/grandmother) + // require that the mother is the grandmother of the other electron + if (!nameStr.compare("eeFromBandBtoCsameGM")) { + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); + MCProng prongBtoC(3, {11, 402, 502}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}, false); // check if mother pdg code is in history + prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs from b->e and b->c->e, mother = grandmother", {prongB, prongBtoC}, {1, 2}, false); // signal at pair level, accept commonAncestor Pairs + return signal; + } + + // Any b->e and Any b->c->e (same mother/grandmother) + // require that the mother is the grandmother of the other electron + if (!nameStr.compare("eeFromBandBtoCsameGMBis")) { + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); + MCProng prongBtoC(3, {11, 402, 502}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}, false); // check if mother pdg code is in history + prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs from b->c->e and b->e, mother = grandmother", {prongBtoC, prongB}, {2, 1}, false); // signal at pair level, accept commonAncestor Pairs + return signal; + } + + // Any b->e and Any b->c->e (different mother/grandmother) + // require that the mother is not the grandmother of the other electron + if (!nameStr.compare("eeFromBandBtoCdiffGM")) { + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); + MCProng prongBtoC(3, {11, 402, 502}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}, false); // check if mother pdg code is in history + prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs from b->e and b->c->e, mother != grandmother", {prongB, prongBtoC}, {1, 2}, true); // signal at pair level, exclude commonAncestor Pairs + return signal; + } + + // Any b->e and Any b->c->e (different mother/grandmother) + // require that the mother is not the grandmother of the other electron + if (!nameStr.compare("eeFromBandBtoCdiffGMBis")) { + MCProng prongB(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}); + prongB.SetSourceBit(0, MCProng::kPhysicalPrimary); + MCProng prongBtoC(3, {11, 402, 502}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}, false); // check if mother pdg code is in history + prongBtoC.SetSourceBit(0, MCProng::kPhysicalPrimary); + signal = new MCSignal(name, "ee pairs from b->c->e and b->e, mother != grandmother", {prongBtoC, prongB}, {2, 1}, true); // signal at pair level, exclude commonAncestor Pairs + return signal; + } + // b->e and b->e if (!nameStr.compare("eeFromBB")) { MCProng prong(2, {11, 502}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false});