Changeset 2556 for trunk/MagicSoft/Mars/mreport
- Timestamp:
- 11/22/03 15:31:18 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mreport
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mreport/MReportCamera.h
r2553 r2556 10 10 class MCameraHV; 11 11 class MCameraLV; 12 class MCameraAUX; 12 13 class MCameraCalibration; 13 14 … … 20 21 MCameraCooling *fCooling; 21 22 MCameraLids *fLids; 23 MCameraAUX *fAUX; 22 24 MCameraHV *fHV; 23 25 MCameraLV *fLV; … … 27 29 Bool_t CheckTag(TString &str, const char *tag) const; 28 30 31 Bool_t InterpreteCamera(TString &str); 29 32 Bool_t InterpreteDC(TString &str); 30 33 Bool_t InterpreteHV(TString &str); -
trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
r2532 r2556 32 32 #include <fstream> 33 33 34 #include <TClass.h> 34 35 #include <TRegexp.h> 35 36 #include <THashTable.h> … … 55 56 56 57 public: 57 MReportHelp(MReport *rep) : fReport(rep), fNumReports(0) { } 58 MReportHelp(const char *name, MLog *fLog) : fReport(NULL), fNumReports(0) 59 { 60 TClass *cls = gROOT->GetClass(name); 61 Int_t rc = 0; 62 if (!cls) 63 rc =1; 64 else 65 { 66 if (!cls->Property()) 67 rc = 5; 68 if (!cls->Size()) 69 rc = 4; 70 if (!cls->IsLoaded()) 71 rc = 3; 72 if (!cls->HasDefaultConstructor()) 73 rc = 2; 74 } 75 76 if (rc) 77 { 78 *fLog << err << dbginf << "Cannot create new instance of class '" << name << "': "; 79 switch (rc) 80 { 81 case 1: 82 *fLog << "gROOT->GetClass() returned NULL." << endl; 83 return; 84 case 2: 85 *fLog << "no default constructor." << endl; 86 return; 87 case 3: 88 *fLog << "not loaded." << endl; 89 return; 90 case 4: 91 *fLog << "zero size." << endl; 92 return; 93 case 5: 94 *fLog << "no property." << endl; 95 return; 96 } 97 } 98 99 // 100 // create the parameter container of the the given class type 101 // 102 fReport = (MReport*)cls->New(); 103 } 104 ~MReportHelp() { if (fReport) delete fReport; } 105 58 106 const char *GetName() const { return fReport->GetIdentifier(); } 59 107 ULong_t GetNumReports() const { return fNumReports; } … … 113 161 } 114 162 115 Bool_t MReportFileRead::AddToList(MReport *rep) const 116 { 163 Bool_t MReportFileRead::AddToList(const char *name) const 164 { 165 MReportHelp *help = new MReportHelp(name, fLog); 166 167 MReport *rep = NULL; 168 if (!(rep=help->GetReport())) 169 return kFALSE; 170 117 171 if (GetReport(rep->GetIdentifier())) 118 172 { … … 120 174 *fLog << rep->GetIdentifier() << "' already added to the list... "; 121 175 *fLog << "ignored." << endl; 122 return kFALSE; 123 } 124 125 fList->Add(new MReportHelp(rep)); 176 delete help; 177 return kFALSE; 178 } 179 180 fList->Add(help); 126 181 return kTRUE; 127 182 } -
trunk/MagicSoft/Mars/mreport/MReportFileRead.h
r2523 r2556 40 40 ~MReportFileRead(); 41 41 42 Bool_t AddToList( MReport *rep) const;42 Bool_t AddToList(const char *name) const; 43 43 44 44 ClassDef(MReportFileRead, 0) // Task to read the raw data binary file -
trunk/MagicSoft/Mars/mreport/MReportTrigger.cc
r2520 r2556 36 36 using namespace std; 37 37 38 MReportTrigger::MReportTrigger() : MReport("TRIGGER-REPORT") 38 MReportTrigger::MReportTrigger() : MReport("TRIGGER-REPORT"), fPrescalerRates(19)//, fRates(11) 39 39 { 40 40 fName = "MReportTrigger"; … … 44 44 { 45 45 str = str.Strip(TString::kLeading); 46 Int_t pos = str.First(' '); 47 if (pos<=0) 46 47 const Int_t ws = str.First(' '); 48 if (ws<=0) 48 49 { 49 50 *fLog << err << "ERROR - Cannot determin name of trigger table." << endl; … … 51 52 } 52 53 53 TString tablename = str(0, pos);54 str.Remove(0, pos);54 TString tablename = str(0, ws); 55 str.Remove(0, ws); 55 56 56 57 Int_t len, n; 57 58 58 pos = 0;59 const char *pos = str.Data(); 59 60 for (int i=0; i<19; i++) 60 61 { 61 n = sscanf( str.Data()+pos, " %f %n", &fScalerRate[i], &len);62 n = sscanf(pos, " %f %n", &fPrescalerRates[i], &len); 62 63 if (n!=1) 63 64 { … … 67 68 pos += len; 68 69 } 69 n = sscanf(str.Data()+pos, " %f %f %n", &fL1TriggerRate, 70 &fL2TriggerRate, &len); 70 n = sscanf(pos, " %f %f %n", &fL2BeforePrescaler, &fL2AfterPrescaler, &len); 71 71 if (n!=2) 72 72 { … … 77 77 for (int i=0; i<11; i++) 78 78 { 79 n = sscanf(str.Data()+pos, " %f %n", &fRates[i], &len); 79 Float_t dummy; 80 n = sscanf(pos, " %f %n", &dummy/*fRates[i]*/, &len); 80 81 if (n!=1) 81 82 { … … 85 86 pos += len; 86 87 } 87 str.Remove(0, pos );88 str.Remove(0, pos-str.Data()); 88 89 str.Strip(TString::kBoth); 89 90 *fLog << "T" << flush;91 90 92 91 return str==(TString)"OVER"; -
trunk/MagicSoft/Mars/mreport/MReportTrigger.h
r2520 r2556 6 6 #endif 7 7 8 #ifndef ROOT_TArrayF 9 #include <TArrayF.h> 10 #endif 11 8 12 class MReportTrigger : public MReport 9 13 { 10 14 private: 11 Float_t fScalerRate[19]; 12 Float_t fL1TriggerRate; 13 Float_t fL2TriggerRate; 14 Float_t fRates[13]; 15 Float_t fL2BeforePrescaler; // L2 trigger rate before prescaler 16 Float_t fL2AfterPrescaler; // L2 trigger rate before prescaler 17 18 TArrayF fPrescalerRates; //[Hz] L2 prescaler rates 19 //TArrayF fRates; //[Hz] curently undefined 15 20 16 21 public: … … 19 24 Bool_t InterpreteBody(TString &str); 20 25 21 ClassDef(MReportTrigger, 0) // Base class for control reports26 ClassDef(MReportTrigger, 1) // Base class for control reports 22 27 }; 23 28
Note:
See TracChangeset
for help on using the changeset viewer.