Skip to content

Commit a9d6917

Browse files
committed
readability-implicit-bool-conversion
1 parent cfee67a commit a9d6917

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

PWGDQ/Core/HistogramManager.cxx

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
207207
fBinsAllocated += nXbins + 2;
208208
// TODO: possibly make the call of Sumw2() optional for all histograms
209209
h->Sumw2();
210-
if (fVariableNames[varX][0]) {
210+
if (fVariableNames[varX][0] != 0) {
211211
h->GetXaxis()->SetTitle(Form("%s %s", fVariableNames[varX].Data(),
212-
(fVariableUnits[varX][0] ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
212+
((fVariableUnits[varX][0] != 0) ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
213213
}
214214
if (arr->At(1)) {
215215
h->GetXaxis()->SetTitle(arr->At(1)->GetName());
@@ -240,9 +240,9 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
240240
fBinsAllocated += (nXbins + 2) * (nYbins + 2);
241241
h->Sumw2();
242242
}
243-
if (fVariableNames[varX][0]) {
243+
if (fVariableNames[varX][0] != 0) {
244244
h->GetXaxis()->SetTitle(Form("%s %s", fVariableNames[varX].Data(),
245-
(fVariableUnits[varX][0] ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
245+
((fVariableUnits[varX][0] != 0) ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
246246
}
247247
if (arr->At(1)) {
248248
h->GetXaxis()->SetTitle(arr->At(1)->GetName());
@@ -251,13 +251,13 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
251251
MakeAxisLabels(h->GetXaxis(), xLabels);
252252
}
253253

254-
if (fVariableNames[varY][0]) {
254+
if (fVariableNames[varY][0] != 0) {
255255
h->GetYaxis()->SetTitle(Form("%s %s", fVariableNames[varY].Data(),
256-
(fVariableUnits[varY][0] ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
256+
((fVariableUnits[varY][0] != 0) ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
257257
}
258-
if (fVariableNames[varY][0] && isProfile) {
258+
if ((fVariableNames[varY][0] != 0) && isProfile) {
259259
h->GetYaxis()->SetTitle(Form("<%s> %s", fVariableNames[varY].Data(),
260-
(fVariableUnits[varY][0] ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
260+
((fVariableUnits[varY][0] != 0) ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
261261
}
262262
if (arr->At(2)) {
263263
h->GetYaxis()->SetTitle(arr->At(2)->GetName());
@@ -295,33 +295,33 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
295295
fBinsAllocated += (nXbins + 2) * (nYbins + 2) * (nZbins + 2);
296296
h->Sumw2();
297297
}
298-
if (fVariableNames[varX][0]) {
298+
if (fVariableNames[varX][0] != 0) {
299299
h->GetXaxis()->SetTitle(Form("%s %s", fVariableNames[varX].Data(),
300-
(fVariableUnits[varX][0] ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
300+
((fVariableUnits[varX][0] != 0) ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
301301
}
302302
if (arr->At(1)) {
303303
h->GetXaxis()->SetTitle(arr->At(1)->GetName());
304304
}
305305
if (xLabels[0] != '\0') {
306306
MakeAxisLabels(h->GetXaxis(), xLabels);
307307
}
308-
if (fVariableNames[varY][0]) {
308+
if (fVariableNames[varY][0] != 0) {
309309
h->GetYaxis()->SetTitle(Form("%s %s", fVariableNames[varY].Data(),
310-
(fVariableUnits[varY][0] ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
310+
((fVariableUnits[varY][0] != 0) ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
311311
}
312312
if (arr->At(2)) {
313313
h->GetYaxis()->SetTitle(arr->At(2)->GetName());
314314
}
315315
if (yLabels[0] != '\0') {
316316
MakeAxisLabels(h->GetYaxis(), yLabels);
317317
}
318-
if (fVariableNames[varZ][0]) {
318+
if (fVariableNames[varZ][0] != 0) {
319319
h->GetZaxis()->SetTitle(Form("%s %s", fVariableNames[varZ].Data(),
320-
(fVariableUnits[varZ][0] ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
320+
((fVariableUnits[varZ][0] != 0) ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
321321
}
322-
if (fVariableNames[varZ][0] && isProfile && varT < 0) { // for TProfile2D
322+
if ((fVariableNames[varZ][0] != 0) && isProfile && varT < 0) { // for TProfile2D
323323
h->GetZaxis()->SetTitle(Form("<%s> %s", fVariableNames[varZ].Data(),
324-
(fVariableUnits[varZ][0] ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
324+
((fVariableUnits[varZ][0] != 0) ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
325325
}
326326
if (arr->At(3)) {
327327
h->GetZaxis()->SetTitle(arr->At(3)->GetName());
@@ -415,9 +415,9 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
415415
}
416416
fBinsAllocated += nXbins + 2;
417417
h->Sumw2();
418-
if (fVariableNames[varX][0]) {
418+
if (fVariableNames[varX][0] != 0) {
419419
h->GetXaxis()->SetTitle(Form("%s %s", fVariableNames[varX].Data(),
420-
(fVariableUnits[varX][0] ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
420+
((fVariableUnits[varX][0] != 0) ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
421421
}
422422
if (arr->At(1)) {
423423
h->GetXaxis()->SetTitle(arr->At(1)->GetName());
@@ -446,23 +446,23 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
446446
fBinsAllocated += (nXbins + 2) * (nYbins + 2);
447447
h->Sumw2();
448448
}
449-
if (fVariableNames[varX][0]) {
449+
if (fVariableNames[varX][0] != 0) {
450450
h->GetXaxis()->SetTitle(Form("%s %s", fVariableNames[varX].Data(),
451-
(fVariableUnits[varX][0] ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
451+
((fVariableUnits[varX][0] != 0) ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
452452
}
453453
if (arr->At(1)) {
454454
h->GetXaxis()->SetTitle(arr->At(1)->GetName());
455455
}
456456
if (xLabels[0] != '\0') {
457457
MakeAxisLabels(h->GetXaxis(), xLabels);
458458
}
459-
if (fVariableNames[varY][0]) {
459+
if (fVariableNames[varY][0] != 0) {
460460
h->GetYaxis()->SetTitle(Form("%s %s", fVariableNames[varY].Data(),
461-
(fVariableUnits[varY][0] ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
461+
((fVariableUnits[varY][0] != 0) ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
462462
}
463-
if (fVariableNames[varY][0] && isProfile) {
463+
if ((fVariableNames[varY][0] != 0) && isProfile) {
464464
h->GetYaxis()->SetTitle(Form("<%s> %s", fVariableNames[varY].Data(),
465-
(fVariableUnits[varY][0] ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
465+
((fVariableUnits[varY][0] != 0) ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
466466
}
467467

468468
if (arr->At(2)) {
@@ -501,33 +501,33 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
501501
fBinsAllocated += (nXbins + 2) * (nYbins + 2) * (nZbins + 2);
502502
h->Sumw2();
503503
}
504-
if (fVariableNames[varX][0]) {
504+
if (fVariableNames[varX][0] != 0) {
505505
h->GetXaxis()->SetTitle(Form("%s %s", fVariableNames[varX].Data(),
506-
(fVariableUnits[varX][0] ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
506+
((fVariableUnits[varX][0] != 0) ? Form("(%s)", fVariableUnits[varX].Data()) : "")));
507507
}
508508
if (arr->At(1)) {
509509
h->GetXaxis()->SetTitle(arr->At(1)->GetName());
510510
}
511511
if (xLabels[0] != '\0') {
512512
MakeAxisLabels(h->GetXaxis(), xLabels);
513513
}
514-
if (fVariableNames[varY][0]) {
514+
if (fVariableNames[varY][0] != 0) {
515515
h->GetYaxis()->SetTitle(Form("%s %s", fVariableNames[varY].Data(),
516-
(fVariableUnits[varY][0] ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
516+
((fVariableUnits[varY][0] != 0) ? Form("(%s)", fVariableUnits[varY].Data()) : "")));
517517
}
518518
if (arr->At(2)) {
519519
h->GetYaxis()->SetTitle(arr->At(2)->GetName());
520520
}
521521
if (yLabels[0] != '\0') {
522522
MakeAxisLabels(h->GetYaxis(), yLabels);
523523
}
524-
if (fVariableNames[varZ][0]) {
524+
if (fVariableNames[varZ][0] != 0) {
525525
h->GetZaxis()->SetTitle(Form("%s %s", fVariableNames[varZ].Data(),
526-
(fVariableUnits[varZ][0] ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
526+
((fVariableUnits[varZ][0] != 0) ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
527527
}
528-
if (fVariableNames[varZ][0] && isProfile && varT < 0) { // TProfile2D
528+
if ((fVariableNames[varZ][0] != 0) && isProfile && varT < 0) { // TProfile2D
529529
h->GetZaxis()->SetTitle(Form("<%s> %s", fVariableNames[varZ].Data(),
530-
(fVariableUnits[varZ][0] ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
530+
((fVariableUnits[varZ][0] != 0) ? Form("(%s)", fVariableUnits[varZ].Data()) : "")));
531531
}
532532

533533
if (arr->At(3)) {
@@ -611,9 +611,9 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
611611
for (int idim = 0; idim < nDimensions; ++idim) {
612612
nbins *= (nBins[idim] + 2);
613613
TAxis* axis = h->GetAxis(idim);
614-
if (fVariableNames[vars[idim]][0]) {
614+
if (fVariableNames[vars[idim]][0] != 0) {
615615
axis->SetTitle(Form("%s %s", fVariableNames[vars[idim]].Data(),
616-
(fVariableUnits[vars[idim]][0] ? Form("(%s)", fVariableUnits[vars[idim]].Data()) : "")));
616+
((fVariableUnits[vars[idim]][0] != 0) ? Form("(%s)", fVariableUnits[vars[idim]].Data()) : "")));
617617
}
618618
if (arr->At(1 + idim)) {
619619
axis->SetTitle(arr->At(1 + idim)->GetName());
@@ -719,9 +719,9 @@ void HistogramManager::AddHistogram(const char* histClass, const char* hname, co
719719
for (int idim = 0; idim < nDimensions; ++idim) {
720720
bins *= (nBins[idim] + 2);
721721
TAxis* axis = h->GetAxis(idim);
722-
if (fVariableNames[vars[idim]][0]) {
722+
if (fVariableNames[vars[idim]][0] != 0) {
723723
axis->SetTitle(Form("%s %s", fVariableNames[vars[idim]].Data(),
724-
(fVariableUnits[vars[idim]][0] ? Form("(%s)", fVariableUnits[vars[idim]].Data()) : "")));
724+
((fVariableUnits[vars[idim]][0] != 0) ? Form("(%s)", fVariableUnits[vars[idim]].Data()) : "")));
725725
}
726726
if (arr->At(1 + idim)) {
727727
axis->SetTitle(arr->At(1 + idim)->GetName());

0 commit comments

Comments
 (0)