Index: src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp
===================================================================
--- src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp	(revision a3427f795a607e84365d342681c78b46570d042e)
+++ src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -0,0 +1,359 @@
+/*
+ * 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/>.
+ */
+
+/*
+ * AnalyseFragmentationResultsAction.cpp
+ *
+ *  Created on: Mar 8, 2013
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+// include headers that implement a archive in simple text format
+// and before MemDebug due to placement new
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <boost/mpl/remove.hpp>
+
+#include <vector>
+#include <fstream>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#ifdef HAVE_JOBMARKET
+#include "JobMarket/types.hpp"
+#else
+typedef size_t JobId_t;
+#endif
+
+#include "Fragmentation/Summation/Containers/FragmentationChargeDensity.hpp"
+#include "Fragmentation/Summation/Containers/FragmentationLongRangeResults.hpp"
+#include "Fragmentation/Summation/Containers/FragmentationResultContainer.hpp"
+#include "Fragmentation/Summation/Containers/FragmentationShortRangeResults.hpp"
+#include "Fragmentation/Summation/Containers/MPQCData.hpp"
+#include "Fragmentation/Summation/Containers/MPQCData_printKeyNames.hpp"
+#include "Fragmentation/Homology/HomologyContainer.hpp"
+#include "Fragmentation/Homology/HomologyGraph.hpp"
+#include "Fragmentation/KeySetsContainer.hpp"
+#include "Fragmentation/Summation/SetValues/Fragment.hpp"
+#include "Fragmentation/Summation/SetValues/Histogram.hpp"
+#include "Fragmentation/Summation/SetValues/IndexedVectors.hpp"
+#include "Fragmentation/Summation/IndexSetContainer.hpp"
+#include "Fragmentation/Summation/writeTable.hpp"
+#ifdef HAVE_VMG
+#include "Fragmentation/Summation/Containers/VMGData.hpp"
+#include "Fragmentation/Summation/Containers/VMGDataFused.hpp"
+#include "Fragmentation/Summation/Containers/VMGDataMap.hpp"
+#include "Fragmentation/Summation/Containers/VMGData_printKeyNames.hpp"
+#endif
+#include "World.hpp"
+
+#include "Actions/FragmentationAction/AnalyseFragmentationResultsAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "AnalyseFragmentationResultsAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+
+void writeToFile(const std::string &filename, const std::string contents)
+{
+  std::ofstream tablefile(filename.c_str());
+  tablefile << contents;
+  tablefile.close();
+}
+
+/** Print (short range) energy, forces, and timings from received results.
+ *
+ * @param results summed up results container
+ */
+void printReceivedShortResults(
+    const FragmentationShortRangeResults &results)
+{
+  // print tables (without eigenvalues, they go extra)
+  {
+    typedef boost::mpl::remove<MPQCDataEnergyVector_t, MPQCDataFused::energy_eigenvalues>::type
+      MPQCDataEnergyVector_noeigenvalues_t;
+    const std::string energyresult =
+        writeTable<MPQCDataEnergyMap_t, MPQCDataEnergyVector_noeigenvalues_t >()(
+            results.Result_Energy_fused, results.getMaxLevel());
+    LOG(0, "Energy table is \n" << energyresult);
+    std::string filename;
+    filename += FRAGMENTPREFIX + std::string("_Energy.dat");
+    writeToFile(filename, energyresult);
+  }
+
+  {
+    typedef boost::mpl::list<
+        MPQCDataFused::energy_eigenvalues
+    > MPQCDataEigenvalues_t;
+    const std::string eigenvalueresult =
+        writeTable<MPQCDataEnergyMap_t, MPQCDataEigenvalues_t >()(
+            results.Result_Energy_fused, results.getMaxLevel());
+    LOG(0, "Eigenvalue table is \n" << eigenvalueresult);
+    std::string filename;
+    filename += FRAGMENTPREFIX + std::string("_Eigenvalues.dat");
+    writeToFile(filename, eigenvalueresult);
+  }
+
+  {
+    const std::string forceresult =
+        writeTable<MPQCDataForceMap_t, MPQCDataForceVector_t>()(
+            results.Result_Force_fused, results.getMaxLevel());
+    LOG(0, "Force table is \n" << forceresult);
+    std::string filename;
+    filename += FRAGMENTPREFIX + std::string("_Forces.dat");
+    writeToFile(filename, forceresult);
+  }
+  // we don't want to print grid to a table
+  {
+    // print times (without flops for now)
+    typedef boost::mpl::remove<
+        boost::mpl::remove<MPQCDataTimeVector_t, MPQCDataFused::times_total_flops>::type,
+        MPQCDataFused::times_gather_flops>::type
+        MPQCDataTimeVector_noflops_t;
+    const std::string timesresult =
+        writeTable<MPQCDataTimeMap_t, MPQCDataTimeVector_noflops_t >()(
+            results.Result_Time_fused, results.getMaxLevel());
+    LOG(0, "Times table is \n" << timesresult);
+    std::string filename;
+    filename += FRAGMENTPREFIX + std::string("_Times.dat");
+    writeToFile(filename, timesresult);
+  }
+}
+
+
+/** Print long range energy from received results.
+ *
+ * @param results summed up results container
+ */
+void printReceivedFullResults(
+    const FragmentationLongRangeResults &results)
+{
+  // print tables (without eigenvalues, they go extra)
+
+  if (results.Result_LongRange_fused.size() >= (results.getMaxLevel()-2))
+  {
+    const std::string gridresult =
+        writeTable<VMGDataMap_t, VMGDataVector_t >()(
+            results.Result_LongRange_fused, results.getMaxLevel(), 2);
+    LOG(0, "VMG table is \n" << gridresult);
+    std::string filename;
+    filename += FRAGMENTPREFIX + std::string("_VMGEnergy.dat");
+    writeToFile(filename, gridresult);
+  }
+
+  if (results.Result_LongRangeIntegrated_fused.size() >= (results.getMaxLevel()-2))
+  {
+    const std::string gridresult =
+        writeTable<VMGDataLongRangeMap_t, VMGDataLongRangeVector_t >()(
+            results.Result_LongRangeIntegrated_fused, results.getMaxLevel(), 2);
+    LOG(0, "LongRange table is \n" << gridresult);
+    std::string filename;
+    filename += FRAGMENTPREFIX + std::string("_LongRangeEnergy.dat");
+    writeToFile(filename, gridresult);
+  }
+}
+
+bool appendToHomologyFile(
+    const boost::filesystem::path &homology_file,
+    const FragmentationShortRangeResults &shortrangeresults,
+    const FragmentationLongRangeResults &longrangeresults
+    )
+{
+  /// read homology container (if present)
+  HomologyContainer homology_container;
+  if (boost::filesystem::exists(homology_file)) {
+    std::ifstream returnstream(homology_file.string().c_str());
+    if (returnstream.good()) {
+      boost::archive::text_iarchive ia(returnstream);
+      ia >> homology_container;
+    } else {
+      ELOG(2, "Failed to parse from " << homology_file.string() << ".");
+    }
+    returnstream.close();
+  } else {
+    LOG(2, "Could not open " << homology_file.string()
+        << ", creating empty container.");
+  }
+
+  /// append all fragments to a HomologyContainer
+  HomologyContainer::container_t values;
+
+  // convert KeySetContainer to IndexSetContainer
+  IndexSetContainer::ptr ForceContainer(new IndexSetContainer(shortrangeresults.getForceKeySet()));
+  const IndexSetContainer::Container_t &Indices = shortrangeresults.getContainer();
+  const IndexSetContainer::Container_t &ForceIndices = ForceContainer->getContainer();
+  IndexSetContainer::Container_t::const_iterator iter = Indices.begin();
+  IndexSetContainer::Container_t::const_iterator forceiter = ForceIndices.begin();
+  /// go through all fragments
+  for (;iter != Indices.end(); ++iter, ++forceiter) // go through each IndexSet
+  {
+    /// create new graph entry in HomologyContainer which is (key,value) type
+    LOG(1, "INFO: Creating new graph with " << **forceiter << ".");
+    HomologyGraph graph(**forceiter);
+    LOG(2, "DEBUG: Created graph " << graph << ".");
+    const IndexSet::ptr &index = *iter;
+    HomologyContainer::value_t value;
+
+    // obtain fragment as key
+    std::map<IndexSet::ptr, std::pair< MPQCDataFragmentMap_t, MPQCDataFragmentMap_t> >::const_iterator fragmentiter
+        = longrangeresults.Result_perIndexSet_Fragment.find(index);
+    ASSERT( fragmentiter != longrangeresults.Result_perIndexSet_Fragment.end(),
+        "appendToHomologyFile() - cannot find index "+toString(*index)
+        +" in FragmentResults.");
+    value.first = boost::fusion::at_key<MPQCDataFused::fragment>(fragmentiter->second.first);
+
+    // obtain energy as value
+    std::map<IndexSet::ptr, std::pair< MPQCDataEnergyMap_t, MPQCDataEnergyMap_t> >::const_iterator energyiter
+        = shortrangeresults.Result_perIndexSet_Energy.find(index);
+    ASSERT( energyiter != shortrangeresults.Result_perIndexSet_Energy.end(),
+        "appendToHomologyFile() - cannot find index "+toString(*index)
+        +" in FragmentResults.");
+    // value.second = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.first); // values
+    value.second = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.second); // contributions
+    values.insert( std::make_pair( graph, value) );
+  }
+  homology_container.insert(values);
+
+  LOG(1, "INFO: Listing all present atomic ids ...");
+  std::stringstream output;
+  for (World::AtomIterator iter = World::getInstance().getAtomIter();
+      iter != World::getInstance().atomEnd(); ++iter)
+    output << (*iter)->getId() << " ";
+  LOG(1, "INFO: { " << output.str() << "} .");
+
+  // for debugging: print container
+  LOG(1, "INFO: Listing all present homologies ...");
+  for (HomologyContainer::container_t::const_iterator iter =
+      homology_container.begin(); iter != homology_container.end(); ++iter) {
+    LOG(1, "INFO: graph " << iter->first << " has Fragment "
+        << iter->second.first << " and associated energy " << iter->second.second << ".");
+  }
+
+  /// store homology container again
+  std::ofstream outputstream(homology_file.string().c_str());
+  if (outputstream.good()) { // check if opened
+    boost::archive::text_oarchive oa(outputstream);
+    oa << homology_container;
+    if (outputstream.fail()) { // check if correctly written
+      LOG(1, "Failed to write to file " << homology_file.string() << ".");
+      return false;
+    } else
+      outputstream.close();
+  } else {
+    LOG(1, "Failed to open file " << homology_file.string()
+        << " for writing.");
+    return false;
+  }
+  return true;
+}
+
+Action::state_ptr FragmentationAnalyseFragmentationResultsAction::performCall() {
+
+  // TODO: Get data and keysets from ResultsContainer
+  FragmentationResultContainer& container = FragmentationResultContainer::getInstance();
+  const std::map<JobId_t, MPQCData> &shortrangedata = container.getShortRangeResults();
+  const KeySetsContainer &keysets = container.getKeySets();
+  const KeySetsContainer &forcekeysets = container.getForceKeySets();
+  const bool DoLongrange = container.areFullRangeResultsPresent();
+
+  FragmentationShortRangeResults shortrangeresults(shortrangedata, keysets, forcekeysets);
+  shortrangeresults(shortrangedata);
+  printReceivedShortResults(shortrangeresults);
+
+#ifdef HAVE_VMG
+  if (DoLongrange) {
+    if ( World::getInstance().getAllAtoms().size() == 0) {
+      ELOG(1, "Please load the full molecule into the world before starting this action.");
+      return Action::failure;
+    }
+
+    FragmentationChargeDensity summedChargeDensity(shortrangedata,keysets);
+    const std::vector<SamplingGrid> full_sample = summedChargeDensity.getFullSampledGrid();
+
+    std::map<JobId_t, VMGData> longrangeData = container.getLongRangeResults();
+    // remove full solution corresponding to full_sample from map (must be highest ids), has to be treated extra
+    std::map<JobId_t, VMGData>::iterator iter = longrangeData.end();
+    for (size_t i=0;i<full_sample.size();++i)
+      --iter;
+    std::map<JobId_t, VMGData>::iterator remove_iter = iter;
+    std::vector<VMGData> fullsolutionData;
+    for (; iter != longrangeData.end(); ++iter)
+      fullsolutionData.push_back(iter->second);
+    longrangeData.erase(remove_iter, longrangeData.end());
+
+    // Final phase: sum up and print result
+    FragmentationLongRangeResults longrangeresults(
+        shortrangedata,longrangeData,keysets, forcekeysets);
+    longrangeresults(
+        shortrangedata,
+        longrangeData,
+        fullsolutionData,
+        full_sample);
+    printReceivedFullResults(longrangeresults);
+
+    // append all keysets to homology file
+    if (!params.homology_file.get().empty()) {
+      const boost::filesystem::path &homology_file = params.homology_file.get();
+      if (homology_file.string() != "") {
+        LOG(1, "INFO: Appending HomologyGraphs to file " << homology_file.string() << ".");
+        if (!appendToHomologyFile(homology_file, shortrangeresults, longrangeresults))
+          return Action::failure;
+      }
+    }
+  }
+#endif
+
+  container.clear();
+
+  return Action::success;
+}
+
+Action::state_ptr FragmentationAnalyseFragmentationResultsAction::performUndo(Action::state_ptr _state) {
+  return Action::success;
+}
+
+Action::state_ptr FragmentationAnalyseFragmentationResultsAction::performRedo(Action::state_ptr _state){
+  return Action::success;
+}
+
+bool FragmentationAnalyseFragmentationResultsAction::canUndo() {
+  return false;
+}
+
+bool FragmentationAnalyseFragmentationResultsAction::shouldUndo() {
+  return false;
+}
+/** =========== end of function ====================== */
Index: src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.def
===================================================================
--- src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.def	(revision a3427f795a607e84365d342681c78b46570d042e)
+++ src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.def	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -0,0 +1,37 @@
+/*
+ * AnalyseFragmentationResultsAction.def
+ *
+ *  Created on: Mar 8, 2013
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <boost/filesystem/path.hpp>
+
+#include "Parameters/Validators/DummyValidator.hpp"
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
+#define paramtypes (boost::filesystem::path)
+#define paramtokens ("homology-file")
+#define paramdescriptions ("path to file containing homology containerto append to")
+#define paramdefaults (PARAM_DEFAULT(""))
+#define paramreferences (homology_file)
+#define paramvalids \
+(DummyValidator< boost::filesystem::path >())
+
+#undef statetypes
+#undef statereferences
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Fragmentation
+#define MENUNAME "fragmentation"
+#define MENUPOSITION 4
+#define ACTIONNAME AnalyseFragmentationResults
+#define TOKEN "analyse-fragment-results"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "analyses previously calculated results"
+#undef SHORTFORM
Index: src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.hpp
===================================================================
--- src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.hpp	(revision a3427f795a607e84365d342681c78b46570d042e)
+++ src/Actions/FragmentationAction/AnalyseFragmentationResultsAction.hpp	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -0,0 +1,22 @@
+/*
+ * AnalyseFragmentationResultsAction.hpp
+ *
+ *  Created on: Mar 8, 2013
+ *      Author: heber
+ */
+
+#ifndef ANALYSEFRAGMENTATIONRESULTSACTION_HPP_
+#define ANALYSEFRAGMENTATIONRESULTSACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "AnalyseFragmentationResultsAction.def"
+#include "Action_impl_header.hpp"
+
+#endif /* ANALYSEFRAGMENTATIONRESULTSACTION_HPP_ */
Index: src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision fbf143b9fb3d409937862a091c997ab0428c8b3e)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -39,13 +39,13 @@
 #include "CodePatterns/MemDebug.hpp"
 
