@@ -95,7 +95,7 @@ struct TreeWriterTpcV0 {
9595 Configurable<bool > rejectNoTofDauTrackKa{" rejectNoTofDauTrackKa" , false , " reject not matched to TOF kaon daughter tracks" };
9696 Configurable<float > nClNorm{" nClNorm" , 152 ., " Number of cluster normalization. Run 2: 159, Run 3 152" };
9797 Configurable<int > applyEvSel{" applyEvSel" , 2 , " Flag to apply rapidity cut: 0 -> no event selection, 1 -> Run 2 event selection, 2 -> Run 3 event selection" };
98- Configurable<int > trackSelection{" trackSelection" , 1 , " Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks" };
98+ Configurable<int > trackSelection{" trackSelection" , 0 , " Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks" };
9999 Configurable<std::string> irSource{" irSource" , " T0VTX" , " Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)" };
100100 // / Configurables downsampling
101101 Configurable<double > dwnSmplFactorPi{" dwnSmplFactorPi" , 1 ., " downsampling factor for pions, default fraction to keep is 1." };
@@ -442,10 +442,11 @@ struct TreeWriterTpcV0 {
442442 rowTPCTree.reserve (2 * v0s.size () + cascs.size ());
443443
444444 auto fillDaughterTrack = [&](const auto & mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter) {
445+ const bool passTrackSelection = isTrackSelected (dauTrack, trackSelection);
445446 const bool passDownsamplig = downsampleTsalisCharged (fRndm , dauTrack.pt (), daughter.downsamplingTsalis , daughter.mass , sqrtSNN, daughter.maxPt4dwnsmplTsalis );
446447 const bool passNSigmaTofCut = std::fabs (daughter.tofNSigma ) < daughter.nSigmaTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) < FloatEqualityTolerance;
447448 const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) > FloatEqualityTolerance;
448- if (passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
449+ if (passTrackSelection && passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
449450 fillSkimmedV0Table<IsCorrectedDeDx>(mother, dauTrack, collision, daughter.tpcNSigma , daughter.tofNSigma , daughter.tpcExpSignal , daughter.id , runnumber, daughter.dwnSmplFactor , hadronicRate);
450451 }
451452 };
@@ -458,9 +459,6 @@ struct TreeWriterTpcV0 {
458459 }
459460 const auto & posTrack = v0.posTrack_as <TrksType>();
460461 const auto & negTrack = v0.negTrack_as <TrksType>();
461- if (!(isTrackSelected (posTrack, trackSelection) && isTrackSelected (negTrack, trackSelection))) {
462- continue ;
463- }
464462
465463 const V0Mother v0Mother = createV0Mother (v0Id);
466464 const V0Daughter posDaughter = createV0Daughter<IsCorrectedDeDx>(v0, posTrack, v0Id, v0Mother.posDaughterId , true );
@@ -477,9 +475,6 @@ struct TreeWriterTpcV0 {
477475 continue ;
478476 }
479477 const auto & bachTrack = casc.bachelor_as <TrksType>();
480- if (!isTrackSelected (bachTrack, trackSelection)) {
481- continue ;
482- }
483478 const V0Daughter bachDaughter = createV0Daughter<IsCorrectedDeDx>(casc, bachTrack, cascId, DaughterKaon);
484479 // Omega and antiomega
485480 fillDaughterTrack (casc, bachTrack, bachDaughter);
@@ -536,10 +531,11 @@ struct TreeWriterTpcV0 {
536531 }
537532
538533 auto fillDaughterTrack = [&](const auto & mother, const TrksType::iterator& dauTrack, const V0Daughter& daughter, const aod::TracksQA& trackQAInstance, const bool existTrkQA) {
534+ const bool passTrackSelection = isTrackSelected (dauTrack, trackSelection);
539535 const bool passDownsamplig = downsampleTsalisCharged (fRndm , dauTrack.pt (), daughter.downsamplingTsalis , daughter.mass , sqrtSNN, daughter.maxPt4dwnsmplTsalis );
540536 const bool passNSigmaTofCut = std::fabs (daughter.tofNSigma ) < daughter.nSigmaTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) < FloatEqualityTolerance;
541537 const bool passMatchTofRequirement = !daughter.rejectNoTofDauTrack || std::fabs (daughter.tofNSigma - NSigmaTofUnmatched) > FloatEqualityTolerance;
542- if (passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
538+ if (passTrackSelection && passDownsamplig && passNSigmaTofCut && passMatchTofRequirement) {
543539 fillSkimmedV0TableWithTrQAGeneric<IsCorrectedDeDx, IsWithdEdx>(mother, dauTrack, trackQAInstance, existTrkQA, collision, daughter.tpcNSigma , daughter.tofNSigma , daughter.tpcExpSignal , daughter.id , runnumber, daughter.dwnSmplFactor , hadronicRate, bcGlobalIndex, bcTimeFrameId, bcBcInTimeFrame);
544540 }
545541 };
@@ -562,9 +558,6 @@ struct TreeWriterTpcV0 {
562558 }
563559 const auto & posTrack = v0.posTrack_as <TrksType>();
564560 const auto & negTrack = v0.negTrack_as <TrksType>();
565- if (!(isTrackSelected (posTrack, trackSelection) && isTrackSelected (negTrack, trackSelection))) {
566- continue ;
567- }
568561
569562 const auto & [posTrackQA, existPosTrkQA] = getTrackQA (posTrack);
570563 const auto & [negTrackQA, existNegTrkQA] = getTrackQA (negTrack);
@@ -584,9 +577,6 @@ struct TreeWriterTpcV0 {
584577 continue ;
585578 }
586579 const auto & bachTrack = casc.bachelor_as <TrksType>();
587- if (!isTrackSelected (bachTrack, trackSelection)) {
588- continue ;
589- }
590580 const V0Daughter bachDaughter = createV0Daughter<IsCorrectedDeDx>(casc, bachTrack, cascId, DaughterKaon);
591581 const auto & [bachTrackQA, existBachTrkQA] = getTrackQA (bachTrack);
592582 // Omega and antiomega
0 commit comments