From c7f3904d63c71cc6bb4fd526abd8d9c894ce22b6 Mon Sep 17 00:00:00 2001
From: Simon Heybrock <simon.heybrock@esss.se>
Date: Tue, 4 Oct 2016 09:54:10 +0200
Subject: [PATCH] Re #15319. Fixed Run and Sample includes in remaining source
 files.

---
 .../src/ISIS/ISISHistoDataListener.cpp        |  1 +
 .../src/TOPAZLiveEventDataListener.cpp        | 19 +------------------
 .../inc/MantidMDAlgorithms/LoadSQW2.h         |  3 +++
 .../inc/MantidMDAlgorithms/MDWSDescription.h  |  2 +-
 .../Quantification/CachedExperimentInfo.h     |  3 +++
 .../MDAlgorithms/src/BinaryOperationMD.cpp    |  4 +---
 .../MDAlgorithms/src/CalculateCoverageDGS.cpp |  7 ++-----
 Framework/MDAlgorithms/src/ConvToMDBase.cpp   |  1 +
 .../src/ConvertCWPDMDToSpectra.cpp            |  3 +--
 .../src/ConvertCWSDExpToMomentum.cpp          |  3 +--
 .../MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp   |  4 ++--
 .../src/ConvertSpiceDataToRealSpace.cpp       |  3 +--
 .../src/ConvertToDiffractionMDWorkspace.cpp   |  7 ++-----
 Framework/MDAlgorithms/src/ConvertToMD.cpp    |  1 +
 .../src/ConvertToMDMinMaxGlobal.cpp           |  6 ++----
 .../MDAlgorithms/src/ConvertToMDParent.cpp    |  2 +-
 .../src/ConvertToReflectometryQ.cpp           |  1 +
 Framework/MDAlgorithms/src/CreateMD.cpp       |  2 ++
 Framework/MDAlgorithms/src/CutMD.cpp          |  2 ++
 Framework/MDAlgorithms/src/FindPeaksMD.cpp    |  1 +
 .../src/GetSpiceDataRawCountsFromMD.cpp       |  3 +--
 .../MDAlgorithms/src/IntegrateEllipsoids.cpp  |  1 +
 .../MDAlgorithms/src/IntegratePeaksCWSD.cpp   |  3 +--
 .../MDAlgorithms/src/IntegratePeaksMD.cpp     |  2 +-
 .../MDAlgorithms/src/IntegratePeaksMD2.cpp    |  2 +-
 Framework/MDAlgorithms/src/LoadILLAscii.cpp   |  1 +
 Framework/MDAlgorithms/src/LoadSQW.cpp        |  3 ++-
 Framework/MDAlgorithms/src/LoadSQW2.cpp       | 16 ++--------------
 Framework/MDAlgorithms/src/MDNormDirectSC.cpp |  3 +--
 Framework/MDAlgorithms/src/MDNormSCD.cpp      |  4 +---
 .../MDAlgorithms/src/MDWSDescription.cpp      |  6 ++++++
 .../src/PreprocessDetectorsToMD.cpp           |  2 +-
 .../Quantification/CachedExperimentInfo.cpp   |  4 +---
 .../src/Quantification/ForegroundModel.cpp    |  5 ++---
 .../src/Quantification/Models/QCoordinate.cpp |  3 ++-
 .../Resolution/TobyFitBMatrix.cpp             |  1 +
 .../Resolution/TobyFitResolutionModel.cpp     |  3 ++-
 Framework/MDAlgorithms/src/SaveZODS.cpp       |  6 +-----
 .../MDAlgorithms/src/SlicingAlgorithm.cpp     |  3 +--
 .../api/src/Exports/IPeaksWorkspace.cpp       |  1 +
 .../api/src/Exports/MatrixWorkspace.cpp       |  1 +
 .../src/WorkspaceCreationHelper.cpp           |  4 +---
 .../src/DgsConvertToEnergyTransfer.cpp        |  6 +-----
 .../src/DgsPreprocessData.cpp                 |  6 +-----
 .../WorkflowAlgorithms/src/DgsReduction.cpp   |  5 +----
 .../src/EQSANSDarkCurrentSubtraction.cpp      |  4 +---
 .../src/EQSANSDarkCurrentSubtraction2.cpp     |  4 +---
 .../WorkflowAlgorithms/src/EQSANSLoad.cpp     |  4 +---
 .../src/EQSANSMonitorTOF.cpp                  |  4 +---
 .../WorkflowAlgorithms/src/EQSANSQ2D.cpp      |  4 +---
 .../src/HFIRDarkCurrentSubtraction.cpp        |  4 +---
 .../WorkflowAlgorithms/src/HFIRInstrument.cpp |  4 +---
 Framework/WorkflowAlgorithms/src/HFIRLoad.cpp |  4 +---
 .../src/HFIRSANSNormalise.cpp                 |  4 +---
 .../WorkflowAlgorithms/src/RefReduction.cpp   |  4 +---
 .../src/SANSSensitivityCorrection.cpp         |  4 +---
 MantidPlot/src/LabelTool.cpp                  |  1 +
 .../src/Mantid/MantidGroupPlotGenerator.cpp   |  1 +
 .../src/Mantid/MantidSampleMaterialDialog.cpp |  4 +---
 .../src/Mantid/MantidSurfacePlotDialog.cpp    |  1 +
 MantidPlot/src/Mantid/MantidUI.cpp            |  1 +
 MantidPlot/src/Mantid/SampleLogDialogBase.cpp |  5 +----
 .../src/PlotAsymmetryByLogValueDialog.cpp     |  7 +------
 .../EnggDiffFittingPresenter.cpp              |  1 +
 .../src/Indirect/ApplyPaalmanPings.cpp        |  3 ++-
 .../src/Indirect/ContainerSubtraction.cpp     |  3 ++-
 .../CustomInterfaces/src/MantidEVWorker.cpp   |  2 ++
 .../src/MultiDatasetFit/MDFLogValueFinder.cpp |  1 +
 .../src/MultiDatasetFit/MultiDatasetFit.cpp   |  1 +
 .../src/Muon/ALCDataLoadingPresenter.cpp      |  1 +
 .../src/Muon/MuonAnalysisFitDataPresenter.cpp |  1 +
 .../src/Muon/MuonAnalysisHelper.cpp           |  1 +
 .../Muon/MuonAnalysisResultTableCreator.cpp   |  1 +
 .../src/Muon/MuonAnalysisResultTableTab.cpp   |  6 +-----
 .../ReflNexusMeasurementItemSource.cpp        |  4 +---
 .../CustomInterfaces/src/SANSRunWindow.cpp    |  4 +---
 MantidQt/CustomInterfaces/src/StepScan.cpp    |  4 +---
 .../src/Tomography/ImageROIViewQtWidget.cpp   |  1 +
 .../Tomography/TomographyIfaceViewQtGUI.cpp   |  1 +
 .../InstrumentWidgetPickTab.cpp               |  1 +
 .../MantidWidgets/src/SequentialFitDialog.cpp |  9 +--------
 .../src/ConcretePeaksPresenter.cpp            |  1 +
 82 files changed, 105 insertions(+), 174 deletions(-)

diff --git a/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp b/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp
index ffc2dbeed39..60c15b7d24a 100644
--- a/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp
+++ b/Framework/LiveData/src/ISIS/ISISHistoDataListener.cpp
@@ -5,6 +5,7 @@
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/LiveListenerFactory.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/SpectrumDetectorMapping.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceGroup.h"
diff --git a/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp b/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp
index c4ac046f4f1..a2bcc57a8db 100644
--- a/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp
+++ b/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp
@@ -1,37 +1,20 @@
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/LiveListenerFactory.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidLiveData/TOPAZLiveEventDataListener.h"
 #include "MantidLiveData/Exception.h"
-//#include "MantidDataObjects/Events.h"
-//#include "MantidKernel/DateAndTime.h"
-//#include "MantidKernel/Strings.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/UnitFactory.h"
-//#include "MantidKernel/WriteLock.h"
 #include "MantidDataObjects/EventWorkspace.h"
 
 #include <Poco/Net/NetException.h>
 #include <Poco/Net/StreamSocket.h>
 #include <Poco/Net/DatagramSocket.h>
 #include <Poco/Net/SocketAddress.h>
