Skip to content

Commit 827af3f

Browse files
committed
GPU QA: Drop obsolete csvDump function
1 parent cddf007 commit 827af3f

2 files changed

Lines changed: 0 additions & 113 deletions

File tree

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ AddOption(filterCharge, int, 0, "", 0, "Filter for positive (+1) or negative (-1
317317
AddOption(filterPID, int, -1, "", 0, "Filter for Particle Type (0 Electron, 1 Muon, 2 Pion, 3 Kaon, 4 Proton)")
318318
AddOption(nativeFitResolutions, bool, false, "", 0, "Create resolution histograms in the native fit units (sin(phi), tan(lambda), Q/Pt)")
319319
AddOption(enableLocalOutput, bool, true, "", 0, "Enable normal output to local PDF files / console")
320-
AddOption(csvDump, bool, false, "", 0, "Dump all clusters and Pt information into csv file")
321320
AddOption(writeMCLabels, bool, false, "", 0, "Store mc labels to file for later matching")
322321
AddOption(writeRootFiles, bool, false, "", 0, "Create ROOT canvas files")
323322
AddOptionVec(matchMCLabels, std::string, "", 0, "Read labels from files and match them, only process tracks where labels differ")

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,118 +1708,6 @@ void GPUQA::RunQA(bool matchOnly, const std::vector<o2::tpc::TrackTPC>* tracksEx
17081708
GPUInfo("QA Time: Cluster Counts:\t%6.0f us", timer.GetCurrentElapsedTime(true) * 1e6);
17091709
}
17101710

1711-
// Create CSV DumpTrackHits
1712-
if (mConfig.csvDump) {
1713-
if (!mTracking->GetParam().par.earlyTpcTransform) {
1714-
GPUError("Unsupported settings for csv dump\n");
1715-
return;
1716-
}
1717-
int totalNCls = GetNMCLabels();
1718-
if (totalNCls == 0) {
1719-
for (unsigned int iSlice = 0; iSlice < GPUChainTracking::NSLICES; iSlice++) {
1720-
totalNCls += mTracking->mIOPtrs.nClusterData[iSlice];
1721-
}
1722-
}
1723-
1724-
std::vector<float> clusterInfo(totalNCls);
1725-
memset(clusterInfo.data(), 0, clusterInfo.size() * sizeof(clusterInfo[0]));
1726-
for (unsigned int i = 0; i < nReconstructedTracks; i++) {
1727-
const GPUTPCGMMergedTrack& track = mTracking->mIOPtrs.mergedTracks[i];
1728-
if (!track.OK()) {
1729-
continue;
1730-
}
1731-
for (unsigned int k = 0; k < track.NClusters(); k++) {
1732-
if (mTracking->mIOPtrs.mergedTrackHits[track.FirstClusterRef() + k].state & GPUTPCGMMergedTrackHit::flagReject) {
1733-
continue;
1734-
}
1735-
int hitId = mTracking->mIOPtrs.mergedTrackHits[track.FirstClusterRef() + k].num;
1736-
float pt = fabsf(1.f / track.GetParam().GetQPt());
1737-
if (pt > clusterInfo[hitId]) {
1738-
clusterInfo[hitId] = pt;
1739-
}
1740-
}
1741-
}
1742-
static int csvNum = 0;
1743-
char fname[256];
1744-
sprintf(fname, "dump.%d.csv", csvNum);
1745-
FILE* fp = fopen(fname, "w+");
1746-
fprintf(fp, "x;y;z;reconstructedPt;individualMomentum;individualTransverseMomentum;trackLabel1;trackLabel2;trackLabel3;removed\n\n");
1747-
int dumpClTot = 0, dumpClLeft = 0, dumpClRem = 0;
1748-
for (unsigned int iSlice = 0; iSlice < GPUChainTracking::NSLICES; iSlice++) {
1749-
for (unsigned int i = 0; i < mTracking->mIOPtrs.nClusterData[iSlice]; i++) {
1750-
const auto& cl = mTracking->mIOPtrs.clusterData[iSlice][i];
1751-
float x, y, z;
1752-
const int cid = cl.id;
1753-
mTracking->GetParam().Slice2Global(iSlice, cl.x, cl.y, cl.z, &x, &y, &z);
1754-
1755-
float totalWeight = 0.f;
1756-
if (mcPresent()) {
1757-
for (int j = 0; j < GetMCLabelNID(cid); j++) {
1758-
if (GetMCLabelID(cid, j) >= 0) {
1759-
totalWeight += GetMCLabelWeight(cid, j);
1760-
}
1761-
}
1762-
}
1763-
1764-
float maxPt = 0.;
1765-
float p = 0.;
1766-
1767-
if (totalWeight > 0) {
1768-
for (int j = 0; j < GetMCLabelNID(cid); j++) {
1769-
const mcLabelI_t label = GetMCLabel(cid, j);
1770-
if (!label.isFake() && GetMCLabelWeight(cid, j) > 0.3 * totalWeight) {
1771-
const mcInfo_t& info = GetMCTrack(label);
1772-
const additionalMCParameters& mc2 = GetMCTrackObj(mMCParam, label);
1773-
const float pt = fabsf(mc2.pt);
1774-
if (pt > maxPt) {
1775-
maxPt = pt;
1776-
p = std::sqrt(info.pX * info.pX + info.pY * info.pY + info.pZ * info.pZ);
1777-
}
1778-
}
1779-
}
1780-
}
1781-
int labels[3] = {};
1782-
if (mcPresent()) {
1783-
for (int j = 0; j < GetMCLabelNID(cid); j++) {
1784-
labels[j] = GetMCLabelID(cid, j);
1785-
}
1786-
}
1787-
1788-
dumpClTot++;
1789-
int attach = mTracking->mIOPtrs.mergedTrackHitAttachment[cid];
1790-
CHECK_CLUSTER_STATE();
1791-
if (protect || physics) {
1792-
continue;
1793-
}
1794-
if (attach && qpt < 50) {
1795-
continue;
1796-
}
1797-
dumpClLeft++;
1798-
if (attach) {
1799-
dumpClRem++;
1800-
}
1801-
1802-
fprintf(fp, "%f;%f;%f;%f;%f;%f;%d;%d;%d;%d\n", x, y, z, attach ? 1.f / qpt : 0.f, p, maxPt, labels[0], labels[1], labels[2], attach ? 1 : 0);
1803-
}
1804-
}
1805-
fclose(fp);
1806-
if (mcPresent()) {
1807-
sprintf(fname, "dump_event.%d.csv", csvNum++);
1808-
fp = fopen(fname, "w+");
1809-
fprintf(fp, "trackLabel;trackMomentum;trackMomentumTransverse;trackMomentumZ\n\n");
1810-
for (unsigned int iCol = 0; iCol < GetNMCCollissions(); iCol++) {
1811-
for (unsigned int i = 0; i < GetNMCTracks(iCol); i++) {
1812-
const mcInfo_t& info = GetMCTrack(i, iCol);
1813-
additionalMCParameters& mc2 = mMCParam[iCol][i];
1814-
if (mc2.nWeightCls > 0) {
1815-
fprintf(fp, "%u;%f;%f;%f\n", i, std::sqrt(info.pX * info.pX + info.pY * info.pY + info.pZ * info.pZ), mc2.pt, info.pZ);
1816-
}
1817-
}
1818-
}
1819-
fclose(fp);
1820-
}
1821-
GPUInfo("Wrote %s,%d clusters in total, %d left, %d to be removed", fname, dumpClTot, dumpClLeft, dumpClRem);
1822-
}
18231711
mTrackingScratchBuffer.clear();
18241712
}
18251713

0 commit comments

Comments
 (0)