2#include "include/fun.h"
7 cout <<
"Calibration type: XtCalib" << endl;
16 m_fdXt =
new TFolder(
"mfdxt",
"fdxt");
20 for(
int lay=0; lay<43; lay++){
21 for(
int iEntr=0; iEntr<
gNEntr[lay]; iEntr++){
22 for(
int lr=0; lr<
NLR; lr++){
24 sprintf(hname,
"mHxt%02d_E%02d_LR%01d_B%02d", lay, iEntr, lr,
bin);
25 m_hxt[lay][iEntr][lr][
bin] =
new TH1D(hname,
"", 300, -1.5, 1.5);
26 m_fdXt->Add(m_hxt[lay][iEntr][lr][
bin]);
37 TFolder* fd = (TFolder*)fhist->Get(
"fdXt");
38 for(
int lay=0; lay<43; lay++){
39 for(
int iEntr=0; iEntr<
gNEntr[lay]; iEntr++){
40 for(
int lr=0; lr<
NLR; lr++){
42 sprintf(hname,
"Hxt%02d_E%02d_LR%01d_B%02d", lay, iEntr, lr,
bin);
43 TH1F* hist = (TH1F*)fd->FindObjectAny(hname);
44 m_hxt[lay][iEntr][lr][
bin]->Add(hist);
67 TMinuit* gmxt =
new TMinuit(6);
68 gmxt -> SetPrintLevel(-1);
69 gmxt -> SetFCN(
fcnXT);
70 gmxt -> SetErrorDef(1.0);
71 gmxt -> mnparm(0,
"xtpar0", 0, 0.1, 0, 0, ierflg);
72 gmxt -> mnparm(1,
"xtpar1", 0, 0.1, 0, 0, ierflg);
73 gmxt -> mnparm(2,
"xtpar2", 0, 0.1, 0, 0, ierflg);
74 gmxt -> mnparm(3,
"xtpar3", 0, 0.1, 0, 0, ierflg);
75 gmxt -> mnparm(4,
"xtpar4", 0, 0.1, 0, 0, ierflg);
76 gmxt -> mnparm(5,
"xtpar5", 0, 0.1, 0, 0, ierflg);
78 gmxt -> mnexcm(
"SET NOW", arglist, 0, ierflg);
80 TMinuit* gmxtEd =
new TMinuit(1);
81 gmxtEd -> SetPrintLevel(-1);
83 gmxtEd -> SetErrorDef(1.0);
84 gmxtEd -> mnparm(0,
"xtpar0", 0, 0.1, 0, 0, ierflg);
86 gmxtEd -> mnexcm(
"SET NOW", arglist, 0, ierflg);
99 ofstream fxtlog(
"xtlog");
100 for(
int lay=0; lay<43; lay++){
102 for(
int iEntr=0; iEntr<
gNEntr[lay]; iEntr++){
103 for(
int iLR=0; iLR<
NLR; iLR++){
104 fxtlog <<
"Layer " << setw(3) << lay << setw(3) << iEntr
105 << setw(3) << iLR << endl;
106 for(
int ord=0; ord<
NXTPAR; ord++){
107 if(0 == iEntr) xtpar = calconst -> getXtpar(lay, 8, iLR, ord);
108 else if(1 == iEntr) xtpar = calconst -> getXtpar(lay, 9, iLR, ord);
115 histEntry = (int)(m_hxt[lay][iEntr][iLR][
bin] -> GetEntries());
117 deltx = m_hxt[lay][iEntr][iLR][
bin] -> GetMean();
118 xerr = m_hxt[lay][iEntr][iLR][
bin]->GetRMS();
125 else tbcen = xtini[6];
126 xcor =
xtFun(tbcen, xtini) - deltx;
130 XMEAS.push_back( xcor );
131 ERR.push_back( xerr );
135 ERRED.push_back( xerr );
137 fxtlog << setw(3) <<
bin
145 if(
XMEAS.size() < 12 ){
157 for(
int ord=0; ord<=5; ord++){
158 arglist[0] = ord + 1;
159 arglist[1] = xtini[ord];
160 gmxt -> mnexcm(
"SET PARameter", arglist, 2, ierflg);
167 gmxt -> mnexcm(
"SET PARameter", arglist, 2, ierflg);
168 gmxt -> mnexcm(
"FIX", arglist, 1, ierflg);
173 gmxt -> mnexcm(
"MIGRAD", arglist, 2, ierflg);
174 gmxt -> mnstat(fmin, edm, errdef, nvpar, nparx, istat);
176 fxtlog <<
"Xtpar: " << endl;
177 if( (0 == ierflg) && (istat >= 2) ){
178 for(
int ord=0; ord<=5; ord++){
179 gmxt -> GetParameter(ord, xtpar, xterr);
185 calconst -> resetXtpar(lay, i, iLR, ord, xtpar);
186 }
else if(2 ==
gNEntr[lay]){
189 calconst->
resetXtpar(lay, i, iLR, ord, xtpar);
192 calconst->
resetXtpar(lay, i, iLR, ord, xtpar);
195 fxtlog << setw(15) << xtpar << setw(15) << xterr << endl;
198 for(
int ord=0; ord<=5; ord++){
199 fxtlog << setw(15) << xtini[ord] << setw(15) <<
"0" << endl;
202 fxtlog << setw(15) <<
Tmax << setw(15) <<
"0" << endl;
207 gmxt -> mnexcm(
"REL", arglist, 1, ierflg);
215 arglist[1] = xtini[7];
216 gmxtEd -> mnexcm(
"SET PARameter", arglist, 2, ierflg);
220 gmxtEd -> mnexcm(
"MIGRAD", arglist, 2, ierflg);
221 gmxtEd -> mnstat(fmin, edm, errdef, nvpar, nparx, istat);
223 if( (0 == ierflg) && (istat >=2) ){
224 gmxtEd -> GetParameter(0, xtpar, xterr);
225 if(xtpar < 0.0) xtpar = 0.0;
230 calconst -> resetXtpar(lay, i, iLR, 7, xtpar);
231 }
else if(2 ==
gNEntr[lay]){
240 fxtlog << setw(15) << xtpar << setw(15) << xterr << endl;
242 fxtlog << setw(15) << xtini[7] << setw(15) <<
"0" << endl;
245 fxtlog << setw(15) << xtini[7] << setw(15) <<
"0" << endl;
247 fxtlog <<
"Tm " << setw(15) <<
Tmax
248 <<
" Dmax " << setw(15) <<
Dmax << endl;
266void XtCalib::renameHist(){
268 m_fdXt->SetName(
"fdXt");
269 for(
int lay=0; lay<43; lay++){
270 for(
int iEntr=0; iEntr<
gNEntr[lay]; iEntr++){
271 for(
int lr=0; lr<
NLR; lr++){
273 sprintf(hname,
"Hxt%02d_E%02d_LR%01d_B%02d", lay, iEntr, lr,
bin);
274 m_hxt[lay][iEntr][lr][
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
double xtFun(double t, double xtpar[])
void fcnXT(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
void fcnXtEdge(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
vector< double > TBINCENED
virtual void init(TObjArray *hlist, MdcCosGeom *pGeom)=0
virtual void mergeHist(TFile *fhist)=0
virtual void calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)=0
void resetXtpar(int lay, int entr, int lr, int order, double val)
void init(TObjArray *hlist, MdcCosGeom *pGeom)
void mergeHist(TFile *fhist)
void calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)