===== Analysis tools ===== ===Novosibirsk function=== The Novosibirsk function is typically used to fit monoenergetic electromagnetic calorimeter spectra. Explanations on this function are given here {{ :software:novosibirsk.pdf |}}. A C++ code snippet to calculate the function using ROOT classes is given below. The interface is chosen to be usable with the ROOT fitting routines, e.g. ''TH1::Fit()''. It takes two arrays as input. From the first one only the first element is used as ''x'', From the second array, the values of the fit parameters are taken. #include "TMath.h" /* p[0] = normalisation constant p[1] = peak position p[2] = sigma (energy resolution) p[3] = eta (asymmetry parameter) p[4] = constant background */ double novosibirsk(double *x, double *p) { double xi=2.35482004503094933e+00; double Y=(x[0]-p[1])*p[3]/p[2]; if(Y>=1) return p[4]; double lnX = log( 1. - Y ); double s0 = 2/xi*TMath::ASinH(p[3]*xi*0.5); double s02 = s0*s0; double f = p[0]*exp ( -0.5/s02 * lnX*lnX - 0.5*s02) + p[4]; return f; }