Index: /trunk/FACT++/src/EventBuilderWrapper.h
===================================================================
--- /trunk/FACT++/src/EventBuilderWrapper.h	(revision 16586)
+++ /trunk/FACT++/src/EventBuilderWrapper.h	(revision 16587)
@@ -180,5 +180,5 @@
                                                            "Event counts"
                                                            "|evtsCount[int]:Num evts cur. run, total (all run), evt ID, trig. Num"),
-        fDimRawData     ("FAD_CONTROL/RAW_DATA",           "S:1;S:1;I:1;I:1;S:1;I:1;C:4;I:1;I:2;I:40;S:1440;S:160;F",
+        fDimRawData     ("FAD_CONTROL/RAW_DATA",           "S:1;S:1;I:1;I:1;S:1;I:1;I:2;I:40;S:1440;S:160;F",
                                                            "|roi[uint16]:number of samples per pixel"
                                                            "|roi_tm[uint16]:number of samples per time-marker channel"
@@ -187,6 +187,4 @@
                                                            "|type[uint16]:trigger type from FTM"
                                                            "|num_boards[uint32]:number of active boards"
-                                                           "|error[uint8]:event builder error counters"
-                                                           "|dummy[]:"
                                                            "|time[uint32]:PC time as unix time stamp"
                                                            "|time_board[uint32]:Time stamp of FAD boards"
@@ -485,5 +483,5 @@
         // If there is still an open file: close it
         if (fFile)
-            runClose();
+            runClose(*evt.runCtrl);
 
         // Keep a copy of the currently valid drs calibration
@@ -591,5 +589,5 @@
     }
 
-    void runClose()
+    void runClose(RUN_CTRL2 &run)
     {
         if (!fFile)
@@ -625,4 +623,10 @@
         // Do the potentially blocking call after all others
         rc ? fMsg.Info(str) : fMsg.Error(str);
+
+        // If a Drs Calibration has just been finished, all following events
+        // should also be processed with this calibration
+        const DrsCalibration &cal = DataCalib::GetCalibration();
+        if (!run.calib || run.calib->fStep != cal.fStep || run.calib->fRoi!=cal.fRoi)
+            run.calib = shared_ptr<DrsCalibration>(new DrsCalibration(cal));
     }
 
@@ -1262,7 +1266,7 @@
 }
 
-void runClose()
+void runClose(RUN_CTRL2 &run)
 {
-    EventBuilderWrapper::This->runClose();
+    EventBuilderWrapper::This->runClose(run);
 }
 
