Index: src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 965e2fdeb4a01f3b569d70307746f102a48494ab)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 56df379c672f095aa9b6ac364949cfa8c0ba57d5)
@@ -55,6 +55,5 @@
 #include "Fragmentation/KeySet.hpp"
 #include "Fragmentation/KeySetsContainer.hpp"
-#include "Fragmentation/Summation/OrthogonalSummation.hpp"
-#include "Fragmentation/Summation/SetValue.hpp"
+#include "Fragmentation/Summation/Summator.hpp"
 #include "Graph/DepthFirstSearchAnalysis.hpp"
 #include "Jobs/MPQCJob.hpp"
@@ -277,36 +276,79 @@
   SubsetMap::ptr subsetmap(new SubsetMap(*container));
 
+  // convert all MPQCData to MPQCDataMap_t
+  std::vector<MPQCDataMap_t> MPQCData_fused;
+  MPQCData_fused.reserve(fragmentData.size());
+  for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+      dataiter != fragmentData.end(); ++dataiter) {
+    MPQCDataMap_t instance;
+    boost::fusion::at_key<MPQCDataFused::energy_total>(instance) = dataiter->energies.total;
+//    boost::fusion::at_key<MPQCDataFused::energy_eigenvalues>(instance) = dataiter->energies.eigenvalues;
+//    boost::fusion::at_key<MPQCDataFused::forces>(instance) = dataiter->forces;
+//    boost::fusion::at_key<MPQCDataFused::times_walltime>(instance) = dataiter->times.walltime;
+  }
+
+  // get a vector of a job ids
+  std::vector<JobId_t> jobids(results.size(), JobId::IllegalJob);
+//  std::transform(results.begin(), results.end(), jobids.begin(),
+//      boost::bind(&FragmentResult::getId,
+//          boost::bind(&FragmentResult::ptr::, _1)));
+  std::vector<JobId_t>::iterator iditer = jobids.begin();
+  for (std::vector<FragmentResult::ptr>::const_iterator resultiter = results.begin();
+      resultiter != results.end(); ++resultiter) {
+    *iditer = (*resultiter)->getId();
+    ++iditer;
+  }
+
   // associate each index set with its value (do not use the full set, that is also contained!)
   const IndexSetContainer::Container_t &_container = container->getContainer();
-  {
-    OrthogonalSummation<double>::InputSets_t indices(_container.begin(), _container.end()-1);
-    OrthogonalSummation<double>::InputValues_t values(_container.size()-1, 0.);
-    std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
-    std::vector<FragmentResult::ptr>::const_iterator resultiter = results.begin();
-    for (; dataiter != fragmentData.end(); ++dataiter, ++resultiter) {
-      const MPQCData &extractedData = *dataiter;
-      values[ MatrixNrLookup[(*resultiter)->getId()] ] = extractedData.energies.total;
-    }
-
-    // create the summation functor and evaluate
-    OrthogonalSummation<double> OS(indices, values, subsetmap);
-    const double energyresult = OS();
-    LOG(0, "STATUS: Resulting energy is " << energyresult << ".");
-  }
-  {
-    OrthogonalSummation<Histogram>::InputSets_t indices(_container.begin(), _container.end()-1);
-    OrthogonalSummation<Histogram>::InputValues_t values(_container.size()-1);
-    std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
-    std::vector<FragmentResult::ptr>::const_iterator resultiter = results.begin();
-    for (; dataiter != fragmentData.end(); ++dataiter, ++resultiter) {
-      const MPQCData &extractedData = *dataiter;
-      values[ MatrixNrLookup[(*resultiter)->getId()] ] = Histogram(extractedData.energies.eigenvalues, 0., 0.1);
-    }
-
-    // create the summation functor and evaluate
-    OrthogonalSummation<Histogram> OS(indices, values, subsetmap);
-    const Histogram eigenvaluegram = OS();
-    LOG(0, "STATUS: Resulting histogram is " << eigenvaluegram << ".");
-  }
+  Summator<MPQCDataMap_t, MPQCDataFused::energy_total> sum_energy_total(
+      subsetmap,
+      MPQCData_fused,
+      jobids,
+      _container,
+      MatrixNrLookup
+      );
+  double energy_total = sum_energy_total();
+  LOG(0, "STATUS: Resulting total energy is " << energy_total << ".");
+
+  //  Summator<MPQCDataMap_t, MPQCDataFused::energy_eigenvalues> sum_energy_eigenvalues(
+//      subsetmap,
+//      MPQCData_fused,
+//      jobids,
+//      _container,
+//      MatrixNrLookup
+//      );
+
+  // associate each index set with its value (do not use the full set, that is also contained!)
+//  {
+//    OrthogonalSummation<double>::InputSets_t indices(_container.begin(), _container.end()-1);
+//    OrthogonalSummation<double>::InputValues_t values(_container.size()-1, 0.);
+//    std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+//    std::vector<FragmentResult::ptr>::const_iterator resultiter = results.begin();
+//    for (; dataiter != fragmentData.end(); ++dataiter, ++resultiter) {
+//      const MPQCData &extractedData = *dataiter;
+//      values[ MatrixNrLookup[(*resultiter)->getId()] ] = extractedData.energies.total;
+//    }
+//
+//    // create the summation functor and evaluate
+//    OrthogonalSummation<double> OS(indices, values, subsetmap);
+//    const double energyresult = OS();
+//    LOG(0, "STATUS: Resulting energy is " << energyresult << ".");
+//  }
+//  {
+//    OrthogonalSummation<Histogram>::InputSets_t indices(_container.begin(), _container.end()-1);
+//    OrthogonalSummation<Histogram>::InputValues_t values(_container.size()-1);
+//    std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+//    std::vector<FragmentResult::ptr>::const_iterator resultiter = results.begin();
+//    for (; dataiter != fragmentData.end(); ++dataiter, ++resultiter) {
+//      const MPQCData &extractedData = *dataiter;
+//      values[ MatrixNrLookup[(*resultiter)->getId()] ] = Histogram(extractedData.energies.eigenvalues, 0., 0.1);
+//    }
+//
+//    // create the summation functor and evaluate
+//    OrthogonalSummation<Histogram> OS(indices, values, subsetmap);
+//    const Histogram eigenvaluegram = OS();
+//    LOG(0, "STATUS: Resulting histogram is " << eigenvaluegram << ".");
+//  }
 
   // combine all found data
