Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 29 additions & 7 deletions Common/Tools/Multiplicity/multGlauberNBDFitter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ Double_t multGlauberNBDFitter::ContinuousNBD(Double_t n, Double_t mu, Double_t k
return F;
}

void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCollProf, TH2F* lNPart2DPlot, TH2F* lNColl2DPlot, TH1F* hPercentileMap, Double_t lLoRange, Double_t lHiRange, TH3D* lNpNcEcc, TH2F* lEcc2DPlot)
void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCollProf, TH2F* lNPart2DPlot, TH2F* lNColl2DPlot, TH1F* hPercentileMap, Double_t lLoRange, Double_t lHiRange, TH3D* lNpNcEcc, TH2F* lEcc2DPlot, TH3D* lNpNcB, TH2F* lB2DPlot, TH2F* lNancestor2DPlot)
{
cout << "Calculating <Npart>, <Ncoll> in centrality bins..." << endl;
cout << "Range to calculate: " << lLoRange << " to " << lHiRange << endl;
Expand Down Expand Up @@ -421,8 +421,15 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
Double_t lNAncestors1 = TMath::Floor(fNpart[ibin] * ff + fNcoll[ibin] * (1.0 - ff) + 0.5);
Double_t lNAncestors2 = (fNpart[ibin] * ff + fNcoll[ibin] * (1.0 - ff));

TH1D* hEccentricity = 0x0;
// define ancestors officially
Double_t lNancestors = lNAncestors0;
if (fAncestorMode == 1)
lNancestors = lNAncestors1;
if (fAncestorMode == 2)
lNancestors = lNAncestors2;

// eccentricity handling
TH1D* hEccentricity = 0x0;
if (lNpNcEcc) {
// locate the histogram that corresponds to the eccentricity distribution in this NpNc pair
lNpNcEcc->GetXaxis()->SetRange(lNpNcEcc->GetXaxis()->FindBin(fNpart[ibin]), lNpNcEcc->GetXaxis()->FindBin(fNpart[ibin]));
Expand All @@ -431,12 +438,17 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
hEccentricity->SetName(Form("hEccentricity_%i", ibin));
}

// impact parameter handling
TH1D* hImpactParameter = 0x0;
if (lNpNcB) {
// locate the histogram that corresponds to the eccentricity distribution in this NpNc pair
lNpNcB->GetXaxis()->SetRange(lNpNcB->GetXaxis()->FindBin(fNpart[ibin]), lNpNcB->GetXaxis()->FindBin(fNpart[ibin]));
lNpNcB->GetYaxis()->SetRange(lNpNcB->GetYaxis()->FindBin(fNcoll[ibin]), lNpNcB->GetYaxis()->FindBin(fNcoll[ibin]));
hImpactParameter = reinterpret_cast<TH1D*>(lNpNcB->Project3D("z"));
hImpactParameter->SetName(Form("hImpactParameter_%i", ibin));
}

for (Long_t lMultValue = 1; lMultValue < lHiRange; lMultValue++) {
Double_t lNancestors = lNAncestors0;
if (fAncestorMode == 1)
lNancestors = lNAncestors1;
if (fAncestorMode == 2)
lNancestors = lNAncestors2;
Double_t lNancestorCount = fContent[ibin];
Double_t lThisMu = (((Double_t)lNancestors)) * fMu;
Double_t lThisk = (((Double_t)lNancestors)) * fk;
Expand All @@ -452,6 +464,10 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
lMultValueToFill = hPercentileMap->GetBinContent(hPercentileMap->FindBin(lMultValue));
lNPartProf->Fill(lMultValueToFill, fNpart[ibin], lProbability);
lNCollProf->Fill(lMultValueToFill, fNcoll[ibin], lProbability);
if (lNancestor2DPlot) {
// fill cross-check histogram with lNancestorCount at lNancestors value
lNancestor2DPlot->Fill(lMultValueToFill, lNancestors, lProbability * lNancestorCount);
}
if (lNPart2DPlot)
lNPart2DPlot->Fill(lMultValueToFill, fNpart[ibin], lProbability);
if (lNColl2DPlot)
Expand All @@ -462,6 +478,12 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
lEcc2DPlot->Fill(lMultValueToFill, hEccentricity->GetBinCenter(ib), lProbability * hEccentricity->GetBinContent(ib));
}
}
if (lNpNcB) {
// collapse the entire eccentricity distribution for this combo
for (int ib = 1; ib < hImpactParameter->GetNbinsX() + 1; ib++) {
lB2DPlot->Fill(lMultValueToFill, hImpactParameter->GetBinCenter(ib), lProbability * hImpactParameter->GetBinContent(ib));
}
}
}
}
}
3 changes: 2 additions & 1 deletion Common/Tools/Multiplicity/multGlauberNBDFitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ 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, TH2F* lNPart2DPlot, TH2F* lNColl2DPlot, TH1F* hPercentileMap, Double_t lLoRange = -1, Double_t lHiRange = -1, TH3D* lNpNcEcc = 0x0, TH2F* lEcc2DPlot = 0x0);
// also viable: eccentricity, impact parameter, ancestor cross-check plot
void CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCollProf, TH2F* lNPart2DPlot, TH2F* lNColl2DPlot, TH1F* hPercentileMap, Double_t lLoRange = -1, Double_t lHiRange = -1, TH3D* lNpNcEcc = 0x0, TH2F* lEcc2DPlot = 0x0, TH3D* lNpNcB = 0x0, TH2F* lB2DPlot = 0x0, TH2F* lNancestor2DPlot = 0x0);

// void Print(Option_t *option="") const;

Expand Down
Loading