Changeset 3378 in Sophya for trunk/Cosmo/SimLSS/cmvfitpk.cc
- Timestamp:
- Nov 9, 2007, 7:04:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Cosmo/SimLSS/cmvfitpk.cc
r3377 r3378 124 124 // --- NTuple et ppf 125 125 POutPersist pos("cmvfitpk.ppf"); 126 const int nvar = 10;127 char *vname[nvar] = {"xi2","a","b","ea","eb","eab" ,"ea1","ea2","eb1","eb2"};126 const int nvar = 6; 127 char *vname[nvar] = {"xi2","a","b","ea","eb","eab"}; 128 128 NTuple nt(nvar,vname); 129 129 double xnt[nvar]; … … 156 156 // --- Initialisation de minuit 157 157 MnUserParameters upar; 158 const int npar = 2; 158 159 upar.Add("A",1.,0.01); 159 160 upar.Add("B",b_ini,b_ini/100.); … … 176 177 MnUserParameterState ustate = min.UserState(); 177 178 178 MnMinos Minos(fcn,min);179 pair<double,double> eminos[2];180 for(int ip=0;ip<2;ip++) {181 eminos[ip].first = eminos[ip].second = 0.;182 if(!ustate.Parameter(ip).IsFixed()) eminos[ip] = Minos(ip);183 }184 185 179 // --- Recuperation des informations et remplissage NTuple 186 180 for(int i=0;i<nvar;i++) xnt[i] = 0.; 187 181 double xi2r = ustate.Fval()/(nbinok-upar.VariableParameters()); 182 double A = ustate.Value((unsigned int)0); 183 double B = ustate.Value((unsigned int)1); 188 184 xnt[0] = xi2r; 189 xnt[1] = ustate.Value((unsigned int)0);190 xnt[2] = ustate.Value((unsigned int)1);185 xnt[1] = A; 186 xnt[2] = B; 191 187 xnt[3] = ustate.Error((unsigned int)0); 192 188 xnt[4] = ustate.Error((unsigned int)1); 193 189 if(ustate.HasCovariance()) xnt[5] = ustate.Covariance()(0,1); 194 xnt[6] = eminos[0].first;195 xnt[7] = eminos[0].second;196 xnt[8] = eminos[1].first;197 xnt[9] = eminos[1].second;198 190 nt.Fill(xnt); 199 191 … … 202 194 HistoErr herrf(herr); herrf.Zero(); 203 195 HistoErr herrd(herr); herrd.Zero(); 204 for(int i= 0;i<herr.NBins();i++) {205 double f = pkz(herr.BinCenter(i));196 for(int i=1;i<herr.NBins();i++) { 197 double f = A*pkz(herr.BinCenter(i))+B; 206 198 herrf.SetBin(i,f,herr.Error(i),1.); 207 199 herrd.SetBin(i,herr(i)-f,herr.Error(i),1.); … … 214 206 215 207 // --- Print de debug 216 if(nfile ==0) {208 if(nfile<3) { 217 209 cout<<"minimum: "<<min<<endl; 218 210 for(int i=0;i<nvar;i++) cout<<"["<<i<<"] = "<<xnt[i]<<endl; 211 212 MnMinos Minos(fcn,min); 213 pair<double,double> eminos[npar]; 214 for(int ip=0;ip<npar;ip++) { 215 eminos[ip].first = eminos[ip].second = 0.; 216 if(!ustate.Parameter(ip).IsFixed()) eminos[ip] = Minos(ip); 217 cout<<"Minos: "<<ip<<" err=["<<eminos[ip].first<<","<<eminos[ip].second<<"]"<<endl; 218 } 219 219 } 220 220 … … 248 248 } 249 249 250 /* 251 openppf cmvfitpk.ppf 252 253 set i 0 254 zone 255 disp h$i "nsta hbincont err" 256 disp hf$i "nsta same red" 257 258 zone 259 disp hd$i "nsta hbincont err red" 260 disp hd$i "nsta same" 261 262 zone 263 n/plot nt.xi2 264 265 zone 266 n/plot nt.a 267 n/plot nt.b 268 n/plot nt.b%a ! ! "crossmarker5" 269 270 n/plot nt.ea 271 n/plot nt.eb 272 n/plot nt.ea%eb ! ! "crossmarker5" 273 274 */
Note:
See TracChangeset
for help on using the changeset viewer.