Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
float cut_pt[Nstages] = {0., 0., ptMin};
float cut_eta[Nstages] = {9999., 99999., etaMax};
for (int i = 0; i < Nstages; i++) {
if (pt[i] > cut_pt[i] && fabs(eta[i]) < cut_eta[i]) {

Check failure on line 84 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (pdg == 4)
hRapQuark[i]->Fill(p.cQuarkRap());
else if (pdg == 5)
Expand All @@ -101,7 +101,7 @@
float cut_pt[Nstages] = {0., 0., ptMin};
float cut_eta[Nstages] = {9999., 99999., etaMax};
for (int i = 0; i < Nstages; i++) {
if (pt[i] > cut_pt[i] && fabs(eta[i]) < cut_eta[i]) {

Check failure on line 104 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hEta[i]->Fill(eta[i], weight[i]);
hPt[i]->Fill(pt[i], weight[i]);
hPtEta[i]->Fill(pt[i], eta[i], weight[i]);
Expand Down Expand Up @@ -138,7 +138,7 @@
}

for (int i = 0; i < Nstages; i++) {
if (pt1[i] > cut_pt[i] && pt2[i] > cut_pt[i] && fabs(eta1[i]) < cut_eta[i] && fabs(eta2[i]) < cut_eta[i]) {

Check failure on line 141 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hMee[i]->Fill(mass[i], weight[i]);
hMeePtee[i]->Fill(mass[i], pt[i], weight[i]);
}
Expand All @@ -160,19 +160,57 @@

struct lmeehfcocktailprefilter {

HistogramRegistry registry{"registry", {}};
std::vector<std::shared_ptr<TH1>> hRapQuark;
Produces<o2::aod::HfTable> hfTable;
ConfigurableAxis fConfigRapBins{"cfgRapBins", {200, -10.f, 10.f}, "Quark rapidity binning"};

void init(o2::framework::InitContext&)
{
const int Nchannels = 2;
const char* typeNamesSingle[Nchannels] = {"b", "c"};
const char* typeTitlesSingle[Nchannels] = {"b", "c"};

AxisSpec rap_axis = {fConfigRapBins, "y_{b}"};

// quark histograms
for (int i = 0; i < Nchannels; i++) {
hRapQuark.push_back(registry.add<TH1>(Form("Quark_Rap_%s", typeNamesSingle[i]), Form("Rap Quark %s", typeTitlesSingle[i]), HistType::kTH1F, {rap_axis}, true));
}
}

void process(aod::McParticles const& mcParticles)
{
for (auto const& p : mcParticles) {
// Look at quarks which fragment
if (abs(p.pdgCode()) == 5 || abs(p.pdgCode()) == 4) {

Check failure on line 186 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
bool foundhadrons = kFALSE;
if (p.has_daughters()) {
const auto& daughtersSlice = p.daughters_as<aod::McParticles>();
for (auto& d : daughtersSlice) {
int pdgfragment = d.pdgCode();
if (static_cast<int>(abs(pdgfragment) / 100.) == abs(p.pdgCode()) || static_cast<int>(abs(pdgfragment) / 1000.) == abs(p.pdgCode())) {

Check failure on line 192 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
foundhadrons = kTRUE;
}
}
}
if (foundhadrons) {
if (abs(p.pdgCode()) == 4)

Check failure on line 198 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hRapQuark[1]->Fill(p.y());
else if (abs(p.pdgCode()) == 5)

Check failure on line 200 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hRapQuark[0]->Fill(p.y());
}
}

// Look at electrons
if (abs(p.pdgCode()) != 11 || o2::mcgenstatus::getHepMCStatusCode(p.statusCode()) != 1 || !p.has_mothers()) {

Check failure on line 206 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
hfTable(EFromHFType::kNoE, -1, -1, -1, -1, -1, -1, -999., -999.);
continue;
}

int mother_pdg = mcParticles.iteratorAt(p.mothersIds()[0]).pdgCode();
bool direct_charm_mother = abs(mother_pdg) < 1e+9 && (std::to_string(mother_pdg)[std::to_string(mother_pdg).length() - 3] == '4' || std::to_string(mother_pdg)[std::to_string(mother_pdg).length() - 4] == '4');

Check failure on line 212 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (abs(mother_pdg) == 443) {

Check failure on line 213 in PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
direct_charm_mother = false; // we don't want JPsi here
}
int cHadronId = -1;
Expand Down
10 changes: 6 additions & 4 deletions PWGEM/Dilepton/Utils/MCUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,16 @@ int searchMothers(T& p, U& mcParticles, int pdg, bool equal)
for (int i : allmothersids) {
auto mother = mcParticles.iteratorAt(i);
int mpdg = mother.pdgCode();
if (abs(mpdg) == pdg && mpdg * p.pdgCode() > 0) { // check for quark
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
// if (abs(mpdg) == pdg && mpdg * p.pdgCode() > 0) { // check for quark
if (abs(mpdg) == pdg) { // check for quark to allow for beauty and charm + oscillation
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
// LOG(warning) << "Flavour tracking is ambiguous. Stopping here.";
return -1;
}
quark_id = i;
} 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
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
//} 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
} 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
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
// LOG(warning) << "Flavour tracking is ambiguous. Stopping here.";
return -1;
}
Expand Down
Loading