Index: src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.cpp
===================================================================
--- src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.cpp	(revision 91e7658a957edb869c0ec3c778cdda9a2c3412f3)
+++ src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.cpp	(revision d56e210d487ef5c883cacc6db7669fdec688456d)
@@ -581,4 +581,85 @@
       returnthreshold *= third_two;
   return returnthreshold;
+}
+
+/** UnitTest for padWithZerosForEvenNumberedSamples()
+ *
+ */
+void SamplingGridTest::padWithZerosForEvenNumberedSamplesTest()
+{
+  const double begin[NDIM] = { 0., 0., 0. };
+  const double end[NDIM] = { 2., 2., 2. };
+
+  // we check for window of odd numbers
+  {
+  //    LOG(2, "Checking with difference " << grid_difference);
+    const int gridpoints = 1*2*2;
+    const int extended_gridpoints = 2*4*4;
+    SamplingGrid::sampledvalues_t values(gridpoints, 1.); // length in one axis is odd
+    SamplingGrid::sampledvalues_t checkvalues(extended_gridpoints, 0.);
+    {
+      int N[NDIM];
+      int index = 0;
+      for (N[0]=2;N[0]<3;++N[0]) {
+        for (N[1]=0;N[1]<1;++N[1]) {
+          for (N[2]=0;N[2]<4;++N[2]) {
+            checkvalues[index++] = 0.;
+          }
+        }
+        for (N[1]=1;N[1]<3;++N[1]) {
+          checkvalues[index++] = 0.;
+          for (N[2]=1;N[2]<3;++N[2]) {
+            checkvalues[index++] = 1.;
+          }
+          checkvalues[index++] = 0.;
+        }
+        for (N[1]=3;N[1]<4;++N[1]) {
+          for (N[2]=0;N[2]<4;++N[2]) {
+            checkvalues[index++] = 0.;
+          }
+        }
+      }
+      for (N[0]=3;N[0]<4;++N[0]) {
+        for (N[1]=0;N[1]<4;++N[1]) {
+          for (N[2]=0;N[2]<4;++N[2]) {
+            checkvalues[index++] = 0.;
+          }
+        }
+      }
+    }
+
+    /** Here, we must initialize the larger grid with zero window first and
+     * then add the values into the smaller window.
+     */
+    SamplingGrid grid(begin, end, 2);
+    const double window_begin[NDIM] = {
+        grid.getNearestHigherGridPoint(1.0, 0), // index 2
+        grid.getNearestHigherGridPoint(0.5, 1), // index 1 -> 0
+        grid.getNearestHigherGridPoint(0.5, 2) }; // index 1 -> 0
+    const double window_end[NDIM] = {
+        grid.getNearestLowerGridPoint(1.5, 0), // index 3 -> 4
+        grid.getNearestLowerGridPoint(1.5, 1), // index 3 -> 4
+        grid.getNearestLowerGridPoint(1.5, 2) }; // index 3 -> 4
+    grid.setWindow(window_begin, window_end);
+    grid.addOntoWindow(window_begin, window_end, values, +1.);
+    grid.padWithZerosForEvenNumberedSamples();
+
+    SamplingGrid checkgrid(begin, end, 2);
+    const double check_window_begin[NDIM] = {
+        checkgrid.getNearestHigherGridPoint(1., 0),
+        checkgrid.getNearestHigherGridPoint(0., 1),
+        checkgrid.getNearestHigherGridPoint(0., 2) };
+    const double check_window_end[NDIM] = {
+        checkgrid.getNearestHigherGridPoint(2., 0),
+        checkgrid.getNearestHigherGridPoint(2., 1),
+        checkgrid.getNearestHigherGridPoint(2., 2) };
+    checkgrid.setWindow(check_window_begin, check_window_end);
+    checkgrid.addOntoWindow(check_window_begin, check_window_end, checkvalues, +1.);
+
+    std::cout << " grid value " << grid.sampled_grid << std::endl;
+    std::cout << " checkgrid value " << checkgrid.sampled_grid << std::endl;
+    CPPUNIT_ASSERT_EQUAL( checkgrid.sampled_grid.size(), grid.sampled_grid.size());
+    CPPUNIT_ASSERT_EQUAL( checkgrid, grid );
+  }
 }
 
Index: src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.hpp
===================================================================
--- src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.hpp	(revision 91e7658a957edb869c0ec3c778cdda9a2c3412f3)
+++ src/Fragmentation/Summation/SetValues/unittests/SamplingGridUnitTest.hpp	(revision d56e210d487ef5c883cacc6db7669fdec688456d)
@@ -38,4 +38,5 @@
     CPPUNIT_TEST ( equality_Test );
     CPPUNIT_TEST ( serializeTest );
+    CPPUNIT_TEST ( padWithZerosForEvenNumberedSamplesTest );
     CPPUNIT_TEST ( downsample_gridTest );
     CPPUNIT_TEST ( downsample_smallerwindowTest );
@@ -59,4 +60,5 @@
       void equality_Test();
       void serializeTest();
+      void padWithZerosForEvenNumberedSamplesTest();
       void downsample_gridTest();
       void downsample_smallerwindowTest();
