Changeset 3572 in Sophya for trunk/SophyaPI/PIext/nomhistadapter.cc
- Timestamp:
- Feb 7, 2009, 10:50:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/nomhistadapter.cc
r3432 r3572 16 16 #include "strutilxx.h" 17 17 18 #ifndef SANS_EVOLPLANCK19 18 #include "objfitter.h" 20 19 // Pour les DataTable ( Depuis Avril 2005 ) 21 20 #include "datatable.h" 22 21 #include "swppfdtable.h" 23 #endif24 22 25 23 //----------------------------------------------------------------------------- … … 139 137 void NOMAdapter_Histo::SavePPF(POutPersist& pos, string const & nom) 140 138 { 141 #ifdef SANS_EVOLPLANCK142 // PEIDA-EROS L'histo est lui-meme PPersist143 string tag = nom; // A cause de const144 mHis->Write(pos,0,tag);145 #else146 139 ObjFileIO<Histo> fio(mHis); 147 140 fio.Write(pos, nom); 148 #endif149 141 } 150 142 … … 204 196 { 205 197 Histo* h = NULL; 206 #ifdef SANS_EVOLPLANCK207 h = mHis->FitResidus(mfit);208 #else209 198 h = new Histo(ObjectFitter::FitResidus(*mHis,mfit)); 210 #endif211 199 return h; 212 200 } … … 215 203 { 216 204 Histo* h = NULL; 217 #ifdef SANS_EVOLPLANCK218 h = mHis->FitFunction(mfit);219 #else220 205 h = new Histo(ObjectFitter::FitFunction(*mHis,mfit)); 221 #endif222 206 return h; 223 207 } … … 316 300 void NOMAdapter_Histo2D::SavePPF(POutPersist& pos, string const & nom) 317 301 { 318 #ifdef SANS_EVOLPLANCK319 // PEIDA-EROS L'histo est lui-meme PPersist320 string tag = nom; // A cause de const321 mHis->Write(pos,0,tag);322 #else323 302 ObjFileIO<Histo2D> fio(mHis); 324 303 fio.Write(pos, nom); 325 #endif326 304 } 327 305 … … 389 367 { 390 368 Histo2D* h2 = NULL; 391 #ifdef SANS_EVOLPLANCK392 h2 = mHis->FitFunction(mfit);393 #else394 369 h2 = new Histo2D(ObjectFitter::FitResidus(*mHis,mfit)); 395 #endif396 370 return h2; 397 371 } … … 400 374 { 401 375 Histo2D* h2 = NULL; 402 #ifdef SANS_EVOLPLANCK403 h2 = mHis->FitFunction(mfit);404 #else405 376 h2 = new Histo2D(ObjectFitter::FitFunction(*mHis,mfit)); 406 #endif407 377 return h2; 408 378 } … … 555 525 void NOMAdapter_NTuple::SavePPF(POutPersist& pos, string const & nom) 556 526 { 557 #ifdef SANS_EVOLPLANCK558 // PEIDA-EROS L'histo est lui-meme PPersist559 string tag = nom; // A cause de const560 mNt->Write(pos,0,tag);561 #else562 527 ObjFileIO<NTuple> fio(mNt); 563 528 fio.Write(pos, nom); 564 #endif565 529 } 566 530 … … 571 535 char buff[128]; 572 536 if (opts[0] == "sizes") { 573 sprintf(buff, "%ld %ld", mNt->NEntry(),mNt->NVar());537 sprintf(buff, "%ld %ld", (long)mNt->NEntry(), (long)mNt->NVar()); 574 538 return string(buff); 575 539 } 576 540 else if ((opts[0] == "nlines") || (opts[0] == "nentry") || (opts[0] == "nrows")) { 577 sprintf(buff, "%ld", mNt->NEntry());541 sprintf(buff, "%ld", (long)mNt->NEntry()); 578 542 return string(buff); 579 543 } 580 544 else if ((opts[0] == "nvar") || (opts[0] == "ncols")) { 581 sprintf(buff, "%ld", mNt->NVar());545 sprintf(buff, "%ld", (long)mNt->NVar()); 582 546 return string(buff); 583 547 } … … 610 574 return(mNt); 611 575 // return( new NTupInt_NTuple(mNt) ); 612 }613 614 //-------------------------------------------------------------------------615 // Class Adaptateur d'objet (Pour NamedObjMgr) d'objet XNTuple616 //-------------------------------------------------------------------------617 618 /* --Methode-- */619 NOMAdapter_XNTuple::NOMAdapter_XNTuple(XNTuple* o)620 : NObjMgrAdapter(o)621 {622 mNt = o;623 }624 625 /* --Methode-- */626 NOMAdapter_XNTuple::~NOMAdapter_XNTuple()627 {628 }629 630 /* --Methode-- */631 NObjMgrAdapter* NOMAdapter_XNTuple::Clone(AnyDataObj* o)632 {633 XNTuple* nt = dynamic_cast<XNTuple *>(o);634 if (nt) return ( new NOMAdapter_XNTuple(nt) );635 return ( new NObjMgrAdapter(o) );636 }637 638 /* --Methode-- */639 string NOMAdapter_XNTuple::GetDataObjType()640 {641 return ("XNTuple ");642 }643 644 /* --Methode-- */645 AnyDataObj* NOMAdapter_XNTuple::CloneDataObj(bool /*share*/)646 {647 return ( new XNTuple(*mNt) );648 }649 650 /* --Methode-- */651 void NOMAdapter_XNTuple::SavePPF(POutPersist& pos, string const & nom)652 {653 #ifdef SANS_EVOLPLANCK654 // PEIDA-EROS L'histo est lui-meme PPersist655 string tag = nom; // A cause de const656 mNt->Write(pos,0,tag);657 #else658 ObjFileIO<XNTuple> fio(mNt);659 fio.Write(pos, nom);660 #endif661 }662 663 /* --Methode-- */664 void NOMAdapter_XNTuple::Print(ostream& os, int lev)665 {666 // os << mNt->Info();667 mNt->Show(os);668 }669 670 671 /* --Methode-- */672 NTupleInterface* NOMAdapter_XNTuple::GetNTupleInterface(bool& adel)673 {674 adel = false;675 return(mNt);676 576 } 677 577 … … 751 651 char buff[128]; 752 652 if (opts[0] == "sizes") { 753 sprintf(buff, "%ld %ld", mDT->NEntry(),mDT->NVar());653 sprintf(buff, "%ld %ld", (long)mDT->NEntry(), (long)mDT->NVar()); 754 654 return string(buff); 755 655 } 756 656 else if ((opts[0] == "nlines") || (opts[0] == "nentry") || (opts[0] == "nrows")) { 757 sprintf(buff, "%ld", mDT->NEntry());657 sprintf(buff, "%ld", (long)mDT->NEntry()); 758 658 return string(buff); 759 659 } 760 660 else if ((opts[0] == "nvar") || (opts[0] == "ncols")) { 761 sprintf(buff, "%ld", mDT->NVar());661 sprintf(buff, "%ld", (long)mDT->NVar()); 762 662 return string(buff); 763 663 }
Note:
See TracChangeset
for help on using the changeset viewer.