2#include "include/fun.h"
7 cout <<
"Calibration type: QtCalib" << endl;
18 for(
int lay=0; lay<
NLAYER; lay++){
19 m_qmin[lay] =
gQmin[lay];
20 m_qmax[lay] =
gQmax[lay];
21 m_qbinw[lay] = (m_qmax[lay] - m_qmin[lay]) / (
double)NQBin;
24 m_fdQt =
new TFolder(
"mfdQt",
"fdQt");
25 m_fdQ_T =
new TFolder(
"mQtPlot",
"QtPlot");
27 hlist ->
Add(m_fdQ_T);
29 for(
int lay=0; lay<
NLAYER; lay++){
30 sprintf(hname,
"mHQ_Layer%02d", lay);
31 m_hqhit[lay] =
new TH1F(hname,
"", 1500, 0, 3000);
32 m_fdQt ->
Add(m_hqhit[lay]);
34 sprintf(hname,
"mHQT_Plot_lay%02d", lay);
35 m_grqt[lay] =
new TGraphErrors();
36 m_grqt[lay]->SetName(hname);
37 m_grqt[lay]->SetMarkerStyle(20);
38 m_grqt[lay]->SetMarkerColor(1);
39 m_grqt[lay]->SetLineColor(10);
40 m_fdQ_T->Add(m_grqt[lay]);
42 sprintf(hname,
"mHQdelT_Plot_lay%02d", lay);
43 m_grqdt[lay] =
new TGraphErrors();
44 m_grqdt[lay]->SetName(hname);
45 m_grqdt[lay]->SetMarkerStyle(10);
46 m_grqdt[lay]->SetMarkerColor(1);
47 m_grqdt[lay]->SetLineColor(10);
48 m_fdQ_T->Add(m_grqdt[lay]);
51 sprintf(hname,
"mHQT_Lay%02d_Bin%02d", lay,
bin);
52 m_hqt[lay][
bin] =
new TH1F(hname,
"", 200, -1, 1);
53 m_fdQt ->
Add(m_hqt[lay][
bin]);
63 TFolder* fdQt = (TFolder*)fhist->Get(
"fdQt");
64 for(
int lay=0; lay<
NLAYER; lay++){
65 sprintf(hname,
"HQ_Layer%02d", lay);
66 hist = (TH1F*)fdQt->FindObjectAny(hname);
67 m_hqhit[lay]->Add(hist);
70 sprintf(hname,
"HQT_Lay%02d_Bin%02d", lay,
bin);
71 hist = (TH1F*)fdQt->FindObjectAny(hname);
72 m_hqt[lay][
bin]->Add(hist);
87 TF1* funQt =
new TF1(
"funQt",
qtFun, 200, 2000, 2);
89 ofstream fqtlog(
"qtlog");
90 for(
int lay=0; lay<
NLAYER; lay++){
93 fqtlog <<
"Layer" << lay << endl;
95 for(
int ord=0; ord<QtOrd; ord++) qtini[ord] = calconst->
getQtpar(lay, ord);
97 entry = m_hqt[lay][
bin]->GetEntries();
99 deltw = m_hqt[lay][
bin] -> GetMean();
100 qterr = ( m_hqt[lay][
bin]->GetRMS() ) / sqrt((
double)entry);
107 qbcen = ( (double)
bin + 0.5 ) * m_qbinw[lay] + m_qmin[lay];
110 tw = qtini[1] / sqrt(qbcen) + qtini[0] + deltw;
112 m_grqt[lay]->SetPoint(
bin, qbcen, tw);
113 m_grqt[lay]->SetPointError(
bin, 0, qterr);
115 m_grqdt[lay]->SetPoint(
bin, qbcen, deltw);
116 m_grqdt[lay]->SetPointError(
bin, 0, qterr);
118 fqtlog << setw(3) <<
bin << setw(12) << deltw << setw(12) << tw
119 << setw(12) << qbcen << setw(12) << qterr << endl;
122 m_grqt[lay]->Fit(
"funQt",
"Q+",
"", m_qmin[lay], m_qmax[lay]);
125 for(
int ord=0; ord<QtOrd; ord++){
126 qtpar = funQt->GetParameter(ord);
127 qterr = funQt->GetParError(ord);
128 calconst -> resetQtpar(lay, ord, qtpar);
130 fqtlog << setw(12) << qtpar << setw(12) << qterr << endl;
139 Double_t tw = par[1] / sqrt(
x[0]) + par[0];
143void QtCalib::renameHist(){
145 m_fdQt->SetName(
"fdQt");
146 m_fdQ_T->SetName(
"QtPlot");
147 for(
int lay=0; lay<
NLAYER; lay++){
148 sprintf(hname,
"HQ_Layer%02d", lay);
149 m_hqhit[lay]->SetName(hname);
151 sprintf(hname,
"HQT_Plot_lay%02d", lay);
152 m_grqt[lay]->SetName(hname);
154 sprintf(hname,
"HQdelT_Plot_lay%02d", lay);
155 m_grqdt[lay]->SetName(hname);
158 sprintf(hname,
"HQT_Lay%02d_Bin%02d", lay,
bin);
159 m_hqt[lay][
bin]->SetName(hname);
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
virtual void init(TObjArray *hlist, MdcCosGeom *pGeom)=0
virtual void mergeHist(TFile *fhist)=0
virtual void calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)=0
double getQtpar(int lay, int order) const
void calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)
static Double_t qtFun(Double_t *x, Double_t *par)
void init(TObjArray *hlist, MdcCosGeom *pGeom)
void mergeHist(TFile *fhist)
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)