@@ -1007,8 +1007,8 @@ struct HfTrackIndexSkimCreator {
10071007 Configurable<std::vector<double >> binsPtDplusToPiKPi{" binsPtDplusToPiKPi" , std::vector<double >{hf_cuts_presel_3prong::vecBinsPt}, " pT bin limits for D+->piKpi pT-dependent cuts" };
10081008 Configurable<LabeledArray<double >> cutsDplusToPiKPi{" cutsDplusToPiKPi" , {hf_cuts_presel_3prong::cuts[0 ], hf_cuts_presel_3prong::nBinsPt, hf_cuts_presel_3prong::nCutVars, hf_cuts_presel_3prong::labelsPt, hf_cuts_presel_3prong::labelsCutVar}, " D+->piKpi selections per pT bin" };
10091009 // Ds+ cuts
1010- Configurable<std::vector<double >> binsPtDsToKKPi{" binsPtDsToKKPi" , std::vector<double >{hf_cuts_presel_3prong ::vecBinsPt}, " pT bin limits for Ds+->KKPi pT-dependent cuts" };
1011- Configurable<LabeledArray<double >> cutsDsToKKPi{" cutsDsToKKPi" , {hf_cuts_presel_3prong ::cuts[0 ], hf_cuts_presel_3prong ::nBinsPt, hf_cuts_presel_3prong ::nCutVars, hf_cuts_presel_3prong ::labelsPt, hf_cuts_presel_3prong ::labelsCutVar}, " Ds+->KKPi selections per pT bin" };
1010+ Configurable<std::vector<double >> binsPtDsToKKPi{" binsPtDsToKKPi" , std::vector<double >{hf_cuts_presel_Ds ::vecBinsPt}, " pT bin limits for Ds+->KKPi pT-dependent cuts" };
1011+ Configurable<LabeledArray<double >> cutsDsToKKPi{" cutsDsToKKPi" , {hf_cuts_presel_Ds ::cuts[0 ], hf_cuts_presel_Ds ::nBinsPt, hf_cuts_presel_Ds ::nCutVars, hf_cuts_presel_Ds ::labelsPt, hf_cuts_presel_Ds ::labelsCutVar}, " Ds+->KKPi selections per pT bin" };
10121012 // Lc+ cuts
10131013 Configurable<std::vector<double >> binsPtLcToPKPi{" binsPtLcToPKPi" , std::vector<double >{hf_cuts_presel_3prong::vecBinsPt}, " pT bin limits for Lc->pKpi pT-dependent cuts" };
10141014 Configurable<LabeledArray<double >> cutsLcToPKPi{" cutsLcToPKPi" , {hf_cuts_presel_3prong::cuts[0 ], hf_cuts_presel_3prong::nBinsPt, hf_cuts_presel_3prong::nCutVars, hf_cuts_presel_3prong::labelsPt, hf_cuts_presel_3prong::labelsCutVar}, " Lc->pKpi selections per pT bin" };
@@ -1031,13 +1031,14 @@ struct HfTrackIndexSkimCreator {
10311031 double massElectron{0 .};
10321032 double massMuon{0 .};
10331033 double massDzero{0 .};
1034+ double massPhi{0 .};
10341035
10351036 // int nColls{0}; //can be added to run over limited collisions per file - for tesing purposes
10361037
10371038 static constexpr int kN2ProngDecays = hf_cand_2prong::DecayType::N2ProngDecays; // number of 2-prong hadron types
10381039 static constexpr int kN3ProngDecays = hf_cand_3prong::DecayType::N3ProngDecays; // number of 3-prong hadron types
10391040 static constexpr int kNCuts2Prong = 4 ; // how many different selections are made on 2-prongs
1040- static constexpr int kNCuts3Prong = 4 ; // how many different selections are made on 3-prongs
1041+ static constexpr int kNCuts3Prong [ kN3ProngDecays ] = { 4 , 4 , 5 , 4 }; // how many different selections are made on 3-prongs
10411042 static constexpr int kNCutsDstar = 3 ; // how many different selections are made on Dstars
10421043 std::array<std::array<std::array<double , 2 >, 2 >, kN2ProngDecays > arrMass2Prong;
10431044 std::array<std::array<std::array<double , 3 >, 2 >, kN3ProngDecays > arrMass3Prong;
@@ -1084,6 +1085,7 @@ struct HfTrackIndexSkimCreator {
10841085 massElectron = o2::analysis::pdg::MassElectron;
10851086 massMuon = o2::analysis::pdg::MassMuonPlus;
10861087 massDzero = o2::analysis::pdg::MassD0;
1088+ massPhi = o2::analysis::pdg::MassPhi;
10871089
10881090 arrMass2Prong[hf_cand_2prong::DecayType::D0ToPiK] = std::array{std::array{massPi, massK},
10891091 std::array{massK, massPi}};
@@ -1304,10 +1306,10 @@ struct HfTrackIndexSkimCreator {
13041306 massHypos[0 ] = RecoDecay::m2 (arrMom, arrMass3Prong[iDecay3P][0 ]);
13051307 massHypos[1 ] = RecoDecay::m2 (arrMom, arrMass3Prong[iDecay3P][1 ]);
13061308 if (massHypos[0 ] < min2 || massHypos[0 ] >= max2) {
1307- whichHypo[iDecay3P] -= 1 ;
1309+ CLRBIT ( whichHypo[iDecay3P], 0 ) ;
13081310 }
13091311 if (massHypos[1 ] < min2 || massHypos[1 ] >= max2) {
1310- whichHypo[iDecay3P] -= 2 ;
1312+ CLRBIT ( whichHypo[iDecay3P], 1 ) ;
13111313 }
13121314 if (whichHypo[iDecay3P] == 0 ) {
13131315 CLRBIT (isSelected, iDecay3P);
@@ -1316,6 +1318,32 @@ struct HfTrackIndexSkimCreator {
13161318 }
13171319 }
13181320 }
1321+
1322+ if ((debug || TESTBIT (isSelected, iDecay3P)) && iDecay3P == hf_cand_3prong::DecayType::DsToKKPi) {
1323+ int deltaMassPhiIndex = cut3Prong[iDecay3P].colmap .find (" deltaMassKK" )->second ;
1324+
1325+ if (TESTBIT (whichHypo[iDecay3P], 0 ))
1326+ {
1327+ double MassPhiKKPi = RecoDecay::m (std::array{pVecTrack0, pVecTrack1}, std::array{arrMass3Prong[iDecay3P][0 ][0 ], arrMass3Prong[iDecay3P][0 ][1 ]});
1328+ if (std::abs (MassPhiKKPi - massPhi) > cut3Prong[iDecay3P].get (pTBin, deltaMassPhiIndex)) {
1329+ CLRBIT (whichHypo[iDecay3P], 0 );
1330+ }
1331+ }
1332+ if (TESTBIT (whichHypo[iDecay3P], 1 ))
1333+ {
1334+ double MassPhiPiKK = RecoDecay::m (std::array{pVecTrack1, pVecTrack2}, std::array{arrMass3Prong[iDecay3P][0 ][1 ], arrMass3Prong[iDecay3P][0 ][2 ]});
1335+ if (std::abs (MassPhiPiKK - massPhi) > cut3Prong[iDecay3P].get (pTBin, deltaMassPhiIndex)) {
1336+ CLRBIT (whichHypo[iDecay3P], 1 );
1337+ }
1338+ }
1339+
1340+ if (whichHypo[iDecay3P] == 0 ) {
1341+ CLRBIT (isSelected, iDecay3P);
1342+ if (debug) {
1343+ cutStatus[iDecay3P][4 ] = false ;
1344+ }
1345+ }
1346+ }
13191347 }
13201348 }
13211349
@@ -1688,9 +1716,14 @@ struct HfTrackIndexSkimCreator {
16881716 int n3ProngBit = BIT (kN3ProngDecays ) - 1 ; // bit value for 3-prong candidates where each candidate is one bit and they are all set to 1
16891717
16901718 bool cutStatus2Prong[kN2ProngDecays ][kNCuts2Prong ];
1691- bool cutStatus3Prong[ kN3ProngDecays ][ kNCuts3Prong ] ;
1719+ std::array<std::vector< bool >, kN3ProngDecays > cutStatus3Prong ;
16921720 int nCutStatus2ProngBit = BIT (kNCuts2Prong ) - 1 ; // bit value for selection status for each 2-prong candidate where each selection is one bit and they are all set to 1
1693- int nCutStatus3ProngBit = BIT (kNCuts3Prong ) - 1 ; // bit value for selection status for each 3-prong candidate where each selection is one bit and they are all set to 1
1721+ bool nCutStatus3ProngBit[kN3ProngDecays ]; // bit value for selection status for each 3-prong candidate where each selection is one bit and they are all set to 1
1722+
1723+ for (int iDecay3P = 0 ; iDecay3P < kN3ProngDecays ; iDecay3P++) {
1724+ nCutStatus3ProngBit[iDecay3P] = BIT (kNCuts3Prong [iDecay3P]) - 1 ;
1725+ cutStatus3Prong[iDecay3P] = std::vector<bool >(kNCuts3Prong [iDecay3P], true );
1726+ }
16941727
16951728 int whichHypo2Prong[kN2ProngDecays ];
16961729 int whichHypo3Prong[kN3ProngDecays ];
@@ -2017,7 +2050,7 @@ struct HfTrackIndexSkimCreator {
20172050
20182051 if (debug) {
20192052 for (int iDecay3P = 0 ; iDecay3P < kN3ProngDecays ; iDecay3P++) {
2020- for (int iCut = 0 ; iCut < kNCuts3Prong ; iCut++) {
2053+ for (int iCut = 0 ; iCut < kNCuts3Prong [iDecay3P] ; iCut++) {
20212054 cutStatus3Prong[iDecay3P][iCut] = true ;
20222055 }
20232056 }
@@ -2158,8 +2191,8 @@ struct HfTrackIndexSkimCreator {
21582191 if (debug) {
21592192 int Prong3CutStatus[kN3ProngDecays ];
21602193 for (int iDecay3P = 0 ; iDecay3P < kN3ProngDecays ; iDecay3P++) {
2161- Prong3CutStatus[iDecay3P] = nCutStatus3ProngBit;
2162- for (int iCut = 0 ; iCut < kNCuts3Prong ; iCut++) {
2194+ Prong3CutStatus[iDecay3P] = nCutStatus3ProngBit[iDecay3P] ;
2195+ for (int iCut = 0 ; iCut < kNCuts3Prong [iDecay3P] ; iCut++) {
21632196 if (!cutStatus3Prong[iDecay3P][iCut]) {
21642197 CLRBIT (Prong3CutStatus[iDecay3P], iCut);
21652198 }
@@ -2176,7 +2209,7 @@ struct HfTrackIndexSkimCreator {
21762209 std::array<std::array<float , 3 >, 3 > arr3Mom = {pvec0, pvec1, pvec2};
21772210 for (int iDecay3P = 0 ; iDecay3P < kN3ProngDecays ; iDecay3P++) {
21782211 if (TESTBIT (isSelected3ProngCand, iDecay3P)) {
2179- if (whichHypo3Prong[iDecay3P] == 1 || whichHypo3Prong[iDecay3P] == 3 ) {
2212+ if (TESTBIT ( whichHypo3Prong[iDecay3P], 0 ) ) {
21802213 auto mass3Prong = RecoDecay::m (arr3Mom, arrMass3Prong[iDecay3P][0 ]);
21812214 switch (iDecay3P) {
21822215 case hf_cand_3prong::DecayType::DplusToPiKPi:
@@ -2193,7 +2226,7 @@ struct HfTrackIndexSkimCreator {
21932226 break ;
21942227 }
21952228 }
2196- if (whichHypo3Prong[iDecay3P] >= 2 ) {
2229+ if (TESTBIT ( whichHypo3Prong[iDecay3P], 1 ) ) {
21972230 auto mass3Prong = RecoDecay::m (arr3Mom, arrMass3Prong[iDecay3P][1 ]);
21982231 switch (iDecay3P) {
21992232 case hf_cand_3prong::DecayType::DsToKKPi:
@@ -2271,7 +2304,7 @@ struct HfTrackIndexSkimCreator {
22712304
22722305 if (debug) {
22732306 for (int iDecay3P = 0 ; iDecay3P < kN3ProngDecays ; iDecay3P++) {
2274- for (int iCut = 0 ; iCut < kNCuts3Prong ; iCut++) {
2307+ for (int iCut = 0 ; iCut < kNCuts3Prong [iDecay3P] ; iCut++) {
22752308 cutStatus3Prong[iDecay3P][iCut] = true ;
22762309 }
22772310 }
@@ -2412,8 +2445,8 @@ struct HfTrackIndexSkimCreator {
24122445 if (debug) {
24132446 int Prong3CutStatus[kN3ProngDecays ];
24142447 for (int iDecay3P = 0 ; iDecay3P < kN3ProngDecays ; iDecay3P++) {
2415- Prong3CutStatus[iDecay3P] = nCutStatus3ProngBit;
2416- for (int iCut = 0 ; iCut < kNCuts3Prong ; iCut++) {
2448+ Prong3CutStatus[iDecay3P] = nCutStatus3ProngBit[iDecay3P] ;
2449+ for (int iCut = 0 ; iCut < kNCuts3Prong [iDecay3P] ; iCut++) {
24172450 if (!cutStatus3Prong[iDecay3P][iCut]) {
24182451 CLRBIT (Prong3CutStatus[iDecay3P], iCut);
24192452 }
@@ -2430,7 +2463,7 @@ struct HfTrackIndexSkimCreator {
24302463 std::array<std::array<float , 3 >, 3 > arr3Mom = {pvec0, pvec1, pvec2};
24312464 for (int iDecay3P = 0 ; iDecay3P < kN3ProngDecays ; iDecay3P++) {
24322465 if (TESTBIT (isSelected3ProngCand, iDecay3P)) {
2433- if (whichHypo3Prong[iDecay3P] == 1 || whichHypo3Prong[iDecay3P] == 3 ) {
2466+ if (TESTBIT ( whichHypo3Prong[iDecay3P], 0 ) ) {
24342467 auto mass3Prong = RecoDecay::m (arr3Mom, arrMass3Prong[iDecay3P][0 ]);
24352468 switch (iDecay3P) {
24362469 case hf_cand_3prong::DecayType::DplusToPiKPi:
@@ -2447,7 +2480,7 @@ struct HfTrackIndexSkimCreator {
24472480 break ;
24482481 }
24492482 }
2450- if (whichHypo3Prong[iDecay3P] >= 2 ) {
2483+ if (TESTBIT ( whichHypo3Prong[iDecay3P], 1 ) ) {
24512484 auto mass3Prong = RecoDecay::m (arr3Mom, arrMass3Prong[iDecay3P][1 ]);
24522485 switch (iDecay3P) {
24532486 case hf_cand_3prong::DecayType::DsToKKPi:
0 commit comments