Skip to content

Commit b179a16

Browse files
authored
fix in per trigger yield calculation (#4463)
1 parent 6b517d1 commit b179a16

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Analysis/Core/src/CorrelationContainer.cxx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -748,14 +748,23 @@ TH2* CorrelationContainer::getPerTriggerYield(CorrelationContainer::CFStep step,
748748
multBinBegin = multAxis->FindBin(mCentralityMin + 1e-4);
749749
multBinEnd = multAxis->FindBin(mCentralityMax - 1e-4);
750750
LOGF(info, "Using multiplicity range %d --> %d", multBinBegin, multBinEnd);
751-
}
752751

753-
if (mCentralityMin < mCentralityMax) {
754752
trackSameAll->GetAxis(3)->SetRange(multBinBegin, multBinEnd);
755753
}
756754

755+
TAxis* vertexAxis = trackSameAll->GetAxis(2);
756+
int vertexBinBegin = 1;
757+
int vertexBinEnd = vertexAxis->GetNbins();
758+
if (mZVtxMax > mZVtxMin) {
759+
vertexBinBegin = vertexAxis->FindBin(mZVtxMin);
760+
vertexBinEnd = vertexAxis->FindBin(mZVtxMax);
761+
LOGF(info, "Using vertex range %d --> %d", vertexBinBegin, vertexBinEnd);
762+
763+
trackSameAll->GetAxis(2)->SetRange(vertexBinBegin, vertexBinEnd);
764+
}
765+
757766
TH2* yield = trackSameAll->Projection(1, 0, "E");
758-
Float_t triggers = eventSameAll->Integral(1, eventSameAll->GetXaxis()->GetNbins(), multBinBegin, multBinEnd);
767+
Float_t triggers = eventSameAll->Integral(multBinBegin, multBinEnd, vertexBinBegin, vertexBinEnd);
759768

760769
if (normalizePerTrigger) {
761770
LOGF(info, "Dividing %f tracks by %f triggers", yield->Integral(), triggers);

0 commit comments

Comments
 (0)