I want to create a custom TF1 from say bins, 2190 to 2260, which smoothly passes over the peaks in this histogram. Does anyone have any idea about ‘creating’ TF1 from any such histograms? Also, can I view this TF1 as an output on the screen after it is created?
Any help or a starting point is highly appreciated here, thank you!
one way to do this is to fit the histogram with some functional form. For example you can define a TF1 with some free parameters and then call histo.Fit(function). See e.g. ROOT: tutorials/hist/hlHisto4.C File Reference for code that fits a TF1 to a TH1. @moneta might be able to point to better resources.
You can see this example, for transforming a TH1 in a TF1 that is then used for fitting. If you want to smooth your histogram you can use TH1::Interpolate that performs linear interpolation between bins, or TH1::Smooth.