 |
Belle II Software
release-05-02-19
|
13 #include <top/calibration/TOPLocalCalFitter.h>
14 #include <calibration/CalibrationAlgorithm.h>
30 class TOPLocalCalFitter :
public CalibrationAlgorithm {
75 if (fitterMode ==
"calibration")
76 B2INFO(
"Fitter set to calibration mode");
77 else if (fitterMode ==
"monitoring")
78 B2INFO(
"Fitter set to monitoring mode");
79 else if (fitterMode ==
"MC")
80 B2INFO(
"Fitter set to MC mode");
82 B2ERROR(
"Unknown fitter type " << fitterMode <<
". The valid options are calibration, monitoring or MC");
123 std::string
m_output =
"laserFitResult.root";
125 "/group/belle2/group/detector/TOP/calibration/MCreferences/LaserMCParameters.root";
127 "/group/belle2/group/detector/TOP/calibration/MCreferences/TTSParametrization.root";
130 std::vector<float>
m_binEdges = {50, 100, 130, 160, 190, 220, 250, 280, 310, 340, 370, 400, 430, 460, 490, 520, 550, 580, 610, 640, 670, 700, 800, 900, 1000, 1200, 1500, 2000};
virtual EResult calibrate() override
Runs the algorithm on events.
float m_sigmaBackgroundConstraints
Sigma of the gaussian used to describe the background.
float m_f2
Fraction of the second gaussian on the TTS parametrization.
float m_fractionConstraints
Fraction of the main peak.
float m_alphaExtraConstraints
alpha parameter of the tail of the extra peak.
float m_secondPulserSigma
Time resolution from the fit of the first electronic pulse, from a Gaussian fit.
float m_yieldLaser
Total number of laser hits from the fitting function integral.
void setupOutputTreeAndFile()
prepares the output tree
float m_channelT0
Raw, channelT0 calibration, defined as peakTime-peakTimeMC.
float m_yieldLaserBackground
Integral of the background gaussian.
float m_nExtra
parameter n of the tail of the extra peak
std::string m_fitConstraints
File with the TTS parametrization.
float m_fractionMC
Fraction of events in the secondary peak form the MC simulation.
TFile * m_inputTTS
File containing m_treeTTS.
float m_deltaTErr
Statistical error on deltaT.
float m_sigmaBackground
Sigma of the gaussian used to describe the background.
void calculateChennelT0()
Calculates the commonT0 calibration after the fits have been done.
float m_peakTime
Fitted time of the main (i.e.
TTree * m_treeTTS
Input to the fitter.
void setFitMode(const std::string &fitterMode)
Sets the fitter mode.
float m_firstPulserTime
Average time of the first electronic pulse respect to the reference pulse, from a Gaussian fit.
float m_sigma2
Width of the second gaussian on the TTS parametrization.
virtual ~TOPLocalCalFitter()
Destructor.
float m_secondPulserTime
Average time of the second electronic pulse respect to the reference pulse, from a gaussian fit.
float m_timeExtra
Position of the extra peak seen in the timing tail, w/ respect to peakTime.
TTree * m_timewalkTree
Output of the fitter.
TOPLocalCalFitter()
Constructor.
void setFitConstraintsFileName(const std::string &fitConstraints)
Sets the name of the root file containing the laser MC time corrections and the fit constraints.
float m_firstPulserSigma
Time resolution from the fit of the first electronic pulse, from a Gaussian fit.
short m_channel
Channel number (0-511)
TFile * m_histFile
Output of the fitter.
int m_minEntries
Minimum number of entries to perform the fit.
float m_histoIntegral
Integral of the fitted histogram.
float m_timeBackgroundConstraints
Position of the gaussian used to describe the background, w/ respect to peakTime.
float m_deltaTConstraints
Distance between the main and the secondary laser peak.
TTree * m_fitTree
Output of the fitter.
void setTTSFileName(const std::string &TTSData)
Sets the name of the root file containing the TTS parameters.
void loadMCInfoTrees()
loads the TTS parameters and the MC truth info
void fitChannel(short, short, TH1 *)
Fits the laser light on one channel.
Abstract base class for different kinds of events.
std::string m_output
Name of the output file.
float m_mean2
Position of the second gaussian of the TTS parametrization with respect to the first one.
float m_channelT0Err
Statistical error on channelT0.
std::string m_fitterMode
Fit mode.
std::vector< float > m_binEdges
Amplitude bins.
float m_fraction
Fraction of events in the secondary peak.
TFile * m_inputConstraints
File containing m_treeConstraints.
float m_binLowerEdge
Lower edge of the amplitude bin in which this fit is performed.
float m_peakTimeErr
Statistical error on peakTime.
float m_yieldLaserErr
Statistical error on yield.
bool m_isFitInAmplitudeBins
Enables the fit in amplitude bins.
short m_fitStatus
Fit quality flag, propagated to the constants.
void fitInAmpliduteBins(bool isFitInAmplitudeBins)
Enables the fit amplitude bins.
void determineFitStatus()
determines if the constant obtained by the fit are good or not
float m_sigmaExtraConstraints
Width of the guassian used to describe the extra peak on the timing distribution tail.
float m_timeExtraConstraints
Position of the guassian used to describe the extra peak on the timing distribution tail.
EResult
The result of calibration.
float m_fractionErr
Statistical error on fraction.
float m_alphaExtra
alpha parameter of the tail of the extra peak.
float m_nExtraConstraints
parameter n of the tail of the extra peak
void setOutputFileName(const std::string &output)
Sets the name of the output root file.
float m_yieldLaserExtra
Integral of the extra peak.
float m_f1
Fraction of the first gaussian on the TTS parametrization.
float m_peakTimeMC
Time of the main peak in teh MC simulation, i.e.
void fitPulser(TH1 *, TH1 *)
Fits the two pulsers.
float m_sigma
Gaussian time resolution, fitted.
float m_deltaTMC
Time difference between the main peak and the secondary peak in the MC simulation.
short m_pixelRow
Pixel row.
float m_deltaT
Time difference between the main peak and the secondary peak.
float m_rms
RMS of the histogram used for the fit.
float m_timeBackground
Position of the gaussian used to describe the background, w/ respect to peakTime.
float m_peakTimeConstraints
Time of the main laser peak in the MC simulation (aka MC correction)
float m_chi2
Reduced chi2 of the fit.
float m_sigmaExtra
Gaussian sigma of the extra peak in the timing tail
void setMinEntries(int minEntries)
Sets the minimum number of entries to perform the calibration in one channel.
std::string m_TTSData
File with the Fit constraints and MC info.
short m_slot
Slot ID (1-16)
float m_binUpperEdge
Upper edge of the amplitude bin in which this fit is performed.
float m_sigmaErr
Statistical error on sigma.
TTree * m_treeConstraints
Input to the fitter.
short m_pixelCol
Pixel column.
float m_sigma1
Width of the first gaussian on the TTS parametrization.