Changeset 604 for trunk/MagicSoft
- Timestamp:
- 02/21/01 15:23:18 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r603 r604 1 1 -*-*- END -*-*- 2 3 2000/02/21: Thomas Bretz 4 5 * MRawEvtData.cc: Changed ReadEvt according to the new 6 raw binary format 2001/02/20 7 8 * Added MLog.[h,cc], MLogManip.[h,cc] 9 10 * Adde SetStreamer and fLog to the MParContainer base class 11 12 * Derived MEvtLoop from MParContainer 13 14 * Makefile: added 'tar' 15 16 * mbase/BaseIncl.h: added fstream.h, TGListBox.h 17 18 * mbase/BaseLinkDef.h: added pragma for gLog and MLog 19 20 * mbase/MAGIC.h: added forward definition for gLog 21 22 * mbase/MEvtLoop.cc: exchanged cout with *fLog, added statements 23 to provide log-facility to all tasks als parameter containers 24 25 * mbase/MEvtLoop.h: Small changes 26 27 * mbase/MParContainer.h: Added definitions necessary for use of Log-Facility 28 29 * mbase/MParList.[h,cc]: Added SetLogStream 30 31 * mbase/MTask.h: added fLog 32 33 * mbase/MTaskList.[h,cc]: added SetLogStream 34 35 * mbase/Makefile: Added MLog.cc, MLogManip.cc 36 37 2 38 2000/02/19: Harald Kornmayer 3 39 … … 12 48 macros/readCT1.C 13 49 50 14 51 2000/02/19: Thomas Bretz 15 52 -
trunk/MagicSoft/Mars/Makefile
r599 r604 101 101 @echo "cd .." 102 102 103 tar: mrproper 104 @echo "Making tar-file" 105 @tar -cvf ../mars.tar * 106 @gzip -9 ../mars.tar 103 107 104 108 # @endcode -
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) -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r585 r604 317 317 const UShort_t npix = fRunHeader->GetPixAssignment(i); 318 318 319 fin.read((Byte_t*)hi.GetArray(), nhi); 320 AddPixel(npix, &hi, kFALSE); 321 319 322 // FIXME: Not implemented in the raw files yet 320 323 //if (IsLoGainOn(i, j)) … … 323 326 AddPixel(npix, &lo, kTRUE); 324 327 //} 325 326 fin.read((Byte_t*)hi.GetArray(), nhi);327 AddPixel(npix, &hi, kFALSE);328 328 } 329 329 }
Note:
See TracChangeset
for help on using the changeset viewer.