-// include headers that implement a archive in simple text format
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-
-
-#include <boost/mpl/remove.hpp>
-#include <boost/lambda/lambda.hpp>
-
-#include <iostream>
+//// include headers that implement a archive in simple text format
+//#include <boost/archive/text_oarchive.hpp>
+//#include <boost/archive/text_iarchive.hpp>
+
+//
+//#include <boost/mpl/remove.hpp>
+//#include <boost/lambda/lambda.hpp>
+
+//#include <iostream>
 
 #include "CodePatterns/Assert.hpp"
@@ -56,34 +56,17 @@
 #include "Fragmentation/Automation/FragmentJobQueue.hpp"
 #include "Fragmentation/Automation/MPQCFragmentController.hpp"
+#include "Fragmentation/Summation/Containers/FragmentationChargeDensity.hpp"
+#include "Fragmentation/Summation/Containers/FragmentationLongRangeResults.hpp"
+#include "Fragmentation/Summation/Containers/FragmentationResultContainer.hpp"
+#include "Fragmentation/Summation/Containers/FragmentationShortRangeResults.hpp"
+#include "Fragmentation/Summation/Containers/MPQCData.hpp"
+#include "Fragmentation/KeySetsContainer.hpp"
+#ifdef HAVE_VMG
 #include "Fragmentation/Automation/VMGDebugGridFragmentController.hpp"
 #include "Fragmentation/Automation/VMGFragmentController.hpp"
