Skip to content

Commit 013e849

Browse files
committed
Fix: hotfixes
1 parent 3d105fd commit 013e849

File tree

4 files changed

+46
-35
lines changed

4 files changed

+46
-35
lines changed

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class CascadeSelection : public BaseSelection<float, o2::aod::femtodatatypes::Ca
271271
};
272272

273273
template <typename T>
274-
bool checkCandidate(const T& cascade) const
274+
bool checkFilters(const T& cascade) const
275275
{
276276
// check kinematics
277277
const bool kinematicsOK =
@@ -390,24 +390,25 @@ class CascadeBuilder
390390
int64_t posDaughterIndex = 0;
391391
int64_t negDaughterIndex = 0;
392392
for (const auto& cascade : fullCascades) {
393-
if (!mCascadeSelection.checkCandidate(cascade)) {
393+
if (!mCascadeSelection.checkFilters(cascade)) {
394394
continue;
395395
}
396396
mCascadeSelection.applySelections(cascade, fullTracks, col);
397-
if (mCascadeSelection.passesAllRequiredSelections()) {
397+
if (!mCascadeSelection.passesAllRequiredSelections()) {
398+
continue;
399+
}
398400

399-
auto bachelor = cascade.template bachelor_as<T7>();
400-
auto posDaughter = cascade.template posTrack_as<T7>();
401-
auto negDaughter = cascade.template negTrack_as<T7>();
401+
auto bachelor = cascade.template bachelor_as<T7>();
402+
auto posDaughter = cascade.template posTrack_as<T7>();
403+
auto negDaughter = cascade.template negTrack_as<T7>();
402404

403-
collisionBuilder.template fillCollision<system>(collisionProducts, col);
405+
collisionBuilder.template fillCollision<system>(collisionProducts, col);
404406

405-
bachelorIndex = trackBuilder.template getDaughterIndex<modes::Track::kCascadeBachelor>(bachelor, trackProducts, collisionProducts, indexMap);
406-
posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
407-
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);
407+
bachelorIndex = trackBuilder.template getDaughterIndex<modes::Track::kCascadeBachelor>(bachelor, trackProducts, collisionProducts, indexMap);
408+
posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
409+
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);
408410

409-
fillCascade(collisionProducts, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
410-
}
411+
fillCascade(collisionProducts, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
411412
}
412413
}
413414

PWGCF/Femto/Core/closePairRejection.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ class CloseTrackRejection
222222
}
223223
}
224224
// for small momemeta the calculation of phistar might fail, if the particle did not reach a certain radius
225-
mAverageDphistar = std::accumulate(mDphistar.begin(), mDphistar.end(), 0.f) / count; // only average values if phistar could be computed
225+
if (count > 0) {
226+
mAverageDphistar = std::accumulate(mDphistar.begin(), mDphistar.end(), 0.f) / count; // only average values if phistar could be computed
227+
} else {
228+
mAverageDphistar = 0.f; // if computation at all radii fail, set it 0
229+
}
226230
}
227231

228232
void fill(float kstar)

PWGCF/Femto/Core/twoTrackResonanceBuilder.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class TwoTrackResonanceSelection : public BaseSelection<float, o2::aod::femtodat
320320
mPhi = RecoDecay::constrainAngle(vecResonance.Phi());
321321
}
322322

323-
bool checkCandidate() const
323+
bool checkFilters() const
324324
{
325325
return ((mMass > mMassMin && mMass < mMassMax) &&
326326
(mPt > mPtMin && mPt < mPtMax) &&
@@ -526,10 +526,15 @@ class TwoTrackResonanceBuilder
526526
{
527527

528528
mTwoTrackResonanceSelection.reconstructResonance(posDaughter, negDaughter);
529-
if (!mTwoTrackResonanceSelection.checkCandidate()) {
529+
if (!mTwoTrackResonanceSelection.checkFilters()) {
530530
return;
531531
}
532532
mTwoTrackResonanceSelection.applySelections(posDaughter, negDaughter); // for resonances selection are only applied to daughter tracks
533+
534+
if (!mTwoTrackResonanceSelection.passesAllRequiredSelections()) {
535+
return;
536+
}
537+
533538
int64_t posDaughterIndex = 0;
534539
int64_t negDaughterIndex = 0;
535540

PWGCF/Femto/Core/v0Builder.h

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class V0Selection : public BaseSelection<float, o2::aod::femtodatatypes::V0MaskT
268268
}
269269

270270
template <typename T>
271-
bool checkCandidate(const T& v0) const
271+
bool checkFilters(const T& v0) const
272272
{
273273
// check kinematics first
274274
const bool kinematicsOK =
@@ -380,28 +380,29 @@ class V0Builder
380380
int64_t posDaughterIndex = 0;
381381
int64_t negDaughterIndex = 0;
382382
for (const auto& v0 : v0s) {
383-
if (!mV0Selection.checkCandidate(v0)) {
383+
if (!mV0Selection.checkFilters(v0)) {
384384
continue;
385385
}
386386
mV0Selection.applySelections(v0, tracks);
387-
if (mV0Selection.passesAllRequiredSelections()) {
388-
auto posDaughter = v0.template posTrack_as<T7>();
389-
auto negDaughter = v0.template negTrack_as<T7>();
390-
391-
collisionBuilder.template fillCollision<system>(collisionProducts, col);
392-
393-
posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
394-
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);
395-
396-
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda)) {
397-
fillLambda(collisionProducts, v0products, v0, 1.f, posDaughterIndex, negDaughterIndex);
398-
}
399-
if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
400-
fillLambda(collisionProducts, v0products, v0, -1.f, posDaughterIndex, negDaughterIndex);
401-
}
402-
if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) {
403-
fillK0short(collisionProducts, v0products, v0, posDaughterIndex, negDaughterIndex);
404-
}
387+
if (!mV0Selection.passesAllRequiredSelections()) {
388+
continue;
389+
}
390+
auto posDaughter = v0.template posTrack_as<T7>();
391+
auto negDaughter = v0.template negTrack_as<T7>();
392+
393+
collisionBuilder.template fillCollision<system>(collisionProducts, col);
394+
395+
posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
396+
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);
397+
398+
if constexpr (modes::isEqual(v0Type, modes::V0::kLambda)) {
399+
fillLambda(collisionProducts, v0products, v0, 1.f, posDaughterIndex, negDaughterIndex);
400+
}
401+
if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
402+
fillLambda(collisionProducts, v0products, v0, -1.f, posDaughterIndex, negDaughterIndex);
403+
}
404+
if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) {
405+
fillK0short(collisionProducts, v0products, v0, posDaughterIndex, negDaughterIndex);
405406
}
406407
}
407408
}

0 commit comments

Comments
 (0)