Skip to content

Commit 0f3fb6f

Browse files
authored
[PWGCF] additional control histogram, optionally restrict range in which stat is computed (#11871)
1 parent fb4ba20 commit 0f3fb6f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

PWGCF/Core/CorrelationContainer.cxx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,11 @@ TH2* CorrelationContainer::getSumOfRatios(CorrelationContainer* mixed, Correlati
681681
Double_t sums[] = {0, 0, 0};
682682
Double_t errors[] = {0, 0, 0};
683683

684+
Int_t checkBinYBegin = 1; // tracksSame->GetXaxis()->FindBin(-0.79);
685+
Int_t checkBinYEnd = tracksSame->GetNbinsY(); // tracksSame->GetXaxis()->FindBin(0.79);
686+
684687
for (Int_t x = 1; x <= tracksSame->GetNbinsX(); x++) {
685-
for (Int_t y = 1; y <= tracksSame->GetNbinsY(); y++) {
688+
for (Int_t y = checkBinYBegin; y <= checkBinYEnd; y++) {
686689
sums[0] += tracksSame->GetBinContent(x, y);
687690
errors[0] += tracksSame->GetBinError(x, y);
688691
sums[1] += tracksMixed->GetBinContent(x, y);
@@ -693,7 +696,7 @@ TH2* CorrelationContainer::getSumOfRatios(CorrelationContainer* mixed, Correlati
693696
tracksSame->Divide(tracksMixed);
694697

695698
for (Int_t x = 1; x <= tracksSame->GetNbinsX(); x++) {
696-
for (Int_t y = 1; y <= tracksSame->GetNbinsY(); y++) {
699+
for (Int_t y = checkBinYBegin; y <= checkBinYEnd; y++) {
697700
sums[2] += tracksSame->GetBinContent(x, y);
698701
errors[2] += tracksSame->GetBinError(x, y);
699702
}

PWGCF/Tasks/correlations.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ struct CorrelationTask {
173173
registry.add("multiplicity", "event multiplicity", {HistType::kTH1F, {{1000, 0, 100, "/multiplicity/centrality"}}});
174174

175175
const int maxMixBin = AxisSpec(axisMultiplicity).getNbins() * AxisSpec(axisVertex).getNbins();
176+
// The bin numbers for the control histograms (eventcount_*) come from getBin(...) and are the following: #mult_bin * #number_of_z_bins + #zbin
176177
registry.add("eventcount_same", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}});
177178
registry.add("eventcount_mixed", "bin", {HistType::kTH1F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}}});
179+
registry.add("trackcount_same", "bin", {HistType::kTH2F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}, {10, -0.5, 9.5}}});
180+
registry.add("trackcount_mixed", "bin", {HistType::kTH3F, {{maxMixBin + 2, -2.5, -0.5 + maxMixBin, "bin"}, {10, -0.5, 9.5}, {10, -0.5, 9.5}}});
178181

179182
mPairCuts.SetHistogramRegistry(&registry);
180183

@@ -653,6 +656,7 @@ struct CorrelationTask {
653656

654657
int bin = configurableBinningDerived.getBin({collision.posZ(), collision.multiplicity()});
655658
registry.fill(HIST("eventcount_same"), bin);
659+
registry.fill(HIST("trackcount_same"), bin, tracks.size());
656660
fillQA(collision, multiplicity, tracks);
657661

658662
same->fillEvent(multiplicity, CorrelationContainer::kCFStepReconstructed);
@@ -810,6 +814,7 @@ struct CorrelationTask {
810814
// LOGF(info, "Tracks: %d and %d entries", tracks1.size(), tracks2.size());
811815

812816
registry.fill(HIST("eventcount_mixed"), bin);
817+
registry.fill(HIST("trackcount_mixed"), bin, tracks1.size(), tracks2.size());
813818
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(mixed, tracks1, tracks2, collision1.multiplicity(), collision1.posZ(), field, eventWeight);
814819

815820
if (cfg.mEfficiencyAssociated || cfg.mEfficiencyTrigger) {

0 commit comments

Comments
 (0)