@@ -54,9 +54,11 @@ const AxisSpec axisSparseDcaZ{100, -1., 1., "DCA_{z}, cm"};
5454struct TimeDependentQaTask {
5555 Configurable<float > confTimeBinWidthInSec{" TimeBinWidthInSec" , 0.25 , " Width of time bins in seconds" }; // o2-linter: disable=name/configurable (temporary fix)
5656 Configurable<int > confTakeVerticesWithUPCsettings{" ConsiderVerticesWithUPCsettings" , 0 , " Take vertices: 0 - all , 1 - only without UPC settings, 2 - only with UPC settings" }; // o2-linter: disable=name/configurable (temporary fix)
57- Configurable<int > confFillPhiVsTimeHist {" FlagFillPhiVsTimeHist" , 2 , " 0 - don't fill , 1 - fill only for global/7cls/TRD/TOF tracks, 2 - fill also layer-by-layer" }; // o2-linter: disable=name/configurable (temporary fix)
58- Configurable<int > confFillEtaPhiVsTimeHist {" FlagFillEtaPhiVsTimeHist" , 0 , " 0 - don't fill , 1 - fill" }; // o2-linter: disable=name/configurable (temporary fix)
57+ Configurable<int > confFlagFillPhiVsTimeHist {" FlagFillPhiVsTimeHist" , 2 , " 0 - don't fill , 1 - fill only for global/7cls/TRD/TOF tracks, 2 - fill also layer-by-layer" }; // o2-linter: disable=name/configurable (temporary fix)
58+ Configurable<int > confFlagFillEtaPhiVsTimeHist {" FlagFillEtaPhiVsTimeHist" , 0 , " 0 - don't fill , 1 - fill" }; // o2-linter: disable=name/configurable (temporary fix)
5959 Configurable<float > confCutOnNtpcClsForSharedFractAndDeDxCalc{" CutOnNtpcClsForSharedFractAndDeDxCalc" , 70 , " " }; // o2-linter: disable=name/configurable (temporary fix)
60+ Configurable<int > confFlagCheckMshape{" FlagCheckMshape" , 0 , " 0 - don't check , 1 - check" }; // o2-linter: disable=name/configurable (temporary fix)
61+ Configurable<int > confFlagCheckQoverPtHist{" FlagCheckQoverPtHist" , 1 , " 0 - don't check , 1 - check" }; // o2-linter: disable=name/configurable (temporary fix)
6062
6163 enum EvSelBitsToMonitor {
6264 enCollisionsAll = 0 ,
@@ -124,12 +126,14 @@ struct TimeDependentQaTask {
124126 ccdb->setCaching (true );
125127 ccdb->setLocalObjectValidityChecking ();
126128 histos.add (" allTracks/hQoverPt" , " " , kTH1F , {axisQoverPt});
129+ if (confFlagCheckQoverPtHist) {
130+ histos.add (" allTracks/hQoverPtDcaR" , " " , kTH2F , {axisSparseQoverPt, axisSparseDcaR});
131+ histos.add (" allTracks/hQoverPtDcaZ" , " " , kTH2F , {axisSparseQoverPt, axisSparseDcaZ});
132+ }
127133 histos.add (" allTracks/hDcaR" , " " , kTH1F , {axisDcaR});
128134 histos.add (" allTracks/hDcaZ" , " " , kTH1F , {axisDcaZ});
129135 histos.add (" allTracks/hDcaRafterCuts" , " " , kTH1F , {axisDcaR});
130136 histos.add (" allTracks/hDcaZafterCuts" , " " , kTH1F , {axisDcaZ});
131- histos.add (" allTracks/hQoverPtDcaR" , " " , kTH2F , {axisSparseQoverPt, axisSparseDcaR});
132- histos.add (" allTracks/hQoverPtDcaZ" , " " , kTH2F , {axisSparseQoverPt, axisSparseDcaZ});
133137
134138 histos.add (" PVcontrib/hDcaRafterCuts" , " " , kTH1F , {axisDcaR});
135139 histos.add (" PVcontrib/hDcaZafterCuts" , " " , kTH1F , {axisDcaZ});
@@ -145,6 +149,8 @@ struct TimeDependentQaTask {
145149 histos.add (" C/globalPV/hDcaZafterCuts" , " " , kTH1F , {axisDcaZ});
146150 }
147151
152+ Preslice<BarrelTracks> perCollision = aod::track::collisionId;
153+
148154 void processRun3 (
149155 ColEvSels const & cols,
150156 BarrelTracks const & tracks,
@@ -195,8 +201,9 @@ struct TimeDependentQaTask {
195201 histos.add (" hSecondsOccupancyByFT0C" , " " , kTH1D , {axisSeconds});
196202
197203 // QA for UPC settings
198- histos.add (" hSecondsUPCverticesBeforeSel8" , " " , kTH2F , {axisSeconds, {2 , -0.5 , 1.5 , " Is vertex with UPC settings" }});
199- histos.add (" hSecondsUPCvertices" , " " , kTH2F , {axisSeconds, {2 , -0.5 , 1.5 , " Is vertex with UPC settings after sel8" }});
204+ histos.add (" hSecondsUPCverticesBeforeAllCuts" , " " , kTH2F , {axisSeconds, {2 , -0.5 , 1.5 , " Is vertex with UPC settings" }});
205+ histos.add (" hSecondsUPCverticesBeforeSel8" , " " , kTH2F , {axisSeconds, {2 , -0.5 , 1.5 , " Is vertex with UPC settings after |vZ|<10 cut" }});
206+ histos.add (" hSecondsUPCvertices" , " " , kTH2F , {axisSeconds, {2 , -0.5 , 1.5 , " Is vertex with UPC settings after |vZ|<10 and sel8 cuts" }});
200207
201208 // ### QA event selection bits
202209 int nEvSelBits = enNumEvSelBits;
@@ -277,14 +284,17 @@ struct TimeDependentQaTask {
277284 const AxisSpec axisNclsTPC{40 , -0.5 , 159.5 , " n TPC cls" };
278285 const AxisSpec axisFraction{20 , 0 , 1 ., " Fraction shared cls Tpc" };
279286 histos.add (" allTracks/hSecondsTracks" , " " , kTH1D , {axisSeconds});
280- histos.add (" allTracks/hSecondsQoverPtSumDcaR" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
281- histos.add (" allTracks/hSecondsQoverPtSumDcaZ" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
287+ if (confFlagCheckQoverPtHist) {
288+ histos.add (" allTracks/hSecondsQoverPtSumDcaR" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
289+ histos.add (" allTracks/hSecondsQoverPtSumDcaZ" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
290+ }
282291 histos.add (" allTracks/hSecondsSumDcaR" , " " , kTH1D , {axisSeconds});
283292 histos.add (" allTracks/hSecondsSumDcaZ" , " " , kTH1D , {axisSeconds});
284293 histos.add (" allTracks/hSecondsSumPt" , " " , kTH1D , {axisSeconds});
285294 histos.add (" allTracks/hSecondsNumClsIts" , " " , kTH2D , {axisSeconds, axisNclsITS});
286295 histos.add (" allTracks/hSecondsChi2NClIts" , " " , kTH1D , {axisSeconds});
287- histos.add (" allTracks/hSecondsTracksMshape" , " " , kTH1D , {axisSeconds});
296+ if (confFlagCheckMshape)
297+ histos.add (" allTracks/hSecondsTracksMshape" , " " , kTH1D , {axisSeconds});
288298
289299 // QA for PV contributors
290300 histos.add (" PVcontrib/hSecondsTracks" , " " , kTH1D , {axisSeconds});
@@ -300,8 +310,10 @@ struct TimeDependentQaTask {
300310 // ### A side
301311 // global tracks
302312 histos.add (" A/global/hSecondsNumTracks" , " " , kTH1D , {axisSeconds});
303- histos.add (" A/global/hSecondsQoverPtSumDcaR" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
304- histos.add (" A/global/hSecondsQoverPtSumDcaZ" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
313+ if (confFlagCheckQoverPtHist) {
314+ histos.add (" A/global/hSecondsQoverPtSumDcaR" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
315+ histos.add (" A/global/hSecondsQoverPtSumDcaZ" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
316+ }
305317 histos.add (" A/global/hSecondsSumDcaR" , " " , kTH1D , {axisSeconds});
306318 histos.add (" A/global/hSecondsSumDcaZ" , " " , kTH1D , {axisSeconds});
307319 histos.add (" A/global/hSecondsSumPt" , " " , kTH1D , {axisSeconds});
@@ -327,8 +339,10 @@ struct TimeDependentQaTask {
327339 // ### C side
328340 // global tracks
329341 histos.add (" C/global/hSecondsNumTracks" , " " , kTH1D , {axisSeconds});
330- histos.add (" C/global/hSecondsQoverPtSumDcaR" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
331- histos.add (" C/global/hSecondsQoverPtSumDcaZ" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
342+ if (confFlagCheckQoverPtHist) {
343+ histos.add (" C/global/hSecondsQoverPtSumDcaR" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
344+ histos.add (" C/global/hSecondsQoverPtSumDcaZ" , " " , kTH2D , {axisSeconds, axisSparseQoverPt});
345+ }
332346 histos.add (" C/global/hSecondsSumDcaR" , " " , kTH1D , {axisSeconds});
333347 histos.add (" C/global/hSecondsSumDcaZ" , " " , kTH1D , {axisSeconds});
334348 histos.add (" C/global/hSecondsSumPt" , " " , kTH1D , {axisSeconds});
@@ -354,7 +368,7 @@ struct TimeDependentQaTask {
354368 // phi holes vs time
355369 const AxisSpec axisPhi{64 , 0 , TMath::TwoPi (), " #varphi" }; // o2-linter: disable=external-pi (temporary fix)
356370 const AxisSpec axisEta{10 , -0.8 , 0.8 , " #eta" };
357- if (confFillPhiVsTimeHist == 2 ) {
371+ if (confFlagFillPhiVsTimeHist == 2 ) {
358372 histos.add (" hSecondsITSlayer0vsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
359373 histos.add (" hSecondsITSlayer1vsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
360374 histos.add (" hSecondsITSlayer2vsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
@@ -363,13 +377,13 @@ struct TimeDependentQaTask {
363377 histos.add (" hSecondsITSlayer5vsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
364378 histos.add (" hSecondsITSlayer6vsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
365379 }
366- if (confFillPhiVsTimeHist > 0 ) {
380+ if (confFlagFillPhiVsTimeHist > 0 ) {
367381 histos.add (" hSecondsITS7clsVsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
368382 histos.add (" hSecondsITSglobalVsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
369383 histos.add (" hSecondsITSTRDVsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
370384 histos.add (" hSecondsITSTOFVsPhi" , " " , kTH2F , {axisSeconds, axisPhi});
371385 }
372- if (confFillEtaPhiVsTimeHist )
386+ if (confFlagFillEtaPhiVsTimeHist )
373387 histos.add (" hSecondsITSglobalVsEtaPhi" , " " , kTH3F , {axisSeconds, axisEta, axisPhi});
374388 }
375389
@@ -412,6 +426,8 @@ struct TimeDependentQaTask {
412426 if (col.selection_bit (kIsTriggerTVX ) && col.selection_bit (kNoTimeFrameBorder ))
413427 histos.fill (HIST (" hSecondsCollisionsTVXTFborderCutNoVzCut" ), secFromSOR);
414428
429+ histos.fill (HIST (" hSecondsUPCverticesBeforeAllCuts" ), secFromSOR, isVertexUPC ? 1 : 0 );
430+
415431 if (std::fabs (col.posZ ()) > 10 )
416432 continue ;
417433
@@ -494,12 +510,16 @@ struct TimeDependentQaTask {
494510 histos.fill (HIST (" hSecondsIR" ), secFromSOR, hadronicRate);
495511
496512 // checking mShape flags in time:
497- auto mShapeTree = ccdb->getForTimeStamp <TTree>(" TPC/Calib/MShapePotential" , ts);
498- mshape.setFromTree (*mShapeTree );
499- bool isMshape = !mshape.getBoundaryPotential (ts).mPotential .empty ();
513+ bool isMshape = false ;
514+ if (confFlagCheckMshape) {
515+ auto mShapeTree = ccdb->getForTimeStamp <TTree>(" TPC/Calib/MShapePotential" , ts);
516+ mshape.setFromTree (*mShapeTree );
517+ isMshape = !mshape.getBoundaryPotential (ts).mPotential .empty ();
518+ }
500519
501520 // ##### track loop
502- for (const auto & track : tracks) {
521+ auto tracksGrouped = tracks.sliceBy (perCollision, col.globalIndex ());
522+ for (const auto & track : tracksGrouped) {
503523 // if (!track.hasTPC() || !track.hasITS())
504524 // continue;
505525 if (std::fabs (track.eta ()) > 0.8 || std::fabs (track.pt ()) < 0.2 )
@@ -522,21 +542,24 @@ struct TimeDependentQaTask {
522542
523543 double qpt = track.signed1Pt ();
524544 histos.fill (HIST (" allTracks/hQoverPt" ), qpt);
525- histos.fill (HIST (" allTracks/hQoverPtDcaR" ), qpt, dcaR);
526- histos.fill (HIST (" allTracks/hQoverPtDcaZ" ), qpt, dcaZ);
527-
545+ if (confFlagCheckQoverPtHist) {
546+ histos.fill (HIST (" allTracks/hQoverPtDcaR" ), qpt, dcaR);
547+ histos.fill (HIST (" allTracks/hQoverPtDcaZ" ), qpt, dcaZ);
548+ }
528549 // now consider only abs values for DCAs:
529550 double dcaRabs = std::fabs (dcaR);
530551 double dcaZabs = std::fabs (dcaZ);
531552
532553 histos.fill (HIST (" allTracks/hSecondsSumDcaR" ), secFromSOR, dcaRabs);
533554 histos.fill (HIST (" allTracks/hSecondsSumDcaZ" ), secFromSOR, dcaZabs);
534555 histos.fill (HIST (" allTracks/hSecondsSumPt" ), secFromSOR, track.pt ());
535- histos.fill (HIST (" allTracks/hSecondsQoverPtSumDcaR" ), secFromSOR, qpt, dcaRabs);
536- histos.fill (HIST (" allTracks/hSecondsQoverPtSumDcaZ" ), secFromSOR, qpt, dcaZabs);
556+ if (confFlagCheckQoverPtHist) {
557+ histos.fill (HIST (" allTracks/hSecondsQoverPtSumDcaR" ), secFromSOR, qpt, dcaRabs);
558+ histos.fill (HIST (" allTracks/hSecondsQoverPtSumDcaZ" ), secFromSOR, qpt, dcaZabs);
559+ }
537560 histos.fill (HIST (" allTracks/hSecondsNumClsIts" ), secFromSOR, track.itsNCls ());
538561 histos.fill (HIST (" allTracks/hSecondsChi2NClIts" ), secFromSOR, track.itsChi2NCl ());
539- if (isMshape) {
562+ if (confFlagCheckMshape && isMshape) {
540563 histos.fill (HIST (" allTracks/hSecondsTracksMshape" ), secFromSOR);
541564 }
542565
@@ -563,8 +586,10 @@ struct TimeDependentQaTask {
563586 histos.fill (HIST (" A/global/hDcaZafterCuts" ), dcaZ);
564587
565588 histos.fill (HIST (" A/global/hSecondsNumTracks" ), secFromSOR);
566- histos.fill (HIST (" A/global/hSecondsQoverPtSumDcaR" ), secFromSOR, qpt, dcaRabs);
567- histos.fill (HIST (" A/global/hSecondsQoverPtSumDcaZ" ), secFromSOR, qpt, dcaZabs);
589+ if (confFlagCheckQoverPtHist) {
590+ histos.fill (HIST (" A/global/hSecondsQoverPtSumDcaR" ), secFromSOR, qpt, dcaRabs);
591+ histos.fill (HIST (" A/global/hSecondsQoverPtSumDcaZ" ), secFromSOR, qpt, dcaZabs);
592+ }
568593 histos.fill (HIST (" A/global/hSecondsSumDcaR" ), secFromSOR, dcaRabs);
569594 histos.fill (HIST (" A/global/hSecondsSumDcaZ" ), secFromSOR, dcaZabs);
570595 histos.fill (HIST (" A/global/hSecondsSumPt" ), secFromSOR, track.pt ());
@@ -601,8 +626,10 @@ struct TimeDependentQaTask {
601626 histos.fill (HIST (" C/global/hDcaZafterCuts" ), dcaZ);
602627
603628 histos.fill (HIST (" C/global/hSecondsNumTracks" ), secFromSOR);
604- histos.fill (HIST (" C/global/hSecondsQoverPtSumDcaR" ), secFromSOR, qpt, dcaRabs);
605- histos.fill (HIST (" C/global/hSecondsQoverPtSumDcaZ" ), secFromSOR, qpt, dcaZabs);
629+ if (confFlagCheckQoverPtHist) {
630+ histos.fill (HIST (" C/global/hSecondsQoverPtSumDcaR" ), secFromSOR, qpt, dcaRabs);
631+ histos.fill (HIST (" C/global/hSecondsQoverPtSumDcaZ" ), secFromSOR, qpt, dcaZabs);
632+ }
606633 histos.fill (HIST (" C/global/hSecondsSumDcaR" ), secFromSOR, dcaRabs);
607634 histos.fill (HIST (" C/global/hSecondsSumDcaZ" ), secFromSOR, dcaZabs);
608635 histos.fill (HIST (" C/global/hSecondsSumPt" ), secFromSOR, track.pt ());
@@ -640,7 +667,7 @@ struct TimeDependentQaTask {
640667 // study ITS cluster pattern vs phi vs time (pt>1 GeV/c cut selects straight tracks)
641668 if (track.isPVContributor () && track.pt () > 1 ) {
642669 // layer-by-layer check
643- if (confFillPhiVsTimeHist == 2 ) {
670+ if (confFlagFillPhiVsTimeHist == 2 ) {
644671 if (track.itsClusterMap () & (1 << 0 ))
645672 histos.fill (HIST (" hSecondsITSlayer0vsPhi" ), secFromSOR, track.phi ());
646673 if (track.itsClusterMap () & (1 << 1 ))
@@ -657,7 +684,7 @@ struct TimeDependentQaTask {
657684 histos.fill (HIST (" hSecondsITSlayer6vsPhi" ), secFromSOR, track.phi ());
658685 }
659686 // tracks with conditions
660- if (confFillPhiVsTimeHist > 0 ) {
687+ if (confFlagFillPhiVsTimeHist > 0 ) {
661688 if (track.itsNCls () == 7 )
662689 histos.fill (HIST (" hSecondsITS7clsVsPhi" ), secFromSOR, track.phi ());
663690 if (track.isGlobalTrack ())
@@ -668,7 +695,7 @@ struct TimeDependentQaTask {
668695 histos.fill (HIST (" hSecondsITSTOFVsPhi" ), secFromSOR, track.phi ());
669696 }
670697 // eta-phi histogram for global tracks
671- if (confFillEtaPhiVsTimeHist && track.isGlobalTrack ()) {
698+ if (confFlagFillEtaPhiVsTimeHist && track.isGlobalTrack ()) {
672699 histos.fill (HIST (" hSecondsITSglobalVsEtaPhi" ), secFromSOR, track.eta (), track.phi ());
673700 }
674701 }
0 commit comments