Changeset 609 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 02/22/01 14:30:10 (24 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MAGIC.h
r604 r609 34 34 // default pipes all output to the stdout 35 35 // 36 37 //This will be fixed soon. It doesn't work with Alphas at the moment 36 38 class MLog; 39 #ifndef __CINT__ 37 40 extern MLog gLog; 41 #endif 38 42 39 43 #endif -
trunk/MagicSoft/Mars/mbase/MLog.cc
r604 r609 46 46 } 47 47 48 void MLog::Write ()48 void MLog::WriteBuffer() 49 49 { 50 50 const int len = fPPtr - fBase; … … 76 76 { 77 77 // cout << "*sync*"; 78 Write ();78 WriteBuffer(); 79 79 80 80 if (fDevice&eStdout) … … 100 100 // If the buffer is not really filled i is EOF(-1). 101 101 // 102 if (fOutputLevel < fDebugLevel) 103 { 104 *fPPtr++ = (char)i; 102 if (fOutputLevel >= fDebugLevel) 103 return 0; 105 104 106 if (fPPtr == fEPtr) 107 Write(); 108 } 105 *fPPtr++ = (char)i; 106 107 if (fPPtr == fEPtr) 108 WriteBuffer(); 109 109 110 110 return 0; -
trunk/MagicSoft/Mars/mbase/MLog.h
r604 r609 36 36 void Init(); 37 37 38 void Write ();38 void WriteBuffer(); 39 39 int sync(); 40 40 int overflow(int i); // i=EOF means not a real overflow -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r458 r609 13 13 #include "MParContainer.h" 14 14 15 #include <iostream.h> // cout16 17 15 #include <TClass.h> // IsA 18 16 #include <TROOT.h> // TROOT::Identlevel 19 17 #include <TVirtualPad.h> // gPad 18 19 #include "MLog.h" 20 20 21 21 ClassImp(MParContainer) … … 78 78 79 79 TROOT::IndentLevel(); 80 cout<<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "80 *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : " 81 81 << Int_t(TestBit(kCanDelete)) << endl; 82 82 } … … 87 87 // Print MParContainer name and title. 88 88 89 cout<<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;89 *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl; 90 90 } 91 91 -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r604 r609 20 20 #endif 21 21 22 class MLog;23 22 class ofstream; 24 23 class ifstream; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r608 r609 15 15 // // 16 16 ///////////////////////////////////////////////////////////////////////////// 17 18 17 #include "MParList.h" 19 18 20 19 #include <TNamed.h> 21 20 22 #include "M ParContainer.h"21 #include "MLog.h" 23 22 24 23 ClassImp(MParList) … … 57 56 cont->SetLogStream(log); 58 57 59 //SetLogStream(log);58 MParContainer::SetLogStream(log); 60 59 } 61 60 … … 74 73 if (!obj) return kTRUE; 75 74 76 cout<< "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;75 *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush; 77 76 // 78 77 // check if it is in the list yet … … 80 79 if (fContainer.FindObject(obj)) 81 80 { 82 cout<< "WARNING: MParList::add: Container already added" << endl;81 *fLog << "WARNING: MParList::add: Container already added" << endl; 83 82 return kTRUE; 84 83 } … … 92 91 if (!fContainer.FindObject(where)) 93 92 { 94 cout<< "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;93 *fLog << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl; 95 94 return kFALSE; 96 95 } … … 98 97 99 98 fContainer.Add(obj); 100 cout<< "Done." << endl;99 *fLog << "Done." << endl; 101 100 102 101 return kTRUE; … … 118 117 // print some information about the current status of MParList 119 118 // 120 cout<< "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;121 cout<< endl;119 *fLog << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl; 120 *fLog << endl; 122 121 123 122 } -
trunk/MagicSoft/Mars/mbase/MParList.h
r604 r609 14 14 #endif 15 15 16 #include <iostream.h>17 18 16 #ifndef ROOT_TOrdCollection 19 17 #include "TOrdCollection.h" 20 18 #endif 19 #ifndef MPARCONTAINER_H 20 #include "MParContainer.h" 21 #endif 21 22 22 23 class MLog; 23 class MParContainer;24 24 25 class MParList : public TObject25 class MParList : public MParContainer 26 26 { 27 27 private: -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r585 r609 15 15 #include "MReadTree.h" 16 16 17 #include <iostream.h>18 17 #include <fstream.h> 19 18 … … 22 21 #include <TObjArray.h> 23 22 23 #include "MLog.h" 24 24 #include "MTime.h" 25 25 #include "MParList.h" … … 49 49 if (!fFile->IsOpen()) 50 50 { 51 cout<< "MReadTree::PreProcess: ERROR: Cannot open file '";52 cout<< fFileName << "'" << endl;51 *fLog << "MReadTree::PreProcess: ERROR: Cannot open file '"; 52 *fLog << fFileName << "'" << endl; 53 53 return kFALSE; 54 54 } … … 58 58 if (!fTree) 59 59 { 60 cout<< "MReadTree::PreProcess: ERROR: Cannot open tree '";61 cout<< fTreeName << "'" << endl;60 *fLog << "MReadTree::PreProcess: ERROR: Cannot open tree '"; 61 *fLog << fTreeName << "'" << endl; 62 62 return kFALSE; 63 63 } … … 66 66 fNumEntry = 0; 67 67 68 cout<< "File: '" << fFileName << "' Tree: '" << fTreeName;69 cout<< "' with " << fNumEntries << " Entries opened." << endl;68 *fLog << "File: '" << fFileName << "' Tree: '" << fTreeName; 69 *fLog << "' with " << fNumEntries << " Entries opened." << endl; 70 70 71 71 // … … 96 96 // if object is not existing in the list try to create one 97 97 // 98 cout<< "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl;98 *fLog << "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl; 99 99 100 100 // … … 109 109 // we cannot proceed reading this branch 110 110 // 111 cout<< "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl;111 *fLog << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl; 112 112 continue; 113 113 } … … 117 117 // 118 118 pcont = (MParContainer*)cls->New(); 119 cout<< pcont << endl;119 *fLog << pcont << endl; 120 120 pList->AddToList(pcont); 121 121 } … … 180 180 if (fNumEntry < dec/*+1*/) 181 181 { 182 cout<< "MReadTree::SetPrevEvent: WARNING: " << fNumEntry/*-1*/ << "-" << dec << " out of Range." << endl;182 *fLog << "MReadTree::SetPrevEvent: WARNING: " << fNumEntry/*-1*/ << "-" << dec << " out of Range." << endl; 183 183 return kFALSE; 184 184 } … … 203 203 if (fNumEntry+inc/*-1*/ >= fNumEntries) 204 204 { 205 cout<< "MReadTree::SkipEvents: WARNING: " << fNumEntry/*-1*/ << "+" << inc << " out of Range." << endl;205 *fLog << "MReadTree::SkipEvents: WARNING: " << fNumEntry/*-1*/ << "+" << inc << " out of Range." << endl; 206 206 return kFALSE; 207 207 } … … 218 218 if (nr>=fNumEntries) 219 219 { 220 cout<< "MReadTree::SetEventNum: WARNING: " << nr << " out of Range." << endl;220 *fLog << "MReadTree::SetEventNum: WARNING: " << nr << " out of Range." << endl; 221 221 return kFALSE; 222 222 } -
trunk/MagicSoft/Mars/mbase/MTask.cc
r458 r609 37 37 #include "MTask.h" 38 38 39 #include <string.h>40 #include <iostream.h>41 42 39 ClassImp(MTask) 43 40 44 41 Bool_t MTask::PreProcess( MParList *pList ) 45 42 { 46 //47 // This is processed before the eventloop starts48 //49 // It is the job of the PreProcess to connect the tasks50 // with the right container in the parameter list.51 //52 // the virtual implementation returns kTRUE53 //54 return kTRUE;43 // 44 // This is processed before the eventloop starts 45 // 46 // It is the job of the PreProcess to connect the tasks 47 // with the right container in the parameter list. 48 // 49 // the virtual implementation returns kTRUE 50 // 51 return kTRUE; 55 52 } 56 57 53 58 54 Bool_t MTask::Process() 59 55 { 60 //61 // This is processed for every event in the eventloop62 //63 // the virtual implementation returns kTRUE64 //65 return kTRUE;56 // 57 // This is processed for every event in the eventloop 58 // 59 // the virtual implementation returns kTRUE 60 // 61 return kTRUE; 66 62 } 67 63 68 64 Bool_t MTask::PostProcess() 69 65 { 70 //71 // This is processed after the eventloop starts72 //73 // the virtual implementation returns kTRUE74 //75 return kTRUE;66 // 67 // This is processed after the eventloop starts 68 // 69 // the virtual implementation returns kTRUE 70 // 71 return kTRUE; 76 72 } 77 73 -
trunk/MagicSoft/Mars/mbase/MTask.h
r604 r609 18 18 class MTask : public MInputStreamID 19 19 { 20 MLog *fLog; //!21 22 20 public: 23 21 ~MTask() -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r608 r609 9 9 #include "MTaskList.h" 10 10 11 #include <iostream.h> 12 11 #include "MLog.h" 13 12 #include "MParList.h" 14 13 #include "MInputStreamID.h" … … 56 55 task->SetLogStream(log); 57 56 58 //SetLogStream(log);57 MParContainer::SetLogStream(log); 59 58 } 60 59 … … 73 72 if (fTasks.FindObject(task)) 74 73 { 75 cout<< "WARNING: MTaskList::AddToList: Task already existing." << endl;74 *fLog << "WARNING: MTaskList::AddToList: Task already existing." << endl; 76 75 return kTRUE; 77 76 } … … 79 78 if (fTasks.FindObject(name)) 80 79 { 81 cout<< "WARNING: MTaskList::AddToList: '" << name << "' exists in List already." << endl;80 *fLog << "WARNING: MTaskList::AddToList: '" << name << "' exists in List already." << endl; 82 81 return kTRUE; 83 82 } … … 92 91 } 93 92 94 cout<< "Adding " << name << " to " << GetName() << " for " << type << "... " << flush;93 *fLog << "Adding " << name << " to " << GetName() << " for " << type << "... " << flush; 95 94 96 95 task->SetStreamId(type); 97 96 fTasks.Add(task); 98 97 99 cout<< "Done." << endl;98 *fLog << "Done." << endl; 100 99 101 100 return kTRUE; … … 108 107 // do pre processing (before eventloop) of all tasks in the task-list 109 108 // 110 cout<< "Preprocessing... " << flush;109 *fLog << "Preprocessing... " << flush; 111 110 112 111 // … … 122 121 while ( (task=(MTask*)Next()) ) 123 122 { 124 cout<< task->GetName() << "... " << flush;123 *fLog << task->GetName() << "... " << flush; 125 124 126 125 if (!task->PreProcess( pList )) … … 128 127 } 129 128 130 cout<< endl;129 *fLog << endl; 131 130 132 131 return kTRUE; … … 184 183 // 185 184 186 cout<< "Postprocessing... " << flush;185 *fLog << "Postprocessing... " << flush; 187 186 188 187 // … … 198 197 while ( (task=(MTask*)Next()) ) 199 198 { 200 cout<< task->GetName() << "... " << flush;199 *fLog << task->GetName() << "... " << flush; 201 200 202 201 if (!task->PostProcess()) … … 204 203 } 205 204 206 cout<< endl;205 *fLog << endl; 207 206 208 207 return kTRUE; … … 213 212 void MTaskList::Print(Option_t *t) 214 213 { 215 cout<< "TaskList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;214 *fLog << "TaskList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl; 216 215 217 216 fTasks.Print(); 218 217 219 cout<< endl;220 } 221 218 *fLog << endl; 219 } 220 -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r604 r609 26 26 TOrdCollection fTasks; // Container for the ordered list of different tasks 27 27 28 29 28 public: 30 29 MTaskList(const char *title=NULL); -
trunk/MagicSoft/Mars/mbase/MTime.cc
r458 r609 9 9 #include "MTime.h" 10 10 11 #include <iostream.h>12 11 #include <iomanip.h> 12 13 #include "MLog.h" 13 14 14 15 ClassImp(MTime) 15 16 16 17 void MTime::Print(Option_t *) 17 { 18 cout << "MTime Information: " << hex 19 << " 0x" <<setfill('0') << setw(2) << fTimeStamp[0] 20 << " 0x" <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl; 18 { 19 fLog->setf(ios::showbase); 20 *fLog << "MTime Information: " << hex 21 << " " <<setfill('0') << setw(2) << fTimeStamp[0] 22 << " " <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl; 21 23 } 22 /*23 inline Bool_t operator<(MTime &t1, MTime &t2)24 {25 return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<t2.GetTimeLo());26 }27 24 28 inline Bool_t operator>(MTime &t1, MTime &t2)29 {30 return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>t2.GetTimeLo());31 }32 33 inline Bool_t operator<=(MTime &t1, MTime &t2)34 {35 return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<=t2.GetTimeLo());36 }37 38 inline Bool_t operator>=(MTime &t1, MTime &t2)39 {40 return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>=t2.GetTimeLo());41 }42 43 inline Bool_t operator==(MTime &t1, MTime &t2)44 {45 return (t1.GetTimeLo()==t2.GetTimeLo()) && (t1.GetTimeHi()==t2.GetTimeHi());46 }47 */
Note:
See TracChangeset
for help on using the changeset viewer.