Index: /trunk/FACT++/src/EventBuilderWrapper.h
===================================================================
--- /trunk/FACT++/src/EventBuilderWrapper.h	(revision 11294)
+++ /trunk/FACT++/src/EventBuilderWrapper.h	(revision 11295)
@@ -32,4 +32,7 @@
     uint32_t fRunId;
 
+protected:
+    string fFileName;
+
 public:
     DataFileImp(uint32_t id) : fRunId(id) { }
@@ -39,4 +42,6 @@
     virtual bool Write(EVENT *) = 0;
     virtual bool Close(RUN_TAIL * = 0) = 0;
+
+    const string &GetFileName() const { return fFileName; }
 
     uint32_t GetRunId() const { return fRunId; }
@@ -93,4 +98,5 @@
     bool OpenFile(RUN_HEAD* h)
     {
+        fFileName = "/dev/null";
         cout << "OPEN_FILE #" << GetRunId() << " (" << this << ")" <<  endl;
         cout << " Ver= " << h->Version << endl;
@@ -221,4 +227,6 @@
         const string name = FormFileName(h->RunType, "bin");
 
+        fFileName = name;
+
         errno = 0;
         fOut.open(name.c_str(), ios_base::out);
@@ -396,4 +404,6 @@
         //Form filename, based on runid and run-type
         const string fileName = FormFileName(h->RunType, "fits");
+
+        fFileName = fileName;
 
         //create the FITS object
@@ -775,5 +785,5 @@
     EventBuilderWrapper(MessageImp &imp) : fMsg(imp),
         fFileFormat(kNone), fMaxRun(0), fLastOpened(0), fLastClosed(0),
-        fDimRuns        ("FAD_CONTROL/RUNS",             "I:5", ""),
+        fDimRuns        ("FAD_CONTROL/RUNS",             "I:5;C", ""),
         fDimEvents      ("FAD_CONTROL/EVENTS",           "I:4", ""),
 	fDimEventData   ("FAD_CONTROL/EVENT_DATA",       "S:1;I:1;S:1;I:2;S:1;S", ""),
@@ -784,5 +794,5 @@
         fDimTemperature ("FAD_CONTROL/TEMPERATURE",      "F:82", ""),
         fDimRefClock    ("FAD_CONTROL/REFERENCE_CLOCK",  "I:42", ""),
-        fDimStatistics1 ("FAD_CONTROL/STATISTICS1",      "I:3;I:5;I:1;X:3", ""),
+        fDimStatistics1 ("FAD_CONTROL/STATISTICS1",      "I:3;I:5;I:1;X:3;C:676", ""),
         fDimStatistics2 ("FAD_CONTROL/STATISTICS2",      "I:1;I:280;X:40;I:40;I:4;I:4;I:2;I:2;I:3;C:40",  ""),
         fDebugStream(false), fDebugRead(false)
@@ -989,5 +999,5 @@
     // -------------- Mapped event builder callbacks ------------------
 
-    void UpdateRuns()
+    void UpdateRuns(const string &fname="")
     {
         uint32_t values[5] =
@@ -1014,5 +1024,9 @@
         fMaxRun = values[2];
 
-        fDimRuns.Update(values);
+        vector<char> data(sizeof(values)+fname.size()+1);
+        memcpy(data.data(), values, sizeof(values));
+        strcpy(data.data()+sizeof(values), fname.c_str());
+
+        fDimRuns.Update(data);
     }
 
@@ -1044,5 +1058,5 @@
 
         fLastOpened = runid;
-        UpdateRuns();
+        UpdateRuns(file->GetFileName());
 
         fNumEvts[kEventId] = 0;
