KaliVeda
Toolkit for HIC analysis
KVAlphaCalibration Class Reference

Detailed Description

Set up and run the calibration of siliciums.

This can be used either 'interactively' or in menu-driven mode. In both cases, in order to run a calirbation, the user must specify

  • the histogram
  • the energy and normalization factor of the peaks present in the histogram
  • the parameter of the method that will initialise the position of the peaks

The role of this class is to search for a number of peaks given by the user in a histogram and to fit them in order to get several information about the response of the detectors. This class was made in order to calibrate silicium with alpha but it can be use for every detectors which response is a gaussian.

The way it has to be used

To set up the calibration class the user needs to give the number of peaks that has to be found in the constructor. If the user wants to fit several peaks with one program, it is recommended to set up only one KVAlphaCalibration class and to set the histograms in a loop, instead of using the constructor with a histogram.

Afterwards, the user needs to set the energy and the normalization factor of the peaks with the method SetPeak(). The method SetSigmaSpec needs to be used in order to set up the TSpectrum that will initialise the model, while SetSigmaFit will set the width for the model. The default value of ThresholdOfTSpectrum may be fine but if the TSpectrum find to many peaks it can be modified with SetThresholdOfTSpectrum. Finally the user just has to use the FitInit and FitSpectrum methods in order to get the results

It is possible for the user to draw the histogram, but he needs to create a canvas. The histogram will be drawn in it

Definition at line 71 of file KVAlphaCalibration.h.

#include <KVAlphaCalibration.h>

Public Member Functions

 KVAlphaCalibration (int NumberOfPeak_)
 
 KVAlphaCalibration (int NumberOfPeak_, TH1 *h)
 
 ~KVAlphaCalibration ()
 Default destructor. More...
 
void AddPeak (double Energy_, double Intensity_)
 
void DrawResult (bool WhatToDraw=true)
 
void FitAll (bool debug_=false)
 This function calls the FitInit and FitSpectrum function. More...
 
TGraphFitInit (bool debug_=false)
 
void FitSpectrum (bool debug_=false)
 
double GetGaussianFitParameter (int)
 
double GetGaussianFitParError (int)
 
double GetInitializationFitParameter (int)
 
void Init (int)
 
void PrintResult (void)
 
void SetHisto (TH1 *h)
 Set the histogram that contains the data. More...
 
void SetHistRange (double xmin, double xmax)
 
void SetParameters (double SigmaOfTSpectrum_=1., double SigmaOfGaussian_=1., double ThresholdOfTSpectrum_=0.5, double IsOriginAtZero_=false)
 

Constructor & Destructor Documentation

◆ KVAlphaCalibration() [1/2]

KVAlphaCalibration::KVAlphaCalibration ( int  NumberOfPeak_)

Definition at line 15 of file KVAlphaCalibration.cpp.

◆ KVAlphaCalibration() [2/2]

KVAlphaCalibration::KVAlphaCalibration ( int  NumberOfPeak_,
TH1 h 
)

Definition at line 26 of file KVAlphaCalibration.cpp.

◆ ~KVAlphaCalibration()

KVAlphaCalibration::~KVAlphaCalibration ( )

Default destructor.

Definition at line 39 of file KVAlphaCalibration.cpp.

Member Function Documentation

◆ AddPeak()

void KVAlphaCalibration::AddPeak ( double  Energy_,
double  Intensity_ 
)

Set the energy and the normalization factor the peaks you want to fit. The normalization factor is only here to constrain the model

Definition at line 87 of file KVAlphaCalibration.cpp.

◆ DrawResult()

void KVAlphaCalibration::DrawResult ( bool  WhatToDraw = true)

Definition at line 453 of file KVAlphaCalibration.cpp.

◆ FitAll()

void KVAlphaCalibration::FitAll ( bool  debug_ = false)

This function calls the FitInit and FitSpectrum function.

Definition at line 254 of file KVAlphaCalibration.cpp.

◆ FitInit()

TGraph * KVAlphaCalibration::FitInit ( bool  debug_ = false)

This method find the peaks with a TSpectrum and fit their position to initialize the model The boolean is false by default, but it is advised to set it true in order to check if the TSpectrum find the right peaks. If not, change the parameter SigmaOfTSpectrum and ThresholdOfTSpectrum

Definition at line 272 of file KVAlphaCalibration.cpp.

◆ FitSpectrum()

void KVAlphaCalibration::FitSpectrum ( bool  debug_ = false)

This methods will use the model and fit the peaks in the histogram with a gaussian in order to get a very accurate calibration It also print the results at the end of the fit

Definition at line 338 of file KVAlphaCalibration.cpp.

◆ GetGaussianFitParameter()

double KVAlphaCalibration::GetGaussianFitParameter ( int  j)

Get the final parameter found by the model 0 for the slope 1 for the ordinate at the origin 2 for the width factor. This factor needs to be multiplied by the energy of one peak in order to get his width 3 - NumberOfPeak + 3 for the normalization factor

Definition at line 195 of file KVAlphaCalibration.cpp.

◆ GetGaussianFitParError()

double KVAlphaCalibration::GetGaussianFitParError ( int  j)

Get the error of final parameter found by the model 0 for the error of the slope 1 for the error of the ordinate at the origin 2 for the error of the width factor. This factor needs to be multiplied by the energy of one peak in order to get his width 3 - NumberOfPeak + 3 for the error of the normalization factor

Definition at line 225 of file KVAlphaCalibration.cpp.

◆ GetInitializationFitParameter()

double KVAlphaCalibration::GetInitializationFitParameter ( int  j)

Get the initialization parameter of the model. 0 for the slope 1 for the ordinate at the origin

Definition at line 168 of file KVAlphaCalibration.cpp.

◆ Init()

void KVAlphaCalibration::Init ( int  NumberOfPeak_)

Definition at line 63 of file KVAlphaCalibration.cpp.

◆ PrintResult()

void KVAlphaCalibration::PrintResult ( void  )

Definition at line 483 of file KVAlphaCalibration.cpp.

◆ SetHisto()

void KVAlphaCalibration::SetHisto ( TH1 h)

Set the histogram that contains the data.

Definition at line 108 of file KVAlphaCalibration.cpp.

◆ SetHistRange()

void KVAlphaCalibration::SetHistRange ( double  xmin,
double  xmax 
)

Definition at line 120 of file KVAlphaCalibration.cpp.

◆ SetParameters()

void KVAlphaCalibration::SetParameters ( double  SigmaOfTSpectrum_ = 1.,
double  SigmaOfGaussian_ = 1.,
double  ThresholdOfTSpectrum_ = 0.5,
double  IsOriginAtZero_ = false 
)

Definition at line 131 of file KVAlphaCalibration.cpp.