Changeset 1091 in Sophya for trunk/SophyaPI/PIext/pawexecut.cc
- Timestamp:
- Jul 26, 2000, 3:15:43 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.