1212// / \brief This task is for Normalized Factorial Moments Analysis: Hwa and Yang, Phys. Rev. C 85, 044914 (2012)
1313// / \author Salman Malik
1414// / \author Balwan Singh
15-
1615#include " Common/CCDB/EventSelectionParams.h"
1716#include " Common/CCDB/TriggerAliases.h"
1817#include " Common/Core/RecoDecay.h"
@@ -53,6 +52,10 @@ using namespace o2::framework;
5352using namespace o2 ::framework::expressions;
5453
5554struct FactorialMomentsTask {
55+ Configurable<bool > useDcaCut{" useDcaCut" , true , " Enable DCA cut" };
56+ Configurable<bool > useTPCRefit{" useTPCRefit" , true , " Enable TPC refit cut" };
57+ Configurable<bool > useTPCChi2{" useTPCChi2" , true , " Enable TPC chi2 cut" };
58+ Configurable<bool > useTPCCluster{" useTPCCluster" , false , " Select tracks with TPCCluster" };
5659 Configurable<bool > useITS{" useITS" , false , " Select tracks with ITS" };
5760 Configurable<bool > useTPC{" useTPC" , false , " Select tracks with TPC" };
5861 Configurable<bool > useGlobal{" useGlobal" , true , " Select global tracks" };
@@ -66,8 +69,9 @@ struct FactorialMomentsTask {
6669 Configurable<float > ptMin{" ptMin" , 0 .2f , " lower pT cut" };
6770 Configurable<float > dcaXY{" dcaXY" , 0 .1f , " DCA xy cut" };
6871 Configurable<float > dcaZ{" dcaZ" , 1 .0f , " DCA z cut" };
69- Configurable<float > maxTPCChi2NCl{" maxTPCChi2NCl" , 2 . 5f , " Maximum TPCchi2NCl" };
72+ Configurable<float > maxTPCChi2NCl{" maxTPCChi2NCl" , 4 . 0f , " Maximum TPCchi2NCl" };
7073 Configurable<float > maxITSChi2NCl{" maxITSChi2NCl" , 40 .0f , " Maximum ITSchi2NCl" };
74+ Configurable<float > minTPCr{" minTPCr" , 70 .0f , " minimum number of TPC clusters" };
7175 Configurable<float > minTPCNCls{" minTPCNCls" , 70 .0f , " minimum number of TPC clusters" };
7276 Configurable<std::vector<int >> centLimits{" centLimits" , {0 , 5 }, " centrality min and max" };
7377 Configurable<std::vector<float >> vertexXYZ{" vertexXYZ" , {0 .3f , 0 .4f , 10 .0f }, " vertex cuts" };
@@ -85,9 +89,10 @@ struct FactorialMomentsTask {
8589 Configurable<bool > includeITSTracks{" includeITSTracks" , false , " ITS Tracks" };
8690 Configurable<int > nSlots{" nSlots" , 1250 , " Number of hash slots for merge-safe subsampling (slot = splitmix64(globalBC) % nSlots); must be identical for every job" };
8791 Configurable<bool > useMC{" useMC" , false , " Use MC information" };
92+ Configurable<bool > useCrossedRows{" useCrossedRows" , true , " Require global track in filter" };
8893 Configurable<bool > useGlobalTrack{" useGlobalTrack" , true , " Require global track in filter" };
8994 Configurable<int > minITSClusters{" minITSClusters" , 6 , " Minimum Number of ITS cluster" };
90- Configurable<int > minTPCClusters{" minTPCClusters" , 80 , " Minimum Number of TPC cluster" };
95+ Configurable<int > minTPCClusters{" minTPCClusters" , 70 , " Minimum Number of TPC cluster" };
9196 Configurable<int > minTPCCrossedRows{" minTPCCrossedRows" , 70 , " Minimum Number of TPC crossed-rows" };
9297 Configurable<float > minTPCCrossedRowsOverFindableCls{" minTPCCrossedRowsOverFindableCls" , 0.8 , " Minimum ratio of crossed rows over findable clusters TPC" };
9398 Configurable<int > reduceOutput{" reduceOutput" , 0 , " Suppress info level output (0 = all output, 1 = per collision, 2 = none)" };
@@ -132,24 +137,29 @@ struct FactorialMomentsTask {
132137 },
133138 OutputObjHandlingPolicy::AnalysisObject,
134139 true };
135- float collisionZ = 0 .f;
136- static constexpr double kDcaXY0 = 0.0105 ;
137- static constexpr double kDcaXY1 = 0.035 ;
138- static constexpr double kDcaXY2 = 1.1 ;
139140 static const int nBins = 52 ;
140- static constexpr double kMinCharge = 1e-6 ;
141+ static const int nCentLim = 2 ;
142+ static const int nPtVal = 2 ;
143+ static const int nVertexXYZ = 3 ;
144+ static constexpr int NPt = 5 ;
145+ float collisionZ = 0 .f;
146+ static constexpr double DcaXY0 = 0.0105 ;
147+ static constexpr double DcaXY1 = 0.035 ;
148+ static constexpr double DcaXY2 = 1.1 ;
149+ static constexpr double MinCharge = 1e-6 ;
150+ static constexpr int MaxSlots = 1000000 ;
141151 static const int nfqOrder = 6 ;
142- static constexpr int kEvAll = 1 ;
143- static constexpr int kEvSel8 = 2 ;
144- static constexpr int kEvITSROFrame = 3 ;
145- static constexpr int kEvTimeFrame = 4 ;
146- static constexpr int kEvSameBunch = 5 ;
147- static constexpr int kEvGoodITS = 6 ;
148- static constexpr int kEvGoodZvtx = 7 ;
149- static constexpr int kEvVertexITSTPC = 8 ;
150- static constexpr int kEvCent = 9 ;
151- static constexpr int kEvAccepted = 10 ;
152- static constexpr int kNEventSteps = 10 ;
152+ static constexpr int EvAll = 1 ;
153+ static constexpr int EvSel8 = 2 ;
154+ static constexpr int EvITSROFrame = 3 ;
155+ static constexpr int EvTimeFrame = 4 ;
156+ static constexpr int EvSameBunch = 5 ;
157+ static constexpr int EvGoodITS = 6 ;
158+ static constexpr int EvGoodZvtx = 7 ;
159+ static constexpr int EvVertexITSTPC = 8 ;
160+ static constexpr int EvCent = 9 ;
161+ static constexpr int EvAccepted = 10 ;
162+ static constexpr int NEventSteps = 10 ;
153163 std::array<int , nBins> binningM{};
154164 std::array<int , 5 > countTracks{};
155165 std::array<std::array<std::array<double , nBins>, 5 >, nfqOrder> fqEvent{};
@@ -170,17 +180,17 @@ struct FactorialMomentsTask {
170180
171181 void init (o2::framework::InitContext&)
172182 {
173- if (numPt.value < 1 || numPt.value > 5 ) {
174- LOG (fatal) << " numPt must be between 1 and 5, got " << numPt.value ;
183+ if (numPt.value < 1 || numPt.value > NPt ) {
184+ LOG (fatal) << " NPt must be between 1 and 5, got " << numPt.value ;
175185 }
176- if (static_cast <int >(ptCuts.value .size ()) < 2 * numPt.value ) {
177- LOG (fatal) << " ptCuts needs " << 2 * numPt.value << " values for numPt=" << numPt.value
186+ if (static_cast <int >(ptCuts.value .size ()) < nPtVal * numPt.value ) {
187+ LOG (fatal) << " ptCuts needs " << nPtVal * numPt.value << " values for numPt=" << numPt.value
178188 << " , got " << ptCuts.value .size ();
179189 }
180- if (nSlots.value < 1 || nSlots.value > 1000000 ) {
181- LOG (fatal) << " nSlots must be in [1, 1000000 ], got " << nSlots.value ;
190+ if (nSlots.value < 1 || nSlots.value > MaxSlots ) {
191+ LOG (fatal) << " nSlots must be in [1, MaxSlots ], got " << nSlots.value ;
182192 }
183- if (centLimits.value .size () != 2 || vertexXYZ.value .size () != 3 ) {
193+ if (centLimits.value .size () != nCentLim || vertexXYZ.value .size () != nVertexXYZ ) {
184194 LOG (fatal) << " centLimits needs 2 and vertexXYZ needs 3 values" ;
185195 }
186196 if (applyCheckPtForRec.value == applyCheckPtForMC.value ) {
@@ -195,9 +205,9 @@ struct FactorialMomentsTask {
195205 cfg += Form (" %s%g" , i > 0 ? " ," : " " , ptCuts.value [i]);
196206 }
197207 histos.add (" metaConfig" , cfg.Data (), HistType::kTH1D , {{1 , 0.5 , 1.5 }});
198- auto mEventSelected = std::get<std::shared_ptr<TH1 >>(histos.add (" mEventSelected" , " eventSelected" , HistType::kTH1D , {{kNEventSteps , 0.5 , kNEventSteps + 0.5 }}));
199- const std::array<const char *, kNEventSteps > evLabels = {" all" , " sel8" , " kNoITSROFrameBorder" , " kNoTimeFrameBorder" , " kNoSameBunchPileup" , " kIsGoodITSLayersAll" , " kIsGoodZvtxFT0vsPV" , " kIsVertexITSTPC" , " centrality" , " accepted" };
200- for (int iStep = 0 ; iStep < kNEventSteps ; ++iStep) {
208+ auto mEventSelected = std::get<std::shared_ptr<TH1 >>(histos.add (" mEventSelected" , " eventSelected" , HistType::kTH1D , {{NEventSteps , 0.5 , NEventSteps + 0.5 }}));
209+ const std::array<const char *, NEventSteps > evLabels = {" all" , " sel8" , " kNoITSROFrameBorder" , " kNoTimeFrameBorder" , " kNoSameBunchPileup" , " kIsGoodITSLayersAll" , " kIsGoodZvtxFT0vsPV" , " kIsVertexITSTPC" , " centrality" , " accepted" };
210+ for (int iStep = 0 ; iStep < NEventSteps ; ++iStep) {
201211 mEventSelected ->GetXaxis ()->SetBinLabel (iStep + 1 , evLabels[iStep]);
202212 }
203213 // merge-safe slot output: additive per-slot sums, hadd-exact (see slotpool.C)
@@ -326,7 +336,7 @@ struct FactorialMomentsTask {
326336 template <typename T>
327337 bool passDcaCut (const T& track) const
328338 {
329- return std::fabs (track.dcaXY ()) < (kDcaXY0 + kDcaXY1 / std::pow (track.pt (), kDcaXY2 ));
339+ return std::fabs (track.dcaXY ()) < (DcaXY0 + DcaXY1 / std::pow (track.pt (), DcaXY2 ));
330340 }
331341
332342 template <typename T>
@@ -368,7 +378,7 @@ struct FactorialMomentsTask {
368378 double charge = pdgInfo->Charge ();
369379 double physCharge = charge / 3.0 ;
370380 histos.fill (HIST (" mChargeBefore" ), physCharge);
371- if (mc.isPhysicalPrimary () && std::abs (mc.eta ()) < centralEta && std::abs (physCharge) >= kMinCharge ) {
381+ if (mc.isPhysicalPrimary () && std::abs (mc.eta ()) < centralEta && std::abs (physCharge) >= MinCharge ) {
372382 histos.fill (HIST (" mChargeAfter" ), physCharge);
373383 histos.fill (HIST (" mEta" ), mc.eta ());
374384 histos.fill (HIST (" mPt" ), mc.pt ());
@@ -383,69 +393,100 @@ struct FactorialMomentsTask {
383393 template <typename T>
384394 bool selectEventRun3 (const T& coll)
385395 {
386- histos.fill (HIST (" mEventSelected" ), kEvAll );
396+ histos.fill (HIST (" mEventSelected" ), EvAll );
387397 if (!coll.sel8 ()) {
388398 return false ;
389399 }
390- histos.fill (HIST (" mEventSelected" ), kEvSel8 );
400+ histos.fill (HIST (" mEventSelected" ), EvSel8 );
391401 if (evSelNoITSROFrameBorder && !(coll.selection_bit (o2::aod::evsel::kNoITSROFrameBorder ))) {
392402 return false ;
393403 }
394- histos.fill (HIST (" mEventSelected" ), kEvITSROFrame );
404+ histos.fill (HIST (" mEventSelected" ), EvITSROFrame );
395405 if (evSelNoTimeFrameBorder && !(coll.selection_bit (o2::aod::evsel::kNoTimeFrameBorder ))) {
396406 return false ;
397407 }
398- histos.fill (HIST (" mEventSelected" ), kEvTimeFrame );
408+ histos.fill (HIST (" mEventSelected" ), EvTimeFrame );
399409 if (evSelNoSameBunchPileup && !coll.selection_bit (o2::aod::evsel::kNoSameBunchPileup )) {
400410 return false ;
401411 }
402- histos.fill (HIST (" mEventSelected" ), kEvSameBunch );
412+ histos.fill (HIST (" mEventSelected" ), EvSameBunch );
403413 if (evSelGoodITSLayersAll && !(coll.selection_bit (o2::aod::evsel::kIsGoodITSLayersAll ))) {
404414 return false ;
405415 }
406- histos.fill (HIST (" mEventSelected" ), kEvGoodITS );
416+ histos.fill (HIST (" mEventSelected" ), EvGoodITS );
407417 if (evSelGoodZvtxFT0vsPV && !coll.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV )) {
408418 return false ;
409419 }
410- histos.fill (HIST (" mEventSelected" ), kEvGoodZvtx );
420+ histos.fill (HIST (" mEventSelected" ), EvGoodZvtx );
411421 if (coll.centFT0C () < centLimits.value [0 ] || coll.centFT0C () > centLimits.value [1 ]) {
412422 return false ;
413423 }
414424 collisionZ = coll.posZ ();
415- histos.fill (HIST (" mEventSelected" ), kEvCent );
416- histos.fill (HIST (" mEventSelected" ), kEvAccepted );
425+ histos.fill (HIST (" mEventSelected" ), EvCent );
426+ histos.fill (HIST (" mEventSelected" ), EvAccepted );
417427 return true ;
418428 }
419429
420430 template <typename T>
421431 bool selectEventMCRec (const T& coll)
422432 {
423- histos.fill (HIST (" mEventSelected" ), kEvAll );
433+ histos.fill (HIST (" mEventSelected" ), EvAll );
424434 if (!coll.sel8 ()) {
425435 return false ;
426436 }
427- histos.fill (HIST (" mEventSelected" ), kEvSel8 );
437+ histos.fill (HIST (" mEventSelected" ), EvSel8 );
428438 if (evSelNoSameBunchPileup && !coll.selection_bit (o2::aod::evsel::kNoSameBunchPileup )) {
429439 return false ;
430440 }
431- histos.fill (HIST (" mEventSelected" ), kEvSameBunch );
441+ histos.fill (HIST (" mEventSelected" ), EvSameBunch );
432442 if (evSelGoodZvtxFT0vsPV && !coll.selection_bit (o2::aod::evsel::kIsGoodZvtxFT0vsPV )) {
433443 return false ;
434444 }
435- histos.fill (HIST (" mEventSelected" ), kEvGoodZvtx );
445+ histos.fill (HIST (" mEventSelected" ), EvGoodZvtx );
436446 if (evSelVertexITSTPC && !coll.selection_bit (o2::aod::evsel::kIsVertexITSTPC )) {
437447 return false ;
438448 }
439- histos.fill (HIST (" mEventSelected" ), kEvVertexITSTPC );
449+ histos.fill (HIST (" mEventSelected" ), EvVertexITSTPC );
440450 if (coll.centFT0C () < centLimits.value [0 ] || coll.centFT0C () > centLimits.value [1 ]) {
441451 return false ;
442452 }
443453 collisionZ = coll.posZ ();
444- histos.fill (HIST (" mEventSelected" ), kEvCent );
445- histos.fill (HIST (" mEventSelected" ), kEvAccepted );
454+ histos.fill (HIST (" mEventSelected" ), EvCent );
455+ histos.fill (HIST (" mEventSelected" ), EvAccepted );
446456 return true ;
447457 }
458+ template <typename T>
459+ bool selectTrack (const T& track)
460+ {
461+ if (useITS && !track.hasITS ()) {
462+ return false ;
463+ }
464+ if (useTPC && !track.hasTPC ()) {
465+ return false ;
466+ }
467+ if (useGlobal && !track.isGlobalTrack ()) {
468+ return false ;
469+ }
470+ if (useCrossedRows && track.tpcNClsCrossedRows () < minTPCr) {
471+ return false ;
472+ }
473+ if (useDcaCut && !passDcaCut (track)) {
474+ return false ;
475+ }
448476
477+ if (useTPCRefit && !(track.flags () & o2::aod::track::TPCrefit)) {
478+ return false ;
479+ }
480+
481+ if (useTPCChi2 && track.tpcChi2NCl () > maxTPCChi2NCl) {
482+ return false ;
483+ }
484+
485+ if (useTPCCluster && track.tpcNClsFound () < minTPCClusters) {
486+ return false ;
487+ }
488+ return true ;
489+ }
449490 void beginEvent ()
450491 {
451492 for (int iPt = 0 ; iPt < numPt; ++iPt) {
@@ -488,16 +529,7 @@ struct FactorialMomentsTask {
488529 histos.fill (HIST (" mCentFT0C" ), coll.centFT0C ());
489530 beginEvent ();
490531 for (auto const & track : tracks) {
491- if (useITS && !track.hasITS ()) {
492- continue ;
493- }
494- if (useTPC && !track.hasTPC ()) {
495- continue ;
496- }
497- if (useGlobal && !track.isGlobalTrack ()) {
498- continue ;
499- }
500- if (!passDcaCut (track)) {
532+ if (!selectTrack (track)) {
501533 continue ;
502534 }
503535 fillTrackQA (track);
@@ -523,16 +555,7 @@ struct FactorialMomentsTask {
523555 histos.fill (HIST (" mCentFT0C" ), coll.centFT0C ());
524556 beginEvent ();
525557 for (auto const & track : colltracks) {
526- if (useITS && !track.hasITS ()) {
527- continue ;
528- }
529- if (useTPC && !track.hasTPC ()) {
530- continue ;
531- }
532- if (useGlobal && !track.isGlobalTrack ()) {
533- continue ;
534- }
535- if (!passDcaCut (track)) {
558+ if (!selectTrack (track)) {
536559 continue ;
537560 }
538561 fillTrackQA (track);
@@ -572,7 +595,7 @@ struct FactorialMomentsTask {
572595 beginEvent ();
573596 for (auto const & track : tracks) {
574597 double recoCharge = (track.sign () != 0 ) ? track.sign () : 0 .;
575- if (std::abs (track.eta ()) < centralEta && track.isGlobalTrack () && std::abs (recoCharge) >= kMinCharge ) {
598+ if (std::abs (track.eta ()) < centralEta && track.isGlobalTrack () && std::abs (recoCharge) >= MinCharge ) {
576599 fillTrackQA (track);
577600 if (applyCheckPtForRec && !applyCheckPtForMC) {
578601 checkpT (track);
0 commit comments