Changeset 604 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 02/21/01 15:23:18 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseIncl.h
r454 r604 1 1 #ifndef __CINT__ 2 3 #include <fstream.h> 2 4 3 5 #include <TFile.h> 4 6 #include <TTree.h> 5 7 8 #include <TGListBox.h> 9 6 10 #endif // __CINT__ -
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r590 r604 4 4 #pragma link off all classes; 5 5 #pragma link off all functions; 6 7 #pragma link C++ global gLog; 8 9 #pragma link C++ class MLog; 6 10 7 11 #pragma link C++ class MTask; -
trunk/MagicSoft/Mars/mbase/MAGIC.h
r454 r604 30 30 const Int_t kIRON = 5626; 31 31 32 // 33 // This is the definition of a global output stream, which by 34 // default pipes all output to the stdout 35 // 36 class MLog; 37 extern MLog gLog; 38 32 39 #endif -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r599 r604 28 28 #include <TStopwatch.h> 29 29 30 #include "MLog.h" 30 31 #include "MParList.h" 31 32 #include "MTaskList.h" … … 33 34 ClassImp(MEvtLoop) 34 35 35 MEvtLoop::MEvtLoop() : fPar list(NULL)36 MEvtLoop::MEvtLoop() : fParList(NULL) 36 37 { 37 38 } … … 39 40 MEvtLoop::~MEvtLoop() 40 41 { 41 }42 43 void MEvtLoop::SetParList(MParList *p)44 {45 fParlist = p;46 42 } 47 43 … … 56 52 // check if the needed parameter list is set. 57 53 // 58 if (!fPar list)54 if (!fParList) 59 55 { 60 cout<< "MEvtLoop::Eventloop - Error: Parlist not initialized." << endl;56 *fLog << "MEvtLoop::Eventloop - Error: Parlist not initialized." << endl; 61 57 return kFALSE; 62 58 } … … 66 62 // the default name is "MTaskList" 67 63 // 68 fTaskList = (MTaskList*)fPar list->FindObject(tlist);64 fTaskList = (MTaskList*)fParList->FindObject(tlist); 69 65 if (!fTaskList) 70 66 { 71 cout<< "MEvtLoop::Eventloop - Error: Cannot find tasklist '" << tlist << "' in parameter list." << endl;67 *fLog << "MEvtLoop::Eventloop - Error: Cannot find tasklist '" << tlist << "' in parameter list." << endl; 72 68 return kFALSE; 69 } 70 71 if (fLog != &gLog) 72 { 73 fParList ->SetLogStream(fLog); 74 fTaskList->SetLogStream(fLog); 73 75 } 74 76 … … 78 80 // the parameter list 79 81 // 80 if (!fTaskList->PreProcess(fPar list))82 if (!fTaskList->PreProcess(fParList)) 81 83 { 82 cout<< "Error detected while PreProcessing" << endl;84 *fLog << "Error detected while PreProcessing" << endl; 83 85 return kFALSE; 84 86 } … … 98 100 // each event 99 101 // 100 cout<< endl << "Eventloop running (";102 *fLog << endl << "Eventloop running ("; 101 103 102 104 if (maxcnt<0) 103 cout<< "all";105 *fLog << "all"; 104 106 else 105 cout<< dec << maxcnt;107 *fLog << dec << maxcnt; 106 108 107 cout<< " events)..." << flush;109 *fLog << " events)..." << flush; 108 110 109 111 Int_t dummy = maxcnt<0 ? 0 : maxcnt; … … 130 132 clock.Stop(); 131 133 132 cout<< "Ready!" << endl << endl;134 *fLog << "Ready!" << endl << endl; 133 135 134 136 clock.Print(); 135 137 136 cout<< dec << endl138 *fLog << dec << endl 137 139 << "Time: " << clock.CpuTime() << "s" 138 140 << " for " << (maxcnt<0?dummy:maxcnt) << " Events" -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r599 r604 14 14 #endif 15 15 16 #ifndef MPARCONTAINER_H 17 #include "MParContainer.h" 18 #endif 19 16 20 class MParList; 17 21 class MTaskList; 18 22 19 class MEvtLoop 23 class MEvtLoop : public MParContainer 20 24 { 21 25 private: 22 MParList *fPar list;26 MParList *fParList; 23 27 MTaskList *fTaskList; 24 28 … … 27 31 virtual ~MEvtLoop(); 28 32 29 void SetParList(MParList *p) ;33 void SetParList(MParList *p) { fParList = p; } 30 34 31 35 Bool_t PreProcess(const char *tlist="MTaskList"); -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r600 r604 9 9 // // 10 10 ////////////////////////////////////////////////////////////////////////// 11 12 #include <fstream.h> 11 #ifndef MAGIC_H 12 #include "MAGIC.h" 13 #endif 13 14 14 15 #ifndef ROOT_TObject … … 18 19 #include <TString.h> 19 20 #endif 21 22 class MLog; 23 class ofstream; 24 class ifstream; 20 25 21 26 class MParContainer : public TObject … … 31 36 32 37 protected: 33 TString *fName; //! parameter container identifier (name) 34 TString *fTitle; //! parameter container title 38 MLog *fLog; //! The general log facility for this object, initialized with the global object 39 40 TString *fName; //! parameter container identifier (name) 41 TString *fTitle; //! parameter container title 35 42 36 43 public: 37 MParContainer(const char *name="", const char *title="") { Init(name, title); }38 MParContainer(const TString &name, const TString &title) { Init(name, title); }44 MParContainer(const char *name="", const char *title="") : fLog(&gLog) { Init(name, title); } 45 MParContainer(const TString &name, const TString &title) : fLog(&gLog) { Init(name, title); } 39 46 MParContainer(const MParContainer &named); 40 47 MParContainer& operator=(const MParContainer& rhs); 48 49 void SetLogStream(MLog *log) { fLog = log; } 50 41 51 virtual ~MParContainer() { 42 52 //delete fName; delete fTitle; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r463 r604 42 42 } 43 43 44 void MParList::SetLogStream(MLog *log) 45 { 46 // 47 // create the Iterator over the tasklist 48 // 49 TIter Next(&fContainer); 50 51 MParContainer *cont=NULL; 52 53 // 54 // loop over all tasks for preproccesing 55 // 56 while ( (cont=(MParContainer*)Next()) ) 57 cont->SetLogStream(log); 58 } 44 59 45 60 Bool_t MParList::AddToList(MParContainer *obj, MParContainer *where) -
trunk/MagicSoft/Mars/mbase/MParList.h
r458 r604 20 20 #endif 21 21 22 class MLog; 22 23 class MParContainer; 23 24 … … 40 41 Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL); 41 42 43 void SetLogStream(MLog *log); 44 42 45 TObject *FindObject(const char *name) const; 43 46 -
trunk/MagicSoft/Mars/mbase/MTask.h
r458 r604 18 18 class MTask : public MInputStreamID 19 19 { 20 MLog *fLog; //! 20 21 21 22 public: -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r458 r604 41 41 } 42 42 43 void MTaskList::SetLogStream(MLog *log) 44 { 45 // 46 // create the Iterator over the tasklist 47 // 48 TIter Next(&fTasks); 49 50 MTask *task=NULL; 51 52 // 53 // loop over all tasks for preproccesing 54 // 55 while ( (task=(MTask*)Next()) ) 56 task->SetLogStream(log); 57 } 58 59 43 60 Bool_t MTaskList::AddToList(MTask *task, const char *type, MTask *where) 44 61 { … … 94 111 // create the Iterator over the tasklist 95 112 // 96 TIter next(&fTasks);113 TIter Next(&fTasks); 97 114 98 115 MTask *task=NULL; … … 101 118 // loop over all tasks for preproccesing 102 119 // 103 while ( (task=(MTask*) next()) )120 while ( (task=(MTask*)Next()) ) 104 121 { 105 122 cout << task->GetName() << "... " << flush; … … 123 140 // create the Iterator for the TaskList 124 141 // 125 TIter next(&fTasks);142 TIter Next(&fTasks); 126 143 MTask *task=NULL; 127 144 … … 129 146 // loop over all tasks for processing 130 147 // 131 while ( (task=(MTask*) next()) )148 while ( (task=(MTask*)Next()) ) 132 149 { 133 150 if (!strcmp(GetStreamId(), task->GetStreamId()) || … … 170 187 // create the Iterator for the TaskList 171 188 // 172 TIter next(&fTasks);189 TIter Next(&fTasks); 173 190 174 191 MTask *task=NULL; … … 177 194 // loop over all tasks for postprocessing 178 195 // 179 while ( (task=(MTask*) next()) )196 while ( (task=(MTask*)Next()) ) 180 197 { 181 198 cout << task->GetName() << "... " << flush; -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r458 r604 17 17 #endif 18 18 19 class MLog; 19 20 class MParList; 20 21 class MInputStreamID; … … 31 32 MTaskList(MTaskList &ts); 32 33 34 void SetLogStream(MLog *log); 35 33 36 Bool_t AddToList(MTask *task, const char *tType="All", MTask *where = NULL); 34 37 -
trunk/MagicSoft/Mars/mbase/Makefile
r546 r604 41 41 MArrayB.cc \ 42 42 MArrayS.cc \ 43 MTime.cc 43 MTime.cc \ 44 MLog.cc \ 45 MLogManip.cc 44 46 45 47 SRCS = $(SRCFILES)
Note:
See TracChangeset
for help on using the changeset viewer.