Skip to content

Commit 870e524

Browse files
author
Preet Pati
committed
Fixed the issue of histograms not being found
1 parent 4882833 commit 870e524

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

‎PWGCF/TwoParticleCorrelations/Tasks/pidLongRange.cxx‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,6 @@ struct PidLongRange {
488488
histos.add("h_centFT0M_centFT0C", "after cut;Centrality T0C;Centrality T0M", {HistType::kTH2D, {axisCent, axisCent}});
489489
histos.add("h_centFV0A_centFT0C", "after cut;Centrality T0C;Centrality V0A", {HistType::kTH2D, {axisCent, axisCent}});
490490

491-
histos.add("hTrackCorrection2d", "Correlation table for number of tracks table; uncorrected track; corrected track", {HistType::kTH2D, {axisMult, axisMult}});
492-
493491
// Add track cuts table
494492
histos.add("hDCAz_before", "DCAz before cuts; DCAz (cm); Pt", {HistType::kTH2D, {axisDCAz, axisPtFiner}});
495493
histos.add("hDCAxy_before", "DCAxy before cuts; DCAxy (cm); Pt", {HistType::kTH2D, {axisDCAxy, axisPtFiner}});
@@ -514,6 +512,7 @@ struct PidLongRange {
514512
histos.add("Nch_corrected", "N_{ch} corrected", {HistType::kTH1D, {axisMult}});
515513
histos.add("Centrality", "Centrality", {HistType::kTH1D, {axisCent}});
516514
histos.add("CentralityWeighted", "Centrality (weighted)", {HistType::kTH1D, {axisCent}});
515+
histos.add("hTrackCorrection2d", "Correlation table for number of tracks table; uncorrected track; corrected track", {HistType::kTH2D, {axisMult, axisMult}});
517516
}
518517

519518
if (doprocessSameTpcFt0 || doprocessQA) {
@@ -567,6 +566,7 @@ struct PidLongRange {
567566

568567
histos.add("FT0Amp", "", {HistType::kTH2F, {axisChID, cfgFITamp}});
569568
histos.add("FT0AmpCorrect", "", {HistType::kTH2F, {axisChID, cfgFITamp}});
569+
histos.add("eventcount", "bin", {HistType::kTH1F, {{4, 0, 4, "bin"}}}); // histogram to see how many events are in the same and mixed event
570570
}
571571

572572
if (doprocessSameFt0aFt0c) {
@@ -581,9 +581,6 @@ struct PidLongRange {
581581

582582
histos.add("FT0Amp", "", {HistType::kTH2F, {axisChID, cfgFITamp}});
583583
histos.add("FT0AmpCorrect", "", {HistType::kTH2F, {axisChID, cfgFITamp}});
584-
}
585-
586-
if (!doprocessQA) {
587584
histos.add("eventcount", "bin", {HistType::kTH1F, {{4, 0, 4, "bin"}}}); // histogram to see how many events are in the same and mixed event
588585
}
589586

@@ -1159,7 +1156,7 @@ struct PidLongRange {
11591156
}
11601157

11611158
template <typename TTracks>
1162-
void nchCounter(const TTracks& tracks, double& multiplicity) // function to count the number of tracks in the event and fill the histogram
1159+
void nchCounter(const TTracks& tracks, double& multiplicity, bool fillHistogram) // function to count the number of tracks in the event and fill the histogram
11631160
{
11641161
double nTracksCorrected = 0;
11651162
double nTracksUncorrected = 0;
@@ -1176,7 +1173,9 @@ struct PidLongRange {
11761173
nTracksUncorrected += 1.0;
11771174
nTracksCorrected += weightNch;
11781175
}
1179-
histos.fill(HIST("hTrackCorrection2d"), nTracksUncorrected, nTracksCorrected);
1176+
if (fillHistogram) {
1177+
histos.fill(HIST("hTrackCorrection2d"), nTracksUncorrected, nTracksCorrected);
1178+
}
11801179
multiplicity = nTracksCorrected;
11811180
}
11821181

@@ -1509,7 +1508,7 @@ struct PidLongRange {
15091508
}
15101509

15111510
if (cfgGeneral.cfgStrictTrackCounter) {
1512-
nchCounter(tracks, multiplicity);
1511+
nchCounter(tracks, multiplicity, false);
15131512
}
15141513

15151514
if (cfgGeneral.cfgQABasic) {
@@ -1591,7 +1590,7 @@ struct PidLongRange {
15911590
auto multiplicity = static_cast<double>(tracks1.size());
15921591

15931592
if (cfgGeneral.cfgStrictTrackCounter) {
1594-
nchCounter(tracks1, multiplicity);
1593+
nchCounter(tracks1, multiplicity, false);
15951594
}
15961595

15971596
if (cfgEvSel.cfgSelCollByNch && (multiplicity > cfgEvSel.cfgMaxMultForCorrelations || multiplicity < cfgEvSel.cfgMinMultForCorrelations)) {
@@ -1675,7 +1674,7 @@ struct PidLongRange {
16751674
}
16761675

16771676
if (cfgGeneral.cfgStrictTrackCounter) {
1678-
nchCounter(tracks, multiplicity);
1677+
nchCounter(tracks, multiplicity, false);
16791678
}
16801679

16811680
if (cfgGeneral.cfgQABasic) {
@@ -1753,7 +1752,7 @@ struct PidLongRange {
17531752
auto multiplicity = static_cast<double>(tracks1.size());
17541753

17551754
if (cfgGeneral.cfgStrictTrackCounter) {
1756-
nchCounter(tracks1, multiplicity);
1755+
nchCounter(tracks1, multiplicity, false);
17571756
}
17581757

17591758
if (cfgEvSel.cfgSelCollByNch && (multiplicity > cfgEvSel.cfgMaxMultForCorrelations || multiplicity < cfgEvSel.cfgMinMultForCorrelations)) {
@@ -1844,7 +1843,7 @@ struct PidLongRange {
18441843
histos.fill(HIST("Nch"), multiplicity);
18451844

18461845
if (cfgGeneral.cfgStrictTrackCounter) {
1847-
nchCounter(tracks, multiplicity);
1846+
nchCounter(tracks, multiplicity, true);
18481847
}
18491848

18501849
histos.fill(HIST("Nch_corrected"), multiplicity);

0 commit comments

Comments
 (0)