Changeset 17165 for trunk/Mars/mraw


Ignore:
Timestamp:
09/13/13 14:04:51 (11 years ago)
Author:
ftemme
Message:
Merging changes from the MC branch in the trunk
Location:
trunk/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars

  • trunk/Mars/mraw/MRawFileRead.cc

    r14857 r17165  
    102102//
    103103MRawFileRead::MRawFileRead(const char *fname, const char *name, const char *title)
    104     : fFileNames(NULL), fNumFile(0), fNumTotalEvents(0), fIn(NULL), fParList(NULL), fInterleave(1), fForce(kFALSE)
     104    : fFileNames(NULL), fNumFile(0), fNumTotalEvents(0), fIn(NULL), fParList(NULL), fInterleave(1), fForce(kFALSE), fIsMc(kFALSE)
    105105{
    106106    fName  = name  ? name  : "MRead";
  • trunk/Mars/mraw/MRawFileRead.h

    r14449 r17165  
    3737    Int_t PostProcess();
    3838
     39    Bool_t    fIsMc;
     40
    3941public:
    4042    MRawFileRead(const char *filename=NULL, const char *name=NULL, const char *title=NULL);
  • trunk/Mars/mraw/MRawFitsRead.cc

    r17124 r17165  
    159159    fRawRunHeader->SetRunInfo(0, fin.GetUInt("NIGHT"), fin.GetUInt("RUNID"));
    160160    fRawRunHeader->InitFact(fin.GetUInt("NPIX")/9, 9, fin.GetUInt("NROI"), fPixelMap.size()==0?0:fPixelMap.data());
    161     fRawRunHeader->SetFormat(0xf172, fin.GetUInt("BLDVER"));
     161    if (!fin.HasKey("ISMC")){
     162        fRawRunHeader->SetFormat(0xf172, fin.GetUInt("BLDVER"));
     163    }
    162164    fRawRunHeader->SetRunType(0/*data*/);
    163165
    164     const string runstart = fin.GetStr("DATE-OBS");
    165     const string runstop  = fin.GetStr("DATE-END");
    166 
    167     fRawRunHeader->SetRunTime(MTime(runstart.c_str()), MTime(runstop.c_str()));
    168 
    169     return
    170         fin.HasKey("NPIX") && fin.HasKey("RUNID")  &&
    171         fin.HasKey("NROI") && fin.HasKey("BLDVER") &&
    172         fin.HasKey("NIGHT");
     166    if (!fin.HasKey("ISMC")){
     167        const string runstart = fin.GetStr("DATE-OBS");
     168        const string runstop  = fin.GetStr("DATE-END");
     169
     170        fRawRunHeader->SetRunTime(MTime(runstart.c_str()), MTime(runstop.c_str()));
     171    }
     172
     173    if (!fin.HasKey("ISMC"))
     174        return
     175            fin.HasKey("NPIX") && fin.HasKey("RUNID")  &&
     176            fin.HasKey("NROI") && fin.HasKey("BLDVER") &&
     177            fin.HasKey("NIGHT");
     178    else
     179        return
     180            fin.HasKey("NPIX") && fin.HasKey("RUNID")  &&
     181            fin.HasKey("NROI") && fin.HasKey("NIGHT");
    173182}
    174183
     
    197206        return kFALSE;
    198207
    199     if (!fin.SetRefAddress("NumBoards", fNumBoards))
    200         return kFALSE;
    201 
    202     fPCTime.resize(2);
    203     if (!fin.SetVecAddress("UnixTimeUTC", fPCTime))
    204         if (!fin.SetVecAddress("PCTime", fPCTime))
     208    if (!fin.HasKey("ISMC")){
     209        if (!fin.SetRefAddress("NumBoards", fNumBoards))
    205210            return kFALSE;
    206211
    207 
    208     if (!fin.SetPtrAddress("BoardTime", fRawBoards->fFadTime, 40))
    209         return kFALSE;
     212        fPCTime.resize(2);
     213        if (!fin.SetVecAddress("UnixTimeUTC", fPCTime))
     214            if (!fin.SetVecAddress("PCTime", fPCTime))
     215                return kFALSE;
     216
     217
     218        if (!fin.SetPtrAddress("BoardTime", fRawBoards->fFadTime, 40))
     219            return kFALSE;
     220    }
     221    else
     222        fIsMc = kTRUE;
     223
    210224
    211225    if (!fin.SetPtrAddress("Data", (int16_t*)(*data)->GetArray(), (*data)->GetSize()/2))
     
    225239        return kFALSE;
    226240
    227     // Skip incomplete events
    228     if (fNumBoards!=40)
    229         return kCONTINUE;
    230 
    231     fRawEvtTime->SetUnixTime(fPCTime[0], fPCTime[1]);
    232 
     241    if (!fIsMc)
     242    {
     243        // Skip incomplete events
     244        if (fNumBoards!=40)
     245            return kCONTINUE;
     246
     247        fRawEvtTime->SetUnixTime(fPCTime[0], fPCTime[1]);
     248
     249    }   
    233250    // FIXME: Correctly sort the pixels here!
    234251
Note: See TracChangeset for help on using the changeset viewer.