Belle II Software  release-08-01-10
LaserCalibratorFit Class Reference

A class do laser calibration fit provide different fitting method (under development) More...

#include <LaserCalibratorFit.h>

Collaboration diagram for LaserCalibratorFit:

Public Member Functions

 LaserCalibratorFit (unsigned moduleID)
 Constructor. More...
 
 ~LaserCalibratorFit ()
 Destructor.
 
void setHist (const std::vector< TH1F * > &hist)
 set time hist of all channels in one moduleID More...
 
void setFitMethod (const std::string &method)
 set time fit function More...
 
void setFitRange (double xmin=-200, double xmax=200)
 set x range in the fit More...
 
int fitChannel (unsigned channel)
 fit for a specific channel More...
 
void writeFile (const std::string &outfile)
 write fit result to a root file More...
 
int getModuleID () const
 get the module ID in the fit
 
double getFitChisq (unsigned channel)
 get chi^2 in the fit More...
 
std::string getFitMethod () const
 get the fit method used in recent module
 
std::vector< double > getMaxPos ()
 get the center positon of hist max bin
 
double getFitT ()
 get mean positon after fit
 
double getFitTErr ()
 returns the error mean positon after fit
 

Private Member Functions

TF1 * makeGFit (unsigned channel)
 Fit process using single gaussian function. More...
 
TF1 * makeCBFit (unsigned channel)
 Fit process using single Crystal Ball fuction. More...
 
TF1 * makeCB2Fit (unsigned channel, bool minOut)
 Fit process using double Crystal Ball fuction. More...
 

Private Attributes

unsigned m_moduleID = 0
 one moduleID/slot
 
std::vector< double > m_maxpos
 center positon of hist max bin
 
std::vector< double > m_maxpos_error
 error on the center positon of hist max bin
 
double m_xmin = 0
 fitting low-edge
 
double m_xmax = 0
 fitting upper-edge
 
double m_fitT = 0
 mean position after fit
 
double m_fitTErr = 0.
 error on the mean position estimated by the fit
 
std::vector< TH1F * > m_hist
 time hist of 512 channels
 
std::vector< TF1 * > m_func
 fitting function
 
std::string m_fitMethod
 fitting method
 

Detailed Description

A class do laser calibration fit provide different fitting method (under development)

Definition at line 44 of file LaserCalibratorFit.h.

Constructor & Destructor Documentation

◆ LaserCalibratorFit()

LaserCalibratorFit ( unsigned  moduleID)
explicit

Constructor.

Parameters
moduleIDmodule ID

Definition at line 54 of file LaserCalibratorFit.cc.

54  :
55  m_moduleID(moduleID)
56  {
57  }
unsigned m_moduleID
one moduleID/slot

Member Function Documentation

◆ fitChannel()

int fitChannel ( unsigned  channel)

fit for a specific channel

Parameters
channela specific channel (0 - 511)

Definition at line 92 of file LaserCalibratorFit.cc.

◆ getFitChisq()

double getFitChisq ( unsigned  channel)

get chi^2 in the fit

Parameters
channelchi^2 for a channel

Definition at line 83 of file LaserCalibratorFit.cc.

◆ makeCB2Fit()

TF1 * makeCB2Fit ( unsigned  channel,
bool  minOut 
)
private

Fit process using double Crystal Ball fuction.

Parameters
channelrefers to a typical time separation of two main peaks
minOutminimum printing need more studies

Definition at line 291 of file LaserCalibratorFit.cc.

◆ makeCBFit()

TF1 * makeCBFit ( unsigned  channel)
private

Fit process using single Crystal Ball fuction.

Parameters
channelchannel number

Definition at line 253 of file LaserCalibratorFit.cc.

◆ makeGFit()

TF1 * makeGFit ( unsigned  channel)
private

Fit process using single gaussian function.

Parameters
channelchannel number

Definition at line 235 of file LaserCalibratorFit.cc.

◆ setFitMethod()

void setFitMethod ( const std::string &  method)
inline

set time fit function

Parameters
methodgauss: single gaussian; cb: single Crystal Ball; cb2: double Crystal Ball

Definition at line 67 of file LaserCalibratorFit.h.

67 {m_fitMethod = method;}
std::string m_fitMethod
fitting method

◆ setFitRange()

void setFitRange ( double  xmin = -200,
double  xmax = 200 
)
inline

set x range in the fit

Parameters
xminlower x
xmaxupper x

Definition at line 74 of file LaserCalibratorFit.h.

◆ setHist()

void setHist ( const std::vector< TH1F * > &  hist)

set time hist of all channels in one moduleID

Parameters
histtime hist vector

Definition at line 73 of file LaserCalibratorFit.cc.

◆ writeFile()

void writeFile ( const std::string &  outfile)

write fit result to a root file

Parameters
outfileoutput file name

Definition at line 125 of file LaserCalibratorFit.cc.


The documentation for this class was generated from the following files: