3737#include " CCDB/BasicCCDBManager.h"
3838#include " DCAFitter/DCAFitterN.h"
3939#include " PWGLF/DataModel/pidTOFGeneric.h"
40+ #include " PWGLF/DataModel/LFStrangenessTables.h"
4041#include " Common/Core/PID/PIDTOF.h"
4142
4243using namespace o2 ;
@@ -47,8 +48,6 @@ namespace
4748{
4849
4950static constexpr int nNuclei{3 };
50- static constexpr int nHyperNuclei{1 };
51- static constexpr int nITStriggers{2 };
5251static constexpr int nCutsPID{5 };
5352static constexpr std::array<float , nNuclei> masses{
5453 constants::physics::MassDeuteron, constants::physics::MassTriton,
@@ -57,7 +56,7 @@ static constexpr std::array<int, nNuclei> charges{1, 1, 2};
5756static const std::vector<std::string> matterOrNot{" Matter" , " Antimatter" };
5857static const std::vector<std::string> nucleiNames{" H2" , " H3" , " Helium" };
5958static const std::vector<std::string> hypernucleiNames{" H3L" }; // 3-body decay case
60- static const std::vector<std::string> columnsNames{o2::aod::filtering::H2::columnLabel (), " fH3 " , o2::aod::filtering::He ::columnLabel (), o2::aod::filtering::H3L3Body::columnLabel (), o2::aod::filtering::ITSmildIonisation::columnLabel (), o2::aod::filtering::ITSextremeIonisation::columnLabel ()};
59+ static const std::vector<std::string> columnsNames{o2::aod::filtering::H2::columnLabel (), o2::aod::filtering::He::columnLabel () , o2::aod::filtering::HeV0 ::columnLabel (), o2::aod::filtering::H3L3Body::columnLabel (), o2::aod::filtering::Tracked3Body ::columnLabel (), o2::aod::filtering::ITSmildIonisation::columnLabel (), o2::aod::filtering::ITSextremeIonisation::columnLabel ()};
6160static const std::vector<std::string> cutsNames{
6261 " TPCnSigmaMin" , " TPCnSigmaMax" , " TOFnSigmaMin" , " TOFnSigmaMax" , " TOFpidStartPt" };
6362constexpr double betheBlochDefault[nNuclei][6 ]{
@@ -160,9 +159,9 @@ struct nucleiFilter {
160159 } trgH3L3Body;
161160
162161 HistogramRegistry qaHists{" qaHists" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
163- OutputObj<TH1D> hProcessedEvents{TH1D (" hProcessedEvents" , " ;;Number of filtered events" , nNuclei + nHyperNuclei + nITStriggers + 1 , -0.5 , nNuclei + nHyperNuclei + nITStriggers + 0.5 )};
162+ OutputObj<TH1D> hProcessedEvents{TH1D (" hProcessedEvents" , " ;;Number of filtered events" , kNtriggers + 1 , -0.5 , kNtriggers + 0.5 )};
164163
165- void init (o2::framework:: InitContext&)
164+ void init (InitContext&)
166165 {
167166 std::vector<double > ptBinning = {0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 , 1.1 , 1.2 , 1.3 , 1.4 , 1.5 , 1.6 , 1.8 , 2.0 , 2.2 , 2.4 , 2.8 , 3.2 , 3.6 , 4 ., 5 .};
168167
@@ -313,26 +312,39 @@ struct nucleiFilter {
313312 bachelorTOFPID.SetParams (mRespParamsV2 );
314313 }
315314
315+ enum {
316+ kH2 = 0 ,
317+ kHe ,
318+ kHeV0 ,
319+ kH3L3Body ,
320+ kTracked3Body ,
321+ kITSmildIonisation ,
322+ kITSextremeIonisation ,
323+ kNtriggers
324+ } TriggerType;
316325 // void process(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, aod::Vtx3BodyDatas const& vtx3bodydatas, TrackCandidates const& tracks)
317326 using ColWithEvTime = soa::Join<aod::Collisions, aod::EvSels, aod::EvTimeTOFFT0>;
318- void process (ColWithEvTime::iterator const & collision, aod::Decay3Bodys const & decay3bodys, TrackCandidates const & tracks, aod::BCsWithTimestamps const &)
327+ void process (ColWithEvTime::iterator const & collision, aod::Decay3Bodys const & decay3bodys, TrackCandidates const & tracks, aod::AssignedTracked3Bodys const & tracked3Bodys, aod::V0s const & v0s, aod:: BCsWithTimestamps const &)
319328 {
320329 // collision process loop
321- bool keepEvent[nNuclei + nHyperNuclei + nITStriggers] {false };
330+ std::array< bool , kNtriggers > keepEvent {false };
322331 //
323332 qaHists.fill (HIST (" fCollZpos" ), collision.posZ ());
324333 hProcessedEvents->Fill (0 );
325334 //
326335 if (!collision.selection_bit (aod::evsel::kNoTimeFrameBorder )) {
327- tags (keepEvent[0 ], keepEvent[2 ], keepEvent[3 ], keepEvent[4 ], keepEvent[5 ]);
336+ tags (keepEvent[kH2 ], keepEvent[kHe ], keepEvent[kHeV0 ], keepEvent[kH3L3Body ], keepEvent[kTracked3Body ], keepEvent[ kITSmildIonisation ], keepEvent[ kITSextremeIonisation ]);
328337 return ;
329338 }
339+
330340 //
331341 const double bgScalings[nNuclei][2 ]{
332342 {charges[0 ] * cfgMomentumScalingBetheBloch->get (0u , 0u ) / masses[0 ], charges[0 ] * cfgMomentumScalingBetheBloch->get (0u , 1u ) / masses[0 ]},
333343 {charges[1 ] * cfgMomentumScalingBetheBloch->get (1u , 0u ) / masses[1 ], charges[1 ] * cfgMomentumScalingBetheBloch->get (1u , 1u ) / masses[1 ]},
334344 {charges[2 ] * cfgMomentumScalingBetheBloch->get (2u , 0u ) / masses[2 ], charges[2 ] * cfgMomentumScalingBetheBloch->get (2u , 1u ) / masses[2 ]}};
335345
346+ constexpr int nucleusIndex[nNuclei]{kH2 , -1 , kHe }; // / remap for nuclei triggers
347+ std::vector<int > he3indices;
336348 for (auto & track : tracks) { // start loop over tracks
337349 if (track.itsNCls () >= cfgCutNclusExtremeIonisationITS) {
338350 double avgClsSize{0 .};
@@ -342,8 +354,8 @@ struct nucleiFilter {
342354 }
343355 avgClsSize = avgClsSize * cosL / track.itsNCls ();
344356 qaHists.fill (HIST (" fExtremeIonisationITS" ), track.itsNCls (), avgClsSize, track.p ());
345- keepEvent[4 ] = track.p () > cfgMomentumCutExtremeIonisation && avgClsSize > cfgCutClsSizeMildIonisation;
346- keepEvent[5 ] = track.p () > cfgMomentumCutExtremeIonisation && avgClsSize > cfgCutClsSizeExtremeIonisation;
357+ keepEvent[kITSmildIonisation ] = track.p () > cfgMomentumCutExtremeIonisation && avgClsSize > cfgCutClsSizeMildIonisation;
358+ keepEvent[kITSextremeIonisation ] = track.p () > cfgMomentumCutExtremeIonisation && avgClsSize > cfgCutClsSizeExtremeIonisation;
347359 }
348360 if (track.itsNCls () < cfgCutNclusITS ||
349361 track.tpcNClsFound () < cfgCutNclusTPC) {
@@ -354,10 +366,8 @@ struct nucleiFilter {
354366 qaHists.fill (HIST (" fDeuTOFNsigma" ), track.p () * track.sign (), track.tofNSigmaDe ());
355367 }
356368
357- if (track.sign () > 0 && (std::abs (track.dcaXY ()) > cfgCutDCAxy ||
358- std::abs (track.dcaZ ()) > cfgCutDCAz)) {
359- continue ;
360- }
369+ bool passesDCAselection{(track.sign () < 0 || (std::abs (track.dcaXY ()) < cfgCutDCAxy &&
370+ std::abs (track.dcaZ ()) < cfgCutDCAz))};
361371
362372 float nSigmaTPC[nNuclei]{
363373 track.tpcNSigmaDe (), track.tpcNSigmaTr (), track.tpcNSigmaHe ()};
@@ -388,10 +398,28 @@ struct nucleiFilter {
388398 if (track.p () > cfgCutsPID->get (iN, 4u ) && (nSigmaTOF[iN] < cfgCutsPID->get (iN, 2u ) || nSigmaTOF[iN] > cfgCutsPID->get (iN, 3u ))) {
389399 continue ;
390400 }
391- keepEvent[iN] = true ;
392- if (keepEvent[iN]) {
401+ if (nucleusIndex[iN] < 0 ) {
402+ continue ;
403+ }
404+ keepEvent[nucleusIndex[iN]] = passesDCAselection;
405+ if (keepEvent[nucleusIndex[iN]]) {
393406 h2TPCsignal[iN]->Fill (track.sign () * track.tpcInnerParam () * fixTPCrigidity, track.tpcSignal ());
394407 }
408+ if (iN == 2 ) {
409+ he3indices.push_back (track.globalIndex ());
410+ }
411+ }
412+
413+ for (const auto & v0 : v0s) {
414+ for (const auto & he3 : he3indices) {
415+ if (v0.posTrackId () == he3 || v0.negTrackId () == he3) {
416+ keepEvent[kHeV0 ] = true ;
417+ break ;
418+ }
419+ }
420+ if (keepEvent[kHeV0 ]) {
421+ break ;
422+ }
395423 }
396424
397425 //
@@ -531,7 +559,7 @@ struct nucleiFilter {
531559 qaHists.fill (HIST (" fBachDeuTOFNsigma" ), track2.p () * track2.sign (), tofNSigmaDeuteron);
532560 qaHists.fill (HIST (" fH3LDcaVsPt" ), pt3B, dcaDaughters);
533561 qaHists.fill (HIST (" fH3LCosPAVsPt" ), pt3B, vtxCosPA);
534- keepEvent[3 ] = true ;
562+ keepEvent[kH3L3Body ] = true ;
535563 }
536564 }
537565 if (invmassAntiH3L >= trgH3L3Body.h3LMassLowerlimit && invmassAntiH3L <= trgH3L3Body.h3LMassUpperlimit ) {
@@ -541,17 +569,20 @@ struct nucleiFilter {
541569 qaHists.fill (HIST (" fBachDeuTOFNsigma" ), track2.p () * track2.sign (), tofNSigmaDeuteron);
542570 qaHists.fill (HIST (" fH3LDcaVsPt" ), pt3B, dcaDaughters);
543571 qaHists.fill (HIST (" fH3LCosPAVsPt" ), pt3B, vtxCosPA);
544- keepEvent[3 ] = true ;
572+ keepEvent[kH3L3Body ] = true ;
545573 }
546574 }
547575 }
548576
549- for (int iDecision{0 }; iDecision < nNuclei + nHyperNuclei + nITStriggers; ++iDecision) {
577+ keepEvent[kTracked3Body ] = tracked3Bodys.size () > 0 ;
578+
579+ for (int iDecision{0 }; iDecision < kNtriggers ; ++iDecision) {
550580 if (keepEvent[iDecision]) {
551581 hProcessedEvents->Fill (iDecision + 1 );
552582 }
553583 }
554- tags (keepEvent[0 ], keepEvent[2 ], keepEvent[3 ], keepEvent[4 ], keepEvent[5 ]);
584+
585+ tags (keepEvent[kH2 ], keepEvent[kHe ], keepEvent[kHeV0 ], keepEvent[kH3L3Body ], keepEvent[kTracked3Body ], keepEvent[kITSmildIonisation ], keepEvent[kITSextremeIonisation ]);
555586 }
556587};
557588
0 commit comments