Skip to content

Commit f2916c7

Browse files
authored
[PWGEM] Fix for normalization of beauty cocktail. (#11021)
1 parent 4606bc3 commit f2916c7

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,49 @@ struct MyConfigs : ConfigurableGroup {
160160

161161
struct lmeehfcocktailprefilter {
162162

163+
HistogramRegistry registry{"registry", {}};
164+
std::vector<std::shared_ptr<TH1>> hRapQuark;
163165
Produces<o2::aod::HfTable> hfTable;
166+
ConfigurableAxis fConfigRapBins{"cfgRapBins", {200, -10.f, 10.f}, "Quark rapidity binning"};
167+
168+
void init(o2::framework::InitContext&)
169+
{
170+
const int Nchannels = 2;
171+
const char* typeNamesSingle[Nchannels] = {"b", "c"};
172+
const char* typeTitlesSingle[Nchannels] = {"b", "c"};
173+
174+
AxisSpec rap_axis = {fConfigRapBins, "y_{b}"};
175+
176+
// quark histograms
177+
for (int i = 0; i < Nchannels; i++) {
178+
hRapQuark.push_back(registry.add<TH1>(Form("Quark_Rap_%s", typeNamesSingle[i]), Form("Rap Quark %s", typeTitlesSingle[i]), HistType::kTH1F, {rap_axis}, true));
179+
}
180+
}
181+
164182
void process(aod::McParticles const& mcParticles)
165183
{
166184
for (auto const& p : mcParticles) {
185+
// Look at quarks which fragment
186+
if (abs(p.pdgCode()) == 5 || abs(p.pdgCode()) == 4) {
187+
bool foundhadrons = kFALSE;
188+
if (p.has_daughters()) {
189+
const auto& daughtersSlice = p.daughters_as<aod::McParticles>();
190+
for (auto& d : daughtersSlice) {
191+
int pdgfragment = d.pdgCode();
192+
if (static_cast<int>(abs(pdgfragment) / 100.) == abs(p.pdgCode()) || static_cast<int>(abs(pdgfragment) / 1000.) == abs(p.pdgCode())) {
193+
foundhadrons = kTRUE;
194+
}
195+
}
196+
}
197+
if (foundhadrons) {
198+
if (abs(p.pdgCode()) == 4)
199+
hRapQuark[1]->Fill(p.y());
200+
else if (abs(p.pdgCode()) == 5)
201+
hRapQuark[0]->Fill(p.y());
202+
}
203+
}
167204

205+
// Look at electrons
168206
if (abs(p.pdgCode()) != 11 || o2::mcgenstatus::getHepMCStatusCode(p.statusCode()) != 1 || !p.has_mothers()) {
169207
hfTable(EFromHFType::kNoE, -1, -1, -1, -1, -1, -1, -999., -999.);
170208
continue;

PWGEM/Dilepton/Utils/MCUtilities.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,16 @@ int searchMothers(T& p, U& mcParticles, int pdg, bool equal)
481481
for (int i : allmothersids) {
482482
auto mother = mcParticles.iteratorAt(i);
483483
int mpdg = mother.pdgCode();
484-
if (abs(mpdg) == pdg && mpdg * p.pdgCode() > 0) { // check for quark
485-
if (quark_id > -1 || next_mother_id > -1) { // we already found a possible candidate in the list of mothers, so now we have (at least) two
484+
// if (abs(mpdg) == pdg && mpdg * p.pdgCode() > 0) { // check for quark
485+
if (abs(mpdg) == pdg) { // check for quark to allow for beauty and charm + oscillation
486+
if (quark_id > -1 || next_mother_id > -1) { // we already found a possible candidate in the list of mothers, so now we have (at least) two
486487
// LOG(warning) << "Flavour tracking is ambiguous. Stopping here.";
487488
return -1;
488489
}
489490
quark_id = i;
490-
} else if ((static_cast<int>(abs(mpdg) / 100) == pdg || static_cast<int>(abs(mpdg) / 1000) == pdg) && mpdg * p.pdgCode() > 0) { // check for other mothers with flavour content
491-
if (quark_id > -1 || next_mother_id > -1) { // we already found a possible candidate in the list of mothers, so now we have (at least) two
491+
//} else if ((static_cast<int>(abs(mpdg) / 100) == pdg || static_cast<int>(abs(mpdg) / 1000) == pdg) && mpdg * p.pdgCode() > 0) { // check for other mothers with flavour content
492+
} else if ((static_cast<int>(abs(mpdg) / 100) == pdg || static_cast<int>(abs(mpdg) / 1000) == pdg)) { // check for other mothers with flavour content to allow for beauty and charm
493+
if (quark_id > -1 || next_mother_id > -1) { // we already found a possible candidate in the list of mothers, so now we have (at least) two
492494
// LOG(warning) << "Flavour tracking is ambiguous. Stopping here.";
493495
return -1;
494496
}

0 commit comments

Comments
 (0)