Index: src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 56df379c672f095aa9b6ac364949cfa8c0ba57d5)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 8cae4c222d38d45129885e5a2edc6e31879577de)
@@ -59,4 +59,5 @@
 #include "Jobs/MPQCJob.hpp"
 #include "Jobs/MPQCData.hpp"
+#include "Jobs/MPQCData_printName.hpp"
 #include "molecule.hpp"
 #include "World.hpp"
@@ -65,4 +66,6 @@
 #include <string>
 #include <vector>
+
+#include <boost/mpl/for_each.hpp>
 
 #include "Actions/FragmentationAction/FragmentationAutomationAction.hpp"
@@ -138,4 +141,40 @@
 }
 
+
+template <typename MapType>
+struct printSum {
+  printSum(
+      SubsetMap::ptr &_subsetmap,
+      const std::vector<MapType> &_data,
+      const std::vector<JobId_t> &_jobids,
+      const IndexSetContainer::Container_t &_container,
+      std::map< JobId_t, size_t > &_MatrixNrLookup) : /* cannot make this const due to operator[] */
+    subsetmap(_subsetmap),
+    data(_data),
+    jobids(_jobids),
+    container(_container),
+    MatrixNrLookup(_MatrixNrLookup)
+  {}
+  template <typename MapKey>
+  void operator()(MapKey &) {
+    Summator<MapType, MapKey> sum_value(
+        subsetmap, data, jobids, container, MatrixNrLookup
+        );
+    double value = sum_value();
+    LOG(0, "STATUS: Resulting " << MPQCDataNames::printName<MapKey>() << " is " << value << ".");
+  }
+
+private:
+  //!> Hierarchy of IndexSet's
+  SubsetMap::ptr &subsetmap;
+  //!> vector of data converted from MPQCData
+  const std::vector<MapType> &data;
+  //!> vector of jobids
+  const std::vector<JobId_t> &jobids;
+  //!> container with all IndexSet's
+  const IndexSetContainer::Container_t &container;
+  //!> lookup map from job ids to ordering in above vectors
+  std::map< JobId_t, size_t > MatrixNrLookup;
+};
 
 /** Print MPQCData from received results.
@@ -276,79 +315,92 @@
   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();
-  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 << ".");
-//  }
+  {
+    /// convert all MPQCData to MPQCDataMap_t
+
+    // energy_t
+    std::vector<MPQCDataEnergyMap_t> MPQCData_Energy_fused;
+    MPQCData_Energy_fused.reserve(fragmentData.size());
+    for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+        dataiter != fragmentData.end(); ++dataiter) {
+      const MPQCData &extractedData = *dataiter;
+      LOG(2, "DEBUG: Current extracted Data is " << extractedData << ".");
+      MPQCDataEnergyMap_t instance;
+      boost::fusion::at_key<MPQCDataFused::energy_total>(instance) = extractedData.energies.total;
+      boost::fusion::at_key<MPQCDataFused::energy_nuclear_repulsion>(instance) = extractedData.energies.nuclear_repulsion;
+      boost::fusion::at_key<MPQCDataFused::energy_electron_repulsion>(instance) = extractedData.energies.electron_repulsion;
+      boost::fusion::at_key<MPQCDataFused::energy_correlation>(instance) = extractedData.energies.correlation;
+      boost::fusion::at_key<MPQCDataFused::energy_overlap>(instance) = extractedData.energies.overlap;
+      boost::fusion::at_key<MPQCDataFused::energy_kinetic>(instance) = extractedData.energies.kinetic;
+      boost::fusion::at_key<MPQCDataFused::energy_hcore>(instance) = extractedData.energies.hcore;
+  //    boost::fusion::at_key<MPQCDataFused::energy_eigenvalues>(instance) = extractedData.energies.eigenvalues;
+      MPQCData_Energy_fused.push_back(instance);
+    }
+
+    // forces
+    std::vector<MPQCDataForceMap_t> MPQCData_Force_fused;
+    MPQCData_Force_fused.reserve(fragmentData.size());
+    for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+        dataiter != fragmentData.end(); ++dataiter) {
+      const MPQCData &extractedData = *dataiter;
+      LOG(2, "DEBUG: Current extracted Data is " << extractedData << ".");
+      MPQCDataForceMap_t instance;
+      boost::fusion::at_key<MPQCDataFused::forces>(instance) = extractedData.forces;
+      MPQCData_Force_fused.push_back(instance);
+    }
+
+    // times
+    std::vector<MPQCDataTimeMap_t> MPQCData_Time_fused;
+    MPQCData_Time_fused.reserve(fragmentData.size());
+    for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+        dataiter != fragmentData.end(); ++dataiter) {
+      const MPQCData &extractedData = *dataiter;
+      LOG(2, "DEBUG: Current extracted Data is " << extractedData << ".");
+      MPQCDataTimeMap_t instance;
+      boost::fusion::at_key<MPQCDataFused::times_walltime>(instance) = extractedData.times.walltime;
+      boost::fusion::at_key<MPQCDataFused::times_cputime>(instance) = extractedData.times.cputime;
+      boost::fusion::at_key<MPQCDataFused::times_flops>(instance) = extractedData.times.flops;
+      MPQCData_Time_fused.push_back(instance);
+    }
+
+    // create a vector of all 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::operator->, _1)));
+
+    // sum up and print energies
+    boost::mpl::for_each<MPQCDataEnergyVector_t>(
+        printSum<MPQCDataEnergyMap_t>(
+            subsetmap,
+            MPQCData_Energy_fused,
+            jobids,
+            container->getContainer(),
+            MatrixNrLookup)
+        );
+    // TODO: Histogram still needs cstor taking just vector<double>
+
+
+    // TODO: We need to put forces into specific class and implement operators
+//    // sum up and print forces
+//    boost::mpl::for_each<MPQCDataForceVector_t>(
+//        printSum<MPQCDataForceMap_t>(
+//            subsetmap,
+//            MPQCData_Force_fused,
+//            jobids,
+//            container->getContainer(),
+//            MatrixNrLookup)
+//        );
+
+    // TODO: Times should just be summed not orthogonalized
+//    // sum up and print times
+//    boost::mpl::for_each<MPQCDataTimeVector_t>(
+//        printSum<MPQCDataTimeMap_t>(
+//            subsetmap,
+//            MPQCData_Time_fused,
+//            jobids,
+//            container->getContainer(),
+//            MatrixNrLookup)
+//        );
+  }
 
   // combine all found data
Index: src/Jobs/MPQCDataFused.hpp
===================================================================
--- src/Jobs/MPQCDataFused.hpp	(revision 56df379c672f095aa9b6ac364949cfa8c0ba57d5)
+++ src/Jobs/MPQCDataFused.hpp	(revision 8cae4c222d38d45129885e5a2edc6e31879577de)
@@ -19,12 +19,27 @@
  * generic algorithms to work on it.
  *
- *
+ * \note forward declarations are not enough as we need the true (but empty)
+ * instance when going throughb the list with boost::mpl::for_each.
  */
 namespace MPQCDataFused {
-  struct energy_total;
-  struct energy_eigenvalues;
-  struct forces;
-  struct times_walltime;
+  // keys for energy_t
+  struct energy_total {};
+  struct energy_nuclear_repulsion {};
+  struct energy_electron_repulsion {};
+  struct energy_correlation {};
+  struct energy_overlap {};
+  struct energy_kinetic {};
+  struct energy_hcore {};
+  struct energy_eigenvalues {};
+
+  // keys for forces
+  struct forces {};
+
+  // keys for times_t
+  struct times_walltime {};
+  struct times_cputime {};
+  struct times_flops {};
 }
 
