@@ -33,14 +33,17 @@ using namespace o2;
3333using namespace o2 ::framework;
3434using namespace o2 ::framework::expressions;
3535
36+ #define bitset (var, nbit ) ((var) |= (1 << (nbit)))
3637#define bitcheck (var, nbit ) ((var) & (1 << (nbit)))
3738
3839struct hstrangecorrelationfilter {
3940 HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
4041
4142 // Operational
4243 Configurable<bool > fillTableOnlyWithCompatible{" fillTableOnlyWithCompatible" , true , " pre-apply dE/dx, broad mass window in table filling" };
43- Configurable<float > strangedEdxNSigma{" strangedEdxNSigma" , 5 , " Nsigmas for strange decay daughters" };
44+ Configurable<float > strangedEdxNSigmaLoose{" strangedEdxNSigmaLoose" , 5 , " Nsigmas for strange decay daughters" };
45+ Configurable<float > strangedEdxNSigma{" strangedEdxNSigma" , 4 , " Nsigmas for strange decay daughters" };
46+ Configurable<float > strangedEdxNSigmaTight{" strangedEdxNSigmaTight" , 3 , " Nsigmas for strange decay daughters" };
4447
4548 // Trigger particle selections in phase space
4649 Configurable<float > triggerEtaMin{" triggerEtaCutMin" , -0.8 , " triggeretamin" };
@@ -329,9 +332,9 @@ struct hstrangecorrelationfilter {
329332 continue ;
330333 }
331334 // check dE/dx compatibility
332- bool compatibleK0Short = false ;
333- bool compatibleLambda = false ;
334- bool compatibleAntiLambda = false ;
335+ int compatibleK0Short = 0 ;
336+ int compatibleLambda = 0 ;
337+ int compatibleAntiLambda = 0 ;
335338
336339 auto posdau = v0.posTrack_as <DauTracks>();
337340 auto negdau = v0.negTrack_as <DauTracks>();
@@ -342,19 +345,33 @@ struct hstrangecorrelationfilter {
342345 if (posdau.tpcNClsCrossedRows () < minTPCNCrossedRows)
343346 continue ;
344347
345- if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigma) {
346- compatibleK0Short = true ;
347- }
348- if (TMath::Abs (posdau.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigma) {
349- if (v0.v0cosPA () > lambdaCospa) {
350- compatibleLambda = true ;
351- }
352- }
353- if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negdau.tpcNSigmaPr ()) < strangedEdxNSigma) {
354- if (v0.v0cosPA () > lambdaCospa) {
355- compatibleAntiLambda = true ;
356- }
357- }
348+ if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigmaLoose)
349+ bitset (compatibleK0Short, 0 );
350+ if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigma)
351+ bitset (compatibleK0Short, 1 );
352+ if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigmaTight && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigmaTight)
353+ bitset (compatibleK0Short, 2 );
354+
355+ if (TMath::Abs (posdau.tpcNSigmaPr ()) < strangedEdxNSigmaLoose && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigmaLoose)
356+ if (v0.v0cosPA () > lambdaCospa)
357+ bitset (compatibleLambda, 0 );
358+ if (TMath::Abs (posdau.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigma)
359+ if (v0.v0cosPA () > lambdaCospa)
360+ bitset (compatibleLambda, 1 );
361+ if (TMath::Abs (posdau.tpcNSigmaPr ()) < strangedEdxNSigmaTight && TMath::Abs (negdau.tpcNSigmaPi ()) < strangedEdxNSigmaTight)
362+ if (v0.v0cosPA () > lambdaCospa)
363+ bitset (compatibleLambda, 2 );
364+
365+ if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && TMath::Abs (negdau.tpcNSigmaPr ()) < strangedEdxNSigmaLoose)
366+ if (v0.v0cosPA () > lambdaCospa)
367+ bitset (compatibleAntiLambda, 0 );
368+ if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negdau.tpcNSigmaPr ()) < strangedEdxNSigma)
369+ if (v0.v0cosPA () > lambdaCospa)
370+ bitset (compatibleAntiLambda, 1 );
371+ if (TMath::Abs (posdau.tpcNSigmaPi ()) < strangedEdxNSigmaTight && TMath::Abs (negdau.tpcNSigmaPr ()) < strangedEdxNSigmaTight)
372+ if (v0.v0cosPA () > lambdaCospa)
373+ bitset (compatibleAntiLambda, 2 );
374+
358375 // check whether V0s are in the regin
359376 int massRegK0Short = -1 ;
360377 if (TMath::Abs (v0.mK0Short () - fK0Mean ->Eval (v0.pt ()) < peakNsigma * fK0Width ->Eval (v0.pt ()))) {
@@ -416,9 +433,9 @@ struct hstrangecorrelationfilter {
416433
417434 if (!fillTableOnlyWithCompatible ||
418435 ( // start major condition check
419- (compatibleK0Short && massRegK0Short > 0 && massRegK0Short < 4 ) ||
420- (compatibleLambda && massRegLambda > 0 && massRegLambda < 4 ) ||
421- (compatibleAntiLambda && massRegAntiLambda > 0 && massRegAntiLambda < 4 )) // end major condition check
436+ (compatibleK0Short > 0 && massRegK0Short > 0 && massRegK0Short < 4 ) ||
437+ (compatibleLambda > 0 && massRegLambda > 0 && massRegLambda < 4 ) ||
438+ (compatibleAntiLambda > 0 && massRegAntiLambda > 0 && massRegAntiLambda < 4 )) // end major condition check
422439 ) {
423440 assocV0 (v0.collisionId (), v0.globalIndex (),
424441 compatibleK0Short, compatibleLambda, compatibleAntiLambda,
@@ -454,23 +471,38 @@ struct hstrangecorrelationfilter {
454471 continue ;
455472
456473 // check dE/dx compatibility
457- bool compatibleXiMinus = false ;
458- bool compatibleXiPlus = false ;
459- bool compatibleOmegaMinus = false ;
460- bool compatibleOmegaPlus = false ;
461-
462- if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && casc.sign () < 0 ) {
463- compatibleXiMinus = true ;
464- }
465- if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && casc.sign () > 0 ) {
466- compatibleXiPlus = true ;
467- }
468- if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigma && casc.sign () < 0 ) {
469- compatibleOmegaMinus = true ;
470- }
471- if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigma && casc.sign () > 0 ) {
472- compatibleOmegaPlus = true ;
473- }
474+ int compatibleXiMinus = 0 ;
475+ int compatibleXiPlus = 0 ;
476+ int compatibleOmegaMinus = 0 ;
477+ int compatibleOmegaPlus = 0 ;
478+
479+ if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaLoose && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && casc.sign () < 0 )
480+ bitset (compatibleXiMinus, 0 );
481+ if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && casc.sign () < 0 )
482+ bitset (compatibleXiMinus, 1 );
483+ if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaTight && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaTight && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaTight && casc.sign () < 0 )
484+ bitset (compatibleXiMinus, 2 );
485+
486+ if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaLoose && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && casc.sign () > 0 )
487+ bitset (compatibleXiPlus, 0 );
488+ if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && casc.sign () > 0 )
489+ bitset (compatibleXiPlus, 1 );
490+ if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaTight && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaTight && TMath::Abs (bachTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaTight && casc.sign () > 0 )
491+ bitset (compatibleXiPlus, 2 );
492+
493+ if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaLoose && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigmaLoose && casc.sign () < 0 )
494+ bitset (compatibleOmegaMinus, 0 );
495+ if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigma && casc.sign () < 0 )
496+ bitset (compatibleOmegaMinus, 1 );
497+ if (TMath::Abs (posTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaTight && TMath::Abs (negTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaTight && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigmaTight && casc.sign () < 0 )
498+ bitset (compatibleOmegaMinus, 2 );
499+
500+ if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaLoose && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaLoose && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigmaLoose && casc.sign () > 0 )
501+ bitset (compatibleOmegaPlus, 0 );
502+ if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigma && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigma && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigma && casc.sign () > 0 )
503+ bitset (compatibleOmegaPlus, 1 );
504+ if (TMath::Abs (posTrackCast.tpcNSigmaPi ()) < strangedEdxNSigmaTight && TMath::Abs (negTrackCast.tpcNSigmaPr ()) < strangedEdxNSigmaTight && TMath::Abs (bachTrackCast.tpcNSigmaKa ()) < strangedEdxNSigmaTight && casc.sign () > 0 )
505+ bitset (compatibleOmegaPlus, 2 );
474506
475507 int massRegXi = -1 ;
476508 if (TMath::Abs (casc.mXi () - fXiMean ->Eval (casc.pt ()) < peakNsigma * fXiWidth ->Eval (casc.pt ()))) {
@@ -517,8 +549,8 @@ struct hstrangecorrelationfilter {
517549
518550 if (!fillTableOnlyWithCompatible ||
519551 ( // start major condition check
520- ((compatibleXiMinus || compatibleXiPlus) && massRegXi > 0 && massRegXi < 4 ) ||
521- ((compatibleOmegaMinus || compatibleOmegaPlus) && massRegOmega > 0 && massRegOmega < 4 )) // end major condition check
552+ ((compatibleXiMinus > 0 || compatibleXiPlus > 0 ) && massRegXi > 0 && massRegXi < 4 ) ||
553+ ((compatibleOmegaMinus > 0 || compatibleOmegaPlus > 0 ) && massRegOmega > 0 && massRegOmega < 4 )) // end major condition check
522554 ) {
523555 assocCascades (casc.collisionId (), casc.globalIndex (),
524556 compatibleXiMinus, compatibleXiPlus, compatibleOmegaMinus, compatibleOmegaPlus,
0 commit comments