Best practice to retrieve detector response?

Dear rooters,

I have background data, background + signal data, and Monte Carlo simulated signal sample, all in TTree format. I’d like to retrieve the detector response by comparing the energy spectra between data and MC. The detector response can be described by a scaling and a smearing parameter on the energy, both can be applied to individual MC events, and the energy scaling parameter is what I am after.

My first attempt is to write a double myfunc(double* x, double* p) that can be used to create a TF1 object, fMC. I read MC events’ energies from a tree, scale them using p[0], smear them using p[1], and save the result to a histogram, hMC, in myfunc. The background data is saved in another histogram, hBG. I add them together: h->Add(hMC, hBG, p[2], p[3]) and return its bin content based on x[0] (energy). Background + signal data is filled into another histogram, hdata. I then try hdata->Fit(fMC) to determine all the p’s, including p[0], which is what I’d like to know. Unfortunately, the fitting never converges.

RooUnfold seems to be a standard way to get the response matrix, but I don’t know how to get the scaling factor from the matrix.

I am thinking using RooKeysPdf to get the signal PDF from the MC tree, and convolute it with a Gaussian. But how can I implement the energy scaling factor to the resulting PDF as a fitting parameter? Another question is that FFT is used to calculate the convolution, is it possible to apply FFT directly to the energies saved in the tree? It seems silly to create the PDF from the tree, and then use the PDF to create random samples for FFT.

Am I on the right track? Is there any other way that I am not aware of? Please advice.

Thanks,

Jing

Hi,
Apologies for the late reply. I think I would start with your first approach, which seems to be reasonable, you model with your MC your data, maybe you should apply a convolution with a Gaussian for describing your detector resolution and you fit the Gaussian parameters of your convolution. The fit should converge, if it does not is probably due to some error in modelling your fitting function. Please post the code and your data and I can have a look at this.

Best,

Lorenzo

Best,

Hi, Lorenzo,

thanks for the confirmation. I’ll give my first attempt a second try. The fitting complains that no error matrix can be obtained. I remember I read somewhere that the calculation of the error matrix depends on the calculation of the derivative of myfunc. I thought myfunc is too complicated for Migrad to get the error matrix… If I fix all the parameters, I can draw the function on top of my histogram without problem.

Thanks,
Jing

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.