@@ -152,6 +152,7 @@ static constexpr float PT_MIN_CLUST = 0.01;
152152static constexpr float PT_MAX = 20 ;
153153static constexpr float ETA_MAX = 1.5 ;
154154static constexpr float ETA_MAX2 = 0.9 ;
155+ static constexpr int32_t PADROW_CHECK_MINCLS = 50 ;
155156
156157static constexpr bool CLUST_HIST_INT_SUM = false ;
157158
@@ -525,9 +526,10 @@ int32_t GPUQA::InitQACreateHistograms()
525526 createHist (mClusters [i], name, name, AXIS_BINS[4 ], binsPt.get ());
526527 }
527528
528- createHist (mPadRow [0 ], " padrow0" , " padrow0" , GPUCA_ROW_COUNT, 0 , GPUCA_ROW_COUNT - 1 , GPUCA_ROW_COUNT, 0 , GPUCA_ROW_COUNT - 1 );
529- createHist (mPadRow [1 ], " padrow1" , " padrow1" , 100 .f , -0 .2f , 0 .2f , GPUCA_ROW_COUNT, 0 , GPUCA_ROW_COUNT - 1 );
530- createHist (mPadRow [2 ], " padrow2" , " padrow2" , 100 .f , -0 .2f , 0 .2f , GPUCA_ROW_COUNT, 0 , GPUCA_ROW_COUNT - 1 );
529+ createHist (mPadRow [0 ], " padrow0" , " padrow0" , GPUCA_ROW_COUNT - PADROW_CHECK_MINCLS, 0 , GPUCA_ROW_COUNT - 1 - PADROW_CHECK_MINCLS, GPUCA_ROW_COUNT - PADROW_CHECK_MINCLS, 0 , GPUCA_ROW_COUNT - 1 - PADROW_CHECK_MINCLS);
530+ createHist (mPadRow [1 ], " padrow1" , " padrow1" , 100 .f , -0 .2f , 0 .2f , GPUCA_ROW_COUNT - PADROW_CHECK_MINCLS, 0 , GPUCA_ROW_COUNT - 1 - PADROW_CHECK_MINCLS);
531+ createHist (mPadRow [2 ], " padrow2" , " padrow2" , 100 .f , -0 .2f , 0 .2f , GPUCA_ROW_COUNT - PADROW_CHECK_MINCLS, 0 , GPUCA_ROW_COUNT - 1 - PADROW_CHECK_MINCLS);
532+ createHist (mPadRow [3 ], " padrow3" , " padrow3" , 100 .f , 0 , 300000 , GPUCA_ROW_COUNT - PADROW_CHECK_MINCLS, 0 , GPUCA_ROW_COUNT - 1 - PADROW_CHECK_MINCLS);
531533 }
532534
533535 if (mQATasks & taskTrackStatistics) {
@@ -968,7 +970,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
968970 nClusters++;
969971 uint32_t hitId = mTracking ->mIOPtrs .mergedTrackHits [track.FirstClusterRef () + k].num ;
970972 if (hitId >= GetNMCLabels ()) {
971- GPUError (" Invalid hit id %u > %d (nClusters %d)" , hitId, GetNMCLabels (), mTracking -> mIOPtrs . clustersNative ? mTracking -> mIOPtrs . clustersNative ->nClustersTotal : 0 );
973+ GPUError (" Invalid hit id %u > %d (nClusters %d)" , hitId, GetNMCLabels (), clNative ? clNative ->nClustersTotal : 0 );
972974 throw std::runtime_error (" qa error" );
973975 }
974976 acc.addLabel (hitId);
@@ -1069,7 +1071,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
10691071 }
10701072 }
10711073 }
1072- if ((mQATasks & taskClusterAttach)) {
1074+ if ((mQATasks & taskClusterAttach) && !tracksExternal ) {
10731075 std::vector<uint8_t > lowestPadRow (mTracking ->mIOPtrs .nMergedTracks );
10741076 // fill cluster adjacent status
10751077 if (mTracking ->mIOPtrs .mergedTrackHitAttachment ) {
@@ -1096,12 +1098,12 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
10961098 }
10971099 }
10981100 }
1099- if (mTracking ->mIOPtrs .nMergedTracks && mTracking -> mIOPtrs . clustersNative ) {
1101+ if (mTracking ->mIOPtrs .nMergedTracks && clNative ) {
11001102 std::fill (lowestPadRow.begin (), lowestPadRow.end (), 255 );
11011103 for (uint32_t iSector = 0 ; iSector < GPUCA_NSECTORS; iSector++) {
11021104 for (uint32_t iRow = 0 ; iRow < GPUCA_ROW_COUNT; iRow++) {
1103- for (uint32_t iCl = 0 ; iCl < mTracking -> mIOPtrs . clustersNative ->nClusters [iSector][iRow]; iCl++) {
1104- int32_t i = mTracking -> mIOPtrs . clustersNative ->clusterOffset [iSector][iRow] + iCl;
1105+ for (uint32_t iCl = 0 ; iCl < clNative ->nClusters [iSector][iRow]; iCl++) {
1106+ int32_t i = clNative ->clusterOffset [iSector][iRow] + iCl;
11051107 for (int32_t j = 0 ; j < GetMCLabelNID (i); j++) {
11061108 uint32_t trackId = GetMCTrackObj (mTrackMCLabelsReverse , GetMCLabel (i, j));
11071109 if (trackId < lowestPadRow.size () && lowestPadRow[trackId] > iRow) {
@@ -1113,12 +1115,21 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
11131115 }
11141116 for (uint32_t i = 0 ; i < mTracking ->mIOPtrs .nMergedTracks ; i++) {
11151117 const auto & trk = mTracking ->mIOPtrs .mergedTracks [i];
1116- if (trk.OK () && lowestPadRow[i] != 255 && trk.NClustersFitted () > 70 && CAMath::Abs (trk.GetParam ().GetQPt ()) < 0.5 ) {
1117- int32_t lowestRow = CAMath::Min (mTracking ->mIOPtrs .mergedTrackHits [trk.FirstClusterRef ()].row , mTracking ->mIOPtrs .mergedTrackHits [trk.FirstClusterRef () + trk.NClusters () - 1 ].row );
1118+ if (trk.OK () && lowestPadRow[i] != 255 && trk.NClustersFitted () >= PADROW_CHECK_MINCLS && CAMath::Abs (trk.GetParam ().GetQPt ()) < 1.0 ) {
1119+ const auto & lowestCl = mTracking ->mIOPtrs .mergedTrackHits [trk.FirstClusterRef ()].row < mTracking ->mIOPtrs .mergedTrackHits [trk.FirstClusterRef () + trk.NClusters () - 1 ].row ? mTracking ->mIOPtrs .mergedTrackHits [trk.FirstClusterRef ()] : mTracking ->mIOPtrs .mergedTrackHits [trk.FirstClusterRef () + trk.NClusters () - 1 ];
1120+ const int32_t lowestRow = lowestCl.row ;
11181121 mPadRow [0 ]->Fill (lowestPadRow[i], lowestRow, 1 .f );
11191122 mPadRow [1 ]->Fill (CAMath::ATan2 (trk.GetParam ().GetY (), trk.GetParam ().GetX ()), lowestRow, 1 .f );
1120- if (lowestPadRow[i] == 0 && lowestRow != 0 ) {
1121- mPadRow [2 ]->Fill (CAMath::ATan2 (trk.GetParam ().GetY (), trk.GetParam ().GetX ()), lowestRow, 1 .f );
1123+ if (lowestPadRow[i] < 10 && lowestRow > lowestPadRow[i] + 3 ) {
1124+ const auto & cl = clNative->clustersLinear [lowestCl.num ];
1125+ float x, y, z;
1126+ mTracking ->GetTPCTransformHelper ()->Transform (lowestCl.sector , lowestCl.row , cl.getPad (), cl.getTime (), x, y, z, trk.GetParam ().GetTOffset ());
1127+ float phi = CAMath::ATan2 (y, x);
1128+ mPadRow [2 ]->Fill (phi, lowestRow, 1 .f );
1129+ if (CAMath::Abs (phi) < 0.15 ) {
1130+ const float time = cl.getTime ();
1131+ mPadRow [3 ]->Fill (mTracking ->GetParam ().GetUnscaledMult (time), lowestRow, 1 .f );
1132+ }
11221133 }
11231134 }
11241135 }
@@ -1485,7 +1496,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
14851496 }
14861497 }
14871498
1488- if (mQATasks & taskClusterAttach) {
1499+ if (( mQATasks & taskClusterAttach) && !tracksExternal ) {
14891500 // Fill cluster histograms
14901501 for (uint32_t iTrk = 0 ; iTrk < nReconstructedTracks; iTrk++) {
14911502 const GPUTPCGMMergedTrack& track = mTracking ->mIOPtrs .mergedTracks [iTrk];
@@ -1715,7 +1726,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
17151726 GPUWarning (" No MC information available, only running partial TPC QA!" );
17161727 } // mcAvail
17171728
1718- if (mQATasks & taskTrackStatistics) {
1729+ if (( mQATasks & taskTrackStatistics) && !tracksExternal ) {
17191730 // Fill track statistic histograms
17201731 std::vector<std::array<float , 3 >> clusterAttachCounts;
17211732 if (mcAvail) {
@@ -1815,8 +1826,8 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
18151826 if (mQATasks & taskClusterCounts) {
18161827 for (uint32_t iSector = 0 ; iSector < GPUCA_NSECTORS; iSector++) {
18171828 for (uint32_t iRow = 0 ; iRow < GPUCA_ROW_COUNT; iRow++) {
1818- for (uint32_t iCl = 0 ; iCl < mTracking -> mIOPtrs . clustersNative ->nClusters [iSector][iRow]; iCl++) {
1819- uint32_t i = mTracking -> mIOPtrs . clustersNative ->clusterOffset [iSector][iRow] + iCl;
1829+ for (uint32_t iCl = 0 ; iCl < clNative ->nClusters [iSector][iRow]; iCl++) {
1830+ uint32_t i = clNative ->clusterOffset [iSector][iRow] + iCl;
18201831 int32_t attach = mTracking ->mIOPtrs .mergedTrackHitAttachment [i];
18211832 const auto & r = checkClusterState<true >(attach, &mClusterCounts );
18221833
@@ -1873,8 +1884,8 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
18731884 if (r.unattached ) {
18741885 mClusterCounts .nUnattached ++;
18751886 }
1876- if (mTracking && mTracking -> mIOPtrs . clustersNative ) {
1877- const auto & cl = mTracking -> mIOPtrs . clustersNative ->clustersLinear [i];
1887+ if (mTracking && clNative ) {
1888+ const auto & cl = clNative ->clustersLinear [i];
18781889 mClRej [0 ]->Fill (cl.getPad () - GPUTPCGeometry::NPads (iRow) / 2 + 0.5 , iRow, 1 .f );
18791890 if (!r.unattached && !r.protect ) {
18801891 mClRej [1 ]->Fill (cl.getPad () - GPUTPCGeometry::NPads (iRow) / 2 + 0.5 , iRow, 1 .f );
@@ -1895,7 +1906,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
18951906 GPUInfo (" QA Time: Cluster Counts:\t %6.0f us" , timer.GetCurrentElapsedTime (true ) * 1e6 );
18961907 }
18971908
1898- if (mConfig .dumpToROOT ) {
1909+ if (mConfig .dumpToROOT && !tracksExternal ) {
18991910 if (!clNative || !mTracking || !mTracking ->mIOPtrs .mergedTrackHitAttachment || !mTracking ->mIOPtrs .mergedTracks ) {
19001911 throw std::runtime_error (" Cannot dump non o2::tpc::clusterNative clusters, need also hit attachmend and GPU tracks" );
19011912 }
@@ -2273,7 +2284,7 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
22732284 mPClRejP = createGarbageCollected<TPad>(" p0" , " " , 0.0 , 0.0 , 1.0 , 1.0 );
22742285 mPClRejP ->Draw ();
22752286
2276- for (int32_t i = 0 ; i < 3 ; i++) {
2287+ for (int32_t i = 0 ; i < 4 ; i++) {
22772288 snprintf (name, 2048 , " cpadrow%d" , i);
22782289 mCPadRow [i] = createGarbageCollected<TCanvas>(name, name, 0 , 0 , 700 , 700 . * 2 . / 3 .);
22792290 mCPadRow [i]->cd ();
@@ -2842,19 +2853,28 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
28422853 }
28432854 }
28442855
2845- for (int32_t i = 0 ; i < 3 ; i++) {
2856+ for (int32_t i = 0 ; i < 4 ; i++) {
28462857 auto * e = mPadRow [i];
28472858 if (tout && !mConfig .inputHistogramsOnly ) {
28482859 e->Write ();
28492860 }
28502861 mPPadRow [i]->cd ();
28512862 e->SetOption (" colz" );
2852- e->SetTitle (i == 2 ? " First Track Pad Row (row_{MC} = 0, row_{trk} > 0)" : " First Track Pad Row" );
2853- e->GetXaxis ()->SetTitle (i ? " #Phi (sector)" : " First MC Pad Row" );
2863+ std::string title = " First Track Pad Row (p_{T} > 1GeV, N_{Cl} #geq " + std::to_string (PADROW_CHECK_MINCLS);
2864+ if (i >= 2 ) {
2865+ title += " , row_{trk} > row_{MC} + 3, row_{MC} < 10" ;
2866+ }
2867+ if (i >= 3 ) {
2868+ title += " , #Phi_{Cl} < 0.15" ;
2869+ }
2870+ title += " )" ;
2871+
2872+ e->SetTitle (title.c_str ());
2873+ e->GetXaxis ()->SetTitle (i == 3 ? " Local Occupancy" : (i ? " #Phi_{Cl} (sector)" : " First MC Pad Row" ));
28542874 e->GetYaxis ()->SetTitle (" First Pad Row" );
28552875 e->Draw ();
28562876 mCPadRow [i]->cd ();
2857- static const constexpr char * PADROW_NAMES[3 ] = {" MC" , " Phi" , " Phi1" };
2877+ static const constexpr char * PADROW_NAMES[4 ] = {" MC" , " Phi" , " Phi1" , " Occ " };
28582878 mCPadRow [i]->Print (Form (" %s/padRow%s.pdf" , mConfig .plotsDir .c_str (), PADROW_NAMES[i]));
28592879 if (mConfig .writeFileExt != " " ) {
28602880 mCPadRow [i]->Print (Form (" %s/padRow%s.%s" , mConfig .plotsDir .c_str (), PADROW_NAMES[i], mConfig .writeFileExt .c_str ()));
0 commit comments