Problem in histogram calibration

Hi,

I am trying to do the energy calibration of a histogram using a second degree polynomial function :

Double_t HP_Ge::channel_Energy(Double_t x)
{
  Double_t v;
  v = -78.61 + (0.6816*LaBr3Raw[3]) + (1.043*TMath::Power(10,-6)*TMath::Power(LaBr3Raw[3],2));     
  return v;
}

and the following is what I have :

I dont understand why the calibarted spectrum is like this. I already tried using a different binning for the second histogram but I cannot get it to look nice, but it doesnt work.

Thank you!

Can you provide a more complete example reproducing this plot ?

I have a ttree with the raw data, and I use the make class for the calibration .
HP_Ge.h (17.2 KB)
HP_Ge.C (3.8 KB)

I tried with a linear function also to fit but I have similar results

root [0] 
Processing HP_Ge.C...
Error in <TFile::TFile>: file /Users/couet/Downloads/r0207_000a.root does not exist
(HP_Ge) @0x7f79221c0820
root [1] .q

As the file size is large, please find the root file in the following link:

@gini

I guess, it is not really a ROOT problem.

You may wish to smooth your histogram after you apply calibration function by replacing

v = 0.6861 * x - 82.4698;
with
v = 0.6861 * x - 82.4698 + ((float) rand()/(float) RAND_MAX) ;

Hope this helps.

Ajay

@ajaydeo thanks for the reply !

In that case what to do with the polynomial function if I use it to calibrate ?

@gini

As simple as,

  v = -78.61 + (0.6816*LaBr3Raw[3]) + (1.043*TMath::Power(10,-6)*TMath::Power(LaBr3Raw[3],2)) + ((float) rand()/(float) RAND_MAX);     

Ajay

1 Like

If I may suggest another improvement (which will not fix anything, but it makes the code cleaner and faster):
consider replacing

1.043*TMath::Power(10,-6)*TMath::Power(LaBr3Raw[3],2)

with just

1.043e-6*TMath::Sq(LaBr3Raw[3])
1 Like