@@ -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