-#include "Fragmentation/EnergyMatrix.hpp"
-#include "Fragmentation/ForceMatrix.hpp"
-#include "Fragmentation/Fragmentation.hpp"
-#include "Fragmentation/Homology/HomologyContainer.hpp"
-#include "Fragmentation/Homology/HomologyGraph.hpp"
-#include "Fragmentation/KeySet.hpp"
-#include "Fragmentation/KeySetsContainer.hpp"
-#include "Fragmentation/Summation/IndexSetContainer.hpp"
-#include "Fragmentation/Summation/writeTable.hpp"
-#include "Fragmentation/Summation/Containers/createMatrixNrLookup.hpp"
-#include "Fragmentation/Summation/Containers/extractJobIds.hpp"
-#include "Fragmentation/Summation/Containers/FragmentationChargeDensity.hpp"
-#include "Fragmentation/Summation/Containers/FragmentationLongRangeResults.hpp"
-#include "Fragmentation/Summation/Containers/FragmentationShortRangeResults.hpp"
-#include "Fragmentation/Summation/Containers/MPQCData.hpp"
-#include "Fragmentation/Summation/Containers/MPQCData_printKeyNames.hpp"
-#include "Fragmentation/Summation/SetValues/Fragment.hpp"
-#include "Fragmentation/Summation/SetValues/Histogram.hpp"
-#include "Fragmentation/Summation/SetValues/IndexedVectors.hpp"
-#include "Graph/DepthFirstSearchAnalysis.hpp"
-#include "Jobs/MPQCJob.hpp"
-#ifdef HAVE_VMG
 #include "Fragmentation/Summation/Containers/VMGData.hpp"
 #include "Fragmentation/Summation/Containers/VMGDataFused.hpp"
 #include "Fragmentation/Summation/Containers/VMGDataMap.hpp"
 #include "Fragmentation/Summation/Containers/VMGData_printKeyNames.hpp"
