Changeset 6456 for trunk/MagicSoft/Mars
- Timestamp:
- 02/14/05 12:13:58 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6455 r6456 43 43 too much by the start of data taking 44 44 - fixed setting of mean time corresponding to rate-interval 45 46 * mraw/MRawFileRead.[h,cc]: 47 - calculate total number of events from all files in PreProcess 45 48 46 49 -
trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
r5776 r6456 165 165 // This opens the next file in the list and deletes its name from the list. 166 166 // 167 Int_t MRawFileRead::OpenNextFile( )167 Int_t MRawFileRead::OpenNextFile(Bool_t print) 168 168 { 169 169 // … … 217 217 } 218 218 219 if (!print) 220 return kTRUE; 221 219 222 // 220 223 // Print Run Header … … 271 274 fNumEvents=0; 272 275 return OpenNextFile()==kTRUE; 276 } 277 278 Bool_t MRawFileRead::CalcNumTotalEvents() 279 { 280 fNumTotalEvents = 0; 281 282 Bool_t rc = kTRUE; 283 284 while (1) 285 { 286 switch (OpenNextFile(kFALSE)) 287 { 288 case kFALSE: 289 break; 290 case kERROR: 291 rc = kFALSE; 292 break; 293 case kTRUE: 294 fNumTotalEvents += fRawRunHeader->GetNumEvents(); 295 continue; 296 } 297 break; 298 } 299 300 if (fIn) 301 delete fIn; 302 fIn = NULL; 303 304 return rc; 273 305 } 274 306 … … 301 333 return kFALSE; 302 334 303 // 304 // Now open next (first) file 305 // 306 // if (!Rewind()) 307 // return kFALSE; 308 335 *fLog << inf << "Calculating number of total events..." << flush; 336 if (!CalcNumTotalEvents()) 337 return kFALSE; 338 *fLog << inf << " " << fNumTotalEvents << " found." << endl; 309 339 310 340 fNumFile=0; 311 fNumEvents=0; 341 fNumEvents=0; 312 342 313 343 return kTRUE; -
trunk/MagicSoft/Mars/mraw/MRawFileRead.h
r5776 r6456 12 12 { 13 13 private: 14 TList *fFileNames; // list of file names 15 UInt_t fNumFile; //! number of next file 16 UInt_t fNumEvents; //! input stream (file to read from) 14 TList *fFileNames; // list of file names 15 UInt_t fNumFile; //! number of next file 16 UInt_t fNumEvents; //! input stream (file to read from) 17 UInt_t fNumTotalEvents; //! total number of events in all files 17 18 18 ifstream *fIn; //! input stream (file to read from)19 ifstream *fIn; //! input stream (file to read from) 19 20 20 MParList *fParList; //! tasklist to call ReInit from21 MParList *fParList; //! tasklist to call ReInit from 21 22 22 23 UInt_t fInterleave; 23 24 24 Int_t OpenNextFile(); 25 Int_t OpenNextFile(Bool_t print=kTRUE); 26 Bool_t CalcNumTotalEvents(); 25 27 26 28 Int_t PreProcess(MParList *pList); … … 40 42 Int_t AddFile(const char *fname, Int_t entries=-1); 41 43 Bool_t Rewind(); 44 UInt_t GetEntries() { return fNumTotalEvents/fInterleave; } 42 45 43 46 ClassDef(MRawFileRead, 0) // Task to read the raw data binary file
Note:
See TracChangeset
for help on using the changeset viewer.