We are currently doing some spectrum analysis on a dataset obtained from a fiber scintillator detector setup. Our old code uses TSpectrum in it. Since it’s mentioned that TSpectrum is now legacy, are there any general alternatives to use it? Is it possible to use RooFit or RooStats?
I do not think there a one to one replacement. Depending on how you are using TSpectrum there might be several other possibilities. @moneta can tell you I am sure.
Yes in principle it should be possible to use RooFit for such analysis.However TSpectrum will not be removed, one can continue to use it as it is, there will be only no new developments or fixes in the code.
Which kind of functionality of TSpectrum are you using it ?
hmm, This is now the x-th time that I have seen this kind of answer. Wording like “in principle” and “possible” are not very encouraging. Could anyone then fill in the blanks with RooFit.
Why not take one of the TSpectrum tutorials and do it in RooFit
TSpectrum has also some other functionalities like the “peak finder” that’s why Lorenzo asked which functionality is requested here. That said, as I suggested, I might be good to update the TSpectrum page with a list of “replacements” and some examples showing how to do it.
TSpectrum provides also some specific algorithm developed by the original author, which we are not sure if these are actually used and they are the standard in the spectrum community. Examples include deconvolution, unfolding, background estimation, etc,…
Some of this will be possible with existing ROOT classes, e.g. RooFit, TUnfold, etc…, others
maybe not.
I think first is important to understand first which functionality in TSpectrum is really used and in this case we can provide some replacement examples.
To answer @moneta 's question, we use TSpectrum only to find the position of the first two peaks in the photon-electron spectrum of our dataset. Those x-axis position values are then later used for fitting Gaussian functions within a range of the peaks. The fits are then later used for normalization procedures and so on.
Thank you for the answer. The peak finding position is one of the unique feature of TSpectrum. In case we deprecate the class we will need to add an alternative implementation in the ROOT Histogram library
I assume that means there’s no present alternative for use. Hope that a new implementation will be made available soon, possibly integrated into RooStats or RooFit (not that I would not use the legacy class at all).
There is no direct alternative for such specific algorithm of gamma or X ray spectra, as the one mentioned. We don’t have also the needed expertise in ROOT to provide and maintain such algorithms.
What you can do, is estimate the background using a more general approach based on modelling the likelihood function using RooFit.