Changeset 3378 in Sophya for trunk/Cosmo/SimLSS/cmvfitpk.cc


Ignore:
Timestamp:
Nov 9, 2007, 7:04:12 PM (18 years ago)
Author:
cmv
Message:

modif sur remplissage NTuple/Minos, possibilite de changer les parametres O0,Om,Ol etc... , cmv 09/11/2007

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/cmvfitpk.cc

    r3377 r3378  
    124124 // --- NTuple et ppf
    125125 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"};
    128128 NTuple nt(nvar,vname);
    129129 double xnt[nvar];
     
    156156   // --- Initialisation de minuit
    157157    MnUserParameters upar;
     158    const int npar = 2;
    158159    upar.Add("A",1.,0.01);
    159160    upar.Add("B",b_ini,b_ini/100.);
     
    176177   MnUserParameterState ustate = min.UserState();
    177178
    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 
    185179   // --- Recuperation des informations et remplissage NTuple
    186180   for(int i=0;i<nvar;i++) xnt[i] = 0.;
    187181   double xi2r = ustate.Fval()/(nbinok-upar.VariableParameters());
     182   double A = ustate.Value((unsigned int)0);
     183   double B = ustate.Value((unsigned int)1);
    188184   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;
    191187   xnt[3] = ustate.Error((unsigned int)0);
    192188   xnt[4] = ustate.Error((unsigned int)1);
    193189   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;
    198190   nt.Fill(xnt);
    199191
     
    202194     HistoErr herrf(herr); herrf.Zero();
    203195     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;
    206198       herrf.SetBin(i,f,herr.Error(i),1.);
    207199       herrd.SetBin(i,herr(i)-f,herr.Error(i),1.);
     
    214206
    215207   // --- Print de debug
    216    if(nfile==0) {
     208   if(nfile<3) {
    217209     cout<<"minimum: "<<min<<endl;
    218210     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     }
    219219   }
    220220
     
    248248}
    249249
     250/*
     251openppf cmvfitpk.ppf
     252
     253set i 0
     254zone
     255disp h$i "nsta hbincont err"
     256disp hf$i "nsta same red"
     257
     258zone
     259disp hd$i "nsta hbincont err red"
     260disp hd$i "nsta same"
     261
     262zone
     263n/plot nt.xi2
     264
     265zone
     266n/plot nt.a
     267n/plot nt.b
     268n/plot nt.b%a ! ! "crossmarker5"
     269
     270n/plot nt.ea
     271n/plot nt.eb
     272n/plot nt.ea%eb ! ! "crossmarker5"
     273
     274 */
Note: See TracChangeset for help on using the changeset viewer.