Changeset 11295


Ignore:
Timestamp:
07/08/11 15:42:07 (13 years ago)
Author:
tbretz
Message:
Updated to support new statistics; added sending of filename to fDimRuns
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/EventBuilderWrapper.h

    r11286 r11295  
    3232    uint32_t fRunId;
    3333
     34protected:
     35    string fFileName;
     36
    3437public:
    3538    DataFileImp(uint32_t id) : fRunId(id) { }
     
    3942    virtual bool Write(EVENT *) = 0;
    4043    virtual bool Close(RUN_TAIL * = 0) = 0;
     44
     45    const string &GetFileName() const { return fFileName; }
    4146
    4247    uint32_t GetRunId() const { return fRunId; }
     
    9398    bool OpenFile(RUN_HEAD* h)
    9499    {
     100        fFileName = "/dev/null";
    95101        cout << "OPEN_FILE #" << GetRunId() << " (" << this << ")" <<  endl;
    96102        cout << " Ver= " << h->Version << endl;
     
    221227        const string name = FormFileName(h->RunType, "bin");
    222228
     229        fFileName = name;
     230
    223231        errno = 0;
    224232        fOut.open(name.c_str(), ios_base::out);
     
    396404        //Form filename, based on runid and run-type
    397405        const string fileName = FormFileName(h->RunType, "fits");
     406
     407        fFileName = fileName;
    398408
    399409        //create the FITS object
     
    775785    EventBuilderWrapper(MessageImp &imp) : fMsg(imp),
    776786        fFileFormat(kNone), fMaxRun(0), fLastOpened(0), fLastClosed(0),
    777         fDimRuns        ("FAD_CONTROL/RUNS",             "I:5", ""),
     787        fDimRuns        ("FAD_CONTROL/RUNS",             "I:5;C", ""),
    778788        fDimEvents      ("FAD_CONTROL/EVENTS",           "I:4", ""),
    779789        fDimEventData   ("FAD_CONTROL/EVENT_DATA",       "S:1;I:1;S:1;I:2;S:1;S", ""),
     
    784794        fDimTemperature ("FAD_CONTROL/TEMPERATURE",      "F:82", ""),
    785795        fDimRefClock    ("FAD_CONTROL/REFERENCE_CLOCK",  "I:42", ""),
    786         fDimStatistics1 ("FAD_CONTROL/STATISTICS1",      "I:3;I:5;I:1;X:3", ""),
     796        fDimStatistics1 ("FAD_CONTROL/STATISTICS1",      "I:3;I:5;I:1;X:3;C:676", ""),
    787797        fDimStatistics2 ("FAD_CONTROL/STATISTICS2",      "I:1;I:280;X:40;I:40;I:4;I:4;I:2;I:2;I:3;C:40",  ""),
    788798        fDebugStream(false), fDebugRead(false)
     
    989999    // -------------- Mapped event builder callbacks ------------------
    9901000
    991     void UpdateRuns()
     1001    void UpdateRuns(const string &fname="")
    9921002    {
    9931003        uint32_t values[5] =
     
    10141024        fMaxRun = values[2];
    10151025
    1016         fDimRuns.Update(values);
     1026        vector<char> data(sizeof(values)+fname.size()+1);
     1027        memcpy(data.data(), values, sizeof(values));
     1028        strcpy(data.data()+sizeof(values), fname.c_str());
     1029
     1030        fDimRuns.Update(data);
    10171031    }
    10181032
     
    10441058
    10451059        fLastOpened = runid;
    1046         UpdateRuns();
     1060        UpdateRuns(file->GetFileName());
    10471061
    10481062        fNumEvts[kEventId] = 0;
Note: See TracChangeset for help on using the changeset viewer.