Belle II Software development
T0CalibrationAlgorithm.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9#include <calibration/CalibrationAlgorithm.h>
10#include <TH1F.h>
11#include <cdc/dbobjects/CDCGeometry.h>
12#include <framework/database/DBObjPtr.h>
13#include "string"
14namespace Belle2 {
19 namespace CDC {
24 public:
30 void storeHisto(bool storeHist = false) {m_storeHisto = storeHist;}
32 void setMinimumNDF(double minndf) {m_ndfmin = minndf;}
34 void setMinimumPval(double minPval) {m_Pvalmin = minPval;}
36 void setMaxRMSDt(double maxRMSDt) {m_maxRMSDt = maxRMSDt;}
38 void setMaxMeanDt(double maxMeanDt) {m_maxMeanDt = maxMeanDt;}
40 void setOffsetMeanDt(double offsetMeanDt) {m_offsetMeanDt = offsetMeanDt;}
42 void setMaxBadChannel(double max_bad_channel) {m_maxBadChannel = max_bad_channel;}
43
45 void setCommonT0(double commonT0) {m_commonT0 = commonT0;}
46
48 void enableTextOutput(bool output = true) {m_textOutput = output;}
49
51 void setOutputFileName(std::string outputname) {m_outputT0FileName.assign(outputname);}
52
54 void setHistFileName(const std::string& name) {m_histName = "histT0_" + name + ".root";}
55
56 protected:
58 EResult calibrate() override;
60 void createHisto();
62 int write();
64 double getMeanT0(TH1F* h1);
65 private:
66 TH1F* m_hTotal;
67 TH1F* m_h1[56][385];
68 TH1F* m_hT0b[300];
69 double m_xmin = 0.07;
70 double m_ndfmin = 5;
71 double m_Pvalmin = 0.;
72 /*Condition to stop iterate minDt <m_maxDt and rmsDt<m_maxRMS*/
73 double m_maxMeanDt = 0.2;
74 double m_offsetMeanDt = -0.4;
75 double m_maxRMSDt = 0.22;
76 double m_maxBadChannel = 50;
77 double dt[56][385] = {{0.}};
78 double err_dt[56][385] = {{0.}};
79 double dtb[300] = {0.};
80 double err_dtb[300] = {0.};
81 double m_commonT0 = 4825.;
83 bool m_storeHisto = false;
84 bool m_textOutput = false;
85 std::string m_outputT0FileName = "t0_new.dat";
86 std::string m_histName = "histT0.root";
88 };
89 }// name space CDC
91} // namespace Belle2
92
void setMinimumNDF(double minndf)
minimum ndf require for track.
void setMinimumPval(double minPval)
minimum pvalue requirement.
void setOutputFileName(std::string outputname)
output xt T0 file name (for text mode)
void setMaxMeanDt(double maxMeanDt)
Maximum mean of dt of all channels distribution, condition to stop iterating.
std::string m_outputT0FileName
output t0 file name for text file
double m_offsetMeanDt
offset dT distribution caused by event timing extraction;
TH1F * m_hTotal
1D histogram of delta T whole channel
double dt[56][385]
dt of each channel
void createHisto()
create histo for each channel
double getMeanT0(TH1F *h1)
calculate mean of the T0 distribution
double m_maxRMSDt
RMS of dT distribution of all channels.
void setCommonT0(double commonT0)
set common T0
void storeHisto(bool storeHist=false)
store Hisotgram or not.
DBObjPtr< CDCGeometry > m_cdcGeo
Geometry of CDC.
double m_commonT0
A common T0 of all channels.
void enableTextOutput(bool output=true)
Enable text output of calibration result.
void setHistFileName(const std::string &name)
Set name for histogram output.
void setMaxBadChannel(double max_bad_channel)
Maximum channel in which T0 is still need to be calibrated.
double m_maxMeanDt
Mean of dT distribution of all channels;.
TH1F * m_h1[56][385]
1D histogram for each channel
double err_dt[56][385]
error of dt of each channel
bool m_textOutput
output text file if true
EResult calibrate() override
Run algo on data.
TH1F * m_hT0b[300]
1D histogram for each board
double m_Pvalmin
minimum pvalue required
void setMaxRMSDt(double maxRMSDt)
Maximum RMS of dt of all channels distribution, condition to stop iterating.
double err_dtb[300]
error of dt of board
double m_maxBadChannel
Number of channels which has DeltaT0 larger then 0.5.
void setOffsetMeanDt(double offsetMeanDt)
Maximum mean of dt of all channels distribution, condition to stop iterating.
Base class for calibration algorithms.
EResult
The result of calibration.
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Abstract base class for different kinds of events.