Changeset 1091 in Sophya for trunk/SophyaPI
- Timestamp:
- Jul 26, 2000, 3:15:43 PM (25 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r1068 r1091 210 210 else if (kw == "newh1d") { 211 211 if (tokens.size() < 4) { cout << "Usage: newh1d name xmin xmax nbin" << endl; return(0); } 212 int nbx; 213 float xmin, xmax; 214 nbx = 100; 215 xmin = 0.; xmax = 1.; 212 int_4 nbx = 100; 213 r_8 xmin = 0., xmax = 1.; 216 214 nbx = atoi(tokens[3].c_str()); 217 215 xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str()); … … 224 222 return(0); 225 223 } 226 int nbx, nby; 227 float xmin, xmax; 228 float ymin, ymax; 229 nbx = nby = 50; 230 xmin = 0.; xmax = 1.; 231 ymin = 0.; ymax = 1.; 224 int_4 nbx = 50, nby = 50; 225 r_8 xmin = 0., xmax = 1.; 226 r_8 ymin = 0., ymax = 1.; 232 227 nbx = atoi(tokens[3].c_str()); 233 228 nby = atoi(tokens[6].c_str()); … … 240 235 if (tokens.size() < 4) 241 236 { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); } 242 int nbx;243 float xmin, xmax, ymin = 1., ymax = -1.;237 int_4 nbx = 100; 238 r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.; 244 239 if(tokens.size() > 5) 245 240 {ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());} 246 nbx = 100;247 xmin = 0.; xmax = 1.;248 241 nbx = atoi(tokens[3].c_str()); 249 242 xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str()); … … 546 539 while (tokens.size() < 8) tokens.push_back(""); 547 540 srvo->ProjectHProf(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0], 548 tokens[6], tokens[7] );541 tokens[6], tokens[7] ); 549 542 } 550 543 -
trunk/SophyaPI/PIext/nomhistadapter.cc
r1090 r1091 232 232 { 233 233 int i,j; 234 floatf2,f3;234 r_8 f2,f3; 235 235 if ((n < 0) || (n >= mHis->NBinX()*mHis->NBinY())) 236 236 for(i=0; i<6; i++) mRet[i] = 0.; -
trunk/SophyaPI/PIext/pawexecut.cc
r1090 r1091 368 368 {cout<<"PAWExecutor::h_integ Error: unknow object"<<tokens[0]<<endl; 369 369 return;} 370 doublenorm = 1.;370 r_8 norm = 1.; 371 371 if(tokens.size()>=2) norm = atof(tokens[1].c_str()); 372 372 // attention: dynamic_cast<Histo*>(HProf)=Vrai! … … 410 410 {cout<<"PAWExecutor::h_rebin Error: unknow object"<<tokens[0]<<endl; 411 411 return;} 412 int nbin = atoi(tokens[1].c_str());412 int_4 nbin = atoi(tokens[1].c_str()); 413 413 Histo* h1 = dynamic_cast<Histo*>(mobj); 414 414 // Ca marche aussi pour les HProf, HRebin a ete passe virtuel … … 431 431 {cout<<"PAWExecutor::h_cadd Error: unknow object"<<tokens[0]<<endl; 432 432 return;} 433 doubleval = atof(tokens[1].c_str());433 r_8 val = atof(tokens[1].c_str()); 434 434 Histo* h1 = dynamic_cast<Histo*>(mobj); 435 435 HProf* hp = dynamic_cast<HProf*>(mobj); … … 455 455 {cout<<"PAWExecutor::h_cmult Error: unknow object"<<tokens[0]<<endl; 456 456 return;} 457 doubleval = atof(tokens[1].c_str());457 r_8 val = atof(tokens[1].c_str()); 458 458 Histo* h1 = dynamic_cast<Histo*>(mobj); 459 459 HProf* hp = dynamic_cast<HProf*>(mobj); … … 703 703 if(tokens.size()<3) 704 704 {cout<<"Usage: h/plot/2d nameh2d bx/by/sx/sy n [dopt]"<<endl; return;} 705 int n = atoi(tokens[2].c_str());705 int_4 n = atoi(tokens[2].c_str()); 706 706 dopt = ""; if(tokens.size()>=4) dopt = tokens[3]; 707 707 if(proj == "bx") { … … 848 848 return;} 849 849 string proj = "h"; if(tokens.size()>3) proj = tokens[3]; 850 int nproj = -1;if(tokens.size()>4) nproj = atoi(tokens[4].c_str());850 int_4 nproj = -1; if(tokens.size()>4) nproj = atoi(tokens[4].c_str()); 851 851 string hname = tokens[0]; 852 852 string vname = tokens[1]; … … 988 988 Histo* v2 = NULL; 989 989 if(mobjv2==NULL) 990 {v2 = new Histo(0.,( float)(i2-i1+1),i2-i1+1);990 {v2 = new Histo(0.,(r_8)(i2-i1+1),i2-i1+1); 991 991 omg.AddObj(v2,tokens[1]); mobjv2 = omg.GetObj(tokens[1]);} 992 992 if(typeid(*mobjv2) != typeid(Histo)) … … 1050 1050 Histo2D* v2 = NULL; 1051 1051 if(mobjv2==NULL) 1052 {v2 = new Histo2D(0.,( float)(i2-i1+1),i2-i1+1,0.,(float)(j2-j1+1),j2-j1+1);1052 {v2 = new Histo2D(0.,(r_8)(i2-i1+1),i2-i1+1,0.,(r_8)(j2-j1+1),j2-j1+1); 1053 1053 omg.AddObj(v2,tokens[1]); mobjv2 = omg.GetObj(tokens[1]);} 1054 1054 if(typeid(*mobjv2) != typeid(Histo2D)) … … 1096 1096 // Decodage arguments 1097 1097 bool replerr = false; if(dum=="err") replerr = true; 1098 float setval = (float)atof(tokens[1].c_str());1098 r_8 setval = atof(tokens[1].c_str()); 1099 1099 int testcont=0; if(tokens[2]=="v") testcont=1; if(tokens[2]=="e") testcont=2; 1100 1100 int_4 i1=-1, i2=-1, j1=-1, j2=-1; 1101 floatv1=0., v2=0.;1101 r_8 v1=0., v2=0.; 1102 1102 if(testcont==0) { 1103 1103 sscanf(tokens[2].c_str(),"%d:%d",&i1,&i2); … … 1107 1107 {cout<<"PAWExecutor::h_set Error: h/set/... v v1:v2, please give v1:v2"<<endl; 1108 1108 return;} 1109 sscanf(tokens[3].c_str(),"% f:%f",&v1,&v2);1109 sscanf(tokens[3].c_str(),"%lf:%lf",&v1,&v2); 1110 1110 } 1111 1111 … … 1130 1130 {cout<<"PAWExecutor::h_set Error: bad bin range i1="<<i1<<endl; return;} 1131 1131 if(i2<i1) i2=i1; if(i2>=h->NBins()) i2=h->NBins()-1; 1132 for(int i=i1;i<=i2;i++) {1132 for(int_4 i=i1;i<=i2;i++) { 1133 1133 bool change = true; 1134 1134 if(testcont==1) {if((*h)(i)<v1 || (*h)(i)>v2) change = false;} … … 1147 1147 if(i2<i1) i2=i1; if(i2>=h2->NBinX()) i2=h2->NBinX()-1; 1148 1148 if(j2<j1) j2=j1; if(j2>=h2->NBinY()) j2=h2->NBinY()-1; 1149 for(int i=i1;i<=i2;i++) for(intj=j1;j<=j2;j++) {1149 for(int_4 i=i1;i<=i2;i++) for(int_4 j=j1;j<=j2;j++) { 1150 1150 bool change = true; 1151 1151 if(testcont==1) {if((*h2)(i,j)<v1 || (*h2)(i,j)>v2) change = false;} … … 1201 1201 Histo* h = dynamic_cast<Histo*>(mobj); 1202 1202 if(!(h->HasErrors())) h->Errors(); 1203 for(int i=0;i<h->NBins();i++) {1204 double x = (double)(*h)(i);1205 doublee = f(x);1203 for(int_4 i=0;i<h->NBins();i++) { 1204 r_8 x = (*h)(i); 1205 r_8 e = f(x); 1206 1206 h->SetErr2(i,e*e); 1207 1207 } … … 1210 1210 Histo2D* h2 = dynamic_cast<Histo2D*>(mobj); 1211 1211 if(!(h2->HasErrors())) h2->Errors(); 1212 for(int i=0;i<h2->NBinX();i++) for(intj=0;j<h2->NBinY();j++) {1213 double x = (double)(*h2)(i,j);1214 doublee = f(x);1212 for(int_4 i=0;i<h2->NBinX();i++) for(int_4 j=0;j<h2->NBinY();j++) { 1213 r_8 x = (*h2)(i,j); 1214 r_8 e = f(x); 1215 1215 h2->Error2(i,j) = e*e; 1216 1216 } -
trunk/SophyaPI/PIext/piafitting.cc
r1067 r1091 598 598 {x=(double) i; y=(double) j; f=(*mM)(j,i); e=1.;} 599 599 else if(mH2) 600 { float xf,yf; mH2->BinCenter(i,j,xf,yf); x=(double)xf; y=(double)yf;600 {r_8 xf,yf; mH2->BinCenter(i,j,xf,yf); x=xf; y=yf; 601 601 f=(*mH2)(i,j); e=(mH2->HasErrors())?mH2->Error(i,j):1.;} 602 602 else if(mIm) -
trunk/SophyaPI/PIext/piafitting.h
r551 r1091 56 56 int nstep; 57 57 int lp,lpg; 58 int i1,i2,j1,j2;58 int_4 i1,i2,j1,j2; 59 59 bool fromlastfit,autoinifit; 60 60 } DFOPTIONS ; … … 91 91 // Structure de data pour le fit, parametres et options 92 92 GeneralFitData* mGData; 93 int mNPar,mNVar,mNBinX,mNBinY,mNData;93 int_4 mNPar,mNVar,mNBinX,mNBinY,mNData; 94 94 Vector mPar; Vector mStep; Vector mMin; Vector mMax; Vector mFix; 95 95 Vector mParSave; Vector mStepSave; Vector mMinSave; Vector mMaxSave; Vector mFixSave; … … 110 110 DlUserFitFunc mFitFunc; 111 111 DlUserFitFuncDer mFitFuncDer; 112 int mUFNVar, mUFNPar;112 int_4 mUFNVar, mUFNPar; 113 113 }; 114 114 -
trunk/SophyaPI/PIext/pihisto2d.cc
r548 r1091 247 247 for (int j=0; j<mHisto->NBinY(); j++) { 248 248 249 floatleft0,bottom0;249 r_8 left0,bottom0; 250 250 mHisto->BinLowEdge(i,j,left0,bottom0); 251 251 -
trunk/SophyaPI/PIext/servnobjm.cc
r1090 r1091 579 579 return; 580 580 } 581 doublexmin, xmax;581 r_8 xmin, xmax; 582 582 nt->GetMinMax(0, xmin, xmax); 583 583 hprof = new HProf(xmin, xmax, 100);
Note:
See TracChangeset
for help on using the changeset viewer.