Changeset 3135 in Sophya for trunk/SophyaPI/PIext/pawexecut.cc
- Timestamp:
- Jan 12, 2007, 7:36:32 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pawexecut.cc
r3125 r3135 309 309 usage += "\n h/err namehisto expr_func"; 310 310 usage += "\n Related commands: h/set/err"; 311 piac->RegisterCommand(kw,usage,this,hgrp); 312 313 kw = "herr/correl"; 314 usage = "Perform bin mean computation for HistoErr and Histo2DErr"; 315 usage += "\n herr/correl nameherr todo"; 316 usage += "\n todo = +1 : compute mean"; 317 usage += "\n = -1 : cancel computation"; 311 318 piac->RegisterCommand(kw,usage,this,hgrp); 312 319 … … 375 382 } else if(kw == "h/err") { 376 383 h_err(tokens); return(0); 384 } else if(kw == "herr/correl") { 385 herr_correl(tokens); return(0); 377 386 } else return(1); 378 387 } … … 2414 2423 2415 2424 } 2425 2426 /* methode */ 2427 void PAWExecutor::herr_correl(vector<string>& tokens) 2428 // Pour appliquer ToCorrel ou FromCorrel a un HistoErr ou Histo2DErr 2429 { 2430 int_4 tks = tokens.size(); 2431 if(tks<1) 2432 {cout<<"Usage: herr_correl namehisterr [+1,-1]"<<endl; 2433 return;} 2434 2435 NamedObjMgr omg; 2436 AnyDataObj* mobj = omg.GetObj(tokens[0]); 2437 if( mobj==NULL) 2438 {cout<<"PAWExecutor::h_copy Error: unknow object "<<tokens[0]<<endl; 2439 return;} 2440 2441 int sens = 1; 2442 if(tks>1) sens = atoi(tokens[1].c_str()); 2443 2444 HistoErr *herr = dynamic_cast<HistoErr*>(mobj); 2445 Histo2DErr *herr2 = dynamic_cast<Histo2DErr*>(mobj); 2446 2447 if(sens>=0) { 2448 if(herr) herr->ToCorrel(); 2449 else if(herr2) herr2->ToCorrel(); 2450 } else { 2451 if(herr) herr->FromCorrel(); 2452 else if(herr2) herr2->FromCorrel(); 2453 } 2454 2455 int ncorrel = 0; 2456 if(herr) ncorrel = herr->NCorrel(); 2457 else if(herr2) ncorrel = herr2->NCorrel(); 2458 cout<<tokens[0]<<" : ncorrel = "<<ncorrel<<endl; 2459 2460 }
Note:
See TracChangeset
for help on using the changeset viewer.