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
4 changes: 2 additions & 2 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// 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 @@ -133,8 +133,8 @@

// CCDB configuration
o2::ccdb::CcdbApi ccdbApi;
Service<o2::ccdb::BasicCCDBManager> ccdb;

Check warning on line 136 in EventFiltering/PWGHF/HFFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfFilter: Service< appears too early (before end of Configurable<).
Configurable<std::string> url{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};

Check warning on line 137 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.)
int currentRun{0}; // needed to detect if the run changed and trigger update of calibrations etc.

// TPC PID calibrations
Expand Down Expand Up @@ -164,7 +164,7 @@
o2::vertexing::DCAFitterN<3> dfBtoDstar; // fitter for Beauty Hadron to D* vertex (3-prong vertex fitter)
o2::vertexing::DCAFitterN<2> dfStrangeness; // fitter for V0s and cascades (2-prong vertex fitter)

HistogramRegistry registry{"registry"};

Check warning on line 167 in EventFiltering/PWGHF/HFFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pwghf/struct-member-order]

HfFilter: HistogramRegistry appears too early (before end of PresliceUnsorted<).
std::shared_ptr<TH1> hProcessedEvents;

// QA histos
Expand Down Expand Up @@ -238,7 +238,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 warning on line 241 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 @@ -385,7 +385,7 @@
for (const auto& collision : collisions) {

bool keepEvent[kNtriggersHF]{false};
if (!collision.sel8() || std::fabs(collision.posZ()) > 11.f) { // safety margin for Zvtx

Check warning on line 388 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.
tags(keepEvent[kHighPt2P], keepEvent[kHighPt3P], keepEvent[kBeauty3P], keepEvent[kBeauty4P], keepEvent[kFemto2P], keepEvent[kFemto3P], keepEvent[kDoubleCharm2P], keepEvent[kDoubleCharm3P], keepEvent[kDoubleCharmMix], keepEvent[kV0Charm2P], keepEvent[kV0Charm3P], keepEvent[kCharmBarToXiBach], keepEvent[kSigmaCPPK], keepEvent[kSigmaC0K0], keepEvent[kPhotonCharm2P], keepEvent[kPhotonCharm3P], keepEvent[kSingleCharm2P], keepEvent[kSingleCharm3P], keepEvent[kSingleNonPromptCharm2P], keepEvent[kSingleNonPromptCharm3P], keepEvent[kCharmBarToXi2Bach], keepEvent[kPrCharm2P], keepEvent[kBtoJPsiKa], keepEvent[kBtoJPsiKstar], keepEvent[kBtoJPsiPhi], keepEvent[kBtoJPsiPrKa], keepEvent[kBtoJPsiPi]);
continue;
}
Expand Down Expand Up @@ -464,7 +464,7 @@
std::vector<float> scores{};
if (preselD0) {
scores.insert(scores.end(), cand2Prong.mlProbSkimD0ToKPi().begin(), cand2Prong.mlProbSkimD0ToKPi().end());
if (scores.size() != 3) {

Check warning on line 467 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 @@ -715,7 +715,7 @@

// Beauty with JPsi
if (preselJPsiToMuMu) {
if (TESTBIT(helper.isSelectedTrackForSoftPionOrBeauty<kBtoJPsiKa>(track, trackParThird, dcaThird), kForBeauty)) { // same for all channels
if (!TESTBIT(helper.isSelectedTrackForSoftPionOrBeauty<kBtoJPsiKa>(track, trackParThird, dcaThird), kForBeauty)) { // same for all channels
continue;
}
std::array<float, 3> pVecPosVtx{}, pVecNegVtx{}, pVecThirdVtx{}, pVecFourthVtx{};
Expand Down Expand Up @@ -753,7 +753,7 @@
o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParFourth, 2.f, noMatCorr, &dcaFourth);
getPxPyPz(trackParFourth, pVecFourth);
}
if (TESTBIT(helper.isSelectedTrackForSoftPionOrBeauty<kBtoJPsiKa>(trackFourth, trackParFourth, dcaFourth), kForBeauty)) { // same for all channels
if (!TESTBIT(helper.isSelectedTrackForSoftPionOrBeauty<kBtoJPsiKa>(trackFourth, trackParFourth, dcaFourth), kForBeauty)) { // same for all channels
continue;
}
if (df4.process(trackParPos, trackParNeg, trackParThird, trackParFourth) != 0) {
Expand Down Expand Up @@ -1150,7 +1150,7 @@
continue;
}

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

Check warning on line 1153 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 @@ -1377,7 +1377,7 @@
// check the candidate SigmaC++ charge
std::array<int, 4> chargesSc = {trackFirst.sign(), trackSecond.sign(), trackThird.sign(), trackSoftPi.sign()};
int chargeSc = std::accumulate(chargesSc.begin(), chargesSc.end(), 0); // SIGNED electric charge of SigmaC candidate
if (std::abs(chargeSc) != 2) {

Check warning on line 1380 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.
continue;
}

Expand Down Expand Up @@ -1699,7 +1699,7 @@
gpu::gpustd::array<float, 2> dcaInfo;
o2::track::TrackParCov trackParCasc;
o2::track::TrackParCov trackParCascTrack;
if (requireStrangenessTrackingAny < 2) { // needed for at least one of the two

Check warning on line 1702 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
14 changes: 7 additions & 7 deletions EventFiltering/PWGHF/HFFilterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ namespace hf_trigger_cuts_presel_beauty
{
static constexpr int nBinsPt = 2;
static constexpr int nCutVars = 4;
static constexpr int nCutVarsBtoJPsi = 4;
static constexpr int nCutVarsBtoJPsi = 6;
// default values for the pT bin edges (can be used to configure histogram axis)
// common for any beauty candidate
constexpr double binsPt[nBinsPt + 1] = {
Expand All @@ -332,14 +332,14 @@ auto vecBinsPt = std::vector<double>{binsPt, binsPt + nBinsPt + 1};
constexpr double cuts[nBinsPt][nCutVars] = {{0.4, -1, -1, 10.}, /* 0 < pt < 5 */
{0.4, -1, -1, 10.}}; /* 5 < pt < 1000 */

constexpr double cutsBtoJPsi[nBinsPt][nCutVarsBtoJPsi] = {{1., 0.6, 0.9, 0.02}, /* 0 < pt < 5 */
{1., 0.8, 0.9, 0.02}}; /* 5 < pt < 1000 */
constexpr double cutsBtoJPsi[nBinsPt][nCutVarsBtoJPsi] = {{1., 0.6, 0.9, 0.02, 0.02, 0.1}, /* 0 < pt < 5 */
{1., 0.8, 0.9, 0.02, 0.02, 0.1}}; /* 5 < pt < 1000 */

// row labels
static const std::vector<std::string> labelsPt{};
// column labels
static const std::vector<std::string> labelsColumnsTopolBeauty = {"DeltaMassB", "minCPA", "minDecayLength", "maxImpParProd"};
static const std::vector<std::string> labelsColumnsCutsBeautyToJPsi = {"minPtMuon", "DeltaMassB", "minCPA", "minDecayLength"};
static const std::vector<std::string> labelsColumnsCutsBeautyToJPsi = {"minPtMuon", "DeltaMassB", "minCPA", "minDecayLength", "DeltaMassKK", "DeltaMassKPi"};

} // namespace hf_trigger_cuts_presel_beauty

Expand Down Expand Up @@ -2154,7 +2154,7 @@ inline int8_t HfFilterHelper::isSelectedBhadronToJPsi(std::array<T1, Nprongs> pV
bool isSecondProton = isSelectedProton4CharmOrBeautyBaryons<true>(tracksDauNoMu[1]);
auto massKaKa = RecoDecay::m(std::array{pVecDauTracks[2], pVecDauTracks[3]}, std::array{massKa, massKa});
if (isFirstKaon && isSeconKaon) {
if (std::fabs(massKaKa - massPhi) < 0.02f) {
if (std::fabs(massKaKa - massPhi) < mCutsBhadToJPsi.get(binPtB, 4u)) {
auto massJPsiKaKa = RecoDecay::m(std::array{pVecJPsi, pVecDauTracks[2], pVecDauTracks[3]}, std::array{massJPsi, massKa, massKa});
if (std::fabs(massJPsiKaKa - massBs) < mCutsBhadToJPsi.get(binPtB, 1u)) {
SETBIT(isSelected, kBsToJPsi);
Expand All @@ -2166,7 +2166,7 @@ inline int8_t HfFilterHelper::isSelectedBhadronToJPsi(std::array<T1, Nprongs> pV
}
if (isFirstKaon) {
auto massKaPi = RecoDecay::m(std::array{pVecDauTracks[2], pVecDauTracks[3]}, std::array{massKa, massPi});
if (std::fabs(massKaPi - massPhi) < 0.1f) {
if (std::fabs(massKaPi - massK0Star892) < mCutsBhadToJPsi.get(binPtB, 5u)) {
auto massJPsiKaPi = RecoDecay::m(std::array{pVecJPsi, pVecDauTracks[2], pVecDauTracks[3]}, std::array{massJPsi, massKa, massPi});
if (std::fabs(massJPsiKaPi - massB0) < mCutsBhadToJPsi.get(binPtB, 1u)) {
SETBIT(isSelected, kB0ToJPsi);
Expand All @@ -2178,7 +2178,7 @@ inline int8_t HfFilterHelper::isSelectedBhadronToJPsi(std::array<T1, Nprongs> pV
}
if (isSeconKaon) {
auto massPiKa = RecoDecay::m(std::array{pVecDauTracks[2], pVecDauTracks[3]}, std::array{massPi, massKa});
if (std::fabs(massPiKa - massPhi) < 0.1f) {
if (std::fabs(massPiKa - massK0Star892) < mCutsBhadToJPsi.get(binPtB, 5u)) {
auto massJPsiPiKa = RecoDecay::m(std::array{pVecJPsi, pVecDauTracks[2], pVecDauTracks[3]}, std::array{massJPsi, massPi, massKa});
if (std::fabs(massJPsiPiKa - massB0) < mCutsBhadToJPsi.get(binPtB, 1u)) {
SETBIT(isSelected, kB0ToJPsi);
Expand Down
Loading