-//#include <Poco/Net/SocketStream.h>
-//#include <Poco/Timestamp.h>
 
-// Includes for parsing the XML device descriptions
-//#include "Poco/DOM/DOMParser.h"
-//#include "Poco/DOM/Document.h"
-//#include "Poco/DOM/AutoPtr.h"
-//#include "Poco/DOM/NodeList.h"
-//#include "Poco/DOM/NamedNodeMap.h"
-
-//#include <Poco/Thread.h>
-//#include <Poco/Runnable.h>
-
-//#include <time.h>
-//#include <sstream> // for ostringstream
 #include <string>
 #include <fstream>
 #include <exception>
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h
index 9af42f7453b..34504cb5c9b 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/LoadSQW2.h
@@ -14,6 +14,9 @@ namespace Mantid {
 namespace API {
 class ExperimentInfo;
 }
+namespace Geometry {
+class OrientedLattice;
+}
 
 namespace MDAlgorithms {
 
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
index 1ed3503f970..2b17821ecad 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h
@@ -104,7 +104,7 @@ public: // for the time being
   std::string getWSName() const { return m_InWS->name(); }
   bool isPowder() const;
   bool isQ3DMode() const;
-  bool hasLattice() const { return m_InWS->sample().hasOrientedLattice(); }
+  bool hasLattice() const;
 
   boost::shared_ptr<Geometry::OrientedLattice> getLattice() const {
     return getOrientedLattice(m_InWS);
diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h
index 22d7b317cac..c3ffe130d93 100644
--- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h
+++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/Quantification/CachedExperimentInfo.h
@@ -28,6 +28,9 @@
 #include "MantidKernel/Matrix.h"
 
 namespace Mantid {
+namespace Geometry {
+class Goniometer;
+}
 namespace MDAlgorithms {
 /**
  * Defines information about a neutron event within a given experiment
diff --git a/Framework/MDAlgorithms/src/BinaryOperationMD.cpp b/Framework/MDAlgorithms/src/BinaryOperationMD.cpp
index a8049dd2af7..6ac64a6c831 100644
--- a/Framework/MDAlgorithms/src/BinaryOperationMD.cpp
+++ b/Framework/MDAlgorithms/src/BinaryOperationMD.cpp
@@ -6,6 +6,7 @@
 #include "MantidDataObjects/MDEventFactory.h"
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
 
@@ -18,7 +19,6 @@ using Mantid::Geometry::IMDDimension_const_sptr;
 namespace Mantid {
 namespace MDAlgorithms {
 
-//----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string BinaryOperationMD::name() const {
   return "BinaryOperationMD";
@@ -32,7 +32,6 @@ const std::string BinaryOperationMD::category() const {
   return "MDAlgorithms\\MDArithmetic";
 }
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void BinaryOperationMD::init() {
@@ -55,7 +54,6 @@ void BinaryOperationMD::init() {
 /// Optional extra properties
 void BinaryOperationMD::initExtraProperties() {}
 
-//----------------------------------------------------------------------------------------------
 /** Execute the algorithm.
  */
 void BinaryOperationMD::exec() {
diff --git a/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp b/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
index ff43cb9dddc..1db1765f795 100644
--- a/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
+++ b/Framework/MDAlgorithms/src/CalculateCoverageDGS.cpp
@@ -1,5 +1,7 @@
 #include "MantidMDAlgorithms/CalculateCoverageDGS.h"
 #include "MantidAPI/InstrumentValidator.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidDataObjects/MDHistoWorkspace.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/ArrayLengthValidator.h"
@@ -29,7 +31,6 @@ bool compareMomentum(const Mantid::Kernel::VMD &v1,
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(CalculateCoverageDGS)
 
-//----------------------------------------------------------------------------------------------
 /** Constructor
  */
 CalculateCoverageDGS::CalculateCoverageDGS()
@@ -40,8 +41,6 @@ CalculateCoverageDGS::CalculateCoverageDGS()
       m_eX(), m_hIdx(-1), m_kIdx(-1), m_lIdx(-1), m_eIdx(-1), m_rubw(3, 3),
       m_normWS() {}
 
-//----------------------------------------------------------------------------------------------
-
 /// Algorithms name for identification. @see Algorithm::name
 const std::string CalculateCoverageDGS::name() const {
   return "CalculateCoverageDGS";
@@ -92,7 +91,6 @@ void CalculateCoverageDGS::cacheDimensionXValues() {
   }
 }
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void CalculateCoverageDGS::init() {
@@ -152,7 +150,6 @@ void CalculateCoverageDGS::init() {
                   "A name for the output data MDHistoWorkspace.");
 }
 
-//----------------------------------------------------------------------------------------------
 /** Execute the algorithm.
  */
 void CalculateCoverageDGS::exec() {
diff --git a/Framework/MDAlgorithms/src/ConvToMDBase.cpp b/Framework/MDAlgorithms/src/ConvToMDBase.cpp
index e63eab348d1..e9a540109e4 100644
--- a/Framework/MDAlgorithms/src/ConvToMDBase.cpp
+++ b/Framework/MDAlgorithms/src/ConvToMDBase.cpp
@@ -1,5 +1,6 @@
 #include "MantidMDAlgorithms/ConvToMDBase.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
diff --git a/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp b/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp
index 372ed733a04..f4160508884 100644
--- a/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp
+++ b/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp
@@ -5,6 +5,7 @@
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/IMDIterator.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidGeometry/Instrument.h"
@@ -22,7 +23,6 @@ DECLARE_ALGORITHM(ConvertCWPDMDToSpectra)
 
 const double BIGNUMBER = 1.0E100;
 
-//----------------------------------------------------------------------------------------------
 void ConvertCWPDMDToSpectra::init() {
 
   declareProperty(make_unique<WorkspaceProperty<IMDEventWorkspace>>(
@@ -76,7 +76,6 @@ void ConvertCWPDMDToSpectra::init() {
                   "is applied to the case that the bin size is small. ");
 }
 
-//----------------------------------------------------------------------------------------------
 void ConvertCWPDMDToSpectra::exec() {
   // Process input workspaces
   // input data workspace
diff --git a/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp b/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp
index b95b819fa96..a6e05402bd0 100644
--- a/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp
+++ b/Framework/MDAlgorithms/src/ConvertCWSDExpToMomentum.cpp
@@ -1,4 +1,5 @@
 #include "MantidMDAlgorithms/ConvertCWSDExpToMomentum.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidGeometry/Instrument.h"
@@ -21,7 +22,6 @@ namespace MDAlgorithms {
 
 DECLARE_ALGORITHM(ConvertCWSDExpToMomentum)
 
-//----------------------------------------------------------------------------------------------
 /** Constructor
  */
 ConvertCWSDExpToMomentum::ConvertCWSDExpToMomentum()
@@ -29,7 +29,6 @@ ConvertCWSDExpToMomentum::ConvertCWSDExpToMomentum()
       m_iMonitorCounts(4), m_iTime(5), m_setQRange(true), m_isBaseName(false),
       m_removeBackground(false) {}
 
-//----------------------------------------------------------------------------------------------
 /** Init to declare property
  */
 void ConvertCWSDExpToMomentum::init() {
diff --git a/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp b/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp
index 5cd76046dd1..0b4cfb8c09e 100644
--- a/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp
+++ b/Framework/MDAlgorithms/src/ConvertCWSDMDtoHKL.cpp
@@ -3,6 +3,8 @@
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/IMDIterator.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 
 #include "MantidGeometry/Crystal/IndexingUtils.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
@@ -33,7 +35,6 @@ using namespace Mantid::Geometry;
 
 DECLARE_ALGORITHM(ConvertCWSDMDtoHKL)
 
-//----------------------------------------------------------------------------------------------
 /** Init
  */
 void ConvertCWSDMDtoHKL::init() {
@@ -65,7 +66,6 @@ void ConvertCWSDMDtoHKL::init() {
                   "Name of file for HKL.");
 }
 
-//----------------------------------------------------------------------------------------------
 /** Exec
  */
 void ConvertCWSDMDtoHKL::exec() {
diff --git a/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp b/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp
index 49b481e5e8b..5bc4e7d654b 100644
--- a/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp
+++ b/Framework/MDAlgorithms/src/ConvertSpiceDataToRealSpace.cpp
@@ -4,6 +4,7 @@
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/IMDIterator.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidDataObjects/MDEventFactory.h"
 #include "MantidDataObjects/MDEventInserter.h"
@@ -32,7 +33,6 @@ using namespace Mantid::DataObjects;
 
 DECLARE_ALGORITHM(ConvertSpiceDataToRealSpace)
 
-//------------------------------------------------------------------------------------------------
 /** Init
  */
 void ConvertSpiceDataToRealSpace::init() {
@@ -90,7 +90,6 @@ void ConvertSpiceDataToRealSpace::init() {
       "Name of a table workspace containing the detectors' efficiency.");
 }
 
-//------------------------------------------------------------------------------------------------
 /** Exec
  */
 void ConvertSpiceDataToRealSpace::exec() {
diff --git a/Framework/MDAlgorithms/src/ConvertToDiffractionMDWorkspace.cpp b/Framework/MDAlgorithms/src/ConvertToDiffractionMDWorkspace.cpp
index c270cce4927..b28b4c769de 100644
--- a/Framework/MDAlgorithms/src/ConvertToDiffractionMDWorkspace.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToDiffractionMDWorkspace.cpp
@@ -3,6 +3,8 @@
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/Progress.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidDataObjects/MDEventFactory.h"
@@ -36,7 +38,6 @@ bool DODEBUG = true;
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(ConvertToDiffractionMDWorkspace)
 
-//----------------------------------------------------------------------------------------------
 /** Constructor
  */
 ConvertToDiffractionMDWorkspace::ConvertToDiffractionMDWorkspace()
@@ -49,9 +50,6 @@ ConvertToDiffractionMDWorkspace::ConvertToDiffractionMDWorkspace()
       m_extentsMax(nullptr) // will be allocated in exec using nDims
 {}
 
-//----------------------------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void ConvertToDiffractionMDWorkspace::init() {
@@ -126,7 +124,6 @@ void ConvertToDiffractionMDWorkspace::init() {
 /// Our MDLeanEvent dimension
 typedef DataObjects::MDLeanEvent<3> MDE;
 
-//----------------------------------------------------------------------------------------------
 /** Convert one spectrum to DataObjects.
  * Depending on options, it uses the histogram view or the
  * pure event view.
diff --git a/Framework/MDAlgorithms/src/ConvertToMD.cpp b/Framework/MDAlgorithms/src/ConvertToMD.cpp
index 7febafb223d..357b1895c9e 100644
--- a/Framework/MDAlgorithms/src/ConvertToMD.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToMD.cpp
@@ -4,6 +4,7 @@
 
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/FileProperty.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/EnabledWhenProperty.h"
 
 #include "MantidKernel/ArrayProperty.h"
diff --git a/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp b/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp
index 4c2eb54b0db..c76c5f6de2b 100644
--- a/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToMDMinMaxGlobal.cpp
@@ -2,6 +2,8 @@
 
 #include "MantidAPI/HistogramValidator.h"
 #include "MantidAPI/InstrumentValidator.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/CompositeValidator.h"
@@ -25,7 +27,6 @@ namespace MDAlgorithms {
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(ConvertToMDMinMaxGlobal)
 
-//----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string ConvertToMDMinMaxGlobal::name() const {
   return "ConvertToMDMinMaxGlobal";
@@ -39,9 +40,6 @@ const std::string ConvertToMDMinMaxGlobal::category() const {
   return "MDAlgorithms\\Creation";
 }
 
-//----------------------------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void ConvertToMDMinMaxGlobal::init() {
diff --git a/Framework/MDAlgorithms/src/ConvertToMDParent.cpp b/Framework/MDAlgorithms/src/ConvertToMDParent.cpp
index 8559fbc82f8..c1ab2ba739b 100644
--- a/Framework/MDAlgorithms/src/ConvertToMDParent.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToMDParent.cpp
@@ -2,6 +2,7 @@
 
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/InstrumentValidator.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 
 #include "MantidKernel/ArrayProperty.h"
@@ -24,7 +25,6 @@ const std::string ConvertToMDParent::category() const {
   return "MDAlgorithms\\Creation";
 }
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
 */
 void ConvertToMDParent::init() {
diff --git a/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp b/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
index a9b88aa06c4..17ca579dfd5 100644
--- a/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
+++ b/Framework/MDAlgorithms/src/ConvertToReflectometryQ.cpp
@@ -4,6 +4,7 @@
 #include "MantidAPI/IEventWorkspace.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/HistogramValidator.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidAPI/Progress.h"
 
diff --git a/Framework/MDAlgorithms/src/CreateMD.cpp b/Framework/MDAlgorithms/src/CreateMD.cpp
index 784662e78bd..a492605d2b1 100644
--- a/Framework/MDAlgorithms/src/CreateMD.cpp
+++ b/Framework/MDAlgorithms/src/CreateMD.cpp
@@ -1,6 +1,8 @@
 #include "MantidMDAlgorithms/CreateMD.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidAPI/FileProperty.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidKernel/EnabledWhenProperty.h"
 #include "MantidKernel/ListValidator.h"
 #include "MantidKernel/MandatoryValidator.h"
diff --git a/Framework/MDAlgorithms/src/CutMD.cpp b/Framework/MDAlgorithms/src/CutMD.cpp
index 8ac80336bc7..114af43693d 100644
--- a/Framework/MDAlgorithms/src/CutMD.cpp
+++ b/Framework/MDAlgorithms/src/CutMD.cpp
@@ -3,6 +3,8 @@
 #include "MantidAPI/IMDHistoWorkspace.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/Projection.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/ListValidator.h"
diff --git a/Framework/MDAlgorithms/src/FindPeaksMD.cpp b/Framework/MDAlgorithms/src/FindPeaksMD.cpp
index 9ebd3fa6bce..0cb21c0dc40 100644
--- a/Framework/MDAlgorithms/src/FindPeaksMD.cpp
+++ b/Framework/MDAlgorithms/src/FindPeaksMD.cpp
@@ -4,6 +4,7 @@
 #include "MantidDataObjects/MDEventFactory.h"
 #include "MantidDataObjects/MDHistoWorkspace.h"
 #include "MantidKernel/VMD.h"
+#include "MantidAPI/Run.h"
 
 #include <boost/math/special_functions/fpclassify.hpp>
 #include <boost/type_traits/integral_constant.hpp>
diff --git a/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp b/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp
index 4970e5af3fc..ddf4bdc9fca 100644
--- a/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp
+++ b/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp
@@ -4,6 +4,7 @@
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/IMDIterator.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidGeometry/Instrument.h"
@@ -17,7 +18,6 @@ using namespace Mantid::Kernel;
 
 DECLARE_ALGORITHM(GetSpiceDataRawCountsFromMD)
 
-//----------------------------------------------------------------------------------------------
 /** Initialization
  * @brief GetSpiceDataRawCountsFromMD::init
  */
@@ -77,7 +77,6 @@ void GetSpiceDataRawCountsFromMD::init() {
                   "be normalized by their monitor counts. ");
 }
 
-//----------------------------------------------------------------------------------------------
 /** Execution body
  * @brief GetSpiceDataRawCountsFromMD::exec
  */
diff --git a/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp b/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
index 9a3a1fb057c..d282d058f97 100644
--- a/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
+++ b/Framework/MDAlgorithms/src/IntegrateEllipsoids.cpp
@@ -2,6 +2,7 @@
 
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/InstrumentValidator.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidDataObjects/EventWorkspace.h"
diff --git a/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp b/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp
index fc9fefebd4a..99fb4f12e50 100644
--- a/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp
+++ b/Framework/MDAlgorithms/src/IntegratePeaksCWSD.cpp
@@ -1,6 +1,7 @@
 #include "MantidMDAlgorithms/IntegratePeaksCWSD.h"
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/IMDIterator.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidDataObjects/Peak.h"
 #include "MantidDataObjects/PeaksWorkspace.h"
@@ -21,7 +22,6 @@ using namespace Mantid::Geometry;
 
 const signal_t THRESHOLD_SIGNAL = 0;
 
-//----------------------------------------------------------------------------------------------
 /** Constructor
  */
 IntegratePeaksCWSD::IntegratePeaksCWSD()
@@ -30,7 +30,6 @@ IntegratePeaksCWSD::IntegratePeaksCWSD()
       m_normalizeByTime(false), m_scaleFactor(0), m_maskDets(false),
       m_haveInputPeakWS(false) {}
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void IntegratePeaksCWSD::init() {
diff --git a/Framework/MDAlgorithms/src/IntegratePeaksMD.cpp b/Framework/MDAlgorithms/src/IntegratePeaksMD.cpp
index d9b8776cbb8..ed62776e64e 100644
--- a/Framework/MDAlgorithms/src/IntegratePeaksMD.cpp
+++ b/Framework/MDAlgorithms/src/IntegratePeaksMD.cpp
@@ -19,6 +19,7 @@
 #include "MantidAPI/FunctionValues.h"
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/IPeakFunction.h"
+#include "MantidAPI/Run.h"
 #include <boost/math/special_functions/fpclassify.hpp>
 #include <gsl/gsl_integration.h>
 #include <fstream>
@@ -35,7 +36,6 @@ using namespace Mantid::DataObjects;
 using namespace Mantid::DataObjects;
 using namespace Mantid::Geometry;
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void IntegratePeaksMD::init() {
diff --git a/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp b/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
index 2f7724a9d32..a8ea69d8be6 100644
--- a/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
+++ b/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp
@@ -21,6 +21,7 @@
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/IPeakFunction.h"
 #include "MantidAPI/Progress.h"
+#include "MantidAPI/Run.h"
 #include <boost/math/special_functions/fpclassify.hpp>
 #include <gsl/gsl_integration.h>
 #include <fstream>
@@ -37,7 +38,6 @@ using namespace Mantid::DataObjects;
 using namespace Mantid::DataObjects;
 using namespace Mantid::Geometry;
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void IntegratePeaksMD2::init() {
diff --git a/Framework/MDAlgorithms/src/LoadILLAscii.cpp b/Framework/MDAlgorithms/src/LoadILLAscii.cpp
index e09beac5302..e5cb0a709f1 100644
--- a/Framework/MDAlgorithms/src/LoadILLAscii.cpp
+++ b/Framework/MDAlgorithms/src/LoadILLAscii.cpp
@@ -13,6 +13,7 @@
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/RegisterFileLoader.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidGeometry/Instrument/ComponentHelper.h"
 #include "MantidGeometry/MDGeometry/MDHistoDimension.h"
diff --git a/Framework/MDAlgorithms/src/LoadSQW.cpp b/Framework/MDAlgorithms/src/LoadSQW.cpp
index d88f420de35..1c4b76220cd 100644
--- a/Framework/MDAlgorithms/src/LoadSQW.cpp
+++ b/Framework/MDAlgorithms/src/LoadSQW.cpp
@@ -1,6 +1,8 @@
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/Progress.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidAPI/WorkspaceProperty.h"
 #include "MantidGeometry/MDGeometry/MDHistoDimensionBuilder.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
@@ -26,7 +28,6 @@ namespace Mantid {
 namespace MDAlgorithms {
 
 namespace {
-//------------------------------------------------------------------------------------------------
 /** Helper function allowing to typecast sequence of bytes into proper expected
 *type.
 * The input buffer is interpreted as the template type
diff --git a/Framework/MDAlgorithms/src/LoadSQW2.cpp b/Framework/MDAlgorithms/src/LoadSQW2.cpp
index 55da008d2c8..7a13209c9b8 100644
--- a/Framework/MDAlgorithms/src/LoadSQW2.cpp
+++ b/Framework/MDAlgorithms/src/LoadSQW2.cpp
@@ -1,12 +1,11 @@
-//------------------------------------------------------------------------------
-// Includes
-//------------------------------------------------------------------------------
 #include "MantidMDAlgorithms/LoadSQW2.h"
 #include "MantidMDAlgorithms/MDWSTransform.h"
 
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/Progress.h"
 #include "MantidAPI/RegisterFileLoader.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidDataObjects/BoxControllerNeXusIO.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
 #include "MantidGeometry/Instrument/Goniometer.h"
@@ -34,9 +33,6 @@ using Kernel::DblMatrix;
 using Kernel::Matrix;
 using Kernel::V3D;
 
-//------------------------------------------------------------------------------
-// Constants
-//------------------------------------------------------------------------------
 namespace {
 /// Defines buffer size for reading the pixel data. It is assumed to be the
 /// number of pixels to read in a single call. A single pixel is 9 float
@@ -54,10 +50,6 @@ constexpr double INV_TWO_PI = 0.5 / M_PI;
 // Register the algorithm into the AlgorithmFactory
 DECLARE_FILELOADER_ALGORITHM(LoadSQW2)
 
-//------------------------------------------------------------------------------
-// Public methods
-//------------------------------------------------------------------------------
-
 /// Algorithms name for identification. @see Algorithm::name
 const std::string LoadSQW2::name() const { return "LoadSQW"; }
 
@@ -96,10 +88,6 @@ int LoadSQW2::confidence(Kernel::FileDescriptor &descriptor) const {
   return 81;
 }
 
-//------------------------------------------------------------------------------
-// Private methods
-//------------------------------------------------------------------------------
-
 /// Initialize the algorithm's properties.
 void LoadSQW2::init() {
   using namespace API;
diff --git a/Framework/MDAlgorithms/src/MDNormDirectSC.cpp b/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
index cbf8e881e93..af8c4b43df7 100644
--- a/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
+++ b/Framework/MDAlgorithms/src/MDNormDirectSC.cpp
@@ -2,6 +2,7 @@
 
 #include "MantidAPI/CommonBinsValidator.h"
 #include "MantidAPI/InstrumentValidator.h"
+#include "MantidAPI/Run.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidDataObjects/MDEventWorkspace.h"
 #include "MantidDataObjects/MDHistoWorkspace.h"
@@ -31,7 +32,6 @@ bool compareMomentum(const Mantid::Kernel::VMD &v1,
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(MDNormDirectSC)
 
-//----------------------------------------------------------------------------------------------
 /**
  * Constructor
  */
@@ -60,7 +60,6 @@ const std::string MDNormDirectSC::summary() const {
 /// Algorithm's name for use in the GUI and help. @see Algorithm::name
 const std::string MDNormDirectSC::name() const { return "MDNormDirectSC"; }
 
-//----------------------------------------------------------------------------------------------
 /**
   * Initialize the algorithm's properties.
   */
diff --git a/Framework/MDAlgorithms/src/MDNormSCD.cpp b/Framework/MDAlgorithms/src/MDNormSCD.cpp
index 744055138e1..1370ab0c821 100644
--- a/Framework/MDAlgorithms/src/MDNormSCD.cpp
+++ b/Framework/MDAlgorithms/src/MDNormSCD.cpp
@@ -2,6 +2,7 @@
 
 #include "MantidAPI/CommonBinsValidator.h"
 #include "MantidAPI/InstrumentValidator.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidDataObjects/MDEventWorkspace.h"
@@ -31,7 +32,6 @@ bool compareMomentum(const Mantid::Kernel::VMD &v1,
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(MDNormSCD)
 
-//----------------------------------------------------------------------------------------------
 /**
  * Constructor
  */
@@ -59,7 +59,6 @@ const std::string MDNormSCD::summary() const {
 /// Algorithm's name for use in the GUI and help. @see Algorithm::name
 const std::string MDNormSCD::name() const { return "MDNormSCD"; }
 
-//----------------------------------------------------------------------------------------------
 /**
   * Initialize the algorithm's properties.
   */
@@ -107,7 +106,6 @@ void MDNormSCD::init() {
                   "A name for the output normalization MDHistoWorkspace.");
 }
 
-//----------------------------------------------------------------------------------------------
 /**
  * Execute the algorithm.
  */
diff --git a/Framework/MDAlgorithms/src/MDWSDescription.cpp b/Framework/MDAlgorithms/src/MDWSDescription.cpp
index 4caed18d9be..442c5a2070a 100644
--- a/Framework/MDAlgorithms/src/MDWSDescription.cpp
+++ b/Framework/MDAlgorithms/src/MDWSDescription.cpp
@@ -3,6 +3,8 @@
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/NumericAxis.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/Strings.h"
@@ -450,5 +452,9 @@ bool MDWSDescription::isQ3DMode() const {
   return this->AlgID.compare("Q3D") == 0;
 }
 
+bool MDWSDescription::hasLattice() const {
+  return m_InWS->sample().hasOrientedLattice();
+}
+
 } // end namespace MDAlgorithms
 } // end namespace Mantid
diff --git a/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp b/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
index f139db95046..20d9ba263b3 100644
--- a/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
+++ b/Framework/MDAlgorithms/src/PreprocessDetectorsToMD.cpp
@@ -2,6 +2,7 @@
 #include "MantidAPI/InstrumentValidator.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/NumericAxis.h"
+#include "MantidAPI/Run.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/CompositeValidator.h"
 #include "MantidKernel/PropertyWithValue.h"
@@ -18,7 +19,6 @@ DECLARE_ALGORITHM(PreprocessDetectorsToMD)
 PreprocessDetectorsToMD::PreprocessDetectorsToMD()
     : m_getEFixed(false), m_getIsMasked(false) {}
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties. */
 void PreprocessDetectorsToMD::init() {
   auto ws_valid = boost::make_shared<Kernel::CompositeValidator>();
diff --git a/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp b/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp
index ed66d421953..dce1e6dba69 100644
--- a/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp
+++ b/Framework/MDAlgorithms/src/Quantification/CachedExperimentInfo.cpp
@@ -1,12 +1,10 @@
-//
-// Includes
-//
 #include "MantidMDAlgorithms/Quantification/CachedExperimentInfo.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidGeometry/Instrument/ReferenceFrame.h"
 #include "MantidGeometry/Instrument/Goniometer.h"
 #include "MantidGeometry/Instrument/DetectorGroup.h"
+#include "MantidAPI/Sample.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
diff --git a/Framework/MDAlgorithms/src/Quantification/ForegroundModel.cpp b/Framework/MDAlgorithms/src/Quantification/ForegroundModel.cpp
index 3655083df19..48087760a1c 100644
--- a/Framework/MDAlgorithms/src/Quantification/ForegroundModel.cpp
+++ b/Framework/MDAlgorithms/src/Quantification/ForegroundModel.cpp
@@ -1,9 +1,8 @@
-//
-// Includes
-//
 #include "MantidMDAlgorithms/Quantification/ForegroundModel.h"
 #include "MantidKernel/Exception.h"
 #include "MantidKernel/MagneticFormFactorTable.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 
 namespace Mantid {
 namespace MDAlgorithms {
diff --git a/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp b/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp
index 11664c0d376..e74436ae338 100644
--- a/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp
+++ b/Framework/MDAlgorithms/src/Quantification/Models/QCoordinate.cpp
@@ -1,5 +1,6 @@
-// Includes
 #include "MantidMDAlgorithms/Quantification/Models/QCoordinate.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include <cmath>
 
 namespace Mantid {
diff --git a/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitBMatrix.cpp b/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitBMatrix.cpp
index 1990468d911..bd7546ff051 100644
--- a/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitBMatrix.cpp
+++ b/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitBMatrix.cpp
@@ -5,6 +5,7 @@
 
 #include "MantidAPI/ChopperModel.h"
 #include "MantidAPI/ModeratorModel.h"
+#include "MantidAPI/Sample.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
 #include "MantidGeometry/Instrument/ReferenceFrame.h"
 
diff --git a/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp b/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp
index 1202cdb98d3..96cc4486aa7 100644
--- a/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp
+++ b/Framework/MDAlgorithms/src/Quantification/Resolution/TobyFitResolutionModel.cpp
@@ -1,10 +1,11 @@
-// Includes
 #include "MantidMDAlgorithms/Quantification/Resolution/TobyFitResolutionModel.h"
 #include "MantidMDAlgorithms/Quantification/Resolution/ModeratorChopperResolution.h"
 #include "MantidMDAlgorithms/Quantification/CachedExperimentInfo.h"
 
 #include "MantidAPI/FrameworkManager.h"
 #include "MantidAPI/IMDEventWorkspace.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidGeometry/Instrument/ReferenceFrame.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
 #include "MantidKernel/MersenneTwister.h"
diff --git a/Framework/MDAlgorithms/src/SaveZODS.cpp b/Framework/MDAlgorithms/src/SaveZODS.cpp
index 07f4e37e62e..495b4d8fd9b 100644
--- a/Framework/MDAlgorithms/src/SaveZODS.cpp
+++ b/Framework/MDAlgorithms/src/SaveZODS.cpp
@@ -1,5 +1,6 @@
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/IMDHistoWorkspace.h"
+#include "MantidAPI/Sample.h"
 #include "MantidKernel/System.h"
 #include "MantidMDAlgorithms/SaveZODS.h"
 #include "MantidDataObjects/MDHistoWorkspace.h"
@@ -16,7 +17,6 @@ namespace MDAlgorithms {
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(SaveZODS)
 
-//----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string SaveZODS::name() const { return "SaveZODS"; }
 
@@ -28,9 +28,6 @@ const std::string SaveZODS::category() const {
   return "MDAlgorithms\\DataHandling";
 }
 
-//----------------------------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void SaveZODS::init() {
@@ -43,7 +40,6 @@ void SaveZODS::init() {
       "The name of the HDF5 file to write, as a full or relative path.");
 }
 
-//----------------------------------------------------------------------------------------------
 /** Execute the algorithm.
  */
 void SaveZODS::exec() {
diff --git a/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp b/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
index 602379d6b54..05d6ee29d07 100644
--- a/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
+++ b/Framework/MDAlgorithms/src/SlicingAlgorithm.cpp
@@ -10,6 +10,7 @@
 #include "MantidKernel/VisibleWhenProperty.h"
 #include "MantidKernel/ArrayLengthValidator.h"
 #include "MantidMDAlgorithms/SlicingAlgorithm.h"
+#include "MantidAPI/Run.h"
 
 #include <boost/regex.hpp>
 
@@ -21,7 +22,6 @@ using Mantid::Kernel::Strings::strip;
 namespace Mantid {
 namespace MDAlgorithms {
 
-//----------------------------------------------------------------------------------------------
 /** Constructor
  */
 SlicingAlgorithm::SlicingAlgorithm()
@@ -30,7 +30,6 @@ SlicingAlgorithm::SlicingAlgorithm()
       m_axisAligned(true), m_outD(0), // unititialized and should be invalid
       m_NormalizeBasisVectors(false) {}
 
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void SlicingAlgorithm::initSlicingProps() {
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp
index 76d09bebf7b..8eeb370e494 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp
@@ -1,4 +1,5 @@
 #include "MantidAPI/IPeaksWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidGeometry/Crystal/IPeak.h"
 #include "MantidPythonInterface/kernel/GetPointer.h"
 #include "MantidPythonInterface/kernel/Converters/PyObjectToV3D.h"
diff --git a/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp b/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
index 8d3edfa0d75..7de857936c6 100644
--- a/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
+++ b/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
@@ -1,5 +1,6 @@
 #include "MantidAPI/Axis.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceOpOverloads.h"
 
 #include "MantidPythonInterface/api/CloneMatrixWorkspace.h"
diff --git a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
index 4b427d045f7..310a1826c0f 100644
--- a/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
+++ b/Framework/TestHelpers/src/WorkspaceCreationHelper.cpp
@@ -8,9 +8,6 @@
  *higher
  *  than DataObjects (e.g. any algorithm), even if going via the factory.
  *********************************************************************************/
-//------------------------------------------------------------------------------
-// Includes
-//------------------------------------------------------------------------------
 #include "MantidTestHelpers/WorkspaceCreationHelper.h"
 #include "MantidTestHelpers/ComponentCreationHelper.h"
 #include "MantidTestHelpers/InstrumentCreationHelper.h"
@@ -19,6 +16,7 @@
 #include "MantidAPI/Run.h"
 #include "MantidAPI/IAlgorithm.h"
 #include "MantidAPI/Algorithm.h"
+#include "MantidAPI/Sample.h"
 #include "MantidAPI/SpectraAxis.h"
 #include "MantidAPI/NumericAxis.h"
 #include "MantidDataObjects/PeaksWorkspace.h"
diff --git a/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp b/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
index 2159055666e..8736a061c97 100644
--- a/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
+++ b/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp
@@ -1,6 +1,7 @@
 #include "MantidWorkflowAlgorithms/DgsConvertToEnergyTransfer.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidKernel/PropertyManagerDataService.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceHistory.h"
 #include "MantidGeometry/IDetector.h"
 #include "MantidGeometry/Instrument.h"
@@ -30,7 +31,6 @@ namespace WorkflowAlgorithms {
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(DgsConvertToEnergyTransfer)
 
-//----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DgsConvertToEnergyTransfer::name() const {
   return "DgsConvertToEnergyTransfer";
@@ -44,9 +44,6 @@ const std::string DgsConvertToEnergyTransfer::category() const {
   return "Workflow\\Inelastic\\UsesPropertyManager";
 }
 
-//----------------------------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void DgsConvertToEnergyTransfer::init() {
@@ -87,7 +84,6 @@ void DgsConvertToEnergyTransfer::init() {
                         Direction::Input);
 }
 
-//----------------------------------------------------------------------------------------------
 /** Execute the algorithm.
  */
 void DgsConvertToEnergyTransfer::exec() {
diff --git a/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp b/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp
index 4a27bce5158..3e1a7d356f8 100644
--- a/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp
+++ b/Framework/WorkflowAlgorithms/src/DgsPreprocessData.cpp
@@ -5,6 +5,7 @@
 #include "MantidAPI/FileFinder.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/PropertyManagerDataService.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/ConfigService.h"
@@ -26,7 +27,6 @@ namespace WorkflowAlgorithms {
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(DgsPreprocessData)
 
-//----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DgsPreprocessData::name() const {
   return "DgsPreprocessData";
@@ -40,9 +40,6 @@ const std::string DgsPreprocessData::category() const {
   return "Workflow\\Inelastic\\UsesPropertyManager";
 }
 
-//----------------------------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void DgsPreprocessData::init() {
@@ -63,7 +60,6 @@ void DgsPreprocessData::init() {
                         Direction::Input);
 }
 
-//----------------------------------------------------------------------------------------------
 /** Execute the algorithm.
  */
 void DgsPreprocessData::exec() {
diff --git a/Framework/WorkflowAlgorithms/src/DgsReduction.cpp b/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
index 4a53a2b3ea9..0bdada58e55 100644
--- a/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
+++ b/Framework/WorkflowAlgorithms/src/DgsReduction.cpp
@@ -1,6 +1,7 @@
 #include "MantidWorkflowAlgorithms/DgsReduction.h"
 
 #include "MantidAPI/FileProperty.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/PropertyManagerDataService.h"
 #include "MantidKernel/ArrayProperty.h"
 #include "MantidKernel/BoundedValidator.h"
@@ -27,7 +28,6 @@ namespace WorkflowAlgorithms {
 // Register the algorithm into the AlgorithmFactory
 DECLARE_ALGORITHM(DgsReduction)
 
-//----------------------------------------------------------------------------------------------
 /// Algorithm's name for identification. @see Algorithm::name
 const std::string DgsReduction::name() const { return "DgsReduction"; }
 
@@ -39,9 +39,6 @@ const std::string DgsReduction::category() const {
   return "Workflow\\Inelastic";
 }
 
-//----------------------------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------------------------
 /** Initialize the algorithm's properties.
  */
 void DgsReduction::init() {
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp b/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp
index 007283c41f2..a4e189b80a0 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction.cpp
@@ -1,11 +1,9 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/EQSANSDarkCurrentSubtraction.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidAPI/FileProperty.h"
+#include "MantidAPI/Run.h"
 #include "Poco/Path.h"
 #include "Poco/String.h"
 #include "MantidAPI/AlgorithmProperty.h"
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp b/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp
index 4192b2e24f8..fc5db20edeb 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSDarkCurrentSubtraction2.cpp
@@ -1,11 +1,9 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/EQSANSDarkCurrentSubtraction2.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidAPI/AlgorithmProperty.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidKernel/PropertyManagerDataService.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidGeometry/IDetector.h"
 #include "MantidKernel/PropertyManager.h"
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp b/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
index e86447ac3d9..59c6490ef04 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSLoad.cpp
@@ -1,6 +1,3 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/EQSANSLoad.h"
 #include "MantidWorkflowAlgorithms/EQSANSInstrument.h"
 #include "MantidAPI/AlgorithmManager.h"
@@ -9,6 +6,7 @@
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/FileFinder.h"
 #include "MantidAPI/FileProperty.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/PropertyManagerDataService.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidGeometry/Instrument.h"
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp b/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp
index 4a738618f6c..722da805e1e 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSMonitorTOF.cpp
@@ -1,7 +1,5 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/EQSANSMonitorTOF.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidKernel/TimeSeriesProperty.h"
diff --git a/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp b/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp
index bb955db0a68..32d410265f4 100644
--- a/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp
+++ b/Framework/WorkflowAlgorithms/src/EQSANSQ2D.cpp
@@ -1,8 +1,6 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/EQSANSQ2D.h"
 #include "MantidWorkflowAlgorithms/EQSANSInstrument.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
 #include "MantidGeometry/Instrument.h"
 #include "Poco/NumberFormatter.h"
diff --git a/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp b/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp
index f02ebc23bc1..812c1038fd6 100644
--- a/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp
+++ b/Framework/WorkflowAlgorithms/src/HFIRDarkCurrentSubtraction.cpp
@@ -1,6 +1,3 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/HFIRDarkCurrentSubtraction.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/WorkspaceUnitValidator.h"
@@ -8,6 +5,7 @@
 #include "Poco/Path.h"
 #include "Poco/String.h"
 #include "MantidAPI/AlgorithmProperty.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/PropertyManagerDataService.h"
 #include "MantidKernel/PropertyManager.h"
 
diff --git a/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp b/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp
index ceb5c81114a..7b77328ece3 100644
--- a/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp
+++ b/Framework/WorkflowAlgorithms/src/HFIRInstrument.cpp
@@ -1,6 +1,3 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/HFIRInstrument.h"
 #include "MantidKernel/Exception.h"
 #include "MantidKernel/Property.h"
@@ -8,6 +5,7 @@
 #include "MantidDataObjects/Workspace2D.h"
 #include "MantidKernel/StringTokenizer.h"
 #include "MantidGeometry/Instrument.h"
+#include "MantidAPI/Run.h"
 #include "Poco/NumberParser.h"
 
 namespace Mantid {
diff --git a/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp b/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp
index 858e1d276c0..72a933f66a6 100644
--- a/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp
+++ b/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp
@@ -1,6 +1,3 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include <string>
 
 #include "MantidWorkflowAlgorithms/HFIRLoad.h"
@@ -10,6 +7,7 @@
 #include "MantidAPI/AlgorithmProperty.h"
 #include "MantidKernel/PropertyManagerDataService.h"
 #include "MantidAPI/FileProperty.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/PropertyManager.h"
 
 namespace Mantid {
diff --git a/Framework/WorkflowAlgorithms/src/HFIRSANSNormalise.cpp b/Framework/WorkflowAlgorithms/src/HFIRSANSNormalise.cpp
index 223b2a2757d..7c7467a5e3e 100644
--- a/Framework/WorkflowAlgorithms/src/HFIRSANSNormalise.cpp
+++ b/Framework/WorkflowAlgorithms/src/HFIRSANSNormalise.cpp
@@ -1,8 +1,6 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/HFIRSANSNormalise.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/ListValidator.h"
 
 #include <boost/algorithm/string.hpp>
diff --git a/Framework/WorkflowAlgorithms/src/RefReduction.cpp b/Framework/WorkflowAlgorithms/src/RefReduction.cpp
index 26f5f8b2e11..fa22f2acedf 100644
--- a/Framework/WorkflowAlgorithms/src/RefReduction.cpp
+++ b/Framework/WorkflowAlgorithms/src/RefReduction.cpp
@@ -1,9 +1,7 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/RefReduction.h"
 #include "MantidAPI/FileFinder.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidGeometry/Instrument.h"
 #include "MantidKernel/ArrayProperty.h"
diff --git a/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp b/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp
index fde9c01e11a..350d754009a 100644
--- a/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp
+++ b/Framework/WorkflowAlgorithms/src/SANSSensitivityCorrection.cpp
@@ -1,6 +1,3 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidWorkflowAlgorithms/SANSSensitivityCorrection.h"
 #include "MantidDataObjects/EventWorkspace.h"
 #include "MantidAPI/AnalysisDataService.h"
@@ -8,6 +5,7 @@
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidAPI/FileProperty.h"
 #include "MantidAPI/FileFinder.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/TableRow.h"
 #include "Poco/File.h"
 #include "Poco/Path.h"
diff --git a/MantidPlot/src/LabelTool.cpp b/MantidPlot/src/LabelTool.cpp
index 2fdfd68ae7a..e956a22180b 100644
--- a/MantidPlot/src/LabelTool.cpp
+++ b/MantidPlot/src/LabelTool.cpp
@@ -7,6 +7,7 @@
 #include "Mantid/LabelToolLogValuesDialog.h"
 // Mantid
 #include "MantidKernel/TimeSeriesProperty.h"
+#include "MantidAPI/Run.h"
 // Qwt
 #include <qwt_picker.h>
 #include <qwt_plot_canvas.h>
diff --git a/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp b/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp
index 2fede3c1cd4..1f798100abb 100644
--- a/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp
+++ b/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp
@@ -1,6 +1,7 @@
 #include "MantidGroupPlotGenerator.h"
 
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 
 using Mantid::API::WorkspaceGroup_const_sptr;
diff --git a/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp b/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp
index 9493d788026..ca0a69a9573 100644
--- a/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp
+++ b/MantidPlot/src/Mantid/MantidSampleMaterialDialog.cpp
@@ -1,12 +1,10 @@
-//----------------------------------
-// Includes
-//----------------------------------
 #include "MantidSampleMaterialDialog.h"
 
 #include "MantidUI.h"
 
 #include "MantidAPI/ExperimentInfo.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Sample.h"
 #include "MantidKernel/Material.h"
 
 #include <QTreeWidgetItem>
diff --git a/MantidPlot/src/Mantid/MantidSurfacePlotDialog.cpp b/MantidPlot/src/Mantid/MantidSurfacePlotDialog.cpp
index bc14dce8eb2..a8f7da5ed3f 100644
--- a/MantidPlot/src/Mantid/MantidSurfacePlotDialog.cpp
+++ b/MantidPlot/src/Mantid/MantidSurfacePlotDialog.cpp
@@ -1,6 +1,7 @@
 #include "MantidSurfacePlotDialog.h"
 #include "MantidAPI/IMDWorkspace.h"
 #include "MantidAPI/ExperimentInfo.h"
+#include "MantidAPI/Run.h"
 #include <QMessageBox>
 
 using Mantid::API::IMDWorkspace;
diff --git a/MantidPlot/src/Mantid/MantidUI.cpp b/MantidPlot/src/Mantid/MantidUI.cpp
index 4162f0a243a..1108b9ea90d 100644
--- a/MantidPlot/src/Mantid/MantidUI.cpp
+++ b/MantidPlot/src/Mantid/MantidUI.cpp
@@ -48,6 +48,7 @@
 #include "MantidAPI/IMDHistoWorkspace.h"
 #include "MantidAPI/IMDEventWorkspace.h"
 #include "MantidAPI/IPeaksWorkspace.h"
+#include "MantidAPI/Run.h"
 
 #include <QMessageBox>
 #include <QTextEdit>
diff --git a/MantidPlot/src/Mantid/SampleLogDialogBase.cpp b/MantidPlot/src/Mantid/SampleLogDialogBase.cpp
index 124c481253d..07e7c360d57 100644
--- a/MantidPlot/src/Mantid/SampleLogDialogBase.cpp
+++ b/MantidPlot/src/Mantid/SampleLogDialogBase.cpp
@@ -1,12 +1,9 @@
-//----------------------------------
-// Includes
-//----------------------------------
-
 #include "SampleLogDialogBase.h"
 
 // Mantid API
 #include <MantidAPI/MultipleExperimentInfos.h>
 #include <MantidAPI/IMDWorkspace.h>
+#include "MantidAPI/Run.h"
 
 // Mantid Kernel
 #include <MantidKernel/TimeSeriesProperty.h>
diff --git a/MantidQt/CustomDialogs/src/PlotAsymmetryByLogValueDialog.cpp b/MantidQt/CustomDialogs/src/PlotAsymmetryByLogValueDialog.cpp
index 4e597c62e2c..4e4407a53ec 100644
--- a/MantidQt/CustomDialogs/src/PlotAsymmetryByLogValueDialog.cpp
+++ b/MantidQt/CustomDialogs/src/PlotAsymmetryByLogValueDialog.cpp
@@ -5,6 +5,7 @@
 #include "MantidAPI/AlgorithmFactory.h"
 #include "MantidAPI/Algorithm.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 
 #include <QLabel>
 #include <QLineEdit>
@@ -30,9 +31,6 @@ DECLARE_DIALOG(PlotAsymmetryByLogValueDialog)
 using namespace MantidQt::CustomDialogs;
 using namespace MantidQt::API;
 
-//---------------------------------------
-// Public member functions
-//---------------------------------------
 /**
  * Constructor
  */
@@ -51,9 +49,6 @@ PlotAsymmetryByLogValueDialog::~PlotAsymmetryByLogValueDialog() {
   delete browseButtonMapper;
 }
 
-//---------------------------------------
-// Private member functions
-//---------------------------------------
 /**
  * Reimplemented virtual function to set up the dialog
  */
diff --git a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp
index f23d5878dd3..6f7f31fe0f0 100644
--- a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp
@@ -2,6 +2,7 @@
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidQtCustomInterfaces/EnggDiffraction/EnggDiffFittingPresWorker.h"
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp
index a72c1c4c083..5806df93a0c 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp
@@ -1,6 +1,7 @@
 #include "MantidQtCustomInterfaces/Indirect/ApplyPaalmanPings.h"
 #include "MantidQtCustomInterfaces/UserInputValidator.h"
 #include "MantidAPI/AnalysisDataService.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/TextAxis.h"
 
 #include <QStringList>
@@ -590,4 +591,4 @@ void ApplyPaalmanPings::plotClicked() {
   }
 }
 } // namespace CustomInterfaces
-} // namespace MantidQt
\ No newline at end of file
+} // namespace MantidQt
diff --git a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
index f925596bd18..96880b9ab86 100644
--- a/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
+++ b/MantidQt/CustomInterfaces/src/Indirect/ContainerSubtraction.cpp
@@ -2,6 +2,7 @@
 #include "MantidQtCustomInterfaces/UserInputValidator.h"
 
 #include "MantidAPI/Axis.h"
+#include "MantidAPI/Run.h"
 
 using namespace Mantid::API;
 
@@ -480,4 +481,4 @@ void ContainerSubtraction::plotClicked() {
 }
 
 } // namespace CustomInterfaces
-} // namespace MantidQt
\ No newline at end of file
+} // namespace MantidQt
diff --git a/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp b/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp
index 90ae3683607..2c77df8d14f 100644
--- a/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp
+++ b/MantidQt/CustomInterfaces/src/MantidEVWorker.cpp
@@ -8,6 +8,8 @@
 #include "MantidAPI/IEventWorkspace.h"
 #include "MantidAPI/IMDWorkspace.h"
 #include "MantidAPI/IPeaksWorkspace.h"
+#include "MantidAPI/Run.h"
+#include "MantidAPI/Sample.h"
 #include "MantidGeometry/Crystal/IPeak.h"
 #include "MantidGeometry/Crystal/OrientedLattice.h"
 #include "MantidKernel/EmptyValues.h"
diff --git a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFLogValueFinder.cpp b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFLogValueFinder.cpp
index 4451e7ee15a..65a92b9fc7a 100644
--- a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFLogValueFinder.cpp
+++ b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFLogValueFinder.cpp
@@ -1,5 +1,6 @@
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidQtCustomInterfaces/MultiDatasetFit/MDFLogValueFinder.h"
 #include <ostream>
 
diff --git a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp
index 920ffb583a6..0fa179229e8 100644
--- a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp
+++ b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp
@@ -8,6 +8,7 @@
 #include "MantidAPI/FunctionFactory.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 
 #include "MantidQtAPI/AlgorithmRunner.h"
diff --git a/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp b/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp
index b260dd3b220..51cf8c18a0b 100644
--- a/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/Muon/ALCDataLoadingPresenter.cpp
@@ -2,6 +2,7 @@
 
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/Strings.h"
 #include "MantidGeometry/Instrument.h"
 
diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp
index 31e3949578c..9860a424bd3 100644
--- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp
+++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp
@@ -2,6 +2,7 @@
 #include "MantidAPI/GroupingLoader.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/Workspace_fwd.h"
 #include "MantidAPI/WorkspaceFactory.h"
diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp
index 429ca32cb50..a4ce67ab68a 100644
--- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp
+++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp
@@ -3,6 +3,7 @@
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/ScopedWorkspace.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceGroup.h"
diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableCreator.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableCreator.cpp
index dfb30a2795e..12ddafb3d2b 100644
--- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableCreator.cpp
+++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableCreator.cpp
@@ -1,6 +1,7 @@
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/ExperimentInfo.h"
 #include "MantidAPI/ITableWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/WorkspaceGroup.h"
diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableTab.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableTab.cpp
index 783c91d5fe8..f1b63ef0f15 100644
--- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableTab.cpp
+++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisResultTableTab.cpp
@@ -1,10 +1,8 @@
-//----------------------------------------------------------------------
-// Includes
-//----------------------------------------------------------------------
 #include "MantidQtCustomInterfaces/Muon/MuonAnalysisResultTableTab.h"
 #include "MantidAPI/ExperimentInfo.h"
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidKernel/ConfigService.h"
@@ -27,8 +25,6 @@
 
 #include <algorithm>
 
-//-----------------------------------------------------------------------------
-
 namespace MantidQt {
 namespace CustomInterfaces {
 namespace Muon {
diff --git a/MantidQt/CustomInterfaces/src/Reflectometry/ReflNexusMeasurementItemSource.cpp b/MantidQt/CustomInterfaces/src/Reflectometry/ReflNexusMeasurementItemSource.cpp
index c826a53602a..25787d49a8e 100644
--- a/MantidQt/CustomInterfaces/src/Reflectometry/ReflNexusMeasurementItemSource.cpp
+++ b/MantidQt/CustomInterfaces/src/Reflectometry/ReflNexusMeasurementItemSource.cpp
@@ -1,10 +1,10 @@
-
 #include "MantidQtCustomInterfaces/Reflectometry/ReflNexusMeasurementItemSource.h"
 #include <Poco/File.h>
 #include <Poco/Exception.h>
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/Workspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include <iostream>
@@ -18,12 +18,10 @@ using namespace Mantid::Kernel;
 namespace MantidQt {
 namespace CustomInterfaces {
 
-//----------------------------------------------------------------------------------------------
 /** Constructor
  */
 ReflNexusMeasurementItemSource::ReflNexusMeasurementItemSource() {}
 
-//----------------------------------------------------------------------------------------------
 /** Destructor
  */
 ReflNexusMeasurementItemSource::~ReflNexusMeasurementItemSource() {}
diff --git a/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp b/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
index 3a4ed70dc13..03850850be0 100644
--- a/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
+++ b/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp
@@ -1,6 +1,3 @@
-//----------------------
-// Includes
-//----------------------
 #include "MantidQtCustomInterfaces/SANSRunWindow.h"
 
 #include "MantidKernel/ConfigService.h"
@@ -16,6 +13,7 @@
 #include "MantidAPI/AnalysisDataService.h"
 #include "MantidAPI/IAlgorithm.h"
 #include "MantidAPI/IEventWorkspace.h"
+#include "MantidAPI/Sample.h"
 #include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceGroup.h"
 
diff --git a/MantidQt/CustomInterfaces/src/StepScan.cpp b/MantidQt/CustomInterfaces/src/StepScan.cpp
index dd6701a6c50..f1d7f4108dc 100644
--- a/MantidQt/CustomInterfaces/src/StepScan.cpp
+++ b/MantidQt/CustomInterfaces/src/StepScan.cpp
@@ -1,11 +1,9 @@
-//----------------------
-// Includes
-//----------------------
 #include "MantidQtCustomInterfaces/StepScan.h"
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/IEventWorkspace.h"
 #include "MantidAPI/InstrumentDataService.h"
 #include "MantidAPI/LiveListenerFactory.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/InstrumentInfo.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include <QFileInfo>
diff --git a/MantidQt/CustomInterfaces/src/Tomography/ImageROIViewQtWidget.cpp b/MantidQt/CustomInterfaces/src/Tomography/ImageROIViewQtWidget.cpp
index 278d831abad..c5b1c5e74f7 100644
--- a/MantidQt/CustomInterfaces/src/Tomography/ImageROIViewQtWidget.cpp
+++ b/MantidQt/CustomInterfaces/src/Tomography/ImageROIViewQtWidget.cpp
@@ -1,4 +1,5 @@
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceGroup.h"
 #include "MantidKernel/ConfigService.h"
 #include "MantidQtAPI/AlgorithmInputHistory.h"
diff --git a/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceViewQtGUI.cpp b/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceViewQtGUI.cpp
index e64e183c24b..796fd818a02 100644
--- a/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceViewQtGUI.cpp
+++ b/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceViewQtGUI.cpp
@@ -1,6 +1,7 @@
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/MatrixWorkspace.h"
 #include "MantidAPI/ITableWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidQtAPI/AlgorithmInputHistory.h"
 
diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
index f604ed4bc0b..85129cfb59f 100644
--- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
+++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp
@@ -17,6 +17,7 @@
 #include "MantidAPI/ITableWorkspace.h"
 #include "MantidAPI/IPeaksWorkspace.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Sample.h"
 #include "MantidAPI/WorkspaceFactory.h"
 #include "MantidAPI/TableRow.h"
 #include "MantidAPI/FrameworkManager.h"
diff --git a/MantidQt/MantidWidgets/src/SequentialFitDialog.cpp b/MantidQt/MantidWidgets/src/SequentialFitDialog.cpp
index e671d4881d5..58ff125c816 100644
--- a/MantidQt/MantidWidgets/src/SequentialFitDialog.cpp
+++ b/MantidQt/MantidWidgets/src/SequentialFitDialog.cpp
@@ -1,7 +1,3 @@
-//---------------------------------------
-// Includes
-//---------------------------------------
-
 #include "MantidQtMantidWidgets/SequentialFitDialog.h"
 #include "MantidQtMantidWidgets/FitPropertyBrowser.h"
 #include "MantidQtMantidWidgets/SelectWorkspacesDialog.h"
@@ -10,6 +6,7 @@
 #include "MantidAPI/CompositeFunction.h"
 #include "MantidAPI/CompositeFunction.h"
 #include "MantidAPI/MatrixWorkspace.h"
+#include "MantidAPI/Run.h"
 #include "MantidKernel/TimeSeriesProperty.h"
 #include "MantidKernel/ConfigService.h"
 
@@ -21,10 +18,6 @@
 #include <QDesktopServices>
 #include <QUrl>
 
-//---------------------------------------
-// Public member functions
-//---------------------------------------
-
 namespace MantidQt {
 namespace MantidWidgets {
 
diff --git a/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp b/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp
index f83fb8f7bdb..f4853f6d04b 100644
--- a/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp
+++ b/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp
@@ -11,6 +11,7 @@
 #include "MantidAPI/IMDWorkspace.h"
 #include "MantidAPI/AlgorithmManager.h"
 #include "MantidAPI/IAlgorithm.h"
+#include "MantidAPI/Sample.h"
 #include "MantidGeometry/MDGeometry/IMDDimension.h"
 #include "MantidKernel/Logger.h"
 #include <boost/scoped_ptr.hpp>
-- 
GitLab