@@ -45,11 +45,20 @@ using namespace o2;
4545using namespace o2 ::framework;
4646using namespace o2 ::framework::expressions;
4747using std::array;
48+ using namespace o2 ::aod::rctsel;
4849
4950struct LfTaskLambdaSpinCorr {
5051
5152 Service<o2::ccdb::BasicCCDBManager> ccdb;
53+
54+ struct : ConfigurableGroup {
55+ Configurable<bool > requireRCTFlagChecker{" requireRCTFlagChecker" , true , " Check event quality in run condition table" };
56+ Configurable<std::string> cfgEvtRCTFlagCheckerLabel{" cfgEvtRCTFlagCheckerLabel" , " CBT_hadronPID" , " Evt sel: RCT flag checker label" };
57+ Configurable<bool > cfgEvtRCTFlagCheckerZDCCheck{" cfgEvtRCTFlagCheckerZDCCheck" , false , " Evt sel: RCT flag checker ZDC check" };
58+ Configurable<bool > cfgEvtRCTFlagCheckerLimitAcceptAsBad{" cfgEvtRCTFlagCheckerLimitAcceptAsBad" , true , " Evt sel: RCT flag checker treat Limited Acceptance As Bad" };
59+ } rctCut;
5260 // mixing
61+ Configurable<int > cfgCutOccupancy{" cfgCutOccupancy" , 2000 , " Occupancy cut" };
5362 ConfigurableAxis axisVertex{" axisVertex" , {5 , -10 , 10 }, " vertex axis for bin" };
5463 ConfigurableAxis axisMultiplicityClass{" axisMultiplicityClass" , {8 , 0 , 80 }, " multiplicity percentile for bin" };
5564 Configurable<int > nMix{" nMix" , 5 , " number of event mixing" };
@@ -59,6 +68,8 @@ struct LfTaskLambdaSpinCorr {
5968 // fill output
6069 Configurable<bool > additionalEvSel{" additionalEvSel" , false , " additionalEvSel" };
6170 Configurable<bool > additionalEvSel3{" additionalEvSel3" , false , " additionalEvSel3" };
71+ Configurable<bool > additionalEvSel4{" additionalEvSel4" , false , " additionalEvSel4" };
72+ Configurable<bool > additionalEvSel5{" additionalEvSel5" , false , " additionalEvSel5" };
6273 Configurable<bool > fillGEN{" fillGEN" , false , " filling generated histograms" };
6374 Configurable<bool > fillQA{" fillQA" , false , " filling QA histograms" };
6475
@@ -103,14 +114,14 @@ struct LfTaskLambdaSpinCorr {
103114 ConfigurableAxis configthnAxisPol{" configthnAxisPol" , {VARIABLE_WIDTH, -1.0 , -0.6 , -0.2 , 0 , 0.2 , 0.4 , 0.8 }, " Pol" };
104115
105116 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
106-
117+ RCTFlagsChecker rctChecker;
107118 void init (o2::framework::InitContext&)
108119 {
120+ rctChecker.init (rctCut.cfgEvtRCTFlagCheckerLabel , rctCut.cfgEvtRCTFlagCheckerZDCCheck , rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad );
109121 AxisSpec thnAxisInvMass{iMNbins, lbinIM, hbinIM, " #it{M} (GeV/#it{c}^{2})" };
110122 AxisSpec thnAxisInvMasspair{iMNbinspair, lbinIMpair, hbinIMpair, " #it{M} (GeV/#it{c}^{2})" };
111-
123+ histos. add ( " hEvtSelInfo " , " hEvtSelInfo " , kTH1F , {{ 10 , 0 , 10.0 }});
112124 histos.add (" hCentrality" , " Centrality distribution" , kTH1F , {{configcentAxis}});
113-
114125 histos.add (" hSparseLambdaLambda" , " hSparseLambdaLambda" , HistType::kTHnSparseF , {thnAxisInvMass, thnAxisInvMass, configthnAxisPol, configcentAxis, thnAxisInvMasspair}, true );
115126 histos.add (" hSparseLambdaAntiLambda" , " hSparseLambdaAntiLambda" , HistType::kTHnSparseF , {thnAxisInvMass, thnAxisInvMass, configthnAxisPol, configcentAxis, thnAxisInvMasspair}, true );
116127 histos.add (" hSparseAntiLambdaAntiLambda" , " hSparseAntiLambdaAntiLambda" , HistType::kTHnSparseF , {thnAxisInvMass, thnAxisInvMass, configthnAxisPol, configcentAxis, thnAxisInvMasspair}, true );
@@ -237,8 +248,10 @@ struct LfTaskLambdaSpinCorr {
237248 double centrality, int datatype)
238249 {
239250
240- auto particle1Dummy = ROOT::Math::PxPyPzMVector (particle1.Px (), particle1.Py (), particle1.Pz (), 1.115683 );
241- auto particle2Dummy = ROOT::Math::PxPyPzMVector (particle2.Px (), particle2.Py (), particle2.Pz (), 1.115683 );
251+ // auto particle1Dummy = ROOT::Math::PxPyPzMVector(particle1.Px(), particle1.Py(), particle1.Pz(), 1.115683);
252+ // auto particle2Dummy = ROOT::Math::PxPyPzMVector(particle2.Px(), particle2.Py(), particle2.Pz(), 1.115683);
253+ auto particle1Dummy = ROOT::Math::PxPyPzMVector (particle1.Px (), particle1.Py (), particle1.Pz (), particle1.M ());
254+ auto particle2Dummy = ROOT::Math::PxPyPzMVector (particle2.Px (), particle2.Py (), particle2.Pz (), particle2.M ());
242255 auto pairDummy = particle1Dummy + particle2Dummy;
243256
244257 // auto pairParticle = particle1 + particle2;
@@ -395,17 +408,37 @@ struct LfTaskLambdaSpinCorr {
395408
396409 void processData (EventCandidates::iterator const & collision, AllTrackCandidates const & /* tracks*/ , ResoV0s const & V0s)
397410 {
411+ histos.fill (HIST (" hEvtSelInfo" ), 0.5 );
412+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision)) {
413+ return ;
414+ }
415+ histos.fill (HIST (" hEvtSelInfo" ), 1.5 );
398416 if (!collision.sel8 ()) {
399417 return ;
400418 }
419+ histos.fill (HIST (" hEvtSelInfo" ), 2.5 );
401420 auto centrality = collision.centFT0C ();
421+ int occupancy = collision.trackOccupancyInTimeRange ();
402422 if (additionalEvSel && (!collision.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
403423 return ;
404424 }
405-
425+ histos. fill ( HIST ( " hEvtSelInfo " ), 3.5 );
406426 if (additionalEvSel3 && (!collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
407427 return ;
408428 }
429+ histos.fill (HIST (" hEvtSelInfo" ), 4.5 );
430+ if (additionalEvSel4 && !collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
431+ return ;
432+ }
433+ histos.fill (HIST (" hEvtSelInfo" ), 5.5 );
434+ if (additionalEvSel5 && !collision.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
435+ return ;
436+ }
437+ histos.fill (HIST (" hEvtSelInfo" ), 6.5 );
438+ if (occupancy > cfgCutOccupancy) {
439+ return ;
440+ }
441+ histos.fill (HIST (" hEvtSelInfo" ), 7.5 );
409442 histos.fill (HIST (" hCentrality" ), centrality);
410443 for (const auto & v0 : V0s) {
411444 auto [lambdaTag, aLambdaTag, isValid] = getLambdaTags (v0, collision);
@@ -482,6 +515,14 @@ struct LfTaskLambdaSpinCorr {
482515 {
483516 for (auto & [collision1, collision2] : selfCombinations (colBinning, nMix, -1 , collisions, collisions)) {
484517 // LOGF(info, "Mixed event collisions: (%d, %d)", collision1.index(), collision2.index());
518+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision1)) {
519+ continue ;
520+ }
521+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision2)) {
522+ continue ;
523+ }
524+ int occupancy1 = collision1.trackOccupancyInTimeRange ();
525+ int occupancy2 = collision2.trackOccupancyInTimeRange ();
485526
486527 if (collision1.index () == collision2.index ()) {
487528 continue ;
@@ -492,15 +533,36 @@ struct LfTaskLambdaSpinCorr {
492533 if (additionalEvSel && (!collision1.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision1.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
493534 continue ;
494535 }
495- if (additionalEvSel3 && (!collision1. selection_bit (aod::evsel:: kNoTimeFrameBorder ) || !collision1. selection_bit (aod::evsel:: kNoITSROFrameBorder )) ) {
536+ if (occupancy1 > cfgCutOccupancy ) {
496537 continue ;
497538 }
498539 if (additionalEvSel && (!collision2.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision2.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
499540 continue ;
500541 }
542+ if (occupancy2 > cfgCutOccupancy) {
543+ continue ;
544+ }
545+
546+ if (additionalEvSel3 && (!collision1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision1.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
547+ continue ;
548+ }
549+ if (additionalEvSel4 && !collision1.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
550+ continue ;
551+ }
552+ if (additionalEvSel5 && !collision1.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
553+ continue ;
554+ }
555+
501556 if (additionalEvSel3 && (!collision2.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision2.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
502557 continue ;
503558 }
559+ if (additionalEvSel4 && !collision2.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
560+ continue ;
561+ }
562+ if (additionalEvSel5 && !collision2.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
563+ continue ;
564+ }
565+
504566 auto centrality = collision1.centFT0C ();
505567 auto groupV01 = V0s.sliceBy (tracksPerCollisionV0, collision1.globalIndex ());
506568 auto groupV02 = V0s.sliceBy (tracksPerCollisionV0, collision1.globalIndex ());
0 commit comments