@@ -353,7 +353,7 @@ struct HfCorrelatorLcScHadrons {
353353 Configurable<float > cfgV0DaughPIDCutsTPCPr{" cfgV0DaughPIDCutsTPCPr" , 2.5 , " max. TPCnSigma Proton" };
354354 Configurable<float > cfgV0DaughPIDCutsTPCPi{" cfgV0DaughPIDCutsTPCPi" , 2.5 , " max. TPCnSigma Pion" };
355355 Configurable<float > cfgV0DaughPIDCutsTOFPi{" cfgV0DaughPIDCutsTOFPi" , 2.5 , " max. TOFnSigma Pion" };
356- Configurable<float > cfgV0DaughPIDCutsTOFPr{" cfgV0DaughPIDCutsTOFPr" , 2.5 , " max . TOFnSigma Pion " };
356+ Configurable<float > cfgV0DaughPIDCutsTOFPr{" cfgV0DaughPIDCutsTOFPr" , - 2.5 , " min . TOFnSigma Proton (put only negative value) " };
357357 Configurable<float > cfgHypMassWindow{" cfgHypMassWindow" , 0.1 , " single lambda mass selection" };
358358 Configurable<bool > cfgIsCorrCollMatchV0{" cfgIsCorrCollMatchV0" , true , " check if daughter and mother collision are same" };
359359 Configurable<bool > cfgCalDataDrivenEffPr{" cfgCalDataDrivenEffPr" , false , " calculate data driven efficiency of proton using Lambda" };
@@ -368,6 +368,7 @@ struct HfCorrelatorLcScHadrons {
368368 Configurable<int > cfgMinOccupancy{" cfgMinOccupancy" , 0 , " maximum occupancy of tracks in neighbouring collisions in a given time range" };
369369 Configurable<float > cfgPV{" cfgPV" , 10 ., " maximum z-vertex" };
370370 Configurable<bool > calEffV0{" calEffV0" , false , " calculate lambda0 efficiency" };
371+ Configurable<bool > checkTOFForPion{" checkTOFForPion" , false , " if True, TOF selection on pion V0 wil only be applied if TOF present" };
371372 } cfgV0;
372373
373374 // Event Mixing for the Data Mode
@@ -602,43 +603,48 @@ struct HfCorrelatorLcScHadrons {
602603 if (std::abs (track.eta ()) > cfgCharmCand.etaTrackMax ) {
603604 return false ;
604605 }
606+
605607 // ---------------------------------------------------------
606608 // 1. Proton PID Selection
607609 // ---------------------------------------------------------
608610 if (std::abs (pid) == kProton ) {
611+ bool hasTOFProton = (pid > 0 ) ? v0.positiveHasTOF () : v0.negativeHasTOF ();
609612 bool passTOF = false ;
610613
611614 if (track.pt () > cfgV0.cfgV0DaughPrPtMax || track.pt () < cfgV0.cfgV0DaughPrPtMin ) {
612615 return false ;
613616 }
614- if (track.hasTOF ()) {
617+
618+ if (hasTOFProton && (track.pt () > cfgCharmCand.tofPIDThreshold )) {
615619 if constexpr (std::experimental::is_detected<HasStrangeTOFinV0, V0Type>::value) {
616620 // pid > 0: Proton from Lambda (LaPr)
617621 // pid < 0: Antiproton from Anti-Lambda (ALaPr)
618622 double strangeTOF = (pid > 0 ) ? v0.tofNSigmaLaPr () : v0.tofNSigmaALaPr ();
619- passTOF = std::abs (strangeTOF) > cfgV0.cfgV0DaughPIDCutsTOFPr ;
623+ passTOF = strangeTOF > cfgV0.cfgV0DaughPIDCutsTOFPr ;
624+
620625 } else {
621626 // if strange TOF is unavailable
622- passTOF = std::abs ( track.tofNSigmaPr () ) > cfgV0.cfgV0DaughPIDCutsTOFPr ;
627+ passTOF = track.tofNSigmaPr () > cfgV0.cfgV0DaughPIDCutsTOFPr ;
623628 }
624629 }
625630
626- if ((std::abs (track.tpcNSigmaPr ()) > cfgV0.cfgV0DaughPIDCutsTPCPr ) || passTOF) {
631+ if ((std::abs (track.tpcNSigmaPr ()) > cfgV0.cfgV0DaughPIDCutsTPCPr ) && ! passTOF) {
627632 return false ;
628633 }
629634 }
630635
631636 // ---------------------------------------------------------
632637 // 2. Pion PID Selection
633638 // ---------------------------------------------------------
634- if (std::abs (pid) == kPiPlus ) {
639+ if (std::abs (pid) == kPiPlus && cfgV0.checkTOFForPion ) {
640+ bool hasTOFPion = (pid < 0 ) ? v0.negativeHasTOF () : v0.positiveHasTOF ();
635641 bool passTOF = false ;
636642
637643 if (track.pt () > cfgV0.cfgV0DaughPiPtMax || track.pt () < cfgV0.cfgV0DaughPiPtMin ) {
638644 return false ;
639645 }
640646
641- if (track.hasTOF ( )) {
647+ if (hasTOFPion && ( track.pt () > cfgCharmCand. tofPIDThreshold )) {
642648 if constexpr (std::experimental::is_detected<HasStrangeTOFinV0, V0Type>::value) {
643649 // A pion can belong to either a Lambda/Anti-Lambda decay or a K0s decay.
644650 // We evaluate both applicable hypotheses based on charge sign and pick the best match.
@@ -651,11 +657,10 @@ struct HfCorrelatorLcScHadrons {
651657 }
652658 }
653659
654- if ((std::abs (track.tpcNSigmaPi ()) > cfgV0.cfgV0DaughPIDCutsTPCPi ) || passTOF) {
660+ if ((std::abs (track.tpcNSigmaPi ()) > cfgV0.cfgV0DaughPIDCutsTPCPi ) && ! passTOF) {
655661 return false ;
656662 }
657663 }
658-
659664 return true ;
660665 }
661666
@@ -848,7 +853,7 @@ struct HfCorrelatorLcScHadrons {
848853 }
849854
850855 // Process Lambda (proton-pion)
851- if (std::abs (o2::constants::physics::MassLambda - v0.mLambda ()) < cfgV0.cfgHypMassWindow ) {
856+ if (( std::abs (o2::constants::physics::MassLambda - v0.mLambda ()) < cfgV0.cfgHypMassWindow ) && v0. alpha () > 0 ) {
852857 if (isSelectedV0Daughter (posTrackV0, v0, kProton ) && isSelectedV0Daughter (negTrackV0, v0, kPiMinus )) {
853858
854859 if (selLcPKPi) {
@@ -869,7 +874,7 @@ struct HfCorrelatorLcScHadrons {
869874 }
870875
871876 // Process anti-Lambda (anti-proton-pion)
872- if (std::abs (o2::constants::physics::MassLambda - v0.mAntiLambda ()) < cfgV0.cfgHypMassWindow ) {
877+ if (( std::abs (o2::constants::physics::MassLambda - v0.mAntiLambda ()) < cfgV0.cfgHypMassWindow ) && v0. alpha () < 0 ) {
873878 if (isSelectedV0Daughter (negTrackV0, v0, kProtonBar ) && isSelectedV0Daughter (posTrackV0, v0, kPiPlus )) {
874879
875880 if (selLcPKPi) {
@@ -956,7 +961,7 @@ struct HfCorrelatorLcScHadrons {
956961 }
957962
958963 // Process Lambda (proton + pion)
959- if (passV0Sel && std::abs (o2::constants::physics::MassLambda - v0.mLambda ()) < cfgV0.cfgHypMassWindow ) {
964+ if (passV0Sel && std::abs (o2::constants::physics::MassLambda - v0.mLambda ()) < cfgV0.cfgHypMassWindow && v0. alpha () > 0 ) {
960965 entryHadron (v0.mLambda (), trackV0Pos.eta (), trackV0Pos.pt () * trackV0Pos.sign (), 0 , 0 , v0.pt ());
961966 entryTrkPID (trackV0Pos.tpcNSigmaPr (), trackV0Pos.tpcNSigmaKa (), trackV0Pos.tpcNSigmaPi (), trackV0Pos.tofNSigmaPr (), trackV0Pos.tofNSigmaKa (), trackV0Pos.tofNSigmaPi ());
962967
@@ -980,7 +985,7 @@ struct HfCorrelatorLcScHadrons {
980985 }
981986 }
982987
983- if (passV0Sel && std::abs (o2::constants::physics::MassLambda - v0.mAntiLambda ()) < cfgV0.cfgHypMassWindow ) {
988+ if (passV0Sel && std::abs (o2::constants::physics::MassLambda - v0.mAntiLambda ()) < cfgV0.cfgHypMassWindow && v0. alpha () < 0 ) {
984989 entryHadron (v0.mAntiLambda (), trackV0Neg.eta (), trackV0Neg.pt () * trackV0Neg.sign (), 0 , 0 , v0.pt ());
985990 entryTrkPID (trackV0Neg.tpcNSigmaPr (), trackV0Neg.tpcNSigmaKa (), trackV0Neg.tpcNSigmaPi (), trackV0Neg.tofNSigmaPr (), trackV0Neg.tofNSigmaKa (), trackV0Neg.tofNSigmaPi ());
986991
@@ -1013,7 +1018,7 @@ struct HfCorrelatorLcScHadrons {
10131018 auto const & partV0Pos = trackV0Pos.mcParticle ();
10141019 auto const & partV0Neg = trackV0Neg.mcParticle ();
10151020
1016- if (passV0Sel && v0Mc.pdgCode () == kLambda0 ) {
1021+ if (passV0Sel && v0Mc.pdgCode () == kLambda0 && v0. alpha () > 0 ) {
10171022 if (isSelectedV0Daughter (trackV0Pos, v0, kProton ) && isSelectedV0Daughter (trackV0Neg, v0, kPiMinus )) {
10181023 registry.fill (HIST (" hV0LambdaMcRec" ), v0.mLambda (), v0.pt (), partV0Pos.pt ());
10191024 registry.fill (HIST (" hV0LambdaReflMcRec" ), v0.mAntiLambda (), v0.pt (), partV0Neg.pt ());
@@ -1028,7 +1033,7 @@ struct HfCorrelatorLcScHadrons {
10281033 }
10291034 }
10301035 }
1031- if (passV0Sel && v0Mc.pdgCode () == kLambda0Bar ) {
1036+ if (passV0Sel && v0Mc.pdgCode () == kLambda0Bar && v0. alpha () < 0 ) {
10321037 if (isSelectedV0Daughter (trackV0Neg, v0, kProtonBar ) && isSelectedV0Daughter (trackV0Pos, v0, kPiPlus )) {
10331038 registry.fill (HIST (" hV0LambdaMcRec" ), v0.mAntiLambda (), v0.pt (), partV0Neg.pt ());
10341039 registry.fill (HIST (" hV0LambdaReflMcRec" ), v0.mLambda (), v0.pt (), partV0Pos.pt ());
@@ -1625,7 +1630,7 @@ struct HfCorrelatorLcScHadrons {
16251630 registry.fill (HIST (" hPhiMcGen" ), RecoDecay::constrainAngle (particle.phi (), -PIHalf));
16261631 registry.fill (HIST (" hYMcGen" ), yCand);
16271632
1628- int8_t chargeCand = pdg->GetParticle (particle.pdgCode ())->Charge () / PDGChargeScale; // Retrieve charge
1633+ auto chargeCand = pdg->GetParticle (particle.pdgCode ())->Charge () / PDGChargeScale; // Retrieve charge
16291634 if (chargeCand == ChargeZero) {
16301635 chargeCand = (particle.pdgCode () > ChargeZero) ? AssignedChargeSc0 : -AssignedChargeSc0; // to distingush sc0 from anti-sc0, charge set to +1 and -1
16311636 }
@@ -1854,8 +1859,8 @@ struct HfCorrelatorLcScHadrons {
18541859 if (cfgCharmCand.pidTrkApplied && (std::abs (particleAssoc.pdgCode ()) != kProton )) {
18551860 continue ; // proton PID
18561861 }
1857- int8_t const chargeLc = static_cast < int8_t >( pdg->GetParticle (candidate.pdgCode ())->Charge ()); // Retrieve charge
1858- int8_t const chargeAssoc = static_cast < int8_t >( pdg->GetParticle (particleAssoc.pdgCode ())->Charge ()); // Retrieve charge
1862+ auto const chargeLc = pdg->GetParticle (candidate.pdgCode ())->Charge (); // Retrieve charge
1863+ auto const chargeAssoc = pdg->GetParticle (particleAssoc.pdgCode ())->Charge (); // Retrieve charge
18591864 float cent = 100.0 ; // will be updated later
18601865
18611866 int trackOrigin = RecoDecay::getCharmHadronOrigin (mcParticles, particleAssoc, true );
@@ -1906,8 +1911,8 @@ struct HfCorrelatorLcScHadrons {
19061911 PROCESS_SWITCH (HfCorrelatorLcScHadrons, processLambda0EffCal, " Mc process for lambda0" , false );
19071912};
19081913
1909- WorkflowSpec defineDataProcessing (ConfigContext const & cfgc )
1914+ WorkflowSpec defineDataProcessing (ConfigContext const & context )
19101915{
1911- return WorkflowSpec{adaptAnalysisTask<HfCorrelatorLcScHadronsSelection>(cfgc ),
1912- adaptAnalysisTask<HfCorrelatorLcScHadrons>(cfgc )};
1916+ return WorkflowSpec{adaptAnalysisTask<HfCorrelatorLcScHadronsSelection>(context ),
1917+ adaptAnalysisTask<HfCorrelatorLcScHadrons>(context )};
19131918}
0 commit comments