1515
1616#include " TRandom.h"
1717#include < TH1F.h>
18+
1819// O2 includes
1920#include " Common/Core/RecoDecay.h"
2021#include " Common/Core/TrackSelection.h"
3334
3435#include < unordered_set>
3536#include < vector>
37+
3638using namespace o2 ;
3739using namespace o2 ::framework;
3840using namespace o2 ::framework::expressions;
@@ -41,7 +43,7 @@ TH1D* tmpFqErr[6][5][52];
4143struct FactorialMomentsTask {
4244 Configurable<bool > useITS{" useITS" , false , " Select tracks with ITS" };
4345 Configurable<bool > useTPC{" useTPC" , false , " Select tracks with TPC" };
44- Configurable<bool > useGlobal{" useGlobal" , false , " Select global tracks" };
46+ Configurable<bool > useGlobal{" useGlobal" , true , " Select global tracks" };
4547 Configurable<bool > applyCheckPtForRec{" applyCheckPtForRec" , false , " Apply checkpT for reconstructed tracks" };
4648 Configurable<bool > applyCheckPtForMC{" applyCheckPtForMC" , true , " Apply checkpT for MC-generated tracks" };
4749 Configurable<float > centralEta{" centralEta" , 0.9 , " eta limit for tracks" };
@@ -60,6 +62,9 @@ struct FactorialMomentsTask {
6062 Configurable<bool > isApplyVertexTRDmatched{" isApplyVertexTRDmatched" , true , " Enable VertexTRDmatched cut" };
6163 Configurable<bool > isApplyExtraCorrCut{" isApplyExtraCorrCut" , false , " Enable extra NPVtracks vs FTOC correlation cut" };
6264 Configurable<bool > isApplyExtraPhiCut{" isApplyExtraPhiCut" , false , " Enable extra phi cut" };
65+ Configurable<bool > includeGlobalTracks{" includeGlobalTracks" , false , " Enable Global Tracks" };
66+ Configurable<bool > includeTPCTracks{" includeTPCTracks" , false , " TPC Tracks" };
67+ Configurable<bool > includeITSTracks{" includeITSTracks" , false , " ITS Tracks" };
6368 Configurable<int > samplesize{" samplesize" , 100 , " Sample size" };
6469 Configurable<bool > useMC{" useMC" , false , " Use MC information" };
6570 Configurable<int > reduceOutput{" reduceOutput" , 0 , " Suppress info level output (0 = all output, 1 = per collision, 2 = none)" };
@@ -99,8 +104,6 @@ struct FactorialMomentsTask {
99104 HistogramRegistry histos{
100105 " histos" ,
101106 {
102- {" mTPCdEdxVsP" , " TPC dE/dx vs p; p (GeV/c); TPC dE/dx" , {HistType::kTH2F , {{1000 , 0.1 , 10.0 }, {1000 , 0.0 , 1000.0 }}}},
103- {" mImpactParameter" , " Impact parameter;b (fm);entries" , {HistType::kTH1F , {{100 , 0.0 , 20.0 }}}},
104107 {" mChargeBefore" , " Charge before MC cuts;charge;entries" , {HistType::kTH1F , {{7 , -3.5 , 3.5 }}}},
105108 {" mChargeAfter" , " Charge after MC cuts;charge;entries" , {HistType::kTH1F , {{7 , -3.5 , 3.5 }}}},
106109 {" mCollID" , " collisionID" , {HistType::kTH1I , {{1000 , -10000 , 10000 }}}},
@@ -116,25 +119,23 @@ struct FactorialMomentsTask {
116119 {" mPhi" , " #phi" , {HistType::kTH1F , {{100 , 0 , o2::constants::math::TwoPI}}}},
117120 {" mEvents" , " events" , {HistType::kTH1D , {{5 , -0.5 , 4.5 }}}},
118121 {" mNFindableClsTPC" , " findable TPC clusters;findable clusters" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
119- {" mNFindableClsTPCb" , " findable TPC clusters;findable clusters" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
120122 {" mNClsTPC" , " number of clusters TPC; nClusters TPC" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
121- {" mNClsITS" , " number of clusters ITS; nClusters ITS" , {HistType::kTH1F , {{100 , 0 , 50 }}}},
123+ {" mNClsITS" , " number of clusters ITS; nClusters ITS" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
122124 {" mChi2TPC" , " chi2 TPC" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
123125 {" mChi2ITS" , " chi2 ITS" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
124126 {" mChi2TRD" , " chi2 TRD" , {HistType::kTH1F , {{100 , 0 , 100 }}}},
125127 {" mDCAxy" , " DCA xy" , {HistType::kTH1F , {{500 , -0.8 , 0.8 }}}},
126- {" mDCAz " , " DCA z" , {HistType::kTH1F , {{500 , -2.0 , 2.0 }}}},
127- {" mDCAxyPt" , " DCA xy vs #pt;#pt;DCAxy" , {HistType::kTH2F , {{1000 , 0 , 6 }, {500 , -0.5 , 0.5 }}}},
128+ {" mDCAx " , " DCA z" , {HistType::kTH1F , {{500 , -2.0 , 2.0 }}}},
129+ {" mDCAxyPt" , " DCA xy vs #pt;#pt;DCAxy" , {HistType::kTH2F , {{100 , 0 , 20 }, {500 , -0.5 , 0.5 }}}},
128130 {" mDCAxyPtbcut" , " DCA xy vs #pt;#pt;DCAxycut" , {HistType::kTH2F , {{100 , 0 , 20 }, {500 , -0.5 , 0.5 }}}},
129131 {" mDCAzPtbcut" , " DCA z vs #pt;#pt;DCAzcut" , {HistType::kTH2F , {{100 , 0 , 20 }, {100 , -2.0 , 2.0 }}}},
130- {" mDCAzPt" , " DCA z vs #pt;#pt;DCAz" , {HistType::kTH2F , {{1000 , 0 , 6 }, {1000 , -2.0 , 2.0 }}}},
132+ {" mDCAzPt" , " DCA z vs #pt;#pt;DCAz" , {HistType::kTH2F , {{100 , 0 , 20 }, {100 , -2.0 , 2.0 }}}},
131133 {" mNSharedClsTPC" , " shared clusters in TPC" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
132134 {" mCrossedRowsTPC" , " crossedrows in TPC" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
133135 {" mNFinClsminusCRows" , " findable cluster #minus crossed rows (TPC)" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
134136 {" mNFractionShClsTPC" , " fraction of shared clusters in TPC" , {HistType::kTH1F , {{100 , 0 , 2 }}}},
135137 {" mSharedClsvsPt" , " shared cluster vs #pt" , {HistType::kTH2F , {{100 , 0 , 50 }, {100 , 0 , 10 }}}},
136- {" mCrossedRowsfindablesvsPt" , " fraction of crossed rows in TPC and findables vs #pt;#pt;ncrows/fcls" , {HistType::kTH2F , {{100 , 0 , 20.0 }, {100 , 0 , 5.0 }}}},
137- {" mSharedClsProbvsPt" , " shared clusters ration vs #pt;#pt;sharedcls/ncrows" , {HistType::kTH2F , {{100 , 0 , 20 }, {100 , 0 , 5 }}}},
138+ {" mSharedClsProbvsPt" , " shared clusters ration vs #pt;#pt;sharedcls/ncrows" , {HistType::kTH2F , {{100 , 0 , 50 }, {100 , 0 , 5 }}}},
138139 },
139140 OutputObjHandlingPolicy::AnalysisObject,
140141 true };
@@ -178,7 +179,8 @@ struct FactorialMomentsTask {
178179 mEventSelected ->GetXaxis ()->SetBinLabel (5 , " vertexITSTPC" );
179180 mEventSelected ->GetXaxis ()->SetBinLabel (6 , " centrality" );
180181 mEventSelected ->GetXaxis ()->SetBinLabel (7 , " final" );
181- auto mTrackSelected = std::get<std::shared_ptr<TH1>>(histos.add (" mTrackSelected" , " Track Selection Steps" , HistType::kTH1D , {{5 , 0.5 , 5.5 }}));
182+ auto mTrackSelected = std::get<std::shared_ptr<TH1>>(histos.add (
183+ " mTrackSelected" , " Track Selection Steps" , HistType::kTH1D , {{5 , 0.5 , 5.5 }}));
182184 mTrackSelected ->GetXaxis ()->SetBinLabel (1 , " all" );
183185 mTrackSelected ->GetXaxis ()->SetBinLabel (2 , " charge" );
184186 mTrackSelected ->GetXaxis ()->SetBinLabel (3 , " PIDs" );
@@ -247,6 +249,7 @@ struct FactorialMomentsTask {
247249 compSample = kTRUE ;
248250 countSamples = 0 ;
249251 }
252+ // Calculate the normalized factorial moments
250253 for (int iPt = 0 ; iPt < numPt; ++iPt) {
251254 for (int iM = 0 ; iM < nBins; ++iM) {
252255 binContent = 0 ;
@@ -331,32 +334,35 @@ struct FactorialMomentsTask {
331334 fqEvent = {{{{{0 , 0 , 0 , 0 , 0 , 0 }}}}};
332335 binConEvent = {{{0 , 0 , 0 , 0 , 0 }}};
333336 for (auto const & track : tracks) {
334- if (track.hasTPC ()) {
335- histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
336- histos.fill (HIST (" mCollID" ), track.collisionId ());
337- histos.fill (HIST (" mEta" ), track.eta ());
338- histos.fill (HIST (" mPt" ), track.pt ());
339- histos.fill (HIST (" mPhi" ), track.phi ());
340- histos.fill (HIST (" mNFindableClsTPC" ), track.tpcNClsFindable ());
341- histos.fill (HIST (" mNClsTPC" ), track.tpcNClsFound ());
342- histos.fill (HIST (" mNClsITS" ), track.itsNCls ());
343- histos.fill (HIST (" mChi2TPC" ), track.tpcChi2NCl ());
344- histos.fill (HIST (" mChi2ITS" ), track.itsChi2NCl ());
345- histos.fill (HIST (" mChi2TRD" ), track.trdChi2 ());
346- histos.fill (HIST (" mDCAxy" ), track.dcaXY ());
347- histos.fill (HIST (" mDCAz" ), track.dcaZ ());
348- histos.fill (HIST (" mDCAxyPt" ), track.pt (), track.dcaXY ());
349- histos.fill (HIST (" mDCAzPt" ), track.pt (), track.dcaZ ());
350- histos.fill (HIST (" mNSharedClsTPC" ), track.tpcNClsShared ());
351- histos.fill (HIST (" mCrossedRowsTPC" ), track.tpcNClsCrossedRows ());
352- histos.fill (HIST (" mNFinClsminusCRows" ), track.tpcNClsFindableMinusCrossedRows ());
353- histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
354- histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
355- histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
356- histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
357- checkpT (track);
358- }
337+ if (useITS && !track.hasITS ())
338+ continue ;
339+ if (useTPC && !track.hasTPC ())
340+ continue ;
341+ if (useGlobal && !track.isGlobalTrack ())
342+ continue ;
343+ histos.fill (HIST (" mCollID" ), track.collisionId ());
344+ histos.fill (HIST (" mEta" ), track.eta ());
345+ histos.fill (HIST (" mPt" ), track.pt ());
346+ histos.fill (HIST (" mPhi" ), track.phi ());
347+ histos.fill (HIST (" mNFindableClsTPC" ), track.tpcNClsFindable ());
348+ histos.fill (HIST (" mNClsTPC" ), track.tpcNClsFound ());
349+ histos.fill (HIST (" mNClsITS" ), track.itsNCls ());
350+ histos.fill (HIST (" mChi2TPC" ), track.tpcChi2NCl ());
351+ histos.fill (HIST (" mChi2ITS" ), track.itsChi2NCl ());
352+ histos.fill (HIST (" mChi2TRD" ), track.trdChi2 ());
353+ histos.fill (HIST (" mDCAxy" ), track.dcaXY ());
354+ histos.fill (HIST (" mDCAx" ), track.dcaZ ());
355+ histos.fill (HIST (" mDCAxyPt" ), track.pt (), track.dcaXY ());
356+ histos.fill (HIST (" mDCAzPt" ), track.pt (), track.dcaZ ());
357+ histos.fill (HIST (" mNSharedClsTPC" ), track.tpcNClsShared ());
358+ histos.fill (HIST (" mCrossedRowsTPC" ), track.tpcNClsCrossedRows ());
359+ histos.fill (HIST (" mNFinClsminusCRows" ), track.tpcNClsFindableMinusCrossedRows ());
360+ histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
361+ histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
362+ histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
363+ checkpT (track);
359364 }
365+
360366 for (int iPt = 0 ; iPt < numPt; ++iPt) {
361367 if (countTracks[iPt] > 0 ) {
362368 mHistArrQA [iPt * 4 + 3 ]->Fill (countTracks[iPt]);
@@ -403,18 +409,13 @@ struct FactorialMomentsTask {
403409 countTracks = {0 , 0 , 0 , 0 , 0 };
404410 fqEvent = {{{{{0 , 0 , 0 , 0 , 0 , 0 }}}}};
405411 binConEvent = {{{0 , 0 , 0 , 0 , 0 }}};
406-
407412 for (auto const & track : colltracks) {
408413 if (useITS && !track.hasITS ())
409414 continue ;
410415 if (useTPC && !track.hasTPC ())
411416 continue ;
412417 if (useGlobal && !track.isGlobalTrack ())
413418 continue ;
414- if ((track.pt () < ptMin)) {
415- continue ;
416- }
417- histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
418419 histos.fill (HIST (" mCollID" ), track.collisionId ());
419420 histos.fill (HIST (" mEta" ), track.eta ());
420421 histos.fill (HIST (" mPt" ), track.pt ());
@@ -426,7 +427,7 @@ struct FactorialMomentsTask {
426427 histos.fill (HIST (" mChi2ITS" ), track.itsChi2NCl ());
427428 histos.fill (HIST (" mChi2TRD" ), track.trdChi2 ());
428429 histos.fill (HIST (" mDCAxy" ), track.dcaXY ());
429- histos.fill (HIST (" mDCAz " ), track.dcaZ ());
430+ histos.fill (HIST (" mDCAx " ), track.dcaZ ());
430431 histos.fill (HIST (" mDCAxyPt" ), track.pt (), track.dcaXY ());
431432 histos.fill (HIST (" mDCAzPt" ), track.pt (), track.dcaZ ());
432433 histos.fill (HIST (" mNSharedClsTPC" ), track.tpcNClsShared ());
@@ -435,7 +436,6 @@ struct FactorialMomentsTask {
435436 histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
436437 histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
437438 histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
438- histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
439439 if (applyCheckPtForRec && !applyCheckPtForMC) {
440440 checkpT (track);
441441 }
@@ -466,7 +466,6 @@ struct FactorialMomentsTask {
466466 }
467467 }
468468 histos.fill (HIST (" mEventSelected" ), 6 );
469- // Calculate the normalized factorial moments
470469 calculateMoments (mHistArrReset );
471470 }
472471 PROCESS_SWITCH (FactorialMomentsTask, processMCRec, " main process function" , false );
@@ -485,16 +484,13 @@ struct FactorialMomentsTask {
485484 if (!(bc.eventCuts () & BIT (aod::Run2EventCuts::kAliEventCutsAccepted ))) {
486485 return ;
487486 }
488- auto mcColl = coll.mcCollision ();
489- float imp = mcColl.impactParameter ();
490- histos.fill (HIST (" mImpactParameter" ), imp);
491- float bMax = 3.5 ; // adjust based on your MC
492- if (imp > bMax) {
487+ if (coll.centRun2V0M () < centLimits.value [0 ] || coll.centRun2V0M () > centLimits.value [1 ]) {
493488 return ;
494489 }
495490 histos.fill (HIST (" mVertexX" ), coll.posX ());
496491 histos.fill (HIST (" mVertexY" ), coll.posY ());
497492 histos.fill (HIST (" mVertexZ" ), coll.posZ ());
493+ histos.fill (HIST (" mCentFT0M" ), coll.centRun2V0M ());
498494 for (auto const & h : mHistArrReset ) {
499495 h->Reset ();
500496 }
@@ -504,7 +500,6 @@ struct FactorialMomentsTask {
504500 for (auto const & track : tracks) {
505501 double recoCharge = (track.sign () != 0 ) ? track.sign () : 0 .;
506502 if (std::abs (track.eta ()) < centralEta && track.isGlobalTrack () && std::abs (recoCharge) >= kMinCharge ) {
507- histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
508503 histos.fill (HIST (" mCollID" ), track.collisionId ());
509504 histos.fill (HIST (" mNFindableClsTPC" ), track.tpcNClsFindable ());
510505 histos.fill (HIST (" mNClsTPC" ), track.tpcNClsFound ());
@@ -517,23 +512,24 @@ struct FactorialMomentsTask {
517512 histos.fill (HIST (" mNFinClsminusCRows" ), track.tpcNClsFindableMinusCrossedRows ());
518513 histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
519514 histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
520- histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
521515 histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
522516 if (applyCheckPtForRec && !applyCheckPtForMC) {
523517 checkpT (track);
524518 }
525519 }
526520 }
527521 auto mcParts = mcParticles.sliceBy (perMcCollision, coll.mcCollision ().globalIndex ());
528- for (const auto & mc : mcParts) {
522+ for (auto const & mc : mcParts) {
529523 int pdgCode = mc.pdgCode ();
530524 auto pdgInfo = pdg->GetParticle (pdgCode);
531525 if (!pdgInfo) {
532526 continue ;
533527 }
534528 double charge = pdgInfo->Charge ();
535529 double physCharge = charge / 3.0 ;
530+ histos.fill (HIST (" mChargeBefore" ), physCharge);
536531 if (mc.isPhysicalPrimary () && std::abs (mc.eta ()) < centralEta && std::abs (physCharge) >= kMinCharge ) {
532+ histos.fill (HIST (" mChargeAfter" ), physCharge);
537533 histos.fill (HIST (" mEta" ), mc.eta ());
538534 histos.fill (HIST (" mPt" ), mc.pt ());
539535 histos.fill (HIST (" mPhi" ), mc.phi ());
@@ -542,11 +538,13 @@ struct FactorialMomentsTask {
542538 }
543539 }
544540 }
541+
545542 for (int iPt = 0 ; iPt < numPt; ++iPt) {
546543 if (countTracks[iPt] > 0 ) {
547544 mHistArrQA [iPt * 4 + 3 ]->Fill (countTracks[iPt]);
548545 }
549546 }
547+
550548 calculateMoments (mHistArrReset );
551549 }
552550
@@ -574,7 +572,6 @@ struct FactorialMomentsTask {
574572 if ((track.pt () < ptMin) || (!track.isGlobalTrack ()) || (track.tpcNClsFindable () < mintPCCls)) {
575573 continue ;
576574 }
577- histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
578575 histos.fill (HIST (" mCollID" ), track.collisionId ());
579576 histos.fill (HIST (" mEta" ), track.eta ());
580577 histos.fill (HIST (" mPt" ), track.pt ());
@@ -586,7 +583,7 @@ struct FactorialMomentsTask {
586583 histos.fill (HIST (" mChi2ITS" ), track.itsChi2NCl ());
587584 histos.fill (HIST (" mChi2TRD" ), track.trdChi2 ());
588585 histos.fill (HIST (" mDCAxy" ), track.dcaXY ());
589- histos.fill (HIST (" mDCAz " ), track.dcaZ ());
586+ histos.fill (HIST (" mDCAx " ), track.dcaZ ());
590587 histos.fill (HIST (" mDCAxyPt" ), track.pt (), track.dcaXY ());
591588 histos.fill (HIST (" mDCAzPt" ), track.pt (), track.dcaZ ());
592589 histos.fill (HIST (" mNSharedClsTPC" ), track.tpcNClsShared ());
@@ -595,14 +592,14 @@ struct FactorialMomentsTask {
595592 histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
596593 histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
597594 histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
598- histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
599595 checkpT (track);
600596 }
601597 for (int iPt = 0 ; iPt < numPt; ++iPt) {
602- if (countTracks[iPt] < 0 ) {
598+ if (countTracks[iPt] > 0 ) {
603599 mHistArrQA [iPt * 4 + 3 ]->Fill (countTracks[iPt]);
604600 }
605601 }
602+ // Calculate the normalized factorial moments
606603 calculateMoments (mHistArrReset );
607604 }
608605 PROCESS_SWITCH (FactorialMomentsTask, processRun2, " for RUN2" , false );
0 commit comments