Changeset 1920 in Sophya for trunk/SophyaPI/PIext/pawexecut.cc
- Timestamp:
- Mar 6, 2002, 5:50:30 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pawexecut.cc
r1913 r1920 82 82 piac->RegisterCommand(kw,usage,this,hgrp); 83 83 84 //#ifndef SANS_EVOLPLANCK 84 85 kw = "v/integ"; 85 usage = "Integrate a TVector ";86 usage = "Integrate a TVector / vector"; 86 87 usage += "\n v/integ namevec [norm]"; 87 88 usage += "\n norm<=0 means no normalisation (def norm=0)"; 88 89 usage += "\n Related commands: h/integ h/deriv v/deriv"; 89 90 piac->RegisterCommand(kw,usage,this,hgrp); 91 //#endif 90 92 91 93 kw = "h/deriv"; … … 95 97 piac->RegisterCommand(kw,usage,this,hgrp); 96 98 99 //#ifndef SANS_EVOLPLANCK 97 100 kw = "v/deriv"; 98 usage = "Derivate a TVector ";101 usage = "Derivate a TVector / vector"; 99 102 usage += "\n v/deriv namevec [deriv_option]"; 100 103 usage += "\n deriv_option -1 replace v[i] with v[i]-v[i-1]"; … … 103 106 usage += "\n Related commands: h/integ h/deriv v/integ"; 104 107 piac->RegisterCommand(kw,usage,this,hgrp); 108 //#endif 105 109 106 110 kw = "h/rebin"; … … 231 235 } else if(kw == "h/integ") { 232 236 h_integ(tokens); return(0); 237 //#ifndef SANS_EVOLPLANCK 233 238 } else if(kw == "v/integ") { 234 239 v_integ(tokens); return(0); 240 //#endif 235 241 } else if(kw == "h/deriv") { 236 242 h_deriv(tokens); return(0); 243 //#ifndef SANS_EVOLPLANCK 237 244 } else if(kw == "v/deriv") { 238 245 v_deriv(tokens); return(0); 246 //#endif 239 247 } else if(kw == "h/rebin") { 240 248 h_rebin(tokens); return(0); … … 586 594 r_8 norm=-1.; 587 595 if(tokens.size()>=2) norm = atof(tokens[1].c_str()); 596 #ifdef SANS_EVOLPLANCK 597 Vector* v = dynamic_cast<Vector*>(mobj); 598 #else 588 599 TVector<r_8>* v = dynamic_cast<TVector<r_8>*>(mobj); 600 #endif 601 589 602 if(!v) 590 {cout<<"PAWExecutor::v_integ Error: "<<tokens[0]<<" not a TVector"<<endl; 591 return;} 603 {cout<<"PAWExecutor::v_integ Error: "<<tokens[0]<<" not a TVector/Vector"<<endl; 604 return;} 605 606 #ifdef SANS_EVOLPLANCK 607 uint_4 n = v->NElts(); 608 #else 592 609 uint_4 n = v->Size(); 610 #endif 611 593 612 if(n==0) 594 613 {cout<<"PAWExecutor::v_integ Error: "<<tokens[0]<<" is an empty vector"<<endl; … … 636 655 int_4 deriv_option = 0; 637 656 if(tokens.size()>=2) deriv_option = atoi(tokens[1].c_str()); 657 658 #ifdef SANS_EVOLPLANCK 659 Vector* v = dynamic_cast<Vector*>(mobj); 660 #else 638 661 TVector<r_8>* v = dynamic_cast<TVector<r_8>*>(mobj); 662 #endif 663 639 664 if(!v) 640 {cout<<"PAWExecutor::v_deriv Error: "<<tokens[0]<<" not a TVector"<<endl; 641 return;} 665 {cout<<"PAWExecutor::v_deriv Error: "<<tokens[0]<<" not a TVector/Vector"<<endl; 666 return;} 667 668 669 #ifdef SANS_EVOLPLANCK 670 uint_4 n = v->NElts(); 671 #else 642 672 uint_4 n = v->Size(); 673 #endif 674 643 675 if(n==0) 644 676 {cout<<"PAWExecutor::v_deriv Error: "<<tokens[0]<<" is an empty vector"<<endl; 645 677 return;} 646 678 if(n<=1) return; 679 680 #ifdef SANS_EVOLPLANCK 681 Vector vsave(*v); 682 #else 647 683 TVector<r_8> vsave(*v,false); 684 #endif 685 648 686 if(deriv_option<0) { 649 687 for(uint_4 i=1;i<n;i++) (*v)(i) = vsave(i)-vsave(i-1); … … 658 696 } 659 697 } 698 660 699 661 700 /* methode */
Note:
See TracChangeset
for help on using the changeset viewer.