1717
1818#include " PWGLF/DataModel/EPCalibrationTables.h"
1919#include " PWGLF/DataModel/LFhe3HadronTables.h"
20+ #include " PWGLF/Utils/nucleiUtils.h"
2021#include " PWGLF/Utils/svPoolCreator.h"
2122
2223#include " Common/Core/PID/PIDTOF.h"
@@ -237,6 +238,7 @@ struct he3HadronFemto {
237238 Configurable<float > settingCutPtMinTOFHad{" settingCutPtMinTOFHad" , 0 .4f , " Minimum pT to apply the TOF cut on hadrons" };
238239 Configurable<float > settingCutNsigmaTOF{" settingCutNsigmaTOF" , 3 .0f , " Value of the TOF Nsigma cut" };
239240
241+ Configurable<LabeledArray<int >> settingEventSelections{" settingEventSelections" , {nuclei::EvSelDefault[0 ], 8 , 1 , nuclei::eventSelectionLabels, nuclei::eventSelectionTitle}, " Event selections" };
240242 Configurable<int > settingNoMixedEvents{" settingNoMixedEvents" , 5 , " Number of mixed events per event" };
241243 Configurable<bool > settingEnableBkgUS{" settingEnableBkgUS" , false , " Enable US background" };
242244 Configurable<bool > settingEnableDCAfitter{" settingEnableDCAfitter" , false , " Enable DCA fitter" };
@@ -295,13 +297,14 @@ struct he3HadronFemto {
295297 HistogramRegistry mQaRegistry {
296298 " QA" ,
297299 {
300+ {" hEventSelections" , " Event selections; Selection step; Counts" , {HistType::kTH1D , {{nuclei::evSel::kNevSels + 1 , -0 .5f , static_cast <float >(nuclei::evSel::kNevSels ) + 0 .5f }}}},
301+ {" hEvents" , " Number of events processed;Counts" , {HistType::kTH1F , {{1 , -0 .5f , 2 .5f }}}},
298302 {" hVtxZBefore" , " Vertex distribution in Z before selections;Z (cm)" , {HistType::kTH1F , {{400 , -20.0 , 20.0 }}}},
299303 {" hVtxZ" , " Vertex distribution in Z;Z (cm)" , {HistType::kTH1F , {{400 , -20.0 , 20.0 }}}},
300304 {" hCentralityFT0A" , " ;Centrality FT0A (%)" , {HistType::kTH1F , {{100 , 0 , 100.0 }}}},
301305 {" hCentralityFT0C" , " ;Centrality FT0C (%)" , {HistType::kTH1F , {{100 , 0 , 100.0 }}}},
302306 {" hNcontributor" , " Number of primary vertex contributor" , {HistType::kTH1F , {{2000 , 0 .0f , 2000 .0f }}}},
303307 {" hTrackSel" , " Accepted tracks" , {HistType::kTH1F , {{Selections::kAll , -0.5 , static_cast <double >(Selections::kAll ) - 0.5 }}}},
304- {" hEvents" , " ; Events;" , {HistType::kTH1F , {{3 , -0.5 , 2.5 }}}},
305308 {" hEmptyPool" , " svPoolCreator did not find track pairs false/true" , {HistType::kTH1F , {{2 , -0.5 , 1.5 }}}},
306309 {" hhe3HadtInvMass" , " ; M(^{3}He + p) (GeV/#it{c}^{2})" , {HistType::kTH1F , {{300 , 3 .74f , 4 .34f }}}},
307310
@@ -319,16 +322,16 @@ struct he3HadronFemto {
319322 {" Had/hNClsHadITS" , " had;N_{ITS} Cluster" , {HistType::kTH1F , {{20 , -10 .0f , 10 .0f }}}},
320323 {" Had/hChi2NClHadITS" , " had;Chi2_{ITS} Ncluster" , {HistType::kTH1F , {{100 , 0 , 100 .0f }}}},
321324 {" Had/hHadronPt" , " had; #it{p}_{T} (GeV/#it{c})" , {HistType::kTH1F , {{120 , -3 .0f , 3 .0f }}}},
322- {" Had/h2NsigmaHadronITS" , " NsigmaHadron ITS distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{ITS}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {200 , -5 .0f , 5 .0f }}}},
323- {" Had/h2NsigmaHadronITS_preselection" , " NsigmaHadron ITS distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
324- {" Had/h2NsigmaHadronTPC" , " NsigmaHadron TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {200 , -5 .0f , 5 .0f }}}},
325- {" Had/h2NsigmaHadronTPC_preselection" , " NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
326- {" Had/h2NsigmaHadronTPC_mcBackground" , " NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
327- {" Had/h2NsigmaHadronTPC_mcSignal" , " NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
328- {" Had/h2NsigmaHadronTOF" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {200 , -5 .0f , 5 .0f }}}},
329- {" Had/h2NsigmaHadronTOF_preselection" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
330- {" Had/h2NsigmaHadronTOF_mcBackground" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
331- {" Had/h2NsigmaHadronTOF_mcSignal" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
325+ {" Had/h2NsigmaHadronITS" , " NsigmaHadron ITS distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{ITS}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {200 , -5 .0f , 5 .0f }}}},
326+ {" Had/h2NsigmaHadronITS_preselection" , " NsigmaHadron ITS distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{ITS}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
327+ {" Had/h2NsigmaHadronTPC" , " NsigmaHadron TPC distribution; #it{p}_{T}(GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {200 , -5 .0f , 5 .0f }}}},
328+ {" Had/h2NsigmaHadronTPC_preselection" , " NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
329+ {" Had/h2NsigmaHadronTPC_mcBackground" , " NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
330+ {" Had/h2NsigmaHadronTPC_mcSignal" , " NsigmaHadron TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
331+ {" Had/h2NsigmaHadronTOF" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {200 , -5 .0f , 5 .0f }}}},
332+ {" Had/h2NsigmaHadronTOF_preselection" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
333+ {" Had/h2NsigmaHadronTOF_mcBackground" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
334+ {" Had/h2NsigmaHadronTOF_mcSignal" , " NsigmaHadron TOF distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TOF}(had)" , {HistType::kTH2F , {{200 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }}}},
332335 },
333336 OutputObjHandlingPolicy::AnalysisObject,
334337 false ,
@@ -358,8 +361,14 @@ struct he3HadronFemto {
358361 if (settingSkipAmbiTracks) {
359362 mSvPoolCreator .setSkipAmbiTracks ();
360363 }
361- const int numberParticle = 5 ;
362- for (int i = 0 ; i < numberParticle; i++) {
364+
365+ mQaRegistry .get <TH1>(HIST (" hEventSelections" ))->GetXaxis ()->SetBinLabel (1 , " All" );
366+ for (int iSel = 1 ; iSel < nuclei::evSel::kNevSels + 1 ; iSel++) {
367+ mQaRegistry .get <TH1>(HIST (" hEventSelections" ))->GetXaxis ()->SetBinLabel (iSel + 1 , nuclei::eventSelectionLabels[iSel].c_str ());
368+ }
369+
370+ const int nBetheBlochParameters = 5 ;
371+ for (int i = 0 ; i < nBetheBlochParameters; i++) {
363372 mBBparamsHe [i] = settingBetheBlochParams->get (" He3" , Form (" p%i" , i));
364373 }
365374 mBBparamsHe [5 ] = settingBetheBlochParams->get (" He3" , " resolution" );
@@ -423,31 +432,22 @@ struct he3HadronFemto {
423432 bool selectCollision (const Tcollision& collision, const aod::BCsWithTimestamps&)
424433 {
425434 mQaRegistry .fill (HIST (" hEvents" ), 0 );
426- mQaRegistry .fill (HIST (" hVtxZBefore" ), collision.posZ ());
427435
428436 auto bc = collision.template bc_as <aod::BCsWithTimestamps>();
429437 initCCDB (bc);
430438
431- if constexpr (isMC) {
432- if (/* !collision.sel8() ||*/ std::abs (collision.posZ ()) > settingCutVertex) {
433- return false ;
434- }
435- } else {
436-
437- if (!collision.sel8 () || std::abs (collision.posZ ()) > settingCutVertex) {
438- return false ;
439- }
440- if (settingSkimmedProcessing) {
441- bool zorroSelected = mZorro .isSelected (collision.template bc_as <aod::BCsWithTimestamps>().globalBC ());
442- if (zorroSelected) {
443- mQaRegistry .fill (HIST (" hEvents" ), 2 );
444- }
439+ if (!nuclei::eventSelection (collision, mQaRegistry , settingEventSelections, settingCutVertex)) {
440+ return false ;
441+ }
442+ if (settingSkimmedProcessing) {
443+ bool zorroSelected = mZorro .isSelected (collision.template bc_as <aod::BCsWithTimestamps>().globalBC ());
444+ if (zorroSelected) {
445+ mQaRegistry .fill (HIST (" hEvents" ), 2 );
445446 }
446447 }
447448
448449 mQaRegistry .fill (HIST (" hEvents" ), 1 );
449450 mQaRegistry .fill (HIST (" hNcontributor" ), collision.numContrib ());
450- mQaRegistry .fill (HIST (" hVtxZ" ), collision.posZ ());
451451 mQaRegistry .fill (HIST (" hCentralityFT0A" ), collision.centFT0A ());
452452 mQaRegistry .fill (HIST (" hCentralityFT0C" ), collision.centFT0C ());
453453 return true ;
0 commit comments