Skip to content

Commit

Permalink
Common: improvements to av Np, Nc calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
ddobrigk committed May 2, 2024
1 parent 3416fe5 commit d56808f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions Common/Tools/Multiplicity/multGlauberNBDFitter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Npart>, <Ncoll> in centrality bins..." << endl;

Expand All @@ -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;
Expand All @@ -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);
}
}
}
2 changes: 1 addition & 1 deletion Common/Tools/Multiplicity/multGlauberNBDFitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d56808f

Please sign in to comment.