Changeset 17330 for trunk/FACT++


Ignore:
Timestamp:
11/21/13 17:15:05 (11 years ago)
Author:
tbretz
Message:
Give access to the full information in Open/Write/Close
Location:
trunk/FACT++/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DataCalib.cc

    r17271 r17330  
    11#include "DataCalib.h"
    22
    3 #include "FAD.h"
     3#include "EventBuilder.h"
    44#include "FitsFile.h"
    55#include "DimDescriptionService.h"
     
    180180}
    181181
    182 bool DataCalib::WriteEvt(const EVENT &e)
     182bool DataCalib::WriteEvt(const EVT_CTRL2 &evt)
    183183{
    184184    // FIXME: SET StartPix to 0 if StartPix is -1
    185185
     186    const EVENT &e = *evt.fEvent;
     187
    186188    if (fData.fStep==0)
    187189    {
     
    197199    }
    198200
    199     return DataWriteFits2::WriteEvt(e);
     201    return DataWriteFits2::WriteEvt(evt);
    200202}
    201203
     
    274276}
    275277*/
    276 bool DataCalib::Close(const RUN_TAIL *tail)
     278bool DataCalib::Close(const EVT_CTRL2 &evt)
    277279{
    278280    if (fNumEntries==0)
     
    357359    fProcessing = false;
    358360
    359     return DataWriteFits2::Close(tail);
    360 }
     361    return DataWriteFits2::Close(evt);
     362}
  • trunk/FACT++/src/DataCalib.h

    r17233 r17330  
    3838
    3939    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
    40     bool WriteEvt(const EVENT &e);
    41     bool Close(const RUN_TAIL * = 0);
     40    bool WriteEvt(const EVT_CTRL2 &);
     41    bool Close(const EVT_CTRL2 &);
    4242
    4343    //static void Apply(int16_t *val, const int16_t *start, uint32_t roi);
  • trunk/FACT++/src/DataProcessorImp.cc

    r16582 r17330  
    22
    33#include "HeadersFAD.h"
    4 #include "FAD.h"
     4#include "EventBuilder.h"
    55#include "tools.h"
    66
     
    6767}
    6868
    69 bool DataDump::WriteEvt(const EVENT &e)
     69bool DataDump::WriteEvt(const EVT_CTRL2 &e)
    7070{
    7171    const Time now;
     
    7676
    7777    ostringstream str;
    78     str << this << " - EVENT #" << e.EventNum << " / " << e.TriggerNum;
     78    str << this << " - EVENT #" << e.evNum << " / " << e.trgNum;
    7979    Debug(str);
    8080
     
    8282}
    8383
    84 bool DataDump::Close(const RUN_TAIL *)
     84bool DataDump::Close(const EVT_CTRL2 &)
    8585{
    8686    ostringstream str;
     
    9494// =======================================================================
    9595
    96 bool DataDebug::WriteEvt(const EVENT &e)
     96bool DataDebug::WriteEvt(const EVT_CTRL2 &e)
    9797{
    98     cout << "WRITE_EVENT #" << GetRunId() << " (" << e.EventNum << ")" << endl;
    99     cout << " Typ=" << e.TriggerType << endl;
    100     cout << " roi=" << e.Roi << endl;
    101     cout << " tim=" << e.PCTime << endl;
     98    cout << "WRITE_EVENT #" << GetRunId() << " (" << e.evNum << ")" << endl;
     99    cout << " Typ=" << e.trgTyp << endl;
     100    cout << " roi=" << e.nRoi << endl;
     101    cout << " tim=" << e.time.tv_sec << endl;
    102102
    103103    return true;
  • trunk/FACT++/src/DataProcessorImp.h

    r16055 r17330  
    55
    66struct RUN_HEAD;
    7 struct _EVENT;
    8 struct _RUN_TAIL;
     7struct EVT_CTRL2;
     8struct RUN_CTRL2;
    99
    1010namespace FAD
     
    1212    struct RunDescription;
    1313};
    14 
    15 typedef struct _EVENT    EVENT;
    16 typedef struct _RUN_TAIL RUN_TAIL;
    1714
    1815class DataProcessorImp : public MessageImp
     
    3633
    3734    virtual bool Open(const RUN_HEAD &h, const FAD::RunDescription &desc) = 0;
    38     virtual bool WriteEvt(const EVENT &) = 0;
    39     virtual bool Close(const RUN_TAIL * = 0) = 0;
     35    virtual bool WriteEvt(const EVT_CTRL2 &) = 0;
     36    virtual bool Close(const EVT_CTRL2 &) = 0;
    4037
    4138    const std::string &GetFileName() const { return fFileName; }
     
    6259
    6360    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
    64     bool WriteEvt(const EVENT &e);
    65     bool Close(const RUN_TAIL * = 0);
     61    bool WriteEvt(const EVT_CTRL2 &);
     62    bool Close(const EVT_CTRL2 &);
    6663};
    6764
     
    7168    DataDebug(const std::string &path, uint64_t night, uint32_t id, MessageImp &imp) : DataDump(path, night, id, imp) { }
    7269
    73     bool WriteEvt(const EVENT &e);
     70    bool WriteEvt(const EVT_CTRL2 &);
    7471};
    7572
  • trunk/FACT++/src/DataWriteRaw.cc

    r16072 r17330  
    22
    33#include "HeadersFAD.h"
    4 #include "FAD.h"
     4#include "EventBuilder.h"
    55
    66using namespace std;
     
    7979}
    8080
    81 bool DataWriteRaw::WriteEvt(const EVENT &e)
     81bool DataWriteRaw::WriteEvt(const EVT_CTRL2 &evt)
    8282{
     83    const EVENT &e = *evt.fEvent;
     84
    8385    const int sh = sizeof(EVENT)-2 + NPIX*e.Roi*2;
    8486
     
    8890}
    8991
    90 bool DataWriteRaw::Close(const RUN_TAIL *tail)
     92bool DataWriteRaw::Close()
    9193{
    9294    WriteBlockHeader(kEndOfFile, 0, 0, 0);
    9395
     96    /*
    9497    if (tail)
    9598    {
     
    97100
    98101        WriteValue(uint32_t(1));
    99         fOut.write(reinterpret_cast<const char*>(tail), 0/*sizeof(RUN_TAIL)*/);
    100     }
     102        fOut.write(reinterpret_cast<const char*>(tail), sizeof(RUN_TAIL));
     103    }*/
    101104
    102105    if (!fOut)
  • trunk/FACT++/src/DataWriteRaw.h

    r16055 r17330  
    8282
    8383    bool Open(const RUN_HEAD &h, const FAD::RunDescription &d);
    84     bool WriteEvt(const EVENT &evt);
    85     bool Close(const RUN_TAIL *tail= 0);
     84    bool WriteEvt(const EVT_CTRL2 &);
     85    bool Close(const EVT_CTRL2 &) { return Close(); }
     86    bool Close();
    8687};
    8788
Note: See TracChangeset for help on using the changeset viewer.