Changeset 8584 for trunk/MagicSoft/Mars/mraw
- Timestamp:
- 06/19/07 12:01:35 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mraw
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r8434 r8584 33 33 // ======================= 34 34 // 35 // Format Version 9: 36 // ----------------- 37 // + fNumEventsRead; 38 // 35 39 // Format Version 8: 36 40 // ----------------- … … 73 77 // MRawRunHeader CLASS VERSION 74 78 // =========================== 79 // 80 // Format Version 7: 81 // ----------------- 82 // - added fNumEventsRead; 75 83 // 76 84 // Format Version 6: … … 108 116 // 109 117 //////////////////////////////////////////////////////////////////////////// 110 111 118 #include "MRawRunHeader.h" 112 119 … … 124 131 125 132 const UShort_t MRawRunHeader::kMagicNumber = 0xc0c0; 126 const Byte_t MRawRunHeader::kMaxFormatVersion = 8;133 const Byte_t MRawRunHeader::kMaxFormatVersion = 9; 127 134 128 135 // -------------------------------------------------------------------------- … … 430 437 431 438 // ----- Source position ----- 439 fin.seekg(fFormatVersion>5 ? 16 : 8, ios::cur); 440 /* 432 441 if (fFormatVersion>5) 433 442 { 434 fin.read((char*)dummy, 4); // F32 SourceRA; Total=48 435 fin.read((char*)dummy, 4); // F32 SourceDEC; Total=52 436 } 443 fin.read((char*)&fSourceRa, 4); // F32 SourceRA; Total=48 444 fin.read((char*)&fSourceDec, 4); // F32 SourceDEC; Total=52 445 } 446 fin.read((char*)&fTelescopeRa, 4); // F32 TelescopeRA; (+4) 447 fin.read((char*)&fTelescopeDec, 4); // F32 TelescopeDEC; (+4) 448 */ 449 437 450 // Maybe we should set these to something 438 451 // in case of fFormatVersion<6 439 fin.read((char*)dummy, 4); // F32 TelescopeRA; (+4)440 fin.read((char*)dummy, 4); // F32 TelescopeDEC; (+4)441 452 fin.read((char*)&fSourceEpochChar, 2); // Total=56 442 453 fin.read((char*)&fSourceEpochDate, 2); // Total=58 … … 446 457 { 447 458 UShort_t y, m, d; 448 fin. read((char*)dummy, 4);// Former fMJD[4],459 fin.seekg(4, ios::cur); // Former fMJD[4], 449 460 fin.read((char*)&y, 2); // Former fDateYear[2] 450 461 fin.read((char*)&m, 2); // Former fDateMonth[2] … … 460 471 fin.read((char*)&fNumSamplesHiGain, 2); // MUX: Number of samples per pixel 461 472 473 if (fFormatVersion>8) 474 fin.read((char*)dummy, 4); // 2xU16 (NumSamplesRemovedHead and NumSamplesRemovedTail) 475 462 476 // ----- Number of events ----- 463 477 fin.read((char*)&fNumEvents, 4); // Total=70 478 479 if (fFormatVersion>8) 480 fin.read((char*)&fNumEventsRead, 4); // Total=70 464 481 465 482 // New in general features: (should they be included in new MAGIC1 formats, too?) … … 566 583 *fLog << "Sampling: " << fFreqSampling << "MHz with " << (int)fNumSignificantBits << " significant bits" << endl; 567 584 *fLog << "Samples: " << fNumSamplesHiGain << "/" << fNumSamplesLoGain << " (hi/lo) * " << fNumBytesPerSample << "B/sample = " << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate * fNumBytesPerSample/1000 << "kB/Evt" << endl; 568 *fLog << "Evt Counter: " << fNumEvents << endl; 585 *fLog << "Evt Counter: " << fNumEvents; 586 if (fFormatVersion>8) 587 *fLog << " (read=" << fNumEventsRead << ")"; 588 *fLog << endl; 569 589 570 590 if (TString(t).Contains("header", TString::kIgnoreCase)) -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r8582 r8584 38 38 private: 39 39 /* ---- Run Header Informations ---- */ 40 UShort_t fMagicNumber; 41 UShort_t fFormatVersion; 42 UShort_t fSoftVersion; 43 UShort_t fFadcType; 44 UShort_t fCameraVersion; 45 UShort_t fTelescopeNumber; 46 UShort_t fRunType; 47 UInt_t fRunNumber; 48 Char_t fProjectName[101];//23]; 49 Char_t fSourceName[81]; //13]; 50 Char_t fObservationMode[61]; 51 Char_t fSourceEpochChar[2]; 52 UShort_t fSourceEpochDate; 53 UShort_t fNumCrates; 54 UShort_t fNumPixInCrate; 55 UShort_t fNumSamplesLoGain; 56 UShort_t fNumSamplesHiGain; 57 UShort_t fNumBytesPerSample; 58 UInt_t fNumEvents; 59 UShort_t fFreqSampling; 60 Byte_t fNumSignificantBits; 61 MTime fRunStart; 62 MTime fRunStop; 63 MArrayS *fPixAssignment; 40 UShort_t fMagicNumber; // File type identifier 41 UShort_t fFormatVersion; // File format version 42 UShort_t fSoftVersion; // DAQ software version 43 UShort_t fFadcType; // FADC type (0=Siegen, 1=MUX) 44 UShort_t fCameraVersion; // Camera Version (1=MAGIC I) 45 UShort_t fTelescopeNumber; // Telescope number (1=Magic I) 46 UShort_t fRunType; // Run Type 47 UInt_t fRunNumber; // Run number 48 Char_t fProjectName[101]; // Project name 49 Char_t fSourceName[81]; // Source name 50 Char_t fObservationMode[61]; // observation mode 51 Char_t fSourceEpochChar[2]; // epoch char of the source 52 UShort_t fSourceEpochDate; // epoch date of the source 53 UShort_t fNumCrates; // number of electronic boards 54 UShort_t fNumPixInCrate; // number of pixels in crate 55 UShort_t fNumSamplesLoGain; // number of logain samples stored 56 UShort_t fNumSamplesHiGain; // number of higain samples stored 57 UShort_t fNumBytesPerSample; // number of bytes per sample 58 UInt_t fNumEvents; // number of events stored 59 UInt_t fNumEventsRead; // number of events read by the electronics 60 UShort_t fFreqSampling; // Sampling Frequency [MHz] 61 Byte_t fNumSignificantBits; // number of significant bits 62 MTime fRunStart; // time of run start 63 MTime fRunStop; // time of run stop 64 MArrayS *fPixAssignment; //-> pixel assignment table 64 65 65 66 Bool_t SwapAssignment(Short_t id0, Short_t id1); … … 106 107 UShort_t GetNumBytesPerSample() const { return fNumBytesPerSample; } 107 108 UInt_t GetNumEvents() const { return fNumEvents; } 109 UInt_t GetNumEventsRead() const { return fNumEventsRead; } 108 110 UShort_t GetFreqSampling() const { return fFreqSampling; } 109 111 const MTime &GetRunStart() const { return fRunStart; } … … 133 135 Bool_t ReadEvt(istream& fin); 134 136 135 ClassDef(MRawRunHeader, 6) // storage container for general info137 ClassDef(MRawRunHeader, 7) // storage container for general info 136 138 }; 137 139 #endif
Note:
See TracChangeset
for help on using the changeset viewer.