+
 #endif /* MPQCDATAFUSED_HPP_ */
Index: src/Jobs/MPQCDataMap.hpp
===================================================================
--- src/Jobs/MPQCDataMap.hpp	(revision 56df379c672f095aa9b6ac364949cfa8c0ba57d5)
+++ src/Jobs/MPQCDataMap.hpp	(revision 8cae4c222d38d45129885e5a2edc6e31879577de)
@@ -15,9 +15,15 @@
 
 #include <boost/fusion/container/map.hpp>
+#include <boost/mpl/list.hpp>
 
 #include "Jobs/MPQCDataFused.hpp"
 
+class Histogram;
+
+/// \note: We had to split up the map because boost::fusion only allows for
+/// up to 9 template types.
+
 /** This boost::fusion map defines key-value or rather key-type pairs with
- * which we associate data members in MPQCData and their type.
+ * which we associate all energy_t data members in MPQCData and their type.
  *
  * This lets us resolves any ambiguitites of types in MPQCData, e.g.
@@ -27,8 +33,57 @@
 typedef boost::fusion::map<
     boost::fusion::pair<MPQCDataFused::energy_total, double>
+  ,  boost::fusion::pair<MPQCDataFused::energy_nuclear_repulsion, double>
+  ,  boost::fusion::pair<MPQCDataFused::energy_electron_repulsion, double>
+  ,  boost::fusion::pair<MPQCDataFused::energy_correlation, double>
+  ,  boost::fusion::pair<MPQCDataFused::energy_overlap, double>
+  ,  boost::fusion::pair<MPQCDataFused::energy_kinetic, double>
+  ,  boost::fusion::pair<MPQCDataFused::energy_hcore, double>
   ,  boost::fusion::pair<MPQCDataFused::energy_eigenvalues, Histogram >
-  ,  boost::fusion::pair<MPQCDataFused::forces, std::vector< std::vector<double> > >
-  ,  boost::fusion::pair<MPQCDataFused::times_walltime, double> >
-MPQCDataMap_t;
+> MPQCDataEnergyMap_t;
+
+typedef boost::mpl::list<
+    MPQCDataFused::energy_total,
+    MPQCDataFused::energy_nuclear_repulsion,
+    MPQCDataFused::energy_electron_repulsion,
+    MPQCDataFused::energy_correlation,
+    MPQCDataFused::energy_overlap,
+    MPQCDataFused::energy_kinetic,
+    MPQCDataFused::energy_hcore /*,
+    MPQCDataFused::energy_eigenvalues */
+> MPQCDataEnergyVector_t;
+
+/** This boost::fusion map defines key-value or rather key-type pairs with
+ * which we associate all forces data members in MPQCData and their type.
+ *
+ * This lets us resolves any ambiguitites of types in MPQCData, e.g.
+ * to know vector<double> is forces or energy_eigenvalues.
+ *
+ */
+typedef boost::fusion::map<
+  boost::fusion::pair<MPQCDataFused::forces, std::vector< std::vector<double> > >
+> MPQCDataForceMap_t;
+
+typedef boost::mpl::list<
+    MPQCDataFused::forces
+> MPQCDataForceVector_t;
+
+/** This boost::fusion map defines key-value or rather key-type pairs with
+ * which we associate all times_t data members in MPQCData and their type.
+ *
+ * This lets us resolves any ambiguitites of types in MPQCData, e.g.
+ * to know vector<double> is forces or energy_eigenvalues.
+ *
+ */
+typedef boost::fusion::map<
+  boost::fusion::pair<MPQCDataFused::times_walltime, double >
+  , boost::fusion::pair<MPQCDataFused::times_cputime, double >
+  , boost::fusion::pair<MPQCDataFused::times_flops, double >
+> MPQCDataTimeMap_t;
+
+typedef boost::mpl::list<
+    MPQCDataFused::times_walltime,
+    MPQCDataFused::times_cputime,
+    MPQCDataFused::times_flops
+> MPQCDataTimeVector_t;
 
 #endif /* MPQCDATAMAP_HPP_ */
