Index: src/Fragmentation/Automation/FragmentationLongRangeResults.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentationLongRangeResults.cpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
+++ src/Fragmentation/Automation/FragmentationLongRangeResults.cpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
@@ -0,0 +1,187 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * FragmentationLongRangeResults.cpp
+ *
+ *  Created on: Aug 31, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "FragmentationLongRangeResults.hpp"
+
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/remove.hpp>
+#include <sstream>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "Fragmentation/Converter/DataConverter.hpp"
+#include "Fragmentation/KeySetsContainer.hpp"
+#include "Fragmentation/Automation/createMatrixNrLookup.hpp"
+#include "Fragmentation/Automation/extractJobIds.hpp"
+#include "Fragmentation/Automation/parseKeySetFile.hpp"
+#include "Fragmentation/Summation/AllLevelOrthogonalSummator.hpp"
+#include "Fragmentation/Summation/IndexSetContainer.hpp"
+#include "Fragmentation/Summation/OrthogonalSumUpPerLevel.hpp"
+#include "Fragmentation/Summation/SubsetMap.hpp"
+#include "Fragmentation/Summation/SumUpPerLevel.hpp"
+
+#include "Helpers/defs.hpp"
+
+FragmentationLongRangeResults::FragmentationLongRangeResults(
+    const std::map<JobId_t,MPQCData> &fragmentData,
+    std::map<JobId_t,VMGData> &longrangeData,
+    const KeySetsContainer& _KeySet,
+    const KeySetsContainer& _ForceKeySet) :
+    KeySet(_KeySet),
+    ForceKeySet(_ForceKeySet)
+{
+  // create lookup from job nr to fragment number
+  size_t MPQCFragmentCounter = 0;
+  const std::vector<JobId_t> mpqcjobids = extractJobIds<MPQCData>(fragmentData);
+  MPQCMatrixNrLookup =
+      createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter);
+
+  size_t VMGFragmentCounter = 0;
+  const std::vector<JobId_t> vmgjobids = extractJobIds<VMGData>(longrangeData);
+  VMGMatrixNrLookup =
+      createMatrixNrLookup(vmgjobids, VMGFragmentCounter);
+
+  // convert KeySetContainer to IndexSetContainer
+  container.reset(new IndexSetContainer(KeySet));
+  // create the map of all keysets
+  subsetmap.reset(new SubsetMap(*container));
+}
+
+void FragmentationLongRangeResults::operator()(
+    const std::map<JobId_t,MPQCData> &fragmentData,
+    std::map<JobId_t,VMGData> &longrangeData,
+    const std::vector<VMGData> &fullsolutionData,
+    const std::vector<SamplingGrid> &full_sample)
+{
+  MaxLevel = subsetmap->getMaximumSetLevel();
+  LOG(1, "INFO: Summing up results till level " << MaxLevel << ".");
+  /// convert all MPQCData to MPQCDataMap_t
+  {
+    ASSERT( ForceKeySet.KeySets.size() == fragmentData.size(),
+        "FragmentationLongRangeResults::FragmentationLongRangeResults() - ForceKeySet's KeySets and fragmentData differ in size.");
+
+    OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>(
+        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
+        Result_Grid_fused, Result_perIndexSet_Grid);
+    OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>(
+        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
+        Result_Fragment_fused, Result_perIndexSet_Fragment);
+
+    // multiply each short-range potential with the respective charge
+    std::map<JobId_t,MPQCData>::const_iterator mpqciter = fragmentData.begin();
+    std::map<JobId_t,VMGData>::iterator vmgiter = longrangeData.begin();
+    for (; vmgiter != longrangeData.end(); ++mpqciter, ++vmgiter) {
+      vmgiter->second.sampled_potential *= mpqciter->second.sampled_grid;
+    }
+    // then sum up
+    OrthogonalSumUpPerLevel<VMGDataMap_t, VMGData, VMGDataVector_t>(
+        longrangeData, VMGMatrixNrLookup, container, subsetmap,
+        Result_LongRange_fused, Result_perIndexSet_LongRange);
+
+    Result_LongRangeIntegrated_fused.reserve(MaxLevel);
+    {
+      // NOTE: potential for level 1 is not calculated as saturation hydrogen
+      // are not removed on this level yet
+      VMGDataLongRangeMap_t instance;
+      boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) = 0.;
+      boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) = 0.;
+      boost::fusion::at_key<VMGDataFused::nuclei_longrange>(instance) = 0.;
+      boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance) = 0.;
+      boost::fusion::at_key<VMGDataFused::total_longrange>(instance) = 0.;
+      boost::fusion::at_key<VMGDataFused::total_shortrange>(instance) = 0.;
+      Result_LongRangeIntegrated_fused.push_back(instance);
+    }
+    for (size_t level = 2; level <= MaxLevel; ++level) {
+      // we have to fill in the remainder values in the LongRangeMap by hand
+      // weight times correct charge density of the same level
+      const SamplingGrid &charge_weight =
+          boost::fusion::at_key<MPQCDataFused::sampled_grid>(Result_Grid_fused[level-1]);
+      SamplingGrid full_sample_solution = fullsolutionData[level-2].sampled_potential;
+      full_sample_solution *= charge_weight;
+      const SamplingGrid &short_range_correction =
+          boost::fusion::at_key<VMGDataFused::sampled_potential>(Result_LongRange_fused[level-1]);
+      full_sample_solution -= short_range_correction;
+      double full_solution_energy = fullsolutionData[level-2].e_long;
+      const double short_range_energy =
+          boost::fusion::at_key<VMGDataFused::energy_long>(Result_LongRange_fused[level-1]);
+      full_solution_energy -= short_range_energy;
+
+      // multiply element-wise with charge distribution
+      VMGDataLongRangeMap_t instance;
+      boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) = .5*full_sample_solution.integral();
+//      LOG(0, "Remaining long-range potential integral of level " << level << " is "
+//          << full_sample_solution.integral() << ".");
+      boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) = .5*short_range_correction.integral();
+//      LOG(0, "Short-range correction potential integral of level " << level << " is "
+//          << short_range_correction.integral() << ".");
+      boost::fusion::at_key<VMGDataFused::nuclei_longrange>(instance) = full_solution_energy;
+//      LOG(0, "Remaining long-range energy from potential integral of level " << level << " is "
+//          << full_solution_energy << ".");
+      boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance) = short_range_energy;
+//      LOG(0, "Short-range correction energy from potential integral of level " << level << " is "
+//          << short_range_energy << ".");
+      boost::fusion::at_key<VMGDataFused::total_longrange>(instance) =
+          boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) - full_solution_energy;
+      boost::fusion::at_key<VMGDataFused::total_shortrange>(instance) =
+          boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) - short_range_energy;
+      Result_LongRangeIntegrated_fused.push_back(instance);
+    }
+//    {
+//      //    LOG(0, "Remaining long-range energy from energy_potential is " << full_sample_solution.integral()-epotentialSummer.getFullContribution() << ".");
+//      SamplingGrid full_sample_solution = fullsolutionData.back().sampled_potential;
+//      const SamplingGrid &short_range_correction =
+//          boost::fusion::at_key<VMGDataFused::sampled_potential>(Result_LongRange_fused.back()).getFullContribution();
+//      full_sample_solution -= short_range_correction;
+//      // multiply element-wise with charge distribution
+//      LOG(0, "Remaining long-range potential integral is " << full_sample_solution.integral() << ".");
+//      LOG(0, "Short-range correction potential integral of level is " << short_range_correction.integral() << ".");
+//      LOG(0, "Remaining long-range energy from potential integral is "
+//          << full_sample_solution.integral(full_sample.back()) << ".");
+//      LOG(0, "Short-range correction energy from potential integral is "
+//          << short_range_correction.integral(full_sample.back()) << ".");
+//
+//      double e_long = fullsolutionData.back().e_long;
+//      e_long -= boost::fusion::at_key<VMGDataFused::energy_long>(Result_LongRange_fused.back()).getFullContribution();
+//      LOG(0, "Remaining long-range energy is " << e_long << ".");
+//    }
+
+    // TODO: Extract long-range corrections to forces
+    // NOTE: potential is in atomic length units, NOT IN ANGSTROEM!
+
+  }
+}
Index: src/Fragmentation/Automation/FragmentationLongRangeResults.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentationLongRangeResults.hpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
+++ src/Fragmentation/Automation/FragmentationLongRangeResults.hpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
@@ -0,0 +1,118 @@
+/*
+ * FragmentationLongRangeResults.hpp
+ *
+ *  Created on: Aug 31, 2012
+ *      Author: heber
+ */
+
+#ifndef FRAGMENTATIONLONGRANGERESULTS_HPP_
+#define FRAGMENTATIONLONGRANGERESULTS_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <map>
+#include <vector>
+
+#include "JobMarket/types.hpp"
+
+#include "Fragmentation/KeySetsContainer.hpp"
+#include "Fragmentation/Summation/IndexSet.hpp"
+#include "Fragmentation/Summation/IndexSetContainer.hpp"
+#include "Fragmentation/Summation/SubsetMap.hpp"
+
+#include "Jobs/MPQCData.hpp"
+#include "Jobs/MPQCDataMap.hpp"
+#include "Jobs/VMGData.hpp"
+#include "Jobs/VMGDataMap.hpp"
+#include "Jobs/Grid/SamplingGrid.hpp"
+
+/** FragmentationLongRangeResults contains the summed up results per level resulting
+ * from the fragmentation of the molecular system and clever combination of
+ * fragmentary energies, forces, timings, and so on.
+ *
+ * This structure is mostly a storage wherein the summed up results are
+ * contained for subsequent pretty printing and so on.
+ *
+ */
+struct FragmentationLongRangeResults
+{
+  /** Constructor for class FragmentationLongRangeResults, based on KeySets.
+   *
+   * @param fragmentData results from short-range fragment calculations
+   * @param longrangeData results from long-range fragment calculations
+   * @param _KeySet KeySets of all (non-hydrogen) atoms
+   * @param _ForceKeySet KeySets of all atoms except those added by saturation
+   */
+  FragmentationLongRangeResults(
+      const std::map<JobId_t,MPQCData> &fragmentData,
+      std::map<JobId_t,VMGData> &longrangeData,
+      const KeySetsContainer& _KeySet,
+      const KeySetsContainer& _ForceKeySet);
+
+  /** Performs the summation and fills all result vectors.
+   *
+   * @param fragmentData results from short-range fragment calculations
+   * @param longrangeData results from long-range fragment calculations
+   * @param fullsolutionData long-range solution
+   * @param full_sample sampled density
+   */
+  void operator()(
+      const std::map<JobId_t,MPQCData> &fragmentData,
+      std::map<JobId_t,VMGData> &longrangeData,
+      const std::vector<VMGData> &fullsolutionData,
+      const std::vector<SamplingGrid> &full_sample);
+
+  size_t getMaxLevel() const {
+    return MaxLevel;
+  }
+
+  IndexSetContainer::Container_t getContainer() const {
+    return container->getContainer();
+  }
+
+  const KeySetsContainer& getKeySet() const {
+    return KeySet;
+  }
+
+  const KeySetsContainer& getForceKeySet() const {
+    return ForceKeySet;
+  }
+
+private:
+  std::map< JobId_t, size_t > MPQCMatrixNrLookup;
+  std::map< JobId_t, size_t > VMGMatrixNrLookup;
+  KeySetsContainer KeySet;
+  KeySetsContainer ForceKeySet;
+  IndexSetContainer::ptr container;
+  SubsetMap::ptr subsetmap;
+
+public:
+  //!> results per level of summed up sampled grid charge
+  std::vector<MPQCDataGridMap_t> Result_Grid_fused;
+  //!> results per level of summed up fragment positions and charges
+  std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused;
+  //!> results per level of summed up long range potential grids and energy
+  std::vector<VMGDataMap_t> Result_LongRange_fused;
+  //!> results per level of summed up long range true energy
+  std::vector<VMGDataLongRangeMap_t> Result_LongRangeIntegrated_fused;
+
+  //!> results per IndexSet of summed up sampled grid charge
+  std::map<IndexSet::ptr, std::pair<MPQCDataGridMap_t,MPQCDataGridMap_t> > Result_perIndexSet_Grid;
+  //!> results per IndexSet of summed up fragment positions and charges
+  std::map<IndexSet::ptr, std::pair<MPQCDataFragmentMap_t,MPQCDataFragmentMap_t> > Result_perIndexSet_Fragment;
+  //!> results per IndexSet of summed up long range potential grids and energy
+  std::map<IndexSet::ptr, std::pair<VMGDataMap_t, VMGDataMap_t> > Result_perIndexSet_LongRange;
+  // we don't need the map pendant for Result_LongRangeIntegrated_fused, as this
+  // quantity makes sense only level-wise
+
+private:
+  //!> maximum level of summation
+  size_t MaxLevel;
+};
+
+
+#endif /* FRAGMENTATIONLONGRANGERESULTS_HPP_ */
Index: src/Fragmentation/Automation/FragmentationResults.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentationResults.cpp	(revision 503acc1d5410844da8877333a7e128ad0a2ab6ee)
+++ 	(revision )
@@ -1,207 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * 
- *
- *   This file is part of MoleCuilder.
- *
- *    MoleCuilder is free software: you can redistribute it and/or modify
- *    it under the terms of the GNU General Public License as published by
- *    the Free Software Foundation, either version 2 of the License, or
- *    (at your option) any later version.
- *
- *    MoleCuilder is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *    GNU General Public License for more details.
- *
- *    You should have received a copy of the GNU General Public License
- *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * FragmentationResults.cpp
- *
- *  Created on: Aug 31, 2012
- *      Author: heber
- */
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "FragmentationResults.hpp"
-
-#include <boost/mpl/for_each.hpp>
-#include <boost/mpl/remove.hpp>
-#include <sstream>
-
-#include "CodePatterns/Assert.hpp"
-#include "CodePatterns/Log.hpp"
-
-#include "Fragmentation/Converter/DataConverter.hpp"
-#include "Fragmentation/KeySetsContainer.hpp"
-#include "Fragmentation/Automation/createMatrixNrLookup.hpp"
-#include "Fragmentation/Automation/extractJobIds.hpp"
-#include "Fragmentation/Automation/parseKeySetFile.hpp"
-#include "Fragmentation/Summation/AllLevelOrthogonalSummator.hpp"
-#include "Fragmentation/Summation/IndexSetContainer.hpp"
-#include "Fragmentation/Summation/OrthogonalSumUpPerLevel.hpp"
-#include "Fragmentation/Summation/SubsetMap.hpp"
-#include "Fragmentation/Summation/SumUpPerLevel.hpp"
-
-#include "Helpers/defs.hpp"
-
-FragmentationResults::FragmentationResults(
-    const std::map<JobId_t,MPQCData> &fragmentData,
-    std::map<JobId_t,VMGData> &longrangeData,
-    const KeySetsContainer& _KeySet,
-    const KeySetsContainer& _ForceKeySet) :
-    KeySet(_KeySet),
-    ForceKeySet(_ForceKeySet)
-{
-  // create lookup from job nr to fragment number
-  size_t MPQCFragmentCounter = 0;
-  const std::vector<JobId_t> mpqcjobids = extractJobIds<MPQCData>(fragmentData);
-  MPQCMatrixNrLookup =
-      createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter);
-
-  size_t VMGFragmentCounter = 0;
-  const std::vector<JobId_t> vmgjobids = extractJobIds<VMGData>(longrangeData);
-  VMGMatrixNrLookup =
-      createMatrixNrLookup(vmgjobids, VMGFragmentCounter);
-
-  // convert KeySetContainer to IndexSetContainer
-  container.reset(new IndexSetContainer(KeySet));
-  // create the map of all keysets
-  subsetmap.reset(new SubsetMap(*container));
-}
-
-void FragmentationResults::operator()(
-    const std::map<JobId_t,MPQCData> &fragmentData,
-    std::map<JobId_t,VMGData> &longrangeData,
-    const std::vector<VMGData> &fullsolutionData,
-    const std::vector<SamplingGrid> &full_sample)
-{
-  MaxLevel = subsetmap->getMaximumSetLevel();
-  LOG(1, "INFO: Summing up results till level " << MaxLevel << ".");
-  /// convert all MPQCData to MPQCDataMap_t
-  {
-    ASSERT( ForceKeySet.KeySets.size() == fragmentData.size(),
-        "FragmentationResults::FragmentationResults() - ForceKeySet's KeySets and fragmentData differ in size.");
-
-    typedef boost::mpl::remove<MPQCDataEnergyVector_t, MPQCDataFused::energy_eigenvalues>::type MPQCDataEnergyVector_noeigenvalues_t;
-    OrthogonalSumUpPerLevel<MPQCDataEnergyMap_t, MPQCData, MPQCDataEnergyVector_t>(
-        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
-        Result_Energy_fused, Result_perIndexSet_Energy);
-    OrthogonalSumUpPerLevel<MPQCDataGridMap_t, MPQCData, MPQCDataGridVector_t>(
-        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
-        Result_Grid_fused, Result_perIndexSet_Grid);
-    SumUpPerLevel<MPQCDataTimeMap_t, MPQCData, MPQCDataTimeVector_t>(
-        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
-        Result_Time_fused, Result_perIndexSet_Time);
-    OrthogonalSumUpPerLevel<MPQCDataFragmentMap_t, MPQCData, MPQCDataFragmentVector_t>(
-        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
-        Result_Fragment_fused, Result_perIndexSet_Fragment);
-
-    // multiply each short-range potential with the respective charge
-    std::map<JobId_t,MPQCData>::const_iterator mpqciter = fragmentData.begin();
-    std::map<JobId_t,VMGData>::iterator vmgiter = longrangeData.begin();
-    for (; vmgiter != longrangeData.end(); ++mpqciter, ++vmgiter) {
-      vmgiter->second.sampled_potential *= mpqciter->second.sampled_grid;
-    }
-    // then sum up
-    OrthogonalSumUpPerLevel<VMGDataMap_t, VMGData, VMGDataVector_t>(
-        longrangeData, VMGMatrixNrLookup, container, subsetmap,
-        Result_LongRange_fused, Result_perIndexSet_LongRange);
-
-    // force has extra data converter
-    std::map<JobId_t, MPQCDataForceMap_t> MPQCData_Force_fused;
-    convertMPQCDatatoForceMap(fragmentData, ForceKeySet, MPQCData_Force_fused);
-    Result_Force_fused.resize(MaxLevel); // we need the results of correct size already
-    AllLevelOrthogonalSummator<MPQCDataForceMap_t> forceSummer(
-                subsetmap,
-                MPQCData_Force_fused,
-                container->getContainer(),
-                MPQCMatrixNrLookup,
-                Result_Force_fused,
-                Result_perIndexSet_Force);
-    boost::mpl::for_each<MPQCDataForceVector_t>(boost::ref(forceSummer));
-
-    Result_LongRangeIntegrated_fused.reserve(MaxLevel);
-    {
-      // NOTE: potential for level 1 is not calculated as saturation hydrogen
-      // are not removed on this level yet
-      VMGDataLongRangeMap_t instance;
-      boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) = 0.;
-      boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) = 0.;
-      boost::fusion::at_key<VMGDataFused::nuclei_longrange>(instance) = 0.;
-      boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance) = 0.;
-      boost::fusion::at_key<VMGDataFused::total_longrange>(instance) = 0.;
-      boost::fusion::at_key<VMGDataFused::total_shortrange>(instance) = 0.;
-      Result_LongRangeIntegrated_fused.push_back(instance);
-    }
-    for (size_t level = 2; level <= MaxLevel; ++level) {
-      // we have to fill in the remainder values in the LongRangeMap by hand
-      // weight times correct charge density of the same level
-      const SamplingGrid &charge_weight =
-          boost::fusion::at_key<MPQCDataFused::sampled_grid>(Result_Grid_fused[level-1]);
-      SamplingGrid full_sample_solution = fullsolutionData[level-2].sampled_potential;
-      full_sample_solution *= charge_weight;
-      const SamplingGrid &short_range_correction =
-          boost::fusion::at_key<VMGDataFused::sampled_potential>(Result_LongRange_fused[level-1]);
-      full_sample_solution -= short_range_correction;
-      double full_solution_energy = fullsolutionData[level-2].e_long;
-      const double short_range_energy =
-          boost::fusion::at_key<VMGDataFused::energy_long>(Result_LongRange_fused[level-1]);
-      full_solution_energy -= short_range_energy;
-
-      // multiply element-wise with charge distribution
-      VMGDataLongRangeMap_t instance;
-      boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) = .5*full_sample_solution.integral();
-//      LOG(0, "Remaining long-range potential integral of level " << level << " is "
-//          << full_sample_solution.integral() << ".");
-      boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) = .5*short_range_correction.integral();
-//      LOG(0, "Short-range correction potential integral of level " << level << " is "
-//          << short_range_correction.integral() << ".");
-      boost::fusion::at_key<VMGDataFused::nuclei_longrange>(instance) = full_solution_energy;
-//      LOG(0, "Remaining long-range energy from potential integral of level " << level << " is "
-//          << full_solution_energy << ".");
-      boost::fusion::at_key<VMGDataFused::nuclei_shortrange>(instance) = short_range_energy;
-//      LOG(0, "Short-range correction energy from potential integral of level " << level << " is "
-//          << short_range_energy << ".");
-      boost::fusion::at_key<VMGDataFused::total_longrange>(instance) =
-          boost::fusion::at_key<VMGDataFused::electron_longrange>(instance) - full_solution_energy;
-      boost::fusion::at_key<VMGDataFused::total_shortrange>(instance) =
-          boost::fusion::at_key<VMGDataFused::electron_shortrange>(instance) - short_range_energy;
-      Result_LongRangeIntegrated_fused.push_back(instance);
-    }
-//    {
-//      //    LOG(0, "Remaining long-range energy from energy_potential is " << full_sample_solution.integral()-epotentialSummer.getFullContribution() << ".");
-//      SamplingGrid full_sample_solution = fullsolutionData.back().sampled_potential;
-//      const SamplingGrid &short_range_correction =
-//          boost::fusion::at_key<VMGDataFused::sampled_potential>(Result_LongRange_fused.back()).getFullContribution();
-//      full_sample_solution -= short_range_correction;
-//      // multiply element-wise with charge distribution
-//      LOG(0, "Remaining long-range potential integral is " << full_sample_solution.integral() << ".");
-//      LOG(0, "Short-range correction potential integral of level is " << short_range_correction.integral() << ".");
-//      LOG(0, "Remaining long-range energy from potential integral is "
-//          << full_sample_solution.integral(full_sample.back()) << ".");
-//      LOG(0, "Short-range correction energy from potential integral is "
-//          << short_range_correction.integral(full_sample.back()) << ".");
-//
-//      double e_long = fullsolutionData.back().e_long;
-//      e_long -= boost::fusion::at_key<VMGDataFused::energy_long>(Result_LongRange_fused.back()).getFullContribution();
-//      LOG(0, "Remaining long-range energy is " << e_long << ".");
-//    }
-
-    // TODO: Extract long-range corrections to forces
-    // NOTE: potential is in atomic length units, NOT IN ANGSTROEM!
-
-  }
-}
Index: src/Fragmentation/Automation/FragmentationResults.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentationResults.hpp	(revision 503acc1d5410844da8877333a7e128ad0a2ab6ee)
+++ 	(revision )
@@ -1,130 +1,0 @@
-/*
- * FragmentationResults.hpp
- *
- *  Created on: Aug 31, 2012
- *      Author: heber
- */
-
-#ifndef FRAGMENTATIONRESULTS_HPP_
-#define FRAGMENTATIONRESULTS_HPP_
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <map>
-#include <vector>
-
-#include "JobMarket/types.hpp"
-
-#include "Fragmentation/KeySetsContainer.hpp"
-#include "Fragmentation/Summation/IndexSet.hpp"
-#include "Fragmentation/Summation/IndexSetContainer.hpp"
-#include "Fragmentation/Summation/SubsetMap.hpp"
-
-#include "Jobs/MPQCData.hpp"
-#include "Jobs/MPQCDataMap.hpp"
-#include "Jobs/VMGData.hpp"
-#include "Jobs/VMGDataMap.hpp"
-#include "Jobs/Grid/SamplingGrid.hpp"
-
-/** FragmentationResults contains the summed up results per level resulting
- * from the fragmentation of the molecular system and clever combination of
- * fragmentary energies, forces, timings, and so on.
- *
- * This structure is mostly a storage wherein the summed up results are
- * contained for subsequent pretty printing and so on.
- *
- */
-struct FragmentationResults
-{
-  /** Constructor for class FragmentationResults, based on KeySets.
-   *
-   * @param fragmentData results from short-range fragment calculations
-   * @param longrangeData results from long-range fragment calculations
-   * @param _KeySet KeySets of all (non-hydrogen) atoms
-   * @param _ForceKeySet KeySets of all atoms except those added by saturation
-   */
-  FragmentationResults(
-      const std::map<JobId_t,MPQCData> &fragmentData,
-      std::map<JobId_t,VMGData> &longrangeData,
-      const KeySetsContainer& _KeySet,
-      const KeySetsContainer& _ForceKeySet);
-
-  /** Performs the summation and fills all result vectors.
-   *
-   * @param fragmentData results from short-range fragment calculations
-   * @param longrangeData results from long-range fragment calculations
-   * @param fullsolutionData long-range solution
-   * @param full_sample sampled density
-   */
-  void operator()(
-      const std::map<JobId_t,MPQCData> &fragmentData,
-      std::map<JobId_t,VMGData> &longrangeData,
-      const std::vector<VMGData> &fullsolutionData,
-      const std::vector<SamplingGrid> &full_sample);
-
-  size_t getMaxLevel() const {
-    return MaxLevel;
-  }
-
-  IndexSetContainer::Container_t getContainer() const {
-    return container->getContainer();
-  }
-
-  const KeySetsContainer& getKeySet() const {
-    return KeySet;
-  }
-
-  const KeySetsContainer& getForceKeySet() const {
-    return ForceKeySet;
-  }
-
-private:
-  std::map< JobId_t, size_t > MPQCMatrixNrLookup;
-  std::map< JobId_t, size_t > VMGMatrixNrLookup;
-  KeySetsContainer KeySet;
-  KeySetsContainer ForceKeySet;
-  IndexSetContainer::ptr container;
-  SubsetMap::ptr subsetmap;
-
-public:
-  //!> results per level of summed up energy
-  std::vector<MPQCDataEnergyMap_t> Result_Energy_fused;
-  //!> results per level of summed up sampled grid charge
-  std::vector<MPQCDataGridMap_t> Result_Grid_fused;
-  //!> results per level of summed up times
-  std::vector<MPQCDataTimeMap_t> Result_Time_fused;
-  //!> results per level of summed up fragment positions and charges
-  std::vector<MPQCDataFragmentMap_t> Result_Fragment_fused;
-  //!> results per level of summed up forces
-  std::vector<MPQCDataForceMap_t> Result_Force_fused;
-  //!> results per level of summed up long range potential grids and energy
-  std::vector<VMGDataMap_t> Result_LongRange_fused;
-  //!> results per level of summed up long range true energy
-  std::vector<VMGDataLongRangeMap_t> Result_LongRangeIntegrated_fused;
-
-  //!> results per IndexSet of summed up energy
-  std::map<IndexSet::ptr, std::pair<MPQCDataEnergyMap_t,MPQCDataEnergyMap_t> > Result_perIndexSet_Energy;
-  //!> results per IndexSet of summed up sampled grid charge
-  std::map<IndexSet::ptr, std::pair<MPQCDataGridMap_t,MPQCDataGridMap_t> > Result_perIndexSet_Grid;
-  //!> results per IndexSet of summed up times
-  std::map<IndexSet::ptr, std::pair<MPQCDataTimeMap_t,MPQCDataTimeMap_t> > Result_perIndexSet_Time;
-  //!> results per IndexSet of summed up fragment positions and charges
-  std::map<IndexSet::ptr, std::pair<MPQCDataFragmentMap_t,MPQCDataFragmentMap_t> > Result_perIndexSet_Fragment;
-  //!> results per IndexSet of summed up forces
-  std::map<IndexSet::ptr, std::pair<MPQCDataForceMap_t, MPQCDataForceMap_t> > Result_perIndexSet_Force;
-  //!> results per IndexSet of summed up long range potential grids and energy
-  std::map<IndexSet::ptr, std::pair<VMGDataMap_t, VMGDataMap_t> > Result_perIndexSet_LongRange;
-  // we don't need the map pendant for Result_LongRangeIntegrated_fused, as this
-  // quantity makes sense only level-wise
-
-private:
-  //!> maximum level of summation
-  size_t MaxLevel;
-};
-
-
-#endif /* FRAGMENTATIONRESULTS_HPP_ */
Index: src/Fragmentation/Automation/FragmentationShortRangeResults.cpp
===================================================================
--- src/Fragmentation/Automation/FragmentationShortRangeResults.cpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
+++ src/Fragmentation/Automation/FragmentationShortRangeResults.cpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
@@ -0,0 +1,110 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2013 University of Bonn. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * FragmentationShortRangeResults.cpp
+ *
+ *  Created on: Mar 07, 2013
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "FragmentationShortRangeResults.hpp"
+
+#include <boost/mpl/for_each.hpp>
+#include <boost/mpl/remove.hpp>
+#include <sstream>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "Fragmentation/Converter/DataConverter.hpp"
+#include "Fragmentation/KeySetsContainer.hpp"
+#include "Fragmentation/Automation/createMatrixNrLookup.hpp"
+#include "Fragmentation/Automation/extractJobIds.hpp"
+#include "Fragmentation/Automation/parseKeySetFile.hpp"
+#include "Fragmentation/Summation/AllLevelOrthogonalSummator.hpp"
+#include "Fragmentation/Summation/IndexSetContainer.hpp"
+#include "Fragmentation/Summation/OrthogonalSumUpPerLevel.hpp"
+#include "Fragmentation/Summation/SubsetMap.hpp"
+#include "Fragmentation/Summation/SumUpPerLevel.hpp"
+
+#include "Helpers/defs.hpp"
+
+FragmentationShortRangeResults::FragmentationShortRangeResults(
+    const std::map<JobId_t,MPQCData> &fragmentData,
+    const KeySetsContainer& _KeySet,
+    const KeySetsContainer& _ForceKeySet) :
+    KeySet(_KeySet),
+    ForceKeySet(_ForceKeySet)
+{
+  // create lookup from job nr to fragment number
+  size_t MPQCFragmentCounter = 0;
+  const std::vector<JobId_t> mpqcjobids = extractJobIds<MPQCData>(fragmentData);
+  MPQCMatrixNrLookup =
+      createMatrixNrLookup(mpqcjobids, MPQCFragmentCounter);
+
+  // convert KeySetContainer to IndexSetContainer
+  container.reset(new IndexSetContainer(KeySet));
+  // create the map of all keysets
+  subsetmap.reset(new SubsetMap(*container));
+}
+
+void FragmentationShortRangeResults::operator()(
+    const std::map<JobId_t,MPQCData> &fragmentData)
+{
+  MaxLevel = subsetmap->getMaximumSetLevel();
+  LOG(1, "INFO: Summing up results till level " << MaxLevel << ".");
+  /// convert all MPQCData to MPQCDataMap_t
+  {
+    ASSERT( ForceKeySet.KeySets.size() == fragmentData.size(),
+        "FragmentationShortRangeResults::FragmentationShortRangeResults() - ForceKeySet's KeySets and fragmentData differ in size.");
+
+    typedef boost::mpl::remove<MPQCDataEnergyVector_t, MPQCDataFused::energy_eigenvalues>::type MPQCDataEnergyVector_noeigenvalues_t;
+    OrthogonalSumUpPerLevel<MPQCDataEnergyMap_t, MPQCData, MPQCDataEnergyVector_t>(
+        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
+        Result_Energy_fused, Result_perIndexSet_Energy);
+    SumUpPerLevel<MPQCDataTimeMap_t, MPQCData, MPQCDataTimeVector_t>(
+        fragmentData, MPQCMatrixNrLookup, container, subsetmap,
+        Result_Time_fused, Result_perIndexSet_Time);
+
+    // force has extra data converter
+    std::map<JobId_t, MPQCDataForceMap_t> MPQCData_Force_fused;
+    convertMPQCDatatoForceMap(fragmentData, ForceKeySet, MPQCData_Force_fused);
+    Result_Force_fused.resize(MaxLevel); // we need the results of correct size already
+    AllLevelOrthogonalSummator<MPQCDataForceMap_t> forceSummer(
+                subsetmap,
+                MPQCData_Force_fused,
+                container->getContainer(),
+                MPQCMatrixNrLookup,
+                Result_Force_fused,
+                Result_perIndexSet_Force);
+    boost::mpl::for_each<MPQCDataForceVector_t>(boost::ref(forceSummer));
+  }
+}
Index: src/Fragmentation/Automation/FragmentationShortRangeResults.hpp
===================================================================
--- src/Fragmentation/Automation/FragmentationShortRangeResults.hpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
+++ src/Fragmentation/Automation/FragmentationShortRangeResults.hpp	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
@@ -0,0 +1,104 @@
+/*
+ * FragmentationShortRangeResults.hpp
+ *
+ *  Created on: Mar 7, 2013
+ *      Author: heber
+ */
+
+#ifndef FRAGMENTATIONSHORTRANGERESULTS_HPP_
+#define FRAGMENTATIONSHORTRANGERESULTS_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <map>
+#include <vector>
+
+#include "JobMarket/types.hpp"
+
+#include "Fragmentation/KeySetsContainer.hpp"
+#include "Fragmentation/Summation/IndexSet.hpp"
+#include "Fragmentation/Summation/IndexSetContainer.hpp"
+#include "Fragmentation/Summation/SubsetMap.hpp"
+
+#include "Jobs/MPQCData.hpp"
+#include "Jobs/MPQCDataMap.hpp"
+
+/** FragmentationShortRangeResults contains the summed up results per level resulting
+ * from the fragmentation of the molecular system and clever combination of
+ * fragmentary energies, forces, timings, and so on.
+ *
+ * This structure is mostly a storage wherein the summed up results are
+ * contained for subsequent pretty printing and so on.
+ *
+ */
+struct FragmentationShortRangeResults
+{
+  /** Constructor for class FragmentationShortRangeResults, based on KeySets.
+   *
+   * @param fragmentData results from short-range fragment calculations
+   * @param _KeySet KeySets of all (non-hydrogen) atoms
+   * @param _ForceKeySet KeySets of all atoms except those added by saturation
+   */
+  FragmentationShortRangeResults(
+      const std::map<JobId_t,MPQCData> &fragmentData,
+      const KeySetsContainer& _KeySet,
+      const KeySetsContainer& _ForceKeySet);
+
+  /** Performs the summation and fills all result vectors.
+   *
+   * @param fragmentData results from short-range fragment calculations
+   */
+  void operator()(
+      const std::map<JobId_t,MPQCData> &fragmentData);
+
+  size_t getMaxLevel() const {
+    return MaxLevel;
+  }
+
+  IndexSetContainer::Container_t getContainer() const {
+    return container->getContainer();
+  }
+
+  const KeySetsContainer& getKeySet() const {
+    return KeySet;
+  }
+
+  const KeySetsContainer& getForceKeySet() const {
+    return ForceKeySet;
+  }
+
+private:
+  std::map< JobId_t, size_t > MPQCMatrixNrLookup;
+  KeySetsContainer KeySet;
+  KeySetsContainer ForceKeySet;
+  IndexSetContainer::ptr container;
+  SubsetMap::ptr subsetmap;
+
+public:
+  //!> results per level of summed up energy
+  std::vector<MPQCDataEnergyMap_t> Result_Energy_fused;
+  //!> results per level of summed up times
+  std::vector<MPQCDataTimeMap_t> Result_Time_fused;
+  //!> results per level of summed up forces
+  std::vector<MPQCDataForceMap_t> Result_Force_fused;
+
+  //!> results per IndexSet of summed up energy
+  std::map<IndexSet::ptr, std::pair<MPQCDataEnergyMap_t,MPQCDataEnergyMap_t> > Result_perIndexSet_Energy;
+  //!> results per IndexSet of summed up times
+  std::map<IndexSet::ptr, std::pair<MPQCDataTimeMap_t,MPQCDataTimeMap_t> > Result_perIndexSet_Time;
+  //!> results per IndexSet of summed up forces
+  std::map<IndexSet::ptr, std::pair<MPQCDataForceMap_t, MPQCDataForceMap_t> > Result_perIndexSet_Force;
+  // we don't need the map pendant for Result_LongRangeIntegrated_fused, as this
+  // quantity makes sense only level-wise
+
+private:
+  //!> maximum level of summation
+  size_t MaxLevel;
+};
+
+
+#endif /* FRAGMENTATIONSHORTRANGERESULTS_HPP_ */
Index: src/Fragmentation/Automation/Makefile.am
===================================================================
--- src/Fragmentation/Automation/Makefile.am	(revision 503acc1d5410844da8877333a7e128ad0a2ab6ee)
+++ src/Fragmentation/Automation/Makefile.am	(revision 0cd8cf709454eaffa0f432ef7e53ded096c624a4)
@@ -5,5 +5,6 @@
 	Fragmentation/Automation/createMatrixNrLookup.cpp \
 	Fragmentation/Automation/FragmentationChargeDensity.cpp \
-	Fragmentation/Automation/FragmentationResults.cpp \
+	Fragmentation/Automation/FragmentationLongRangeResults.cpp \
+	Fragmentation/Automation/FragmentationShortRangeResults.cpp \
 	Fragmentation/Automation/FragmentJobQueue.cpp \
 	Fragmentation/Automation/MPQCFragmentController.cpp \
@@ -21,5 +22,6 @@
 	Fragmentation/Automation/extractJobIds.hpp \
 	Fragmentation/Automation/FragmentationChargeDensity.hpp \
-	Fragmentation/Automation/FragmentationResults.hpp \
+	Fragmentation/Automation/FragmentationLongRangeResults.hpp \
+	Fragmentation/Automation/FragmentationShortRangeResults.hpp \
 	Fragmentation/Automation/FragmentJobQueue.hpp \
 	Fragmentation/Automation/MPQCFragmentController.hpp \
