Skip to content

Commit bcdac1a

Browse files
committed
Last fix
1 parent faa6feb commit bcdac1a

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

Common/Tools/Multiplicity/multGlauberNBDFitter.cxx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,14 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
436436
lNpNcEcc->GetYaxis()->SetRange(lNpNcEcc->GetYaxis()->FindBin(fNcoll[ibin]), lNpNcEcc->GetYaxis()->FindBin(fNcoll[ibin]));
437437
hEccentricity = reinterpret_cast<TH1D*>(lNpNcEcc->Project3D("z"));
438438
hEccentricity->SetName(Form("hEccentricity_%i", ibin));
439+
440+
// normalize into unitary fractions
441+
Double_t eccIntegral = hEccentricity->Integral(1, hEccentricity->GetNbinsX()+1);
442+
if(eccIntegral>1e-6){ // no counts
443+
hEccentricity->Scale(1./eccIntegral);
444+
}else{
445+
hEccentricity->Scale(0.0);
446+
}
439447
}
440448

441449
// impact parameter handling
@@ -446,6 +454,14 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
446454
lNpNcB->GetYaxis()->SetRange(lNpNcB->GetYaxis()->FindBin(fNcoll[ibin]), lNpNcB->GetYaxis()->FindBin(fNcoll[ibin]));
447455
hImpactParameter = reinterpret_cast<TH1D*>(lNpNcB->Project3D("z"));
448456
hImpactParameter->SetName(Form("hImpactParameter_%i", ibin));
457+
458+
// normalize into unitary fractions
459+
Double_t bIntegral = hImpactParameter->Integral(1, hImpactParameter->GetNbinsX()+1);
460+
if(bIntegral>1e-6){ // no counts
461+
hImpactParameter->Scale(1./bIntegral);
462+
}else{
463+
hImpactParameter->Scale(0.0);
464+
}
449465
}
450466

451467
for (Long_t lMultValue = 1; lMultValue < lHiRange; lMultValue++) {
@@ -471,7 +487,7 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
471487
lNCollProf->Fill(lMultValueToFill, fNcoll[ibin], lProbability);
472488
if (lNancestor2DPlot) {
473489
// fill cross-check histogram with lNancestorCount at lNancestors value
474-
lNancestor2DPlot->Fill(lMultValueToFill, lNancestors, lProbability * lNancestorCount);
490+
lNancestor2DPlot->Fill(lMultValueToFill, lNancestors, lProbability);
475491
}
476492
if (lNPart2DPlot)
477493
lNPart2DPlot->Fill(lMultValueToFill, fNpart[ibin], lProbability);
@@ -480,13 +496,13 @@ void multGlauberNBDFitter::CalculateAvNpNc(TProfile* lNPartProf, TProfile* lNCol
480496
if (lNpNcEcc) {
481497
// collapse the entire eccentricity distribution for this combo
482498
for (int ib = 1; ib < hEccentricity->GetNbinsX() + 1; ib++) {
483-
lEcc2DPlot->Fill(lMultValueToFill, hEccentricity->GetBinCenter(ib), lProbability * lNancestorCount * hEccentricity->GetBinContent(ib));
499+
lEcc2DPlot->Fill(lMultValueToFill, hEccentricity->GetBinCenter(ib), lProbability * hEccentricity->GetBinContent(ib));
484500
}
485501
}
486502
if (lNpNcB) {
487503
// collapse the entire impact parameter distribution for this combo
488504
for (int ib = 1; ib < hImpactParameter->GetNbinsX() + 1; ib++) {
489-
lB2DPlot->Fill(lMultValueToFill, hImpactParameter->GetBinCenter(ib), lProbability * lNancestorCount * hImpactParameter->GetBinContent(ib));
505+
lB2DPlot->Fill(lMultValueToFill, hImpactParameter->GetBinCenter(ib), lProbability * hImpactParameter->GetBinContent(ib));
490506
}
491507
}
492508
}

0 commit comments

Comments
 (0)