Changeset 9433 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
04/26/09 13:15:08 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9429 r9433  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2009/04/26 Thomas Bretz
     21
     22   * mraw/MRawFileRead.cc:
     23     - added consistency check for two consecutive headers
     24
     25   * mraw/MRawRunHeader.[h,cc]:
     26     - added copy constructor
     27     - added member function for conistency check
     28
     29
     30
    2031 2009/04/16 Thomas Bretz
    2132
  • trunk/MagicSoft/Mars/NEWS

    r9429 r9433  
    77   * Added a new palette "temp" to MH::SetPalette which should resample
    88     a temperature
     9
     10   * Added consistency check for two consecutive runs
    911
    1012 ;showplot:
     
    3739
    3840   * Fixed a bug which caused the aerosol coefficient to be incorrectly
    39      initialized. The effect might be random.
     41     initialized. The effect might be random but seems to be small.
    4042
    4143 ;callisto:
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.cc

    r9332 r9433  
    218218    fNumFile++;
    219219
     220    MRawRunHeader h(*fRawRunHeader);
     221
    220222    //
    221223    // Read RUN HEADER (see specification) from input stream
     
    228230    {
    229231        *fLog << err << "Error: Accessing file '" << name << "'" << endl;
     232        return kERROR;
     233    }
     234
     235    if (h.IsValidRun() && !fRawRunHeader->IsConsistent(h))
     236    {
     237        *fLog << err << "Error: Inconsistency between previous header and '" << name << "' found." << endl;
     238        fRawRunHeader->Print();
    230239        return kERROR;
    231240    }
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc

    r9351 r9433  
    210210}
    211211
     212MRawRunHeader::MRawRunHeader(const MRawRunHeader &h)
     213{
     214    fMagicNumber=h.fMagicNumber;                       // File type identifier
     215
     216    fHeaderSizeRun=h.fHeaderSizeRun;                   // Size of run header
     217    fHeaderSizeEvt=h.fHeaderSizeEvt;                   // Size of evt header
     218    fHeaderSizeCrate=h.fHeaderSizeCrate;               // Size of crate header
     219
     220    fFormatVersion=h.fFormatVersion;                   // File format version
     221    fSoftVersion=h.fSoftVersion;                       // DAQ software version
     222    fFadcType=h.fFadcType;                             // FADC type (1=Siegen, 2=MUX)
     223    fCameraVersion=h.fCameraVersion;                   // Camera Version (1=MAGIC I)
     224    fTelescopeNumber=h.fTelescopeNumber;               // Telescope number (1=Magic I)
     225    fRunType=h.fRunType;                               // Run Type
     226    fRunNumber=h.fRunNumber;                           // Run number
     227    fFileNumber=h.fFileNumber;                         // File number
     228    memcpy(fProjectName, h.fProjectName, 101);         // Project name
     229    memcpy(fSourceName, h.fSourceName, 81);            // Source name
     230    memcpy(fObservationMode, h.fObservationMode, 61);  // observation mode
     231    memcpy(fSourceEpochChar, h.fSourceEpochChar, 4);   // epoch char of the source
     232    fSourceEpochDate=h.fSourceEpochDate;               // epoch date of the source
     233    fNumCrates=h.fNumCrates;                           // number of electronic boards
     234    fNumPixInCrate=h.fNumPixInCrate;                   // number of pixels in crate
     235    fNumSamplesLoGain=h.fNumSamplesLoGain;             // number of logain samples stored
     236    fNumSamplesHiGain=h.fNumSamplesHiGain;             // number of higain samples stored
     237    fNumBytesPerSample=h.fNumBytesPerSample;           // number of bytes per sample
     238    fNumEvents=h.fNumEvents;                           // number of events stored
     239    fNumEventsRead=h.fNumEventsRead;                   // number of events read by the electronics
     240    fSamplingFrequency=h.fSamplingFrequency;           // Sampling Frequency [MHz]
     241    fFadcResolution=h.fFadcResolution;                 // number of significant bits
     242    fRunStart=h.fRunStart;                             // time of run start
     243    fRunStop=h.fRunStop;                               // time of run stop
     244    fPixAssignment = new MArrayS(*h.fPixAssignment);   //-> pixel assignment table
     245}
     246
    212247// --------------------------------------------------------------------------
    213248//
     
    217252{
    218253    delete fPixAssignment;
     254}
     255
     256// --------------------------------------------------------------------------
     257//
     258// Checks for consistency between two run headers. Checks:
     259//    fNumCrates
     260//    fNumPixInCrate
     261//    fNumSamplesLoGain
     262//    fNumSamplesHiGain
     263//    fNumBytesPerSample
     264//
     265Bool_t MRawRunHeader::IsConsistent(const MRawRunHeader &h) const
     266{
     267    return fNumCrates==h.fNumCrates &&
     268        fNumPixInCrate==h.fNumPixInCrate &&
     269        fNumSamplesLoGain==h.fNumSamplesLoGain &&
     270        fNumSamplesHiGain==h.fNumSamplesHiGain &&
     271        fNumBytesPerSample==h.fNumBytesPerSample;
    219272}
    220273
  • trunk/MagicSoft/Mars/mraw/MRawRunHeader.h

    r9317 r9433  
    8484public:
    8585    MRawRunHeader(const char *name=NULL, const char *title=NULL);
     86    MRawRunHeader(const MRawRunHeader &h);
    8687    ~MRawRunHeader();
    8788
     
    169170    Bool_t IsPointRun() const       { return (fRunType&0xff)==kRTPointRun; }
    170171
     172    Bool_t IsValidRun() const { return fRunType!=kRTNone; }
     173
     174    Bool_t IsConsistent(const MRawRunHeader &h) const;
     175
    171176    void Print(Option_t *t=NULL) const;
    172177
Note: See TracChangeset for help on using the changeset viewer.