1616
1717#include < fairlogger/Logger.h>
1818#include < tuple>
19+ #include < string>
1920#include " Math/Vector3D.h"
2021#include " Math/Vector4D.h"
2122#include " Math/GenVector/Boost.h"
@@ -45,11 +46,20 @@ using namespace o2;
4546using namespace o2 ::framework;
4647using namespace o2 ::framework::expressions;
4748using std::array;
49+ using namespace o2 ::aod::rctsel;
4850
4951struct LfTaskLambdaSpinCorr {
5052
5153 Service<o2::ccdb::BasicCCDBManager> ccdb;
54+
55+ struct : ConfigurableGroup {
56+ Configurable<bool > requireRCTFlagChecker{" requireRCTFlagChecker" , true , " Check event quality in run condition table" };
57+ Configurable<std::string> cfgEvtRCTFlagCheckerLabel{" cfgEvtRCTFlagCheckerLabel" , " CBT_hadronPID" , " Evt sel: RCT flag checker label" };
58+ Configurable<bool > cfgEvtRCTFlagCheckerZDCCheck{" cfgEvtRCTFlagCheckerZDCCheck" , false , " Evt sel: RCT flag checker ZDC check" };
59+ Configurable<bool > cfgEvtRCTFlagCheckerLimitAcceptAsBad{" cfgEvtRCTFlagCheckerLimitAcceptAsBad" , true , " Evt sel: RCT flag checker treat Limited Acceptance As Bad" };
60+ } rctCut;
5261 // mixing
62+ Configurable<int > cfgCutOccupancy{" cfgCutOccupancy" , 2000 , " Occupancy cut" };
5363 ConfigurableAxis axisVertex{" axisVertex" , {5 , -10 , 10 }, " vertex axis for bin" };
5464 ConfigurableAxis axisMultiplicityClass{" axisMultiplicityClass" , {8 , 0 , 80 }, " multiplicity percentile for bin" };
5565 Configurable<int > nMix{" nMix" , 5 , " number of event mixing" };
@@ -59,6 +69,8 @@ struct LfTaskLambdaSpinCorr {
5969 // fill output
6070 Configurable<bool > additionalEvSel{" additionalEvSel" , false , " additionalEvSel" };
6171 Configurable<bool > additionalEvSel3{" additionalEvSel3" , false , " additionalEvSel3" };
72+ Configurable<bool > additionalEvSel4{" additionalEvSel4" , false , " additionalEvSel4" };
73+ Configurable<bool > additionalEvSel5{" additionalEvSel5" , false , " additionalEvSel5" };
6274 Configurable<bool > fillGEN{" fillGEN" , false , " filling generated histograms" };
6375 Configurable<bool > fillQA{" fillQA" , false , " filling QA histograms" };
6476
@@ -103,14 +115,14 @@ struct LfTaskLambdaSpinCorr {
103115 ConfigurableAxis configthnAxisPol{" configthnAxisPol" , {VARIABLE_WIDTH, -1.0 , -0.6 , -0.2 , 0 , 0.2 , 0.4 , 0.8 }, " Pol" };
104116
105117 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
106-
118+ RCTFlagsChecker rctChecker;
107119 void init (o2::framework::InitContext&)
108120 {
121+ rctChecker.init (rctCut.cfgEvtRCTFlagCheckerLabel , rctCut.cfgEvtRCTFlagCheckerZDCCheck , rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad );
109122 AxisSpec thnAxisInvMass{iMNbins, lbinIM, hbinIM, " #it{M} (GeV/#it{c}^{2})" };
110123 AxisSpec thnAxisInvMasspair{iMNbinspair, lbinIMpair, hbinIMpair, " #it{M} (GeV/#it{c}^{2})" };
111-
124+ histos. add ( " hEvtSelInfo " , " hEvtSelInfo " , kTH1F , {{ 10 , 0 , 10.0 }});
112125 histos.add (" hCentrality" , " Centrality distribution" , kTH1F , {{configcentAxis}});
113-
114126 histos.add (" hSparseLambdaLambda" , " hSparseLambdaLambda" , HistType::kTHnSparseF , {thnAxisInvMass, thnAxisInvMass, configthnAxisPol, configcentAxis, thnAxisInvMasspair}, true );
115127 histos.add (" hSparseLambdaAntiLambda" , " hSparseLambdaAntiLambda" , HistType::kTHnSparseF , {thnAxisInvMass, thnAxisInvMass, configthnAxisPol, configcentAxis, thnAxisInvMasspair}, true );
116128 histos.add (" hSparseAntiLambdaAntiLambda" , " hSparseAntiLambdaAntiLambda" , HistType::kTHnSparseF , {thnAxisInvMass, thnAxisInvMass, configthnAxisPol, configcentAxis, thnAxisInvMasspair}, true );
@@ -237,8 +249,10 @@ struct LfTaskLambdaSpinCorr {
237249 double centrality, int datatype)
238250 {
239251
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 );
252+ // auto particle1Dummy = ROOT::Math::PxPyPzMVector(particle1.Px(), particle1.Py(), particle1.Pz(), 1.115683);
253+ // auto particle2Dummy = ROOT::Math::PxPyPzMVector(particle2.Px(), particle2.Py(), particle2.Pz(), 1.115683);
254+ auto particle1Dummy = ROOT::Math::PxPyPzMVector (particle1.Px (), particle1.Py (), particle1.Pz (), particle1.M ());
255+ auto particle2Dummy = ROOT::Math::PxPyPzMVector (particle2.Px (), particle2.Py (), particle2.Pz (), particle2.M ());
242256 auto pairDummy = particle1Dummy + particle2Dummy;
243257
244258 // auto pairParticle = particle1 + particle2;
@@ -395,17 +409,37 @@ struct LfTaskLambdaSpinCorr {
395409
396410 void processData (EventCandidates::iterator const & collision, AllTrackCandidates const & /* tracks*/ , ResoV0s const & V0s)
397411 {
412+ histos.fill (HIST (" hEvtSelInfo" ), 0.5 );
413+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision)) {
414+ return ;
415+ }
416+ histos.fill (HIST (" hEvtSelInfo" ), 1.5 );
398417 if (!collision.sel8 ()) {
399418 return ;
400419 }
420+ histos.fill (HIST (" hEvtSelInfo" ), 2.5 );
401421 auto centrality = collision.centFT0C ();
422+ int occupancy = collision.trackOccupancyInTimeRange ();
402423 if (additionalEvSel && (!collision.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
403424 return ;
404425 }
405-
426+ histos. fill ( HIST ( " hEvtSelInfo " ), 3.5 );
406427 if (additionalEvSel3 && (!collision.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
407428 return ;
408429 }
430+ histos.fill (HIST (" hEvtSelInfo" ), 4.5 );
431+ if (additionalEvSel4 && !collision.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
432+ return ;
433+ }
434+ histos.fill (HIST (" hEvtSelInfo" ), 5.5 );
435+ if (additionalEvSel5 && !collision.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
436+ return ;
437+ }
438+ histos.fill (HIST (" hEvtSelInfo" ), 6.5 );
439+ if (occupancy > cfgCutOccupancy) {
440+ return ;
441+ }
442+ histos.fill (HIST (" hEvtSelInfo" ), 7.5 );
409443 histos.fill (HIST (" hCentrality" ), centrality);
410444 for (const auto & v0 : V0s) {
411445 auto [lambdaTag, aLambdaTag, isValid] = getLambdaTags (v0, collision);
@@ -482,6 +516,14 @@ struct LfTaskLambdaSpinCorr {
482516 {
483517 for (auto & [collision1, collision2] : selfCombinations (colBinning, nMix, -1 , collisions, collisions)) {
484518 // LOGF(info, "Mixed event collisions: (%d, %d)", collision1.index(), collision2.index());
519+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision1)) {
520+ continue ;
521+ }
522+ if (rctCut.requireRCTFlagChecker && !rctChecker (collision2)) {
523+ continue ;
524+ }
525+ int occupancy1 = collision1.trackOccupancyInTimeRange ();
526+ int occupancy2 = collision2.trackOccupancyInTimeRange ();
485527
486528 if (collision1.index () == collision2.index ()) {
487529 continue ;
@@ -492,15 +534,36 @@ struct LfTaskLambdaSpinCorr {
492534 if (additionalEvSel && (!collision1.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision1.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
493535 continue ;
494536 }
495- if (additionalEvSel3 && (!collision1. selection_bit (aod::evsel:: kNoTimeFrameBorder ) || !collision1. selection_bit (aod::evsel:: kNoITSROFrameBorder )) ) {
537+ if (occupancy1 > cfgCutOccupancy ) {
496538 continue ;
497539 }
498540 if (additionalEvSel && (!collision2.selection_bit (aod::evsel::kNoSameBunchPileup ) || !collision2.selection_bit (aod::evsel::kIsGoodZvtxFT0vsPV ))) {
499541 continue ;
500542 }
543+ if (occupancy2 > cfgCutOccupancy) {
544+ continue ;
545+ }
546+
547+ if (additionalEvSel3 && (!collision1.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision1.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
548+ continue ;
549+ }
550+ if (additionalEvSel4 && !collision1.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
551+ continue ;
552+ }
553+ if (additionalEvSel5 && !collision1.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
554+ continue ;
555+ }
556+
501557 if (additionalEvSel3 && (!collision2.selection_bit (aod::evsel::kNoTimeFrameBorder ) || !collision2.selection_bit (aod::evsel::kNoITSROFrameBorder ))) {
502558 continue ;
503559 }
560+ if (additionalEvSel4 && !collision2.selection_bit (o2::aod::evsel::kNoCollInTimeRangeStandard )) {
561+ continue ;
562+ }
563+ if (additionalEvSel5 && !collision2.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll )) {
564+ continue ;
565+ }
566+
504567 auto centrality = collision1.centFT0C ();
505568 auto groupV01 = V0s.sliceBy (tracksPerCollisionV0, collision1.globalIndex ());
506569 auto groupV02 = V0s.sliceBy (tracksPerCollisionV0, collision1.globalIndex ());
0 commit comments