55 {
57
58 Int_t ierflg;
59 Int_t istat;
60 Int_t nvpar;
61 Int_t nparx;
62 Double_t fmin;
63 Double_t edm;
64 Double_t errdef;
65 Double_t arglist[10];
66
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);
77 arglist[0] = 0;
78 gmxt -> mnexcm("SET NOW", arglist, 0, ierflg);
79
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);
85 arglist[0] = 0;
86 gmxtEd -> mnexcm("SET NOW", arglist, 0, ierflg);
87
88
89 int i;
90 Stat_t histEntry;
91 double xtpar;
92 double xterr;
93 double tbcen;
94 double deltx;
95 double xcor;
97 double xtini[8];
98 double xtfit[8];
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);
109 xtini[ord] = xtpar;
110 xtfit[ord] = xtpar;
111 }
113
115 histEntry = (int)(m_hxt[lay][iEntr][iLR][
bin] -> GetEntries());
116 if(histEntry > 100){
117 deltx = m_hxt[lay][iEntr][iLR][
bin] -> GetMean();
118 xerr = m_hxt[lay][iEntr][iLR][
bin]->GetRMS();
119 } else{
120 continue;
121 }
122
125 else tbcen = xtini[6];
126 xcor =
xtFun(tbcen, xtini) - deltx;
127
130 XMEAS.push_back( xcor );
132 } else{
136 }
137 fxtlog << setw(3) <<
bin
138 << setw(15) << deltx
139 << setw(15) << xcor
140 << setw(15) << tbcen
142 << endl;
143 }
144
145 if(
XMEAS.size() < 12 ){
149
153
154 continue;
155 }
156
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);
161 }
162
163
165 arglist[0] = 1;
166 arglist[1] = 0.0;
167 gmxt -> mnexcm("SET PARameter", arglist, 2, ierflg);
168 gmxt -> mnexcm("FIX", arglist, 1, ierflg);
169 }
170
171 arglist[0] = 1000;
172 arglist[1] = 0.1;
173 gmxt -> mnexcm("MIGRAD", arglist, 2, ierflg);
174 gmxt -> mnstat(fmin, edm, errdef, nvpar, nparx, istat);
175
176 fxtlog << "Xtpar: " << endl;
177 if( (0 == ierflg) && (istat >= 2) ){
178 for(int ord=0; ord<=5; ord++){
179 gmxt -> GetParameter(ord, xtpar, xterr);
180
181 xtfit[ord] = xtpar;
182
184 for(i=0; i<18; i++)
185 calconst -> resetXtpar(lay, i, iLR, ord, xtpar);
186 }
else if(2 ==
gNEntr[lay]){
187 if(0 == iEntr){
188 for(i=0; i<9; i++)
189 calconst->
resetXtpar(lay, i, iLR, ord, xtpar);
190 } else{
191 for(i=9; i<18; i++)
192 calconst->
resetXtpar(lay, i, iLR, ord, xtpar);
193 }
194 }
195 fxtlog << setw(15) << xtpar << setw(15) << xterr << endl;
196 }
197 } else{
198 for(int ord=0; ord<=5; ord++){
199 fxtlog << setw(15) << xtini[ord] << setw(15) << "0" << endl;
200 }
201 }
202 fxtlog << setw(15) <<
Tmax << setw(15) <<
"0" << endl;
203
204
206 arglist[0] = 1;
207 gmxt -> mnexcm("REL", arglist, 1, ierflg);
208 }
209
211
213
214 arglist[0] = 1;
215 arglist[1] = xtini[7];
216 gmxtEd -> mnexcm("SET PARameter", arglist, 2, ierflg);
217
218 arglist[0] = 1000;
219 arglist[1] = 0.1;
220 gmxtEd -> mnexcm("MIGRAD", arglist, 2, ierflg);
221 gmxtEd -> mnstat(fmin, edm, errdef, nvpar, nparx, istat);
222
223 if( (0 == ierflg) && (istat >=2) ){
224 gmxtEd -> GetParameter(0, xtpar, xterr);
225 if(xtpar < 0.0) xtpar = 0.0;
226
227
229 for(i=0; i<18; i++)
230 calconst -> resetXtpar(lay, i, iLR, 7, xtpar);
231 }
else if(2 ==
gNEntr[lay]){
232 if(0 == iEntr){
233 for(i=0; i<9; i++)
235 } else{
236 for(i=9; i<18; i++)
238 }
239 }
240 fxtlog << setw(15) << xtpar << setw(15) << xterr << endl;
241 } else {
242 fxtlog << setw(15) << xtini[7] << setw(15) << "0" << endl;
243 }
244 } else {
245 fxtlog << setw(15) << xtini[7] << setw(15) << "0" << endl;
246 }
247 fxtlog <<
"Tm " << setw(15) <<
Tmax
248 <<
" Dmax " << setw(15) <<
Dmax << endl;
249
256 }
257 }
258 }
259 fxtlog.close();
260
261 renameHist();
262 delete gmxt;
263 delete gmxtEd;
264}
*******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 calib(MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)=0
void resetXtpar(int lay, int entr, int lr, int order, double val)