Index: src/Jobs/MPQCData_printName.hpp
===================================================================
--- src/Jobs/MPQCData_printName.hpp	(revision 8cae4c222d38d45129885e5a2edc6e31879577de)
+++ src/Jobs/MPQCData_printName.hpp	(revision 8cae4c222d38d45129885e5a2edc6e31879577de)
@@ -0,0 +1,86 @@
+/*
+ * MPQCData_printName.hpp
+ *
+ *  Created on: 28.07.2012
+ *      Author: heber
+ */
+
+#ifndef MPQCDATA_PRINTNAME_HPP_
+#define MPQCDATA_PRINTNAME_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+//#include <iosfwd>
+#include <string>
+
+#include <boost/preprocessor/iteration/local.hpp>
+#include <boost/preprocessor/seq/elem.hpp>
+#include <boost/preprocessor/seq/seq.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/stringize.hpp>
+
+/** this is the boost::preprocessor::sequence of the keys in the boost::fusion::map
+ *
+ * Basically, every key appears here in brackets. If so, then the preprocessor magic
+ * below will create a template specialization of the printName() function in the
+ * namespace MPQCDataNames.
+ */
+#define tokensequence \
+  (energy_total) \
+	(energy_nuclear_repulsion) \
+	(energy_electron_repulsion) \
+	(energy_correlation) \
+	(energy_overlap) \
+	(energy_kinetic) \
+	(energy_hcore) \
+	(energy_eigenvalues) \
+	(forces) \
+	(times_walltime) \
+	(times_cputime) \
+	(times_flops)
+
+/// we take note of the number of keys in tokensequence as (local) loop bounds below
+#ifndef tokensequence
+#define MAXTOKENS 0
+#else
+#define MAXTOKENS BOOST_PP_SEQ_SIZE(tokensequence)
+#endif
+
+//!> this is the macro function which prints the specialized template function
+#define printName_specializer(z, n, NAMESPACE, TOKENSEQ, NAMESEQ ) \
+  template<> std::string printName< NAMESPACE :: BOOST_PP_SEQ_ELEM( n, TOKENSEQ ) >() { \
+    return std::string( BOOST_PP_STRINGIZE( BOOST_PP_SEQ_ELEM( n, NAMESEQ ) ) ); \
+  }
+
+/** Specific namespace for all the specialized template functions that print
+ * a useful name for each of the boost::fusion::map key.
+ */
+namespace MPQCDataNames {
+
+  /** This function needs to be specialized for every member variable in MPQCData
+   * such that it prints the name of the member variable.
+   *
+   * By default, we just return an empty string.
+   */
+  template <typename T> std::string printName() {
+    return std::string();
+  };
+
+  // iterate (line-wise) over the sequence and spill out a specialized printName
+#if defined tokensequence && defined MAXTOKENS && defined printName_specializer
+#define BOOST_PP_LOCAL_MACRO(n) printName_specializer(~, n, MPQCDataFused, tokensequence, tokensequence)
+#define BOOST_PP_LOCAL_LIMITS  (0, MAXTOKENS-1)
+#include BOOST_PP_LOCAL_ITERATE()
+#endif
+
+}; /* namespace MPQCDataNames */
+
+#undef tokensequence
+#undef printName_specializer
+
+#undef MAXTOKENS
+
+#endif /* MPQCDATA_PRINTNAME_HPP_ */
Index: src/Jobs/Makefile.am
===================================================================
--- src/Jobs/Makefile.am	(revision 56df379c672f095aa9b6ac364949cfa8c0ba57d5)
+++ src/Jobs/Makefile.am	(revision 8cae4c222d38d45129885e5a2edc6e31879577de)
@@ -12,4 +12,5 @@
         Jobs/MPQCDataFused.hpp \
         Jobs/MPQCDataMap.hpp \
+        Jobs/MPQCData_printName.hpp \
         Jobs/MPQCJob.hpp 
 
