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
14 changes: 8 additions & 6 deletions EventFiltering/PWGHF/HFFilter.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 EventFiltering/PWGHF/HFFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -153,7 +153,7 @@
} enableWrongMassHyp;

// parameters for Sigma_C proton trigger
Configurable<LabeledArray<float>> cutsSigmaCPr{

Check failure on line 156 in EventFiltering/PWGHF/HFFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
"cutsSigmaCPr",
{cutsSigmaCPrDefault[0],
static_cast<uint32_t>(labelsRowsSigmaCPr.size()),
Expand Down Expand Up @@ -184,7 +184,7 @@
Configurable<bool> acceptBdtBkgOnly{"acceptBdtBkgOnly", true, "Enable / disable selection based on BDT bkg score only"};

// CCDB configuration
Configurable<std::string> url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check failure on line 187 in EventFiltering/PWGHF/HFFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)

// TPC PID calibrations
Configurable<int> setTPCCalib{"setTPCCalib", 0, "0 is not use re-calibrations, 1 is compute TPC post-calibrated n-sigmas, 2 is using TPC Spline"};
Expand Down Expand Up @@ -249,7 +249,8 @@
std::array<std::shared_ptr<TH1>, kNCharmParticles> hBDTScorePrompt{};
std::array<std::shared_ptr<TH1>, kNCharmParticles> hBDTScoreNonPrompt{};
std::array<std::shared_ptr<TH2>, kNV0> hArmPod{};
std::shared_ptr<TH2> hV0Selected, hMassVsCtCharmBaryonToXiPiPi;
std::shared_ptr<TH2> hV0Selected;
std::array<std::shared_ptr<TH2>, 2> hMassVsCtCharmBaryonToXi{};
std::array<std::shared_ptr<TH2>, 2> hMassXi{}; // not tracked and tracked
std::array<std::shared_ptr<TH2>, kNBeautyParticles> hCpaVsPtB{};
std::array<std::shared_ptr<TH2>, kNBeautyParticles> hDecayLengthVsPtB{};
Expand Down Expand Up @@ -348,7 +349,7 @@

hProcessedEvents = registry.add<TH1>("fProcessedEvents", "HF - event filtered;;counts", HistType::kTH1D, {{kNtriggersHF + 2, -0.5, +kNtriggersHF + 1.5}});
for (auto iBin = 0; iBin < kNtriggersHF + 2; ++iBin) {
if (iBin < 2)

Check failure on line 352 in EventFiltering/PWGHF/HFFilter.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.
hProcessedEvents->GetXaxis()->SetBinLabel(iBin + 1, eventTitles[iBin].data());
else
hProcessedEvents->GetXaxis()->SetBinLabel(iBin + 1, hfTriggerNames[iBin - 2].data());
Expand Down Expand Up @@ -390,7 +391,8 @@
hMassVsPtC[kNCharmParticles + 15] = registry.add<TH2>("fMassVsPtCharmBaryonToXiPi", "#it{M} vs. #it{p}_{T} distribution of triggered #Xi+#pi candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 15]});
hMassVsPtC[kNCharmParticles + 16] = registry.add<TH2>("fMassVsPtCharmBaryonToXiKa", "#it{M} vs. #it{p}_{T} distribution of triggered #Xi+K candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 16]});
hMassVsPtC[kNCharmParticles + 17] = registry.add<TH2>("fMassVsPtCharmBaryonToXiPiPi", "#it{M} vs. #it{p}_{T} distribution of triggered #Xi+#pi+#pi candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 17]});
hMassVsCtCharmBaryonToXiPiPi = registry.add<TH2>("fMassVsCtCharmBaryonToXiPiPi", "#it{M} vs. ct distribution of triggered #Xi+#pi+#pi candidates;ct (cm);#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ctAxis, massAxisC[kNCharmParticles + 17]});
hMassVsCtCharmBaryonToXi[0] = registry.add<TH2>("fMassVsCtCharmBaryonToXiPi", "#it{M} vs. ct distribution of triggered #Xi+#pi candidates;ct (cm);#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ctAxis, massAxisC[kNCharmParticles + 15]});
hMassVsCtCharmBaryonToXi[1] = registry.add<TH2>("fMassVsCtCharmBaryonToXiPiPi", "#it{M} vs. ct distribution of triggered #Xi+#pi+#pi candidates;ct (cm);#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ctAxis, massAxisC[kNCharmParticles + 17]});
// JPsi
hMassVsPtC[kNCharmParticles + 18] = registry.add<TH2>("fMassVsPtJPsiToMuMu", "#it{M} vs. #it{p}_{T} distribution of triggered J/#psi to #mu#mu candidates;#it{p}_{T} (GeV/#it{c});#it{M} (GeV/#it{c}^{2});counts", HistType::kTH2D, {ptAxis, massAxisC[kNCharmParticles + 18]});
// Lc resonances
Expand Down Expand Up @@ -571,7 +573,7 @@
std::vector<float> scores{};
if (preselD0) {
scores.insert(scores.end(), cand2Prong.mlProbSkimD0ToKPi().begin(), cand2Prong.mlProbSkimD0ToKPi().end());
if (scores.size() != 3) {

Check failure on line 576 in EventFiltering/PWGHF/HFFilter.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.
scores.resize(3);
scores[0] = 2.;
scores[1] = -1.;
Expand Down Expand Up @@ -1343,7 +1345,7 @@
continue;
}

if (scores[iCharmPart].size() != 3) {

Check failure on line 1348 in EventFiltering/PWGHF/HFFilter.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.
scores[iCharmPart].resize(3);
scores[iCharmPart][0] = 2.;
scores[iCharmPart][1] = -1.;
Expand Down Expand Up @@ -1610,7 +1612,7 @@
/// - it has the correct charge (±1)
/// - it is in the correct mass range
// check the charge for SigmaC++K- candidates
if (!keepEvent[kSigmaCPPK] && (std::abs(chargeSc + track.sign()) == 1 && std::abs(chargeSc) == 2)) {

Check failure on line 1615 in EventFiltering/PWGHF/HFFilter.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.
// check the invariant mass
float massSigmaCPKPi{-999.}, massSigmaCPiKP{-999.}, deltaMassXicResoPKPi{-999.}, deltaMassXicResoPiKP{-999.};
float ptSigmaCKaon = RecoDecay::pt(pVecSigmaC, pVecFourth);
Expand Down Expand Up @@ -1912,7 +1914,7 @@
std::array<float, 2> dcaInfo;
o2::track::TrackParCov trackParCasc;
o2::track::TrackParCov trackParCascTrack;
if (requireStrangenessTrackingAny < 2) { // needed for at least one of the two

Check failure on line 1917 in EventFiltering/PWGHF/HFFilter.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.
trackParCasc = o2::track::TrackParCov(cascCand.vtx, cascCand.mom, cascCand.cov, cascCand.sign, true);
trackParCasc.setPID(o2::track::PID::XiMinus);
trackParCasc.setAbsCharge(1); // to be sure
Expand Down Expand Up @@ -1949,10 +1951,10 @@
bool isSelXiBach{false};
if (requireStrangenessTracking->get(0u, 0u) > 0) {
if (hasStrangeTrack) {
isSelXiBach = helper.isSelectedXiBach(trackParCascTrack, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16]);
isSelXiBach = helper.isSelectedXiBach(trackParCascTrack, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16], hMassVsCtCharmBaryonToXi[0]);
}
} else {
isSelXiBach = helper.isSelectedXiBach(trackParCasc, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16]);
isSelXiBach = helper.isSelectedXiBach(trackParCasc, trackParBachelor, isSelBachelor, collision, dfStrangeness, activateQA, hMassVsPtC[kNCharmParticles + 15], hMassVsPtC[kNCharmParticles + 16], hMassVsCtCharmBaryonToXi[0]);
}
if (isSelXiBach) {
keepEvent[kCharmBarToXiBach] = true;
Expand Down Expand Up @@ -1992,10 +1994,10 @@
bool isSelXiBachBach{false};
if (requireStrangenessTracking->get(0u, 1u) > 0) {
if (hasStrangeTrack) {
isSelXiBachBach = helper.isSelectedXiBachBach<3>(trackParCascTrack, {trackParBachelor, trackParBachelorSecond}, collision, dfStrangeness3, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXiPiPi);
isSelXiBachBach = helper.isSelectedXiBachBach<3>(trackParCascTrack, {trackParBachelor, trackParBachelorSecond}, collision, dfStrangeness3, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXi[1]);
}
} else { // vertex with only the two bachelors
isSelXiBachBach = helper.isSelectedXiBachBach<2>(trackParCasc, {trackParBachelor, trackParBachelorSecond}, collision, df2, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXiPiPi);
isSelXiBachBach = helper.isSelectedXiBachBach<2>(trackParCasc, {trackParBachelor, trackParBachelorSecond}, collision, df2, activateQA, hMassVsPtC[kNCharmParticles + 17], hMassVsCtCharmBaryonToXi[1]);
}
if (isSelXiBachBach) {
keepEvent[kCharmBarToXi2Bach] = true;
Expand Down
11 changes: 8 additions & 3 deletions EventFiltering/PWGHF/HFFilterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
constexpr float massDs = o2::constants::physics::MassDS;
constexpr float massLc = o2::constants::physics::MassLambdaCPlus;
constexpr float massXic = o2::constants::physics::MassXiCPlus;
constexpr float massXic0 = o2::constants::physics::MassXiC0;
constexpr float massDStar = o2::constants::physics::MassDStar;
constexpr float massBPlus = o2::constants::physics::MassBPlus;
constexpr float massB0 = o2::constants::physics::MassB0;
Expand All @@ -296,7 +297,7 @@
static const o2::framework::AxisSpec qtAxis{100, 0.f, 0.25f};
static const o2::framework::AxisSpec bdtAxis{100, 0.f, 1.f};
static const o2::framework::AxisSpec phiAxis{36, 0., o2::constants::math::TwoPI};
static const std::array<o2::framework::AxisSpec, kNCharmParticles + 24> massAxisC = {o2::framework::AxisSpec{250, 1.65f, 2.15f}, o2::framework::AxisSpec{250, 1.65f, 2.15f}, o2::framework::AxisSpec{250, 1.75f, 2.25f}, o2::framework::AxisSpec{250, 2.05f, 2.55f}, o2::framework::AxisSpec{250, 2.25f, 2.75f}, o2::framework::AxisSpec{200, 0.139f, 0.159f}, o2::framework::AxisSpec{250, 0.f, 0.25f}, o2::framework::AxisSpec{250, 0.f, 0.25f}, o2::framework::AxisSpec{200, 0.48f, 0.88f}, o2::framework::AxisSpec{200, 0.48f, 0.88f}, o2::framework::AxisSpec{200, 1.1f, 1.4f}, o2::framework::AxisSpec{200, 1.1f, 1.4f}, o2::framework::AxisSpec{200, 1.1f, 1.4f}, o2::framework::AxisSpec{200, 1.1f, 1.4f}, o2::framework::AxisSpec{170, 0.13f, 0.3f}, o2::framework::AxisSpec{170, 0.13f, 0.3f}, o2::framework::AxisSpec{200, 0.4f, 0.8f}, o2::framework::AxisSpec{200, 0.4f, 0.8f}, o2::framework::AxisSpec{200, 0.4f, 0.8f}, o2::framework::AxisSpec{200, 0.4f, 0.8f}, o2::framework::AxisSpec{350, 2.3f, 3.0f}, o2::framework::AxisSpec{350, 2.3f, 3.0f}, o2::framework::AxisSpec{350, 2.3f, 3.0f}, o2::framework::AxisSpec{240, 2.4f, 3.6f}, o2::framework::AxisSpec{300, 0.7f, 1.3f}, o2::framework::AxisSpec{300, 0.7f, 1.3f}, o2::framework::AxisSpec{300, 0.7f, 1.3f}, o2::framework::AxisSpec{300, 0.7f, 1.3f}, o2::framework::AxisSpec{300, 0.14f, 0.26f}};

Check failure on line 300 in EventFiltering/PWGHF/HFFilterHelpers.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-mass]

Avoid hard-coded particle masses. Use o2::constants::physics::Mass... instead.
static const std::array<o2::framework::AxisSpec, nTotBeautyParts> massAxisB = {o2::framework::AxisSpec{500, 4.2f, 6.2f}, o2::framework::AxisSpec{500, 4.2f, 6.2f}, o2::framework::AxisSpec{500, 5.4f, 7.4f}, o2::framework::AxisSpec{500, 4.2f, 6.2f}, o2::framework::AxisSpec{500, 4.4f, 6.4f}, o2::framework::AxisSpec{400, 5.0f, 6.6f}, o2::framework::AxisSpec{500, 4.2f, 6.2f}, o2::framework::AxisSpec{500, 4.2f, 6.2f}, o2::framework::AxisSpec{500, 4.2f, 6.2f}, o2::framework::AxisSpec{500, 4.2f, 6.2f}, o2::framework::AxisSpec{400, 5.0f, 6.6f}, o2::framework::AxisSpec{240, 5.8f, 7.0f}};

// default values for configurables
Expand Down Expand Up @@ -717,7 +718,7 @@
template <typename T1>
bool isCharmHadronMassInSbRegions(T1 const& massHypo1, T1 const& massHypo2, const float& lowLimitSB, const float& upLimitSB);
template <typename T, typename C, typename H2>
bool isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa);
bool isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa, H2 hMassVsCtXiPi);
template <int Nprongs, typename T, typename C, typename H2>
bool isSelectedXiBachBach(T const& trackParCasc, std::array<T, 2> const& trackParBachelor, C const& collision, o2::vertexing::DCAFitterN<Nprongs>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPiPi, H2 hMassVsCtXiPiPi);
template <bool is4ThetaC = false, typename T>
Expand Down Expand Up @@ -919,7 +920,7 @@
return kRejected;
}

if (std::fabs(trackPar.getEta()) > 0.8) {

Check failure on line 923 in EventFiltering/PWGHF/HFFilterHelpers.h

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.
return kRejected;
}

Expand Down Expand Up @@ -2423,8 +2424,9 @@
/// \param activateQA is the flag to activate the QA
/// \param hMassVsPtXiPi is the 2D histogram with pT vs mass(XiPi)
/// \param hMassVsPtXiKa is the 2D histogram with pT vs mass(XiKa)
/// \param hMassVsCtXiPi is the 2D histogram with ct vs mass(XiPi)
template <typename T, typename C, typename H2>
inline bool HfFilterHelper::isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa)
inline bool HfFilterHelper::isSelectedXiBach(T const& trackParCasc, T const& trackParBachelor, int8_t isSelBachelor, C const& collision, o2::vertexing::DCAFitterN<2>& dcaFitter, const int& activateQA, H2 hMassVsPtXiPi, H2 hMassVsPtXiKa, H2 hMassVsCtXiPi)
{
bool isSelectedXiPi{false}, isSelectedXiKa{false};

Expand Down Expand Up @@ -2483,13 +2485,16 @@
return false;
}

if (RecoDecay::distance(primVtx, vtx) < mDecLenMinXiBach[0]) {
auto decLenXiBach = RecoDecay::distance(primVtx, vtx);
if (decLenXiBach < mDecLenMinXiBach[0]) {
return false;
}

if (activateQA) {
if (isSelectedXiPi) {
auto ctXiBach = RecoDecay::ct(momXiBach, decLenXiBach, massXic0);
hMassVsPtXiPi->Fill(ptXiBach, massXiPi);
hMassVsCtXiPi->Fill(ctXiBach, massXiPi);
}
if (isSelectedXiKa) {
hMassVsPtXiKa->Fill(ptXiBach, massXiKa);
Expand Down
Loading