Changeset 8642 for trunk/MagicSoft
- Timestamp:
- 07/18/07 20:30:13 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8640 r8642 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 22 2007/07/18 Thomas Bretz 23 24 * mpointing/MPointingDevCalc.cc: 25 - changed limit for starguide calibration from 87751 to 85240 26 27 * mbase/MContinue.cc: 28 - changed some debug output 29 - fixed a bug if the filter already decided to be skiped 30 31 * mbase/MEvtLoop.cc: 32 - changed RecursiveRemove to use the newly implemented scheme 33 34 * mbase/MParContainer.[h,cc], mbase/MParList.[h,cc], 35 mbase/MTask.[h,cc], mbase/MTaskList.[h,cc]: 36 - improved debug output 37 - added RecursiveRemove member function 38 - removed screen output from Remove function 39 - call RecursiveRemove when something is removed from the list 40 41 * mbase/MStatusDisplay.h: 42 - aaded a new enum kLastElement 43 44 * mbase/MTask.cc: 45 - set kMustCleanup for fFilter 46 47 * mbase/MTaskList.cc: 48 - added debugg code 49 50 * mfileio/MWriteRootFile.cc: 51 - always set kMustCleanup when a TFile is created 52 - make sure RecursiveRemove is called in the correct way 53 54 * mmain/MEventDisplay.h: 55 - fixed the starting index for the first gui element 56 57 * msignal/MExtractor.cc: 58 - added some initializations in the constructor suggested by 59 valgrind 60 61 * mcalib/MCalibrateData.cc: 62 - improved output 63 20 64 21 65 -
trunk/MagicSoft/Mars/mbase/MContinue.cc
r7808 r8642 131 131 } 132 132 133 *fLog << err << dbginf << "Unknown fatal Error! (fFilter=NULL?!?)" << endl;134 return k FALSE;133 *fLog << inf << "My filter has vanished... skipping." << endl; 134 return kSKIP; 135 135 } 136 136 … … 153 153 if (!fTaskList->AddToListBefore(GetFilter(), this)) 154 154 { 155 *fLog << err << dbginf << "ERROR - Adding filter before MContinue ... abort." << endl;155 *fLog << err << dbginf << "ERROR - Adding filter before MContinue failed... abort." << endl; 156 156 return kFALSE; 157 157 } -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r8011 r8642 102 102 // default constructor 103 103 // 104 MEvtLoop::MEvtLoop(const char *name) : fParList(NULL), f Progress(NULL)104 MEvtLoop::MEvtLoop(const char *name) : fParList(NULL), fTaskList(NULL), fProgress(NULL) 105 105 { 106 106 fName = name; … … 1108 1108 void MEvtLoop::RecursiveRemove(TObject *obj) 1109 1109 { 1110 // If the tasklist was deleted... remove it 1111 if (obj==fTaskList) 1112 fTaskList = NULL; 1113 1114 // If the parlist was deleted...invalidate par- and tasklist 1110 1115 if (obj==fParList) 1111 1116 { … … 1114 1119 } 1115 1120 1121 // if the progress bar was deleted...remove it 1116 1122 if (obj==fProgress) 1117 1123 fProgress = NULL; 1118 1124 1119 if (obj==fDisplay)1120 SetDisplay(NULL);1121 1122 if (obj==fLog)1123 {1124 if (fParList)1125 fParList->SetLogStream(NULL); 1126 SetLogStream(NULL);1127 }1128 } 1125 // If it was something else check par- and tasklist 1126 if (fParList) 1127 fParList->RecursiveRemove(obj); 1128 else 1129 if (fTaskList) // Note that the tasklist is included in the parlist 1130 fTaskList->RecursiveRemove(obj); 1131 1132 // Now check for fDisplay and fLog 1133 MParContainer::RecursiveRemove(obj); 1134 } -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r8218 r8642 71 71 #include "MLogManip.h" 72 72 73 #include "MStatusDisplay.h" 74 73 75 TList *gListOfPrimitives; // forard declaration in MParContainer.h 74 76 … … 116 118 return; 117 119 118 *fLog << all << "Deleting " << GetDescriptor() << endl;120 *fLog << all << "Deleting " << this << " " << GetDescriptor() << endl; 119 121 if (TestBit(kMustCleanup) && gROOT && gROOT->MustClean()) 120 122 { … … 921 923 return ((TEnv&)env).GetValue(prefix, dflt); 922 924 } 925 926 // -------------------------------------------------------------------------- 927 // 928 // If object to remove is fDisplay set fDisplay to NULL. 929 // If object to remove is fLog set fLog to NULL. 930 // Call TObject::RecursiveRemove 931 // 932 void MParContainer::RecursiveRemove(TObject *obj) 933 { 934 if (obj==fDisplay) 935 fDisplay=NULL; 936 937 if (obj==fLog) 938 fLog=NULL; 939 940 if (fDisplay) 941 fDisplay->RecursiveRemove(obj); 942 943 if (fLog) 944 fLog->RecursiveRemove(obj); 945 946 TObject::RecursiveRemove(obj); 947 } 948 -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r7804 r8642 146 146 MParContainer *GetNewObject(const char *name, TClass *base=MParContainer::Class()) const; 147 147 148 void RecursiveRemove(TObject *obj); 149 148 150 ClassDef(MParContainer, 0) //The basis for all parameter containers 149 151 }; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r8218 r8642 312 312 313 313 TObject *obj = fContainer->Remove(cont); 314 if (!obj) 315 { 316 *fLog << warn << "Object not found in list..." << endl; 317 return; 318 } 319 320 *fLog << inf << "MParContainer '" << cont->GetName() << "' removed..." << endl; 321 322 if (IsOwner() && !fAutodelete->FindObject(obj)) 314 315 fContainer->RecursiveRemove(obj); 316 317 // if (!obj) 318 // { 319 // *fLog << warn << "Object not found in list..." << endl; 320 // return; 321 //} 322 323 // *fLog << inf << "MParContainer '" << cont->GetName() << "' removed..." << endl; 324 325 if (obj && IsOwner() && !fAutodelete->FindObject(obj)) 323 326 delete obj; 327 } 328 329 // -------------------------------------------------------------------------- 330 // 331 // Call MParContainer::RecursiveRemove 332 // Call fContainer->RecursiveRemove 333 // 334 void MParList::RecursiveRemove(TObject *obj) 335 { 336 MParContainer::RecursiveRemove(obj); 337 338 if (obj==fContainer) 339 fContainer = NULL; 340 341 if (fContainer) 342 fContainer->RecursiveRemove(obj); 324 343 } 325 344 -
trunk/MagicSoft/Mars/mbase/MParList.h
r7804 r8642 86 86 } 87 87 88 void RecursiveRemove(TObject *obj); 89 88 90 void Reset(); 89 91 void SetReadyToSave(Bool_t flag=kTRUE); -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r7827 r8642 66 66 kPicMagic, kPicMars, 67 67 // kGui 68 kSearch, kTabs 68 kSearch, kTabs, 69 // kLastElement 70 kLastElement 69 71 } Status_t; 70 72 -
trunk/MagicSoft/Mars/mbase/MTask.cc
r8426 r8642 147 147 { 148 148 fFilter=filter; 149 if (filter) 150 AddToBranchList(filter->GetDataMember()); 149 if (!filter) 150 return; 151 152 fFilter->SetBit(kMustCleanup); // Better is better ;-) 153 AddToBranchList(filter->GetDataMember()); 151 154 } 152 155 … … 557 560 *fLog << "%) Evts skipped: " << str << endl; 558 561 } 562 563 // -------------------------------------------------------------------------- 564 // 565 // If obj==fFilter set fFilter to NULL 566 // Call MParcontainer::RecursiveRemove 567 // 568 void MTask::RecursiveRemove(TObject *obj) 569 { 570 if (obj==fFilter) 571 fFilter=NULL; 572 573 if (fFilter) 574 fFilter->RecursiveRemove(obj); 575 576 MParContainer::RecursiveRemove(obj); 577 } -
trunk/MagicSoft/Mars/mbase/MTask.h
r7804 r8642 123 123 void SavePrimitive(ofstream &out, Option_t *o=""); 124 124 125 // TObject 126 void RecursiveRemove(TObject *obj); 127 125 128 ClassDef(MTask, 2) //Abstract base class for a task 126 129 }; -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r8618 r8642 18 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 420 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 80 80 using namespace std; 81 81 82 //#define DEBUG_PROCESS 83 #undef DEBUG_PROCESS 84 82 85 const TString MTaskList::gsDefName = "MTaskList"; 83 86 const TString MTaskList::gsDefTitle = "A list for tasks to be executed"; … … 89 92 // this name in the parameter list (by MEvtLoop::SetParList) 90 93 // 91 MTaskList::MTaskList(const char *name, const char *title) : f NumPasses(0), fNumPass(0)94 MTaskList::MTaskList(const char *name, const char *title) : fTasks(0), fParList(0), fNumPasses(0), fNumPass(0) 92 95 { 93 96 fName = name ? name : gsDefName.Data(); … … 465 468 void MTaskList::Remove(MTask *task) 466 469 { 470 if (!task) 471 return; 472 473 // First remove it from the list(s) so that a later RecursiveRemove 474 // cannot fint the task again 467 475 TObject *obj = fTasks->Remove(task); 468 476 469 if (TestBit(kIsOwner)) 477 // Now do a recursive remove on all other tasks. 478 fTasks->RecursiveRemove(task); 479 480 if (obj && TestBit(kIsOwner)) 470 481 delete obj; 482 } 483 484 // -------------------------------------------------------------------------- 485 // 486 // Call MTask::RecursiveRemove 487 // Call fTasks->RecursiveRemove 488 // 489 void MTaskList::RecursiveRemove(TObject *obj) 490 { 491 MTask::RecursiveRemove(obj); 492 493 if (obj==fTasks) 494 fTasks=NULL; 495 496 if (fTasks) 497 { 498 fTasks->RecursiveRemove(obj); 499 500 // In theory this call is obsolete 501 fTasksProcess.RecursiveRemove(obj); 502 } 471 503 } 472 504 … … 620 652 MTask *task=NULL; 621 653 654 #ifdef DEBUG_PROCESS 655 *fLog << all << "ProcessTaskList - " << GetDescriptor() << " - start." << endl; 656 #endif 657 622 658 // 623 659 // loop over all tasks for processing … … 626 662 while ( (task=(MTask*)Next()) ) 627 663 { 664 #ifdef DEBUG_PROCESS 665 *fLog << all << "Process - " << (void*)task << " " << flush; 666 *fLog << task->GetDescriptor() << "... " << flush; 667 #endif 628 668 // 629 669 // if the task has the wrong stream id skip it. … … 646 686 // everything was OK: go on with the next task 647 687 // 688 #ifdef DEBUG_PROCESS 689 *fLog << "true." << endl; 690 #endif 648 691 continue; 649 692 … … 668 711 // something occured: skip the rest of the tasks for this event 669 712 // 713 #ifdef DEBUG_PROCESS 714 *fLog << "continue." << endl; 715 #endif 670 716 rc = kCONTINUE; 671 717 break; … … 677 723 break; 678 724 } 725 726 #ifdef DEBUG_PROCESS 727 *fLog << all << "ProcessTaskList - " << GetDescriptor() << " - done." << endl; 728 #endif 679 729 680 730 return rc; -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r8618 r8642 97 97 Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const; 98 98 99 void RecursiveRemove(TObject *obj); 100 99 101 operator TIterator*() const; 100 102 -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r8484 r8642 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1. 69 2007-05-10 12:14:54tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.70 2007-07-18 19:30:12 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 668 668 *fLog << warn << GetDescriptor() << ": "; 669 669 *fLog << "Conv.factor " << calibConv << " of Pixel " << pixidx << " out of range ]"; 670 *fLog << fCalibConvMinLimit << "," << fCalibConvMaxLimit << "[... set to 0. " << endl;670 *fLog << fCalibConvMinLimit << "," << fCalibConvMaxLimit << "[... set unsuitable. " << endl; 671 671 } 672 672 -
trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
r8133 r8642 101 101 //fTrees.SetOwner(); 102 102 103 gROOT->GetListOfCleanups()->Add(this); // To remove fDisplay 104 SetBit(kMustCleanup); 103 gROOT->GetListOfCleanups()->Add(this); // To remove fOut if deleted 105 104 } 106 105 … … 133 132 134 133 file->SetOption(option); // IMPORTANT! 134 file->SetBit(kMustCleanup); 135 135 ResetBit(kIsNotOwner); 136 136 return file; … … 227 227 { 228 228 fOut = new TFile("/dev/null", "READ", ftitle, comp); 229 fOut->SetBit(kMustCleanup); 229 230 return; 230 231 } … … 1071 1072 } 1072 1073 1074 // -------------------------------------------------------------------------- 1075 // 1076 // If the output file is deleted set fOut to NULL. 1077 // Call MTask::RecursiveRemove 1078 // 1073 1079 void MWriteRootFile::RecursiveRemove(TObject *obj) 1074 1080 { 1075 1081 if (obj==fOut) 1076 fOut=0; 1082 fOut=NULL; 1083 1084 MWriteFile::RecursiveRemove(obj); 1077 1085 } 1078 1086 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.h
r8632 r8642 19 19 enum 20 20 { 21 kEvtPrev = MStatusDisplay::k Search+ 1,21 kEvtPrev = MStatusDisplay::kLastElement + 1, 22 22 kEvtNext, 23 23 kEvtNumber, -
trunk/MagicSoft/Mars/msignal/MExtractor.cc
r8585 r8642 136 136 : fResolutionPerPheHiGain(0), fResolutionPerPheLoGain(0), 137 137 fSignals(NULL), fRawEvt(NULL), fRunHeader(NULL), fSignal(NULL), 138 f NumHiGainSamples(0), fNumLoGainSamples(0)138 fLoGainLast(0), fNumHiGainSamples(0), fNumLoGainSamples(0) 139 139 { 140 140 fName = name ? name : "MExtractor";
Note:
See TracChangeset
for help on using the changeset viewer.