Skip to content

Commit 51b4524

Browse files
committed
GPU QA: quick fix for rejection histogram bug
1 parent a5c604d commit 51b4524

File tree

2 files changed

+1
-133
lines changed

2 files changed

+1
-133
lines changed

Detectors/TPC/base/test/testTPCCalDet.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ BOOST_AUTO_TEST_CASE(CalDetStreamerTest)
351351
o2::tpc::DeadChannelMapCreator creator{};
352352
creator.init("https://alice-ccdb.cern.ch");
353353
creator.loadIDCPadFlags(1731274461770);
354+
creator.loadFEEConfig(1731274461770);
354355
}
355356

356357
} // namespace o2::tpc

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,6 @@ int32_t GPUQA::InitQACreateHistograms()
543543
createHist(mT0[1], "tracks_t0_res", "tracks_t0_res", 1000, -100, 100);
544544
createHist(mClXY, "clXY", "clXY", 1000, -250, 250, 1000, -250, 250); // TODO: Pass name only once
545545

546-
const int padCount = GPUTPCGeometry::NPads(GPUCA_ROW_COUNT - 1);
547-
for (int32_t i = 0; i < 3; i++) {
548-
snprintf(name, 2048, "clrej_%d", i);
549-
createHist(mClRej[i], name, name, 2 * padCount, -padCount / 2 + 0.5f, padCount / 2 - 0.5f, GPUCA_ROW_COUNT, 0, GPUCA_ROW_COUNT - 1);
550-
}
551-
createHist(mClRejP, "clrejp", "clrejp", GPUCA_ROW_COUNT, 0, GPUCA_ROW_COUNT - 1);
552546
}
553547

554548
if ((mQATasks & taskClusterCounts) && mConfig.clusterRejectionHistograms) {
@@ -1812,78 +1806,6 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
18121806

18131807
uint32_t nCl = clNative ? clNative->nClustersTotal : mTracking->GetProcessors()->tpcMerger.NMaxClusters();
18141808
mClusterCounts.nTotal += nCl;
1815-
if (mQATasks & taskClusterCounts) {
1816-
for (uint32_t iSector = 0; iSector < GPUCA_NSECTORS; iSector++) {
1817-
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;
1820-
int32_t attach = mTracking->mIOPtrs.mergedTrackHitAttachment[i];
1821-
const auto& r = checkClusterState<true>(attach, &mClusterCounts);
1822-
1823-
if (mcAvail) {
1824-
float totalWeight = 0, weight400 = 0, weight40 = 0;
1825-
for (int32_t j = 0; j < GetMCLabelNID(i); j++) {
1826-
const auto& label = GetMCLabel(i, j);
1827-
if (GetMCLabelID(label) >= 0) {
1828-
totalWeight += GetMCLabelWeight(label);
1829-
if (GetMCTrackObj(mMCParam, label).pt >= 0.4) {
1830-
weight400 += GetMCLabelWeight(label);
1831-
}
1832-
if (GetMCTrackObj(mMCParam, label).pt <= 0.04) {
1833-
weight40 += GetMCLabelWeight(label);
1834-
}
1835-
}
1836-
}
1837-
if (totalWeight > 0 && 10.f * weight400 >= totalWeight) {
1838-
if (!r.unattached && !r.protect && !r.physics) {
1839-
mClusterCounts.nFakeRemove400++;
1840-
int32_t totalFake = weight400 < 0.9f * totalWeight;
1841-
if (totalFake) {
1842-
mClusterCounts.nFullFakeRemove400++;
1843-
}
1844-
/*printf("Fake removal (%d): Hit %7d, attached %d lowPt %d looper %d tube200 %d highIncl %d tube %d bad %d recPt %7.2f recLabel %6d", totalFake, i, (int32_t) (mClusterParam[i].attached || mClusterParam[i].fakeAttached),
1845-
(int32_t) lowPt, (int32_t) ((attach & gputpcgmmergertypes::attachGoodLeg) == 0), (int32_t) ((attach & gputpcgmmergertypes::attachTube) && mev200),
1846-
(int32_t) ((attach & gputpcgmmergertypes::attachHighIncl) != 0), (int32_t) ((attach & gputpcgmmergertypes::attachTube) != 0), (int32_t) ((attach & gputpcgmmergertypes::attachGood) == 0),
1847-
fabsf(qpt) > 0 ? 1.f / qpt : 0.f, id);
1848-
for (int32_t j = 0;j < GetMCLabelNID(i);j++)
1849-
{
1850-
//if (GetMCLabelID(i, j) < 0) break;
1851-
printf(" - label%d %6d weight %5d", j, GetMCLabelID(i, j), (int32_t) GetMCLabelWeight(i, j));
1852-
if (GetMCLabelID(i, j) >= 0) printf(" - pt %7.2f", mMCParam[GetMCLabelID(i, j)].pt);
1853-
else printf(" ");
1854-
}
1855-
printf("\n");*/
1856-
}
1857-
mClusterCounts.nAbove400++;
1858-
}
1859-
if (totalWeight > 0 && weight40 >= 0.9 * totalWeight) {
1860-
mClusterCounts.nBelow40++;
1861-
if (r.protect || r.physics) {
1862-
mClusterCounts.nFakeProtect40++;
1863-
}
1864-
}
1865-
}
1866-
1867-
if (r.physics) {
1868-
mClusterCounts.nPhysics++;
1869-
}
1870-
if (r.protect) {
1871-
mClusterCounts.nProt++;
1872-
}
1873-
if (r.unattached) {
1874-
mClusterCounts.nUnattached++;
1875-
}
1876-
if (mTracking && mTracking->mIOPtrs.clustersNative) {
1877-
const auto& cl = mTracking->mIOPtrs.clustersNative->clustersLinear[i];
1878-
mClRej[0]->Fill(cl.getPad() - GPUTPCGeometry::NPads(iRow) / 2 + 0.5, iRow, 1.f);
1879-
if (!r.unattached && !r.protect) {
1880-
mClRej[1]->Fill(cl.getPad() - GPUTPCGeometry::NPads(iRow) / 2 + 0.5, iRow, 1.f);
1881-
}
1882-
}
1883-
}
1884-
}
1885-
}
1886-
}
18871809

