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
5 changes: 3 additions & 2 deletions PWGHF/Core/DecayChannels.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ enum DecayChannelMain : int8_t {
B0ToDminusPiPi0 = 2, // D− π+ π0
B0ToDminusPiGamma = 3, // D− π+ γ0
B0ToDminusK = 4, // D− K+
B0ToD0PiPi = 5, // anti-D0 π+
B0ToD0PiPi = 5, // anti-D0 π+ π−
B0ToDsPi = 19, // Ds− π+
// Bs0
BsToDsPi = 6, // Ds− π+
BsToDsPiPi0 = 7, // Ds− π+ π0
Expand All @@ -172,7 +173,7 @@ enum DecayChannelMain : int8_t {
BplusToD0PiGamma = 17, // anti-D0 π+ γ0
BplusToD0K = 18, // anti-D0 K+
//
NChannelsMain = BplusToD0K // last channel
NChannelsMain = B0ToDsPi // last channel
};
/// @brief beauty candidates: resonant channels
enum DecayChannelResonant : int8_t {
Expand Down
16 changes: 8 additions & 8 deletions PWGHF/D2H/DataModel/ReducedDataModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ DECLARE_SOA_TABLE(HfMcCheckDpPis, "AOD", "HFMCCHECKDPPI", //! Table with reconst
// Table with same size as HFCANDB0
DECLARE_SOA_TABLE(HfMcRecRedB0s, "AOD", "HFMCRECREDB0", //! Reconstruction-level MC information on B0 candidates for reduced workflow
hf_cand_b0::FlagMcMatchRec,
hf_cand_b0::ChannelMcMatchRec,
hf_cand_b0::FlagMcDecayChanRec,
hf_cand_b0::FlagWrongCollision,
hf_cand_b0::DebugMcRec,
hf_b0_mc::PtMother);
Expand All @@ -823,7 +823,7 @@ DECLARE_SOA_TABLE(HfMcCheckB0s, "AOD", "HFMCCHECKB0", //! Table with reconstruct

DECLARE_SOA_TABLE(HfMcGenRedB0s, "AOD", "HFMCGENREDB0", //! Generation-level MC information on B0 candidates for reduced workflow
hf_cand_b0::FlagMcMatchGen,
hf_cand_b0::ChannelMcMatchRec,
hf_cand_b0::FlagMcDecayChanRec,
hf_b0_mc::PtTrack,
hf_b0_mc::YTrack,
hf_b0_mc::EtaTrack,
Expand Down Expand Up @@ -885,7 +885,7 @@ DECLARE_SOA_TABLE(HfMcRecRedJPKs, "AOD", "HFMCRECREDJPK", //! Table with reconst
hf_cand_bplus_reduced::JpsiId,
hf_cand_bplus_reduced::BachKaId,
hf_cand_bplus::FlagMcMatchRec,
hf_cand_bplus::ChannelMcMatchRec,
hf_cand_bplus::FlagMcDecayChanRec,
hf_cand_bplus::FlagWrongCollision,
hf_cand_bplus::DebugMcRec,
hf_bplus_mc::PtMother);
Expand All @@ -902,7 +902,7 @@ DECLARE_SOA_TABLE(HfMcCheckD0Pis, "AOD", "HFMCCHECKD0PI", //! Table with reconst
// Table with same size as HFCANDBPLUS
DECLARE_SOA_TABLE(HfMcRecRedBps, "AOD", "HFMCRECREDBP", //! Reconstruction-level MC information on B+ candidates for reduced workflow
hf_cand_bplus::FlagMcMatchRec,
hf_cand_bplus::ChannelMcMatchRec,
hf_cand_bplus::FlagMcDecayChanRec,
hf_cand_bplus::FlagWrongCollision,
hf_cand_bplus::DebugMcRec,
hf_bplus_mc::PtMother);
Expand All @@ -917,7 +917,7 @@ DECLARE_SOA_TABLE(HfMcCheckBps, "AOD", "HFMCCHECKBP", //! Table with reconstruct

DECLARE_SOA_TABLE(HfMcGenRedBps, "AOD", "HFMCGENREDBP", //! Generation-level MC information on B+ candidates for reduced workflow
hf_cand_bplus::FlagMcMatchGen,
hf_cand_bplus::ChannelMcMatchRec,
hf_cand_bplus::FlagMcDecayChanRec,
hf_bplus_mc::PtTrack,
hf_bplus_mc::YTrack,
hf_bplus_mc::EtaTrack,
Expand Down Expand Up @@ -987,7 +987,7 @@ DECLARE_SOA_TABLE(HfMcRecRedJPPhis, "AOD", "HFMCRECREDJPPHI", //! Table with rec
hf_cand_bs_reduced::Prong0PhiId,
hf_cand_bs_reduced::Prong1PhiId,
hf_cand_bs::FlagMcMatchRec,
hf_cand_bs::ChannelMcMatchRec,
hf_cand_bs::FlagMcDecayChanRec,
hf_cand_bs::FlagWrongCollision,
hf_cand_bs::DebugMcRec,
hf_bs_mc::PtMother);
Expand All @@ -1006,7 +1006,7 @@ DECLARE_SOA_TABLE(HfMcCheckDsPis, "AOD", "HFMCCHECKDSPI", //! Table with reconst
// Table with same size as HFCANDBS
DECLARE_SOA_TABLE(HfMcRecRedBss, "AOD", "HFMCRECREDBS", //! Reconstruction-level MC information on Bs candidates for reduced workflow
hf_cand_bs::FlagMcMatchRec,
hf_cand_bs::ChannelMcMatchRec,
hf_cand_bs::FlagMcDecayChanRec,
hf_cand_bs::FlagWrongCollision,
hf_cand_bs::DebugMcRec,
hf_bs_mc::PtMother);
Expand All @@ -1022,7 +1022,7 @@ DECLARE_SOA_TABLE(HfMcCheckBss, "AOD", "HFMCCHECKBS", //! Table with reconstruct

DECLARE_SOA_TABLE(HfMcGenRedBss, "AOD", "HFMCGENREDBS", //! Generation-level MC information on Bs candidates for reduced workflow
hf_cand_bs::FlagMcMatchGen,
hf_cand_bs::ChannelMcMatchRec,
hf_cand_bs::FlagMcDecayChanRec,
hf_bs_mc::PtTrack,
hf_bs_mc::YTrack,
hf_bs_mc::EtaTrack,
Expand Down
4 changes: 2 additions & 2 deletions PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ struct HfCandidateCreatorBToJpsiReducedExpressions {
if ((rowJpsiHadMcRec.jpsiId() != candB.jpsiId()) || (rowJpsiHadMcRec.bachKaId() != candB.bachKaId())) {
continue;
}
rowBplusMcRec(rowJpsiHadMcRec.flagMcMatchRec(), rowJpsiHadMcRec.channelMcMatchRec(), rowJpsiHadMcRec.flagWrongCollision(), rowJpsiHadMcRec.debugMcRec(), rowJpsiHadMcRec.ptMother());
rowBplusMcRec(rowJpsiHadMcRec.flagMcMatchRec(), rowJpsiHadMcRec.flagMcDecayChanRec(), rowJpsiHadMcRec.flagWrongCollision(), rowJpsiHadMcRec.debugMcRec(), rowJpsiHadMcRec.ptMother());
filledMcInfo = true;
break;
}
Expand All @@ -448,7 +448,7 @@ struct HfCandidateCreatorBToJpsiReducedExpressions {
if ((rowJpsiHadMcRec.jpsiId() != candB.jpsiId()) || (rowJpsiHadMcRec.prong0PhiId() != candB.prong0PhiId()) || (rowJpsiHadMcRec.prong1PhiId() != candB.prong1PhiId())) {
continue;
}
rowBsMcRec(rowJpsiHadMcRec.flagMcMatchRec(), rowJpsiHadMcRec.channelMcMatchRec(), rowJpsiHadMcRec.flagWrongCollision(), rowJpsiHadMcRec.debugMcRec(), rowJpsiHadMcRec.ptMother());
rowBsMcRec(rowJpsiHadMcRec.flagMcMatchRec(), rowJpsiHadMcRec.flagMcDecayChanRec(), rowJpsiHadMcRec.flagWrongCollision(), rowJpsiHadMcRec.debugMcRec(), rowJpsiHadMcRec.ptMother());
filledMcInfo = true;
break;
}
Expand Down
20 changes: 11 additions & 9 deletions PWGHF/D2H/Tasks/taskB0.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGHF/D2H/Tasks/taskB0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

Declare struct members in the conventional order. See the PWGHF coding guidelines.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -14,6 +14,7 @@
///
/// \author Alexandre Bigot <alexandre.bigot@cern.ch>, IPHC Strasbourg

#include "PWGHF/Core/DecayChannels.h"
#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/Core/SelectorCuts.h"
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
Expand Down Expand Up @@ -48,6 +49,7 @@
using namespace o2::analysis;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::hf_decay::hf_cand_beauty;

/// B0 analysis task
struct HfTaskB0 {
Expand All @@ -61,7 +63,7 @@
Configurable<bool> checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"};

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;

Check failure on line 66 in PWGHF/D2H/Tasks/taskB0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfTaskB0: Service< appears too early (before end of HfHelper).
HfHelper hfHelper;

using TracksWithSel = soa::Join<aod::Tracks, aod::TrackSelection>;
Expand Down Expand Up @@ -146,15 +148,15 @@
registry.add("hPtGenWithProngsInAcceptance", "MC particles (generated-daughters in acceptance);candidate #it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1F, {{300, 0., 30.}}});

if (checkDecayTypeMc) {
constexpr uint8_t kNBinsDecayTypeMc = hf_cand_b0::DecayTypeMc::NDecayTypeMc;
TString labels[kNBinsDecayTypeMc];
constexpr uint8_t NBinsDecayTypeMc = hf_cand_b0::DecayTypeMc::NDecayTypeMc; // FIXME
TString labels[NBinsDecayTypeMc];
labels[hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi] = "B^{0} #rightarrow (D^{#minus} #rightarrow #pi^{#minus} K^{#plus} #pi^{#minus}) #pi^{#plus}";
labels[hf_cand_b0::DecayTypeMc::B0ToDsPiToKKPiPi] = "B^{0} #rightarrow (D^{#minus}_{s} #rightarrow K^{#minus} K^{#plus} #pi^{#minus}) #pi^{#plus}";
labels[hf_cand_b0::DecayTypeMc::PartlyRecoDecay] = "Partly reconstructed decay channel";
labels[hf_cand_b0::DecayTypeMc::OtherDecay] = "Other decays";
static const AxisSpec axisDecayType = {kNBinsDecayTypeMc, 0.5, kNBinsDecayTypeMc + 0.5, ""};
static const AxisSpec axisDecayType = {NBinsDecayTypeMc, 0.5, NBinsDecayTypeMc + 0.5, ""};
registry.add("hDecayTypeMc", "DecayType", {HistType::kTH3F, {axisDecayType, axisMassB0, axisPt}});
for (uint8_t iBin = 0; iBin < kNBinsDecayTypeMc; ++iBin) {
for (uint8_t iBin = 0; iBin < NBinsDecayTypeMc; ++iBin) {
registry.get<TH3>(HIST("hDecayTypeMc"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin]);
}
}
Expand Down Expand Up @@ -219,9 +221,9 @@
auto ptCandB0 = candidate.pt();
auto candD = candidate.prong0_as<soa::Join<aod::HfCand3Prong, aod::HfCand3ProngMcRec>>();
auto invMassCandB0 = hfHelper.invMassB0ToDPi(candidate);
int flagMcMatchRecB0 = std::abs(candidate.flagMcMatchRec());
auto flagMcMatchRecB0 = std::abs(candidate.flagMcMatchRec());

if (TESTBIT(flagMcMatchRecB0, hf_cand_b0::DecayTypeMc::B0ToDplusPiToPiKPiPi)) {
if (flagMcMatchRecB0 == DecayChannelMain::B0ToDminusPi) {
auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as<aod::TracksWMc>().mcParticle_as<soa::Join<aod::McParticles, aod::HfCandB0McGen>>(), o2::constants::physics::Pdg::kB0, true);
auto particleMother = mcParticles.rawIteratorAt(indexMother);

Expand Down Expand Up @@ -267,9 +269,9 @@
registry.fill(HIST("hChi2PCARecBg"), candidate.chi2PCA(), ptCandB0);

if (checkDecayTypeMc) {
if (TESTBIT(flagMcMatchRecB0, hf_cand_b0::DecayTypeMc::B0ToDsPiToKKPiPi)) { // B0 → Ds- π+ → (K- K+ π-) π+
if (flagMcMatchRecB0 == DecayChannelMain::B0ToDsPi) { // B0 → Ds- π+ → (K- K+ π-) π+
registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_b0::DecayTypeMc::B0ToDsPiToKKPiPi, invMassCandB0, ptCandB0);
} else if (TESTBIT(flagMcMatchRecB0, hf_cand_b0::DecayTypeMc::PartlyRecoDecay)) { // Partly reconstructed decay channel
} else if (flagMcMatchRecB0 == hf_cand_b0::DecayTypeMc::PartlyRecoDecay) { // FIXME, Partly reconstructed decay channel
registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_b0::DecayTypeMc::PartlyRecoDecay, invMassCandB0, ptCandB0);
} else {
registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_b0::DecayTypeMc::OtherDecay, invMassCandB0, ptCandB0);
Expand All @@ -280,7 +282,7 @@

// MC gen. level
for (const auto& particle : mcParticles) {
if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_b0::DecayType::B0ToDPi)) {
if (std::abs(particle.flagMcMatchGen()) == o2::hf_decay::hf_cand_beauty::DecayChannelMain::B0ToDminusPi) {

auto ptParticle = particle.pt();
auto yParticle = RecoDecay::y(particle.pVector(), o2::constants::physics::MassB0);
Expand Down Expand Up @@ -311,7 +313,7 @@
registry.fill(HIST("hEtaGen"), particle.eta(), ptParticle);

// generated B0 with |y|<0.5
if (std::abs(yParticle) < 0.5) {

Check failure on line 316 in PWGHF/D2H/Tasks/taskB0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hPtGenWithRapidityBelowHalf"), ptParticle);
}

Expand Down
6 changes: 4 additions & 2 deletions PWGHF/D2H/Tasks/taskBplus.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGHF/D2H/Tasks/taskBplus.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

Declare struct members in the conventional order. See the PWGHF coding guidelines.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -18,6 +18,7 @@
/// \author Antonio Palasciano <antonio.palasciano@cern.ch>, Università degli Studi di Bari & INFN, Sezione di Bari
/// \author Deepa Thomas <deepa.thomas@cern.ch>, UT Austin

#include "PWGHF/Core/DecayChannels.h"
#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/Core/SelectorCuts.h"
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
Expand Down Expand Up @@ -48,6 +49,7 @@
using namespace o2::analysis;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::hf_decay::hf_cand_beauty;

// string definitions, used for histogram axis labels
const TString stringPt = "#it{p}_{T} (GeV/#it{c})";
Expand All @@ -67,7 +69,7 @@
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{hf_cuts_bplus_to_d0_pi::vecBinsPt}, "pT bin limits"};

// O2DatabasePDG service
Service<o2::framework::O2DatabasePDG> pdg;

Check failure on line 72 in PWGHF/D2H/Tasks/taskBplus.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfTaskBplus: Service< appears too early (before end of HfHelper).
HfHelper hfHelper;

Partition<soa::Join<aod::HfCandBplus, aod::HfSelBplusToD0Pi>> selectedBPlusCandidates = aod::hf_sel_candidate_bplus::isSelBplusToD0Pi >= selectionFlagBplus;
Expand Down Expand Up @@ -224,7 +226,7 @@
}
auto ptCandBplus = candidate.pt();
// auto candD0 = candidate.prong0_as<aod::HfCand2Prong>();
if (TESTBIT(std::abs(candidate.flagMcMatchRec()), hf_cand_bplus::DecayType::BplusToD0Pi)) {
if (std::abs(candidate.flagMcMatchRec()) == DecayChannelMain::BplusToD0Pi) {

auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as<aod::TracksWMc>().mcParticle_as<soa::Join<aod::McParticles, aod::HfCandBplusMcGen>>(), o2::constants::physics::Pdg::kBPlus, true);
auto particleMother = mcParticles.rawIteratorAt(indexMother);
Expand Down Expand Up @@ -267,7 +269,7 @@

// MC gen. level
for (const auto& particle : mcParticles) {
if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_bplus::DecayType::BplusToD0Pi)) {
if (std::abs(particle.flagMcMatchGen()) == DecayChannelMain::BplusToD0Pi) {

auto ptParticle = particle.pt();
auto yParticle = RecoDecay::y(particle.pVector(), o2::constants::physics::MassBPlus);
Expand Down Expand Up @@ -298,7 +300,7 @@
registry.fill(HIST("hYGen"), yParticle, ptParticle);
registry.fill(HIST("hEtaGen"), particle.eta(), ptParticle);
// generated B0 with |y|<0.5
if (std::abs(yParticle) < 0.5) {

Check failure on line 303 in PWGHF/D2H/Tasks/taskBplus.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hPtGenWithRapidityBelowHalf"), ptParticle);
}

Expand Down
8 changes: 4 additions & 4 deletions PWGHF/D2H/Tasks/taskBplusToJpsiKReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ DECLARE_SOA_TABLE(HfRedCandBpLites, "AOD", "HFREDCANDBPLITE", //! Table with som
hf_cand_bplustojpsik_lite::NSigTpcTofKaBachelor,
// MC truth
hf_cand_bplus::FlagMcMatchRec,
hf_cand_bplus::ChannelMcMatchRec,
hf_cand_bplus::FlagMcDecayChanRec,
hf_cand_bplus::OriginMcRec,
hf_cand_bplustojpsik_lite::FlagWrongCollision,
hf_cand_bplustojpsik_lite::PtGen);
Expand Down Expand Up @@ -324,11 +324,11 @@ struct HfTaskBplusToJpsiKReduced {
auto invMassJpsi = candJpsi.m();
uint8_t statusBplus = 0;

int8_t flagMcMatchRec{0}, channelMcMatchRec{0}, flagWrongCollision{0};
int8_t flagMcMatchRec{0}, flagMcDecayChanRec{0}, flagWrongCollision{0};
bool isSignal = false;
if constexpr (doMc) {
flagMcMatchRec = candidate.flagMcMatchRec();
channelMcMatchRec = candidate.channelMcMatchRec();
flagMcDecayChanRec = candidate.flagMcDecayChanRec();
flagWrongCollision = candidate.flagWrongCollision();
isSignal = std::abs(flagMcMatchRec) == o2::hf_decay::hf_cand_beauty::BplusToJpsiK;
}
Expand Down Expand Up @@ -431,7 +431,7 @@ struct HfTaskBplusToJpsiKReduced {
candKa.tpcTofNSigmaKa(),
// MC truth
flagMcMatchRec,
channelMcMatchRec,
flagMcDecayChanRec,
isSignal,
flagWrongCollision,
ptMother);
Expand Down
20 changes: 11 additions & 9 deletions PWGHF/D2H/Tasks/taskBs.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGHF/D2H/Tasks/taskBs.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

Declare struct members in the conventional order. See the PWGHF coding guidelines.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -15,6 +15,7 @@
///
/// \author Phil Stahlhut <phil.lennart.stahlhut@cern.ch>

#include "PWGHF/Core/DecayChannels.h"
#include "PWGHF/Core/HfHelper.h"
#include "PWGHF/Core/SelectorCuts.h"
#include "PWGHF/DataModel/CandidateReconstructionTables.h"
Expand Down Expand Up @@ -49,6 +50,7 @@
using namespace o2::analysis;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::hf_decay::hf_cand_beauty;

/// Bs analysis task
struct HfTaskBs {
Expand All @@ -61,7 +63,7 @@
// MC checks
Configurable<bool> checkDecayTypeMc{"checkDecayTypeMc", false, "Flag to enable DecayType histogram"};

Service<o2::framework::O2DatabasePDG> pdg;

Check failure on line 66 in PWGHF/D2H/Tasks/taskBs.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfTaskBs: Service< appears too early (before end of HfHelper).
HfHelper hfHelper;

using TracksWithSel = soa::Join<aod::Tracks, aod::TrackSelection>;
Expand Down Expand Up @@ -144,15 +146,15 @@
registry.add("hYGenWithProngsInAcceptance", "MC particles (generated-daughters in acceptance);B^{0}_{s} candidate #it{y}^{gen};entries", {HistType::kTH2F, {{100, -2., 2.}, axisPt}});

if (checkDecayTypeMc) {
constexpr uint8_t kNBinsDecayTypeMc = hf_cand_bs::DecayTypeMc::NDecayTypeMc + 1;
TString labels[kNBinsDecayTypeMc];
constexpr uint8_t NBinsDecayTypeMc = hf_cand_bs::DecayTypeMc::NDecayTypeMc + 1;
TString labels[NBinsDecayTypeMc];
labels[hf_cand_bs::DecayTypeMc::BsToDsPiToPhiPiPiToKKPiPi] = "B^{0}_{s} #rightarrow (D^{#mp}_{s} #rightarrow K^{#minus} K^{#plus} #pi^{#mp}) #pi^{#pm}";
labels[hf_cand_bs::DecayTypeMc::B0ToDsPiToPhiPiPiToKKPiPi] = "B^{0} #rightarrow (D^{#pm}_{s} #rightarrow K^{#minus} K^{#plus} #pi^{#pm}) #pi^{#mp}";
labels[hf_cand_bs::DecayTypeMc::PartlyRecoDecay] = "Partly reconstructed decay channel";
labels[hf_cand_bs::DecayTypeMc::NDecayTypeMc] = "Other decays";
static const AxisSpec axisDecayType = {kNBinsDecayTypeMc, 0.5, kNBinsDecayTypeMc + 0.5, ""};
static const AxisSpec axisDecayType = {NBinsDecayTypeMc, 0.5, NBinsDecayTypeMc + 0.5, ""};
registry.add("hDecayTypeMc", "DecayType", {HistType::kTH3F, {axisDecayType, axisMassBs, axisPt}});
for (uint8_t iBin = 0; iBin < kNBinsDecayTypeMc; ++iBin) {
for (uint8_t iBin = 0; iBin < NBinsDecayTypeMc; ++iBin) {
registry.get<TH3>(HIST("hDecayTypeMc"))->GetXaxis()->SetBinLabel(iBin + 1, labels[iBin]);
}
}
Expand Down Expand Up @@ -216,9 +218,9 @@
auto ptCandBs = candidate.pt();
auto candDs = candidate.prong0_as<soa::Join<aod::HfCand3Prong, aod::HfCand3ProngMcRec>>();
auto invMassCandBs = hfHelper.invMassBsToDsPi(candidate);
int flagMcMatchRecBs = std::abs(candidate.flagMcMatchRec());
auto flagMcMatchRecBs = std::abs(candidate.flagMcMatchRec());

if (TESTBIT(flagMcMatchRecBs, hf_cand_bs::DecayTypeMc::BsToDsPiToPhiPiPiToKKPiPi)) {
if (flagMcMatchRecBs == DecayChannelMain::BsToDsPi) {
auto indexMother = RecoDecay::getMother(mcParticles, candidate.prong1_as<aod::TracksWMc>().mcParticle_as<soa::Join<aod::McParticles, aod::HfCandBsMcGen>>(), o2::constants::physics::Pdg::kBS, true);
auto particleMother = mcParticles.rawIteratorAt(indexMother);

Expand Down Expand Up @@ -264,9 +266,9 @@
registry.fill(HIST("hChi2PCARecBg"), candidate.chi2PCA(), ptCandBs);

if (checkDecayTypeMc) {
if (TESTBIT(flagMcMatchRecBs, hf_cand_bs::DecayTypeMc::B0ToDsPiToPhiPiPiToKKPiPi)) { // B0(bar) → Ds± π∓ → (K- K+ π±) π∓
if (flagMcMatchRecBs == DecayChannelMain::B0ToDsPi) { // B0(bar) → Ds± π∓ → (K- K+ π±) π∓
registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_bs::DecayTypeMc::B0ToDsPiToPhiPiPiToKKPiPi, invMassCandBs, ptCandBs);
} else if (TESTBIT(flagMcMatchRecBs, hf_cand_bs::DecayTypeMc::PartlyRecoDecay)) { // Partly reconstructed decay channel
} else if (flagMcMatchRecBs == hf_cand_bs::DecayTypeMc::PartlyRecoDecay) { // FIXME, Partly reconstructed decay channel
registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_bs::DecayTypeMc::PartlyRecoDecay, invMassCandBs, ptCandBs);
} else {
registry.fill(HIST("hDecayTypeMc"), 1 + hf_cand_bs::DecayTypeMc::NDecayTypeMc, invMassCandBs, ptCandBs);
Expand All @@ -277,7 +279,7 @@

// MC gen. level
for (const auto& particle : mcParticles) {
if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_bs::DecayTypeMc::BsToDsPiToPhiPiPiToKKPiPi)) {
if (std::abs(particle.flagMcMatchGen()) == DecayChannelMain::BsToDsPi) {

auto ptParticle = particle.pt();
auto yParticle = RecoDecay::y(particle.pVector(), o2::constants::physics::MassBS);
Expand Down Expand Up @@ -307,7 +309,7 @@
registry.fill(HIST("hEtaGen"), particle.eta(), ptParticle);

// generated Bs with |y|<0.5
if (std::abs(yParticle) < 0.5) {

Check failure on line 312 in PWGHF/D2H/Tasks/taskBs.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
registry.fill(HIST("hPtGenWithRapidityBelowHalf"), ptParticle);
}

Expand Down
10 changes: 5 additions & 5 deletions PWGHF/D2H/Tasks/taskBsToJpsiPhiReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ DECLARE_SOA_TABLE(HfRedCandBsLites, "AOD", "HFREDCANDBSLITE", //! Table with som
hf_cand_bstojpsiphi_lite::NSigTpcTofKaBachelor1,
// MC truth
hf_cand_bs::FlagMcMatchRec,
hf_cand_bs::ChannelMcMatchRec,
hf_cand_bs::FlagMcDecayChanRec,
hf_cand_bs::OriginMcRec,
hf_cand_bstojpsiphi_lite::FlagWrongCollision,
hf_cand_bstojpsiphi_lite::PtGen);
Expand Down Expand Up @@ -354,14 +354,14 @@ struct HfTaskBsToJpsiPhiReduced {
auto invMassPhi = RecoDecay::m(std::array{pVecKa0, pVecKa1}, std::array{o2::constants::physics::MassKPlus, o2::constants::physics::MassKPlus});
uint8_t statusBs = 0;

int8_t flagMcMatchRec{0}, channelMcMatchRec{0}, flagWrongCollision{0};
int8_t flagMcMatchRec{0}, flagMcDecayChanRec{0}, flagWrongCollision{0};
bool isSignal = false;
if constexpr (doMc) {
flagMcMatchRec = candidate.flagMcMatchRec();
channelMcMatchRec = candidate.channelMcMatchRec();
flagMcDecayChanRec = candidate.flagMcDecayChanRec();
flagWrongCollision = candidate.flagWrongCollision();
isSignal = flagMcMatchRec == o2::hf_decay::hf_cand_beauty::BsToJpsiKK &&
channelMcMatchRec == o2::hf_decay::hf_cand_beauty::BsToJpsiPhi;
flagMcDecayChanRec == o2::hf_decay::hf_cand_beauty::BsToJpsiPhi;
}

SETBIT(statusBs, SelectionStep::RecoSkims);
Expand Down Expand Up @@ -474,7 +474,7 @@ struct HfTaskBsToJpsiPhiReduced {
candKa1.tpcTofNSigmaKa(),
// MC truth
flagMcMatchRec,
channelMcMatchRec,
flagMcDecayChanRec,
isSignal,
flagWrongCollision,
ptMother);
Expand Down
Loading
Loading