Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save simonspa/6c1427738ff1b236f15a76ba944f876b to your computer and use it in GitHub Desktop.
Save simonspa/6c1427738ff1b236f15a76ba944f876b to your computer and use it in GitHub Desktop.
Method to analytically approximate the MPV of the Landau distribution, e.g. for charge deposited.
When filling histogram, fill with Moyal distribution instead of charge directly:
qMoyalvsxmym->fill( xmod, ymod, exp(- Q0 / 3.5) );
where 3.5 is a normalization factor corresponding to <>
After filling the histogram, rebin using
for(Int_t i = 1; i <= h->GetNbinsX(); i++) {
for(Int_t j = 1; j <= h->GetNbinsY(); j++) {
double qx = h->GetBinContent(i,j);
h->SetBinEntries(h->GetBin(i,j),1);
h->SetBinContent(i,j,-3.5*log(qx));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment