Changeset 11490


Ignore:
Timestamp:
07/20/11 18:03:06 (13 years ago)
Author:
tbretz
Message:
Replaced fPCTime by a two byte buffer and init full time; added StartCell to reading.
Location:
trunk/Mars/mraw
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mraw/MRawFitsRead.cc

    r11459 r11490  
    4747
    4848#include "MArrayB.h"
     49#include "MArrayS.h"
    4950
    5051#include "MRawRunHeader.h"
     
    9798    fRawRunHeader->SetRunType(0/*data*/);
    9899
    99     return kTRUE;
     100    return
     101        fin.HasKey("NPIX") && fin.HasKey("RUNID")  &&
     102        fin.HasKey("NROI") && fin.HasKey("BLDVER") &&
     103        fin.HasKey("NIGHT");
    100104}
    101105
     
    105109
    106110    MArrayB **data   = reinterpret_cast<MArrayB**>(fRawEvtData1->DataMember("fHiGainFadcSamples"));
     111    MArrayS **cell   = reinterpret_cast<MArrayS**>(fRawEvtData1->DataMember("fStartCells"));
    107112    UInt_t   *evtnum = reinterpret_cast<UInt_t*>  (fRawEvtHeader->DataMember("fDAQEvtNumber"));
    108113
    109     if (!data || !evtnum)
     114    if (!data || !cell || !evtnum)
    110115        return kFALSE;
    111116
    112117    fRawEvtData1->ResetPixels();
    113118    fRawEvtData2->ResetPixels(0, 0);
     119    fRawEvtData1->InitStartCells();
    114120
    115121    if (!fin.SetRefAddress("EventNum", *evtnum))
    116122        return kFALSE;
    117123
    118     if (!fin.SetRefAddress("PCTime", fPCTime))
     124    fPCTime.resize(2);
     125    if (!fin.SetVecAddress("PCTime", fPCTime))
    119126        return kFALSE;
    120127
    121     if (!fin.SetPtrAddress("Data", (uint16_t*)(*data)->GetArray(), (*data)->GetSize()/2))
     128    if (!fin.SetPtrAddress("Data", (int16_t*)(*data)->GetArray(), (*data)->GetSize()/2))
     129        return kFALSE;
     130
     131    if (!fin.SetPtrAddress("StartCell", (uint16_t*)(*cell)->GetArray(), (*cell)->GetSize()))
    122132        return kFALSE;
    123133
     
    132142        return kFALSE;
    133143
    134     fRawEvtTime->SetUnixTime(fPCTime, 0);
     144    fRawEvtTime->SetUnixTime(fPCTime[0], fPCTime[1]);
     145
     146    // FIXME: Correctly sort the pixels here!
    135147
    136148    fRawEvtData1->SetReadyToSave();
  • trunk/Mars/mraw/MRawFitsRead.h

    r11459 r11490  
    66#endif
    77
     8#include <vector>
     9
    810class MRawFitsRead : public MRawFileRead
    911{
    1012private:
    11     UInt_t  fPCTime; //! Buffer
     13    std::vector<UInt_t> fPCTime; //! Buffer
    1214
    1315    istream *OpenFile(const char *filename);
Note: See TracChangeset for help on using the changeset viewer.