-#include "Jobs/VMGDebugGridJob.hpp"
-#include "Jobs/VMGJob.hpp"
 #endif
 #include "World.hpp"
@@ -113,193 +96,4 @@
 }
 
-void writeToFile(const std::string &filename, const std::string contents)
-{
-  std::ofstream tablefile(filename.c_str());
-  tablefile << contents;
-  tablefile.close();
-}
-
-/** Print (short range) energy, forces, and timings from received results.
- *
- * @param results summed up results container
- */
-void printReceivedShortResults(
-    const FragmentationShortRangeResults &results)
-{
-  // print tables (without eigenvalues, they go extra)
-  {
-    typedef boost::mpl::remove<MPQCDataEnergyVector_t, MPQCDataFused::energy_eigenvalues>::type
-      MPQCDataEnergyVector_noeigenvalues_t;
-    const std::string energyresult =
-        writeTable<MPQCDataEnergyMap_t, MPQCDataEnergyVector_noeigenvalues_t >()(
-            results.Result_Energy_fused, results.getMaxLevel());
-    LOG(0, "Energy table is \n" << energyresult);
-    std::string filename;
-    filename += FRAGMENTPREFIX + std::string("_Energy.dat");
-    writeToFile(filename, energyresult);
-  }
-
-  {
-    const std::string eigenvalueresult;
-    LOG(0, "Eigenvalue table is \n" << eigenvalueresult);
-    std::string filename;
-    filename += FRAGMENTPREFIX + std::string("_Eigenvalues.dat");
-    writeToFile(filename, eigenvalueresult);
-  }
-
-  {
-    const std::string forceresult =
-        writeTable<MPQCDataForceMap_t, MPQCDataForceVector_t>()(
-            results.Result_Force_fused, results.getMaxLevel());
-    LOG(0, "Force table is \n" << forceresult);
-    std::string filename;
-    filename += FRAGMENTPREFIX + std::string("_Forces.dat");
-    writeToFile(filename, forceresult);
-  }
-  // we don't want to print grid to a table
-  {
-    // print times (without flops for now)
-    typedef boost::mpl::remove<
-        boost::mpl::remove<MPQCDataTimeVector_t, MPQCDataFused::times_total_flops>::type,
-        MPQCDataFused::times_gather_flops>::type
-        MPQCDataTimeVector_noflops_t;
-    const std::string timesresult =
-        writeTable<MPQCDataTimeMap_t, MPQCDataTimeVector_noflops_t >()(
-            results.Result_Time_fused, results.getMaxLevel());
-    LOG(0, "Times table is \n" << timesresult);
-    std::string filename;
-    filename += FRAGMENTPREFIX + std::string("_Times.dat");
-    writeToFile(filename, timesresult);
-  }
-}
-
-
-/** Print long range energy from received results.
- *
- * @param results summed up results container
- */
-void printReceivedFullResults(
-    const FragmentationLongRangeResults &results)
-{
-  // print tables (without eigenvalues, they go extra)
-
-  if (results.Result_LongRange_fused.size() >= (results.getMaxLevel()-2))
-  {
-    const std::string gridresult =
-        writeTable<VMGDataMap_t, VMGDataVector_t >()(
-            results.Result_LongRange_fused, results.getMaxLevel(), 2);
-    LOG(0, "VMG table is \n" << gridresult);
-    std::string filename;
-    filename += FRAGMENTPREFIX + std::string("_VMGEnergy.dat");
-    writeToFile(filename, gridresult);
-  }
-
-  if (results.Result_LongRangeIntegrated_fused.size() >= (results.getMaxLevel()-2))
-  {
-    const std::string gridresult =
-        writeTable<VMGDataLongRangeMap_t, VMGDataLongRangeVector_t >()(
-            results.Result_LongRangeIntegrated_fused, results.getMaxLevel(), 2);
-    LOG(0, "LongRange table is \n" << gridresult);
-    std::string filename;
-    filename += FRAGMENTPREFIX + std::string("_LongRangeEnergy.dat");
-    writeToFile(filename, gridresult);
-  }
-}
-
-bool appendToHomologyFile(
-    const boost::filesystem::path &homology_file,
-    const FragmentationShortRangeResults &shortrangeresults,
-    const FragmentationLongRangeResults &longrangeresults
-    )
-{
-  /// read homology container (if present)
-  HomologyContainer homology_container;
-  if (boost::filesystem::exists(homology_file)) {
-    std::ifstream returnstream(homology_file.string().c_str());
-    if (returnstream.good()) {
-      boost::archive::text_iarchive ia(returnstream);
-      ia >> homology_container;
-    } else {
-      ELOG(2, "Failed to parse from " << homology_file.string() << ".");
-    }
-    returnstream.close();
-  } else {
-    LOG(2, "Could not open " << homology_file.string()
-        << ", creating empty container.");
-  }
-
-  /// append all fragments to a HomologyContainer
-  HomologyContainer::container_t values;
-  const size_t FragmentCounter = shortrangeresults.Result_perIndexSet_Energy.size();
-
-  // convert KeySetContainer to IndexSetContainer
-  IndexSetContainer::ptr ForceContainer(new IndexSetContainer(shortrangeresults.getForceKeySet()));
-  const IndexSetContainer::Container_t &Indices = shortrangeresults.getContainer();
-  const IndexSetContainer::Container_t &ForceIndices = ForceContainer->getContainer();
-  IndexSetContainer::Container_t::const_iterator iter = Indices.begin();
-  IndexSetContainer::Container_t::const_iterator forceiter = ForceIndices.begin();
-  /// go through all fragments
-  for (;iter != Indices.end(); ++iter, ++forceiter) // go through each IndexSet
-  {
-    /// create new graph entry in HomologyContainer which is (key,value) type
-    LOG(1, "INFO: Creating new graph with " << **forceiter << ".");
-    HomologyGraph graph(**forceiter);
-    LOG(2, "DEBUG: Created graph " << graph << ".");
-    const IndexSet::ptr &index = *iter;
-    HomologyContainer::value_t value;
-
-    // obtain fragment as key
-    std::map<IndexSet::ptr, std::pair< MPQCDataFragmentMap_t, MPQCDataFragmentMap_t> >::const_iterator fragmentiter
-        = longrangeresults.Result_perIndexSet_Fragment.find(index);
-    ASSERT( fragmentiter != longrangeresults.Result_perIndexSet_Fragment.end(),
-        "appendToHomologyFile() - cannot find index "+toString(*index)
-        +" in FragmentResults.");
-    value.first = boost::fusion::at_key<MPQCDataFused::fragment>(fragmentiter->second.first);
-
-    // obtain energy as value
-    std::map<IndexSet::ptr, std::pair< MPQCDataEnergyMap_t, MPQCDataEnergyMap_t> >::const_iterator energyiter
-        = shortrangeresults.Result_perIndexSet_Energy.find(index);
-    ASSERT( energyiter != shortrangeresults.Result_perIndexSet_Energy.end(),
-        "appendToHomologyFile() - cannot find index "+toString(*index)
-        +" in FragmentResults.");
-    // value.second = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.first); // values
-    value.second = boost::fusion::at_key<MPQCDataFused::energy_total>(energyiter->second.second); // contributions
-    values.insert( std::make_pair( graph, value) );
-  }
-  homology_container.insert(values);
-
-  LOG(1, "INFO: Listing all present atomic ids ...");
-  std::stringstream output;
-  for (World::AtomIterator iter = World::getInstance().getAtomIter();
-      iter != World::getInstance().atomEnd(); ++iter)
-    output << (*iter)->getId() << " ";
-  LOG(1, "INFO: { " << output.str() << "} .");
-
-  // for debugging: print container
-  LOG(1, "INFO: Listing all present homologies ...");
-  for (HomologyContainer::container_t::const_iterator iter =
-      homology_container.begin(); iter != homology_container.end(); ++iter) {
-    LOG(1, "INFO: graph " << iter->first << " has Fragment "
-        << iter->second.first << " and associated energy " << iter->second.second << ".");
-  }
-
-  /// store homology container again
-  std::ofstream outputstream(homology_file.string().c_str());
-  if (outputstream.good()) { // check if opened
-    boost::archive::text_oarchive oa(outputstream);
-    oa << homology_container;
-    if (outputstream.fail()) { // check if correctly written
-      LOG(1, "Failed to write to file " << homology_file.string() << ".");
-      return false;
-    } else
-      outputstream.close();
-  } else {
-    LOG(1, "Failed to open file " << homology_file.string()
-        << " for writing.");
-    return false;
-  }
-  return true;
-}
-
 Action::state_ptr FragmentationFragmentationAutomationAction::performCall() {
   boost::asio::io_service io_service;
@@ -307,6 +101,11 @@
   // TODO: Have io_service run in second thread and merge with current again eventually
 
+  FragmentationResultContainer &container =
+      FragmentationResultContainer::getInstance();
+  const KeySetsContainer& keysets = FragmentJobQueue::getInstance().getKeySets();
+  const KeySetsContainer& forcekeysets = FragmentJobQueue::getInstance().getFullKeySets();
+
   size_t Exitflag = 0;
-  std::map<JobId_t, MPQCData> fragmentData;
+  std::map<JobId_t, MPQCData> shortrangedata;
   {
     const size_t NumberJobs = FragmentJobQueue::getInstance().size();
@@ -325,15 +124,8 @@
     // Phase Three: calculate result
     mpqccontroller.waitforResults(NumberJobs);
-    mpqccontroller.getResults(fragmentData);
+    mpqccontroller.getResults(shortrangedata);
 
     Exitflag += mpqccontroller.getExitflag();
   }
-
-  FragmentationShortRangeResults shortrangeresults(
-      fragmentData,
-      FragmentJobQueue::getInstance().getKeySets(),
-      FragmentJobQueue::getInstance().getFullKeySets());
-  shortrangeresults(fragmentData);
-  printReceivedShortResults(shortrangeresults);
 
 #ifdef HAVE_VMG
@@ -346,17 +138,17 @@
   // obtain combined charge density
   FragmentationChargeDensity summedChargeDensity(
-      fragmentData,
+      shortrangedata,
       FragmentJobQueue::getInstance().getKeySets());
   const std::vector<SamplingGrid> full_sample = summedChargeDensity.getFullSampledGrid();
-  LOG(1, "INFO: There are " << fragmentData.size() << " short-range and "
+  LOG(1, "INFO: There are " << shortrangedata.size() << " short-range and "
       << full_sample.size() << " level-wise long-range jobs.");
 
   // Phase Four: obtain more ids
-  std::map<JobId_t, VMGData> longrangeData;
+  std::map<JobId_t, VMGData> longrangedata;
   {
     VMGFragmentController vmgcontroller(io_service);
     vmgcontroller.setHost(params.host.get());
     vmgcontroller.setPort(params.port.get());
-    const size_t NoJobs = fragmentData.size()+full_sample.size();
+    const size_t NoJobs = shortrangedata.size()+full_sample.size();
     vmgcontroller.requestIds(NoJobs);
 
@@ -365,5 +157,5 @@
     const size_t interpolation_degree = params.interpolation_degree.get();
     if (!vmgcontroller.createLongRangeJobs(
-        fragmentData,
+        shortrangedata,
         full_sample,
         summedChargeDensity.getFragment(),
@@ -374,43 +166,10 @@
     // Phase Six: calculate result
     vmgcontroller.waitforResults(NoJobs);
-    vmgcontroller.getResults(longrangeData);
-    ASSERT( NoJobs == longrangeData.size(),
+    vmgcontroller.getResults(longrangedata);
+    ASSERT( NoJobs == longrangedata.size(),
         "FragmentationFragmentationAutomationAction::performCall() - number of MPQCresults+"
         +toString(full_sample.size())+"="+toString(NoJobs)
-        +" and VMGresults "+toString(longrangeData.size())+" don't match.");
+        +" and VMGresults "+toString(longrangedata.size())+" don't match.");
     Exitflag += vmgcontroller.getExitflag();
-  }
-
-  // remove full solution corresponding to full_sample from map (must be highest ids), has to be treated extra
-  std::map<JobId_t, VMGData>::iterator iter = longrangeData.end();
-  for (size_t i=0;i<full_sample.size();++i)
-    --iter;
-  std::map<JobId_t, VMGData>::iterator remove_iter = iter;
-  std::vector<VMGData> fullsolutionData;
-  for (; iter != longrangeData.end(); ++iter)
-    fullsolutionData.push_back(iter->second);
-  longrangeData.erase(remove_iter, longrangeData.end());
-
-  // Final phase: sum up and print result
-  FragmentationLongRangeResults longrangeresults(
-      fragmentData,
-      longrangeData,
-      FragmentJobQueue::getInstance().getKeySets(),
-      FragmentJobQueue::getInstance().getFullKeySets());
-  longrangeresults(
-      fragmentData,
-      longrangeData,
-      fullsolutionData,
-      full_sample);
-  printReceivedFullResults(longrangeresults);
-
-  // append all keysets to homology file
-  if ((Exitflag == 0) && (!params.homology_file.get().empty())) {
-    const boost::filesystem::path &homology_file = params.homology_file.get();
-    if (homology_file.string() != "") {
-      LOG(1, "INFO: Appending HomologyGraphs to file " << homology_file.string() << ".");
-      if (!appendToHomologyFile(homology_file, shortrangeresults, longrangeresults))
-        Exitflag = 1;
-    }
   }
 
@@ -430,5 +189,10 @@
     }
   }
-  }
+  container.addFullResults(keysets, forcekeysets, shortrangedata, longrangedata);
+  } else {
+    container.addShortRangeResults(keysets, forcekeysets, shortrangedata);
+  }
+#else
+  container.addShortRangeResults(keysets, forcekeysets, shortrangedata);
 #endif
 
