-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding method to apply a calibration with gain correction. #484
Conversation
#include <TH1.h> | ||
#include <TH2.h> | ||
#include <TRestStringOutput.h> | ||
#include <TSpectrum.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's a good idea to use this one (TSpectrum
) since it's deprecated (I think). It may not work as intended or stop to work at any future version of root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I need to search for peaks in a histogram and that is the only and simple way to do it (at least that i know of).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the documentation they propose to use RooFit
, but don't know about the effort required to migrate towards it. They say it is yet fine if you plan to use TSpectrum
.
for more information, see https://pre-commit.ci
Co-authored-by: Luis Antonio Obis Aparicio <35803280+lobis@users.noreply.github.com>
I suggest another name for the class, it could be Ot even just Although the name |
There should be an example, and detailed description on how to use, e.g. RML? EDIT: I see it is on the documentation, probably no need to add the RML, though there is an example folder where it could be placed. |
I think it would be interesting also to add the images that you are attaching at this PR inside the documentation. You must upload/push those images to the following directory: https://github.com/rest-for-physics/framework/tree/master/doc/doxygen/images See for example how |
Co-authored-by: Javier Galan <javier.galan@unizar.es>
Co-authored-by: Javier Galan <javier.galan@unizar.es>
I don't think there is a need to upload the files anyway, they already live in the GitHub servers, you can just use a link to the image in this PR (such as https://user-images.githubusercontent.com/110617994/270608238-ae66e659-cfe4-4f0b-9cb6-2b649138d1f0.png). This avoids having to host images on the repo itself. |
New method
TRestDataSetGainMap
calculates and stores the calibration parameters for a given detector with multiple (or just one) modules. These modules are defined in the Module class. It performs a gain correction based on a spatial segmentation of the detector module. This is useful for big modules such as the ones used in TREX-DM experiment. The input data files for this methods are TRestDataSet for both calculating the calibration parameters and performing the calibration of the desired events.To correct the gain inhomogeneities, the module is divided in fNumberOfSegmentsX*fNumberOfSegmentsY segments. The energy peaks provided are fitted in each segment. The events are associated to each segment based on the observables fSpatialObservableX and fSpatialObservablesY. This results in the following plot that can be obtain with the function TRestDataSetGainMap::Module::DrawSpectrum()
Also, the peak position provides a gain map that can be plotted with the function TRestDataSetGainMap::Module::DrawGainMap(peakNumber)
The result is a better energy resolution with the gain corrected calibration (red) than the plain calibration (blue)