Changeset 3501 in Sophya for trunk/Cosmo/SimLSS/cmvsinxsx.cc


Ignore:
Timestamp:
Jul 18, 2008, 6:50:43 PM (17 years ago)
Author:
cmv
Message:

change libMinuit2Base libMinuit2 for roo 5.20 cmv 18/07/2008

File:
1 edited

Legend:

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

    r3500 r3501  
    3939 bool only_test = false;
    4040 double pr_test = 1.e99;
    41 
     41 int nvec=0;
     42 double veccent=0., vecmax = -2.;
     43
     44 //--- Read arguments
    4245 char c;
    43  while((c = getopt(narg,arg,"htp:n:")) != -1) {
     46 while((c = getopt(narg,arg,"htp:n:v:")) != -1) {
    4447  switch (c) {
    4548  case 'n' :
     
    5255    sscanf(optarg,"%lf",&pr_test);
    5356    break;
     57  case 'v' :
     58    sscanf(optarg,"%d,%lf",&nvec,&vecmax);
     59    break;
    5460  case 'h' :
    5561  default :
    56     cout<<"cmvsinxsx [-t] [-p eps_print] [-n N] [dt,tmin,tmax (rad)]"<<endl;
     62    cout<<"cmvsinxsx [-t] [-p eps_print] [-n N] [-v nv,(+-)vmax (rad)]"<<endl;
     63    cout<<"          [dt,tmin,tmax (rad)]"<<endl;
    5764    return -1;
    5865  }
     
    6269 cout<<"N="<<N<<" dt="<<dt<<" tmin="<<tmin<<" tmax="<<tmax<<" rad"<<endl;
    6370 cout<<"only_test="<<only_test<<" pr_test="<<pr_test<<endl;
     71 if(vecmax<0.) vecmax *= -M_PI;
     72 cout<<"nv="<<nvec<<" vmax="<<vecmax<<" -> ["<<-vecmax/2<<","<<vecmax/2<<"]"<<endl;
    6473 if(tmax<=tmin) return -1;
    6574
     75 //--- Create NTuple
    6676 const int nvar = 11;
    6777 char *vname[nvar] = {"t","s","sn","sx","sx2","snx","snx2","asx","asx2","asnx","asnx2"};
     
    6979 NTuple nt(nvar,vname);
    7080
     81 //--- Fill NTuple and do precision test
    7182 long n = 0;
    7283 double diffsx=0., diffsx2=0., diffsnx=0., diffsnx2=0.;
     
    115126 cout<<"     (sNx/x)^2 = "<<diffsnx2<<" = "<<diffsnx2/(N*N)<<" * "<<N<<" * "<<N<<endl;
    116127
    117  if(!only_test) {
    118    cout<<"writing ppf"<<endl;
    119    POutPersist pos("cmvsinxsx.ppf");
    120    pos.PutObject(nt,"nt");
     128 //--- Fill vector for FFT
     129 TVector<r_8> vsx,vsx2,vsnx,vsnx2;
     130 if(nvec>1) {
     131   vsx.ReSize(nvec); vsx2.ReSize(nvec); vsnx.ReSize(nvec); vsnx2.ReSize(nvec);
     132   for(int i=0;i<nvec;i++) {
     133     double t = veccent -vecmax/2. + i*vecmax/(double)nvec;
     134     vsx(i)   = SinXsX(t);
     135     vsx2(i)  = SinXsX_Sqr(t);
     136     vsnx(i)  = SinNXsX(t,N);
     137     vsnx2(i) = SinNXsX_Sqr(t,N);
     138   }
    121139 }
     140
     141 //--- Write PPF
     142 POutPersist pos("cmvsinxsx.ppf");
     143 if(!only_test) pos.PutObject(nt,"nt");
     144 if(vsx.Size()>0) pos.PutObject(vsx,"vsx");
     145 if(vsx2.Size()>0) pos.PutObject(vsx2,"vsx2");
     146 if(vsnx.Size()>0) pos.PutObject(vsnx,"vsnx");
     147 if(vsnx2.Size()>0) pos.PutObject(vsnx2,"vsnx2");
    122148
    123149 return 0;
     
    161187n/plot nt.snx2-asnx2%t ! ! "connectpoints"
    162188
     189#-------
     190openppf cmvsinxsx.ppf
     191
     192zone 2 2
     193n/plot vsx.val%n ! !
     194n/plot vsx2.val%n ! !
     195n/plot vsnx.val%n ! !
     196n/plot vsnx2.val%n ! !
     197
     198zone
     199fftforw vsx fvsx
     200fftforw vsx2 fvsx2
     201fftforw vsnx fvsnx
     202fftforw vsnx2 fvsnx2
     203
     204zone
     205n/plot fvsx.val%n ! ! "connectpoints"
     206n/plot fvsx2.val%n ! ! "connectpoints"
     207n/plot fvsnx.val%n ! ! "connectpoints"
     208n/plot fvsnx2.val%n ! ! "connectpoints"
     209
    163210*/
Note: See TracChangeset for help on using the changeset viewer.