Skip to content

Commit ca22a95

Browse files
author
Christopher Klumm
committed
Suggested improvements
inside ResoSelectionsome uint_32 return types were replaced by integer types. A suggested usecase for std::hypot was implemented. A check for iteratortype inside femtoDreamContainer.h was improved.
1 parent 3e05f1f commit ca22a95

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

PWGCF/FemtoDream/Core/femtoDreamContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class FemtoDreamContainer
270270
}
271271
if (extendedplots) {
272272
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmTPtPart1PtPart2MultPercentile"), femtoObs, mT, part1.pt(), part2.pt(), multPercentile);
273-
if constexpr (std::is_same_v<T1, o2::aod::FDParticle> && std::is_same_v<T2, o2::aod::FDParticle>) {
273+
if constexpr (requires { part1.mLambda(); part2.mLambda(); }) {
274274
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/invMassPart1invMassPart2kstar"), part1.mLambda(), part2.mLambda(), femtoObs);
275275
}
276276
}

PWGCF/FemtoDream/Core/femtoDreamResoSelection.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class FemtoDreamResoSelection
6565
virtual ~FemtoDreamResoSelection() = default;
6666

6767
template <typename V>
68-
uint32_t getType(V const& track1, V const& track2, bool resoIsNotAnti);
68+
int getType(V const& track1, V const& track2, bool resoIsNotAnti);
6969

7070
/// assigns value from configurbale to private class member
7171
template <typename V>
@@ -218,7 +218,7 @@ class FemtoDreamResoSelection
218218
}; // namespace femtoDream
219219

220220
template <typename V>
221-
uint32_t FemtoDreamResoSelection::getType(V const& track1, V const& track2, bool resoIsNotAnti)
221+
int FemtoDreamResoSelection::getType(V const& track1, V const& track2, bool resoIsNotAnti)
222222
{
223223
float posThresh = 0.;
224224
float negThresh = 0.;
@@ -403,13 +403,9 @@ float FemtoDreamResoSelection::getNSigTotal(T const& track, V const& pid, float
403403
return std::abs(nSigTPC);
404404
}
405405

406-
float nSigTOF = 0.;
407-
if (!track.hasTOF()) {
408-
nSigTOF = 999.f;
409-
} else {
410-
nSigTOF = o2::aod::pidutils::tofNSigma(pid, track);
411-
}
412-
return std::sqrt(nSigTPC * nSigTPC + nSigTOF * nSigTOF);
406+
float nSigTOF = track.hasTOF() ? o2::aod::pidutils::tofNSigma(pid, track) : 999.f;
407+
408+
return std::hypot(nSigTPC, nSigTOF);
413409
}
414410

415411
//// new getCutContainer

0 commit comments

Comments
 (0)