1919#include " PWGLF/DataModel/LFStrangenessTables.h"
2020
2121#include " Common/CCDB/EventSelectionParams.h"
22+ #include " Common/CCDB/RCTSelectionFlags.h"
2223#include " Common/Core/RecoDecay.h"
2324
2425#include < CCDB/BasicCCDBManager.h>
@@ -48,6 +49,8 @@ using namespace o2::framework::expressions;
4849using namespace o2 ::constants::math;
4950using namespace o2 ::constants::physics;
5051
52+ using namespace o2 ::aod::rctsel;
53+
5154using SelCollisions = soa::Join<aod::StraCollisions, aod::StraEvSels, aod::StraCents, aod::StraStamps>;
5255using SimCollisions = soa::Join<aod::StraCollisions, aod::StraEvSels, aod::StraCents, aod::StraStamps, aod::StraCollLabels>;
5356using CascadeCandidates = soa::Join<aod::CascCollRefs, aod::CascCores, aod::CascExtras, aod::CascTOFPIDs, aod::CascTOFNSigmas>;
@@ -72,7 +75,7 @@ struct CascadeAnalysisLightIonsDerivedData {
7275
7376 o2::ccdb::CcdbApi ccdbApi;
7477 Service<o2::ccdb::BasicCCDBManager> ccdb;
75- int mRunNumber ;
78+ int mRunNumber {- 1 } ;
7679
7780 // Define histogram registries
7881 HistogramRegistry registryData{" registryData" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
@@ -137,6 +140,15 @@ struct CascadeAnalysisLightIonsDerivedData {
137140 ConfigurableAxis axisNch{" axisNch" , {500 , 0 .0f , +5000 .0f }, " Number of charged particles" };
138141 ConfigurableAxis axisMult{" axisMult" , {500 , 0 .0f , +100000 .0f }, " Multiplicity" };
139142
143+ struct : ConfigurableGroup {
144+ std::string prefix = " rctConfigurations" ; // JSON group name
145+ Configurable<std::string> cfgRCTLabel{" cfgRCTLabel" , " " , " Which detector condition requirements? (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)" };
146+ Configurable<bool > cfgCheckZDC{" cfgCheckZDC" , false , " Include ZDC flags in the bit selection (for Pb-Pb only)" };
147+ Configurable<bool > cfgTreatLimitedAcceptanceAsBad{" cfgTreatLimitedAcceptanceAsBad" , false , " reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance" };
148+ } rctConfigurations;
149+
150+ RCTFlagsChecker rctFlagsChecker{rctConfigurations.cfgRCTLabel .value };
151+
140152 // Centrality estimator
141153 Configurable<int > centralityEstimator{" centralityEstimator" , 0 , " 0 = FT0C, 1 = FTOM, 2 = FV0A, 3 = NGlobal" };
142154
@@ -172,6 +184,9 @@ struct CascadeAnalysisLightIonsDerivedData {
172184 const AxisSpec nsigmaTOFAxis{200 , -10 , 10 , " n#sigma_{TOF}" };
173185 const AxisSpec nsigmaTPCAxis{200 , -10 , 10 , " n#sigma_{TPC}" };
174186
187+ // Initialise the RCTFlagsChecker
188+ rctFlagsChecker.init (rctConfigurations.cfgRCTLabel .value , rctConfigurations.cfgCheckZDC , rctConfigurations.cfgTreatLimitedAcceptanceAsBad );
189+
175190 // Histograms for data
176191 if (doprocessData) {
177192 registryData.add (" number_of_events_data" , " number of events in data" , HistType::kTH1D , {{20 , -0 .5f , +19 .5f }});
@@ -185,7 +200,8 @@ struct CascadeAnalysisLightIonsDerivedData {
185200 registryData.get <TH1 >(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
186201 registryData.get <TH1 >(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
187202 registryData.get <TH1 >(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
188- registryData.get <TH1 >(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
203+ registryData.get <TH1 >(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (11 , " RCT flags" );
204+ registryData.get <TH1 >(HIST (" number_of_events_data" ))->GetXaxis ()->SetBinLabel (12 , " kINELgr0" );
189205
190206 registryData.add (" number_of_events_data_vs_centrality" , " number of events in data vs centrality" , HistType::kTH2D , {{20 , -0 .5f , +19 .5f }, {101 , 0 .0f , 101 .0f }});
191207 registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
@@ -198,7 +214,8 @@ struct CascadeAnalysisLightIonsDerivedData {
198214 registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
199215 registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
200216 registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
201- registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
217+ registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (11 , " RCT flags" );
218+ registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetXaxis ()->SetBinLabel (12 , " kINELgr0" );
202219 registryData.get <TH2 >(HIST (" number_of_events_data_vs_centrality" ))->GetYaxis ()->SetTitle (" Centrality (%)" );
203220
204221 // QC Histograms
@@ -248,7 +265,8 @@ struct CascadeAnalysisLightIonsDerivedData {
248265 registryMC.get <TH1 >(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
249266 registryMC.get <TH1 >(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
250267 registryMC.get <TH1 >(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
251- registryMC.get <TH1 >(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
268+ registryMC.get <TH1 >(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (11 , " RCT flags" );
269+ registryMC.get <TH1 >(HIST (" number_of_events_mc_rec" ))->GetXaxis ()->SetBinLabel (12 , " kINELgr0" );
252270
253271 registryMC.add (" number_of_events_mc_rec_vs_centrality" , " number of events in mc_rec vs centrality" , HistType::kTH2D , {{20 , -0 .5f , +19 .5f }, {101 , 0 .0f , 101 .0f }});
254272 registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
@@ -261,7 +279,8 @@ struct CascadeAnalysisLightIonsDerivedData {
261279 registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (8 , " kIsVertexTOFmatched" );
262280 registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (9 , " kIsVertexTRDmatched" );
263281 registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (10 , " kNoSameBunchPileup" );
264- registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (11 , " kINELgr0" );
282+ registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (11 , " RCT flags" );
283+ registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetXaxis ()->SetBinLabel (12 , " kINELgr0" );
265284 registryMC.get <TH2 >(HIST (" number_of_events_mc_rec_vs_centrality" ))->GetYaxis ()->SetTitle (" Centrality (%)" );
266285
267286 // QC Histograms
@@ -836,12 +855,18 @@ struct CascadeAnalysisLightIonsDerivedData {
836855 registryData.fill (HIST (" number_of_events_data" ), 9 /* Not at same bunch pile-up */ );
837856 registryData.fill (HIST (" number_of_events_data_vs_centrality" ), 9 , centrality);
838857
839- if (requireInel0 && collision. multNTracksPVeta1 () < 1 ) {
858+ if (!rctConfigurations. cfgRCTLabel . value . empty () && ! rctFlagsChecker (collision) ) {
840859 return ;
841860 }
842- registryData.fill (HIST (" number_of_events_data" ), 10 /* INEL > 0 */ );
861+ registryData.fill (HIST (" number_of_events_data" ), 10 /* Pass CBT condition */ );
843862 registryData.fill (HIST (" number_of_events_data_vs_centrality" ), 10 , centrality);
844863
864+ if (requireInel0 && collision.multNTracksPVeta1 () < 1 ) {
865+ return ;
866+ }
867+ registryData.fill (HIST (" number_of_events_data" ), 11 /* INEL > 0 */ );
868+ registryData.fill (HIST (" number_of_events_data_vs_centrality" ), 11 , centrality);
869+
845870 // Store the Zvtx
846871 registryQC.fill (HIST (" hVertexZdata" ), collision.posZ ());
847872
@@ -985,12 +1010,18 @@ struct CascadeAnalysisLightIonsDerivedData {
9851010 registryMC.fill (HIST (" number_of_events_mc_rec" ), 9 /* Not at same bunch pile-up */ );
9861011 registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 9 , centralityMcRec);
9871012
988- if (requireInel0 && RecCol. multNTracksPVeta1 () < 1 ) {
1013+ if (!rctConfigurations. cfgRCTLabel . value . empty () && ! rctFlagsChecker (RecCol) ) {
9891014 return ;
9901015 }
991- registryMC.fill (HIST (" number_of_events_mc_rec" ), 10 /* INEL > 0 */ );
1016+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 10 /* Pass CBT condition */ );
9921017 registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 10 , centralityMcRec);
9931018
1019+ if (requireInel0 && RecCol.multNTracksPVeta1 () < 1 ) {
1020+ return ;
1021+ }
1022+ registryMC.fill (HIST (" number_of_events_mc_rec" ), 11 /* INEL > 0 */ );
1023+ registryMC.fill (HIST (" number_of_events_mc_rec_vs_centrality" ), 11 , centralityMcRec);
1024+
9941025 // Store the Zvtx
9951026 registryQC.fill (HIST (" hVertexZRec" ), RecCol.posZ ());
9961027
@@ -1061,7 +1092,7 @@ struct CascadeAnalysisLightIonsDerivedData {
10611092 bool isTrueMCCascadeDecay = false ;
10621093 bool isCorrectLambdaDecay = false ;
10631094
1064- if (isPhysPrim && ( isXiMC || isOmegaMC) )
1095+ if (isXiMC || isOmegaMC)
10651096 isTrueMCCascade = true ;
10661097 if (isTrueMCCascade && ((casc.sign () > 0 && cascMC.pdgCodePositive () == PDG_t::kPiPlus && cascMC.pdgCodeNegative () == PDG_t::kProtonBar ) || (casc.sign () < 0 && cascMC.pdgCodePositive () == PDG_t::kProton && cascMC.pdgCodeNegative () == PDG_t::kPiMinus )))
10671098 isCorrectLambdaDecay = true ;
0 commit comments