Skip to content

Commit 4214a1e

Browse files
Fix comments from Vit in taskCd.cxx
1 parent 8034074 commit 4214a1e

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

PWGHF/D2H/Tasks/taskCd.cxx

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct HfTaskCd {
112112
if ((std::accumulate(doprocess.begin(), doprocess.end(), 0)) != 1) {
113113
LOGP(fatal, "no or more than one process function enabled! Please check your configuration!");
114114
}
115-
auto vbins = (std::vector<double>)binsPt;
115+
auto vbins = binsPt;
116116
/// mass candidate
117117
registry.add("Data/hMassVsPtVsNPvContributors", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}; Number of PV contributors", {HistType::kTH3F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}, {5000, 0., 10000.}}});
118118
registry.add("Data/hMassVsPt", "3-prong candidates;inv. mass (de K #pi) (GeV/#it{c}^{2}); p_{T}", {HistType::kTH2F, {{600, 1.98, 2.58}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}});
@@ -152,22 +152,11 @@ struct HfTaskCd {
152152
const AxisSpec thnAxisCPA{thnConfigAxisCPA, "cosine of pointing angle"};
153153
const AxisSpec thnAxisCentrality{thnConfigAxisCentrality, "centrality (FT0C)"};
154154

155-
std::vector<AxisSpec> axesStd;
156-
axesStd = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCentrality};
157-
155+
auto axesStd = std::vector{thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisCentrality};
158156
registry.add("hnCdVars", "THn for Reconstructed Cd candidates for data", HistType::kTHnSparseF, axesStd);
159157
}
160158
}
161159

162-
/// Evaluate centrality/multiplicity percentile (centrality estimator is automatically selected based on the used table)
163-
/// \param candidate is candidate
164-
/// \return centrality/multiplicity percentile of the collision
165-
template <typename Coll>
166-
float evaluateCentralityColl(const Coll& collision)
167-
{
168-
return o2::hf_centrality::getCentralityColl<Coll>(collision);
169-
}
170-
171160
/// Fill histograms for real data
172161
template <typename CollType, typename CandType>
173162
void fillHistosData(CollType const& collision, CandType const& candidates)
@@ -177,19 +166,19 @@ struct HfTaskCd {
177166
auto numPvContributors = collision.numContrib();
178167

179168
for (const auto& candidate : groupedCdCandidates) {
180-
if (!(candidate.hfflag() & 1 << aod::hf_cand_3prong::DecayType::CdToDeKPi)) {
169+
if (!TESTBIT(candidate.hfflag(), aod::hf_cand_3prong::DecayType::CdToDeKPi)) {
181170
continue;
182171
}
183172

184-
auto pt = candidate.pt();
185-
auto ptProng0 = candidate.ptProng0();
186-
auto ptProng1 = candidate.ptProng1();
187-
auto ptProng2 = candidate.ptProng2();
188-
auto decayLength = candidate.decayLength();
189-
auto decayLengthXY = candidate.decayLengthXY();
190-
auto chi2PCA = candidate.chi2PCA();
191-
auto cpa = candidate.cpa();
192-
auto cpaXY = candidate.cpaXY();
173+
const auto pt = candidate.pt();
174+
const auto ptProng0 = candidate.ptProng0();
175+
const auto ptProng1 = candidate.ptProng1();
176+
const auto ptProng2 = candidate.ptProng2();
177+
const auto decayLength = candidate.decayLength();
178+
const auto decayLengthXY = candidate.decayLengthXY();
179+
const auto chi2PCA = candidate.chi2PCA();
180+
const auto cpa = candidate.cpa();
181+
const auto cpaXY = candidate.cpaXY();
193182

194183
if (candidate.isSelCdToDeKPi() >= selectionFlagCd) {
195184
registry.fill(HIST("Data/hMass"), hfHelper.invMassCdToDeKPi(candidate));
@@ -232,7 +221,7 @@ struct HfTaskCd {
232221
registry.fill(HIST("Data/hImpParErrProng2"), candidate.errorImpactParameter2(), pt);
233222

234223
if (fillTHn) {
235-
float const cent = evaluateCentralityColl(collision);
224+
float const cent = o2::hf_centrality::getCentralityColl<CollType>(collision);
236225
double massCd(-1);
237226
if (candidate.isSelCdToDeKPi() >= selectionFlagCd) {
238227
massCd = hfHelper.invMassCdToDeKPi(candidate);

0 commit comments

Comments
 (0)