Index: /trunk/Mars/mcore/DrsCalib.h
===================================================================
--- /trunk/Mars/mcore/DrsCalib.h	(revision 16427)
+++ /trunk/Mars/mcore/DrsCalib.h	(revision 16428)
@@ -220,5 +220,5 @@
     }
 
-    static double FindStep(const size_t ch0, const float *vec, int16_t roi, const int16_t pos, const uint16_t *map)
+    static double FindStep(const size_t ch0, const float *vec, int16_t roi, const int16_t pos, const uint16_t *map=NULL)
     {
         // We have about 1% of all cases which are not ahndled here,
@@ -237,5 +237,5 @@
         {
             const size_t hw = ch0+p;
-            const size_t sw = map[hw]*roi + pos;
+            const size_t sw = (map?map[hw]:hw)*roi + pos;
 
             const double diff = vec[sw]-vec[sw-1];
@@ -250,5 +250,5 @@
     }
 
-    static void SubtractStep(const size_t ch0, const double avg, float *vec, int16_t roi, int32_t pos, const uint16_t *map)
+    static void SubtractStep(const size_t ch0, const double avg, float *vec, int16_t roi, int32_t pos, const uint16_t *map=NULL)
     {
         if (pos==0 || pos>=roi)
@@ -265,5 +265,5 @@
             {
                 const size_t hw = ch0+p;
-                const size_t sw = map[hw]*roi + j;
+                const size_t sw = (map?map[hw]:hw)*roi + j;
 
                 vec[sw] -= sub;
@@ -307,8 +307,9 @@
     static Step CorrectStep(float *vec, uint16_t nch, uint16_t roi,
                             const int16_t *prev, const int16_t *start,
-                            const int16_t offset, const uint16_t *map)
+                            const int16_t offset, const uint16_t *map=NULL)
     {
 
         std::vector<Step> list;
+        list.reserve(nch);
 
         // Fill steps into array
@@ -331,5 +332,5 @@
         }
 
-        if (list.size()==0)
+        if (list.empty())
             return Step();
 
@@ -522,8 +523,5 @@
     static void SlidingAverage(float *const vec, const uint32_t roi, const uint16_t w)
     {
-        if (w==0)
-            return;
-
-        if (w>roi)
+        if (w==0 || w>roi)
             return;
 
@@ -954,7 +952,7 @@
 
     DrsCalibration() :
-        fOffset  (1440*1024, 0),
-        fGain    (1440*1024, 4096),
-        fTrgOff  (1600*1024, 0),
+        fOffset(1440*1024, 0),
+        fGain(1440*1024, 4096),
+        fTrgOff (1600*1024, 0),
         fNumOffset(1),
         fNumGain(2000),
@@ -969,4 +967,21 @@
             fDateRunEnd[i] = "1970-01-01T00:00:00";
         }
+    }
+
+    DrsCalibration(const DrsCalibration &cpy) :
+        fOffset(cpy.fOffset),
+        fGain(cpy.fGain),
+        fTrgOff(cpy.fTrgOff),
+        fNumOffset(cpy.fNumOffset),
+        fNumGain(cpy.fNumGain),
+        fNumTrgOff(cpy.fNumTrgOff),
+        fStep(cpy.fStep),
+        fRoi(cpy.fRoi),
+        fNumTm(cpy.fNumTm),
+        fDateObs(cpy.fDateObs),
+        fDateRunBeg(cpy.fDateRunBeg),
+        fDateRunEnd(cpy.fDateRunEnd),
+        fDateEnd(cpy.fDateEnd)
+    {
     }
 
