Changeset 666 for trunk/MagicSoft
- Timestamp:
- 03/02/01 12:48:15 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r665 r666 1 1 -*-*- END -*-*- 2 2000/03/0 1: Thomas Bretz2 2000/03/02: Thomas Bretz 3 3 4 4 * manalysis/Makefile, mdatacheck/Makefile, meventdisp/Makefile, … … 6 6 new 7 7 8 * mdatacheck/MFillAdcSpect.[h,cc]: 9 changed high and low to hi and lo 8 * mbase/MParList.[cc,h]: 9 Added FindCreateObj member function 10 11 * mbase/MReadTree.cc: 12 changed to use FindCreateObj 13 14 * mdatacheck/MDumpEvtHeader.cc: 15 removed fPixelIter from member list, changed cout to *fLog 16 17 * mdatacheck/MFillAdcSpect.cc 18 removed fPixelIter from member list, changed cout to *fLog, 19 changed to use FindCreateObj, changed high and low to hi and lo 20 21 * mdatacheck/MShowSpect.cc 22 changed cout to *fLog 23 24 * mraw/MRawFileRead.cc: 25 changed to use FindCreateObj 10 26 11 27 * mdatacheck/MGDisplayAdc.[h,cc]: -
trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h
r654 r666 22 22 void Print(Option_t *opt = NULL) ; 23 23 24 Int_t GetPixId() const{ return fPixId ; }24 Int_t GetPixId() const { return fPixId ; } 25 25 Float_t GetNumPhotons() const { return fPhot ; } 26 26 Float_t GetErrorPhot() const { return fErrPhot ; } … … 32 32 void SetPixelUsed() { fIsUsed = kTRUE ; } 33 33 34 void SetCorePixel(){ fIsCore = kTRUE ; }34 void SetCorePixel() { fIsCore = kTRUE ; } 35 35 Bool_t IsCorePixel() const { return fIsCore ; } 36 36 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r652 r666 18 18 19 19 #include <TNamed.h> 20 #include <TClass.h> 20 21 21 22 #include "MLog.h" … … 111 112 } 112 113 114 MParContainer *MParList::FindCreateObj(const char *name) 115 { 116 // 117 // Find an object in the list. 118 // 'name' is the name of the object you are searching for. 119 // If the object doesn't exist we try to create one from the 120 // dictionary. If this isn't possible NULL is returned 121 // 122 MParContainer *pcont = (MParContainer*)FindObject(name); 123 124 if (pcont) 125 return pcont; 126 127 // 128 // if object is not existing in the list try to create one 129 // 130 *fLog << "MParList::CreateObject - Warning: '" << name << "' not found... creating." << endl; 131 132 // 133 // try to get class from root environment 134 // 135 TClass *cls = gROOT->GetClass(name); 136 137 if (!cls) 138 { 139 // 140 // if class is not existing in the root environment 141 // 142 *fLog << "MParList::CreateObject - Warning: Class '" << name << "' not existing in dictionary." << endl; 143 return NULL; 144 } 145 146 // 147 // create the container and add it to the list 148 // 149 pcont = (MParContainer*)cls->New(); 150 AddToList(pcont); 151 152 // 153 // Find an object in the list. 154 // 'name' is the name of the object you are searching for. 155 // 156 return pcont; 157 } 113 158 114 159 void MParList::Print(Option_t *t) -
trunk/MagicSoft/Mars/mbase/MParList.h
r652 r666 40 40 void SetLogStream(MLog *log); 41 41 42 TObject *FindObject(const char *name) const; 42 TObject *FindObject(const char *name) const; 43 MParContainer *FindCreateObj(const char *name); 43 44 44 45 void Print(Option_t *t = NULL); -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r659 r666 101 101 // check if object is existing in the list 102 102 // 103 MParContainer *pcont = (MParContainer*)pList->FindObject(name);103 MParContainer *pcont = pList->FindCreateObj(name); 104 104 105 105 if (!pcont) 106 106 { 107 107 // 108 // if object is not existing in the list try to create one 108 // if class is not existing in the (root) environment 109 // we cannot proceed reading this branch 109 110 // 110 *fLog << "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl; 111 112 // 113 // try to get class from root environment 114 // 115 TClass *cls = gROOT->GetClass(name); 116 117 if (!cls) 118 { 119 // 120 // if class is not existing in the root environment 121 // we cannot proceed reading this branch 122 // 123 *fLog << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl; 124 continue; 125 } 126 127 // 128 // create the container and add it to the list 129 // 130 pcont = (MParContainer*)cls->New(); 131 *fLog << pcont << endl; 132 pList->AddToList(pcont); 111 *fLog << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl; 112 continue; 133 113 } 134 114 -
trunk/MagicSoft/Mars/mdatacheck/DataCheckLinkDef.h
r545 r666 7 7 #pragma link C++ class MShowSpect; 8 8 #pragma link C++ class MHistosAdc; 9 #pragma link C++ class MFillAdcSpect; 10 11 #pragma link C++ class MDumpEvtHeader; 9 12 10 13 #endif -
trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.cc
r609 r666 1 1 #include "MDumpEvtHeader.h" 2 2 3 #include <iostream.h>4 3 #include "MLog.h" 4 #include "MLogManip.h" 5 5 #include "MParList.h" 6 6 #include "MRawEvtHeader.h" 7 7 #include "MRawEvtPixelIter.h" 8 8 9 //ClassImp(MDumpEvtHeader)9 ClassImp(MDumpEvtHeader) 10 10 11 11 Bool_t MDumpEvtHeader::PreProcess (MParList *pList) 12 12 { 13 fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");14 if (!fRawEvtHeader)13 fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader"); 14 if (!fRawEvtHeader) 15 15 { 16 cout << "MRawFileRead::PreProcess - WARNING: MRawEvtHeader not found... creating." << endl; 17 return kFALSE ; 18 } 19 20 fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData"); 21 22 if (!fRawEvtData) 23 { 24 cout << "MRawFileRead::PreProcess - WARNING: MRawEvtData not found... creating." << endl; 25 return kFALSE ; 16 *fLog << dbginf << " Error: MRawEvtHeader not found... exit." << endl; 17 return kFALSE ; 26 18 } 27 19 28 fPixelIter = new MRawEvtPixelIter( fRawEvtData ); 29 30 return kTRUE ; 20 fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData"); 21 if (!fRawEvtData) 22 { 23 *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl; 24 return kFALSE ; 25 } 31 26 27 return kTRUE ; 32 28 } 33 29 34 35 30 Bool_t MDumpEvtHeader::Process() 36 31 { 37 32 fRawEvtHeader->Print() ; 38 33 39 //fRawEvtData->Print() ;34 MRawEvtPixelIter pixel( fRawEvtData ); 40 35 41 fPixelIter->Reset() ; 36 while ( pixel.Next() ) 37 { 38 *fLog << " " << pixel.GetPixelId() ; 39 } 42 40 43 while ( fPixelIter->Next() ) 44 { 45 cout << " " << fPixelIter->GetPixelId() ; 46 47 } 48 49 cout << endl ; 41 *fLog << endl ; 50 42 51 43 return kTRUE; 52 53 44 } -
trunk/MagicSoft/Mars/mdatacheck/MDumpEvtHeader.h
r466 r666 12 12 class MRawEvtHeader; 13 13 class MRawEvtData; 14 class MRawEvtPixelIter;15 14 class MParList; 16 15 … … 21 20 MRawEvtData *fRawEvtData; 22 21 23 MRawEvtPixelIter *fPixelIter ; 24 25 public: 26 MDumpEvtHeader () { 27 fRawEvtHeader = NULL ; 28 } ; 22 public: 23 MDumpEvtHeader () : fRawEvtHeader(NULL) { } ; 29 24 30 25 Bool_t PreProcess(MParList *pList); 31 26 Bool_t Process() ; 32 27 33 // ClassDef(MDumpEvtHeader, 1) // Task to read the raw data binary file28 ClassDef(MDumpEvtHeader, 1) // Class to dump the pixel ids of a raw evt to the screen 34 29 35 30 }; -
trunk/MagicSoft/Mars/mdatacheck/MFillAdcSpect.cc
r665 r666 1 1 #include "MFillAdcSpect.h" 2 2 3 #include <iostream.h>4 3 #include "MLog.h" 4 #include "MLogManip.h" 5 5 #include "MParList.h" 6 6 #include "MHistosAdc.h" … … 8 8 #include "MRawEvtPixelIter.h" 9 9 10 //ClassImp(MFillAdcSpect)10 ClassImp(MFillAdcSpect) 11 11 12 MFillAdcSpect::MFillAdcSpect (const char *name, const char *title)12 MFillAdcSpect::MFillAdcSpect (const char *name, const char *title) : fRawEvtData(NULL) 13 13 { 14 14 *fName = name ? name : "MFillAdcSpect"; 15 15 *fTitle = title ? title : "Task to fill the adc spectra with raw data"; 16 17 fRawEvtData = NULL ;18 fPixelIter = NULL ;19 16 } 20 21 22 17 23 18 Bool_t MFillAdcSpect::PreProcess (MParList *pList) … … 25 20 // connect the raw data with this task 26 21 27 fHistos = (MHistosAdc*)pList->FindObject("MHistosAdc"); 28 if (!fHistos) 29 { 30 cout << "MRawFileRead::PreProcess - WARNING: MHistosAdc not found... creating." << endl; 31 fHistos = new MHistosAdc; 32 pList->AddToList(fHistos); 33 } 22 fHistos = (MHistosAdc*)pList->FindCreateObj("MHistosAdc"); 23 if (!fHistos) 24 return kFALSE; 34 25 35 fRawEvtData = (MRawEvtData*)pList->Find Object("MRawEvtData");26 fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData"); 36 27 if (!fRawEvtData) 37 { 38 cout << "MRawFileRead::PreProcess - WARNING: MRawEvtData not found... exit." << endl; 39 return kFALSE; 40 } 41 42 fPixelIter = new MRawEvtPixelIter( fRawEvtData ); 28 { 29 *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl; 30 return kFALSE ; 31 } 43 32 44 33 return kTRUE ; … … 46 35 } 47 36 48 49 37 Bool_t MFillAdcSpect::Process() 50 38 { 51 39 // loop over the pixels and fill the values in the histograms 52 40 53 fPixelIter->Reset() ;41 MRawEvtPixelIter pixel(fRawEvtData); 54 42 55 43 const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ; … … 58 46 // cout << "HighSamples " << iHighSamples ; 59 47 60 while ( fPixelIter->Next() )48 while ( pixel.Next() ) 61 49 { 62 50 for (Int_t i=0 ; i<nhisamples ; i++ ) 63 51 { 64 fHistos->FillAdcHistHi ( fPixelIter->GetPixelId(),65 fPixelIter->GetHiGainFadcSamples()[i] );52 fHistos->FillAdcHistHi ( pixel.GetPixelId(), 53 pixel.GetHiGainFadcSamples()[i] ); 66 54 } 67 55 68 56 for (Int_t i=0 ; i<nlosamples ; i++ ) 69 57 { 70 fHistos->FillAdcHistLo ( fPixelIter->GetPixelId(),71 fPixelIter->GetLoGainFadcSamples()[i] );58 fHistos->FillAdcHistLo ( pixel.GetPixelId(), 59 pixel.GetLoGainFadcSamples()[i] ); 72 60 } 73 61 } -
trunk/MagicSoft/Mars/mdatacheck/MFillAdcSpect.h
r466 r666 13 13 class MHistosAdc; 14 14 class MRawEvtData; 15 class MRawEvtPixelIter;16 15 17 16 class MFillAdcSpect : public MTask { 18 17 private: 19 18 MRawEvtData *fRawEvtData; 20 MRawEvtPixelIter *fPixelIter ;21 19 22 20 MHistosAdc *fHistos ; … … 28 26 Bool_t Process() ; 29 27 30 // ClassDef(MFillAdcSpect, 1) // Task to read the raw data binary file28 ClassDef(MFillAdcSpect, 1) // Task to fill a MHistosAdc Container with data 31 29 32 30 }; -
trunk/MagicSoft/Mars/mdatacheck/MShowSpect.cc
r609 r666 1 1 #include "MShowSpect.h" 2 2 3 #include <iostream.h>4 3 #include "MLog.h" 4 #include "MLogManip.h" 5 5 #include "MParList.h" // MParList 6 6 #include "MGDisplayAdc.h" // MGDisplayAdc … … 36 36 if (!fHists) 37 37 { 38 cout << "ERROR: MShowSpect::PreProc(): " << fHistName << "not found!" << endl;39 return kFALSE;38 *fLog << dbginf << " Error: MHistosAdc '" << fHistName << "' not found!" << endl; 39 return kFALSE; 40 40 } 41 41 -
trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
r665 r666 84 84 // if not create one and add them to the list 85 85 // 86 fRawRunHeader = (MRawRunHeader*)pList->Find Object("MRawRunHeader");86 fRawRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader"); 87 87 if (!fRawRunHeader) 88 { 89 *fLog << "MRawFileRead::PreProcess - WARNING: MRawRunHeader not found... creating." << endl; 90 fRawRunHeader = new MRawRunHeader; 91 pList->AddToList(fRawRunHeader); 92 } 88 return kFALSE; 93 89 94 fRawEvtHeader = (MRawEvtHeader*)pList->Find Object("MRawEvtHeader");90 fRawEvtHeader = (MRawEvtHeader*)pList->FindCreateObj("MRawEvtHeader"); 95 91 if (!fRawEvtHeader) 96 { 97 *fLog << "MRawFileRead::PreProcess - WARNING: MRawEvtHeader not found... creating." << endl; 98 fRawEvtHeader = new MRawEvtHeader; 99 pList->AddToList(fRawEvtHeader); 100 } 92 return kFALSE; 101 93 102 fRawEvtData = (MRawEvtData*)pList->Find Object("MRawEvtData");94 fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData"); 103 95 if (!fRawEvtData) 104 { 105 *fLog << "MRawFileRead::PreProcess - WARNING: MRawEvtData not found... creating." << endl; 106 fRawEvtData = new MRawEvtData; 107 pList->AddToList(fRawEvtData); 108 } 96 return kFALSE; 109 97 110 fRawCrateArray = (MRawCrateArray*)pList->Find Object("MRawCrateArray");98 fRawCrateArray = (MRawCrateArray*)pList->FindCreateObj("MRawCrateArray"); 111 99 if (!fRawCrateArray) 112 { 113 *fLog << "MRawFileRead::PreProcess - WARNING: MRawCrateArray not found... creating." << endl; 114 fRawCrateArray = new MRawCrateArray; 115 pList->AddToList(fRawCrateArray); 116 } 100 return kFALSE; 117 101 118 fRawEvtTime = (MTime*)pList->Find Object("MRawEvtTime");102 fRawEvtTime = (MTime*)pList->FindCreateObj("MRawEvtTime"); 119 103 if (!fRawEvtTime) 120 { 121 *fLog << "MRawFileRead::PreProcess - WARNING: MRawEvtTime not found... creating." << endl; 122 fRawEvtTime = new MTime("MRawEvtTime"); 123 pList->AddToList(fRawEvtTime); 124 } 104 return kTRUE; 125 105 126 106 //
Note:
See TracChangeset
for help on using the changeset viewer.