14#include <calibration/CalibrationAlgorithm.h>
15#include <cdc/dbobjects/CDCGeometry.h>
16#include <framework/database/DBObjPtr.h>
28 enum {c_Left = 0, c_Right = 1};
33 enum {c_Polynomial = 0, c_Chebyshev = 1};
44 enum FitStatus {c_lowStat = -1, c_fitFailure = 0, c_OK = 1,
45 c_errorOuter = 2, c_errorInner = 3
146 double m_par6[56] = {89, 91, 94, 99, 104, 107, 110, 117,
147 126, 144, 150, 157, 170, 180,
148 160, 167, 183, 205, 200, 194,
149 177, 189, 192, 206, 224, 234,
150 193, 206, 209, 215, 222, 239,
151 204, 212, 217, 227, 235, 240,
152 215, 222, 230, 239, 246, 253,
153 227, 232, 239, 243, 253, 258,
154 231, 243, 246, 256, 263, 300
Class to perform xt calibration for drift chamber.
void setStoreHisto(bool storeHist=false)
set to store histogram or not.
void storeHisto()
Store histogram to file.
void setOutputFileName(std::string outputname)
output file name
void prepare()
Prepare the calibration of XT.
void sanitaryCheck()
Check if there are any wrong xt functions.
double m_par6[56]
boundary parameter for fitting, semi-experiment number
float m_lowerTheta[7]
Lower boundays of theta bins.
double m_xtPrior[56][2][18][7][8]
paremeters of XT before calibration
std::string m_histName
root file name
TF1 * m_xtFunc[56][2][20][10]
XTFunction.
void setDebug(bool debug=false)
Run in debug or silent.
bool m_storeHisto
Store histogram or not.
double m_threshold
minimal requirement for the fraction of fitted results
~XTCalibrationAlgorithm()
Destructor.
double m_minNdf
minimum ndf required
bool m_LRseparate
Separate LR in calibration or mix.
void createHisto()
Create histogram for calibration.
void setMinimumPval(double pval)
set minimum Prob(Chi2) requirement
bool m_debug
run in debug or silent
int m_minEntriesRequired
minimum number of hit per hitosgram.
int m_fitStatus[56][2][20][10]
Fit flag.
TH2F * m_hist2d[56][2][20][10]
2D histo of xt
int m_nAlphaBins
number of alpha bins
int m_nThetaBins
number of theta bins
double m_minPval
minimum pvalue required
TProfile * m_hProf[56][2][20][10]
Profile xt histo.
float m_iAlpha[18]
Represented alpha in alpha bins.
void setMinimumNDF(double ndf)
set minimum number of degree of freedom requirement
float m_lowerAlpha[18]
Lower boundays of alpha bins.
DBObjPtr< CDCGeometry > m_cdcGeo
Geometry of CDC.
void enableTextOutput(bool output=true)
Enable text output of calibration result.
XTCalibrationAlgorithm()
Constructor.
bool m_useSliceFit
Use slice fit or profile.
bool m_bField
with b field or none
void setHistFileName(const std::string &name)
Set name for histogram output.
void setBField(bool bfield)
set to use BField
void write()
Store calibrated constand.
float m_upperAlpha[18]
Upper boundays of alpha bins.
void setLRSeparate(bool lr=true)
Set LR separate mode (default is true).
void setThreshold(double th=0.6)
Set threshold for the fraction of fitted results.
bool m_textOutput
output text file if true
EResult calibrate() override
Run algo on data.
EResult checkConvergence()
Check the convergence of XT fit.
int m_xtModePrior
Mode of xt before calibration; 0 is polynomial;1 is Chebyshev.
void setXtMode(unsigned short mode=c_Chebyshev)
set xt mode, 0 is polynimial, 1 is Chebshev polynomial
TH2F * m_hist2dDraw[56][20][10]
2d histo for draw
float m_upperTheta[7]
Upper boundays of theta bins.
int m_xtMode
Mode of xt; 0 is polynomial;1 is Chebyshev.
TH1F * m_hist2d_1[56][2][20][10]
1D xt histo, results of slice fit
std::string m_outputFileName
Output xt filename.
float m_iTheta[7]
Represented theta in theta bins.
Base class for calibration algorithms.
EResult
The result of calibration.
Class for accessing objects in the database.
Abstract base class for different kinds of events.