Changeset 2678 for trunk/MagicSoft/Mars
- Timestamp:
- 12/15/03 17:29:56 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2676 r2678 18 18 * mfilter/MFAntiFilter.[h,cc]: 19 19 - removed. This function is implemented in MFilterList 20 21 * merpp.cc: 22 - enhanced to support start/stop time 23 24 * manalysis/MEventRateCalc.cc: 25 - removed some stuff which was commented out 26 27 * mbase/MTime.cc: 28 - small change to GetString 29 30 * mhist/MHCamera.cc: 31 - made the inverse deep blue dea palette the default 32 (FIXME: Make this a resource) 33 34 * mreport/MReport.[h,cc]: 35 - added MTime arguments to Interprete 36 37 * mreport/MReportFileRead.[h,cc]: 38 - added MTime arguments to Interprete 39 - added fStart/fStop data member 20 40 21 41 -
trunk/MagicSoft/Mars/NEWS
r2637 r2678 12 12 13 13 - added support for DC current files from the camera control 14 15 - added support for start- and stop-time when merpping report files 14 16 15 17 -
trunk/MagicSoft/Mars/manalysis/MEventRateCalc.cc
r2626 r2678 59 59 // 60 60 MEventRateCalc::MEventRateCalc(const char *name, const char *title) 61 : /*fNumEvents(10000),*/fTimes(1000)61 : fTimes(1000) 62 62 { 63 63 fName = name ? name : "MEventRateCalc"; … … 82 82 if (!fRate) 83 83 return kFALSE; 84 85 //fEvtNumber = 0;86 84 87 85 memset(fTimes.GetArray(), 0, sizeof(Double_t)*fTimes.GetSize()); -
trunk/MagicSoft/Mars/mbase/MTime.cc
r2636 r2678 229 229 // 230 230 // Return contents as a TString of the form: 231 // " [yy]yy/mm/dd [h]h:mm:ss.fff"231 // "yyyy/mm/dd hh:mm:ss.fff" 232 232 // 233 233 TString MTime::GetString() const … … 239 239 GetTime(h, m, s, ms); 240 240 241 return TString(Form("% 2d/%02d/%02d %02d:%02d:%02d.%03d", y, mon, d, h, m, s, ms));241 return TString(Form("%4d/%02d/%02d %02d:%02d:%02d.%03d", y, mon, d, h, m, s, ms)); 242 242 } 243 243 -
trunk/MagicSoft/Mars/merpp.cc
r2632 r2678 68 68 gLog << " -cn: Compression level n=1..9 [default=2]" << endl; 69 69 gLog << " -vn: Verbosity level n [default=2]" << endl; 70 gLog << " --start=yyyy-mm-dd/hh:mm:ss.mmm: Start event time for merpping report files" << endl; 71 gLog << " --stop=yyyy-mm-dd/hh:mm:ss.mmm: Stop event time for merpping report files" << endl; 70 72 gLog << " -?/-h: This help" << endl << endl; 71 73 gLog << " REMARK: At the moment you can process a .raw _or_ a .rep file, only!" << endl << endl; 72 74 } 73 75 76 // FIXME: Move to MTime (maybe 'InterpreteCmdline' 77 MTime AnalyseTime(TString str) 78 { 79 Int_t y=0, ms=0, mon=0, d=0, h=0, m=0, s=0; 80 81 if (7!=sscanf(str.Data(), "%d-%d-%d/%d:%d:%d.%d", &y, &mon, &d, &h, &m, &s, &ms)) 82 return MTime(); 83 84 MTime t; 85 t.Set(y, mon, d, h, m, s, ms); 86 return t; 87 } 88 74 89 int main(const int argc, char **argv) 75 90 { … … 95 110 gLog.SetDebugLevel(arg.HasOption("-v") ? arg.GetIntAndRemove("-v") : 2); 96 111 112 MTime kTimeStart(AnalyseTime(arg.GetStringAndRemove("--start="))); 113 MTime kTimeStop(AnalyseTime(arg.GetStringAndRemove("--stop="))); 114 kTimeStart.SetName("MTimeStart"); 115 kTimeStop.SetName("MTimeStop"); 116 117 if (!kTimeStart) 118 cout << "No start time!" << endl; 119 if (!kTimeStop) 120 cout << "No stop time!" << endl; 121 97 122 // 98 123 // check for the right usage of the program … … 172 197 // 173 198 // ---- The following is only necessary to supress some output ---- 174 / /199 /* 175 200 MRawRunHeader runheader; 176 201 plist.AddToList(&runheader); … … 187 212 MTime evttime; 188 213 plist.AddToList(&evttime); 214 */ 189 215 190 216 // … … 200 226 { 201 227 MReportFileRead *r = new MReportFileRead(kNamein); 228 r->SetTimeStart(kTimeStart); 229 r->SetTimeStop(kTimeStop); 202 230 if (isdc) 203 231 { … … 215 243 216 244 MWriteRootFile *w = new MWriteRootFile(kNameout, option, "Magic root-file", kComprlvl); 217 /*218 w->AddContainer("MReportDAQ", "DAQ");219 w->AddContainer("MTimeDAQ", "DAQ");220 w->AddContainer("MReportDrive", "Drive");221 w->AddContainer("MTimeDrive", "Drive");222 */223 245 if (isdc) 224 246 { … … 241 263 w->AddContainer("MReportDrive", "Drive"); 242 264 w->AddContainer("MTimeDrive", "Drive"); 265 // w->AddContainer("MReportDAQ", "DAQ"); 266 // w->AddContainer("MTimeDAQ", "DAQ"); 243 267 } 244 268 write = w; … … 249 273 write = new MRawFileWrite(kNameout, option, "Magic root-file", kComprlvl); 250 274 } 275 251 276 tasks.AddToList(read); 252 277 tasks.AddToList(write); -
trunk/MagicSoft/Mars/mhist/MHCamera.cc
r2627 r2678 93 93 SetPalette(1, 0); 94 94 #else 95 Set Palette(51, 0);95 SetInvDeepBlueSeaPalette(); 96 96 #endif 97 97 } -
trunk/MagicSoft/Mars/mreport/MReport.cc
r2632 r2678 53 53 // While skip are numbers which won't enter the analysis 54 54 // 55 // SetupReading must be called successfully before. 56 // 55 57 Bool_t MReport::InterpreteHeader(TString &str) 56 58 { … … 70 72 71 73 fState=state; 72 if (fTime) 73 if (!fTime->Set(yea, mon, day, hor, min, sec, ms)) 74 { 75 *fLog << err << "ERROR - Event has invalid time: "; 76 *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms); 77 *fLog << "... abort." << endl; 78 return kFALSE; 79 } 74 if (!fTime->Set(yea, mon, day, hor, min, sec, ms)) 75 { 76 *fLog << err << "ERROR - Event has invalid time: "; 77 *fLog << Form("%d.%d.%d %02s:%02d:%02d.%03d", day, mon, yea, hor, min, sec, ms); 78 *fLog << "... abort." << endl; 79 return kFALSE; 80 } 80 81 81 82 str.Remove(0, len); … … 102 103 // when a corresponding time container exists. 103 104 // 104 Bool_t MReport::Interprete(TString &str) 105 // SetupReading must be called successfully before. 106 // 107 Int_t MReport::Interprete(TString &str, const MTime &start, const MTime &stop) 105 108 { 106 109 if (!InterpreteHeader(str)) 107 110 return kFALSE; 111 112 if (start && *fTime<start) 113 return kCONTINUE; 114 if (stop && *fTime>stop) 115 return kCONTINUE; 108 116 109 117 if (!InterpreteBody(str)) … … 111 119 112 120 SetReadyToSave(); 113 if (fTime) 114 fTime->SetReadyToSave(); 121 fTime->SetReadyToSave(); 115 122 116 123 return kTRUE; -
trunk/MagicSoft/Mars/mreport/MReport.h
r2591 r2678 27 27 virtual Bool_t InterpreteBody(TString &str); 28 28 29 Bool_t Interprete(TString &str);29 Int_t Interprete(TString &str, const MTime &start, const MTime &stop); 30 30 Bool_t CheckIdentifier(TString &str) const 31 31 { -
trunk/MagicSoft/Mars/mreport/MReportFileRead.cc
r2632 r2678 119 119 MReport *GetReport() { return fReport; } 120 120 //void SetTime(MTime *t) { fReport->SetTime(t); } 121 Bool_t Interprete(TString &str) 122 { 123 if (!fReport->Interprete(str)) 121 Int_t Interprete(TString &str, const MTime &start, const MTime &stop) 122 { 123 const Int_t rc = fReport->Interprete(str, start, stop); 124 125 if (rc==kFALSE) 124 126 return kFALSE; 125 127 126 128 fNumReports++; 127 return kTRUE;129 return rc; 128 130 } 129 131 Bool_t SetupReading(MParList &plist) { return fReport->SetupReading(plist); } … … 289 291 while (!GetReport(rep)) 290 292 { 291 // Don't know the reason, but ReadLine and ReadString don't work 292 // for the (at least: converted) DC files. 293 str.ReadToDelim(*fIn); 293 str.ReadLine(*fIn); 294 294 if (!*fIn) 295 295 { … … 307 307 } 308 308 309 if (!rep->Interprete(str)) 309 const Int_t rc = rep->Interprete(str, fStart, fStop); 310 if (rc==kFALSE) 310 311 { 311 312 *fLog << err << "ERROR - Interpretation of '" << rep->GetName() << "' failed." << endl; … … 313 314 } 314 315 315 return kTRUE;316 return rc; 316 317 } 317 318 -
trunk/MagicSoft/Mars/mreport/MReportFileRead.h
r2632 r2678 5 5 #include "MTask.h" 6 6 #endif 7 #ifndef MARS_MTime 8 #include "MTime.h" 9 #endif 7 10 8 / / gcc 3.211 /*// gcc 3.2 9 12 //class ifstream; 10 13 #include <iosfwd> 14 */ 11 15 12 16 class THashTable; … … 27 31 THashTable *fList; 28 32 33 MTime fStart; // Time range which should be read from file 34 MTime fStop; // Time range which should be read from file 35 29 36 enum { kHasNoHeader = BIT(14) }; 30 37 … … 43 50 44 51 void SetHasNoHeader() { SetBit(kHasNoHeader); } 52 void SetTimeStart(const MTime &tm) { fStart = tm; } 53 void SetTimeStop(const MTime &tm) { fStop = tm; } 45 54 46 55 Bool_t AddToList(const char *name) const;
Note:
See TracChangeset
for help on using the changeset viewer.