Skip to content

CDCalibrator update - Histograms and Fitting routine#109

Open
hannahkleis-ctrl wants to merge 12 commits into
Miniball:mainfrom
hannahkleis-ctrl:Cd_calibrator_update
Open

CDCalibrator update - Histograms and Fitting routine#109
hannahkleis-ctrl wants to merge 12 commits into
Miniball:mainfrom
hannahkleis-ctrl:Cd_calibrator_update

Conversation

@hannahkleis-ctrl

Copy link
Copy Markdown
Contributor

The CDCalibrator and settings are updated as well as the Makefile (to use TLinearFitter).

In the CDCalibrator only the histograms with the raw charge (n & p) are created and then the calibration parameters of the p-side is taken for the calibrated p-strip from the calibration file. The Histograms with the p-side on the x-axis and the n-side on the y-axis is taken for the calibration of the P-side and the other way around for the N-side calibration.

The fitting routine is adapted and is basically made out of two steps:

  1. Selection of the data using four linear functions with parameters to be adjusted as the allowance = 0.1 (10%), and the offsets of the two linear functions with small_offset, and larger_offset. These are given in keV and can be adjusted in the settingsfile if needed
  2. TLinearFitter and only take the data from the 'cuts' before (step 1) and then including a weight 1/sqrt(N) and a robust fitting with another parameter which can be adjusted in the settingsfile if needed (default 0.7)

Additionally, the residuals of the datapoints inside the cuts and the fitresults are plotted for each strip and saved in the pdf for further investigations of the fit.

The Makefile needed to be update to use the TLinearFitter in Root --> takes the correct libraries now
The histograms are changed to be only in raw charge without the calibrated energy. The calibration is now in the code only and takes the correct values of the initial p/n strip calibration of the calibration.dat file. 
Additionally, a new fitting routine is implemented which allows to select the data on the diagonal by using linear functions determined by certain parameters. As well as the TLinearFitter from root is used and the robust fitting. 
Furthermore, the residuals are calculated and drawn between the data which is inside the cuts and the fit.
Include the parameters to control the cuts/selection of the data as well as the robust fitting percentage.
Same as for the Setting.hh commit
The new parameters to control the fit in the CDCablibrator are implemented and can be updated, if needed.
changed the new histograms with only raw charge
Comment thread include/Settings.hh Outdated
Comment thread include/Settings.hh Outdated
Comment thread include/Settings.hh Outdated
Comment thread include/Settings.hh Outdated
Comment thread include/Settings.hh Outdated
Comment thread src/CDCalibrator.cc Outdated
Comment thread src/CDCalibrator.cc Outdated
Comment thread src/CDCalibrator.cc Outdated
Comment thread src/CDCalibrator.cc Outdated
Comment thread src/CDCalibrator.cc Outdated
}

//Residuals
if(validFit && cd_pQ_nQ[i][j][k]->GetEntries() > 0){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this test with validFit really necessary? Why not just use continue statements in the early part of this nested loop and immediately skip to the next channel? It will save time in the execution and also save many lines of code and complexities.

If you really want to have the print statement to the user that the channel is skipped, just put that inside the if statement just before you call continue;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those changes, I made in the last commit for the CDCalibrator.cc file, what you meant by that?

hannahkleis-ctrl and others added 5 commits June 5, 2026 13:33
Adjusted the parameters in the CDCalibrator which were suggested to be changed
Changed the handling of the missing strips with the continue as suggested
Adjusted the default values to the correct ones as set as default in the Setting.cc file
Comment thread src/CDCalibrator.cc Outdated
Updated the number of Bins from 8192 to 1024 to help with memory issues

Co-authored-by: Carlotta Porzio <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants