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
8 changes: 0 additions & 8 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 @@ -157,7 +157,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 160 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 @@ -310,7 +310,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 313 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 @@ -441,7 +441,7 @@
for (const auto& collision : collisions) {

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

Check failure on line 444 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 @@ -520,7 +520,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 523 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 @@ -636,7 +636,6 @@
}
} else {
df2.process(trackParPos, trackParNeg);
df2.propagateTracksToVertex();
std::array<float, 3> pVecPosVtx{}, pVecNegVtx{};
df2.getTrack(0).getPxPyPzGlo(pVecPosVtx);
df2.getTrack(1).getPxPyPzGlo(pVecNegVtx);
Expand All @@ -647,7 +646,6 @@
if (activateQA) {
registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex, kBplus);
}
dfB.propagateTracksToVertex();
const auto& secondaryVertexBtoD0h = dfB.getPCACandidate();
std::array<float, 3> pVecThirdVtx{};
dfB.getTrack(0).getPxPyPzGlo(pVec2ProngVtx);
Expand Down Expand Up @@ -733,7 +731,6 @@
}
} else {
df2.process(trackParPos, trackParNeg);
df2.propagateTracksToVertex();
std::array<float, 3> pVecPosVtx{}, pVecNegVtx{};
df2.getTrack(0).getPxPyPzGlo(pVecPosVtx);
df2.getTrack(1).getPxPyPzGlo(pVecNegVtx);
Expand All @@ -744,7 +741,6 @@
if (activateQA) {
registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex, kB0toDStar);
}
dfBtoDstar.propagateTracksToVertex();
const auto& secondaryVertexBzero = dfBtoDstar.getPCACandidate();
std::array<float, 3> pVecThirdVtx{}, pVecFourthVtx{};
dfBtoDstar.getTrack(0).getPxPyPzGlo(pVec2ProngVtx);
Expand Down Expand Up @@ -799,7 +795,6 @@
// 3-prong vertices
if (!keepEvent[kBtoJPsiKa] || !keepEvent[kBtoJPsiPi]) {
if (df3.process(trackParPos, trackParNeg, trackParThird) != 0) {
df3.propagateTracksToVertex();
const auto& secondaryVertexBto3tracks = df3.getPCACandidate();
df3.getTrack(0).getPxPyPzGlo(pVecPosVtx);
df3.getTrack(1).getPxPyPzGlo(pVecNegVtx);
Expand Down Expand Up @@ -834,7 +829,6 @@
continue;
}
if (df4.process(trackParPos, trackParNeg, trackParThird, trackParFourth) != 0) {
df4.propagateTracksToVertex();
const auto& secondaryVertexBto4tracks = df4.getPCACandidate();
df4.getTrack(0).getPxPyPzGlo(pVecPosVtx);
df4.getTrack(1).getPxPyPzGlo(pVecNegVtx);
Expand Down Expand Up @@ -1239,7 +1233,7 @@
continue;
}

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

Check failure on line 1236 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 @@ -1363,7 +1357,6 @@
}
} else {
df3.process(trackParFirst, trackParSecond, trackParThird);
df3.propagateTracksToVertex();
std::array<float, 3> pVecFirstVtx{}, pVecSecondVtx{}, pVecThirdVtx{};
df3.getTrack(0).getPxPyPzGlo(pVecFirstVtx);
df3.getTrack(1).getPxPyPzGlo(pVecSecondVtx);
Expand All @@ -1375,7 +1368,6 @@
if (activateQA) {
registry.fill(HIST("fHfVtxStages"), 1 + HfVtxStage::BeautyVertex, iHypo + 3);
}
dfB.propagateTracksToVertex();
const auto& secondaryVertexB = dfB.getPCACandidate();
std::array<float, 3> pVecFourtVtx{};
dfB.getTrack(0).getPxPyPzGlo(pVec3ProngVtx);
Expand Down Expand Up @@ -1466,7 +1458,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 failure on line 1461 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 @@ -1788,7 +1780,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 1783 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
4 changes: 0 additions & 4 deletions EventFiltering/PWGHF/HFFilterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,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 + 23> 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}};

Check failure on line 296 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 @@ -859,7 +859,7 @@
return kRejected;
}

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

Check failure on line 862 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 @@ -2377,7 +2377,6 @@
}

const auto& vtx = dcaFitter.getPCACandidate();
dcaFitter.propagateTracksToVertex();
const auto& trackCascProp = dcaFitter.getTrack(0);
const auto& trackBachProp = dcaFitter.getTrack(1);
std::array<float, 3> momCasc{}, momBach{};
Expand Down Expand Up @@ -2456,7 +2455,6 @@
const auto& vtx = dcaFitter.getPCACandidate();

std::array<float, 3> momCasc{pVecCascade}, momBachFirst{}, momBachSecond{};
dcaFitter.propagateTracksToVertex();
const auto& trackBachFirstProp = dcaFitter.getTrack(0);
const auto& trackBachSecondProp = dcaFitter.getTrack(1);
trackBachFirstProp.getPxPyPzGlo(momBachFirst);
Expand Down Expand Up @@ -2681,7 +2679,6 @@
}

// compute candidate momentum from tracks propagated to decay vertex
dcaFitter.propagateTracksToVertex();
auto& trackPosProp = dcaFitter.getTrack(0);
auto& trackNegProp = dcaFitter.getTrack(1);
std::array<float, 3> momPos{}, momNeg{};
Expand Down Expand Up @@ -2813,7 +2810,6 @@
}

// compute candidate momentum from tracks propagated to decay vertex
dcaFitter.propagateTracksToVertex();
auto& trackV0Prop = dcaFitter.getTrack(0);
auto& trackBachProp = dcaFitter.getTrack(1);
std::array<float, 3> momV0{}, momBach{};
Expand Down
Loading