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
25 changes: 13 additions & 12 deletions PWGCF/Femto/Core/cascadeBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class CascadeSelection : public BaseSelection<float, o2::aod::femtodatatypes::Ca
};

template <typename T>
bool checkCandidate(const T& cascade) const
bool checkFilters(const T& cascade) const
{
// check kinematics
const bool kinematicsOK =
Expand Down Expand Up @@ -390,24 +390,25 @@ class CascadeBuilder
int64_t posDaughterIndex = 0;
int64_t negDaughterIndex = 0;
for (const auto& cascade : fullCascades) {
if (!mCascadeSelection.checkCandidate(cascade)) {
if (!mCascadeSelection.checkFilters(cascade)) {
continue;
}
mCascadeSelection.applySelections(cascade, fullTracks, col);
if (mCascadeSelection.passesAllRequiredSelections()) {
if (!mCascadeSelection.passesAllRequiredSelections()) {
continue;
}

auto bachelor = cascade.template bachelor_as<T7>();
auto posDaughter = cascade.template posTrack_as<T7>();
auto negDaughter = cascade.template negTrack_as<T7>();
auto bachelor = cascade.template bachelor_as<T7>();
auto posDaughter = cascade.template posTrack_as<T7>();
auto negDaughter = cascade.template negTrack_as<T7>();

collisionBuilder.template fillCollision<system>(collisionProducts, col);
collisionBuilder.template fillCollision<system>(collisionProducts, col);

bachelorIndex = trackBuilder.template getDaughterIndex<modes::Track::kCascadeBachelor>(bachelor, trackProducts, collisionProducts, indexMap);
posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);
bachelorIndex = trackBuilder.template getDaughterIndex<modes::Track::kCascadeBachelor>(bachelor, trackProducts, collisionProducts, indexMap);
posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);

fillCascade(collisionProducts, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
}
fillCascade(collisionProducts, cascadeProducts, cascade, col, bachelorIndex, posDaughterIndex, negDaughterIndex);
}
}

Expand Down
6 changes: 5 additions & 1 deletion PWGCF/Femto/Core/closePairRejection.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ class CloseTrackRejection
}
}
// for small momemeta the calculation of phistar might fail, if the particle did not reach a certain radius
mAverageDphistar = std::accumulate(mDphistar.begin(), mDphistar.end(), 0.f) / count; // only average values if phistar could be computed
if (count > 0) {
mAverageDphistar = std::accumulate(mDphistar.begin(), mDphistar.end(), 0.f) / count; // only average values if phistar could be computed
} else {
mAverageDphistar = 0.f; // if computation at all radii fail, set it 0
}
}

void fill(float kstar)
Expand Down
9 changes: 7 additions & 2 deletions PWGCF/Femto/Core/twoTrackResonanceBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class TwoTrackResonanceSelection : public BaseSelection<float, o2::aod::femtodat
mPhi = RecoDecay::constrainAngle(vecResonance.Phi());
}

bool checkCandidate() const
bool checkFilters() const
{
return ((mMass > mMassMin && mMass < mMassMax) &&
(mPt > mPtMin && mPt < mPtMax) &&
Expand Down Expand Up @@ -526,10 +526,15 @@ class TwoTrackResonanceBuilder
{

mTwoTrackResonanceSelection.reconstructResonance(posDaughter, negDaughter);
if (!mTwoTrackResonanceSelection.checkCandidate()) {
if (!mTwoTrackResonanceSelection.checkFilters()) {
return;
}
mTwoTrackResonanceSelection.applySelections(posDaughter, negDaughter); // for resonances selection are only applied to daughter tracks

if (!mTwoTrackResonanceSelection.passesAllRequiredSelections()) {
return;
}

int64_t posDaughterIndex = 0;
int64_t negDaughterIndex = 0;

Expand Down
41 changes: 21 additions & 20 deletions PWGCF/Femto/Core/v0Builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class V0Selection : public BaseSelection<float, o2::aod::femtodatatypes::V0MaskT
}

template <typename T>
bool checkCandidate(const T& v0) const
bool checkFilters(const T& v0) const
{
// check kinematics first
const bool kinematicsOK =
Expand Down Expand Up @@ -380,28 +380,29 @@ class V0Builder
int64_t posDaughterIndex = 0;
int64_t negDaughterIndex = 0;
for (const auto& v0 : v0s) {
if (!mV0Selection.checkCandidate(v0)) {
if (!mV0Selection.checkFilters(v0)) {
continue;
}
mV0Selection.applySelections(v0, tracks);
if (mV0Selection.passesAllRequiredSelections()) {
auto posDaughter = v0.template posTrack_as<T7>();
auto negDaughter = v0.template negTrack_as<T7>();

collisionBuilder.template fillCollision<system>(collisionProducts, col);

posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);

if constexpr (modes::isEqual(v0Type, modes::V0::kLambda)) {
fillLambda(collisionProducts, v0products, v0, 1.f, posDaughterIndex, negDaughterIndex);
}
if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
fillLambda(collisionProducts, v0products, v0, -1.f, posDaughterIndex, negDaughterIndex);
}
if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) {
fillK0short(collisionProducts, v0products, v0, posDaughterIndex, negDaughterIndex);
}
if (!mV0Selection.passesAllRequiredSelections()) {
continue;
}
auto posDaughter = v0.template posTrack_as<T7>();
auto negDaughter = v0.template negTrack_as<T7>();

collisionBuilder.template fillCollision<system>(collisionProducts, col);

posDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(posDaughter, trackProducts, collisionProducts, indexMap);
negDaughterIndex = trackBuilder.template getDaughterIndex<modes::Track::kV0Daughter>(negDaughter, trackProducts, collisionProducts, indexMap);

if constexpr (modes::isEqual(v0Type, modes::V0::kLambda)) {
fillLambda(collisionProducts, v0products, v0, 1.f, posDaughterIndex, negDaughterIndex);
}
if constexpr (modes::isEqual(v0Type, modes::V0::kAntiLambda)) {
fillLambda(collisionProducts, v0products, v0, -1.f, posDaughterIndex, negDaughterIndex);
}
if constexpr (modes::isEqual(v0Type, modes::V0::kK0short)) {
fillK0short(collisionProducts, v0products, v0, posDaughterIndex, negDaughterIndex);
}
}
}
Expand Down
Loading