Skip to content

Commit 863af5c

Browse files
committed
GPU QA: Add option to write other files but ROOT
1 parent 1f0b946 commit 863af5c

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ AddOption(filterPID, int32_t, -1, "", 0, "Filter for Particle Type (0 Electron,
516516
AddOption(nativeFitResolutions, bool, false, "", 0, "Create resolution histograms in the native fit units (sin(phi), tan(lambda), Q/Pt)")
517517
AddOption(enableLocalOutput, bool, true, "", 0, "Enable normal output to local PDF files / console")
518518
AddOption(dumpToROOT, int32_t, 0, "", 0, "Dump all clusters and tracks to a ROOT file, 1 = combined TNTUple dump, 2 = also individual cluster / track branch dump")
519-
AddOption(writeRootFiles, bool, false, "", 0, "Create ROOT canvas files")
519+
AddOption(writeFileExt, std::string, "", "", 0, "Write extra output file with given extension (default ROOT Canvas)", def("root"))
520520
AddOption(writeMCLabels, bool, false, "", 0, "Store mc labels to file for later matching")
521521
AddOptionVec(matchMCLabels, std::string, "", 0, "Read labels from files and match them, only process tracks where labels differ")
522522
AddOption(compareTrackStatus, uint32_t, 0, "", 0, "0 = disabled, 1 = write status file, 2 = read status file and compare with current tracks")

GPU/GPUTracking/qa/GPUQA.cxx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,11 +2084,11 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
20842084
}
20852085

20862086
std::vector<Color_t> colorNums(COLORCOUNT);
2087-
if (!(qcout || mConfig.writeRootFiles)) {
2087+
if (!(qcout || mConfig.writeFileExt == "root" || mConfig.writeFileExt == "C")) {
20882088
[[maybe_unused]] static int32_t initColorsInitialized = initColors();
20892089
}
20902090
for (int32_t i = 0; i < COLORCOUNT; i++) {
2091-
colorNums[i] = (qcout || mConfig.writeRootFiles) ? defaultColorNums[i] : mColors[i]->GetNumber();
2091+
colorNums[i] = (qcout || mConfig.writeFileExt == "root" || mConfig.writeFileExt == "C") ? defaultColorNums[i] : mColors[i]->GetNumber();
20922092
}
20932093

20942094
bool mcAvail = mcPresent();
@@ -2395,8 +2395,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
23952395
}
23962396
doPerfFigure(0.2, 0.295, 0.025);
23972397
mCEff[ii]->Print(Form("%s/eff_vs_%s.pdf", mConfig.plotsDir.c_str(), VSPARAMETER_NAMES[ii]));
2398-
if (mConfig.writeRootFiles) {
2399-
mCEff[ii]->Print(Form("%s/eff_vs_%s.root", mConfig.plotsDir.c_str(), VSPARAMETER_NAMES[ii]));
2398+
if (mConfig.writeFileExt != "") {
2399+
mCEff[ii]->Print(Form("%s/eff_vs_%s.%s", mConfig.plotsDir.c_str(), VSPARAMETER_NAMES[ii], mConfig.writeFileExt.c_str()));
24002400
}
24012401
}
24022402
}
@@ -2633,8 +2633,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
26332633
}
26342634
doPerfFigure(0.2, 0.295, 0.025);
26352635
can->Print(Form(p ? "%s/pull_vs_%s.pdf" : "%s/res_vs_%s.pdf", mConfig.plotsDir.c_str(), VSPARAMETER_NAMES[ii]));
2636-
if (mConfig.writeRootFiles) {
2637-
can->Print(Form(p ? "%s/pull_vs_%s.root" : "%s/res_vs_%s.root", mConfig.plotsDir.c_str(), VSPARAMETER_NAMES[ii]));
2636+
if (mConfig.writeFileExt != "") {
2637+
can->Print(Form(p ? "%s/pull_vs_%s.%s" : "%s/res_vs_%s.%s", mConfig.plotsDir.c_str(), VSPARAMETER_NAMES[ii], mConfig.writeFileExt.c_str()));
26382638
}
26392639
}
26402640
}
@@ -2704,8 +2704,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
27042704
}
27052705

