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: 7 additions & 7 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 @@ -308,7 +308,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 311 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 @@ -439,7 +439,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 442 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 @@ -518,7 +518,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 521 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 @@ -994,14 +994,14 @@
if (isGoodXicStar) {
if (isRightSignXicStar) {
hMassVsPtC[kNCharmParticles + 7]->Fill(ptCand, massDiffXicStarCand);
} else if (!isRightSignXicStar && keepAlsoWrongDmesLambdaPairs) {
} else if (keepAlsoWrongDmesLambdaPairs) {
hMassVsPtC[kNCharmParticles + 8]->Fill(ptCand, massDiffXicStarBarCand);
}
}
if (isGoodXicStarBar) {
if (isRightSignXicStarBar) {
hMassVsPtC[kNCharmParticles + 7]->Fill(ptCand, massDiffXicStarCand);
} else if (!isRightSignXicStarBar && keepAlsoWrongDmesLambdaPairs) {
} else if (keepAlsoWrongDmesLambdaPairs) {
hMassVsPtC[kNCharmParticles + 8]->Fill(ptCand, massDiffXicStarBarCand);
}
}
Expand Down Expand Up @@ -1093,14 +1093,14 @@
if (isGoodThetac) {
if (isRightSignThetaC) {
hMassVsPtC[kNCharmParticles + 21]->Fill(ptCand, massDiffThetacCand);
} else if (!isRightSignThetaC && keepAlsoWrongDmesProtonPairs) {
} else if (keepAlsoWrongDmesProtonPairs) {
hMassVsPtC[kNCharmParticles + 22]->Fill(ptCand, massDiffThetacBarCand);
}
}
if (isGoodThetacBar) {
if (isRightSignThetaCBar) {
hMassVsPtC[kNCharmParticles + 21]->Fill(ptCand, massDiffThetacCand);
} else if (!isRightSignThetaCBar && keepAlsoWrongDmesProtonPairs) {
} else if (keepAlsoWrongDmesProtonPairs) {
hMassVsPtC[kNCharmParticles + 22]->Fill(ptCand, massDiffThetacBarCand);
}
}
Expand Down Expand Up @@ -1144,14 +1144,14 @@
if (isGoodLcStar) {
if (isRightSignLcStar) {
hMassVsPtC[kNCharmParticles + 19]->Fill(ptCand, massDiffLcStarCand);
} else if (!isRightSignLcStar && keepAlsoWrongDmesProtonPairs) {
} else if (keepAlsoWrongDmesProtonPairs) {
hMassVsPtC[kNCharmParticles + 20]->Fill(ptCand, massDiffLcStarBarCand);
}
}
if (isGoodLcStarBar) {
if (isRightSignLcStarBar) {
hMassVsPtC[kNCharmParticles + 19]->Fill(ptCand, massDiffLcStarCand);
} else if (!isRightSignLcStarBar && keepAlsoWrongDmesProtonPairs) {
} else if (keepAlsoWrongDmesProtonPairs) {
hMassVsPtC[kNCharmParticles + 20]->Fill(ptCand, massDiffLcStarBarCand);
}
}
Expand Down Expand Up @@ -1237,7 +1237,7 @@
continue;
}

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

