10 #include <TGraphErrors.h>
12 #include <framework/database/DBObjPtr.h>
13 #include <cdc/dbobjects/CDCSpaceResols.h>
91 static const unsigned short Max_np = 40;
106 TGraphErrors*
gfit[56][2][18][7];
107 TGraphErrors*
gr[56][2][18][7];
158 int N = graph->GetN();
159 int Nstart = floor(0.5 * (N - unCount));
160 int Nend = N - unCount;
161 for (
int i = Nstart; i < Nend; ++i) {
162 graph->GetPoint(i, x, y);
163 if (graph->GetErrorY(i) > 0.06E-3)
continue;
169 if (imax <= Nstart) {
170 graph->GetPoint(Nend, x, y);
Class for Space resolution calibration.
bool m_BField
Work with BField, fit range and initial parameters is different incase B and noB.
virtual void storeHisto()
store histogram
double ialpha[18]
represented alphas of alpha bins.
virtual void setStoreHisto(bool storeHist=false)
Store histograms durring the calibration or not.
virtual ~SpaceResolutionCalibration()
Destructor.
std::string m_inputRootFileNames
Input root file names.
virtual void setMinimumPval(double minPval)
Minimum Pval required.
TH1F * hb_s[56][2][Max_nalpha][Max_ntheta]
sigma histogram of ubiased residual
int m_nalpha
number of alpha bins
TGraphErrors * gr[56][2][18][7]
sigma graph.
int m_fitflag[56][2][Max_nalpha][Max_ntheta]
Fit flag; 1:OK ; 0:error.
virtual void setSigmaFileName(std::string name)
Output sigma file name, for text mode.
static const int Max_ntheta
maximum theta bin
bool m_storeHisto
Store histogram or not.
TH2F * hist_u[56][2][Max_nalpha][Max_ntheta]
2D histogram of unbiased residual
bool m_useProfileFromInputSigma
Use binning from old sigma or new one form input.
TH1F * hu_m[56][2][Max_nalpha][Max_ntheta]
mean histogram biased residual
double u_alpha[18]
Upper boundays of alpha bins.
virtual void setMinimumNDF(double minndf)
minimum NDF required for track
virtual void BField(bool bfield)
Work with B field or not;.
virtual void readProfile()
read sigma bining (alpha, theta bining)
double m_ndfmin
Minimum NDF
virtual void createHisto()
create histogram
double sigma_old[56][2][18][7][8]
old sigma prameters.
void execute()
execute all, make the interface the same as CAF
virtual void inputFileNames(std::string inputname)
Input root file names, results of collector module.
TGraphErrors * gfit[56][2][18][7]
sigma*sigma graph for fit
DBObjPtr< CDCSpaceResols > * m_sResolFromDB
Database for sigma.
virtual void useProfileFromInputSigma(bool useProfileFromInputSigma)
use sigma bin profile form input sigma or new one from input file
std::string m_ProfileFileName
Profile file name.
bool m_debug
Debug or not.
double l_theta_old[7]
Lower boundays of theta bins from input.
double l_alpha[18]
Lower boundays of alpha bins.
virtual void readSigmaFromDB()
read sigma from DB
double m_binWidth
width of each bin, unit cm
double getUpperBoundaryForFit(TGraphErrors *graph)
search max point at boundary region
int m_ntheta
number of theta bins
virtual void setBinWidth(double bw)
Bin width of each slide.
TH2F * hist_b[56][2][Max_nalpha][Max_ntheta]
2D histogram of biased residual
int nalpha_old
number of alpha bins from input
std::string m_outputSigmaFileName
Output sigma file name.
TH1F * hu_s[56][2][Max_nalpha][Max_ntheta]
sigma histogram of biased residual
TH1F * hb_m[56][2][Max_nalpha][Max_ntheta]
mean histogram of unbiased residual
double itheta_old[7]
represented alphas of theta bins from input.
virtual void setUseDB(bool useDB=false)
Use database or text mode.
static const unsigned short Max_np
Maximum number of point =1/binwidth.
std::string m_sigmafile
Sigma file name, for text mode.
double l_alpha_old[18]
Lower boundays of alpha bins from input.
virtual void ProfileFileNames(std::string profileFileName)
File name describe theta/alpha bin, if don't want to use default from input sigma.
double u_theta_old[7]
Upper boundays of theta bins from input.
virtual bool calibrate()
Run algo on data.
virtual void write()
save calibration, in text file or db
double itheta[7]
represented alphas of theta bins.
double ialpha_old[18]
represented alphas of alpha bins from input.
SpaceResolutionCalibration()
Constructor.
double l_theta[7]
Lower boundays of theta bins.
double sigma_new[56][2][18][7][8]
new sigma prameters.
virtual void readSigmaFromText()
read sigma from text file
static const int Max_nalpha
Maximum alpha bin.
double m_Pvalmin
Minimum Prob(chi2) of track.
double u_alpha_old[18]
Upper boundays of alpha bins from input.
virtual void setDebug(bool debug=false)
Debug or not.
virtual void readSigma()
read sigma from previous calibration, (input sigma)
double u_theta[7]
Upper boundays of theta bins.
unsigned short m_sigmaParamMode_old
sigma mode from input.
int ntheta_old
number of theta bins from input
bool m_useDB
use db or text mode
Class for accessing objects in the database.
Abstract base class for different kinds of events.