Index: src/Actions/FragmentationAction/FragmentationAutomationAction.def
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.def	(revision fbf143b9fb3d409937862a091c997ab0428c8b3e)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.def	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -18,9 +18,9 @@
 // ValueStorage by the token "Z" -> first column: int, Z, "Z"
 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
-#define paramtypes (std::string)(std::string)(boost::filesystem::path)(unsigned int)(unsigned int)(unsigned int)(bool)(boost::filesystem::path)
-#define paramtokens ("server-address")("server-port")("fragment-executable")("grid-level")("near-field-cells")("interpolation-degree")("DoLongrange")("homology-file")
-#define paramdescriptions ("hostname of server")("controller port of server")("executable to launch on clients")("resolution of multigrid")("number of cells used in smearing out core charge")("interpolation degree for getting the nuclei potential from the grid")("whether to calculate long-range contributions")("path to file containing homology containerto append to")
-#define paramdefaults (PARAM_DEFAULT("127.0.0.1"))(NOPARAM_DEFAULT)(PARAM_DEFAULT("mpqc"))(PARAM_DEFAULT(5))(PARAM_DEFAULT(3))(PARAM_DEFAULT(3))(PARAM_DEFAULT("0"))(PARAM_DEFAULT(""))
-#define paramreferences (host)(port)(executable)(level)(near_field_cells)(interpolation_degree)(DoLongrange)(homology_file)
+#define paramtypes (std::string)(std::string)(boost::filesystem::path)(unsigned int)(unsigned int)(unsigned int)(bool)
+#define paramtokens ("server-address")("server-port")("fragment-executable")("grid-level")("near-field-cells")("interpolation-degree")("DoLongrange")
+#define paramdescriptions ("hostname of server")("controller port of server")("executable to launch on clients")("resolution of multigrid")("number of cells used in smearing out core charge")("interpolation degree for getting the nuclei potential from the grid")("whether to calculate long-range contributions")
+#define paramdefaults (PARAM_DEFAULT("127.0.0.1"))(NOPARAM_DEFAULT)(PARAM_DEFAULT("mpqc"))(PARAM_DEFAULT(5))(PARAM_DEFAULT(3))(PARAM_DEFAULT(3))(PARAM_DEFAULT("0"))
+#define paramreferences (host)(port)(executable)(level)(near_field_cells)(interpolation_degree)(DoLongrange)
 #define paramvalids \
 (DummyValidator< std::string >()) \
