I have Energy histogram with 8k channels and need to calibrate it. I am doing this with a macro but the output calibrated histogram has dips at fixed channel difference. In some cases, there are spikes in the calibrated histogram. I have found one article suggesting to use “(float) rand()/(float) RAND_MAX)” but that doesn’t work. Problem in histogram calibration
Attachments:
Macro I am using named Digitizer.cpp
The raw root file has name DataF_CH2.root
The output file I created has name OutputCH2_0.root
_ROOT Version:6.22/06
_Platform:Ububtu 20.04 LTS Compiler: Not Provided
do you mind making your input file publicly available to anyone without us needing to ask for access to it in the Google-Drive webform?
As to your issue, my first guess would be that it has to do with the fact that your Energy is an unsigned short. But I’d like to see your DataF_CH2.root to make sure.
What should be the value of Energy so that the entire expression inside the Fill() was within 260 < calibrated energy < 262? Clearly, it can’t be greater than Energy=83, because even with this Energy=83 you get 3.589×83−35.546+X (where 0<X<1), which is 262.3 at the very least (when X=0). Also, it can’t be smaller than Energy=82, because even with this Energy=82 you get 3.589×82−35.546+X, which is 259.8 at the most (when X=1). So in order to land between 259.8 and 262.3 you need your Energy to be between 82 and 83 (excluding both these values). But it is impossible as Energy is an unsigned short. So this bin is empty, and so are many others.