27062706
can->Print(Form(p ? "%s/pull_integral.pdf" : "%s/res_integral.pdf", mConfig.plotsDir.c_str()));
2707-
if (mConfig.writeRootFiles) {
2708-
can->Print(Form(p ? "%s/pull_integral.root" : "%s/res_integral.root", mConfig.plotsDir.c_str()));
2707+
if (mConfig.writeFileExt != "") {
2708+
can->Print(Form(p ? "%s/pull_integral.%s" : "%s/res_integral.%s", mConfig.plotsDir.c_str(), mConfig.writeFileExt.c_str()));
27092709
}
27102710
}
27112711
}
@@ -2856,8 +2856,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
28562856
doPerfFigure(i == 0 ? 0.37 : (i == 1 ? 0.34 : 0.6), 0.295, 0.030);
28572857
mCClust[i]->cd();
28582858
mCClust[i]->Print(Form(i == 2 ? "%s/clusters_integral.pdf" : i == 1 ? "%s/clusters_relative.pdf" : "%s/clusters.pdf", mConfig.plotsDir.c_str()));
2859-
if (mConfig.writeRootFiles) {
2860-
mCClust[i]->Print(Form(i == 2 ? "%s/clusters_integral.root" : i == 1 ? "%s/clusters_relative.root" : "%s/clusters.root", mConfig.plotsDir.c_str()));
2859+
if (mConfig.writeFileExt != "") {
2860+
mCClust[i]->Print(Form(i == 2 ? "%s/clusters_integral.%s" : i == 1 ? "%s/clusters_relative.%s" : "%s/clusters.%s", mConfig.plotsDir.c_str(), mConfig.writeFileExt.c_str()));
28612861
}
28622862
}
28632863

@@ -2876,8 +2876,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
28762876
static const constexpr char* PADROW_NAMES[3] = {"MC", "Phi", "Phi1"};
28772877
snprintf(name, 2048, "%s/padRow%s.pdf", mConfig.plotsDir.c_str(), PADROW_NAMES[i]);
28782878
mCPadRow[i]->Print(name);
2879-
if (mConfig.writeRootFiles) {
2880-
snprintf(name, 2048, "%s/padRow%s.root", mConfig.plotsDir.c_str(), PADROW_NAMES[i]);
2879+
if (mConfig.writeFileExt != "") {
2880+
snprintf(name, 2048, "%s/padRow%s.%s", mConfig.plotsDir.c_str(), PADROW_NAMES[i], mConfig.writeFileExt.c_str());
28812881
mCPadRow[i]->Print(name);
28822882
}
28832883
}
@@ -2942,8 +2942,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
29422942
doPerfFigure(0.63, 0.7, 0.030);
29432943
mCTracks->cd();
29442944
mCTracks->Print(Form("%s/tracks.pdf", mConfig.plotsDir.c_str()));
2945-
if (mConfig.writeRootFiles) {
2946-
mCTracks->Print(Form("%s/tracks.root", mConfig.plotsDir.c_str()));
2945+
if (mConfig.writeFileExt != "") {
2946+
mCTracks->Print(Form("%s/tracks.%s", mConfig.plotsDir.c_str(), mConfig.writeFileExt.c_str()));
29472947
}
29482948

29492949
for (int32_t i = 0; i < 2; i++) {
@@ -2989,8 +2989,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
29892989
mCT0[i]->cd();
29902990
snprintf(name, 2048, "%s/t0%s.pdf", mConfig.plotsDir.c_str(), i ? "_res" : "");
29912991
mCT0[i]->Print(name);
2992-
if (mConfig.writeRootFiles) {
2993-
snprintf(name, 2048, "%s/t0%s.root", mConfig.plotsDir.c_str(), i ? "_res" : "");
2992+
if (mConfig.writeFileExt != "") {
2993+
snprintf(name, 2048, "%s/t0%s.%s", mConfig.plotsDir.c_str(), i ? "_res" : "", mConfig.writeFileExt.c_str());
29942994
mCT0[i]->Print(name);
29952995
}
29962996

@@ -3036,8 +3036,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
30363036
mCNCl[i]->cd();
30373037
snprintf(name, 2048, "%s/nClusters%s.pdf", mConfig.plotsDir.c_str(), i ? "_corrected" : "");
30383038
mCNCl[i]->Print(name);
3039-
if (mConfig.writeRootFiles) {
3040-
snprintf(name, 2048, "%s/nClusters%s.root", mConfig.plotsDir.c_str(), i ? "_corrected" : "");
3039+
if (mConfig.writeFileExt != "") {
3040+
snprintf(name, 2048, "%s/nClusters%s.%s", mConfig.plotsDir.c_str(), i ? "_corrected" : "", mConfig.writeFileExt.c_str());
30413041
mCNCl[i]->Print(name);
30423042
}
30433043
}
@@ -3047,8 +3047,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
30473047
mClXY->Draw();
30483048
mCClXY->cd();
30493049
mCClXY->Print(Form("%s/clustersXY.pdf", mConfig.plotsDir.c_str()));
3050-
if (mConfig.writeRootFiles) {
3051-
mCClXY->Print(Form("%s/clustersXY.root", mConfig.plotsDir.c_str()));
3050+
if (mConfig.writeFileExt != "") {
3051+
mCClXY->Print(Form("%s/clustersXY.%s", mConfig.plotsDir.c_str(), mConfig.writeFileExt.c_str()));
30523052
}
30533053

30543054
if (mQATasks & taskClusterCounts) {
@@ -3065,8 +3065,8 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
30653065
mCClRej[i]->cd();
30663066
snprintf(name, 2048, "%s/clustersRej%d%s.pdf", mConfig.plotsDir.c_str(), i, REJECTED_NAMES[i]);
30673067
mCClRej[i]->Print(name);
3068-
if (mConfig.writeRootFiles) {
3069-
snprintf(name, 2048, "%s/clustersRej%d%s.root", mConfig.plotsDir.c_str(), i, REJECTED_NAMES[i]);
3068+
if (mConfig.writeFileExt != "") {
3069+
snprintf(name, 2048, "%s/clustersRej%d%s.%s", mConfig.plotsDir.c_str(), i, REJECTED_NAMES[i], mConfig.writeFileExt.c_str());
30703070
mCClRej[i]->Print(name);
30713071
}
30723072
}
@@ -3105,9 +3105,9 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
31053105
e->GetYaxis()->SetTitle("Rejected Clusters (fraction)");
31063106
e->Draw(k == 0 ? "" : "same");
31073107
}
3108-
mPClRejP->Print(Form("%s/clustersRejProjected.pdf", mConfig.plotsDir.c_str())); // TODO: Add option to write pngs
3109-
if (mConfig.writeRootFiles) {
3110-
mPClRejP->Print(Form("%s/clustersRejProjected.root", mConfig.plotsDir.c_str()));
3108+
mPClRejP->Print(Form("%s/clustersRejProjected.pdf", mConfig.plotsDir.c_str()));
3109+
if (mConfig.writeFileExt != "") {
3110+
mPClRejP->Print(Form("%s/clustersRejProjected.%s", mConfig.plotsDir.c_str(), mConfig.writeFileExt.c_str()));
31113111
}
31123112
}
31133113
}
@@ -3131,7 +3131,7 @@ int32_t GPUQA::DrawQAHistograms(TObjArray* qcout)
31313131
if (!qcout) {
31323132
clearGarbagageCollector();
31333133
}
3134-
GPUInfo("GPU TPC QA histograms have been written to %s files", mConfig.writeRootFiles ? ".pdf and .root" : ".pdf");
3134+
GPUInfo("GPU TPC QA histograms have been written to pdf%s%s files", (mConfig.writeFileExt == "" ? "" : " and ", mConfig.writeFileExt.c_str());
31353135
gErrorIgnoreLevel = oldRootIgnoreLevel;
31363136
return (0);
31373137
}

0 commit comments

Comments
 (0)