@@ -30,6 +30,5 @@
 (RangeValidator< unsigned int >(1, 20)) \
 (RangeValidator< unsigned int >(1, 10)) \
-(DummyValidator< bool >()) \
-(DummyValidator< boost::filesystem::path >())
+(DummyValidator< bool >())
 
 #undef statetypes
Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision fbf143b9fb3d409937862a091c997ab0428c8b3e)
+++ src/Actions/GlobalListOfActions.hpp	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -123,4 +123,5 @@
   (SelectionNotShapeByName) \
   (FragmentationFragmentation) \
+  (FragmentationAnalyseFragmentationResults) \
   (FragmentationStoreSaturatedFragment) \
   (FillRegularGrid) \
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision fbf143b9fb3d409937862a091c997ab0428c8b3e)
+++ src/Actions/Makefile.am	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -212,10 +212,13 @@
 FRAGMENTATIONACTIONSOURCE = \
   Actions/FragmentationAction/FragmentationAction.cpp \
+  Actions/FragmentationAction/AnalyseFragmentationResultsAction.cpp \
   Actions/FragmentationAction/StoreSaturatedFragmentAction.cpp
 FRAGMENTATIONACTIONHEADER = \
   Actions/FragmentationAction/FragmentationAction.hpp \
+  Actions/FragmentationAction/AnalyseFragmentationResultsAction.hpp \
   Actions/FragmentationAction/StoreSaturatedFragmentAction.hpp
 FRAGMENTATIONACTIONDEFS = \
   Actions/FragmentationAction/FragmentationAction.def \
+  Actions/FragmentationAction/AnalyseFragmentationResultsAction.def \
   Actions/FragmentationAction/StoreSaturatedFragmentAction.def
 
Index: src/Fragmentation/Summation/Containers/FragmentationResultContainer.cpp
===================================================================
--- src/Fragmentation/Summation/Containers/FragmentationResultContainer.cpp	(revision a3427f795a607e84365d342681c78b46570d042e)
+++ src/Fragmentation/Summation/Containers/FragmentationResultContainer.cpp	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -0,0 +1,106 @@
+/*
+ * 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/>.
+ */
+
+/*
+ * FragmentationResultContainer.cpp
+ *
+ *  Created on: Mar 8, 2013
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "FragmentationResultContainer.hpp"
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Singleton_impl.hpp"
+
+#ifdef HAVE_VMG
+void FragmentationResultContainer::addFullResults(
+    const KeySetsContainer &_keysets,
+    const KeySetsContainer &_forcekeysets,
+    const shortrangedata_t &_shortrangedata,
+    const longrangedata_t &_longrangedata
+    )
+{
+  ASSERT( ResultsType == BothRanges,
+      "FragmentationResultContainer::getLongRangeResults() - mixing full and short range is not in the cards.");
+  ASSERT( _keysets.KeySets.size() == _forcekeysets.KeySets.size(),
+      "FragmentationResultContainer::addFullResults() - keysets ("
+      +toString(_keysets.KeySets.size())+") and forcekeysets ("+toString(_forcekeysets.KeySets.size())
+      +") differ in size.");
+  ASSERT( _keysets.KeySets.size() == _shortrangedata.size(),
+      "FragmentationResultContainer::addFullResults() - keysets ("
+      +toString(_keysets.KeySets.size())+") and shortrangedata ("+toString(_shortrangedata.size())
+      +") differ in size.");
+  // there are more results for longrangedata!
+//  ASSERT( _keysets.KeySets.size() == _longrangedata.size(),
+//      "FragmentationResultContainer::addFullResults() - keysets ("
+//      +toString(_keysets.KeySets.size())+") and longrangedata ("+toString(_longrangedata.size())
+//      +") differ in size.");
+  keysets.insert(_keysets);
+  forcekeysets.insert(_forcekeysets);
+  shortrangedata.insert(_shortrangedata.begin(), _shortrangedata.end());
+  longrangedata.insert(_longrangedata.begin(), _longrangedata.end());
+}
+#endif
+
+void FragmentationResultContainer::addShortRangeResults(
+    const KeySetsContainer &_keysets,
+    const KeySetsContainer &_forcekeysets,
+    const shortrangedata_t &_shortrangedata
+    )
+{
+  ASSERT( (ResultsType == ShortRangeOnly) || (keysets.KeySets.empty()) ,
+      "FragmentationResultContainer::getLongRangeResults() - mixing full and short range is not in the cards.");
+  ASSERT( _keysets.KeySets.size() == _forcekeysets.KeySets.size(),
+      "FragmentationResultContainer::addFullResults() - keysets ("
+      +toString(_keysets.KeySets.size())+") and forcekeysets ("+toString(_forcekeysets.KeySets.size())
+      +") differ in size.");
+  ASSERT( _keysets.KeySets.size() == _shortrangedata.size(),
+      "FragmentationResultContainer::addFullResults() - keysets ("
+      +toString(_keysets.KeySets.size())+") and shortrangedata ("+toString(_shortrangedata.size())
+      +") differ in size.");
+  // deteriorate to short range only
+  ResultsType = ShortRangeOnly;
+  keysets.insert(_keysets);
+  forcekeysets.insert(_forcekeysets);
+  shortrangedata.insert(_shortrangedata.begin(), _shortrangedata.end());
+}
+
+
+#ifdef HAVE_VMG
+const FragmentationResultContainer::longrangedata_t&
+FragmentationResultContainer::getLongRangeResults() const
+{
+  ASSERT( ResultsType == BothRanges,
+      "FragmentationResultContainer::getLongRangeResults() - access although storing only short range.");
+  return longrangedata;
+}
+#endif
+
+CONSTRUCT_SINGLETON(FragmentationResultContainer)
Index: src/Fragmentation/Summation/Containers/FragmentationResultContainer.hpp
===================================================================
--- src/Fragmentation/Summation/Containers/FragmentationResultContainer.hpp	(revision a3427f795a607e84365d342681c78b46570d042e)
+++ src/Fragmentation/Summation/Containers/FragmentationResultContainer.hpp	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -0,0 +1,132 @@
+/*
+ * FragmentationResultContainer.hpp
+ *
+ *  Created on: Mar 8, 2013
+ *      Author: heber
+ */
+
+#ifndef FRAGMENTATIONRESULTCONTAINER_HPP_
+#define FRAGMENTATIONRESULTCONTAINER_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/Singleton.hpp"
+
+#include <map>
+
+#ifdef HAVE_JOBMARKET
+#include "JobMarket/types.hpp"
+#else
+typedef size_t JobId_t;
+#endif
+
+#include "Fragmentation/KeySetsContainer.hpp"
+#include "Fragmentation/Summation/Containers/MPQCData.hpp"
+#ifdef HAVE_VMG
+#include "Fragmentation/Summation/Containers/VMGData.hpp"
+#endif
+
+/** This class stores results from lengthy fragmentation calculations, e.g.
+ * coming out of FragmentationAutomationAction.
+ *
+ * The idea is that we can play around with results without having to recalculate
+ * results in between. Hence, we serialize the FragmentResult into this
+ * container which can also be filled from file.
+ */
+class FragmentationResultContainer: public Singleton<FragmentationResultContainer>
+{
+  //!> Singleton patterns needs access to private cstor/dtor.
+  friend class Singleton<FragmentationResultContainer>;
+private:
+  FragmentationResultContainer() :
+    ResultsType(BothRanges)
+  {}
+  ~FragmentationResultContainer() {}
+
+public:
+  //!> typedef for short range data container
+  typedef std::map<JobId_t, MPQCData> shortrangedata_t;
+#ifdef HAVE_VMG
+  //!> typedef for long range data container
+  typedef std::map<JobId_t, VMGData> longrangedata_t;
+#endif
+
+#ifdef HAVE_VMG
+  /** Adds a a set of both short and long range results.
+   *
+   * Adds all the containers to the ones present in this instance.
+   *
+   * \param _keysets
+   * \param _forcekeysets
+   * \param _shortrangedata
+   * \param _longrangedata
+   */
+  void addFullResults(
+      const KeySetsContainer &_keysets,
+      const KeySetsContainer &_forcekeysets,
+      const shortrangedata_t &_shortrangedata,
+      const longrangedata_t &_longrangedata
+      );
+#endif
+
+  /** Adds a a set of short range results only.
+   *
+   * Adds all the containers to the ones present in this instance.
+   *
+   * \param _keysets
+   * \param _forcekeysets
+   * \param _shortrangedata
+   */
+  void addShortRangeResults(
+      const KeySetsContainer &_keysets,
+      const KeySetsContainer &_forcekeysets,
+      const shortrangedata_t &_shortrangedata
+      );
+
+  /** Clears all internal containers.
+   *
+   * \note Also resets ResultsType.
+   */
+  void clear()
+  {
+    keysets.clear();
+    forcekeysets.clear();
+    shortrangedata.clear();
+#ifdef HAVE_VMG
+    longrangedata.clear();
+#endif
+    ResultsType = BothRanges;
+  }
+
+  const KeySetsContainer &getKeySets() const { return keysets; }
+  const KeySetsContainer &getForceKeySets() const  { return forcekeysets; }
+  const shortrangedata_t& getShortRangeResults() const  { return shortrangedata; }
+#ifdef HAVE_VMG
+  const longrangedata_t& getLongRangeResults() const;
+#endif
+  bool areFullRangeResultsPresent() const { return (ResultsType == BothRanges); }
+
+private:
+  //!> indicates whether we contain short range only or both results
+  enum ResultsType_t {
+    ShortRangeOnly,
+    BothRanges,
+  } ResultsType;
+
+  //!> container for all KeySet's without hydrogens to the jobs
+  KeySetsContainer keysets;
+  //!> container for all KeySet's with all except saturation hydrogen to the jobs
+  KeySetsContainer forcekeysets;
+  //!> container for all short-range results
+  std::map<JobId_t, MPQCData> shortrangedata;
+
+#ifdef HAVE_VMG
+  //!> container for all long-range results
+  std::map<JobId_t, VMGData> longrangedata;
+#endif
+};
+
+#endif /* FRAGMENTATIONRESULTCONTAINER_HPP_ */
Index: src/Fragmentation/Summation/Containers/Makefile.am
===================================================================
--- src/Fragmentation/Summation/Containers/Makefile.am	(revision fbf143b9fb3d409937862a091c997ab0428c8b3e)
+++ src/Fragmentation/Summation/Containers/Makefile.am	(revision a3427f795a607e84365d342681c78b46570d042e)
@@ -6,4 +6,5 @@
 	Fragmentation/Summation/Containers/FragmentationChargeDensity.cpp \
 	Fragmentation/Summation/Containers/FragmentationLongRangeResults.cpp \
+	Fragmentation/Summation/Containers/FragmentationResultContainer.cpp \
 	Fragmentation/Summation/Containers/FragmentationShortRangeResults.cpp \
 	Fragmentation/Summation/Containers/MPQCData.cpp
@@ -19,4 +20,5 @@
 	Fragmentation/Summation/Containers/FragmentationChargeDensity.hpp \
 	Fragmentation/Summation/Containers/FragmentationLongRangeResults.hpp \
+	Fragmentation/Summation/Containers/FragmentationResultContainer.hpp \
 	Fragmentation/Summation/Containers/FragmentationShortRangeResults.hpp \
 	Fragmentation/Summation/Containers/MPQCData.hpp \
