Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Faggin committed Feb 26, 2024
1 parent 71f8e91 commit f0c0d2e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
21 changes: 10 additions & 11 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ struct HfFilter { // Main struct for HF triggers

int isTrackSelected = helper.isSelectedTrackForSoftPionOrBeauty(trackBachelor, trackParBachelor, dcaBachelor, -1);
if (TESTBIT(isTrackSelected, kSoftPion) && ((TESTBIT(selD0, 0) && trackBachelor.sign() < 0) || (TESTBIT(selD0, 1) && trackBachelor.sign() > 0))) {
std::array<float, 2> c{massPi, massKa};
std::array<float, 2> massDausD0{massPi, massKa};
auto massD0dau = massD0Cand;
if (trackBachelor.sign() < 0) {
massDausD0[0] = massKa;
Expand Down Expand Up @@ -869,13 +869,13 @@ struct HfFilter { // Main struct for HF triggers
} // end femto selection

// SigmaC++ K- trigger
if(is3Prong[2]>0) { // we need a candidate Lc->pKpi
if (is3Prong[2] > 0) { // we need a candidate Lc->pKpi

std::array<float, 3> massDausLcPKPi{massProton, massKa, massPi};
std::array<float, 3> massDausLcPiKP{massPi, massKa, massProton};
float massLcPKPi = RecoDecay::m(pVec3Prong, massDausLcPKPi);
float massLcPiKP = RecoDecay::m(pVec3Prong, massDausLcPiKP);
if(!helper.isSelectedLcInMassRangeSigmaC(massLcPKPi, massLcPiKP)) {
if (!helper.isSelectedLcInMassRangeSigmaC(massLcPKPi, massLcPiKP)) {
/// Lc outside the allowed mass range
continue;
}
Expand All @@ -886,9 +886,9 @@ struct HfFilter { // Main struct for HF triggers
// soft pion candidates
auto trackSoftPi = trackSoftPiId.track_as<BigTracksPID>();

// check the candidate SigmaC++ charge
// check the candidate SigmaC++ charge
std::array<int, 4> charges = {trackFirst.sign(), trackSecond.sign(), trackThird.sign(), trackSoftPi.sign()};
if( std::abs(std::accumulate(charges.begin(), charges.end(), 0)) != 2) {
if (std::abs(std::accumulate(charges.begin(), charges.end(), 0)) != 2) {
continue;
}

Expand All @@ -914,18 +914,17 @@ struct HfFilter { // Main struct for HF triggers
std::array<float, 4> pVecDausSigmaC{pVecFirst, pVecSecond, pVecThird, pVecSoftPi};
std::array<float, 4> massDausSigmaCToLcPKPi{massProton, massKa, massPi, massPi};
std::array<float, 4> massDausSigmaCToLcPiKP{massPi, massKa, massProton, massPi};
float massSigmaCToLcPKPi = RecoDecay::m(pVecDausSigmaC, massDausSigmaCToLcPKPi):
float massSigmaCToLcPiKP = RecoDecay::m(pVecDausSigmaC, massDausSigmaCToLcPiKP):
if(!helper.isSelectedSigmaCInDeltaMassRange(massSigmaCToLcPKPi-massLcPKPi, massSigmaCToLcPiKP-massLcPiKP)) {
float massSigmaCToLcPKPi = RecoDecay::m(pVecDausSigmaC, massDausSigmaCToLcPKPi) : float massSigmaCToLcPiKP = RecoDecay::m(pVecDausSigmaC, massDausSigmaCToLcPiKP) : if (!helper.isSelectedSigmaCInDeltaMassRange(massSigmaCToLcPKPi - massLcPKPi, massSigmaCToLcPiKP - massLcPiKP))
{

/// let's build a candidate SigmaC++K- and keep it if it is in the correct mass range
/// TODO (check the charge first)
}

} // end SigmaC++ candidate
} // end loop over tracks (soft pi)
} // end candidate Lc->pKpi
} // end loop over tracks
} // end loop over tracks (soft pi)
} // end candidate Lc->pKpi
} // end loop over tracks

// 3-prong with V0 (Ds gamma, D+ K0S, D+ Lambda)
auto v0sThisCollision = theV0s.sliceBy(v0sPerCollision, thisCollId);
Expand Down
22 changes: 12 additions & 10 deletions EventFiltering/PWGHF/HFFilterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class HfFilterHelper
mNSigmaTofPiKaCutForDzero = nSigmaTof;
}
void setDeltaMassCharmHadForBeauty(float delta) { mDeltaMassCharmHadForBeauty = delta; }
void setDeltaMassLcForSigmaC(float delta) {mDeltaMassLcForSigmaC = delta;}
void setDeltaMassLcForSigmaC(float delta) { mDeltaMassLcForSigmaC = delta; }
void setV0Selections(float minGammaCosPa, float minK0sLambdaCosPa, float minK0sLambdaRadius, float nSigmaPrFromLambda, float deltaMassK0s, float deltaMassLambda)
{
mMinGammaCosinePa = minGammaCosPa;
Expand Down Expand Up @@ -446,7 +446,7 @@ inline int8_t HfFilterHelper::isSelectedTrackForSoftPionOrBeauty(const T track,

// D*+ soft pion pt cut
// Disable this cut if SigmaC triggers are considered
if (pT < mPtMinSoftPionForDstar && whichTrigger != kSigmaCppKminus && whichTrigger != kSigmaC0K0s ) { // soft pion min pT cut should be less stringent than usual tracks
if (pT < mPtMinSoftPionForDstar && whichTrigger != kSigmaCppKminus && whichTrigger != kSigmaC0K0s) { // soft pion min pT cut should be less stringent than usual tracks
return kRejected;
}

Expand All @@ -461,10 +461,10 @@ inline int8_t HfFilterHelper::isSelectedTrackForSoftPionOrBeauty(const T track,
if (whichTrigger == kSigmaCppKminus || whichTrigger == kSigmaC0K0s) {

// SigmaC0,++ soft pion pt cut
if( pT < mPtMinSoftPionForSigmaC ) {
if (pT < mPtMinSoftPionForSigmaC) {
return kRejected;
}

// We do not need any further selection for SigmaC soft-pi
// The current track is a good SigmaC soft-pi candidate
return kSoftPionForSigmaC;
Expand Down Expand Up @@ -801,24 +801,26 @@ inline int8_t HfFilterHelper::isSelectedLcInMassRange(const T& pTrackSameChargeF
/// Mass selection of Lc candidates to build SigmaC candidates
/// \param massPKPi is the inv. mass calculated assuming p-K-pi daughters
/// \param massPiKP is the inv. mass calculated assuming pi-K-p daughters
inline int8_t HfFilterHelper::isSelectedLcInMassRangeSigmaC(const float& massPKPi, const float& massPiKP) {
inline int8_t HfFilterHelper::isSelectedLcInMassRangeSigmaC(const float& massPKPi, const float& massPiKP)
{
int8_t retValue = 0;
if( std::fabs(massPKPi - massLc) < mDeltaMassLcForSigmaC ) {
if (std::fabs(massPKPi - massLc) < mDeltaMassLcForSigmaC) {
retValue |= BIT(0);
}
if( std::fabs(massPiKP - massLc) < mDeltaMassLcForSigmaC ) {
if (std::fabs(massPiKP - massLc) < mDeltaMassLcForSigmaC) {
retValue |= BIT(1);
}
return retValue;
}

/// Delta mass selection on SigmaC candidates
inline int8_t HfFilterHelper::isSelectedSigmaCInDeltaMassRange(const float& deltaMassPKPi, const float& deltaMassPiKP) {
inline int8_t HfFilterHelper::isSelectedSigmaCInDeltaMassRange(const float& deltaMassPKPi, const float& deltaMassPiKP)
{
int8_t retValue = 0;
if( deltaMassPKPi < mDeltaMassMinSigmaC ) {
if (deltaMassPKPi < mDeltaMassMinSigmaC) {
retValue |= BIT(0);
}
if( deltaMassPiKP < mDeltaMassMaxSigmaC ) {
if (deltaMassPiKP < mDeltaMassMaxSigmaC) {
retValue |= BIT(1);
}
return retValue;
Expand Down

0 comments on commit f0c0d2e

Please sign in to comment.