Ignore:
Timestamp:
06/19/07 12:01:35 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mraw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r8434 r8584  
    3333//  =======================
    3434//
     35//  Format Version 9:
     36//  -----------------
     37//   + fNumEventsRead;
     38//
    3539//  Format Version 8:
    3640//  -----------------
     
    7377//  MRawRunHeader CLASS VERSION
    7478//  ===========================
     79//
     80//  Format Version 7:
     81//  -----------------
     82//   - added fNumEventsRead;
    7583//
    7684//  Format Version 6:
     
    108116//
    109117////////////////////////////////////////////////////////////////////////////
    110 
    111118#include "MRawRunHeader.h"
    112119
     
    124131
    125132const UShort_t MRawRunHeader::kMagicNumber      = 0xc0c0;
    126 const Byte_t   MRawRunHeader::kMaxFormatVersion =      8;
     133const Byte_t   MRawRunHeader::kMaxFormatVersion =      9;
    127134
    128135// --------------------------------------------------------------------------
     
    430437
    431438    // ----- Source position -----
     439    fin.seekg(fFormatVersion>5 ? 16 : 8, ios::cur);
     440    /*
    432441    if (fFormatVersion>5)
    433442    {
    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
    437450    // Maybe we should set these to something
    438451    // in case of fFormatVersion<6
    439     fin.read((char*)dummy, 4); // F32 TelescopeRA;  (+4)
    440     fin.read((char*)dummy, 4); // F32 TelescopeDEC; (+4)
    441452    fin.read((char*)&fSourceEpochChar,  2);     // Total=56
    442453    fin.read((char*)&fSourceEpochDate,  2);     // Total=58
     
    446457    {
    447458        UShort_t y, m, d;
    448         fin.read((char*)dummy, 4); // Former fMJD[4],
     459        fin.seekg(4, ios::cur);    // Former fMJD[4],
    449460        fin.read((char*)&y,    2); // Former fDateYear[2]
    450461        fin.read((char*)&m,    2); // Former fDateMonth[2]
     
    460471    fin.read((char*)&fNumSamplesHiGain, 2); // MUX: Number of samples per pixel
    461472
     473    if (fFormatVersion>8)
     474        fin.read((char*)dummy, 4); // 2xU16 (NumSamplesRemovedHead and NumSamplesRemovedTail)
     475
    462476    // ----- Number of events -----
    463477    fin.read((char*)&fNumEvents, 4);     // Total=70
     478
     479    if (fFormatVersion>8)
     480        fin.read((char*)&fNumEventsRead, 4);     // Total=70
    464481
    465482    // New in general features: (should they be included in new MAGIC1 formats, too?)
     
    566583        *fLog << "Sampling:     " << fFreqSampling << "MHz with " << (int)fNumSignificantBits << " significant bits" << endl;
    567584    *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;
    569589
    570590    if (TString(t).Contains("header", TString::kIgnoreCase))
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.h

    r8582 r8584  
    3838private:
    3939    /* ---- 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
    6465
    6566    Bool_t SwapAssignment(Short_t id0, Short_t id1);
     
    106107    UShort_t GetNumBytesPerSample() const { return fNumBytesPerSample; }
    107108    UInt_t   GetNumEvents() const         { return fNumEvents; }
     109    UInt_t   GetNumEventsRead() const     { return fNumEventsRead; }
    108110    UShort_t GetFreqSampling() const      { return fFreqSampling; }
    109111    const MTime &GetRunStart() const      { return fRunStart; }
     
    133135    Bool_t ReadEvt(istream& fin);
    134136
    135     ClassDef(MRawRunHeader, 6)  // storage container for general info
     137    ClassDef(MRawRunHeader, 7)  // storage container for general info
    136138};
    137139#endif
Note: See TracChangeset for help on using the changeset viewer.