13#include <TGraphErrors.h>
14#include <calibration/CalibrationAlgorithm.h>
15#include <cdc/dbobjects/CDCGeometry.h>
16#include <framework/database/DBObjPtr.h>
88 int N = graph->GetN();
89 int Nstart = floor(0.5 * (N - unCount));
90 int Nend = N - unCount;
91 for (
int i = Nstart; i < Nend; ++i) {
92 graph->GetPoint(i, x, y);
93 if (graph->GetErrorY(i) > 0.06E-3)
continue;
100 graph->GetPoint(Nend, x, y);
Class for Space resolution calibration.
void setStoreHisto(bool storeHist=false)
Store histograms durring the calibration or not.
void storeHisto()
store histogram
TH1F * m_hSigmaBiased[56][2][Max_nalpha][Max_ntheta]
sigma histogram of biased residual
void setOutputFileName(std::string outputname)
output file name
void prepare()
Prepare the calibration of space resolution.
float m_lowerTheta[7]
Lower boundays of theta bins.
std::string m_histName
root file name
void setDebug(bool debug=false)
Set Debug mode.
void setBinWidth(double bw)
Bin width of each slide.
static const int Max_ntheta
maximum theta bin
bool m_storeHisto
Store histogram or not.
~SpaceResolutionCalibrationAlgorithm()
Destructor.
double m_threshold
minimal requirement for the fraction of fitted results
double m_minNdf
Minimum NDF
unsigned short m_sigmaParamMode
sigma mode for this calibration.
void createHisto()
create histogram
void setMinimumPval(double pval)
Minimum Pval required.
SpaceResolutionCalibrationAlgorithm()
Constructor.
unsigned short m_sigmaParamModePost
sigma mode before this calibration.
TH1F * m_hMeanBiased[56][2][Max_nalpha][Max_ntheta]
mean histogram biased residual
bool m_debug
Debug or not.
double m_sigmaPost[56][2][18][7][8]
sigma prameters before calibration
int m_nAlphaBins
number of alpha bins
int m_nThetaBins
number of theta bins
double m_minPval
Minimum Prob(chi2) of track.
double m_binWidth
width of each bin, unit cm
float m_iAlpha[18]
represented alphas of alpha bins.
double getUpperBoundaryForFit(TGraphErrors *graph)
search max point at boundary region
void setMinimumNDF(double ndf)
minimum NDF required for track
TGraphErrors * m_graph[56][2][18][7]
sigma graph.
float m_lowerAlpha[18]
Lower boundays of alpha bins.
DBObjPtr< CDCGeometry > m_cdcGeo
Geometry of CDC.
TH2F * m_hBiased[56][2][Max_nalpha][Max_ntheta]
2D histogram of biased residual
static const unsigned short Max_np
Maximum number of point =1/binwidth.
void enableTextOutput(bool output=true)
Enable text output of calibration result.
double m_sigma[56][2][18][7][8]
new sigma prameters.
bool m_bField
Work with BField, fit range and initial parameters is different incase B and noB.
TH1F * m_hSigmaUnbiased[56][2][Max_nalpha][Max_ntheta]
sigma histogram of ubiased residual
void setHistFileName(const std::string &name)
Set name for histogram output.
void setBField(bool bfield)
Work with B field or not;.
void write()
save calibration, in text file or db
float m_upperAlpha[18]
Upper boundays of alpha bins.
TH1F * m_hMeanUnbiased[56][2][Max_nalpha][Max_ntheta]
mean histogram of unbiased residual
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.
static const int Max_nalpha
Maximum alpha bin.
float m_upperTheta[7]
Upper boundays of theta bins.
TGraphErrors * m_gFit[56][2][18][7]
sigma*sigma graph for fit
int m_fitStatus[56][2][Max_nalpha][Max_ntheta]
Fit flag; 1:OK ; 0:error.
std::string m_outputFileName
Output sigma filename.
float m_iTheta[7]
represented alphas of theta bins.
TH2F * m_hUnbiased[56][2][Max_nalpha][Max_ntheta]
2D histogram of unbiased residual
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.