diff --git a/Common/Tools/Multiplicity/multGlauberNBDFitter.cxx b/Common/Tools/Multiplicity/multGlauberNBDFitter.cxx index 112983de9ea..324e6867ad1 100644 --- a/Common/Tools/Multiplicity/multGlauberNBDFitter.cxx +++ b/Common/Tools/Multiplicity/multGlauberNBDFitter.cxx @@ -369,7 +369,7 @@ Double_t multGlauberNBDFitter::ContinuousNBD(Double_t n, Double_t mu, Double_t k return F; } -void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCollProf) +void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCollProf, TH2F* lNPart2DPlot, TH2F* lNColl2DPlot, TH1F *hPercentileMap) { cout << "Calculating , in centrality bins..." << endl; @@ -381,6 +381,7 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol //______________________________________________________ Double_t lLoRange, lHiRange; fGlauberNBD->GetRange(lLoRange, lHiRange); + // bypass to zero for (int ibin = 0; ibin < fNNpNcPairs; ibin++) { if (ibin % 2000 == 0) cout << "At NpNc pair #" << ibin << " of " << fNNpNcPairs << "..." << endl; @@ -403,8 +404,15 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol if (lMultValue > 1e-6) lMult = fAncestorMode != 2 ? fNBD->Eval(lMultValue) : ContinuousNBD(lMultValue, lThisMu, lThisk); Double_t lProbability = lNancestorCount * lMult; - lNPartProf->Fill(lMultValue, fNpart[ibin], lProbability); - lNCollProf->Fill(lMultValue, fNcoll[ibin], lProbability); + Double_t lMultValueToFill = lMultValue; + if(hPercentileMap) + lMultValueToFill = hPercentileMap->GetBinContent(hPercentileMap->FindBin(lMultValue)); + lNPartProf->Fill(lMultValueToFill, fNpart[ibin], lProbability); + lNCollProf->Fill(lMultValueToFill, fNcoll[ibin], lProbability); + if(lNPart2DPlot) + lNPart2DPlot->Fill(lMultValueToFill, fNpart[ibin], lProbability); + if(lNColl2DPlot) + lNColl2DPlot->Fill(lMultValueToFill, fNcoll[ibin], lProbability); } } } diff --git a/Common/Tools/Multiplicity/multGlauberNBDFitter.h b/Common/Tools/Multiplicity/multGlauberNBDFitter.h index ed93c49fc6b..356a37c61bf 100644 --- a/Common/Tools/Multiplicity/multGlauberNBDFitter.h +++ b/Common/Tools/Multiplicity/multGlauberNBDFitter.h @@ -75,7 +75,7 @@ class multGlauberNBDFitter : public TNamed Double_t ContinuousNBD(Double_t n, Double_t mu, Double_t k); //For estimating Npart, Ncoll in multiplicity bins - void CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCollProf); + void CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCollProf, TH2F* lNPart2DPlot, TH2F* lNColl2DPlot, TH1F *hPercentileMap); //void Print(Option_t *option="") const;