18881810
// Process cluster count statistics
18891811
if ((mQATasks & taskClusterCounts) && mConfig.clusterRejectionHistograms) {
@@ -3023,61 +2945,6 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
30232945
mCClXY->Print(Form("%s/clustersXY.%s", mConfig.plotsDir.c_str(), mConfig.writeFileExt.c_str()));
30242946
}
30252947

3026-
if (mQATasks & taskClusterCounts) {
3027-
mClRej[2]->Divide(mClRej[1], mClRej[0]);
3028-
3029-
for (int32_t i = 0; i < 3; i++) {
3030-
if (tout && !mConfig.inputHistogramsOnly) {
3031-
mClRej[i]->Write();
3032-
}
3033-
mPClRej[i]->cd();
3034-
mClRej[i]->SetTitle(REJECTED_NAMES[i]);
3035-
mClRej[i]->SetOption("colz");
3036-
mClRej[i]->Draw();
3037-
mCClRej[i]->cd();
3038-
mCClRej[i]->Print(Form("%s/clustersRej%d%s.pdf", mConfig.plotsDir.c_str(), i, REJECTED_NAMES[i]));
3039-
if (mConfig.writeFileExt != "") {
3040-
mCClRej[i]->Print(Form("%s/clustersRej%d%s.%s", mConfig.plotsDir.c_str(), i, REJECTED_NAMES[i], mConfig.writeFileExt.c_str()));
3041-
}
3042-
}
3043-
3044-
mPClRejP->cd();
3045-
for (int32_t k = 0; k < ConfigNumInputs; k++) {
3046-
auto* tmp = mClRej[0];
3047-
if (GetHist(tmp, tin, k, nNewInput) == nullptr) {
3048-
continue;
3049-
}
3050-
TH1D* proj1 = tmp->ProjectionY(Form("clrejptmp1%d", k)); // TODO: Clean up names
3051-
proj1->SetDirectory(nullptr);
3052-
tmp = mClRej[1];
3053-
if (GetHist(tmp, tin, k, nNewInput) == nullptr) {
3054-
continue;
3055-
}
3056-
TH1D* proj2 = tmp->ProjectionY(Form("clrejptmp2%d", k));
3057-
proj2->SetDirectory(nullptr);
3058-
3059-
auto* e = mClRejP;
3060-
if (GetHist(e, tin, k, nNewInput) == nullptr) {
3061-
continue;
3062-
}
3063-
e->Divide(proj2, proj1);
3064-
if (tout && !mConfig.inputHistogramsOnly && k == 0) {
3065-
e->Write();
3066-
}
3067-
delete proj1;
3068-
delete proj2;
3069-
e->SetMinimum(-0.02);
3070-
e->SetMaximum(0.22);
3071-
e->SetTitle("Rejected Clusters");
3072-
e->GetXaxis()->SetTitle("Pad Row");
3073-
e->GetYaxis()->SetTitle("Rejected Clusters (fraction)");
3074-
e->Draw(k == 0 ? "" : "same");
3075-
}
3076-
mPClRejP->Print(Form("%s/clustersRejProjected.pdf", mConfig.plotsDir.c_str()));
3077-
if (mConfig.writeFileExt != "") {
3078-
mPClRejP->Print(Form("%s/clustersRejProjected.%s", mConfig.plotsDir.c_str(), mConfig.writeFileExt.c_str()));
3079-
}
3080-
}
30812948
}
30822949

30832950
if (tout && !mConfig.inputHistogramsOnly && mConfig.writeMCLabels) {

0 commit comments

Comments
 (0)