2222#include " PWGLF/Utils/decay3bodyBuilderHelper.h"
2323#include " PWGLF/Utils/pidTOFGeneric.h"
2424
25+ #include " Common/CCDB/EventSelectionParams.h"
2526#include " Common/Core/MetadataHelper.h"
2627#include " Common/Core/PID/PIDTOF.h"
2728#include " Common/Core/RecoDecay.h"
@@ -112,6 +113,8 @@ struct TrackedHypertritonRecoTask {
112113
113114 Configurable<bool > requireSel8{" requireSel8" , true , " Require the standard sel8 event selection" };
114115 Configurable<float > maxAbsZvtx{" maxAbsZvtx" , 10 .f , " Maximum absolute primary-vertex z; negative disables the cut" };
116+ Configurable<bool > requireNoSameBunchPileup{" requireNoSameBunchPileup" , false , " Reject collisions which are associated with the same found-by-T0 bunch crossing" };
117+ Configurable<bool > requireIsGoodZvtxFT0vsPV{" requireIsGoodZvtxFT0vsPV" , false , " Verifies the consistency between the primary vertex z position from tracking and the z position of the PV from FT0 timing" };
115118 Configurable<bool > skimmedProcessing{" skimmedProcessing" , false , " Enable Zorro accounting and trigger selection for skimmed data" };
116119 Configurable<std::string> zorroCCDBPath{" zorroCCDBPath" , " EventFiltering/Zorro/" , " Base path of the Zorro CCDB objects" };
117120 Configurable<int > zorroBCTolerance{" zorroBCTolerance" , 100 , " Zorro BC matching tolerance" };
@@ -311,10 +314,13 @@ struct TrackedHypertritonRecoTask {
311314 selections.minCosPA = threeBody.minCosPA ;
312315 selections.maxChi2 = threeBody.maxChi2 ;
313316
314- registry.add (" events" , " Event selection;selection;events" , HistType::kTH1D , {{2 , -0.5 , 1 .5 }});
317+ registry.add (" events" , " Event selection;selection;events" , HistType::kTH1D , {{5 , -0.5 , 4 .5 }});
315318 auto events = registry.get <TH1 >(HIST (" events" ));
316319 events->GetXaxis ()->SetBinLabel (1 , " all" );
317- events->GetXaxis ()->SetBinLabel (2 , " selected" );
320+ events->GetXaxis ()->SetBinLabel (2 , " sel8" );
321+ events->GetXaxis ()->SetBinLabel (3 , " z_{vtx}" );
322+ events->GetXaxis ()->SetBinLabel (4 , " kNoSameBunchPileup" );
323+ events->GetXaxis ()->SetBinLabel (5 , " kIsGoodZvtxFT0vsPV" );
318324 registry.add (" zorroEvents" , " Zorro accounting;trigger;selection" , HistType::kTH2D ,
319325 {{2 , -0.5 , 1.5 }, {2 , -0.5 , 1.5 }});
320326 auto zorroEvents = registry.get <TH2 >(HIST (" zorroEvents" ));
@@ -323,6 +329,13 @@ struct TrackedHypertritonRecoTask {
323329 zorroEvents->GetYaxis ()->SetBinLabel (1 , " before sel8" );
324330 zorroEvents->GetYaxis ()->SetBinLabel (2 , " after sel8" );
325331
332+ if (doprocessMC) {
333+ auto hMcEventCounter = registry.add <TH1 >(" hMcEventCounter" , " hMcEventCounter; Selection; Counts" , HistType::kTH1D , {{2 , 0 .0f , 2 .0f }});
334+ hMcEventCounter->GetXaxis ()->SetBinLabel (1 , " all" );
335+ hMcEventCounter->GetXaxis ()->SetBinLabel (2 , " reconstructed" );
336+ hMcEventCounter->LabelsOption (" v" );
337+ }
338+
326339 registry.add (" hTrackProtonTPCSignal" , " hTrackProtonTPCSignal" , HistType::kTH2F , {{100 , -10 .0f , 10 .0f , " p/z (GeV/c)" }, {2000 , 0 .0f , 2000 .0f , " d#it{E}/d#it{x}" }});
327340 registry.add (" hTrackPionTPCSignal" , " hTrackPionTPCSignal" , HistType::kTH2F , {{100 , -10 .0f , 10 .0f , " p/z (GeV/c)" }, {2000 , 0 .0f , 2000 .0f , " d#it{E}/d#it{x}" }});
328341 registry.add (" hTrackDeuteronTPCSignal" , " hTrackDeuteronTPCSignal" , HistType::kTH2F , {{100 , -10 .0f , 10 .0f , " p/z (GeV/c)" }, {2000 , 0 .0f , 2000 .0f , " d#it{E}/d#it{x}" }});
@@ -387,11 +400,21 @@ struct TrackedHypertritonRecoTask {
387400 if (requireSel8 && !collision.sel8 ()) {
388401 continue ;
389402 }
403+ registry.fill (HIST (" events" ), 1 .);
390404 if (maxAbsZvtx >= 0 .f && std::abs (collision.posZ ()) > maxAbsZvtx) {
391405 continue ;
392406 }
407+ registry.fill (HIST (" events" ), 2 .);
408+ if (requireNoSameBunchPileup && !collision.selection_bit (o2::aod::evsel::kNoSameBunchPileup )) {
409+ continue ;
410+ }
411+ registry.fill (HIST (" events" ), 3 .);
412+ if (requireIsGoodZvtxFT0vsPV && !collision.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV )) {
413+ continue ;
414+ }
415+ registry.fill (HIST (" events" ), 4 .);
416+
393417 goodCollision[collision.globalIndex ()] = true ;
394- registry.fill (HIST (" events" ), 1 .);
395418 if (applyZorro) {
396419 for (size_t i = 0 ; i < kNZorroTriggers ; ++i) {
397420 if (zorroDecision[collision.globalIndex ()][i]) {
@@ -992,6 +1015,14 @@ struct TrackedHypertritonRecoTask {
9921015 aod::BCsWithTimestamps const &,
9931016 aod::McParticles const & mcParticles)
9941017 {
1018+ // MC collision counting for event loss and MC closure
1019+ registry.fill (HIST (" hMcEventCounter" ), 0.5 , mcCollisions.size ());
1020+ for (const auto & collision : collisions) {
1021+ if (collision.has_mcCollision ()) {
1022+ registry.fill (HIST (" hMcEventCounter" ), 1.5 );
1023+ }
1024+ }
1025+
9951026 selectCollisions (collisions, false );
9961027 prepareMCEventInformation (collisions, mcCollisions);
9971028 std::vector<bool > reconstructedTwoBody (mcParticles.size (), false );
0 commit comments