1515
1616#include " TRandom.h"
1717#include < TH1F.h>
18-
1918// O2 includes
2019#include " Common/Core/RecoDecay.h"
2120#include " Common/Core/TrackSelection.h"
3433
3534#include < unordered_set>
3635#include < vector>
37-
3836using namespace o2 ;
3937using namespace o2 ::framework;
4038using namespace o2 ::framework::expressions;
@@ -43,7 +41,7 @@ TH1D* tmpFqErr[6][5][52];
4341struct FactorialMomentsTask {
4442 Configurable<bool > useITS{" useITS" , false , " Select tracks with ITS" };
4543 Configurable<bool > useTPC{" useTPC" , false , " Select tracks with TPC" };
46- Configurable<bool > useGlobal{" useGlobal" , true , " Select global tracks" };
44+ Configurable<bool > useGlobal{" useGlobal" , false , " Select global tracks" };
4745 Configurable<bool > applyCheckPtForRec{" applyCheckPtForRec" , false , " Apply checkpT for reconstructed tracks" };
4846 Configurable<bool > applyCheckPtForMC{" applyCheckPtForMC" , true , " Apply checkpT for MC-generated tracks" };
4947 Configurable<float > centralEta{" centralEta" , 0.9 , " eta limit for tracks" };
@@ -62,9 +60,6 @@ struct FactorialMomentsTask {
6260 Configurable<bool > isApplyVertexTRDmatched{" isApplyVertexTRDmatched" , true , " Enable VertexTRDmatched cut" };
6361 Configurable<bool > isApplyExtraCorrCut{" isApplyExtraCorrCut" , false , " Enable extra NPVtracks vs FTOC correlation cut" };
6462 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" };
6863 Configurable<int > samplesize{" samplesize" , 100 , " Sample size" };
6964 Configurable<bool > useMC{" useMC" , false , " Use MC information" };
7065 Configurable<int > reduceOutput{" reduceOutput" , 0 , " Suppress info level output (0 = all output, 1 = per collision, 2 = none)" };
@@ -104,6 +99,8 @@ struct FactorialMomentsTask {
10499 HistogramRegistry histos{
105100 " histos" ,
106101 {
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 }}}},
107104 {" mChargeBefore" , " Charge before MC cuts;charge;entries" , {HistType::kTH1F , {{7 , -3.5 , 3.5 }}}},
108105 {" mChargeAfter" , " Charge after MC cuts;charge;entries" , {HistType::kTH1F , {{7 , -3.5 , 3.5 }}}},
109106 {" mCollID" , " collisionID" , {HistType::kTH1I , {{1000 , -10000 , 10000 }}}},
@@ -119,23 +116,25 @@ struct FactorialMomentsTask {
119116 {" mPhi" , " #phi" , {HistType::kTH1F , {{100 , 0 , o2::constants::math::TwoPI}}}},
120117 {" mEvents" , " events" , {HistType::kTH1D , {{5 , -0.5 , 4.5 }}}},
121118 {" mNFindableClsTPC" , " findable TPC clusters;findable clusters" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
119+ {" mNFindableClsTPCb" , " findable TPC clusters;findable clusters" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
122120 {" mNClsTPC" , " number of clusters TPC; nClusters TPC" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
123- {" mNClsITS" , " number of clusters ITS; nClusters ITS" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
121+ {" mNClsITS" , " number of clusters ITS; nClusters ITS" , {HistType::kTH1F , {{100 , 0 , 50 }}}},
124122 {" mChi2TPC" , " chi2 TPC" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
125123 {" mChi2ITS" , " chi2 ITS" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
126124 {" mChi2TRD" , " chi2 TRD" , {HistType::kTH1F , {{100 , 0 , 100 }}}},
127125 {" mDCAxy" , " DCA xy" , {HistType::kTH1F , {{500 , -0.8 , 0.8 }}}},
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 }}}},
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 }}}},
130128 {" mDCAxyPtbcut" , " DCA xy vs #pt;#pt;DCAxycut" , {HistType::kTH2F , {{100 , 0 , 20 }, {500 , -0.5 , 0.5 }}}},
131129 {" mDCAzPtbcut" , " DCA z vs #pt;#pt;DCAzcut" , {HistType::kTH2F , {{100 , 0 , 20 }, {100 , -2.0 , 2.0 }}}},
132- {" mDCAzPt" , " DCA z vs #pt;#pt;DCAz" , {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 }}}},
133131 {" mNSharedClsTPC" , " shared clusters in TPC" , {HistType::kTH1F , {{100 , 0 , 10 }}}},
134132 {" mCrossedRowsTPC" , " crossedrows in TPC" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
135133 {" mNFinClsminusCRows" , " findable cluster #minus crossed rows (TPC)" , {HistType::kTH1F , {{100 , 0 , 200 }}}},
136134 {" mNFractionShClsTPC" , " fraction of shared clusters in TPC" , {HistType::kTH1F , {{100 , 0 , 2 }}}},
137135 {" mSharedClsvsPt" , " shared cluster vs #pt" , {HistType::kTH2F , {{100 , 0 , 50 }, {100 , 0 , 10 }}}},
138- {" mSharedClsProbvsPt" , " shared clusters ration vs #pt;#pt;sharedcls/ncrows" , {HistType::kTH2F , {{100 , 0 , 50 }, {100 , 0 , 5 }}}},
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 }}}},
139138 },
140139 OutputObjHandlingPolicy::AnalysisObject,
141140 true };
@@ -179,8 +178,7 @@ struct FactorialMomentsTask {
179178 mEventSelected ->GetXaxis ()->SetBinLabel (5 , " vertexITSTPC" );
180179 mEventSelected ->GetXaxis ()->SetBinLabel (6 , " centrality" );
181180 mEventSelected ->GetXaxis ()->SetBinLabel (7 , " final" );
182- auto mTrackSelected = std::get<std::shared_ptr<TH1>>(histos.add (
183- " mTrackSelected" , " Track Selection Steps" , HistType::kTH1D , {{5 , 0.5 , 5.5 }}));
181+ auto mTrackSelected = std::get<std::shared_ptr<TH1>>(histos.add (" mTrackSelected" , " Track Selection Steps" , HistType::kTH1D , {{5 , 0.5 , 5.5 }}));
184182 mTrackSelected ->GetXaxis ()->SetBinLabel (1 , " all" );
185183 mTrackSelected ->GetXaxis ()->SetBinLabel (2 , " charge" );
186184 mTrackSelected ->GetXaxis ()->SetBinLabel (3 , " PIDs" );
@@ -335,6 +333,7 @@ struct FactorialMomentsTask {
335333 binConEvent = {{{0 , 0 , 0 , 0 , 0 }}};
336334 for (auto const & track : tracks) {
337335 if (track.hasTPC ()) {
336+ histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
338337 histos.fill (HIST (" mCollID" ), track.collisionId ());
339338 histos.fill (HIST (" mEta" ), track.eta ());
340339 histos.fill (HIST (" mPt" ), track.pt ());
@@ -346,7 +345,7 @@ struct FactorialMomentsTask {
346345 histos.fill (HIST (" mChi2ITS" ), track.itsChi2NCl ());
347346 histos.fill (HIST (" mChi2TRD" ), track.trdChi2 ());
348347 histos.fill (HIST (" mDCAxy" ), track.dcaXY ());
349- histos.fill (HIST (" mDCAx " ), track.dcaZ ());
348+ histos.fill (HIST (" mDCAz " ), track.dcaZ ());
350349 histos.fill (HIST (" mDCAxyPt" ), track.pt (), track.dcaXY ());
351350 histos.fill (HIST (" mDCAzPt" ), track.pt (), track.dcaZ ());
352351 histos.fill (HIST (" mNSharedClsTPC" ), track.tpcNClsShared ());
@@ -355,6 +354,7 @@ struct FactorialMomentsTask {
355354 histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
356355 histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
357356 histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
357+ histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
358358 checkpT (track);
359359 }
360360 }
@@ -404,13 +404,18 @@ struct FactorialMomentsTask {
404404 countTracks = {0 , 0 , 0 , 0 , 0 };
405405 fqEvent = {{{{{0 , 0 , 0 , 0 , 0 , 0 }}}}};
406406 binConEvent = {{{0 , 0 , 0 , 0 , 0 }}};
407+
407408 for (auto const & track : colltracks) {
408409 if (useITS && !track.hasITS ())
409410 continue ;
410411 if (useTPC && !track.hasTPC ())
411412 continue ;
412413 if (useGlobal && !track.isGlobalTrack ())
413414 continue ;
415+ if ((track.pt () < ptMin)) {
416+ continue ;
417+ }
418+ histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
414419 histos.fill (HIST (" mCollID" ), track.collisionId ());
415420 histos.fill (HIST (" mEta" ), track.eta ());
416421 histos.fill (HIST (" mPt" ), track.pt ());
@@ -422,7 +427,7 @@ struct FactorialMomentsTask {
422427 histos.fill (HIST (" mChi2ITS" ), track.itsChi2NCl ());
423428 histos.fill (HIST (" mChi2TRD" ), track.trdChi2 ());
424429 histos.fill (HIST (" mDCAxy" ), track.dcaXY ());
425- histos.fill (HIST (" mDCAx " ), track.dcaZ ());
430+ histos.fill (HIST (" mDCAz " ), track.dcaZ ());
426431 histos.fill (HIST (" mDCAxyPt" ), track.pt (), track.dcaXY ());
427432 histos.fill (HIST (" mDCAzPt" ), track.pt (), track.dcaZ ());
428433 histos.fill (HIST (" mNSharedClsTPC" ), track.tpcNClsShared ());
@@ -431,6 +436,7 @@ struct FactorialMomentsTask {
431436 histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
432437 histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
433438 histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
439+ histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
434440 if (applyCheckPtForRec && !applyCheckPtForMC) {
435441 checkpT (track);
436442 }
@@ -481,13 +487,16 @@ struct FactorialMomentsTask {
481487 if (!(bc.eventCuts () & BIT (aod::Run2EventCuts::kAliEventCutsAccepted ))) {
482488 return ;
483489 }
484- if (coll.centRun2V0M () < centLimits.value [0 ] || coll.centRun2V0M () > centLimits.value [1 ]) {
490+ auto mcColl = coll.mcCollision ();
491+ float imp = mcColl.impactParameter ();
492+ histos.fill (HIST (" mImpactParameter" ), imp);
493+ float bMax = 3.5 ; // adjust based on your MC
494+ if (imp > bMax) {
485495 return ;
486496 }
487497 histos.fill (HIST (" mVertexX" ), coll.posX ());
488498 histos.fill (HIST (" mVertexY" ), coll.posY ());
489499 histos.fill (HIST (" mVertexZ" ), coll.posZ ());
490- histos.fill (HIST (" mCentFT0M" ), coll.centRun2V0M ());
491500 for (auto const & h : mHistArrReset ) {
492501 h->Reset ();
493502 }
@@ -497,6 +506,7 @@ struct FactorialMomentsTask {
497506 for (auto const & track : tracks) {
498507 double recoCharge = (track.sign () != 0 ) ? track.sign () : 0 .;
499508 if (std::abs (track.eta ()) < centralEta && track.isGlobalTrack () && std::abs (recoCharge) >= kMinCharge ) {
509+ histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
500510 histos.fill (HIST (" mCollID" ), track.collisionId ());
501511 histos.fill (HIST (" mNFindableClsTPC" ), track.tpcNClsFindable ());
502512 histos.fill (HIST (" mNClsTPC" ), track.tpcNClsFound ());
@@ -509,24 +519,23 @@ struct FactorialMomentsTask {
509519 histos.fill (HIST (" mNFinClsminusCRows" ), track.tpcNClsFindableMinusCrossedRows ());
510520 histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
511521 histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
522+ histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
512523 histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
513524 if (applyCheckPtForRec && !applyCheckPtForMC) {
514525 checkpT (track);
515526 }
516527 }
517528 }
518529 auto mcParts = mcParticles.sliceBy (perMcCollision, coll.mcCollision ().globalIndex ());
519- for (auto const & mc : mcParts) {
530+ for (const auto & mc : mcParts) {
520531 int pdgCode = mc.pdgCode ();
521532 auto pdgInfo = pdg->GetParticle (pdgCode);
522533 if (!pdgInfo) {
523534 continue ;
524535 }
525536 double charge = pdgInfo->Charge ();
526537 double physCharge = charge / 3.0 ;
527- histos.fill (HIST (" mChargeBefore" ), physCharge);
528- if (mc.isPhysicalPrimary () && std::abs (mc.eta ()) < centralEta && std::abs (physCharge) >= kMinCharge ) {
529- histos.fill (HIST (" mChargeAfter" ), physCharge);
538+ if (mc.isPhysicalPrimary () && std::abs (mc.eta ()) < 0.8 && std::abs (physCharge) >= kMinCharge ) {
530539 histos.fill (HIST (" mEta" ), mc.eta ());
531540 histos.fill (HIST (" mPt" ), mc.pt ());
532541 histos.fill (HIST (" mPhi" ), mc.phi ());
@@ -535,13 +544,11 @@ struct FactorialMomentsTask {
535544 }
536545 }
537546 }
538-
539547 for (int iPt = 0 ; iPt < numPt; ++iPt) {
540548 if (countTracks[iPt] > 0 ) {
541549 mHistArrQA [iPt * 4 + 3 ]->Fill (countTracks[iPt]);
542550 }
543551 }
544-
545552 calculateMoments (mHistArrReset );
546553 }
547554
@@ -569,6 +576,7 @@ struct FactorialMomentsTask {
569576 if ((track.pt () < ptMin) || (!track.isGlobalTrack ()) || (track.tpcNClsFindable () < mintPCCls)) {
570577 continue ;
571578 }
579+ histos.fill (HIST (" mTPCdEdxVsP" ), track.p (), track.tpcSignal ());
572580 histos.fill (HIST (" mCollID" ), track.collisionId ());
573581 histos.fill (HIST (" mEta" ), track.eta ());
574582 histos.fill (HIST (" mPt" ), track.pt ());
@@ -580,7 +588,7 @@ struct FactorialMomentsTask {
580588 histos.fill (HIST (" mChi2ITS" ), track.itsChi2NCl ());
581589 histos.fill (HIST (" mChi2TRD" ), track.trdChi2 ());
582590 histos.fill (HIST (" mDCAxy" ), track.dcaXY ());
583- histos.fill (HIST (" mDCAx " ), track.dcaZ ());
591+ histos.fill (HIST (" mDCAz " ), track.dcaZ ());
584592 histos.fill (HIST (" mDCAxyPt" ), track.pt (), track.dcaXY ());
585593 histos.fill (HIST (" mDCAzPt" ), track.pt (), track.dcaZ ());
586594 histos.fill (HIST (" mNSharedClsTPC" ), track.tpcNClsShared ());
@@ -589,10 +597,11 @@ struct FactorialMomentsTask {
589597 histos.fill (HIST (" mNFractionShClsTPC" ), track.tpcFractionSharedCls ());
590598 histos.fill (HIST (" mSharedClsvsPt" ), track.pt (), track.tpcNClsShared ());
591599 histos.fill (HIST (" mSharedClsProbvsPt" ), track.pt (), track.tpcFractionSharedCls () / track.tpcNClsCrossedRows ());
600+ histos.fill (HIST (" mCrossedRowsfindablesvsPt" ), track.pt (), track.tpcNClsCrossedRows () / track.tpcNClsFindable ());
592601 checkpT (track);
593602 }
594603 for (int iPt = 0 ; iPt < numPt; ++iPt) {
595- if (countTracks[iPt] > 0 ) {
604+ if (countTracks[iPt] < 3705 ) {
596605 mHistArrQA [iPt * 4 + 3 ]->Fill (countTracks[iPt]);
597606 }
598607 }
0 commit comments