Check failure on line 1240 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 @@ -1464,7 +1464,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 1467 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 @@ -1640,7 +1640,7 @@
if (activateQA) {
if (isRightSign) {
hMassVsPtC[kNCharmParticles + 5]->Fill(ptCand, massDiffXicStar);
} else if (!isRightSign && keepAlsoWrongDmesLambdaPairs) {
} else if (keepAlsoWrongDmesLambdaPairs) {
hMassVsPtC[kNCharmParticles + 6]->Fill(ptCand, massDiffXicStar);
}
}
Expand Down Expand Up @@ -1786,7 +1786,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 1789 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
32 changes: 16 additions & 16 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 @@ -415,15 +415,15 @@
mForceTofProtonForFemto = forceTofProtons;
mForceTofDeuteronForFemto = forceTofDeuterons;
}
void setPtBinsSingleTracks(std::vector<double> ptBins) { mPtBinsTracks = ptBins; }
void setPtBinsBeautyHadrons(std::vector<double> ptBins) { mPtBinsBeautyHadrons = ptBins; }
void setCutsSingleTrackBeauty(o2::framework::LabeledArray<double> cutsSingleTrack3P, o2::framework::LabeledArray<double> cutsSingleTrack4P, o2::framework::LabeledArray<double> cutsSingleToJPsi)
void setPtBinsSingleTracks(const std::vector<double>& ptBins) { mPtBinsTracks = ptBins; }
void setPtBinsBeautyHadrons(const std::vector<double>& ptBins) { mPtBinsBeautyHadrons = ptBins; }
void setCutsSingleTrackBeauty(const o2::framework::LabeledArray<double>& cutsSingleTrack3P, const o2::framework::LabeledArray<double>& cutsSingleTrack4P, const o2::framework::LabeledArray<double>& cutsSingleToJPsi)
{
mCutsSingleTrackBeauty3Prong = cutsSingleTrack3P;
mCutsSingleTrackBeauty4Prong = cutsSingleTrack4P;
mCutsSingleTrackBeautyToJPsi = cutsSingleToJPsi;
}
void setCutsBhadrons(o2::framework::LabeledArray<double> cutsBplus, o2::framework::LabeledArray<double> cutsB0toDstar, o2::framework::LabeledArray<double> cutsBc, o2::framework::LabeledArray<double> cutsB0, o2::framework::LabeledArray<double> cutsBs, o2::framework::LabeledArray<double> cutsLb, o2::framework::LabeledArray<double> cutsXib)
void setCutsBhadrons(const o2::framework::LabeledArray<double>& cutsBplus, const o2::framework::LabeledArray<double>& cutsB0toDstar, const o2::framework::LabeledArray<double>& cutsBc, const o2::framework::LabeledArray<double>& cutsB0, const o2::framework::LabeledArray<double>& cutsBs, const o2::framework::LabeledArray<double>& cutsLb, const o2::framework::LabeledArray<double>& cutsXib)
{
mCutsBhad[kBplus] = cutsBplus;
mCutsBhad[kB0toDStar] = cutsB0toDstar;
Expand All @@ -433,7 +433,7 @@
mCutsBhad[kLb] = cutsLb;
mCutsBhad[kXib] = cutsXib;
}
void setCutsBtoJPsi(o2::framework::LabeledArray<double> cuts)
void setCutsBtoJPsi(const o2::framework::LabeledArray<double>& cuts)
{
mCutsBhadToJPsi = cuts;
}
Expand Down Expand Up @@ -554,7 +554,7 @@
mMaxDcaXyXi = maxDcaxyXi;
mMaxNsigmaXiDau = nSigma;
}
void setCutsSingleTrackCharmBaryonBachelor(o2::framework::LabeledArray<double> cutsSingleTrack) { mCutsSingleTrackCharmBaryonBachelor = cutsSingleTrack; }
void setCutsSingleTrackCharmBaryonBachelor(const o2::framework::LabeledArray<double>& cutsSingleTrack) { mCutsSingleTrackCharmBaryonBachelor = cutsSingleTrack; }
void setNsigmaPiCutsForCharmBaryonBachelor(float nSigmaTpc, float nSigmaTof)
{
mNSigmaTpcPiCharmBaryonBachelor = nSigmaTpc;
Expand Down Expand Up @@ -583,7 +583,7 @@

void setTpcPidCalibrationOption(int opt) { mTpcPidCalibrationOption = opt; }

void setMassResolParametrisation(std::string recoPass)
void setMassResolParametrisation(const std::string& recoPass)
{
if (recoPass == "2023_pass3") {
mSigmaPars2Prongs[0] = 0.01424f;
Expand All @@ -610,7 +610,7 @@

void setNumSigmaForDeltaMassCharmHadCut(float nSigma) { mNumSigmaDeltaMassCharmHad = nSigma; }

void setPreselDsToKKPi(std::vector<double> ptBins, o2::framework::LabeledArray<double> preselections)
void setPreselDsToKKPi(const std::vector<double>& ptBins, const o2::framework::LabeledArray<double>& preselections)
{
mPtBinsPreselDsToKKPi = ptBins;
mPreselDsToKKPi = preselections;
Expand Down Expand Up @@ -679,7 +679,7 @@
template <typename T>
T computeRelativeMomentum(const std::array<T, 3>& pTrack, const std::array<T, 3>& CharmCandMomentum, const T& CharmMass);
template <typename T>
int computeNumberOfCandidates(std::vector<std::vector<T>> indices);
int computeNumberOfCandidates(const std::vector<std::vector<T>>& indices);
template <typename T1>
int setVtxConfiguration(T1& vertexer, bool useAbsDCA);
template <typename V, typename T, typename C>
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 @@ -1504,14 +1504,14 @@
float nSigmaPrTpc[2] = {v0.nSigmaPrTpcPos, v0.nSigmaPrTpcNeg};
float nSigmaPrTof[2] = {v0.nSigmaPrTofPos, v0.nSigmaPrTofNeg};
float pInTpc[2] = {v0.pinTpcPos, v0.pinTpcNeg};
float nClsTpc[2] = {v0.nClsFoundTpcPos, v0.nClsFoundTpcNeg};
float etaDaus[2] = {v0.etaPos, v0.etaNeg};
float signalTpc[2] = {v0.signalTpcPos, v0.signalTpcNeg};
if (mTpcPidCalibrationOption == 1) {
float nClsTpc[2] = {v0.nClsFoundTpcPos, v0.nClsFoundTpcNeg};
float etaDaus[2] = {v0.etaPos, v0.etaNeg};
for (int iDau{0}; iDau < 2; ++iDau) {
nSigmaPrTpc[iDau] = getTPCPostCalib(pInTpc[iDau], nClsTpc[iDau], etaDaus[iDau], nSigmaPrTpc[iDau], kPr);
}
} else if (mTpcPidCalibrationOption == 2) {
float signalTpc[2] = {v0.signalTpcPos, v0.signalTpcNeg};
for (int iDau{0}; iDau < 2; ++iDau) {
nSigmaPrTpc[iDau] = getTPCSplineCalib(pInTpc[iDau], signalTpc[iDau], (iDau == 0) ? kPr : kAntiPr);
}
Expand Down Expand Up @@ -1664,9 +1664,8 @@
float nClsTpc[3] = {casc.nClsFoundTpcBach, casc.v0.nClsFoundTpcPos, casc.v0.nClsFoundTpcNeg};
float nCrossedRowsTpc[3] = {casc.nClsCrossedRowsTpcBach, casc.v0.nClsCrossedRowsTpcPos, casc.v0.nClsCrossedRowsTpcNeg};
float crossedRowsOverFindableClsTpc[3] = {casc.crossedRowsOverFindableClsTpcBach, casc.v0.crossedRowsOverFindableClsTpcPos, casc.v0.crossedRowsOverFindableClsTpcNeg};
float etaDaus[3] = {casc.etaBach, casc.v0.etaPos, casc.v0.etaNeg};
float signalTpc[3] = {casc.signalTpcBach, casc.v0.signalTpcPos, casc.v0.signalTpcNeg};
if (mTpcPidCalibrationOption == 1) {
float etaDaus[3] = {casc.etaBach, casc.v0.etaPos, casc.v0.etaNeg};
for (int iDau{0}; iDau < 3; ++iDau) {
nSigmaPiTpc[iDau] = getTPCPostCalib(pInTpc[iDau], nClsTpc[iDau], etaDaus[iDau], nSigmaPrTpc[iDau], kPi);
if (iDau == 0) {
Expand All @@ -1675,12 +1674,13 @@
nSigmaPrTpc[iDau] = getTPCPostCalib(pInTpc[iDau], nClsTpc[iDau], etaDaus[iDau], nSigmaPrTpc[iDau], kPr);
}
} else if (mTpcPidCalibrationOption == 2) {
float signalTpc[3] = {casc.signalTpcBach, casc.v0.signalTpcPos, casc.v0.signalTpcNeg};
for (int iDau{0}; iDau < 3; ++iDau) {
nSigmaPiTpc[iDau] = getTPCSplineCalib(pInTpc[iDau], signalTpc[iDau], (iDau == 0) ? kPi : kAntiPi);
if (iDau == 0) {
continue;
}
nSigmaPrTpc[iDau] = getTPCSplineCalib(pInTpc[iDau], signalTpc[iDau], (iDau == 0) ? kPr : kAntiPr);
nSigmaPrTpc[iDau] = getTPCSplineCalib(pInTpc[iDau], signalTpc[iDau], kAntiPr);
}
}

Expand Down Expand Up @@ -1838,7 +1838,7 @@
/// Computation of the number of candidates in an event that do not share daughter tracks
/// \return 0 or 1 in case of less than 2 independent candidates in a single event, 2 otherwise
template <typename T>
inline int HfFilterHelper::computeNumberOfCandidates(std::vector<std::vector<T>> indices)
inline int HfFilterHelper::computeNumberOfCandidates(const std::vector<std::vector<T>>& indices)
{
if (indices.size() < 2) {
return indices.size();
Expand Down
Loading