diff --git a/CHANGELOG b/CHANGELOG
index c78e09873fc96d6ba1cc3ac231af846384f0198d..9270c5bf247dca970f46188d8e97cbc16b531d7b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@ BornAgain-22.0, in preparation
     * Removed RectangularDetector.
     * Removed AddLayerWithTopRoughness. Roughness now belongs to the layer itself.
     * Offspec analyzer is set for detector, not scan(#651)
+    * Multilayer was renamed to Sample
     * FitObjective::addSimulationAndData has been replaced by function addFitPair,
       which takes experimental data in form of a Datafield object instead of a NumPy array
     * Function ba_plot.plot_histogram is replaced by plot_simulation_result
diff --git a/GUI/Model/FromCore/GUIExamplesFactory.cpp b/GUI/Model/FromCore/GUIExamplesFactory.cpp
index 8f232b7197ff89efac3615b4fc407e48b75f40d3..1b2ae7b25ef771852bb0324b357e0f5bb36342b8 100644
--- a/GUI/Model/FromCore/GUIExamplesFactory.cpp
+++ b/GUI/Model/FromCore/GUIExamplesFactory.cpp
@@ -21,7 +21,7 @@
 
 namespace {
 
-const QMap<QString, std::tuple<QString, QString, std::function<MultiLayer*()>>> builders{
+const QMap<QString, std::tuple<QString, QString, std::function<Sample*()>>> builders{
     {"CylindersAndPrismsBuilder",
      {"Cylinder and prisms", "Mixture of cylinders and prisms without interference",
       ExemplarySamples::createCylindersAndPrisms}},
@@ -68,7 +68,7 @@ SampleItem* GUI::ExamplesFactory::itemizeSample(const QString& name)
 {
     ASSERT(isValidExampleName(name));
     auto [title, description, builder] = builders[name];
-    MultiLayer* sample = builder();
+    Sample* sample = builder();
     ASSERT(sample);
     SampleItem* result = GUI::FromCore::itemizeSample(*sample, name);
     result->setName(title);
diff --git a/GUI/Model/FromCore/ItemizeSample.cpp b/GUI/Model/FromCore/ItemizeSample.cpp
index 840a2e66130d4840a066b7238672bbea73d7f544..78e99d8bf2dde6e1481c0ee3d1ec72124baf9777 100644
--- a/GUI/Model/FromCore/ItemizeSample.cpp
+++ b/GUI/Model/FromCore/ItemizeSample.cpp
@@ -29,7 +29,7 @@
 #include "Sample/HardParticle/HardParticles.h"
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/CoreAndShell.h"
 #include "Sample/Particle/Crystal.h"
@@ -641,7 +641,7 @@ void copyParticle(const IParticle* iparticle, MaterialsSet& matItems,
 
 namespace GUI::FromCore {
 
-SampleItem* itemizeSample(const MultiLayer& sample, const QString& nodeName)
+SampleItem* itemizeSample(const Sample& sample, const QString& nodeName)
 {
     auto* result = new SampleItem;
     result->setName(nodeName.isEmpty() ? QString::fromStdString(sample.name()) : nodeName);
diff --git a/GUI/Model/FromCore/ItemizeSample.h b/GUI/Model/FromCore/ItemizeSample.h
index 77f9b64dfc28bc30cad734647b8532257f77eef8..6e53fd2ec76318a86ddac04fbb714966702b54d1 100644
--- a/GUI/Model/FromCore/ItemizeSample.h
+++ b/GUI/Model/FromCore/ItemizeSample.h
@@ -17,13 +17,13 @@
 
 #include <QString>
 
-class MultiLayer;
+class Sample;
 class SampleItem;
 
 namespace GUI::FromCore {
 
 //! Builds GUI sample structure from a domain sample structure.
-SampleItem* itemizeSample(const MultiLayer& sample, const QString& nodeName = "");
+SampleItem* itemizeSample(const Sample& sample, const QString& nodeName = "");
 
 } // namespace GUI::FromCore
 
diff --git a/GUI/Model/Sample/SampleValidator.cpp b/GUI/Model/Sample/SampleValidator.cpp
index b4f9b3a7e6b5bb6718623544d99d3a872e5ec3a2..5093323606fbe5210cacec417f5304042986385a 100644
--- a/GUI/Model/Sample/SampleValidator.cpp
+++ b/GUI/Model/Sample/SampleValidator.cpp
@@ -29,10 +29,10 @@ QString SampleValidator::isValidSample(const SampleItem* sample)
     std::vector<LayerItem*> layers = sample->layerItems();
 
     if (layers.empty())
-        append("MultiLayer should contain at least one layer.");
+        append("Sample should contain at least one layer.");
     if (layers.size() == 1)
         if (layers.front()->layoutItems().empty())
-            append("The single layer in your MultiLayer should contain a particle layout.");
+            append("The single layer in your Sample should contain a particle layout.");
 
     for (const auto* layer : layers) {
         for (const auto* layout : layer->layoutItems()) {
@@ -51,7 +51,7 @@ QString SampleValidator::isValidSample(const SampleItem* sample)
         }
     }
     if (!messages.isEmpty())
-        messages = "Cannot setup DWBA simulation for given MultiLayer.\n" + messages;
+        messages = "Cannot setup DWBA simulation for given Sample.\n" + messages;
 
     return messages;
 }
diff --git a/GUI/Model/Sim/InstrumentItems.cpp b/GUI/Model/Sim/InstrumentItems.cpp
index 8bd3f04bd77267012dee0052bcb24f6f99491a17..c7ba92c3e1746790fd0c99dcc771ff194c9e9e17 100644
--- a/GUI/Model/Sim/InstrumentItems.cpp
+++ b/GUI/Model/Sim/InstrumentItems.cpp
@@ -38,7 +38,7 @@
 #include "GUI/Model/Sim/InstrumentItems.h"
 #include "GUI/Model/Util/Backup.h"
 #include "Param/Distrib/Distributions.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sim/Background/IBackground.h"
 #include "Sim/Scan/AlphaScan.h"
 #include "Sim/Simulation/includeSimulations.h"
@@ -272,7 +272,7 @@ std::unique_ptr<Frame> Scatter2DInstrumentItem::createFrame() const
     return std::make_unique<Frame>(normalDetector()->clippedFrame());
 }
 
-ISimulation* Scatter2DInstrumentItem::createSimulation(const MultiLayer& sample) const
+ISimulation* Scatter2DInstrumentItem::createSimulation(const Sample& sample) const
 {
     std::unique_ptr<Beam> beam = beamItem()->createBeam();
     if (withPolarizer())
@@ -362,7 +362,7 @@ std::unique_ptr<Frame> OffspecInstrumentItem::createFrame() const
                                    detectorItem()->createOffspecDetector()->axis(1).clone());
 }
 
-ISimulation* OffspecInstrumentItem::createSimulation(const MultiLayer& sample) const
+ISimulation* OffspecInstrumentItem::createSimulation(const Sample& sample) const
 {
     const Frame frame = makeFrame();
     std::unique_ptr<OffspecDetector> detector = detectorItem()->createOffspecDetector();
@@ -467,7 +467,7 @@ std::unique_ptr<Frame> SpecularInstrumentItem::createFrame() const
     return std::make_unique<Frame>(axis.clone());
 }
 
-ISimulation* SpecularInstrumentItem::createSimulation(const MultiLayer& sample) const
+ISimulation* SpecularInstrumentItem::createSimulation(const Sample& sample) const
 {
     std::unique_ptr<const Frame> frame = createFrame();
     std::unique_ptr<BeamScan> scan = createScan(frame->axis(0));
@@ -541,7 +541,7 @@ std::unique_ptr<Frame> DepthprobeInstrumentItem::createFrame() const
     return std::make_unique<Frame>(axes);
 }
 
-ISimulation* DepthprobeInstrumentItem::createSimulation(const MultiLayer& sample) const
+ISimulation* DepthprobeInstrumentItem::createSimulation(const Sample& sample) const
 {
     const Frame frame = makeFrame();
     std::unique_ptr<BeamScan> scan = createScan(frame.axis(0));
diff --git a/GUI/Model/Sim/InstrumentItems.h b/GUI/Model/Sim/InstrumentItems.h
index 146f77ff516a958ecc1d94aba6a71889685e997a..774b392a37609d2fc5cd6a2b94be9e13b4139cfe 100644
--- a/GUI/Model/Sim/InstrumentItems.h
+++ b/GUI/Model/Sim/InstrumentItems.h
@@ -29,9 +29,9 @@ class DetectorItem;
 class Frame;
 class IDetector;
 class ISimulation;
-class MultiLayer;
 class OffspecDetectorItem;
 class PhysicalScan;
+class Sample;
 class Scale;
 class ScanItem;
 
@@ -56,7 +56,7 @@ public:
     virtual std::unique_ptr<Frame> createFrame() const = 0;
     virtual Frame makeFrame() const;
 
-    virtual ISimulation* createSimulation(const MultiLayer& sample) const = 0;
+    virtual ISimulation* createSimulation(const Sample& sample) const = 0;
 
     virtual void writeTo(QXmlStreamWriter* w) const;
     virtual void readFrom(QXmlStreamReader* r);
@@ -126,7 +126,7 @@ public:
     size_t axdim(int i) const override;
     void updateToRealData(const DatafileItem* dfi) override;
     std::unique_ptr<Frame> createFrame() const override;
-    ISimulation* createSimulation(const MultiLayer& sample) const override;
+    ISimulation* createSimulation(const Sample& sample) const override;
     void writeTo(QXmlStreamWriter* w) const override;
     void readFrom(QXmlStreamReader* r) override;
 
@@ -150,7 +150,7 @@ public:
     size_t axdim(int i) const override;
     void updateToRealData(const DatafileItem* dfi) override;
     std::unique_ptr<Frame> createFrame() const override;
-    ISimulation* createSimulation(const MultiLayer& sample) const override;
+    ISimulation* createSimulation(const Sample& sample) const override;
     void writeTo(QXmlStreamWriter* w) const override;
     void readFrom(QXmlStreamReader* r) override;
 
@@ -170,7 +170,7 @@ public:
     void updateToRealData(const DatafileItem* dfi) override;
     bool alignedWith(const DatafileItem* dfi) const override;
     std::unique_ptr<Frame> createFrame() const override;
-    ISimulation* createSimulation(const MultiLayer& sample) const override;
+    ISimulation* createSimulation(const Sample& sample) const override;
 
     void writeTo(QXmlStreamWriter* w) const override;
     void readFrom(QXmlStreamReader* r) override;
@@ -186,7 +186,7 @@ public:
     size_t axdim(int i) const override;
     void updateToRealData(const DatafileItem* dfi) override;
     std::unique_ptr<Frame> createFrame() const override;
-    ISimulation* createSimulation(const MultiLayer& sample) const override;
+    ISimulation* createSimulation(const Sample& sample) const override;
     void writeTo(QXmlStreamWriter* w) const override;
     void readFrom(QXmlStreamReader* r) override;
 
diff --git a/GUI/Model/ToCore/SampleToCore.cpp b/GUI/Model/ToCore/SampleToCore.cpp
index f969129ad210a5ee3585cb9c0700db267ad7f36e..ecf62de166261924101ad667d00d1878d8d7bc72 100644
--- a/GUI/Model/ToCore/SampleToCore.cpp
+++ b/GUI/Model/ToCore/SampleToCore.cpp
@@ -28,7 +28,7 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/CoreAndShell.h"
 #include "Sample/Particle/IParticle.h"
@@ -37,9 +37,9 @@
 
 namespace {
 
-std::unique_ptr<MultiLayer> createMultiLayer(const SampleItem& item)
+std::unique_ptr<Sample> createSample(const SampleItem& item)
 {
-    auto sample = std::make_unique<MultiLayer>();
+    auto sample = std::make_unique<Sample>();
     R3 external_field = item.externalField();
     sample->setExternalField(external_field);
     return sample;
@@ -122,9 +122,9 @@ std::unique_ptr<Layer> buildLayer(const LayerItem& item)
 
 } // namespace
 
-std::unique_ptr<MultiLayer> GUI::ToCore::itemToSample(const SampleItem& sampleItem)
+std::unique_ptr<Sample> GUI::ToCore::itemToSample(const SampleItem& sampleItem)
 {
-    auto sample = createMultiLayer(sampleItem);
+    auto sample = createSample(sampleItem);
     for (auto* layerItem : sampleItem.layerItems())
         sample->addLayer(*buildLayer(*layerItem));
     return sample;
diff --git a/GUI/Model/ToCore/SampleToCore.h b/GUI/Model/ToCore/SampleToCore.h
index 74e5fd086745e67baa76c99ee7699d243bcce950..69783a021442fda9e6b64a9d4d44cc5222ee119d 100644
--- a/GUI/Model/ToCore/SampleToCore.h
+++ b/GUI/Model/ToCore/SampleToCore.h
@@ -17,12 +17,12 @@
 
 #include <memory>
 
-class MultiLayer;
+class Sample;
 class SampleItem;
 
 namespace GUI::ToCore {
 
-std::unique_ptr<MultiLayer> itemToSample(const SampleItem& item);
+std::unique_ptr<Sample> itemToSample(const SampleItem& item);
 
 } // namespace GUI::ToCore
 
diff --git a/GUI/Model/ToCore/SimulationToCore.cpp b/GUI/Model/ToCore/SimulationToCore.cpp
index 98f8d293bef2fdc826de777e461b79df451cb09b..edb42ed08ecc9d8650540859791a889ac972c6dd 100644
--- a/GUI/Model/ToCore/SimulationToCore.cpp
+++ b/GUI/Model/ToCore/SimulationToCore.cpp
@@ -19,7 +19,7 @@
 #include "GUI/Model/Sim/SimulationOptionsItem.h"
 #include "GUI/Model/ToCore/SampleToCore.h"
 #include "Resample/Option/SimulationOptions.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sim/Simulation/ISimulation.h"
 
 void GUI::ToCore::setSimulationOptions(ISimulation* simulation, const SimulationOptionsItem& item)
@@ -37,7 +37,7 @@ GUI::ToCore::itemsToSimulation(const SampleItem* sampleItem, const InstrumentIte
                                const SimulationOptionsItem* optionsItem)
 {
     ASSERT(sampleItem && instrumentItem && optionsItem);
-    std::unique_ptr<MultiLayer> sample = GUI::ToCore::itemToSample(*sampleItem);
+    std::unique_ptr<Sample> sample = GUI::ToCore::itemToSample(*sampleItem);
     std::unique_ptr<ISimulation> result(instrumentItem->createSimulation(*sample));
 
     setSimulationOptions(result.get(), *optionsItem);
diff --git a/GUI/View/IO/PythonImport.cpp b/GUI/View/IO/PythonImport.cpp
index ba119b4844e3b52ee2fcf44651290ee814f374a6..9b7bad86b54324eea1c816250cf08b368a567f45 100644
--- a/GUI/View/IO/PythonImport.cpp
+++ b/GUI/View/IO/PythonImport.cpp
@@ -27,9 +27,9 @@
 #include "GUI/View/Info/DetailedMessageBox.h"
 #include "GUI/View/Info/MessageBox.h"
 #include "GUI/View/Widget/AppConfig.h"
-#include "PyCore/Embed/PyInterpreter.h"     // listOfFunctions
-#include "PyCore/Sample/ImportMultiLayer.h" // createMultiLayerFromPython
-#include "Sample/Multilayer/MultiLayer.h"
+#include "PyCore/Embed/PyInterpreter.h" // listOfFunctions
+#include "PyCore/Sample/ImportSample.h" // createMultiLayerFromPython
+#include "Sample/Multilayer/Sample.h"
 #include <QApplication>
 #include <QFileDialog>
 #include <QMessageBox>
@@ -82,16 +82,16 @@ QString readFile(const QString& fname)
 //! Creates a multi-layer by executing a funcName in embedded Python.
 //! Function is supposed to be in code provided by 'snippet'.
 
-std::unique_ptr<MultiLayer> code2sample(const QString& snippet, const QString& funcName)
+std::unique_ptr<Sample> code2sample(const QString& snippet, const QString& funcName)
 {
     QApplication::setOverrideCursor(Qt::WaitCursor);
 
     void* pObj = PyInterpreter::pyscript2object(snippet.toStdString(), funcName.toStdString(),
-                                                "MultiLayer", bornagainDir());
+                                                "Sample", bornagainDir());
 
     QApplication::restoreOverrideCursor();
 
-    return std::unique_ptr<MultiLayer>{reinterpret_cast<MultiLayer*>(pObj)->clone()};
+    return std::unique_ptr<Sample>{reinterpret_cast<Sample*>(pObj)->clone()};
 }
 
 //! Lets user select a function name which generates a MultiLayer.
@@ -107,7 +107,7 @@ QString selectPySampleFunction(const QStringList& funcNames)
         ComboSelectorDialog dialog;
         dialog.addItems(funcNames, getCandidate(funcNames));
         dialog.setTextTop("Python code contains a few functions. Do you know by chance, "
-                          "which one is intended to produce a valid MultiLayer?");
+                          "which one is intended to produce a valid Sample?");
         dialog.setTextBottom(
             "Please select a valid function in combo box and press OK to continue.");
         if (dialog.exec() == QDialog::Accepted)
@@ -139,7 +139,7 @@ QString getPySampleFunctionName(const QString& snippet)
     return selectPySampleFunction(funcList);
 }
 
-SampleItem* itemizeSample(const MultiLayer& sample)
+SampleItem* itemizeSample(const Sample& sample)
 {
     try {
         auto* newItem = GUI::FromCore::itemizeSample(sample);
@@ -160,7 +160,7 @@ SampleItem* itemizeSample(const MultiLayer& sample)
 } // namespace
 
 
-SampleItem* IO::Py::importMultiLayer()
+SampleItem* IO::Py::importSample()
 {
     QString fname =
         QFileDialog::getOpenFileName(gApp->mainWindow, "Open python script",
@@ -177,7 +177,7 @@ SampleItem* IO::Py::importMultiLayer()
     if (funcName.isEmpty())
         return {};
 
-    std::unique_ptr<MultiLayer> sample;
+    std::unique_ptr<Sample> sample;
     try {
         sample = code2sample(snippet, funcName);
         if (!sample)
diff --git a/GUI/View/IO/PythonImport.h b/GUI/View/IO/PythonImport.h
index d4f1e1b6c7dc1166db6602d128ca670186fc3b6b..a298268dc1ecde058afcd7993963bad7c3063552 100644
--- a/GUI/View/IO/PythonImport.h
+++ b/GUI/View/IO/PythonImport.h
@@ -26,7 +26,7 @@ namespace IO::Py {
 //! Show select-file dialog, try to import via python, return created sample.
 //!
 //! If sth. went wrong, a dialog has presented already and nullptr is returned.
-SampleItem* importMultiLayer();
+SampleItem* importSample();
 
 } // namespace IO::Py
 
diff --git a/GUI/View/Realspace/RealspaceBuilder.cpp b/GUI/View/Realspace/RealspaceBuilder.cpp
index 69ae6488925661500b4233dfeec68fb02c42f1ce..3de03cb4517c7b63cbfc97c9cebd5faa3b3d75a0 100644
--- a/GUI/View/Realspace/RealspaceBuilder.cpp
+++ b/GUI/View/Realspace/RealspaceBuilder.cpp
@@ -34,7 +34,7 @@
 #include "Sample/Aggregate/Interferences.h"
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Interface/RoughnessMap.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/CoreAndShell.h"
 #include "Sample/Particle/Mesocrystal.h"
@@ -92,7 +92,7 @@ std::unique_ptr<double2d_t> scaledArray(const double2d_t& src, double factor)
                                 [&src, factor](size_t i, size_t j) { return src[i][j] * factor; }));
 }
 
-std::unique_ptr<const double2d_t> layerRoughnessMap(const MultiLayer& sample, int i_layer,
+std::unique_ptr<const double2d_t> layerRoughnessMap(const Sample& sample, int i_layer,
                                                     const SceneGeometry& sceneGeometry, int seed)
 {
     if (i_layer < 1 || i_layer >= int(sample.numberOfLayers())
@@ -110,7 +110,7 @@ std::unique_ptr<Img3D::Layer> createLayer(const LayerItem& layerItem, const Samp
                                           const double2d_t* topRoughMap,
                                           const double2d_t* bottomRoughMap, bool drawBottom)
 {
-    std::unique_ptr<MultiLayer> sample = GUI::ToCore::itemToSample(sampleItem);
+    std::unique_ptr<Sample> sample = GUI::ToCore::itemToSample(sampleItem);
     double s2 = sceneGeometry.layerSize;
     double thickness = ::visualLayerThickness(layerItem, sceneGeometry);
     ASSERT(thickness > 0);
@@ -169,7 +169,7 @@ void RealspaceBuilder::populateSample(Model* model, const SampleItem& sampleItem
 {
     double total_height(0.0);
     const std::vector<LayerItem*>& layers = sampleItem.layerItems();
-    std::unique_ptr<MultiLayer> sample = GUI::ToCore::itemToSample(sampleItem);
+    std::unique_ptr<Sample> sample = GUI::ToCore::itemToSample(sampleItem);
 
     OwningVector<const double2d_t> rough_maps;
     rough_maps.push_back(nullptr); // top interface of fronting
@@ -201,7 +201,7 @@ void RealspaceBuilder::populateLayer(Model* model, const LayerItem& layerItem,
 
     // individual layer visualization
     if (!topRoughMap && !bottomRoughMap) {
-        std::unique_ptr<MultiLayer> sample = GUI::ToCore::itemToSample(sampleItem);
+        std::unique_ptr<Sample> sample = GUI::ToCore::itemToSample(sampleItem);
         auto new_topRoughMap =
             ::layerRoughnessMap(*sample, i_layer, sceneGeometry, layerItem.roughnessSeed);
 
diff --git a/GUI/View/Sample/ScriptPanel.cpp b/GUI/View/Sample/ScriptPanel.cpp
index 39490120348bd4f09ca81ba52911e8a5c7a2a724..2f6142c38a6f00ebb3212047eeff3978a224fbc0 100644
--- a/GUI/View/Sample/ScriptPanel.cpp
+++ b/GUI/View/Sample/ScriptPanel.cpp
@@ -19,7 +19,7 @@
 #include "GUI/View/Base/Fontsize.h"
 #include "GUI/View/Info/CautionSign.h"
 #include "GUI/View/Info/PythonSyntaxHighlighter.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sim/Export/ExportToPython.h"
 #include <QScrollBar>
 #include <QStackedWidget>
diff --git a/GUI/View/View/SampleView.cpp b/GUI/View/View/SampleView.cpp
index ea0c75349a7aec07829e07ba6bbe47121944c933..6de78074faccaaede2d5ab976021c7089748212d 100644
--- a/GUI/View/View/SampleView.cpp
+++ b/GUI/View/View/SampleView.cpp
@@ -146,7 +146,7 @@ void SampleView::createActions(QToolBar* toolbar)
         "Import sample from a Python script that contains a function that returns a multi-layer");
     toolbar->addAction(import_sample_action);
     connect(import_sample_action, &QAction::triggered, [this] {
-        SampleItem* sample_item = IO::Py::importMultiLayer();
+        SampleItem* sample_item = IO::Py::importSample();
         if (sample_item)
             m_set->add_item(sample_item);
     });
diff --git a/PyCore/Sample/ImportMultiLayer.cpp b/PyCore/Sample/ImportSample.cpp
similarity index 89%
rename from PyCore/Sample/ImportMultiLayer.cpp
rename to PyCore/Sample/ImportSample.cpp
index f11749f128580c908fdf16632f0020909fef895d..91cca61d3bcbfc67f717e325958f4e1c9f7ad94b 100644
--- a/PyCore/Sample/ImportMultiLayer.cpp
+++ b/PyCore/Sample/ImportSample.cpp
@@ -2,8 +2,8 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      PyCore/Sample/ImportMultiLayer.cpp
-//! @brief     Implements createMultiLayerFromPython.
+//! @file      PyCore/Sample/ImportSample.cpp
+//! @brief     Implements importing sample from Python.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -14,7 +14,7 @@
 
 #ifdef BORNAGAIN_PYTHON
 
-#include "PyCore/Sample/ImportMultiLayer.h"
+#include "PyCore/Sample/ImportSample.h"
 #include "PyCore/Embed/PyCore.h"
 #include "PyCore/Embed/PyInterpreter.h" // BornAgain::importScript
 #include "auto/Wrap/swig_runtime.h"     // for creating a core object from Python
@@ -32,7 +32,7 @@ void* PyInterpreter::pyscript2object(const std::string& script, const std::strin
                                                   "Cannot locate the compiled function '"
                                                   + functionName + "'"));
 
-    // create a `MultiLayer` Python object via calling the function
+    // create a `Sample` Python object via calling the function
     PyObject* ret1 = PyObject_CallFunctionObjArgs(pAddFn, NULL);
 
     // clean up
@@ -52,7 +52,7 @@ void* PyInterpreter::pyscript2object(const std::string& script, const std::strin
     if (!SWIG_IsOK(res)) {
         Py_DecRef(ret1);
         throw std::runtime_error(
-            errorDescription("Function " + functionName + " did not yield MultiLayer instance"));
+            errorDescription("Function " + functionName + " did not yield Sample instance"));
     }
 
     return reinterpret_cast<void*>(argp1);
diff --git a/PyCore/Sample/ImportMultiLayer.h b/PyCore/Sample/ImportSample.h
similarity index 79%
rename from PyCore/Sample/ImportMultiLayer.h
rename to PyCore/Sample/ImportSample.h
index d7d3be30da122da0ccf87ac75e5aea2a8c622de9..67e2d808295a981a01125db781da2346420a8501 100644
--- a/PyCore/Sample/ImportMultiLayer.h
+++ b/PyCore/Sample/ImportSample.h
@@ -2,8 +2,8 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      PyCore/Sample/ImportMultiLayer.h
-//! @brief     Declares createMultiLayerFromPython.
+//! @file      PyCore/Sample/ImportSample.h
+//! @brief     Declares importing sample from Python.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -18,8 +18,8 @@
 #ifdef SWIG
 #error no need to expose this header to Swig
 #endif
-#ifndef BORNAGAIN_PYCORE_SAMPLE_IMPORTMULTILAYER_H
-#define BORNAGAIN_PYCORE_SAMPLE_IMPORTMULTILAYER_H
+#ifndef BORNAGAIN_PYCORE_SAMPLE_IMPORTSAMPLE_H
+#define BORNAGAIN_PYCORE_SAMPLE_IMPORTSAMPLE_H
 
 #include "PyCore/Embed/PyObjectPtr.h"
 #include <string>
@@ -32,4 +32,4 @@ void* pyscript2object(const std::string& script, const std::string& functionName
 
 } // namespace PyInterpreter
 
-#endif // BORNAGAIN_PYCORE_SAMPLE_IMPORTMULTILAYER_H
+#endif // BORNAGAIN_PYCORE_SAMPLE_IMPORTSAMPLE_H
diff --git a/Resample/Processed/ReSample.cpp b/Resample/Processed/ReSample.cpp
index f80ea579387e0fd643afe5bc0ef1cdf8de5b7e73..661573d738b9b75a4047fa88fb11cb6fdf282144 100644
--- a/Resample/Processed/ReSample.cpp
+++ b/Resample/Processed/ReSample.cpp
@@ -30,7 +30,7 @@
 #include "Sample/Material/MaterialUtil.h"
 #include "Sample/Material/RefractiveMaterialImpl.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/IParticle.h"
 #include <iomanip>
 #include <iostream>
@@ -40,7 +40,7 @@ namespace {
 
 //! Returns for each layer the z span that contains some particles.
 //! However, if use_slicing is false, then each span is set to -inf..+inf.
-std::vector<ZLimits> particleSpans(const MultiLayer& sample)
+std::vector<ZLimits> particleSpans(const Sample& sample)
 {
     size_t N = sample.numberOfLayers();
     ASSERT(N > 0);
@@ -90,7 +90,7 @@ std::vector<ZLimits> particleSpans(const MultiLayer& sample)
 //!
 //! Used in ReSample constructor.
 
-SliceStack slicify(const MultiLayer& sample, bool useAvgMaterials)
+SliceStack slicify(const Sample& sample, bool useAvgMaterials)
 {
     SliceStack result;
 
@@ -293,7 +293,7 @@ ReLayout* makeReLayout(const ParticleLayout& layout, const SliceStack& slices, d
 
 //! Returns collection of all ReLayout%s, for use in ReSample constructor.
 
-OwningVector<const ReLayout> collectLayouts(const MultiLayer& sample, const SliceStack& slices,
+OwningVector<const ReLayout> collectLayouts(const Sample& sample, const SliceStack& slices,
                                             const SimulationOptions& options, bool polarized)
 {
     OwningVector<const ReLayout> result;
@@ -319,8 +319,7 @@ OwningVector<const ReLayout> collectLayouts(const MultiLayer& sample, const Slic
 
 //... Static factory functions:
 
-ReSample ReSample::make(const MultiLayer& sample, const SimulationOptions& options,
-                        bool forcePolarized)
+ReSample ReSample::make(const Sample& sample, const SimulationOptions& options, bool forcePolarized)
 {
     sample.validateOrThrow();
 
@@ -339,15 +338,15 @@ ReSample ReSample::make(const MultiLayer& sample, const SimulationOptions& optio
     return {sample, polarized, std::move(layouts), stack2};
 }
 
-ReSample ReSample::make(const MultiLayer& sample)
+ReSample ReSample::make(const Sample& sample)
 {
     return make(sample, {}, false);
 }
 
 //...
 
-ReSample::ReSample(const MultiLayer& sample, bool polarized,
-                   OwningVector<const ReLayout>&& relayouts, const SliceStack& refined_stack)
+ReSample::ReSample(const Sample& sample, bool polarized, OwningVector<const ReLayout>&& relayouts,
+                   const SliceStack& refined_stack)
     : m_sample(sample)
     , m_polarized(polarized)
     , m_relayouts(std::move(relayouts))
diff --git a/Resample/Processed/ReSample.h b/Resample/Processed/ReSample.h
index 818933aca1570cb3d7753f425b60e0e26fd8099f..a85af2f7b8433b6b1c6be39073256af7a804bce0 100644
--- a/Resample/Processed/ReSample.h
+++ b/Resample/Processed/ReSample.h
@@ -24,8 +24,8 @@
 
 class Fluxes;
 class Material;
-class MultiLayer;
 class ReLayout;
+class Sample;
 class SimulationOptions;
 
 //! Data structure that contains all the necessary data for scattering calculations.
@@ -36,9 +36,9 @@ class SimulationOptions;
 class ReSample {
 public:
     //! Factory method that wraps the private constructor.
-    static ReSample make(const MultiLayer& sample, const SimulationOptions& options,
+    static ReSample make(const Sample& sample, const SimulationOptions& options,
                          bool forcePolarized = false);
-    static ReSample make(const MultiLayer& sample); // used by tests only?
+    static ReSample make(const Sample& sample); // used by tests only?
 
     ReSample(const ReSample&) = delete;
     ~ReSample();
@@ -51,15 +51,15 @@ public:
     double sliceBottomZ(size_t i) const;
     bool polarizing() const; //!< Contains magnetic material, or nonzero magnetic field
     bool hasRoughness() const;
-    const MultiLayer& sample() const { return m_sample; }
+    const Sample& sample() const { return m_sample; }
 
     Fluxes fluxesIn(const R3& k) const;
     Fluxes fluxesOut(const R3& k) const;
 
 private:
-    ReSample(const MultiLayer& sample, bool polarized, OwningVector<const ReLayout>&& layouts,
+    ReSample(const Sample& sample, bool polarized, OwningVector<const ReLayout>&& layouts,
              const SliceStack& refined_stack);
-    const MultiLayer& m_sample;
+    const Sample& m_sample;
     const bool m_polarized;
     const OwningVector<const ReLayout> m_relayouts;
     const SliceStack m_stack;
diff --git a/Resample/Swig/MultiLayerFuncs.cpp b/Resample/Swig/MultiLayerFuncs.cpp
index 470697f655138e4aecf3f95bf5a16b762a5e9109..a58f03092e77c86bd1da1410453ef59458385f09 100644
--- a/Resample/Swig/MultiLayerFuncs.cpp
+++ b/Resample/Swig/MultiLayerFuncs.cpp
@@ -19,7 +19,7 @@
 
 namespace {
 
-ProfileHelper helper(const MultiLayer& sample)
+ProfileHelper helper(const Sample& sample)
 {
     SimulationOptions options;
     options.setUseAvgMaterials(true);
@@ -40,21 +40,21 @@ std::vector<double> swigAPI::generateZValues(int n_points, double z_min, double
     return result;
 }
 
-std::vector<complex_t> swigAPI::materialProfileSLD(const MultiLayer& sample, int n_points,
-                                                   double z_min, double z_max)
+std::vector<complex_t> swigAPI::materialProfileSLD(const Sample& sample, int n_points, double z_min,
+                                                   double z_max)
 {
     std::vector<double> z_values = generateZValues(n_points, z_min, z_max);
     return ::helper(sample).calculateSLDProfile(z_values);
 }
 
-std::vector<double> swigAPI::magnetizationProfile(const MultiLayer& sample, std::string xyz,
+std::vector<double> swigAPI::magnetizationProfile(const Sample& sample, std::string xyz,
                                                   int n_points, double z_min, double z_max)
 {
     std::vector<double> z_values = generateZValues(n_points, z_min, z_max);
     return ::helper(sample).calculateMagnetizationProfile(z_values, xyz);
 }
 
-std::pair<double, double> swigAPI::defaultMaterialProfileLimits(const MultiLayer& sample)
+std::pair<double, double> swigAPI::defaultMaterialProfileLimits(const Sample& sample)
 {
     SimulationOptions options;
     options.setUseAvgMaterials(true);
diff --git a/Resample/Swig/MultiLayerFuncs.h b/Resample/Swig/MultiLayerFuncs.h
index b224de0f8c8fb7ad52878a1f75953d7da158e4d3..ff53b1533f21203141ef1e37c6def771aa2e2cd9 100644
--- a/Resample/Swig/MultiLayerFuncs.h
+++ b/Resample/Swig/MultiLayerFuncs.h
@@ -19,7 +19,7 @@
 #include <utility>
 #include <vector>
 
-class MultiLayer;
+class Sample;
 
 //! Functions that are only used in the swig *.i files
 namespace swigAPI {
@@ -27,15 +27,15 @@ namespace swigAPI {
 std::vector<double> generateZValues(int n_points, double z_min, double z_max);
 
 //! Calculate average material profile for given sample
-std::vector<complex_t> materialProfileSLD(const MultiLayer& sample, int n_points, double z_min,
+std::vector<complex_t> materialProfileSLD(const Sample& sample, int n_points, double z_min,
                                           double z_max);
 
 //! Calculate average magnetization profile for given sample
-std::vector<double> magnetizationProfile(const MultiLayer& sample, std::string xyz, int n_points,
+std::vector<double> magnetizationProfile(const Sample& sample, std::string xyz, int n_points,
                                          double z_min, double z_max);
 
 //! Get default z limits for generating a material profile
-std::pair<double, double> defaultMaterialProfileLimits(const MultiLayer& sample);
+std::pair<double, double> defaultMaterialProfileLimits(const Sample& sample);
 
 } // namespace swigAPI
 
diff --git a/Sample/Interface/RoughnessMap.cpp b/Sample/Interface/RoughnessMap.cpp
index b78bd19c9ed05b7676383e99596e08feebcb8ea7..141aad73d1d2a32831eba260bb50a7eb214c7bee 100644
--- a/Sample/Interface/RoughnessMap.cpp
+++ b/Sample/Interface/RoughnessMap.cpp
@@ -53,7 +53,7 @@ Arrayf64Wrapper arrayExport(const std::vector<std::size_t>& dimensions,
 } // namespace
 
 RoughnessMap::RoughnessMap(size_t x_points, size_t y_points, double Lx, double Ly,
-                           const MultiLayer& sample, int i_layer, int seed)
+                           const Sample& sample, int i_layer, int seed)
     : m_x_points(x_points)
     , m_y_points(y_points)
     , m_lx(Lx)
diff --git a/Sample/Interface/RoughnessMap.h b/Sample/Interface/RoughnessMap.h
index daa537b997198367c18edf9f2c3c88ee41cd5ee2..ea8b40e75975af76bec62bb6c80828a48cbd45d6 100644
--- a/Sample/Interface/RoughnessMap.h
+++ b/Sample/Interface/RoughnessMap.h
@@ -16,7 +16,7 @@
 #define BORNAGAIN_SAMPLE_MULTILAYER_ROUGHNESSMAP_H
 
 #include "Base/Math/FourierTransform.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include <random>
 
 #ifdef BORNAGAIN_PYTHON
@@ -30,7 +30,7 @@
 
 class RoughnessMap {
 public:
-    RoughnessMap(size_t x_points, size_t y_points, double Lx, double Ly, const MultiLayer& sample,
+    RoughnessMap(size_t x_points, size_t y_points, double Lx, double Ly, const Sample& sample,
                  int i_layer, int seed = -1);
     RoughnessMap() = delete;
 
@@ -59,7 +59,7 @@ private:
     double m_lx; //!< sample x size in nm
     double m_ly; //!< sample y size in nm
 
-    const MultiLayer& m_sample;
+    const Sample& m_sample;
 
     int m_i_layer;
     double2d_t m_rough_map;
diff --git a/Sample/Multilayer/MultiLayer.cpp b/Sample/Multilayer/Sample.cpp
similarity index 84%
rename from Sample/Multilayer/MultiLayer.cpp
rename to Sample/Multilayer/Sample.cpp
index d8aad9ecec82df906b0293ff03811dcac81d3a5c..79d1647a8af7df8c5c7068c3dfcd26cba27e088b 100644
--- a/Sample/Multilayer/MultiLayer.cpp
+++ b/Sample/Multilayer/Sample.cpp
@@ -2,8 +2,8 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      Sample/Multilayer/MultiLayer.cpp
-//! @brief     Implements class MultiLayer.
+//! @file      Sample/Multilayer/Sample.cpp
+//! @brief     Implements class Sample.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Base/Const/PhysicalConstants.h"
 #include "Base/Math/IntegratorGK.h"
 #include "Base/Util/Assert.h"
@@ -24,29 +24,29 @@
 
 using PhysConsts::pi;
 
-MultiLayer::MultiLayer()
+Sample::Sample()
 {
     validateOrThrow();
 }
 
-MultiLayer::~MultiLayer() = default;
+Sample::~Sample() = default;
 
-MultiLayer* MultiLayer::clone() const
+Sample* Sample::clone() const
 {
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->setExternalField(externalField());
     for (size_t i = 0; i < numberOfLayers(); ++i)
         result->addLayer(std::as_const(*m_layers[i]));
     return result;
 }
 
-void MultiLayer::checkMaterials(double wavelength) const
+void Sample::checkMaterials(double wavelength) const
 {
     for (size_t i = 0; i < numberOfLayers(); ++i)
         m_layers[i]->material()->checkRefractiveIndex(wavelength);
 }
 
-void MultiLayer::addLayer(const Layer& layer)
+void Sample::addLayer(const Layer& layer)
 {
     if (!numberOfLayers()) // the top layer
         if (layer.thickness() != 0.0)
@@ -56,12 +56,12 @@ void MultiLayer::addLayer(const Layer& layer)
     m_validated = false;
 }
 
-const AutocorrelationModel* MultiLayer::autocorrAt(int i_layer) const
+const AutocorrelationModel* Sample::autocorrAt(int i_layer) const
 {
     return layer(i_layer)->roughness()->autocorrelationModel();
 }
 
-double MultiLayer::maxCutoffSpatialFrequencyAt(size_t i_layer) const
+double Sample::maxCutoffSpatialFrequencyAt(size_t i_layer) const
 {
     double result = 0;
     for (size_t i = i_layer; i < m_layers.size(); i++) {
@@ -71,18 +71,18 @@ double MultiLayer::maxCutoffSpatialFrequencyAt(size_t i_layer) const
     return result;
 }
 
-const Layer* MultiLayer::layer(size_t i_layer) const
+const Layer* Sample::layer(size_t i_layer) const
 {
     return m_layers.at(i_layer);
 }
 
-void MultiLayer::setExternalField(const R3& ext_field)
+void Sample::setExternalField(const R3& ext_field)
 {
     m_ext_field = ext_field;
     m_validated = false;
 }
 
-double MultiLayer::layerRoughnessSpectrum(double spatial_f, int i_layer) const
+double Sample::layerRoughnessSpectrum(double spatial_f, int i_layer) const
 {
     int size = m_layers.size();
     const AutocorrelationModel* autocorr = autocorrAt(i_layer);
@@ -116,7 +116,7 @@ double MultiLayer::layerRoughnessSpectrum(double spatial_f, int i_layer) const
     ASSERT_NEVER;
 }
 
-double MultiLayer::layerRoughnessRMS(size_t i_layer) const
+double Sample::layerRoughnessRMS(size_t i_layer) const
 {
     ASSERT(i_layer < m_layers.size());
     const auto autocorr = autocorrAt(i_layer);
@@ -135,7 +135,7 @@ double MultiLayer::layerRoughnessRMS(size_t i_layer) const
     ASSERT_NEVER;
 }
 
-std::vector<const INode*> MultiLayer::nodeChildren() const
+std::vector<const INode*> Sample::nodeChildren() const
 {
     std::vector<const INode*> result;
     const size_t N = m_layers.size();
@@ -147,21 +147,21 @@ std::vector<const INode*> MultiLayer::nodeChildren() const
     return result;
 }
 
-double MultiLayer::hig(size_t i) const
+double Sample::hig(size_t i) const
 {
     ASSERT(m_validated);
     ASSERT(i >= 1 && i < numberOfLayers());
     return ZInterfaces.at(i - 1);
 }
 
-double MultiLayer::low(size_t i) const
+double Sample::low(size_t i) const
 {
     ASSERT(m_validated);
     ASSERT(i < numberOfLayers() - 1);
     return ZInterfaces.at(i);
 }
 
-std::string MultiLayer::validate() const
+std::string Sample::validate() const
 {
     std::vector<std::string> errs;
     if (MaterialUtil::checkMaterialTypes(containedMaterials())
diff --git a/Sample/Multilayer/MultiLayer.h b/Sample/Multilayer/Sample.h
similarity index 83%
rename from Sample/Multilayer/MultiLayer.h
rename to Sample/Multilayer/Sample.h
index 996d11f84fd185281e08ffee26283089690e4e7f..8fbd01def697a0f00729b372971eb5a97cd492a1 100644
--- a/Sample/Multilayer/MultiLayer.h
+++ b/Sample/Multilayer/Sample.h
@@ -2,8 +2,8 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      Sample/Multilayer/MultiLayer.h
-//! @brief     Defines class MultiLayer.
+//! @file      Sample/Multilayer/Sample.h
+//! @brief     Defines class Sample.
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -12,18 +12,16 @@
 //
 //  ************************************************************************************************
 
-#ifndef BORNAGAIN_SAMPLE_MULTILAYER_MULTILAYER_H
-#define BORNAGAIN_SAMPLE_MULTILAYER_MULTILAYER_H
+#ifndef BORNAGAIN_SAMPLE_MULTILAYER_SAMPLE_H
+#define BORNAGAIN_SAMPLE_MULTILAYER_SAMPLE_H
 
 #include "Base/Type/OwningVector.h"
-#include "Sample/Interface/InterlayerModels.h"
 #include "Sample/Scattering/ISampleNode.h"
 #include <functional>
 #include <heinz/Vectors3D.h>
 
 class AutocorrelationModel;
 class Layer;
-class LayerRoughness;
 class ParticleLayout;
 
 //! Our sample model: a stack of layers one below the other.
@@ -39,13 +37,13 @@ class ParticleLayout;
 //! substrate   layer 3
 //! @endverbatim
 
-class MultiLayer : public ISampleNode {
+class Sample : public ISampleNode {
 public:
-    MultiLayer();
-    ~MultiLayer() override;
+    Sample();
+    ~Sample() override;
 
-    MultiLayer* clone() const override;
-    std::string className() const final { return "MultiLayer"; }
+    Sample* clone() const override;
+    std::string className() const final { return "Sample"; }
 
     void addLayer(const Layer& layer);
     //! Sets the external field applied to the sample (units: A/m)
@@ -100,4 +98,4 @@ private:
 #endif // SWIG
 };
 
-#endif // BORNAGAIN_SAMPLE_MULTILAYER_MULTILAYER_H
+#endif // BORNAGAIN_SAMPLE_MULTILAYER_SAMPLE_H
diff --git a/Sample/StandardSample/BoxCompositionBuilder.cpp b/Sample/StandardSample/BoxCompositionBuilder.cpp
index 5b7d09ab06bd7424896b12b3816cef9faeb11b6b..b99e61973c198eb3cf8680024a75e214c3554260 100644
--- a/Sample/StandardSample/BoxCompositionBuilder.cpp
+++ b/Sample/StandardSample/BoxCompositionBuilder.cpp
@@ -17,7 +17,7 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
@@ -33,7 +33,7 @@ const double length = 50.0;
 const double width = 20.0;
 const double height = 10.0;
 
-MultiLayer* finalizeMultiLayer(const Compound& composition)
+Sample* finalizeMultiLayer(const Compound& composition)
 {
     ParticleLayout layout;
     layout.addParticle(composition);
@@ -43,7 +43,7 @@ MultiLayer* finalizeMultiLayer(const Compound& composition)
     middle_layer.addLayout(layout);
     Layer substrate(refMat::Substrate2);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(middle_layer);
     sample->addLayer(substrate);
@@ -54,7 +54,7 @@ MultiLayer* finalizeMultiLayer(const Compound& composition)
 
 // --- BoxCompositionRotateXBuilder ---
 
-MultiLayer* ExemplarySamples::createBoxCompositionRotateX()
+Sample* ExemplarySamples::createBoxCompositionRotateX()
 {
     Particle box(particleMaterial, Box(length / 2.0, width, height));
     Compound composition;
@@ -67,7 +67,7 @@ MultiLayer* ExemplarySamples::createBoxCompositionRotateX()
 
 // --- BoxCompositionRotateYBuilder ---
 
-MultiLayer* ExemplarySamples::createBoxCompositionRotateY()
+Sample* ExemplarySamples::createBoxCompositionRotateY()
 {
     Particle box(particleMaterial, Box(length / 2.0, width, height));
     Compound composition;
@@ -80,7 +80,7 @@ MultiLayer* ExemplarySamples::createBoxCompositionRotateY()
 
 // --- BoxCompositionRotateZBuilder ---
 
-MultiLayer* ExemplarySamples::createBoxCompositionRotateZ()
+Sample* ExemplarySamples::createBoxCompositionRotateZ()
 {
     Particle box(particleMaterial, Box(length / 2.0, width, height));
     Compound composition;
@@ -93,7 +93,7 @@ MultiLayer* ExemplarySamples::createBoxCompositionRotateZ()
 
 // --- BoxCompositionRotateZandYBuilder ---
 
-MultiLayer* ExemplarySamples::createBoxCompositionRotateZandY()
+Sample* ExemplarySamples::createBoxCompositionRotateZandY()
 {
     Particle box(particleMaterial, Box(length / 2.0, width, height));
     Compound composition;
@@ -108,7 +108,7 @@ MultiLayer* ExemplarySamples::createBoxCompositionRotateZandY()
 // --- BoxStackCompositionBuilder ---
 
 // Composition of two boxes which gives you the box (10,20,50) with reference point as usual.
-MultiLayer* ExemplarySamples::createBoxStackComposition()
+Sample* ExemplarySamples::createBoxStackComposition()
 {
     Compound composition;
 
diff --git a/Sample/StandardSample/BoxCompositionBuilder.h b/Sample/StandardSample/BoxCompositionBuilder.h
index d71e0bf5893e64ce6f4519af6b34e0141934b16e..ecd7c16aa45831d9e1c9917cf9074051119907b6 100644
--- a/Sample/StandardSample/BoxCompositionBuilder.h
+++ b/Sample/StandardSample/BoxCompositionBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_BOXCOMPOSITIONBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_BOXCOMPOSITIONBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Two boxes in particle composition rotated in X by 90 degrees.
 
 namespace ExemplarySamples {
 
-MultiLayer* createBoxCompositionRotateX();
+Sample* createBoxCompositionRotateX();
 
 } // namespace ExemplarySamples
 
@@ -32,7 +32,7 @@ MultiLayer* createBoxCompositionRotateX();
 
 namespace ExemplarySamples {
 
-MultiLayer* createBoxCompositionRotateY();
+Sample* createBoxCompositionRotateY();
 
 } // namespace ExemplarySamples
 
@@ -40,7 +40,7 @@ MultiLayer* createBoxCompositionRotateY();
 
 namespace ExemplarySamples {
 
-MultiLayer* createBoxCompositionRotateZ();
+Sample* createBoxCompositionRotateZ();
 
 } // namespace ExemplarySamples
 
@@ -48,7 +48,7 @@ MultiLayer* createBoxCompositionRotateZ();
 
 namespace ExemplarySamples {
 
-MultiLayer* createBoxCompositionRotateZandY();
+Sample* createBoxCompositionRotateZandY();
 
 } // namespace ExemplarySamples
 
@@ -56,7 +56,7 @@ MultiLayer* createBoxCompositionRotateZandY();
 
 namespace ExemplarySamples {
 
-MultiLayer* createBoxStackComposition();
+Sample* createBoxStackComposition();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/BoxesSquareLatticeBuilder.cpp b/Sample/StandardSample/BoxesSquareLatticeBuilder.cpp
index 0fb8628bfe84d4edaf7cec776468567b0c0c7e93..28d944317cbf833ecc9077276da5bc9544ebc45a 100644
--- a/Sample/StandardSample/BoxesSquareLatticeBuilder.cpp
+++ b/Sample/StandardSample/BoxesSquareLatticeBuilder.cpp
@@ -18,12 +18,12 @@
 #include "Sample/Correlation/Profiles2D.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 namespace {
-MultiLayer* createBoxesSquareLattice2D(double length, double height, double lattice)
+Sample* createBoxesSquareLattice2D(double length, double height, double lattice)
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -43,19 +43,19 @@ MultiLayer* createBoxesSquareLattice2D(double length, double height, double latt
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 } // namespace
 
-MultiLayer* ExemplarySamples::createBoxesSquareLattice2D()
+Sample* ExemplarySamples::createBoxesSquareLattice2D()
 {
     return ::createBoxesSquareLattice2D(5, 10, 8);
 }
 
-MultiLayer* ExemplarySamples::createBoxesLayer()
+Sample* ExemplarySamples::createBoxesLayer()
 {
     return ::createBoxesSquareLattice2D(10, 10, 10);
 }
diff --git a/Sample/StandardSample/BoxesSquareLatticeBuilder.h b/Sample/StandardSample/BoxesSquareLatticeBuilder.h
index dd7928352d018f6e4ac407a0bab6daff7dddf3b5..4b2aa8b3d81a4d7c29d4c41b2da879127c439221 100644
--- a/Sample/StandardSample/BoxesSquareLatticeBuilder.h
+++ b/Sample/StandardSample/BoxesSquareLatticeBuilder.h
@@ -18,15 +18,15 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_BOXESSQUARELATTICEBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_BOXESSQUARELATTICEBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: square boxes in a square lattice
 
 namespace ExemplarySamples {
 
-MultiLayer* createBoxesSquareLattice2D();
+Sample* createBoxesSquareLattice2D();
 
-MultiLayer* createBoxesLayer();
+Sample* createBoxesLayer();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/CompoundBuilder.cpp b/Sample/StandardSample/CompoundBuilder.cpp
index acc055ea0164b7657b7832642de2e5a5850533a1..84c6ead878ec838cb19f1eab51e9b095095e240c 100644
--- a/Sample/StandardSample/CompoundBuilder.cpp
+++ b/Sample/StandardSample/CompoundBuilder.cpp
@@ -19,14 +19,14 @@
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/HardParticle/Sphere.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 // --- CompoundBuilder ---
 
-MultiLayer* ExemplarySamples::createCompound()
+Sample* ExemplarySamples::createCompound()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -52,13 +52,13 @@ MultiLayer* ExemplarySamples::createCompound()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createCompoundPlus()
+Sample* ExemplarySamples::createCompoundPlus()
 {
     int n_lim = 1;
     double L = 10.0;
@@ -88,7 +88,7 @@ MultiLayer* ExemplarySamples::createCompoundPlus()
     vacuum_layer.addLayout(particle_layout);
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/CompoundBuilder.h b/Sample/StandardSample/CompoundBuilder.h
index dadf56e37df6cf397bc6e3e674cf93bd8b7e10df..8bca238351dccdffd22ae8c9a04e5643caacfc3f 100644
--- a/Sample/StandardSample/CompoundBuilder.h
+++ b/Sample/StandardSample/CompoundBuilder.h
@@ -18,17 +18,17 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_COMPOUNDBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_COMPOUNDBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample.
 
 namespace ExemplarySamples {
 
 //! Two layers of spheres at hex lattice.
-MultiLayer* createCompound();
+Sample* createCompound();
 
 //! Small cylinder "mesocrystal" (shape of "plus" sign).
-MultiLayer* createCompoundPlus();
+Sample* createCompoundPlus();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/CoreAndShellBuilder.cpp b/Sample/StandardSample/CoreAndShellBuilder.cpp
index 94f62cbc66af20dd4f85e732ad28d6d8d2cb5076..83f7d632eef054d4d4b064ebeeea79131b274a87 100644
--- a/Sample/StandardSample/CoreAndShellBuilder.cpp
+++ b/Sample/StandardSample/CoreAndShellBuilder.cpp
@@ -17,7 +17,7 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/CoreAndShell.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
@@ -27,7 +27,7 @@ using Units::deg;
 
 // --- CoreShellParticleBuilder ---
 
-MultiLayer* ExemplarySamples::createCoreShellParticle()
+Sample* ExemplarySamples::createCoreShellParticle()
 {
     complex_t n_particle_core(1.0 - 6e-5, 2e-8);
     complex_t n_particle_shell(1.0 - 1e-4, 2e-8);
@@ -49,14 +49,14 @@ MultiLayer* ExemplarySamples::createCoreShellParticle()
     ParticleLayout particle_layout(particle);
     vacuum_layer.addLayout(particle);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     return sample;
 }
 
 // --- CoreShellBoxRotateZandYBuilder ---
 
-MultiLayer* ExemplarySamples::createCoreShellBoxRotateZandY()
+Sample* ExemplarySamples::createCoreShellBoxRotateZandY()
 {
     const double layer_thickness(100.0);
 
@@ -83,7 +83,7 @@ MultiLayer* ExemplarySamples::createCoreShellBoxRotateZandY()
     middle_layer.addLayout(layout);
     Layer substrate(refMat::Substrate2);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(middle_layer);
     sample->addLayer(substrate);
diff --git a/Sample/StandardSample/CoreAndShellBuilder.h b/Sample/StandardSample/CoreAndShellBuilder.h
index 0a7188849787bc791a0b429a125afde6e5dff6ec..1d27892de86af2db1a3b5c8d08a572f22c1a008d 100644
--- a/Sample/StandardSample/CoreAndShellBuilder.h
+++ b/Sample/StandardSample/CoreAndShellBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_COREANDSHELLBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_COREANDSHELLBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: Core Shell Nanoparticles (IsGISAXS example #11).
 
 namespace ExemplarySamples {
 
-MultiLayer* createCoreShellParticle();
+Sample* createCoreShellParticle();
 
 } // namespace ExemplarySamples
 
@@ -32,7 +32,7 @@ MultiLayer* createCoreShellParticle();
 
 namespace ExemplarySamples {
 
-MultiLayer* createCoreShellBoxRotateZandY();
+Sample* createCoreShellBoxRotateZandY();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/CustomMorphologyBuilder.cpp b/Sample/StandardSample/CustomMorphologyBuilder.cpp
index f00f6de672d3843e311708b9832fa61e2be471d8..a318afc5efc297e51bd680802aa85887c4c3c46b 100644
--- a/Sample/StandardSample/CustomMorphologyBuilder.cpp
+++ b/Sample/StandardSample/CustomMorphologyBuilder.cpp
@@ -17,14 +17,14 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createCustomMorphology()
+Sample* ExemplarySamples::createCustomMorphology()
 {
     Material mat_vacuum = refMat::Vacuum;
     Material mat_particle = refMat::Particle;
@@ -112,7 +112,7 @@ MultiLayer* ExemplarySamples::createCustomMorphology()
     particle_layout.addParticle(p10, 0.5);
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     return sample;
 }
diff --git a/Sample/StandardSample/CustomMorphologyBuilder.h b/Sample/StandardSample/CustomMorphologyBuilder.h
index 46c07d1d588e15339176c714c7e3e0400d2f011f..47e10f3e8b8257552764f9b58a687daef4dbd4a9 100644
--- a/Sample/StandardSample/CustomMorphologyBuilder.h
+++ b/Sample/StandardSample/CustomMorphologyBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_CUSTOMMORPHOLOGYBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_CUSTOMMORPHOLOGYBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: mixture of different particles (IsGISAXS example #7).
 
 namespace ExemplarySamples {
 
-MultiLayer* createCustomMorphology();
+Sample* createCustomMorphology();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/CylindersAndPrismsBuilder.cpp b/Sample/StandardSample/CylindersAndPrismsBuilder.cpp
index d94264f40358cec48ca5d628fb4bc074217298cc..a25f3e7f9534bd467fe9d5ad99e83ad8410c3783 100644
--- a/Sample/StandardSample/CylindersAndPrismsBuilder.cpp
+++ b/Sample/StandardSample/CylindersAndPrismsBuilder.cpp
@@ -17,13 +17,13 @@
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createCylindersAndPrisms()
+Sample* ExemplarySamples::createCylindersAndPrisms()
 {
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
 
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
diff --git a/Sample/StandardSample/CylindersAndPrismsBuilder.h b/Sample/StandardSample/CylindersAndPrismsBuilder.h
index 9149892d187f0c412874b091a0219ef0aeb6b1d3..2d86dc9900eb9bd69035056bf18c93d7d41a85e5 100644
--- a/Sample/StandardSample/CylindersAndPrismsBuilder.h
+++ b/Sample/StandardSample/CylindersAndPrismsBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_CYLINDERSANDPRISMSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_CYLINDERSANDPRISMSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: mixture of cylinders and prisms without interference (IsGISAXS example #1).
 
 namespace ExemplarySamples {
 
-MultiLayer* createCylindersAndPrisms();
+Sample* createCylindersAndPrisms();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/CylindersBuilder.cpp b/Sample/StandardSample/CylindersBuilder.cpp
index 43d0c3a92b25ba83e61d309d1566e0c918e49c62..9b5e55c48ba456d8e82b9b9fc3fa620408f4f380 100644
--- a/Sample/StandardSample/CylindersBuilder.cpp
+++ b/Sample/StandardSample/CylindersBuilder.cpp
@@ -16,11 +16,11 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createCylindersInDWBA()
+Sample* ExemplarySamples::createCylindersInDWBA()
 {
     double height(5);
     double radius(5);
@@ -35,13 +35,13 @@ MultiLayer* ExemplarySamples::createCylindersInDWBA()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createCylindersInBA(double height, double radius)
+Sample* ExemplarySamples::createCylindersInBA(double height, double radius)
 {
     Layer vacuum_layer(refMat::Vacuum);
 
@@ -52,12 +52,12 @@ MultiLayer* ExemplarySamples::createCylindersInBA(double height, double radius)
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createLargeCylindersInDWBA(double height, double radius)
+Sample* ExemplarySamples::createLargeCylindersInDWBA(double height, double radius)
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -69,7 +69,7 @@ MultiLayer* ExemplarySamples::createLargeCylindersInDWBA(double height, double r
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/CylindersBuilder.h b/Sample/StandardSample/CylindersBuilder.h
index 2a4321d2255dd680245eeca4c7301f8ed5c30894..6dac8dccafd06d2a29507c3d5e641404cf35ba35 100644
--- a/Sample/StandardSample/CylindersBuilder.h
+++ b/Sample/StandardSample/CylindersBuilder.h
@@ -18,18 +18,18 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_CYLINDERSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_CYLINDERSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 namespace ExemplarySamples {
 
 //! Builds sample: cylinder form factor in DWBA (IsGISAXS example #3, part I).
-MultiLayer* createCylindersInDWBA();
+Sample* createCylindersInDWBA();
 
 //! Builds sample: cylinder form factor in BA (IsGISAXS example #3, part II).
-MultiLayer* createCylindersInBA(double height = 5, double radius = 5);
+Sample* createCylindersInBA(double height = 5, double radius = 5);
 
 //! Builds sample with large cylinders for MC integration tests.
-MultiLayer* createLargeCylindersInDWBA(double height = 1000, double radius = 500);
+Sample* createLargeCylindersInDWBA(double height = 1000, double radius = 500);
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/ExemplarySamples.h b/Sample/StandardSample/ExemplarySamples.h
index b50ec1b827be2591a836f3cd359d74673037c672..fcc2738f5b285127db5390941b617fe376e90797 100644
--- a/Sample/StandardSample/ExemplarySamples.h
+++ b/Sample/StandardSample/ExemplarySamples.h
@@ -15,7 +15,7 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_EXEMPLARYSAMPLES_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_EXEMPLARYSAMPLES_H
 
-class MultiLayer;
+class Sample;
 
 #include "Sample/StandardSample/BoxCompositionBuilder.h"
 #include "Sample/StandardSample/BoxesSquareLatticeBuilder.h"
diff --git a/Sample/StandardSample/FeNiBilayerBuilder.cpp b/Sample/StandardSample/FeNiBilayerBuilder.cpp
index 190689b1b73c32b51e0f28246cea4b4d15f6cef2..c6c161ea610d577c4d9d18bb0fbf1f0298b33e59 100644
--- a/Sample/StandardSample/FeNiBilayerBuilder.cpp
+++ b/Sample/StandardSample/FeNiBilayerBuilder.cpp
@@ -19,7 +19,7 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 
 using Units::deg;
 
@@ -77,7 +77,7 @@ public:
         sample = constructSample();
     }
 
-    MultiLayer* release() { return sample.release(); }
+    Sample* release() { return sample.release(); }
 
 private:
     int NBilayers;
@@ -91,14 +91,14 @@ private:
 
     R3 magnetizationVector;
 
-    std::unique_ptr<MultiLayer> sample;
+    std::unique_ptr<Sample> sample;
 
-    std::unique_ptr<MultiLayer> constructSample();
+    std::unique_ptr<Sample> constructSample();
 };
 
-std::unique_ptr<MultiLayer> FeNiBilayer::constructSample()
+std::unique_ptr<Sample> FeNiBilayer::constructSample()
 {
-    auto result = std::make_unique<MultiLayer>();
+    auto result = std::make_unique<Sample>();
 
     auto m_ambient = MaterialBySLD("Ambient", 0.0, 0.0);
     auto m_Fe =
@@ -129,13 +129,13 @@ std::unique_ptr<MultiLayer> FeNiBilayer::constructSample()
 } // namespace
 
 
-MultiLayer* ExemplarySamples::createFeNiBilayer()
+Sample* ExemplarySamples::createFeNiBilayer()
 {
     auto sample = FeNiBilayer{Options()};
     return sample.release();
 }
 
-MultiLayer* ExemplarySamples::createFeNiBilayerTanh()
+Sample* ExemplarySamples::createFeNiBilayerTanh()
 {
     Options opt;
     opt.setSigmaRoughness(2. * Units::angstrom);
@@ -144,7 +144,7 @@ MultiLayer* ExemplarySamples::createFeNiBilayerTanh()
     return sample.release();
 }
 
-MultiLayer* ExemplarySamples::createFeNiBilayerNC()
+Sample* ExemplarySamples::createFeNiBilayerNC()
 {
     Options opt;
     opt.setSigmaRoughness(2. * Units::angstrom);
@@ -153,7 +153,7 @@ MultiLayer* ExemplarySamples::createFeNiBilayerNC()
     return sample.release();
 }
 
-MultiLayer* ExemplarySamples::createFeNiBilayerSpinFlip()
+Sample* ExemplarySamples::createFeNiBilayerSpinFlip()
 {
     Options opt;
     opt.setAngle(38. * deg);
@@ -161,7 +161,7 @@ MultiLayer* ExemplarySamples::createFeNiBilayerSpinFlip()
     return sample.release();
 }
 
-MultiLayer* ExemplarySamples::createFeNiBilayerSpinFlipTanh()
+Sample* ExemplarySamples::createFeNiBilayerSpinFlipTanh()
 {
     Options opt;
     opt.setAngle(38. * deg);
@@ -171,7 +171,7 @@ MultiLayer* ExemplarySamples::createFeNiBilayerSpinFlipTanh()
     return sample.release();
 }
 
-MultiLayer* ExemplarySamples::createFeNiBilayerSpinFlipNC()
+Sample* ExemplarySamples::createFeNiBilayerSpinFlipNC()
 {
     Options opt;
     opt.setAngle(38. * deg);
diff --git a/Sample/StandardSample/FeNiBilayerBuilder.h b/Sample/StandardSample/FeNiBilayerBuilder.h
index c5b1f25758dad8b04e27189d2f0d8046b74bfe25..a7879adf6dc95f777513d4b9f22de7921a77f3f0 100644
--- a/Sample/StandardSample/FeNiBilayerBuilder.h
+++ b/Sample/StandardSample/FeNiBilayerBuilder.h
@@ -19,41 +19,41 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_FENIBILAYERBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_FENIBILAYERBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 namespace ExemplarySamples {
 
-MultiLayer* createFeNiBilayer();
+Sample* createFeNiBilayer();
 
 } // namespace ExemplarySamples
 
 namespace ExemplarySamples {
 
-MultiLayer* createFeNiBilayerTanh();
+Sample* createFeNiBilayerTanh();
 
 } // namespace ExemplarySamples
 
 namespace ExemplarySamples {
 
-MultiLayer* createFeNiBilayerNC();
+Sample* createFeNiBilayerNC();
 
 } // namespace ExemplarySamples
 
 namespace ExemplarySamples {
 
-MultiLayer* createFeNiBilayerSpinFlip();
+Sample* createFeNiBilayerSpinFlip();
 
 } // namespace ExemplarySamples
 
 namespace ExemplarySamples {
 
-MultiLayer* createFeNiBilayerSpinFlipTanh();
+Sample* createFeNiBilayerSpinFlipTanh();
 
 } // namespace ExemplarySamples
 
 namespace ExemplarySamples {
 
-MultiLayer* createFeNiBilayerSpinFlipNC();
+Sample* createFeNiBilayerSpinFlipNC();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/HomogeneousMultilayerBuilder.cpp b/Sample/StandardSample/HomogeneousMultilayerBuilder.cpp
index 678697ad6266d226e9d57a1e80c60d2c20726d60..d696132651573421a2727780bf73d5fdb132f438 100644
--- a/Sample/StandardSample/HomogeneousMultilayerBuilder.cpp
+++ b/Sample/StandardSample/HomogeneousMultilayerBuilder.cpp
@@ -15,9 +15,9 @@
 #include "Sample/StandardSample/HomogeneousMultilayerBuilder.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 
-MultiLayer* ExemplarySamples::createHomogeneousMultilayer()
+Sample* ExemplarySamples::createHomogeneousMultilayer()
 {
     const size_t number_of_layers = 10;
     const double delta_ti = -7.36e-7;
@@ -36,7 +36,7 @@ MultiLayer* ExemplarySamples::createHomogeneousMultilayer()
     Layer ti_layer(ti_material, thick_ti);
     Layer substrate_layer(substrate_material);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     for (size_t i = 0; i < number_of_layers; ++i) {
         sample->addLayer(ti_layer);
diff --git a/Sample/StandardSample/HomogeneousMultilayerBuilder.h b/Sample/StandardSample/HomogeneousMultilayerBuilder.h
index a7a8f58dca26557705b5141ad504a33c8f74027d..ea3df992e367b34f619272a04672e5a7f608290e 100644
--- a/Sample/StandardSample/HomogeneousMultilayerBuilder.h
+++ b/Sample/StandardSample/HomogeneousMultilayerBuilder.h
@@ -18,7 +18,7 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_HOMOGENEOUSMULTILAYERBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_HOMOGENEOUSMULTILAYERBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds a sample with 10 interchanging homogeneous layers of Ti and Ni on silicone substrate.
 //! Ti is 70 angstroms thick, Ni is 30 angstroms thick.
@@ -26,7 +26,7 @@ class MultiLayer;
 
 namespace ExemplarySamples {
 
-MultiLayer* createHomogeneousMultilayer();
+Sample* createHomogeneousMultilayer();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/LatticeBuilder.cpp b/Sample/StandardSample/LatticeBuilder.cpp
index 4c8a125b993e43e690bf635b1b09cf8d3fff5002..3d3f427fe5018c2864efd696fa4a7b8d7b5f7878 100644
--- a/Sample/StandardSample/LatticeBuilder.cpp
+++ b/Sample/StandardSample/LatticeBuilder.cpp
@@ -20,13 +20,13 @@
 #include "Sample/Correlation/Profiles2D.h"
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createLattice1D()
+Sample* ExemplarySamples::createLattice1D()
 {
     const double length(20.0);
     const double xi(10.0 * deg);
@@ -49,7 +49,7 @@ MultiLayer* ExemplarySamples::createLattice1D()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/LatticeBuilder.h b/Sample/StandardSample/LatticeBuilder.h
index da5a722c365d69475d3c7d9563da14bc0d8b361a..38882ab8e1aadb114dd800a90ab9d2c4aca94b5d 100644
--- a/Sample/StandardSample/LatticeBuilder.h
+++ b/Sample/StandardSample/LatticeBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_LATTICEBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_LATTICEBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: cylinders with 1DDL structure factor.
 
 namespace ExemplarySamples {
 
-MultiLayer* createLattice1D();
+Sample* createLattice1D();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/LayersWithAbsorptionBuilder.cpp b/Sample/StandardSample/LayersWithAbsorptionBuilder.cpp
index f9de3f0e767083067545bc237d4892e158d0e0d4..4e3bccb1eac371c0d3731f1ac371d0ffa4d3eb67 100644
--- a/Sample/StandardSample/LayersWithAbsorptionBuilder.cpp
+++ b/Sample/StandardSample/LayersWithAbsorptionBuilder.cpp
@@ -17,14 +17,14 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Sphere.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createLayersWithAbsorptionWithFF(const IFormfactor* ff)
+Sample* ExemplarySamples::createLayersWithAbsorptionWithFF(const IFormfactor* ff)
 {
     const double middle_layer_thickness(60.0);
 
@@ -43,7 +43,7 @@ MultiLayer* ExemplarySamples::createLayersWithAbsorptionWithFF(const IFormfactor
 
     middle_layer.addLayout(layout);
 
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->setName(ff->className());
     result->addLayer(vacuum_layer);
     result->addLayer(middle_layer);
diff --git a/Sample/StandardSample/LayersWithAbsorptionBuilder.h b/Sample/StandardSample/LayersWithAbsorptionBuilder.h
index 71170d021ca7def2ea4340f2c84813169177ef73..131398cb30142f19347dba7687b98cec2fa7d184 100644
--- a/Sample/StandardSample/LayersWithAbsorptionBuilder.h
+++ b/Sample/StandardSample/LayersWithAbsorptionBuilder.h
@@ -19,7 +19,7 @@
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_LAYERSWITHABSORPTIONBUILDER_H
 
 class IFormfactor;
-class MultiLayer;
+class Sample;
 
 //! The LayersWithAbsorptionBuilder class generates a sample with 3 layers with
 //! absorption (refractive index has imaginary part).
@@ -28,7 +28,7 @@ class MultiLayer;
 
 namespace ExemplarySamples {
 
-MultiLayer* createLayersWithAbsorptionWithFF(const IFormfactor*);
+Sample* createLayersWithAbsorptionWithFF(const IFormfactor*);
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.cpp b/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.cpp
index 46f85de3733d3193da56adb622fc1a07647e5c9a..76121067a59226be478caccc27aea8ef4ef8c661 100644
--- a/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.cpp
+++ b/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.cpp
@@ -18,7 +18,7 @@
 #include "Sample/HardParticle/Sphere.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
 
@@ -26,7 +26,7 @@ using Units::deg;
 
 const double middle_layer_thickness(60.0);
 
-MultiLayer* ExemplarySamples::createLayersWithAbsorptionBySLD()
+Sample* ExemplarySamples::createLayersWithAbsorptionBySLD()
 {
     Material ambience_mat = MaterialBySLD("Vacuum", 0.0, 0.0);
     Material middle_mat = MaterialBySLD("Teflon", 4.7573e-6, 1.6724e-12);
@@ -50,7 +50,7 @@ MultiLayer* ExemplarySamples::createLayersWithAbsorptionBySLD()
 
     middle_layer.addLayout(layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(middle_layer);
     sample->addLayer(substrate);
diff --git a/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.h b/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.h
index 8cc9eeac4062de9be22b038859912999795687f3..81ec273c35118c45d40cb652c1d7a2c271010ff7 100644
--- a/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.h
+++ b/Sample/StandardSample/LayersWithAbsorptionBySLDBuilder.h
@@ -18,7 +18,7 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_LAYERSWITHABSORPTIONBYSLDBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_LAYERSWITHABSORPTIONBYSLDBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! The LayersWithAbsorptionBySLDBuilder class generates a sample with 3 layers with
 //! absorption (refractive index has imaginary part). //! The middle layer is populated with
@@ -26,7 +26,7 @@ class MultiLayer;
 
 namespace ExemplarySamples {
 
-MultiLayer* createLayersWithAbsorptionBySLD();
+Sample* createLayersWithAbsorptionBySLD();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/MagneticLayersBuilder.cpp b/Sample/StandardSample/MagneticLayersBuilder.cpp
index 141d634101fcfde2568bbbbe1a9c426fea7aa944..b3da64131ab5426b1ae16a4186db42b62398e86c 100644
--- a/Sample/StandardSample/MagneticLayersBuilder.cpp
+++ b/Sample/StandardSample/MagneticLayersBuilder.cpp
@@ -20,7 +20,7 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
 #include <map>
@@ -35,7 +35,7 @@ const double sphere_radius = 5;
 
 //  ************************************************************************************************
 
-MultiLayer* ExemplarySamples::createMagneticSubstrateZeroField()
+Sample* ExemplarySamples::createMagneticSubstrateZeroField()
 {
     R3 substr_field(0.0, 0.0, 0.0);
     R3 particle_field(0.1, 0.0, 0.0);
@@ -54,7 +54,7 @@ MultiLayer* ExemplarySamples::createMagneticSubstrateZeroField()
     Layer substrate_layer(substrate_material);
     substrate_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -62,9 +62,9 @@ MultiLayer* ExemplarySamples::createMagneticSubstrateZeroField()
 
 //  ************************************************************************************************
 
-MultiLayer* ExemplarySamples::createSimpleMagneticLayer()
+Sample* ExemplarySamples::createSimpleMagneticLayer()
 {
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
 
     R3 layer_field = R3(0.0, 1e8, 0.0);
     Material vacuum_material = MaterialBySLD("Vacuum", 0.0, 0.0);
@@ -83,9 +83,9 @@ MultiLayer* ExemplarySamples::createSimpleMagneticLayer()
 
 //  ************************************************************************************************
 
-MultiLayer* ExemplarySamples::createMagneticLayer()
+Sample* ExemplarySamples::createMagneticLayer()
 {
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
 
     R3 layer_field = R3(0.0, 0.0, 1e6);
     R3 particle_field(1e6, 0.0, 0.0);
@@ -110,8 +110,7 @@ MultiLayer* ExemplarySamples::createMagneticLayer()
 
 //  ************************************************************************************************
 
-MultiLayer*
-ExemplarySamples::createSimpleMagneticRotationWithRoughness(const std::string& roughnessKey)
+Sample* ExemplarySamples::createSimpleMagneticRotationWithRoughness(const std::string& roughnessKey)
 {
     double sigmaRoughness = 0.;
     std::unique_ptr<InterlayerModel> interlayerModel;
@@ -128,7 +127,7 @@ ExemplarySamples::createSimpleMagneticRotationWithRoughness(const std::string& r
     } else
         ASSERT_NEVER;
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
 
     R3 substr_field = R3(0.0, 1e6, 0.0);
     R3 layer_field = R3(1e6, 1e6, 0.0);
@@ -151,9 +150,9 @@ ExemplarySamples::createSimpleMagneticRotationWithRoughness(const std::string& r
 
 //  ************************************************************************************************
 
-MultiLayer* ExemplarySamples::createMagneticRotation()
+Sample* ExemplarySamples::createMagneticRotation()
 {
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
 
     R3 substr_field = R3(0.0, 1e6, 0.0);
     R3 particle_field(1e6, 0.0, 0.0);
diff --git a/Sample/StandardSample/MagneticLayersBuilder.h b/Sample/StandardSample/MagneticLayersBuilder.h
index 7c02853b44c7e64d8c1ba9cb66a6f2b16dfbad11..0daf4f74f31a9ed466c92da27d5dfd9bd14acb97 100644
--- a/Sample/StandardSample/MagneticLayersBuilder.h
+++ b/Sample/StandardSample/MagneticLayersBuilder.h
@@ -18,7 +18,7 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_MAGNETICLAYERSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_MAGNETICLAYERSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 #include "Sample/Interface/InterlayerModels.h"
 #include <string>
@@ -27,7 +27,7 @@ class MultiLayer;
 
 namespace ExemplarySamples {
 
-MultiLayer* createMagneticSubstrateZeroField();
+Sample* createMagneticSubstrateZeroField();
 
 } // namespace ExemplarySamples
 
@@ -35,7 +35,7 @@ MultiLayer* createMagneticSubstrateZeroField();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSimpleMagneticLayer();
+Sample* createSimpleMagneticLayer();
 
 } // namespace ExemplarySamples
 
@@ -43,7 +43,7 @@ MultiLayer* createSimpleMagneticLayer();
 
 namespace ExemplarySamples {
 
-MultiLayer* createMagneticLayer();
+Sample* createMagneticLayer();
 
 } // namespace ExemplarySamples
 
@@ -51,7 +51,7 @@ MultiLayer* createMagneticLayer();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSimpleMagneticRotationWithRoughness(const std::string& roughnessKey);
+Sample* createSimpleMagneticRotationWithRoughness(const std::string& roughnessKey);
 
 } // namespace ExemplarySamples
 
@@ -59,7 +59,7 @@ MultiLayer* createSimpleMagneticRotationWithRoughness(const std::string& roughne
 
 namespace ExemplarySamples {
 
-MultiLayer* createMagneticRotation();
+Sample* createMagneticRotation();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/MagneticParticlesBuilder.cpp b/Sample/StandardSample/MagneticParticlesBuilder.cpp
index 9f06947a56a05bb7322fcd642e9e4d05b8dcac3b..32ec9effb290a3f4709033ac68a256b22975592f 100644
--- a/Sample/StandardSample/MagneticParticlesBuilder.cpp
+++ b/Sample/StandardSample/MagneticParticlesBuilder.cpp
@@ -19,14 +19,14 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 
 // ----------------------------------------------------------------------------
 // Magnetic cylinders and zero magnetic field
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createMagneticParticleZeroField()
+Sample* ExemplarySamples::createMagneticParticleZeroField()
 {
     const double m_cylinder_radius(5);
     const double m_cylinder_height(5);
@@ -46,7 +46,7 @@ MultiLayer* ExemplarySamples::createMagneticParticleZeroField()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -56,7 +56,7 @@ MultiLayer* ExemplarySamples::createMagneticParticleZeroField()
 // Magnetic cylinders and non-zero magnetization
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createMagneticCylinders()
+Sample* ExemplarySamples::createMagneticCylinders()
 {
     const double m_cylinder_radius(5);
     const double m_cylinder_height(5);
@@ -76,7 +76,7 @@ MultiLayer* ExemplarySamples::createMagneticCylinders()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -86,7 +86,7 @@ MultiLayer* ExemplarySamples::createMagneticCylinders()
 // Magnetic spheres inside substrate
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createMagneticSpheres()
+Sample* ExemplarySamples::createMagneticSpheres()
 {
     const double m_sphere_radius(5);
 
@@ -107,7 +107,7 @@ MultiLayer* ExemplarySamples::createMagneticSpheres()
     Layer substrate_layer(substrate_material);
     substrate_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/MagneticParticlesBuilder.h b/Sample/StandardSample/MagneticParticlesBuilder.h
index 03195cd670dae6a45ad9eb41111719051600fbbd..025bd39119cda5ea592597d150e0d320e64e32f6 100644
--- a/Sample/StandardSample/MagneticParticlesBuilder.h
+++ b/Sample/StandardSample/MagneticParticlesBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_MAGNETICPARTICLESBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_MAGNETICPARTICLESBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: cylinders with magnetic material and zero magnetic field.
 
 namespace ExemplarySamples {
 
-MultiLayer* createMagneticParticleZeroField();
+Sample* createMagneticParticleZeroField();
 
 } // namespace ExemplarySamples
 
@@ -32,7 +32,7 @@ MultiLayer* createMagneticParticleZeroField();
 
 namespace ExemplarySamples {
 
-MultiLayer* createMagneticCylinders();
+Sample* createMagneticCylinders();
 
 } // namespace ExemplarySamples
 
@@ -40,7 +40,7 @@ MultiLayer* createMagneticCylinders();
 
 namespace ExemplarySamples {
 
-MultiLayer* createMagneticSpheres();
+Sample* createMagneticSpheres();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/MesocrystalBuilder.cpp b/Sample/StandardSample/MesocrystalBuilder.cpp
index ab08f0dda9dc520cad471bc9d041d009fc515f13..fa021a36867534a58ea47f5688b96c3541f1337f 100644
--- a/Sample/StandardSample/MesocrystalBuilder.cpp
+++ b/Sample/StandardSample/MesocrystalBuilder.cpp
@@ -19,13 +19,13 @@
 #include "Sample/HardParticle/Sphere.h"
 #include "Sample/Lattice/Lattice3D.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Crystal.h"
 #include "Sample/Particle/Mesocrystal.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createMesocrystal()
+Sample* ExemplarySamples::createMesocrystal()
 {
     // mesocrystal lattice
     R3 lattice_basis_a(5.0, 0.0, 0.0);
@@ -52,13 +52,13 @@ MultiLayer* ExemplarySamples::createMesocrystal()
     vacuum_layer.addLayout(particle_layout);
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createMesocrystalPlus()
+Sample* ExemplarySamples::createMesocrystalPlus()
 {
     int n = 3;
     double L = 10.0;
@@ -89,7 +89,7 @@ MultiLayer* ExemplarySamples::createMesocrystalPlus()
     vacuum_layer.addLayout(particle_layout);
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/MesocrystalBuilder.h b/Sample/StandardSample/MesocrystalBuilder.h
index 0f48baa9ca65ce39a8a4297e018450fbb0d878b4..dcbcbfdf6b029ebb87b93462dfa54efa85becc70 100644
--- a/Sample/StandardSample/MesocrystalBuilder.h
+++ b/Sample/StandardSample/MesocrystalBuilder.h
@@ -18,17 +18,17 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_MESOCRYSTALBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_MESOCRYSTALBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample.
 
 namespace ExemplarySamples {
 
 //! Cylindrical mesocrystal composed of spheres in a cubic lattice.
-MultiLayer* createMesocrystal();
+Sample* createMesocrystal();
 
 //! Small cylinder mesocrystal (shape of "plus" sign).
-MultiLayer* createMesocrystalPlus();
+Sample* createMesocrystalPlus();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/MultiLayerWithRoughnessBuilder.cpp b/Sample/StandardSample/MultiLayerWithRoughnessBuilder.cpp
index 7545002a1519acf5fc3d0ce8b06eeb8f24c25b35..17f42b90ffcbd7f19f29cd49a74db93e7905f5e3 100644
--- a/Sample/StandardSample/MultiLayerWithRoughnessBuilder.cpp
+++ b/Sample/StandardSample/MultiLayerWithRoughnessBuilder.cpp
@@ -16,10 +16,10 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 
 namespace {
-MultiLayer* createMultiLayerWithInterlayerModel(const InterlayerModel* interlayerModel)
+Sample* createMultiLayerWithInterlayerModel(const InterlayerModel* interlayerModel)
 {
     const double thicknessA(2.5);
     const double thicknessB(5.0);
@@ -42,7 +42,7 @@ MultiLayer* createMultiLayerWithInterlayerModel(const InterlayerModel* interlaye
     Layer partB_layer(part_b_material, thicknessB, &roughness);
     Layer substrate_layer(substrate_material, &roughness);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     for (int i = 0; i < 5; ++i) {
         sample->addLayer(partA_layer);
@@ -53,13 +53,13 @@ MultiLayer* createMultiLayerWithInterlayerModel(const InterlayerModel* interlaye
 }
 } // namespace
 
-MultiLayer* ExemplarySamples::createMultiLayerWithRoughness()
+Sample* ExemplarySamples::createMultiLayerWithRoughness()
 {
     TanhInterlayer interlayer;
     return createMultiLayerWithInterlayerModel(&interlayer);
 }
 
-MultiLayer* ExemplarySamples::createMultiLayerWithNCRoughness()
+Sample* ExemplarySamples::createMultiLayerWithNCRoughness()
 {
     ErfInterlayer interlayer;
     return createMultiLayerWithInterlayerModel(&interlayer);
diff --git a/Sample/StandardSample/MultiLayerWithRoughnessBuilder.h b/Sample/StandardSample/MultiLayerWithRoughnessBuilder.h
index 9396ace6e8e181d4d9422826bb2fda07a9e2f68a..e39b1ebd84543a266dfde476ecfdc62b4254be0d 100644
--- a/Sample/StandardSample/MultiLayerWithRoughnessBuilder.h
+++ b/Sample/StandardSample/MultiLayerWithRoughnessBuilder.h
@@ -18,15 +18,15 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_MULTILAYERWITHROUGHNESSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_MULTILAYERWITHROUGHNESSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: layers with correlated roughness.
 
 namespace ExemplarySamples {
 
-MultiLayer* createMultiLayerWithRoughness();
+Sample* createMultiLayerWithRoughness();
 
-MultiLayer* createMultiLayerWithNCRoughness();
+Sample* createMultiLayerWithNCRoughness();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/MultipleLayoutBuilder.cpp b/Sample/StandardSample/MultipleLayoutBuilder.cpp
index a5d9f81db95cb11da306674573a74efa384112e3..d31be0367c077476020320d1a598254b019ad49e 100644
--- a/Sample/StandardSample/MultipleLayoutBuilder.cpp
+++ b/Sample/StandardSample/MultipleLayoutBuilder.cpp
@@ -17,11 +17,11 @@
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createMultipleLayout()
+Sample* ExemplarySamples::createMultipleLayout()
 {
     const double cylinder_height(5);
     const double cylinder_radius(5);
@@ -47,7 +47,7 @@ MultiLayer* ExemplarySamples::createMultipleLayout()
     vacuum_layer.addLayout(particle_layout_1);
     vacuum_layer.addLayout(particle_layout_2);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/MultipleLayoutBuilder.h b/Sample/StandardSample/MultipleLayoutBuilder.h
index 4de79862808b2deba045fba29fd7bba921115c9e..aad805345d21a11cd2cab79a1b69a8222d6b8b10 100644
--- a/Sample/StandardSample/MultipleLayoutBuilder.h
+++ b/Sample/StandardSample/MultipleLayoutBuilder.h
@@ -18,14 +18,14 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_MULTIPLELAYOUTBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_MULTIPLELAYOUTBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: mixture of cylinders and prisms without interference,
 //! using multiple particle layouts
 
 namespace ExemplarySamples {
 
-MultiLayer* createMultipleLayout();
+Sample* createMultipleLayout();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/ParacrystalBuilder.cpp b/Sample/StandardSample/ParacrystalBuilder.cpp
index 68a35a1c23fd82a315ee6f5159c3e208e320534c..1d6dc583b1146587e1c9ee954b2342ede6680a44 100644
--- a/Sample/StandardSample/ParacrystalBuilder.cpp
+++ b/Sample/StandardSample/ParacrystalBuilder.cpp
@@ -20,13 +20,13 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createRadialParacrystal()
+Sample* ExemplarySamples::createRadialParacrystal()
 {
     const double m_corr_peak_distance(20.0);
     const double m_corr_width(7);
@@ -48,7 +48,7 @@ MultiLayer* ExemplarySamples::createRadialParacrystal()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->addLayer(vacuum_layer);
     result->addLayer(substrate_layer);
     return result;
@@ -58,7 +58,7 @@ MultiLayer* ExemplarySamples::createRadialParacrystal()
 // Basic2DParacrystalBuilder
 // -----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createBasic2DParacrystalWithFTDis(const IProfile2D* pdf2)
+Sample* ExemplarySamples::createBasic2DParacrystalWithFTDis(const IProfile2D* pdf2)
 {
     const Profile2DCauchy pdf1(0.1, 0.2, 0);
 
@@ -78,7 +78,7 @@ MultiLayer* ExemplarySamples::createBasic2DParacrystalWithFTDis(const IProfile2D
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->setName("Basic2DParacrystal_" + pdf2->className());
     result->addLayer(vacuum_layer);
     result->addLayer(substrate_layer);
@@ -89,7 +89,7 @@ MultiLayer* ExemplarySamples::createBasic2DParacrystalWithFTDis(const IProfile2D
 // HexParacrystalBuilder
 // -----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createHexParacrystal()
+Sample* ExemplarySamples::createHexParacrystal()
 {
     const double m_peak_distance(20.0);
     const double m_corr_length(0.0);
@@ -115,7 +115,7 @@ MultiLayer* ExemplarySamples::createHexParacrystal()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->addLayer(vacuum_layer);
     result->addLayer(substrate_layer);
     return result;
@@ -125,7 +125,7 @@ MultiLayer* ExemplarySamples::createHexParacrystal()
 // RectParacrystalBuilder
 // -----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createRectParacrystal()
+Sample* ExemplarySamples::createRectParacrystal()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -145,7 +145,7 @@ MultiLayer* ExemplarySamples::createRectParacrystal()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->addLayer(vacuum_layer);
     result->addLayer(substrate_layer);
     return result;
diff --git a/Sample/StandardSample/ParacrystalBuilder.h b/Sample/StandardSample/ParacrystalBuilder.h
index f00a368bf1646417fe935885c4023dd410d1f8a7..659c5011c93bf9bda6c1b38b0aa632062528843d 100644
--- a/Sample/StandardSample/ParacrystalBuilder.h
+++ b/Sample/StandardSample/ParacrystalBuilder.h
@@ -19,14 +19,14 @@
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_PARACRYSTALBUILDER_H
 
 class IProfile2D;
-class MultiLayer;
 class Profile2DComponents;
+class Sample;
 
 //! Builds sample: cylinders with 1DDL structure factor (IsGISAXS example #4).
 
 namespace ExemplarySamples {
 
-MultiLayer* createRadialParacrystal();
+Sample* createRadialParacrystal();
 
 } // namespace ExemplarySamples
 
@@ -35,7 +35,7 @@ MultiLayer* createRadialParacrystal();
 
 namespace ExemplarySamples {
 
-MultiLayer* createBasic2DParacrystalWithFTDis(const IProfile2D* pdf2);
+Sample* createBasic2DParacrystalWithFTDis(const IProfile2D* pdf2);
 
 } // namespace ExemplarySamples
 
@@ -43,7 +43,7 @@ MultiLayer* createBasic2DParacrystalWithFTDis(const IProfile2D* pdf2);
 
 namespace ExemplarySamples {
 
-MultiLayer* createHexParacrystal();
+Sample* createHexParacrystal();
 
 } // namespace ExemplarySamples
 
@@ -51,7 +51,7 @@ MultiLayer* createHexParacrystal();
 
 namespace ExemplarySamples {
 
-MultiLayer* createRectParacrystal();
+Sample* createRectParacrystal();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/ParticleDistributionsBuilder.cpp b/Sample/StandardSample/ParticleDistributionsBuilder.cpp
index 43c7c7d34272645b848b3f76ed594fded24e1212..e1fdd265a843f17aa2de70d7262d8d5e9719c307 100644
--- a/Sample/StandardSample/ParticleDistributionsBuilder.cpp
+++ b/Sample/StandardSample/ParticleDistributionsBuilder.cpp
@@ -20,11 +20,11 @@
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/HardParticle/Sphere.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createCylindersWithSizeDistribution()
+Sample* ExemplarySamples::createCylindersWithSizeDistribution()
 {
     throw std::runtime_error(
         "This sample used ParticleDistribution which is not supported any more.");
@@ -66,7 +66,7 @@ MultiLayer* ExemplarySamples::createCylindersWithSizeDistribution()
 //
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createTwoTypesCylindersDistribution()
+Sample* ExemplarySamples::createTwoTypesCylindersDistribution()
 {
     throw std::runtime_error(
         "This sample used ParticleDistribution which is not supported any more.");
@@ -125,7 +125,7 @@ MultiLayer* ExemplarySamples::createTwoTypesCylindersDistribution()
 
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createRotatedPyramidsDistribution()
+Sample* ExemplarySamples::createRotatedPyramidsDistribution()
 {
     throw std::runtime_error(
         "This sample used ParticleDistribution which is not supported any more.");
@@ -167,7 +167,7 @@ MultiLayer* ExemplarySamples::createRotatedPyramidsDistribution()
 
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createSpheresWithLimitsDistribution()
+Sample* ExemplarySamples::createSpheresWithLimitsDistribution()
 {
     throw std::runtime_error(
         "This sample used ParticleDistribution which is not supported any more.");
@@ -205,7 +205,7 @@ MultiLayer* ExemplarySamples::createSpheresWithLimitsDistribution()
 
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createConesWithLimitsDistribution()
+Sample* ExemplarySamples::createConesWithLimitsDistribution()
 {
     throw std::runtime_error(
         "This sample used ParticleDistribution which is not supported any more.");
@@ -241,7 +241,7 @@ MultiLayer* ExemplarySamples::createConesWithLimitsDistribution()
     */
 }
 
-MultiLayer* ExemplarySamples::createLinkedBoxDistribution()
+Sample* ExemplarySamples::createLinkedBoxDistribution()
 {
     throw std::runtime_error(
         "This sample used ParticleDistribution which is not supported any more.");
diff --git a/Sample/StandardSample/ParticleDistributionsBuilder.h b/Sample/StandardSample/ParticleDistributionsBuilder.h
index e9cbec98f0c42636d4f1c1294af24c6f865f1507..6083b880823dd7d36942c1a0c16ce6006316802c 100644
--- a/Sample/StandardSample/ParticleDistributionsBuilder.h
+++ b/Sample/StandardSample/ParticleDistributionsBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_PARTICLEDISTRIBUTIONSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_PARTICLEDISTRIBUTIONSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Cylinders in BA with size distributions (IsGISAXS example #3, part II).
 
 namespace ExemplarySamples {
 
-MultiLayer* createCylindersWithSizeDistribution();
+Sample* createCylindersWithSizeDistribution();
 
 } // namespace ExemplarySamples
 
@@ -32,7 +32,7 @@ MultiLayer* createCylindersWithSizeDistribution();
 
 namespace ExemplarySamples {
 
-MultiLayer* createTwoTypesCylindersDistribution();
+Sample* createTwoTypesCylindersDistribution();
 
 } // namespace ExemplarySamples
 
@@ -40,7 +40,7 @@ MultiLayer* createTwoTypesCylindersDistribution();
 
 namespace ExemplarySamples {
 
-MultiLayer* createRotatedPyramidsDistribution();
+Sample* createRotatedPyramidsDistribution();
 
 } // namespace ExemplarySamples
 
@@ -48,7 +48,7 @@ MultiLayer* createRotatedPyramidsDistribution();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSpheresWithLimitsDistribution();
+Sample* createSpheresWithLimitsDistribution();
 
 } // namespace ExemplarySamples
 
@@ -56,7 +56,7 @@ MultiLayer* createSpheresWithLimitsDistribution();
 
 namespace ExemplarySamples {
 
-MultiLayer* createConesWithLimitsDistribution();
+Sample* createConesWithLimitsDistribution();
 
 } // namespace ExemplarySamples
 
@@ -64,7 +64,7 @@ MultiLayer* createConesWithLimitsDistribution();
 
 namespace ExemplarySamples {
 
-MultiLayer* createLinkedBoxDistribution();
+Sample* createLinkedBoxDistribution();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/ParticleInVacuumBuilder.cpp b/Sample/StandardSample/ParticleInVacuumBuilder.cpp
index e4e83b0e19f5ea94ff56bc097ebd72a2a74403e8..a3f601819250d2eb5797a6ef1eaee167973337a8 100644
--- a/Sample/StandardSample/ParticleInVacuumBuilder.cpp
+++ b/Sample/StandardSample/ParticleInVacuumBuilder.cpp
@@ -16,12 +16,12 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Sphere.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 #include <iostream>
 
-MultiLayer* ExemplarySamples::createParticleInVacuumWithFF(const IFormfactor* ff)
+Sample* ExemplarySamples::createParticleInVacuumWithFF(const IFormfactor* ff)
 {
     Layer vacuum_layer(refMat::Vacuum);
 
@@ -29,7 +29,7 @@ MultiLayer* ExemplarySamples::createParticleInVacuumWithFF(const IFormfactor* ff
     ParticleLayout particle_layout(particle);
     vacuum_layer.addLayout(particle_layout);
 
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->setName("ParticleInVacuum_" + ff->className());
     result->addLayer(vacuum_layer);
     return result;
diff --git a/Sample/StandardSample/ParticleInVacuumBuilder.h b/Sample/StandardSample/ParticleInVacuumBuilder.h
index 0c1a37754f7cd223bd09a0a41e7b3cade09c3ef9..4c49a72aa9c8733872f5e3bf2420b5f5ab4ff5d7 100644
--- a/Sample/StandardSample/ParticleInVacuumBuilder.h
+++ b/Sample/StandardSample/ParticleInVacuumBuilder.h
@@ -19,14 +19,14 @@
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_PARTICLEINVACUUMBUILDER_H
 
 class IFormfactor;
-class MultiLayer;
+class Sample;
 
 //! The ParticleInVacuumBuilder class generates a sample with single vacuum layer
 //! populated with particles of certain types.
 
 namespace ExemplarySamples {
 
-MultiLayer* createParticleInVacuumWithFF(const IFormfactor*);
+Sample* createParticleInVacuumWithFF(const IFormfactor*);
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/PercusYevickBuilder.cpp b/Sample/StandardSample/PercusYevickBuilder.cpp
index 3a2038f8505e1b1c75e81539a673e8e9e4855b4e..4cdf15fc46cf08ff898ff48240d38f32c640cced 100644
--- a/Sample/StandardSample/PercusYevickBuilder.cpp
+++ b/Sample/StandardSample/PercusYevickBuilder.cpp
@@ -17,11 +17,11 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createHardDisk()
+Sample* ExemplarySamples::createHardDisk()
 {
     const double m_cylinder_height(5);
     const double m_cylinder_radius(5);
@@ -40,7 +40,7 @@ MultiLayer* ExemplarySamples::createHardDisk()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/PercusYevickBuilder.h b/Sample/StandardSample/PercusYevickBuilder.h
index 1e32457086137d2080fe520a96e48c2fcf9cb01e..44e0b60fc6e96f153906228f81f8771542874ef0 100644
--- a/Sample/StandardSample/PercusYevickBuilder.h
+++ b/Sample/StandardSample/PercusYevickBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_PERCUSYEVICKBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_PERCUSYEVICKBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: cylinders with hard disk Percus-Yevick interference.
 
 namespace ExemplarySamples {
 
-MultiLayer* createHardDisk();
+Sample* createHardDisk();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/PlainMultiLayerBySLDBuilder.cpp b/Sample/StandardSample/PlainMultiLayerBySLDBuilder.cpp
index 0d154fbbe4adb3b6c2b149fc242bb86bcd1566d4..8c1c5e52f792894a31c505cf3b31a27fde02e8ad 100644
--- a/Sample/StandardSample/PlainMultiLayerBySLDBuilder.cpp
+++ b/Sample/StandardSample/PlainMultiLayerBySLDBuilder.cpp
@@ -15,7 +15,7 @@
 #include "Sample/StandardSample/PlainMultiLayerBySLDBuilder.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 
 namespace {
 
@@ -30,7 +30,7 @@ const MaterialData m_ni{9.4245e-06, 1.1423e-09};
 
 } // namespace
 
-MultiLayer* ExemplarySamples::createPlainMultiLayerBySLD(int n_layers, double thick_ti)
+Sample* ExemplarySamples::createPlainMultiLayerBySLD(int n_layers, double thick_ti)
 {
     double thick_ni(7.0);
 
@@ -44,7 +44,7 @@ MultiLayer* ExemplarySamples::createPlainMultiLayerBySLD(int n_layers, double th
     Layer ti_layer(ti_material, thick_ti);
     Layer substrate_layer(substrate_material);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     for (int i = 0; i < n_layers; ++i) {
         sample->addLayer(ti_layer);
diff --git a/Sample/StandardSample/PlainMultiLayerBySLDBuilder.h b/Sample/StandardSample/PlainMultiLayerBySLDBuilder.h
index 835ee60b93ea44f7416d757505f5ab3ea5d8905b..6f226ed67ed988f5ab355a5f25ced9587521bc9c 100644
--- a/Sample/StandardSample/PlainMultiLayerBySLDBuilder.h
+++ b/Sample/StandardSample/PlainMultiLayerBySLDBuilder.h
@@ -18,14 +18,14 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_PLAINMULTILAYERBYSLDBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_PLAINMULTILAYERBYSLDBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds a sample with 10 interchanging homogeneous layers of Ti and Ni on silicone substrate.
 //! Ti is 70 angstroms thick, Ni is 30 angstroms thick.
 
 namespace ExemplarySamples {
 
-MultiLayer* createPlainMultiLayerBySLD(int n_layers = 10, double thick_ti = 3.0);
+Sample* createPlainMultiLayerBySLD(int n_layers = 10, double thick_ti = 3.0);
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/ReferenceMaterials.h b/Sample/StandardSample/ReferenceMaterials.h
index 7c9227cedcd4005fe55e0eee07b04701274aa607..a1c2e10d95dccd30f0270f517b8f36bb4c9e7a16 100644
--- a/Sample/StandardSample/ReferenceMaterials.h
+++ b/Sample/StandardSample/ReferenceMaterials.h
@@ -18,7 +18,7 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_REFERENCEMATERIALS_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_REFERENCEMATERIALS_H
 
-class MultiLayer;
+class Sample;
 
 #include "Sample/Material/MaterialFactoryFuncs.h"
 
diff --git a/Sample/StandardSample/ResonatorBuilder.cpp b/Sample/StandardSample/ResonatorBuilder.cpp
index fdf95b7039410c728f3df7e543a30dd4906153b7..075ac319cb829d1c71d4603dbffab3a89a1c513b 100644
--- a/Sample/StandardSample/ResonatorBuilder.cpp
+++ b/Sample/StandardSample/ResonatorBuilder.cpp
@@ -16,12 +16,12 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include <memory>
 
-MultiLayer* ExemplarySamples::createResonator(double ti_thickness)
+Sample* ExemplarySamples::createResonator(double ti_thickness)
 {
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
 
     Material m_Si = RefractiveMaterial("Si", 8.25218379931e-06, 0.0);
     Material m_Ti = RefractiveMaterial("Ti", -7.6593316363e-06, 3.81961616312e-09);
diff --git a/Sample/StandardSample/ResonatorBuilder.h b/Sample/StandardSample/ResonatorBuilder.h
index cd2c8ef0b2791c51c25d1f6090cfcf0bc946e416..dd1c81529e6945c9c1af901cf3a7e241260accd0 100644
--- a/Sample/StandardSample/ResonatorBuilder.h
+++ b/Sample/StandardSample/ResonatorBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_RESONATORBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_RESONATORBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: sample with Ti/Pt layers sequence.
 
 namespace ExemplarySamples {
 
-MultiLayer* createResonator(double ti_thickness = 13.0);
+Sample* createResonator(double ti_thickness = 13.0);
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/RipplesBuilder.cpp b/Sample/StandardSample/RipplesBuilder.cpp
index a3f07f6d48dda39718e096b0fe5b31973cc2839a..779d201b61594fb88543567b7513dc9737bb9589 100644
--- a/Sample/StandardSample/RipplesBuilder.cpp
+++ b/Sample/StandardSample/RipplesBuilder.cpp
@@ -18,11 +18,11 @@
 #include "Sample/HardParticle/CosineRipple.h"
 #include "Sample/HardParticle/SawtoothRipple.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createCosineRipple()
+Sample* ExemplarySamples::createCosineRipple()
 {
     Layer vacuum_layer(refMat::Vacuum);
     CosineRippleBox ff_ripple1(100.0, 20.0, 4.0);
@@ -39,13 +39,13 @@ MultiLayer* ExemplarySamples::createCosineRipple()
 
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createTriangularRipple(double d)
+Sample* ExemplarySamples::createTriangularRipple(double d)
 {
     Layer vacuum_layer(refMat::Vacuum);
     SawtoothRippleBox ff_ripple2(100.0, 20.0, 4.0, d);
@@ -61,13 +61,13 @@ MultiLayer* ExemplarySamples::createTriangularRipple(double d)
     vacuum_layer.addLayout(particle_layout);
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createAsymRipple()
+Sample* ExemplarySamples::createAsymRipple()
 {
     return ExemplarySamples::createTriangularRipple(-3);
 }
diff --git a/Sample/StandardSample/RipplesBuilder.h b/Sample/StandardSample/RipplesBuilder.h
index a16f88fa5e1ca53560e477371c1322e292863bcb..00235e9067fcf134b3c429524c4e20d594daea1e 100644
--- a/Sample/StandardSample/RipplesBuilder.h
+++ b/Sample/StandardSample/RipplesBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_RIPPLESBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_RIPPLESBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: cosine ripple within the 1D-paracrystal model.
 
 namespace ExemplarySamples {
 
-MultiLayer* createCosineRipple();
+Sample* createCosineRipple();
 
 } // namespace ExemplarySamples
 
@@ -32,13 +32,13 @@ MultiLayer* createCosineRipple();
 
 namespace ExemplarySamples {
 
-MultiLayer* createTriangularRipple(double d = 0);
+Sample* createTriangularRipple(double d = 0);
 
 } // namespace ExemplarySamples
 
 namespace ExemplarySamples {
 
-MultiLayer* createAsymRipple();
+Sample* createAsymRipple();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/RotatedPyramidsBuilder.cpp b/Sample/StandardSample/RotatedPyramidsBuilder.cpp
index cc3e9986d8375b0c2b3ff8918f51365b8f06f7f7..a39202ad65cac28eedcca7e1d749775719bc12f9 100644
--- a/Sample/StandardSample/RotatedPyramidsBuilder.cpp
+++ b/Sample/StandardSample/RotatedPyramidsBuilder.cpp
@@ -17,14 +17,14 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createRotatedPyramids()
+Sample* ExemplarySamples::createRotatedPyramids()
 {
     const double m_length(10);
     const double m_height(5);
@@ -46,7 +46,7 @@ MultiLayer* ExemplarySamples::createRotatedPyramids()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/RotatedPyramidsBuilder.h b/Sample/StandardSample/RotatedPyramidsBuilder.h
index 891e9b1fb8435466150f457bdb45f612d690dca8..fffc00c2cd0f3d422f9bb6c15b0d471515778e3a 100644
--- a/Sample/StandardSample/RotatedPyramidsBuilder.h
+++ b/Sample/StandardSample/RotatedPyramidsBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_ROTATEDPYRAMIDSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_ROTATEDPYRAMIDSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: Pyramids, rotated pyramids on top of substrate (IsGISAXS example #9)
 
 namespace ExemplarySamples {
 
-MultiLayer* createRotatedPyramids();
+Sample* createRotatedPyramids();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/SimpleLayerBuilder.cpp b/Sample/StandardSample/SimpleLayerBuilder.cpp
index a704cbdc7e72aa39a7cad1de9b30099f31904a85..5c7716e6e727a24bb9cc04ab88d8a97d891a2622 100644
--- a/Sample/StandardSample/SimpleLayerBuilder.cpp
+++ b/Sample/StandardSample/SimpleLayerBuilder.cpp
@@ -14,10 +14,10 @@
 
 #include "Sample/StandardSample/SimpleLayerBuilder.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createSimpleLayer()
+Sample* ExemplarySamples::createSimpleLayer()
 {
     const double layer_thickness(10.0);
 
@@ -25,7 +25,7 @@ MultiLayer* ExemplarySamples::createSimpleLayer()
     Layer middle_layer(refMat::Particle, layer_thickness);
     Layer substrate(refMat::Substrate);
 
-    auto* result = new MultiLayer;
+    auto* result = new Sample;
     result->addLayer(vacuum_layer);
     result->addLayer(middle_layer);
     result->addLayer(substrate);
diff --git a/Sample/StandardSample/SimpleLayerBuilder.h b/Sample/StandardSample/SimpleLayerBuilder.h
index ed36b285bf09c05c50f551b972923a87512fd868..e61e4e7036f070382eef481473dad23ba64550d1 100644
--- a/Sample/StandardSample/SimpleLayerBuilder.h
+++ b/Sample/StandardSample/SimpleLayerBuilder.h
@@ -19,13 +19,13 @@
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_SIMPLELAYERBUILDER_H
 
 class IFormfactor;
-class MultiLayer;
+class Sample;
 
 //! Generates a sample with single layer without particles
 
 namespace ExemplarySamples {
 
-MultiLayer* createSimpleLayer();
+Sample* createSimpleLayer();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/SizeDistributionModelsBuilder.cpp b/Sample/StandardSample/SizeDistributionModelsBuilder.cpp
index f89a65263010205617b3256fae57c46537332ffb..98fef28bf92c7e0ed5920b474b4aebbb800a5d5a 100644
--- a/Sample/StandardSample/SizeDistributionModelsBuilder.cpp
+++ b/Sample/StandardSample/SizeDistributionModelsBuilder.cpp
@@ -18,11 +18,11 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
-MultiLayer* ExemplarySamples::createSizeDistributionDAModel()
+Sample* ExemplarySamples::createSizeDistributionDAModel()
 {
     // cylindrical particle 1
     double radius1(5);
@@ -51,7 +51,7 @@ MultiLayer* ExemplarySamples::createSizeDistributionDAModel()
     vacuum_layer.addLayout(particle_layout);
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -59,7 +59,7 @@ MultiLayer* ExemplarySamples::createSizeDistributionDAModel()
 
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createSizeDistributionLMAModel()
+Sample* ExemplarySamples::createSizeDistributionLMAModel()
 {
     // cylindrical particle 1
     double radius1(5);
@@ -96,7 +96,7 @@ MultiLayer* ExemplarySamples::createSizeDistributionLMAModel()
     vacuum_layer.addLayout(particle_layout2);
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -104,7 +104,7 @@ MultiLayer* ExemplarySamples::createSizeDistributionLMAModel()
 
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createSizeDistributionSSCAModel()
+Sample* ExemplarySamples::createSizeDistributionSSCAModel()
 {
     // cylindrical particle 1
     double radius1(5);
@@ -134,7 +134,7 @@ MultiLayer* ExemplarySamples::createSizeDistributionSSCAModel()
     vacuum_layer.addLayout(particle_layout);
     Layer substrate_layer(refMat::Substrate);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -142,7 +142,7 @@ MultiLayer* ExemplarySamples::createSizeDistributionSSCAModel()
 
 // ----------------------------------------------------------------------------
 
-MultiLayer* ExemplarySamples::createCylindersInSSCA()
+Sample* ExemplarySamples::createCylindersInSSCA()
 {
     throw std::runtime_error(
         "This sample used ParticleDistribution which is not supported any more.");
diff --git a/Sample/StandardSample/SizeDistributionModelsBuilder.h b/Sample/StandardSample/SizeDistributionModelsBuilder.h
index 9c8f9289416aec717ad42e267ff15406d15cb58d..45769083abbf56521f8acef31fcf8f1c48723452 100644
--- a/Sample/StandardSample/SizeDistributionModelsBuilder.h
+++ b/Sample/StandardSample/SizeDistributionModelsBuilder.h
@@ -18,14 +18,14 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_SIZEDISTRIBUTIONMODELSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_SIZEDISTRIBUTIONMODELSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Creates the sample demonstrating size distribution model in decoupling approximation.
 //! Equivalent of Examples/Python/simulation/ex03_Interferences/ApproximationDA.py
 
 namespace ExemplarySamples {
 
-MultiLayer* createSizeDistributionDAModel();
+Sample* createSizeDistributionDAModel();
 
 } // namespace ExemplarySamples
 
@@ -34,7 +34,7 @@ MultiLayer* createSizeDistributionDAModel();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSizeDistributionLMAModel();
+Sample* createSizeDistributionLMAModel();
 
 } // namespace ExemplarySamples
 
@@ -43,7 +43,7 @@ MultiLayer* createSizeDistributionLMAModel();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSizeDistributionSSCAModel();
+Sample* createSizeDistributionSSCAModel();
 
 } // namespace ExemplarySamples
 
@@ -51,7 +51,7 @@ MultiLayer* createSizeDistributionSSCAModel();
 
 namespace ExemplarySamples {
 
-MultiLayer* createCylindersInSSCA();
+Sample* createCylindersInSSCA();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/SlicedCompositionBuilder.cpp b/Sample/StandardSample/SlicedCompositionBuilder.cpp
index 770af2dc441a12c8df6cdd29785fa4f80de23ea7..2b4faa5a129b037ad4b1d3dd5ac7b8898c0ff8fa 100644
--- a/Sample/StandardSample/SlicedCompositionBuilder.cpp
+++ b/Sample/StandardSample/SlicedCompositionBuilder.cpp
@@ -17,7 +17,7 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/TruncatedSphere.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
@@ -25,7 +25,7 @@
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createSlicedComposition()
+Sample* ExemplarySamples::createSlicedComposition()
 {
     const double sphere_radius = 10.0;
     const double bottom_cup_height = 4.0;
@@ -49,7 +49,7 @@ MultiLayer* ExemplarySamples::createSlicedComposition()
 
     Layer substrate_layer(refMat::Substrate2);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/SlicedCompositionBuilder.h b/Sample/StandardSample/SlicedCompositionBuilder.h
index daea45c43a3a94ec7aa6b903b778b0cf6e97bd4e..aa8bef577a7f1d4252520d8f25da90316e33b087 100644
--- a/Sample/StandardSample/SlicedCompositionBuilder.h
+++ b/Sample/StandardSample/SlicedCompositionBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_SLICEDCOMPOSITIONBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_SLICEDCOMPOSITIONBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: spherical composition made of top+bottom spherical cups
 
 namespace ExemplarySamples {
 
-MultiLayer* createSlicedComposition();
+Sample* createSlicedComposition();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/SlicedCylindersBuilder.cpp b/Sample/StandardSample/SlicedCylindersBuilder.cpp
index ba4818b2a96c4f52fb043c251e616105a9325344..72fa5f71a3bc06021167b373501c2dd752eb5d5d 100644
--- a/Sample/StandardSample/SlicedCylindersBuilder.cpp
+++ b/Sample/StandardSample/SlicedCylindersBuilder.cpp
@@ -19,7 +19,7 @@
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 
 using PhysConsts::pi;
@@ -46,7 +46,7 @@ complex_t averageSLD(complex_t sld_p, complex_t sld_l, double eff_vol)
 
 } // namespace
 
-MultiLayer* ExemplarySamples::createSlicedCylinders()
+Sample* ExemplarySamples::createSlicedCylinders()
 {
     Material vacuum_material = RefractiveMaterial("Vacuum", 0.0, 0.0);
     Material substrate_material = RefractiveMaterial("Substrate", 6e-6, 2e-8);
@@ -63,13 +63,13 @@ MultiLayer* ExemplarySamples::createSlicedCylinders()
     vacuum_layer.addLayout(particle_layout);
     vacuum_layer.setNumberOfSlices(n_slices);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createSLDSlicedCylinders()
+Sample* ExemplarySamples::createSLDSlicedCylinders()
 {
     Material vacuum_material = MaterialBySLD("Vacuum", 0.0, 0.0);
     complex_t sub_sld = getSLDFromN(wavelength, 6e-6, 2e-8);
@@ -88,13 +88,13 @@ MultiLayer* ExemplarySamples::createSLDSlicedCylinders()
     vacuum_layer.addLayout(particle_layout);
     vacuum_layer.setNumberOfSlices(n_slices);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
 }
 
-MultiLayer* ExemplarySamples::createAveragedSlicedCylinders()
+Sample* ExemplarySamples::createAveragedSlicedCylinders()
 {
     const auto par_surf_density = ParticleLayout().totalParticleSurfaceDensity();
 
@@ -112,7 +112,7 @@ MultiLayer* ExemplarySamples::createAveragedSlicedCylinders()
     Layer avr_layer(avr_material, height / n_slices);
     Layer substrate_layer(substrate_material);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     for (size_t i = 0; i < n_slices; ++i)
         sample->addLayer(avr_layer);
diff --git a/Sample/StandardSample/SlicedCylindersBuilder.h b/Sample/StandardSample/SlicedCylindersBuilder.h
index a165384ab63c74785721bd45e0deb68a80ac96c2..57e04f484d548e189157274ac7433b4512ffe85c 100644
--- a/Sample/StandardSample/SlicedCylindersBuilder.h
+++ b/Sample/StandardSample/SlicedCylindersBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_SLICEDCYLINDERSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_SLICEDCYLINDERSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: cylinders on a silicon substrate
 
 namespace ExemplarySamples {
 
-MultiLayer* createSlicedCylinders();
+Sample* createSlicedCylinders();
 
 } // namespace ExemplarySamples
 
@@ -33,7 +33,7 @@ MultiLayer* createSlicedCylinders();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSLDSlicedCylinders();
+Sample* createSLDSlicedCylinders();
 
 } // namespace ExemplarySamples
 
@@ -43,7 +43,7 @@ MultiLayer* createSLDSlicedCylinders();
 
 namespace ExemplarySamples {
 
-MultiLayer* createAveragedSlicedCylinders();
+Sample* createAveragedSlicedCylinders();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/ThickAbsorptiveSampleBuilder.cpp b/Sample/StandardSample/ThickAbsorptiveSampleBuilder.cpp
index 6da87dfc3e9111beb37761f0fc60e752a6caf608..e8b6cc7cc00eebdc18f85d5a3d3860588143b317 100644
--- a/Sample/StandardSample/ThickAbsorptiveSampleBuilder.cpp
+++ b/Sample/StandardSample/ThickAbsorptiveSampleBuilder.cpp
@@ -16,9 +16,9 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 
-MultiLayer* ExemplarySamples::createThickAbsorptiveSample()
+Sample* ExemplarySamples::createThickAbsorptiveSample()
 {
     Material vacuum_material = MaterialBySLD("Vacuum", 0.0, 0.0);
     Material au_material = MaterialBySLD("Au", 3.48388057043e-05, 1.79057609656e-05);
@@ -33,7 +33,7 @@ MultiLayer* ExemplarySamples::createThickAbsorptiveSample()
     Layer vacuum_layer_2(vacuum_material, 10.0);
     Layer substrate_layer(si_material, &roughness);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(au_layer);
     sample->addLayer(vacuum_layer_2);
diff --git a/Sample/StandardSample/ThickAbsorptiveSampleBuilder.h b/Sample/StandardSample/ThickAbsorptiveSampleBuilder.h
index c2d45be5338d9a34e687460f6e3ee6c3819901f9..bac4c3c9aa0b339cbe9a9387450c96cec4b543b3 100644
--- a/Sample/StandardSample/ThickAbsorptiveSampleBuilder.h
+++ b/Sample/StandardSample/ThickAbsorptiveSampleBuilder.h
@@ -18,11 +18,11 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_THICKABSORPTIVESAMPLEBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_THICKABSORPTIVESAMPLEBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 namespace ExemplarySamples {
 
-MultiLayer* createThickAbsorptiveSample();
+Sample* createThickAbsorptiveSample();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/TransformationsBuilder.cpp b/Sample/StandardSample/TransformationsBuilder.cpp
index 6f9452eb9121ab552f62f017223d6fdbe903ae25..1c157faa5d08966b5744bad89fea09896d6f81fb 100644
--- a/Sample/StandardSample/TransformationsBuilder.cpp
+++ b/Sample/StandardSample/TransformationsBuilder.cpp
@@ -17,14 +17,14 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/HardParticle/Polyhedra.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/Scattering/Rotations.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createTransformBox()
+Sample* ExemplarySamples::createTransformBox()
 {
     const double layer_thickness(100);
     const double length(50);
@@ -44,7 +44,7 @@ MultiLayer* ExemplarySamples::createTransformBox()
     middle_layer.addLayout(layout);
     Layer substrate(refMat::Substrate2);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(middle_layer);
     sample->addLayer(substrate);
diff --git a/Sample/StandardSample/TransformationsBuilder.h b/Sample/StandardSample/TransformationsBuilder.h
index 841250cad367e73a86f97adb1f0a9461d8195da5..5ff07559cd518269a8847746a501e059bbbbc97b 100644
--- a/Sample/StandardSample/TransformationsBuilder.h
+++ b/Sample/StandardSample/TransformationsBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_TRANSFORMATIONSBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_TRANSFORMATIONSBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Rotated box in 3 layers system.
 
 namespace ExemplarySamples {
 
-MultiLayer* createTransformBox();
+Sample* createTransformBox();
 
 } // namespace ExemplarySamples
 
diff --git a/Sample/StandardSample/TwoDimLatticeBuilder.cpp b/Sample/StandardSample/TwoDimLatticeBuilder.cpp
index 6f1a0a76e988701995e2695aeb14bb1084474b1e..61f569f0bc00f1f273356ba430820a414c061ea3 100644
--- a/Sample/StandardSample/TwoDimLatticeBuilder.cpp
+++ b/Sample/StandardSample/TwoDimLatticeBuilder.cpp
@@ -21,14 +21,14 @@
 #include "Sample/Correlation/Profiles2D.h"
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/Particle.h"
 #include "Sample/StandardSample/ReferenceMaterials.h"
 
 using Units::deg;
 
-MultiLayer* ExemplarySamples::createBasic2DLattice()
+Sample* ExemplarySamples::createBasic2DLattice()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -48,7 +48,7 @@ MultiLayer* ExemplarySamples::createBasic2DLattice()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -57,7 +57,7 @@ MultiLayer* ExemplarySamples::createBasic2DLattice()
 // -----------------------------------------------------------------------------
 // lattice #1:
 // -----------------------------------------------------------------------------
-MultiLayer* ExemplarySamples::createSquareLattice2D()
+Sample* ExemplarySamples::createSquareLattice2D()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -76,7 +76,7 @@ MultiLayer* ExemplarySamples::createSquareLattice2D()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -85,7 +85,7 @@ MultiLayer* ExemplarySamples::createSquareLattice2D()
 // -----------------------------------------------------------------------------
 // lattice #2: centered
 // -----------------------------------------------------------------------------
-MultiLayer* ExemplarySamples::createCenteredSquareLattice2D()
+Sample* ExemplarySamples::createCenteredSquareLattice2D()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -109,7 +109,7 @@ MultiLayer* ExemplarySamples::createCenteredSquareLattice2D()
     particle_layout.setInterference(interparticle);
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -118,7 +118,7 @@ MultiLayer* ExemplarySamples::createCenteredSquareLattice2D()
 // -----------------------------------------------------------------------------
 // lattice #3: rotated
 // -----------------------------------------------------------------------------
-MultiLayer* ExemplarySamples::createRotatedSquareLattice2D()
+Sample* ExemplarySamples::createRotatedSquareLattice2D()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -138,7 +138,7 @@ MultiLayer* ExemplarySamples::createRotatedSquareLattice2D()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -147,7 +147,7 @@ MultiLayer* ExemplarySamples::createRotatedSquareLattice2D()
 // -----------------------------------------------------------------------------
 // lattice #4: finite square
 // -----------------------------------------------------------------------------
-MultiLayer* ExemplarySamples::createFiniteSquareLattice2D()
+Sample* ExemplarySamples::createFiniteSquareLattice2D()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -165,7 +165,7 @@ MultiLayer* ExemplarySamples::createFiniteSquareLattice2D()
 
     vacuum_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
@@ -174,7 +174,7 @@ MultiLayer* ExemplarySamples::createFiniteSquareLattice2D()
 // -----------------------------------------------------------------------------
 // lattice #5: superlattice
 // -----------------------------------------------------------------------------
-MultiLayer* ExemplarySamples::createSuperLattice()
+Sample* ExemplarySamples::createSuperLattice()
 {
     Layer vacuum_layer(refMat::Vacuum);
     Layer substrate_layer(refMat::Substrate);
@@ -196,7 +196,7 @@ MultiLayer* ExemplarySamples::createSuperLattice()
 
     substrate_layer.addLayout(particle_layout);
 
-    auto* sample = new MultiLayer;
+    auto* sample = new Sample;
     sample->addLayer(vacuum_layer);
     sample->addLayer(substrate_layer);
     return sample;
diff --git a/Sample/StandardSample/TwoDimLatticeBuilder.h b/Sample/StandardSample/TwoDimLatticeBuilder.h
index 2a2da8b6e6fa9b686c25bf8aac2a5fbbaa37c43c..04193801f7e07d5b593f11178d9a2c4f15a68f17 100644
--- a/Sample/StandardSample/TwoDimLatticeBuilder.h
+++ b/Sample/StandardSample/TwoDimLatticeBuilder.h
@@ -18,13 +18,13 @@
 #ifndef BORNAGAIN_SAMPLE_STANDARDSAMPLE_TWODIMLATTICEBUILDER_H
 #define BORNAGAIN_SAMPLE_STANDARDSAMPLE_TWODIMLATTICEBUILDER_H
 
-class MultiLayer;
+class Sample;
 
 //! Builds sample: 2D lattice with arbitrary angle and different lattice length_1 and length_2.
 
 namespace ExemplarySamples {
 
-MultiLayer* createBasic2DLattice();
+Sample* createBasic2DLattice();
 
 } // namespace ExemplarySamples
 
@@ -32,7 +32,7 @@ MultiLayer* createBasic2DLattice();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSquareLattice2D();
+Sample* createSquareLattice2D();
 
 } // namespace ExemplarySamples
 
@@ -40,7 +40,7 @@ MultiLayer* createSquareLattice2D();
 
 namespace ExemplarySamples {
 
-MultiLayer* createCenteredSquareLattice2D();
+Sample* createCenteredSquareLattice2D();
 
 } // namespace ExemplarySamples
 
@@ -48,7 +48,7 @@ MultiLayer* createCenteredSquareLattice2D();
 
 namespace ExemplarySamples {
 
-MultiLayer* createRotatedSquareLattice2D();
+Sample* createRotatedSquareLattice2D();
 
 } // namespace ExemplarySamples
 
@@ -56,7 +56,7 @@ MultiLayer* createRotatedSquareLattice2D();
 
 namespace ExemplarySamples {
 
-MultiLayer* createFiniteSquareLattice2D();
+Sample* createFiniteSquareLattice2D();
 
 } // namespace ExemplarySamples
 
@@ -64,7 +64,7 @@ MultiLayer* createFiniteSquareLattice2D();
 
 namespace ExemplarySamples {
 
-MultiLayer* createSuperLattice();
+Sample* createSuperLattice();
 
 } // namespace ExemplarySamples
 
diff --git a/Sim/Computation/RoughMultiLayerContribution.cpp b/Sim/Computation/RoughMultiLayerContribution.cpp
index b06082d109cf063481e5d2c51ec9b9346e248828..0551581a4406e7b5cb4f206ae8bdbaab541c43c9 100644
--- a/Sim/Computation/RoughMultiLayerContribution.cpp
+++ b/Sim/Computation/RoughMultiLayerContribution.cpp
@@ -21,7 +21,7 @@
 #include "Resample/Processed/ReSample.h"
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 
 using PhysConsts::pi;
 
diff --git a/Sim/Export/ExportToPython.cpp b/Sim/Export/ExportToPython.cpp
index 49e1241e995608192d74f8880206423796dc7632..333b83e982ea97e4043ab46f8b8fe43fafadd50e 100644
--- a/Sim/Export/ExportToPython.cpp
+++ b/Sim/Export/ExportToPython.cpp
@@ -23,7 +23,7 @@ std::string Py::Export::codeHeader(const std::string& code)
     return "import bornagain as ba\n" + Py::Fmt::printImportedSymbols(code) + "\n\n";
 }
 
-std::string Py::Export::sampleCode(const MultiLayer& sample)
+std::string Py::Export::sampleCode(const Sample& sample)
 {
     std::string sample_code = SampleToPython().sampleCode(sample);
     return Py::Export::codeHeader(sample_code) + sample_code;
diff --git a/Sim/Export/ExportToPython.h b/Sim/Export/ExportToPython.h
index 4f1e3ba35d1f39ff92e7c6a827c34358c46cba4c..3119e92d2e21812cd85da4fe396b85ac45b53bd3 100644
--- a/Sim/Export/ExportToPython.h
+++ b/Sim/Export/ExportToPython.h
@@ -18,14 +18,14 @@
 #include <string>
 
 class ISimulation;
-class MultiLayer;
+class Sample;
 
 //! Wraps methods that serialize objects to Python.
 
 namespace Py::Export {
 
 std::string codeHeader(const std::string& code);
-std::string sampleCode(const MultiLayer& sample);
+std::string sampleCode(const Sample& sample);
 std::string simulationPlotCode(const ISimulation& simulation);
 std::string simulationSaveCode(const ISimulation& simulation, const std::string& fname);
 
diff --git a/Sim/Export/SampleToPython.cpp b/Sim/Export/SampleToPython.cpp
index 7bed030b7580203ad3f8c4ff4258b3e4776cf63d..4e348442db14f2ad608ad4da53438d767738ce08 100644
--- a/Sim/Export/SampleToPython.cpp
+++ b/Sim/Export/SampleToPython.cpp
@@ -22,7 +22,7 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Lattice/Lattice3D.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Compound.h"
 #include "Sample/Particle/CoreAndShell.h"
 #include "Sample/Particle/Crystal.h"
@@ -513,9 +513,9 @@ std::string defineCrystals(const ComponentKeyHandler& objHandler)
     return result.str();
 }
 
-std::string defineMultiLayers(const ComponentKeyHandler& objHandler)
+std::string defineSamples(const ComponentKeyHandler& objHandler)
 {
-    std::vector<const MultiLayer*> v = objHandler.objectsOfType<MultiLayer>();
+    std::vector<const Sample*> v = objHandler.objectsOfType<Sample>();
     if (v.empty())
         return "";
     std::ostringstream result;
@@ -524,7 +524,7 @@ std::string defineMultiLayers(const ComponentKeyHandler& objHandler)
     result << "\n" << indent() << "# Define sample\n";
     for (const auto* s : v) {
         const std::string& key = objHandler.obj2key(s);
-        result << indent() << key << " = ba.MultiLayer()\n";
+        result << indent() << key << " = ba.Sample()\n";
         auto external_field = s->externalField();
         if (external_field.mag() > 0.0) {
             std::string field_name = key + "_external_field";
@@ -556,7 +556,7 @@ std::string defineMultiLayers(const ComponentKeyHandler& objHandler)
 //  class SampleToPython
 //  ************************************************************************************************
 
-std::string SampleToPython::sampleCode(const MultiLayer& sample)
+std::string SampleToPython::sampleCode(const Sample& sample)
 {
     ComponentKeyHandler objHandler;
     MaterialKeyHandler matHandler;
@@ -611,7 +611,7 @@ std::string SampleToPython::sampleCode(const MultiLayer& sample)
         + defineParticleLayouts(objHandler)
         + defineRoughnesses(objHandler)
         + defineLayers(objHandler, matHandler)
-        + defineMultiLayers(objHandler)
+        + defineSamples(objHandler)
         + "\n\n";
     // clang-format on
 }
diff --git a/Sim/Export/SampleToPython.h b/Sim/Export/SampleToPython.h
index e68c52257465698411047d8dc2a8bb1f378434ec..d1cf0a7c2804e892afe97b571400c198333d07ce 100644
--- a/Sim/Export/SampleToPython.h
+++ b/Sim/Export/SampleToPython.h
@@ -21,7 +21,7 @@
 #include <string>
 
 class IParticle;
-class MultiLayer;
+class Sample;
 
 //! Generates Python code snippet from domain (C++) objects representing sample construction.
 
@@ -30,7 +30,7 @@ public:
     SampleToPython();
     ~SampleToPython() = default;
 
-    std::string sampleCode(const MultiLayer& sample);
+    std::string sampleCode(const Sample& sample);
 };
 
 #endif // BORNAGAIN_SIM_EXPORT_SAMPLETOPYTHON_H
diff --git a/Sim/Simulation/DepthprobeSimulation.cpp b/Sim/Simulation/DepthprobeSimulation.cpp
index 75eb6af8d317cb1871cf03b039240d95b5fb991f..81d0a09655372bf88edfb663451309bf0869d637 100644
--- a/Sim/Simulation/DepthprobeSimulation.cpp
+++ b/Sim/Simulation/DepthprobeSimulation.cpp
@@ -38,7 +38,7 @@ const int WaveProperty_Intensity = 0;
 const int WaveProperty_Modulus = 4;
 const int WaveProperty_Phase = 8;
 
-DepthprobeSimulation::DepthprobeSimulation(const BeamScan& scan, const MultiLayer& sample,
+DepthprobeSimulation::DepthprobeSimulation(const BeamScan& scan, const Sample& sample,
                                            const Scale& zaxis, int flags)
     : ISimulation(sample)
     , m_scan(dynamic_cast<AlphaScan*>(scan.clone()))
diff --git a/Sim/Simulation/DepthprobeSimulation.h b/Sim/Simulation/DepthprobeSimulation.h
index ad88944958bd3379f8a760cc9f25b43ca036df62..92849757b6acf5fa96a05546235a51f9ed409a2d 100644
--- a/Sim/Simulation/DepthprobeSimulation.h
+++ b/Sim/Simulation/DepthprobeSimulation.h
@@ -38,7 +38,7 @@ extern const int WaveProperty_Phase;
 
 class DepthprobeSimulation : public ISimulation {
 public:
-    DepthprobeSimulation(const BeamScan& scan, const MultiLayer& sample, const Scale& zaxis,
+    DepthprobeSimulation(const BeamScan& scan, const Sample& sample, const Scale& zaxis,
                          int flags = 0);
     ~DepthprobeSimulation() override;
 
diff --git a/Sim/Simulation/ISimulation.cpp b/Sim/Simulation/ISimulation.cpp
index 840d7e4585c9d3fcecab2c5ac6e3805379b64f48..c073f1b02228a08690d954de0a7d01d56f5f20eb 100644
--- a/Sim/Simulation/ISimulation.cpp
+++ b/Sim/Simulation/ISimulation.cpp
@@ -20,7 +20,7 @@
 #include "Param/Distrib/DistributionHandler.h"
 #include "Resample/Option/SimulationOptions.h"
 #include "Resample/Processed/ReSample.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sim/Background/IBackground.h"
 #include <algorithm>
 #include <gsl/gsl_errno.h>
@@ -63,7 +63,7 @@ size_t batchSize(size_t n_handlers, size_t current_handler, size_t n_elements)
 //  class implementation
 //  ************************************************************************************************
 
-ISimulation::ISimulation(const MultiLayer& sample)
+ISimulation::ISimulation(const Sample& sample)
     : m_sample(sample.clone())
     , m_options(std::make_unique<SimulationOptions>())
     , m_distribution_handler(std::make_unique<DistributionHandler>())
@@ -167,7 +167,7 @@ std::vector<const INode*> ISimulation::nodeChildren() const
     return result;
 }
 
-const MultiLayer* ISimulation::sample() const
+const Sample* ISimulation::sample() const
 {
     return m_sample.get();
 }
diff --git a/Sim/Simulation/ISimulation.h b/Sim/Simulation/ISimulation.h
index 04b233fdd89a077ea9cf8818ed0ce8bec84bc20b..5e35f75966116bceb8e469a6f6b3393f4156d814 100644
--- a/Sim/Simulation/ISimulation.h
+++ b/Sim/Simulation/ISimulation.h
@@ -25,9 +25,9 @@ class DistributionHandler;
 class Frame;
 class IBackground;
 class IComputation;
-class MultiLayer;
 class ProgressHandler;
 class ReSample;
+class Sample;
 class SimulationOptions;
 
 //! Abstract base class, holds the infrastructure to run a simulation.
@@ -42,7 +42,7 @@ class SimulationOptions;
 
 class ISimulation : public INode {
 public:
-    ISimulation(const MultiLayer& sample);
+    ISimulation(const Sample& sample);
     ~ISimulation() override;
 
     ISimulation(const ISimulation&) = delete;
@@ -67,7 +67,7 @@ public:
     //... Getters:
     std::vector<const INode*> nodeChildren() const override;
 
-    const MultiLayer* sample() const;
+    const Sample* sample() const;
     const IBackground* background() const;
     const std::vector<ParameterDistribution>& paramDistributions() const;
 
@@ -114,7 +114,7 @@ private:
     virtual Datafield packResult() = 0;
 
     //... Simulation model:
-    std::unique_ptr<const MultiLayer> m_sample;
+    std::unique_ptr<const Sample> m_sample;
     std::unique_ptr<const IBackground> m_background;
     std::unique_ptr<SimulationOptions> m_options;
 
diff --git a/Sim/Simulation/OffspecSimulation.cpp b/Sim/Simulation/OffspecSimulation.cpp
index c7ed6e6a263c90b29e9de57259b3741ac914b2a3..2561375a76c3ea3d59b56681532fba6cd81525f0 100644
--- a/Sim/Simulation/OffspecSimulation.cpp
+++ b/Sim/Simulation/OffspecSimulation.cpp
@@ -28,7 +28,7 @@
 #include "Sim/Computation/DWBAComputation.h"
 #include "Sim/Scan/PhysicalScan.h"
 
-OffspecSimulation::OffspecSimulation(const PhysicalScan& scan, const MultiLayer& sample,
+OffspecSimulation::OffspecSimulation(const PhysicalScan& scan, const Sample& sample,
                                      const OffspecDetector& detector)
     : ISimulation(sample)
     , m_scan(scan.clone())
diff --git a/Sim/Simulation/OffspecSimulation.h b/Sim/Simulation/OffspecSimulation.h
index fb87d3ef57b5c476835b1d02eb410d42571f6cbe..c2f5d409e063b53664db72e7c17adc2660d6096a 100644
--- a/Sim/Simulation/OffspecSimulation.h
+++ b/Sim/Simulation/OffspecSimulation.h
@@ -30,7 +30,7 @@ class Pixel;
 
 class OffspecSimulation : public ISimulation {
 public:
-    OffspecSimulation(const PhysicalScan& scan, const MultiLayer& sample,
+    OffspecSimulation(const PhysicalScan& scan, const Sample& sample,
                       const OffspecDetector& detector);
     ~OffspecSimulation() override;
 
diff --git a/Sim/Simulation/ScatteringSimulation.cpp b/Sim/Simulation/ScatteringSimulation.cpp
index db3870a84a5f16b7287cfae3df54acb096464c3f..b4a65572c2213716b270f1298122279cdfe91679 100644
--- a/Sim/Simulation/ScatteringSimulation.cpp
+++ b/Sim/Simulation/ScatteringSimulation.cpp
@@ -24,11 +24,11 @@
 #include "Device/Detector/IDetector.h"
 #include "Param/Distrib/DistributionHandler.h"
 #include "Resample/Element/DiffuseElement.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sim/Background/IBackground.h"
 #include "Sim/Computation/DWBAComputation.h"
 
-ScatteringSimulation::ScatteringSimulation(const Beam& beam, const MultiLayer& sample,
+ScatteringSimulation::ScatteringSimulation(const Beam& beam, const Sample& sample,
                                            const IDetector& detector)
     : ISimulation(sample)
     , m_beam(beam.clone())
diff --git a/Sim/Simulation/ScatteringSimulation.h b/Sim/Simulation/ScatteringSimulation.h
index e8dd0ffc94295bde7e6d93bed6d8fc0011fc6f80..bef405cc6676a55c511991d00012a009277a9304 100644
--- a/Sim/Simulation/ScatteringSimulation.h
+++ b/Sim/Simulation/ScatteringSimulation.h
@@ -30,7 +30,7 @@ class Pixel;
 
 class ScatteringSimulation : public ISimulation {
 public:
-    ScatteringSimulation(const Beam& beam, const MultiLayer& sample, const IDetector& detector);
+    ScatteringSimulation(const Beam& beam, const Sample& sample, const IDetector& detector);
     ~ScatteringSimulation() override;
 
     std::string className() const final { return "ScatteringSimulation"; }
diff --git a/Sim/Simulation/SpecularSimulation.cpp b/Sim/Simulation/SpecularSimulation.cpp
index 4e303742beb5b3409ae8140e4b2eac4dcd709b33..5be5d9c16b3e34b06ab6880fd3147fbe35861b1b 100644
--- a/Sim/Simulation/SpecularSimulation.cpp
+++ b/Sim/Simulation/SpecularSimulation.cpp
@@ -30,7 +30,7 @@
 #include "Sim/Computation/SpecularComputation.h"
 #include "Sim/Scan/BeamScan.h"
 
-SpecularSimulation::SpecularSimulation(const BeamScan& scan, const MultiLayer& sample)
+SpecularSimulation::SpecularSimulation(const BeamScan& scan, const Sample& sample)
     : ISimulation(sample)
     , m_scan(scan.clone())
 {
diff --git a/Sim/Simulation/SpecularSimulation.h b/Sim/Simulation/SpecularSimulation.h
index ae1cfed79295171ffcd0d43b2c2ae46b6ffc381d..07efbfe9ed5969f71d705fc53968cc2427b85ff3 100644
--- a/Sim/Simulation/SpecularSimulation.h
+++ b/Sim/Simulation/SpecularSimulation.h
@@ -27,7 +27,7 @@ class SpecularElement;
 
 class SpecularSimulation : public ISimulation {
 public:
-    SpecularSimulation(const BeamScan& scan, const MultiLayer& sample);
+    SpecularSimulation(const BeamScan& scan, const Sample& sample);
     ~SpecularSimulation() override;
 
     std::string className() const final { return "SpecularSimulation"; }
diff --git a/Tests/Functional/Fitting/FittingTests.cpp b/Tests/Functional/Fitting/FittingTests.cpp
index 404ad9bfef96312d676b298c1351d6de699f7c76..7cb57e8944bbdbaa8e6603a8c9682efdb63b8529 100644
--- a/Tests/Functional/Fitting/FittingTests.cpp
+++ b/Tests/Functional/Fitting/FittingTests.cpp
@@ -19,7 +19,7 @@
 #include "Device/Detector/SphericalDetector.h"
 #include "Device/Mask/Rectangle.h"
 #include "Fit/Kernel/Minimizer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/StandardSample/ExemplarySamples.h"
 #include "Sim/Fitting/FitObjective.h"
 #include "Sim/Simulation/OffspecSimulation.h"
@@ -45,16 +45,16 @@ bool runFitTest(const std::string& minimizer_name, const std::string& algorithm_
 //  sample builders
 //  ************************************************************************************************
 
-const auto build_CylBA = [](const mumufit::Parameters& params) -> MultiLayer* {
+const auto build_CylBA = [](const mumufit::Parameters& params) -> Sample* {
     return ExemplarySamples::createCylindersInBA(params["height"].value(),
                                                  params["radius"].value());
 };
 
-const auto build_AlternatingLayers = [](const mumufit::Parameters& params) -> MultiLayer* {
+const auto build_AlternatingLayers = [](const mumufit::Parameters& params) -> Sample* {
     return ExemplarySamples::createPlainMultiLayerBySLD(10, params["ti_thickness"].value());
 };
 
-const auto build_Resonator = [](const mumufit::Parameters& params) -> MultiLayer* {
+const auto build_Resonator = [](const mumufit::Parameters& params) -> Sample* {
     return ExemplarySamples::createResonator(params["ti_thickness"].value());
 };
 
diff --git a/Tests/Functional/Fitting/SimfitTestPlan.cpp b/Tests/Functional/Fitting/SimfitTestPlan.cpp
index 1190317b9d9f465b11f0c4cd19d677a04c768112..e15ed28832485f372199cbc42d19472e3db310e3 100644
--- a/Tests/Functional/Fitting/SimfitTestPlan.cpp
+++ b/Tests/Functional/Fitting/SimfitTestPlan.cpp
@@ -15,7 +15,7 @@
 #include "Tests/Functional/Fitting/SimfitTestPlan.h"
 #include "Device/Data/Datafield.h"
 #include "Fit/Kernel/Minimizer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sim/Fitting/FitObjective.h"
 #include "Sim/Fitting/SimDataPair.h"
 #include "Sim/Simulation/ISimulation.h"
diff --git a/Tests/Functional/Fitting/SimfitTestPlan.h b/Tests/Functional/Fitting/SimfitTestPlan.h
index ca2da78e101dc99f6a974aaf9ee5c70d95d0d62f..a4b790298e7f01e4df8f9dab0a3103c5215060fe 100644
--- a/Tests/Functional/Fitting/SimfitTestPlan.h
+++ b/Tests/Functional/Fitting/SimfitTestPlan.h
@@ -20,7 +20,7 @@
 #include <memory>
 
 class Datafield;
-class MultiLayer;
+class Sample;
 
 //! Contains all logic to construct FitObjective, setup Minimizer and check minimization results.
 
@@ -36,7 +36,7 @@ protected:
     virtual std::unique_ptr<FitObjective> createFitObjective() const;
 
     //! Creates sample for given set of fit parameters.
-    virtual std::unique_ptr<MultiLayer> createMultiLayer(const mumufit::Parameters&) const
+    virtual std::unique_ptr<Sample> createMultiLayer(const mumufit::Parameters&) const
     {
         return {};
     }
diff --git a/Tests/Py/Fit/fitobjective_api.py b/Tests/Py/Fit/fitobjective_api.py
index 7110e55faf49107b6a4e5752e2f3207e8c3db631..4cc6d6ded3117e02b0302008f512d0d5a312fae0 100644
--- a/Tests/Py/Fit/fitobjective_api.py
+++ b/Tests/Py/Fit/fitobjective_api.py
@@ -25,7 +25,7 @@ class SimulationBuilder:
         self.m_pars = dict(pars)
 
         material = ba.RefractiveMaterial("Shell", 0, 0)
-        sample = ba.MultiLayer()
+        sample = ba.Sample()
         sample.addLayer(ba.Layer(material))
         sample.addLayer(ba.Layer(material))
 
diff --git a/Tests/Py/Functional/PolarizedNoAnalyzer.py b/Tests/Py/Functional/PolarizedNoAnalyzer.py
index 76a6cef7527a0f81f894dcbbc24dbb94fcce6d9e..3dfd99c0b7ba009bfb60b205cc6615e8aab37811 100755
--- a/Tests/Py/Functional/PolarizedNoAnalyzer.py
+++ b/Tests/Py/Functional/PolarizedNoAnalyzer.py
@@ -25,7 +25,7 @@ def get_sample():
     layer_3 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/Tests/Py/Functional/auto_slicing.py b/Tests/Py/Functional/auto_slicing.py
index bdb006914f56c7c4239f7cbe2eb3e95dbbbba56d..34c4747277e17b45fcd0a919103b6cc84bc433c9 100644
--- a/Tests/Py/Functional/auto_slicing.py
+++ b/Tests/Py/Functional/auto_slicing.py
@@ -24,7 +24,7 @@ def get_sample(particle, sliced):
     layout = ba.ParticleLayout()
     layout.addParticle(particle)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(matVacuum))
     if sliced:
         sample.addLayer(ba.Layer(matSubstrate, 5))
diff --git a/Tests/Py/Functional/known_slicing.py b/Tests/Py/Functional/known_slicing.py
index 3ae501b764993a73954dbe132e76db49a58d55c2..d3d204ff588e9c40c91859a4988d971c873d2863 100644
--- a/Tests/Py/Functional/known_slicing.py
+++ b/Tests/Py/Functional/known_slicing.py
@@ -33,7 +33,7 @@ def get_sample(particle_to_air=None, particle_to_substrate=None):
         layout.addParticle(particle_to_substrate)
         substrate.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate)
     return sample
diff --git a/Tests/Py/Functional/transform_BoxComposition.py b/Tests/Py/Functional/transform_BoxComposition.py
index 2793c0dde46332ecfe7055e97560b74c2bc39905..26af5b13f891661bf7448fe2d64935ecefe56bf0 100644
--- a/Tests/Py/Functional/transform_BoxComposition.py
+++ b/Tests/Py/Functional/transform_BoxComposition.py
@@ -35,7 +35,7 @@ class TransformBoxCompositionTest(unittest.TestCase):
         middle_layer.addLayout(layout)
         substrate = Layer(mSubstrate)
 
-        sample = MultiLayer()
+        sample = Sample()
         sample.addLayer(vacuum_layer)
         sample.addLayer(middle_layer)
         sample.addLayer(substrate)
diff --git a/Tests/Py/Functional/transform_CoreShellBox.py b/Tests/Py/Functional/transform_CoreShellBox.py
index a485f3719871c10dde210f7fe136909a078efd30..7e8d58f9e572ca827ffded985cf007c8c1d5005b 100644
--- a/Tests/Py/Functional/transform_CoreShellBox.py
+++ b/Tests/Py/Functional/transform_CoreShellBox.py
@@ -31,7 +31,7 @@ class TransformCoreShellBoxTest(unittest.TestCase):
         middle_layer.addLayout(layout)
         substrate = Layer(mSubstrate)
 
-        sample = MultiLayer()
+        sample = Sample()
         sample.addLayer(vacuum_layer)
         sample.addLayer(middle_layer)
         sample.addLayer(substrate)
diff --git a/Tests/Py/Functional/transform_box.py b/Tests/Py/Functional/transform_box.py
index 9d5f4e796686e3990c6fea02fdf8b087f58dac07..610d450ccf606286cc58d0550c3bafd23407176e 100644
--- a/Tests/Py/Functional/transform_box.py
+++ b/Tests/Py/Functional/transform_box.py
@@ -27,7 +27,7 @@ class BoxTransformationsTest(unittest.TestCase):
         middle_layer.addLayout(layout)
         substrate = ba.Layer(mSubstrate)
 
-        sample = ba.MultiLayer()
+        sample = ba.Sample()
         sample.addLayer(vacuum_layer)
         sample.addLayer(middle_layer)
         sample.addLayer(substrate)
diff --git a/Tests/Py/Functional/transform_cube.py b/Tests/Py/Functional/transform_cube.py
index 9833f9f259b7bb1818637f7177c2e04855235673..aac3e76272e9c136109e0aea2e80645933b9894e 100644
--- a/Tests/Py/Functional/transform_cube.py
+++ b/Tests/Py/Functional/transform_cube.py
@@ -47,7 +47,7 @@ class RotationsCubeTest(unittest.TestCase):
         else:
             middle_layer.addLayout(layout)
 
-        sample = MultiLayer()
+        sample = Sample()
         sample.addLayer(vacuum_layer)
         sample.addLayer(middle_layer)
         sample.addLayer(substrate)
diff --git a/Tests/SimFactory/MakeSimulations.cpp b/Tests/SimFactory/MakeSimulations.cpp
index f422193728db938cfc2a8961b800561feca6db47..eb26df25512ba8cf8fb8bca80e48b17dfdf5c8a9 100644
--- a/Tests/SimFactory/MakeSimulations.cpp
+++ b/Tests/SimFactory/MakeSimulations.cpp
@@ -70,7 +70,7 @@ const Beam powerBeam(1e7, 1 * angstrom, 0.2 * deg);
 
 //! GISAS simulation with small detector and phi[-2,2], theta[0,2].
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS(const Sample& sample)
 {
     SphericalDetector detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
@@ -79,14 +79,14 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS(const Mult
 
 //! GISAS simulation with small detector and phi[-1,1], theta[0,1].
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS_v2(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISAS_v2(const Sample& sample)
 {
     SphericalDetector detector(25, -2 * deg, 2 * deg, 25, 0, 1 * deg);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
 }
 
 std::unique_ptr<ScatteringSimulation>
-test::makeSimulation::MiniZPolarizedGISAS(const MultiLayer& sample, const std::string& polCase)
+test::makeSimulation::MiniZPolarizedGISAS(const Sample& sample, const std::string& polCase)
 {
     const auto zCase = ZPolarizationCases.at(polCase);
     std::unique_ptr<Beam> beam(stdBeam.clone());
@@ -100,7 +100,7 @@ test::makeSimulation::MiniZPolarizedGISAS(const MultiLayer& sample, const std::s
 
 //! Basic GISAS simulation with the detector phi[0,2], theta[0,2].
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::BasicGISAS(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::BasicGISAS(const Sample& sample)
 {
     SphericalDetector detector(100, 0 * deg, 2 * deg, 100, 0 * deg, 2 * deg);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
@@ -108,7 +108,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::BasicGISAS(const Mul
 
 //! Basic GISAS simulation for spin flip channel.
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::SpinflipGISAS(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::SpinflipGISAS(const Sample& sample)
 {
     std::unique_ptr<Beam> beam(stdBeam.clone());
     beam->setPolarization(zplus);
@@ -120,7 +120,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::SpinflipGISAS(const
 //! GISAS simulation with beam divergence applied.
 
 std::unique_ptr<ScatteringSimulation>
-test::makeSimulation::MiniGISASBeamDivergence(const MultiLayer& sample)
+test::makeSimulation::MiniGISASBeamDivergence(const Sample& sample)
 {
     std::unique_ptr<ScatteringSimulation> result = MiniGISAS(sample);
 
@@ -137,7 +137,7 @@ test::makeSimulation::MiniGISASBeamDivergence(const MultiLayer& sample)
 
 //! GISAS simulation with multiple masks on the detector plane.
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::GISASWithMasks(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::GISASWithMasks(const Sample& sample)
 {
     SphericalDetector detector(50, -1 * deg, 1 * deg, 50, 0, 2 * deg);
 
@@ -167,7 +167,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::GISASWithMasks(const
 //! GISAS simulation with detector resolution.
 
 std::unique_ptr<ScatteringSimulation>
-test::makeSimulation::MiniGISASDetectorResolution(const MultiLayer& sample)
+test::makeSimulation::MiniGISASDetectorResolution(const Sample& sample)
 {
     std::unique_ptr<ScatteringSimulation> result = MiniGISAS(sample);
     ResolutionFunction2DGaussian resfunc(0.0025, 0.0025);
@@ -178,7 +178,7 @@ test::makeSimulation::MiniGISASDetectorResolution(const MultiLayer& sample)
 //! GISAS simulation with small detector and including specular peak.
 
 std::unique_ptr<ScatteringSimulation>
-test::makeSimulation::MiniGISASSpecularPeak(const MultiLayer& sample)
+test::makeSimulation::MiniGISASSpecularPeak(const Sample& sample)
 {
     SphericalDetector detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg);
     std::unique_ptr<ScatteringSimulation> result =
@@ -189,7 +189,7 @@ test::makeSimulation::MiniGISASSpecularPeak(const MultiLayer& sample)
 
 //! GISAS simulation with large detector to test performance.
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS(const Sample& sample)
 {
     SphericalDetector detector(256, -2 * deg, 2 * deg, 256, 0, 2 * deg);
     return std::make_unique<ScatteringSimulation>(stdBeam, sample, detector);
@@ -197,7 +197,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS(const Mult
 
 //! Basic GISAS for polarization studies.
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS00(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS00(const Sample& sample)
 {
     std::unique_ptr<Beam> beam(stdBeam.clone());
     beam->setPolarization(zplus);
@@ -209,7 +209,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::MaxiGISAS00(const Mu
 //! GISAS simulation with Monte-Carlo integration switched ON.
 
 std::unique_ptr<ScatteringSimulation>
-test::makeSimulation::MiniGISASMonteCarlo(const MultiLayer& sample)
+test::makeSimulation::MiniGISASMonteCarlo(const Sample& sample)
 {
     std::unique_ptr<ScatteringSimulation> result = MiniGISAS(sample);
     result->options().setMonteCarloIntegration(true, 100);
@@ -219,7 +219,7 @@ test::makeSimulation::MiniGISASMonteCarlo(const MultiLayer& sample)
 //! GISAS simulation with spherical detector, region of interest and mask.
 
 std::unique_ptr<ScatteringSimulation>
-test::makeSimulation::SphericalDetWithRoi(const MultiLayer& sample)
+test::makeSimulation::SphericalDetWithRoi(const Sample& sample)
 {
     SphericalDetector detector(40, -2 * deg, 2 * deg, 30, -1 * deg, 2 * deg);
     detector.addMask(Rectangle(-0.5 * deg, 0.3 * deg, -0.2 * deg, 0.6 * deg));
@@ -230,7 +230,7 @@ test::makeSimulation::SphericalDetWithRoi(const MultiLayer& sample)
 
 //! GISAS simulation with rectangular detector, region of interest and mask.
 
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::RectDetWithRoi(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::RectDetWithRoi(const Sample& sample)
 {
     SphericalDetector detector(40, -2 * deg, 2 * deg, 30, -1 * deg, 2 * deg);
     detector.addMask(Rectangle(0.35 * deg, -1.15 * deg, 0.75 * deg, 1.95 * deg));
@@ -241,7 +241,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::RectDetWithRoi(const
 //! GISAS simulation with an extra long wavelength
 
 std::unique_ptr<ScatteringSimulation>
-test::makeSimulation::ExtraLongWavelengthGISAS(const MultiLayer& sample)
+test::makeSimulation::ExtraLongWavelengthGISAS(const Sample& sample)
 {
     std::unique_ptr<Beam> beam(Beam(1e8, 12 * Units::nm, 0.2 * deg).clone());
     SphericalDetector detector(100, -2 * deg, 2 * deg, 100, 0, 2 * deg);
@@ -252,7 +252,7 @@ test::makeSimulation::ExtraLongWavelengthGISAS(const MultiLayer& sample)
 
 //! ISimulation with fitting.
 //! Beam intensity set to provide reasonably large values in detector channels.
-std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISASFit(const MultiLayer& sample)
+std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISASFit(const Sample& sample)
 {
     SphericalDetector detector(25, -2 * deg, 2 * deg, 25, 0, 2 * deg);
     return std::make_unique<ScatteringSimulation>(powerBeam, sample, detector);
@@ -262,7 +262,7 @@ std::unique_ptr<ScatteringSimulation> test::makeSimulation::MiniGISASFit(const M
 //  off-specular simulations
 //  ************************************************************************************************
 
-std::unique_ptr<OffspecSimulation> test::makeSimulation::MiniOffspec(const MultiLayer& sample)
+std::unique_ptr<OffspecSimulation> test::makeSimulation::MiniOffspec(const Sample& sample)
 {
     OffspecDetector detector(9, -0.1 * deg, 0.1 * deg, 25, 0.1 * deg, 5.1 * deg);
     AlphaScan scan(20, 0.2 * deg, 4 * deg);
@@ -296,7 +296,7 @@ BeamScan* test::makeSimulation::BasicSpecularScan(bool vsQ)
     return result;
 }
 
-std::unique_ptr<SpecularSimulation> test::makeSimulation::BasicSpecular(const MultiLayer& sample,
+std::unique_ptr<SpecularSimulation> test::makeSimulation::BasicSpecular(const Sample& sample,
                                                                         bool vsQ, double intensity)
 {
     std::unique_ptr<BeamScan> scan(BasicSpecularScan(vsQ));
@@ -308,7 +308,7 @@ std::unique_ptr<SpecularSimulation> test::makeSimulation::BasicSpecular(const Mu
 }
 
 std::unique_ptr<SpecularSimulation>
-test::makeSimulation::BasicYPolarizedSpecular(const MultiLayer& sample, const std::string& polCase,
+test::makeSimulation::BasicYPolarizedSpecular(const Sample& sample, const std::string& polCase,
                                               bool vsQ)
 {
     const auto yCase = YPolarizationCases.at(polCase);
@@ -319,7 +319,7 @@ test::makeSimulation::BasicYPolarizedSpecular(const MultiLayer& sample, const st
 }
 
 std::unique_ptr<SpecularSimulation>
-test::makeSimulation::SpecularWithGaussianBeam(const MultiLayer& sample)
+test::makeSimulation::SpecularWithGaussianBeam(const Sample& sample)
 {
     const double wavelength = 1.54 * angstrom;
     const int n = 2000;
@@ -333,7 +333,7 @@ test::makeSimulation::SpecularWithGaussianBeam(const MultiLayer& sample)
 }
 
 std::unique_ptr<SpecularSimulation>
-test::makeSimulation::SpecularWithSquareBeam(const MultiLayer& sample)
+test::makeSimulation::SpecularWithSquareBeam(const Sample& sample)
 {
     const double wavelength = 1.54 * angstrom;
     const int n = 2000;
@@ -347,7 +347,7 @@ test::makeSimulation::SpecularWithSquareBeam(const MultiLayer& sample)
 }
 
 std::unique_ptr<SpecularSimulation>
-test::makeSimulation::SpecularDivergentBeam(const MultiLayer& sample)
+test::makeSimulation::SpecularDivergentBeam(const Sample& sample)
 {
     const double wavelength = 1.54 * angstrom;
     const int n = 20;
@@ -370,7 +370,7 @@ test::makeSimulation::SpecularDivergentBeam(const MultiLayer& sample)
 }
 
 std::unique_ptr<SpecularSimulation>
-test::makeSimulation::TOFRWithRelativeResolution(const MultiLayer& sample)
+test::makeSimulation::TOFRWithRelativeResolution(const Sample& sample)
 {
     Scale qs = EquiScan("alpha_i (rad)", 500, 0.0, 1.0);
     QzScan scan(qs);
@@ -382,7 +382,7 @@ test::makeSimulation::TOFRWithRelativeResolution(const MultiLayer& sample)
 }
 
 std::unique_ptr<SpecularSimulation>
-test::makeSimulation::TOFRWithPointwiseResolution(const MultiLayer& sample)
+test::makeSimulation::TOFRWithPointwiseResolution(const Sample& sample)
 {
     Scale qs = EquiScan("alpha_i (rad)", 500, 0.0, 1.0);
     QzScan scan(qs);
@@ -405,7 +405,7 @@ test::makeSimulation::TOFRWithPointwiseResolution(const MultiLayer& sample)
 
 
 std::unique_ptr<DepthprobeSimulation>
-test::makeSimulation::BasicDepthprobeShiftedZ(const MultiLayer& sample, double shift)
+test::makeSimulation::BasicDepthprobeShiftedZ(const Sample& sample, double shift)
 {
     AlphaScan scan(20, 0.025 * deg, 0.975 * deg);
     scan.setWavelength(1.);
@@ -415,8 +415,7 @@ test::makeSimulation::BasicDepthprobeShiftedZ(const MultiLayer& sample, double s
     return std::make_unique<DepthprobeSimulation>(scan, sample, zaxis);
 }
 
-std::unique_ptr<DepthprobeSimulation>
-test::makeSimulation::BasicDepthprobe(const MultiLayer& sample)
+std::unique_ptr<DepthprobeSimulation> test::makeSimulation::BasicDepthprobe(const Sample& sample)
 {
     return test::makeSimulation::BasicDepthprobeShiftedZ(sample, 0);
 }
diff --git a/Tests/SimFactory/MakeSimulations.h b/Tests/SimFactory/MakeSimulations.h
index fc5093f3e043b17c2cc7ee624b22a880308ff116..ab1cbbbc1f62601d5c96a9bd162bbc907db7e5a3 100644
--- a/Tests/SimFactory/MakeSimulations.h
+++ b/Tests/SimFactory/MakeSimulations.h
@@ -23,8 +23,8 @@
 
 class BeamScan;
 class DepthprobeSimulation;
-class MultiLayer;
 class OffspecSimulation;
+class Sample;
 class ScatteringSimulation;
 class SpecularSimulation;
 
@@ -32,40 +32,39 @@ class SpecularSimulation;
 
 namespace test::makeSimulation {
 
-std::unique_ptr<ScatteringSimulation> MiniGISAS(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MiniGISAS_v2(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MiniZPolarizedGISAS(const MultiLayer& sample,
+std::unique_ptr<ScatteringSimulation> MiniGISAS(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MiniGISAS_v2(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MiniZPolarizedGISAS(const Sample& sample,
                                                           const std::string& polCase);
-std::unique_ptr<ScatteringSimulation> BasicGISAS(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> SpinflipGISAS(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MiniGISASBeamDivergence(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MiniGISASDetectorResolution(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MiniGISASSpecularPeak(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> GISASWithMasks(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MaxiGISAS(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MaxiGISAS00(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MiniGISASMonteCarlo(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> SphericalDetWithRoi(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> RectDetWithRoi(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> MiniGISASFit(const MultiLayer& sample);
-std::unique_ptr<ScatteringSimulation> ExtraLongWavelengthGISAS(const MultiLayer& sample);
+std::unique_ptr<ScatteringSimulation> BasicGISAS(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> SpinflipGISAS(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MiniGISASBeamDivergence(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MiniGISASDetectorResolution(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MiniGISASSpecularPeak(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> GISASWithMasks(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MaxiGISAS(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MaxiGISAS00(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MiniGISASMonteCarlo(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> SphericalDetWithRoi(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> RectDetWithRoi(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> MiniGISASFit(const Sample& sample);
+std::unique_ptr<ScatteringSimulation> ExtraLongWavelengthGISAS(const Sample& sample);
 
-std::unique_ptr<OffspecSimulation> MiniOffspec(const MultiLayer& sample);
+std::unique_ptr<OffspecSimulation> MiniOffspec(const Sample& sample);
 
 BeamScan* BasicSpecularScan(bool vsQ);
-std::unique_ptr<SpecularSimulation> BasicSpecular(const MultiLayer& sample, bool vsQ,
+std::unique_ptr<SpecularSimulation> BasicSpecular(const Sample& sample, bool vsQ,
                                                   double intensity = 1.);
-std::unique_ptr<SpecularSimulation> BasicYPolarizedSpecular(const MultiLayer& sample,
+std::unique_ptr<SpecularSimulation> BasicYPolarizedSpecular(const Sample& sample,
                                                             const std::string& polCase, bool vsQ);
-std::unique_ptr<SpecularSimulation> SpecularWithGaussianBeam(const MultiLayer& sample);
-std::unique_ptr<SpecularSimulation> SpecularWithSquareBeam(const MultiLayer& sample);
-std::unique_ptr<SpecularSimulation> SpecularDivergentBeam(const MultiLayer& sample);
-std::unique_ptr<SpecularSimulation> TOFRWithRelativeResolution(const MultiLayer& sample);
-std::unique_ptr<SpecularSimulation> TOFRWithPointwiseResolution(const MultiLayer& sample);
+std::unique_ptr<SpecularSimulation> SpecularWithGaussianBeam(const Sample& sample);
+std::unique_ptr<SpecularSimulation> SpecularWithSquareBeam(const Sample& sample);
+std::unique_ptr<SpecularSimulation> SpecularDivergentBeam(const Sample& sample);
+std::unique_ptr<SpecularSimulation> TOFRWithRelativeResolution(const Sample& sample);
+std::unique_ptr<SpecularSimulation> TOFRWithPointwiseResolution(const Sample& sample);
 
-std::unique_ptr<DepthprobeSimulation> BasicDepthprobe(const MultiLayer& sample);
-std::unique_ptr<DepthprobeSimulation> BasicDepthprobeShiftedZ(const MultiLayer& sample,
-                                                              double shift);
+std::unique_ptr<DepthprobeSimulation> BasicDepthprobe(const Sample& sample);
+std::unique_ptr<DepthprobeSimulation> BasicDepthprobeShiftedZ(const Sample& sample, double shift);
 
 } // namespace test::makeSimulation
 
diff --git a/Tests/Suite/Common/TestSuite.h b/Tests/Suite/Common/TestSuite.h
index 0e31f1077c8e4ba532fbd7544247b8495c6d04de..8ca83d0e71145696f5d22b20b6346ae5054547bd 100644
--- a/Tests/Suite/Common/TestSuite.h
+++ b/Tests/Suite/Common/TestSuite.h
@@ -23,7 +23,7 @@
 #include "Resample/Option/SimulationOptions.h"
 #include "Sample/ComponentBuilder/FormfactorComponent.h"
 #include "Sample/ComponentBuilder/Profile2DComponents.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/StandardSample/ExemplarySamples.h"
 #include "Sim/Background/ConstantBackground.h"
 #include "Sim/Simulation/includeSimulations.h"
@@ -57,8 +57,7 @@ TEST(TESTNAME, Formfactors)
     for (const std::string& ffname : FormfactorComponent().keys()) {
         const IFormfactor* ff = FormfactorComponent().getItem(ffname)->clone();
         ASSERT(ff);
-        std::unique_ptr<const MultiLayer> sample(
-            ExemplarySamples::createParticleInVacuumWithFF(ff));
+        std::unique_ptr<const Sample> sample(ExemplarySamples::createParticleInVacuumWithFF(ff));
         ASSERT(sample);
         auto sim = test::makeSimulation::MiniGISAS(*sample);
         EXPECT_TRUE(runTest("Formfactors_" + ff->className(), *sim, eps));
@@ -71,7 +70,7 @@ TEST(TESTNAME, FormfactorsWithAbsorption)
     for (const std::string& ffname : FormfactorComponent().keys()) {
         const IFormfactor* ff = FormfactorComponent().getItem(ffname)->clone();
         ASSERT(ff);
-        std::unique_ptr<const MultiLayer> sample(
+        std::unique_ptr<const Sample> sample(
             ExemplarySamples::createLayersWithAbsorptionWithFF(ff));
         ASSERT(sample);
         auto sim = test::makeSimulation::MiniGISAS_v2(*sample);
@@ -83,7 +82,7 @@ TEST(TESTNAME, GISASAbsorptiveSLDLayers)
 {
     const double eps =
         eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py); // ARCH3 only for i386
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createLayersWithAbsorptionBySLD());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createLayersWithAbsorptionBySLD());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("GISASAbsorptiveSLDLayers", *sim, eps));
 }
@@ -91,7 +90,7 @@ TEST(TESTNAME, GISASAbsorptiveSLDLayers)
 TEST(TESTNAME, CylindersAndPrisms)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCylindersAndPrisms());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCylindersAndPrisms());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("CylindersAndPrisms", *sim, eps));
 }
@@ -99,7 +98,7 @@ TEST(TESTNAME, CylindersAndPrisms)
 TEST(TESTNAME, RadialParacrystal)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createRadialParacrystal());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createRadialParacrystal());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("RadialParacrystal", *sim, eps));
 }
@@ -107,7 +106,7 @@ TEST(TESTNAME, RadialParacrystal)
 TEST(TESTNAME, HardDisk)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createHardDisk());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createHardDisk());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("HardDisk", *sim, eps));
 }
@@ -119,7 +118,7 @@ TEST(TESTNAME, Basic2DParacrystal)
         const IProfile2D* pdf2 = Profile2DComponents().getItem(pdfname)->clone();
         ASSERT(pdf2);
         std::cout << pdf2->pythonConstructor() << std::endl;
-        std::unique_ptr<const MultiLayer> sample(
+        std::unique_ptr<const Sample> sample(
             ExemplarySamples::createBasic2DParacrystalWithFTDis(pdf2));
         ASSERT(sample);
         auto sim = test::makeSimulation::MiniGISAS(*sample);
@@ -130,7 +129,7 @@ TEST(TESTNAME, Basic2DParacrystal)
 TEST(TESTNAME, HexParacrystal)
 {
     const double eps = eps_direct_vs_python(eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createHexParacrystal());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createHexParacrystal());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("HexParacrystal", *sim, eps));
 }
@@ -138,7 +137,7 @@ TEST(TESTNAME, HexParacrystal)
 TEST(TESTNAME, Lattice1D)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createLattice1D());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createLattice1D());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("Lattice1D", *sim, eps));
 }
@@ -147,7 +146,7 @@ TEST(TESTNAME, RectParacrystal)
 {
     // TODO: investigate numeric integration, which has become problematic under Windows
     //       after moving code from Core/Tools to Base/Utils
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createRectParacrystal());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createRectParacrystal());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("RectParacrystal", *sim, eps_dir));
 }
@@ -155,7 +154,7 @@ TEST(TESTNAME, RectParacrystal)
 TEST(TESTNAME, CoreShellParticle)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCoreShellParticle());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCoreShellParticle());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("CoreShellParticle", *sim, eps));
 }
@@ -163,7 +162,7 @@ TEST(TESTNAME, CoreShellParticle)
 TEST(TESTNAME, CoreShellBoxRotateZandY)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCoreShellBoxRotateZandY());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCoreShellBoxRotateZandY());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("CoreShellBoxRotateZandY", *sim, eps));
 }
@@ -171,7 +170,7 @@ TEST(TESTNAME, CoreShellBoxRotateZandY)
 TEST(TESTNAME, MultiLayerWithRoughness)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? 2e-11 : eps_dir, eps_py); // ARCH3 only for i386
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMultiLayerWithRoughness());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMultiLayerWithRoughness());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("MultiLayerWithRoughness", *sim, eps));
 }
@@ -179,7 +178,7 @@ TEST(TESTNAME, MultiLayerWithRoughness)
 TEST(TESTNAME, SquareLattice2D)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSquareLattice2D());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSquareLattice2D());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("SquareLattice2D", *sim, eps));
 }
@@ -187,7 +186,7 @@ TEST(TESTNAME, SquareLattice2D)
 TEST(TESTNAME, CenteredSquareLattice2D)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCenteredSquareLattice2D());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCenteredSquareLattice2D());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("CenteredSquareLattice2D", *sim, eps));
 }
@@ -195,7 +194,7 @@ TEST(TESTNAME, CenteredSquareLattice2D)
 TEST(TESTNAME, RotatedSquareLattice2D)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createRotatedSquareLattice2D());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createRotatedSquareLattice2D());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("RotatedSquareLattice2D", *sim, eps));
 }
@@ -203,7 +202,7 @@ TEST(TESTNAME, RotatedSquareLattice2D)
 TEST(TESTNAME, FiniteSquareLattice2D)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createFiniteSquareLattice2D());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createFiniteSquareLattice2D());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("FiniteSquareLattice2D", *sim, eps));
 }
@@ -211,7 +210,7 @@ TEST(TESTNAME, FiniteSquareLattice2D)
 TEST(TESTNAME, RotatedPyramids)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createRotatedPyramids());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createRotatedPyramids());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("RotatedPyramids", *sim, eps));
 }
@@ -219,7 +218,7 @@ TEST(TESTNAME, RotatedPyramids)
 TEST(TESTNAME, ThickAbsorptiveSampleWithRoughness)
 {
     const double eps = eps_direct_vs_python(eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createThickAbsorptiveSample());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createThickAbsorptiveSample());
     auto sim = test::makeSimulation::ExtraLongWavelengthGISAS(*sample);
     EXPECT_TRUE(runTest("ThickAbsorptiveSampleWithRoughness", *sim, eps));
 }
@@ -227,7 +226,7 @@ TEST(TESTNAME, ThickAbsorptiveSampleWithRoughness)
 TEST(TESTNAME, Compound)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCompound());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCompound());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("Compound", *sim, eps));
 }
@@ -235,7 +234,7 @@ TEST(TESTNAME, Compound)
 TEST(TESTNAME, CompoundPlus)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCompoundPlus());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCompoundPlus());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("CompoundPlus", *sim, eps));
 }
@@ -243,7 +242,7 @@ TEST(TESTNAME, CompoundPlus)
 TEST(TESTNAME, BoxCompositionRotateX)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createBoxCompositionRotateX());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createBoxCompositionRotateX());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("BoxCompositionRotateX", *sim, eps));
 }
@@ -251,7 +250,7 @@ TEST(TESTNAME, BoxCompositionRotateX)
 TEST(TESTNAME, BoxCompositionRotateY)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createBoxCompositionRotateY());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createBoxCompositionRotateY());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("BoxCompositionRotateY", *sim, eps));
 }
@@ -259,7 +258,7 @@ TEST(TESTNAME, BoxCompositionRotateY)
 TEST(TESTNAME, BoxCompositionRotateZ)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : 6e-13, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createBoxCompositionRotateZ());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createBoxCompositionRotateZ());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("BoxCompositionRotateZ", *sim, eps));
 }
@@ -267,7 +266,7 @@ TEST(TESTNAME, BoxCompositionRotateZ)
 TEST(TESTNAME, BoxCompositionRotateZandY)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createBoxCompositionRotateZandY());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createBoxCompositionRotateZandY());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("BoxCompositionRotateZandY", *sim, eps));
 }
@@ -275,7 +274,7 @@ TEST(TESTNAME, BoxCompositionRotateZandY)
 TEST(TESTNAME, BoxStackComposition)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createBoxStackComposition());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createBoxStackComposition());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("BoxStackComposition", *sim, eps));
 }
@@ -283,7 +282,7 @@ TEST(TESTNAME, BoxStackComposition)
 TEST(TESTNAME, MultipleLayout)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMultipleLayout());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMultipleLayout());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("MultipleLayout", *sim, eps));
 }
@@ -291,7 +290,7 @@ TEST(TESTNAME, MultipleLayout)
 TEST(TESTNAME, ApproximationDA)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSizeDistributionDAModel());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSizeDistributionDAModel());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("ApproximationDA", *sim, eps));
 }
@@ -299,7 +298,7 @@ TEST(TESTNAME, ApproximationDA)
 TEST(TESTNAME, ApproximationLMA)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSizeDistributionLMAModel());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSizeDistributionLMAModel());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("ApproximationLMA", *sim, eps));
 }
@@ -307,7 +306,7 @@ TEST(TESTNAME, ApproximationLMA)
 TEST(TESTNAME, ApproximationSSCA)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSizeDistributionSSCAModel());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSizeDistributionSSCAModel());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("ApproximationSSCA", *sim, eps));
 }
@@ -315,7 +314,7 @@ TEST(TESTNAME, ApproximationSSCA)
 TEST(TESTNAME, CosineRipple)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCosineRipple());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCosineRipple());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("CosineRipple", *sim, eps));
 }
@@ -323,7 +322,7 @@ TEST(TESTNAME, CosineRipple)
 TEST(TESTNAME, TriangularRipple)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createTriangularRipple());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createTriangularRipple());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("TriangularRipple", *sim, eps));
 }
@@ -331,7 +330,7 @@ TEST(TESTNAME, TriangularRipple)
 TEST(TESTNAME, AsymRipple)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createAsymRipple());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createAsymRipple());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("AsymRipple", *sim, eps));
 }
@@ -339,7 +338,7 @@ TEST(TESTNAME, AsymRipple)
 TEST(TESTNAME, Mesocrystal)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMesocrystal());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMesocrystal());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("Mesocrystal", *sim, eps));
 }
@@ -347,7 +346,7 @@ TEST(TESTNAME, Mesocrystal)
 TEST(TESTNAME, MesocrystalPlus)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMesocrystalPlus());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMesocrystalPlus());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("MesocrystalPlus", *sim, eps));
 }
@@ -355,7 +354,7 @@ TEST(TESTNAME, MesocrystalPlus)
 TEST(TESTNAME, CustomMorphology)
 {
     const double eps = eps_direct_vs_python(eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCustomMorphology());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCustomMorphology());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("CustomMorphology", *sim, eps));
 }
@@ -363,7 +362,7 @@ TEST(TESTNAME, CustomMorphology)
 TEST(TESTNAME, TransformBox)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createTransformBox());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createTransformBox());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("TransformBox", *sim, eps));
 }
@@ -371,7 +370,7 @@ TEST(TESTNAME, TransformBox)
 TEST(TESTNAME, MagneticParticleZeroField)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMagneticParticleZeroField());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMagneticParticleZeroField());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("MagneticParticleZeroField", *sim, eps));
 }
@@ -379,7 +378,7 @@ TEST(TESTNAME, MagneticParticleZeroField)
 TEST(TESTNAME, SlicedComposition)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSlicedComposition());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSlicedComposition());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("SlicedComposition", *sim, eps));
 }
@@ -387,7 +386,7 @@ TEST(TESTNAME, SlicedComposition)
 TEST(TESTNAME, MagneticSubstrateZeroField)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? 2e-11 : eps_dir, eps_py); // ARCH3 only for i386
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMagneticSubstrateZeroField());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMagneticSubstrateZeroField());
     auto sim = test::makeSimulation::MiniZPolarizedGISAS(*sample, "PP");
     EXPECT_TRUE(runTest("MagneticSubstrateZeroField", *sim, eps));
 }
@@ -395,7 +394,7 @@ TEST(TESTNAME, MagneticSubstrateZeroField)
 TEST(TESTNAME, MagneticRotation)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? 6e-11 : eps_dir, eps_py); // ARCH3 only for i386
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMagneticRotation());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMagneticRotation());
     auto sim = test::makeSimulation::MiniZPolarizedGISAS(*sample, "PM");
     EXPECT_TRUE(runTest("MagneticRotationZPM", *sim, eps));
 }
@@ -403,7 +402,7 @@ TEST(TESTNAME, MagneticRotation)
 TEST(TESTNAME, MagneticRotationUnpol)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? 2e-11 : eps_dir, eps_py); // ARCH3 only for i386
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMagneticRotation());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMagneticRotation());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("MagneticRotationUnpol", *sim, eps));
 }
@@ -411,7 +410,7 @@ TEST(TESTNAME, MagneticRotationUnpol)
 TEST(TESTNAME, MagneticSpheres)
 {
     const double eps = eps_direct_vs_python(eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMagneticSpheres());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createMagneticSpheres());
     auto sim = test::makeSimulation::MiniZPolarizedGISAS(*sample, "PM");
     EXPECT_TRUE(runTest("MagneticSpheres", *sim, eps));
 }
@@ -420,7 +419,7 @@ TEST(TESTNAME, MagneticCylinders)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? 5e-12 : eps_dir, eps_py); // ARCH3 only for i386
     for (const std::string polCase : {"PP", "MP", "PM", "MM"}) {
-        std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMagneticCylinders());
+        std::unique_ptr<const Sample> sample(ExemplarySamples::createMagneticCylinders());
         auto sim = test::makeSimulation::MiniZPolarizedGISAS(*sample, polCase);
         EXPECT_TRUE(runTest("MagneticCylinders" + polCase, *sim, eps));
     }
@@ -430,7 +429,7 @@ TEST(TESTNAME, MagneticSpheresInMagLayer)
 {
     const double eps = eps_direct_vs_python(eps_dir, eps_py);
     for (const std::string polCase : {"PP", "MP"}) {
-        std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createMagneticLayer());
+        std::unique_ptr<const Sample> sample(ExemplarySamples::createMagneticLayer());
         auto sim = test::makeSimulation::MiniZPolarizedGISAS(*sample, polCase);
         EXPECT_TRUE(runTest("MagneticSpheresInMagLayer" + polCase, *sim, eps));
     }
@@ -439,7 +438,7 @@ TEST(TESTNAME, MagneticSpheresInMagLayer)
 TEST(TESTNAME, BeamDivergence)
 {
     const double eps = eps_direct_vs_python(eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCylindersInBA());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCylindersInBA());
     auto sim = test::makeSimulation::MiniGISASBeamDivergence(*sample);
     EXPECT_TRUE(runTest("BeamDivergence", *sim, eps));
 }
@@ -447,7 +446,7 @@ TEST(TESTNAME, BeamDivergence)
 TEST(TESTNAME, DetectorResolution)
 {
     const double eps = eps_direct_vs_python(eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCylindersInBA());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCylindersInBA());
     auto sim = test::makeSimulation::MiniGISASDetectorResolution(*sample);
     EXPECT_TRUE(runTest("DetectorResolution", *sim, eps));
 }
@@ -455,7 +454,7 @@ TEST(TESTNAME, DetectorResolution)
 TEST(TESTNAME, BoxesWithSpecular)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createBoxesSquareLattice2D());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createBoxesSquareLattice2D());
     auto sim = test::makeSimulation::MiniGISASSpecularPeak(*sample);
     EXPECT_TRUE(runTest("BoxesWithSpecular", *sim, eps));
 }
@@ -519,7 +518,7 @@ TEST(TESTNAME, SpecularDivergentBeam)
 TEST(TESTNAME, SimulationWithMasks)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCylindersAndPrisms());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCylindersAndPrisms());
     auto sim = test::makeSimulation::GISASWithMasks(*sample);
     EXPECT_TRUE(runTest("SimulationWithMasks", *sim, eps));
 }
@@ -527,7 +526,7 @@ TEST(TESTNAME, SimulationWithMasks)
 TEST(TESTNAME, RectDetWithRoi)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCylindersAndPrisms());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCylindersAndPrisms());
     auto sim = test::makeSimulation::RectDetWithRoi(*sample);
     EXPECT_TRUE(runTest("RectDetWithRoi", *sim, eps));
 }
@@ -549,7 +548,7 @@ TEST(TESTNAME, RelativeResolutionTOF)
 TEST(TESTNAME, SphericalDetWithRoi)
 {
     const double eps = eps_direct_vs_python(ARCH3 ? eps_ARCH3 : eps_dir, eps_py);
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createCylindersAndPrisms());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createCylindersAndPrisms());
     auto sim = test::makeSimulation::SphericalDetWithRoi(*sample);
     EXPECT_TRUE(runTest("SphericalDetWithRoi", *sim, eps));
 }
@@ -603,7 +602,7 @@ TEST(TESTNAME, NCRoughnessInSpecular)
 
 TEST(TESTNAME, SuperLattice)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSuperLattice());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSuperLattice());
     auto sim = test::makeSimulation::MiniGISAS(*sample);
     EXPECT_TRUE(runTest("SuperLattice", *sim, eps_py));
 }
@@ -654,7 +653,7 @@ TEST(TESTNAME, TOFResolutionComparison)
 
 TEST(TESTNAME, BasicSpecular)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSimpleMagneticLayer());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSimpleMagneticLayer());
     for (const std::string polCase : {"PP", "MM"}) {
         auto sim = test::makeSimulation::BasicYPolarizedSpecular(*sample, polCase, false);
         EXPECT_TRUE(runTest("BasicSpecular" + polCase, *sim, eps_py));
@@ -663,7 +662,7 @@ TEST(TESTNAME, BasicSpecular)
 
 TEST(TESTNAME, PolarizedQAngleReflectivity)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createSimpleMagneticLayer());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createSimpleMagneticLayer());
     for (const std::string polKey : {"PP", "MM"}) {
         auto sim = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, true);
         EXPECT_TRUE(runTest("PolarizedQAngleReflectivity" + polKey + "_Q", *sim, eps_py));
@@ -673,7 +672,7 @@ TEST(TESTNAME, PolarizedQAngleReflectivity)
 TEST(TESTNAME, MagneticRotationReflectivity)
 {
     for (const auto roughnessKey : {"Flat", "Tanh", "Erf"}) {
-        std::unique_ptr<const MultiLayer> sample(
+        std::unique_ptr<const Sample> sample(
             ExemplarySamples::createSimpleMagneticRotationWithRoughness(roughnessKey));
         for (const std::string polKey : {"PP", "PM", "MP", "MM"}) {
             auto sim = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, false);
@@ -685,7 +684,7 @@ TEST(TESTNAME, MagneticRotationReflectivity)
 
 TEST(TESTNAME, PolarizedFeNiBilayer)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createFeNiBilayer());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createFeNiBilayer());
     for (const std::string polKey : {"PP", "MM"}) {
         auto sim1 = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, false);
         EXPECT_TRUE(runTest("PolarizedFeNiBilayer" + polKey, *sim1, 1e-7));
@@ -696,7 +695,7 @@ TEST(TESTNAME, PolarizedFeNiBilayer)
 
 TEST(TESTNAME, PolarizedFeNiBilayerTanh)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createFeNiBilayerTanh());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createFeNiBilayerTanh());
     for (const std::string polKey : {"PP", "MM"}) {
         auto sim1 = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, false);
         EXPECT_TRUE(runTest("PolarizedFeNiBilayerTanh" + polKey, *sim1, 1e-7));
@@ -707,7 +706,7 @@ TEST(TESTNAME, PolarizedFeNiBilayerTanh)
 
 TEST(TESTNAME, PolarizedFeNiBilayerNC)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createFeNiBilayerNC());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createFeNiBilayerNC());
     for (const std::string polKey : {"PP", "MM"}) {
         auto sim1 = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, false);
         EXPECT_TRUE(runTest("PolarizedFeNiBilayerNC" + polKey, *sim1, 1e-7));
@@ -718,7 +717,7 @@ TEST(TESTNAME, PolarizedFeNiBilayerNC)
 
 TEST(TESTNAME, PolarizedFeNiBilayerSpinFlip)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createFeNiBilayerSpinFlip());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createFeNiBilayerSpinFlip());
     for (const std::string polKey : {"PP", "PM", "MP", "MM"}) {
         auto sim1 = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, false);
         EXPECT_TRUE(runTest("PolarizedFeNiBilayerSpinFlip" + polKey, *sim1, 1e-7));
@@ -729,7 +728,7 @@ TEST(TESTNAME, PolarizedFeNiBilayerSpinFlip)
 
 TEST(TESTNAME, PolarizedFeNiBilayerSpinFlipTanh)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createFeNiBilayerSpinFlipTanh());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createFeNiBilayerSpinFlipTanh());
     for (const std::string polKey : {"PP", "PM", "MP", "MM"}) {
         auto sim1 = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, false);
         EXPECT_TRUE(runTest("PolarizedFeNiBilayerSpinFlipTanh" + polKey, *sim1, 1e-7));
@@ -740,7 +739,7 @@ TEST(TESTNAME, PolarizedFeNiBilayerSpinFlipTanh)
 
 TEST(TESTNAME, PolarizedFeNiBilayerSpinFlipNC)
 {
-    std::unique_ptr<const MultiLayer> sample(ExemplarySamples::createFeNiBilayerSpinFlipNC());
+    std::unique_ptr<const Sample> sample(ExemplarySamples::createFeNiBilayerSpinFlipNC());
     for (const std::string polKey : {"PP", "PM", "MP", "MM"}) {
         auto sim1 = test::makeSimulation::BasicYPolarizedSpecular(*sample, polKey, false);
         EXPECT_TRUE(runTest("PolarizedFeNiBilayerSpinFlipNC" + polKey, *sim1, 1e-7));
diff --git a/Tests/Unit/PyBinding/EmbeddedTest.cpp b/Tests/Unit/PyBinding/EmbeddedTest.cpp
index 854339f9f84b7e8548a0e1529b75c30937ddb449..10d4f37a87a88b5ef1af58cab28c04b7a874af7b 100644
--- a/Tests/Unit/PyBinding/EmbeddedTest.cpp
+++ b/Tests/Unit/PyBinding/EmbeddedTest.cpp
@@ -14,7 +14,7 @@
 #include "Base/Const/Units.h"
 #include "PyCore/Embed/PyInterpreter.h"
 #include "PyCore/Embed/PyObjectPtr.h"
-#include "PyCore/Sample/ImportMultiLayer.h"
+#include "PyCore/Sample/ImportSample.h"
 #include "Tests/GTestWrapper/google_test.h"
 #include <string>
 #include <vector>
diff --git a/Tests/Unit/Resample/KzComputationTest.cpp b/Tests/Unit/Resample/KzComputationTest.cpp
index 6d29c20aeeed297634278ab9847edad5dc3ef7b9..f0d6f8787fc0ad783b04c3059177ba9ef128bc97 100644
--- a/Tests/Unit/Resample/KzComputationTest.cpp
+++ b/Tests/Unit/Resample/KzComputationTest.cpp
@@ -5,7 +5,7 @@
 #include "Resample/Processed/ReSample.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/StandardSample/PlainMultiLayerBySLDBuilder.h"
 #include "Tests/GTestWrapper/google_test.h"
 
@@ -17,7 +17,7 @@ TEST(KzComputation, initial)
     const complex_t sld_3(1.0241e-06, 2.0448e-8);
     const complex_t sld_4(0.0, 2.0448e-6);
 
-    MultiLayer mLayer;
+    Sample mLayer;
 
     Layer layer0(MaterialBySLD("m0", sld_0.real(), sld_0.imag()));
     Layer layer1(MaterialBySLD("m1", sld_1.real(), sld_1.imag()), 10);
@@ -57,7 +57,7 @@ TEST(KzComputation, negativeKz)
     const complex_t sld_3(1.0241e-06, 2.0448e-8);
     const complex_t sld_4(0.0, 2.0448e-6);
 
-    MultiLayer mLayer;
+    Sample mLayer;
 
     Layer layer0(MaterialBySLD("m0", sld_0.real(), sld_0.imag()));
     Layer layer1(MaterialBySLD("m1", sld_1.real(), sld_1.imag()), 10);
@@ -97,7 +97,7 @@ TEST(KzComputation, absorptiveAmbience)
     const complex_t sld_3(1.0241e-06, 2.0448e-8);
     const complex_t sld_4(0.0, 2.0448e-6);
 
-    MultiLayer mLayer;
+    Sample mLayer;
 
     Layer layer0(MaterialBySLD("m0", sld_0.real(), sld_0.imag()));
     Layer layer1(MaterialBySLD("m1", sld_1.real(), sld_1.imag()), 10);
@@ -127,7 +127,7 @@ TEST(KzComputation, absorptiveAmbience)
 
 TEST(KzComputation, TiNiSampleWithRoughness)
 {
-    std::unique_ptr<MultiLayer> sample(ExemplarySamples::createPlainMultiLayerBySLD());
+    std::unique_ptr<Sample> sample(ExemplarySamples::createPlainMultiLayerBySLD());
 
     R3 k = vecOfLambdaAlphaPhi(1.0, 0.0001 * Units::deg);
 
diff --git a/Tests/Unit/Resample/MultilayerAveragingTest.cpp b/Tests/Unit/Resample/MultilayerAveragingTest.cpp
index 7276f193125e35858a8881a7782b919100345891..b89dfdee4f45d31b4a72d95adef5250d13ebfa50 100644
--- a/Tests/Unit/Resample/MultilayerAveragingTest.cpp
+++ b/Tests/Unit/Resample/MultilayerAveragingTest.cpp
@@ -5,7 +5,7 @@
 #include "Sample/HardParticle/Cylinder.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sample/Particle/Particle.h"
 #include "Tests/GTestWrapper/google_test.h"
 
@@ -36,7 +36,7 @@ TEST(MultilayerAveraging, AverageMultilayer)
 
     layer_1.addLayout(layout_1);
 
-    MultiLayer m_layer;
+    Sample m_layer;
     m_layer.addLayer(layer_1);
     m_layer.addLayer(layer_2);
 
@@ -48,7 +48,7 @@ TEST(MultilayerAveraging, AverageMultilayer)
     layer_21.addLayout(layout_1);
     layer_21.addLayout(layout_2);
 
-    MultiLayer m_layer2;
+    Sample m_layer2;
     m_layer2.addLayer(layer_21);
     m_layer2.addLayer(layer_22);
 
diff --git a/Tests/Unit/Resample/RTTest.cpp b/Tests/Unit/Resample/RTTest.cpp
index db8ee08324196be89261a0d2b2398bb9b98b32d6..89211bcc2a92c2cc9fa75a2f632e3ba3c2722e61 100644
--- a/Tests/Unit/Resample/RTTest.cpp
+++ b/Tests/Unit/Resample/RTTest.cpp
@@ -6,7 +6,7 @@
 #include "Sample/Interface/LayerRoughness.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Tests/GTestWrapper/google_test.h"
 
 class RTTest : public ::testing::Test {
@@ -41,7 +41,7 @@ protected:
     const Layer topLayer{air};
     const Layer substrate{stone};
     const R3 k{1, 0, -1e-3};
-    MultiLayer sample1, sample2;
+    Sample sample1, sample2;
     std::vector<ScalarFlux> coeffs1, coeffs2;
 };
 
diff --git a/Tests/Unit/Sample/MultiLayerTest.cpp b/Tests/Unit/Sample/MultiLayerTest.cpp
index abf7aefdd0d53916f5cb27254b561b5147c7d137..874fb587cdd7aa696ce0aab0a512f6f8e0e1bca8 100644
--- a/Tests/Unit/Sample/MultiLayerTest.cpp
+++ b/Tests/Unit/Sample/MultiLayerTest.cpp
@@ -1,4 +1,4 @@
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 
 #include "Base/Const/Units.h"
 #include "Sample/Aggregate/ParticleLayout.h"
@@ -29,7 +29,7 @@ protected:
         mLayer.addLayer(substrate);
     }
 
-    MultiLayer mLayer;
+    Sample mLayer;
     const Material air, iron, chromium, stone;
     Layer topLayer, layer1, layer2, substrate;
 };
@@ -100,7 +100,7 @@ TEST_F(MultiLayerTest, Clone)
 {
     set_four();
 
-    MultiLayer* mLayerClone = mLayer.clone();
+    Sample* mLayerClone = mLayer.clone();
 
     // check properties
     EXPECT_EQ(size_t(4), mLayerClone->numberOfLayers());
@@ -173,7 +173,7 @@ TEST_F(MultiLayerTest, CloneWithRoughness)
     mLayer.addLayer(Layer(*magneticLayer.material(), magneticLayer.thickness(), &lr1));
     mLayer.addLayer(Layer(*substrate.material(), substrate.thickness(), &lr2));
 
-    MultiLayer* mLayerClone = mLayer.clone();
+    Sample* mLayerClone = mLayer.clone();
 
     const LayerRoughness* roughness1 = mLayerClone->layer(1)->roughness();
     const LayerRoughness* roughness2 = mLayerClone->layer(2)->roughness();
@@ -205,7 +205,7 @@ TEST_F(MultiLayerTest, CloneWithRoughness)
 
 TEST_F(MultiLayerTest, MultiLayerComposite)
 {
-    MultiLayer mLayer;
+    Sample mLayer;
     R3 magnetic_field(0.0, 0.0, 0.0);
     Material magMaterial0 = RefractiveMaterial("MagMat0", 6e-4, 2e-8, magnetic_field);
     Material magMaterial1 = RefractiveMaterial("MagMat1", -5.6, 10, magnetic_field);
diff --git a/Tests/Unit/Sim/FittingTestHelper.h b/Tests/Unit/Sim/FittingTestHelper.h
index c6bdaad65a2c5e3e82ba0d722092a0d75898eea6..690d94669a7f07d88d6f6cc95de567322ed8e24b 100644
--- a/Tests/Unit/Sim/FittingTestHelper.h
+++ b/Tests/Unit/Sim/FittingTestHelper.h
@@ -9,7 +9,7 @@
 #include "Fit/Param/Parameters.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
 #include "Sim/Simulation/ScatteringSimulation.h"
 #include <memory>
 
@@ -35,7 +35,7 @@ public:
 
     std::unique_ptr<ISimulation> createSimulation(const mumufit::Parameters&)
     {
-        MultiLayer sample;
+        Sample sample;
         auto material = RefractiveMaterial("Shell", 0.0, 0.0);
         sample.addLayer(Layer(material));
         sample.addLayer(Layer(material));
diff --git a/Wrap/Python/src/bornagain/std_samples.py b/Wrap/Python/src/bornagain/std_samples.py
index 1ffaf821caf836cd280554d57d3ef377c7aa6417..862b5f5d0e5c655c33ee1f4e12e00aa4167074bc 100644
--- a/Wrap/Python/src/bornagain/std_samples.py
+++ b/Wrap/Python/src/bornagain/std_samples.py
@@ -23,7 +23,7 @@ def alternating_layers():
     substrate_layer = ba.Layer(material_substrate)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
@@ -52,7 +52,7 @@ def substrate_plus_particle(particle):
     layer_2 = ba.Layer(material_substrate)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
@@ -81,6 +81,6 @@ def sas_sample_with_particle(particle):
     vacuum_layer = ba.Layer(ba.Vacuum())
     vacuum_layer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     return sample
diff --git a/Wrap/Swig/libBornAgainSample.i b/Wrap/Swig/libBornAgainSample.i
index e81f05a2da273f81f82d640520e6a2a92110af75..e127e8df19c6ed2dc508b3e0b61a8ea110f27da7 100644
--- a/Wrap/Swig/libBornAgainSample.i
+++ b/Wrap/Swig/libBornAgainSample.i
@@ -40,21 +40,21 @@
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/Correlation/IPeakShape.h"
 #include "Sample/HardParticle/HardParticles.h"
-#include "Sample/Lattice/Lattice3D.h"
+#include "Sample/Interface/LayerRoughness.h"
+#include "Sample/Interface/RoughnessMap.h"
 #include "Sample/Lattice/BakeLattice.h"
 #include "Sample/Lattice/ISelectionRule.h"
+#include "Sample/Lattice/Lattice3D.h"
+#include "Sample/Material/MaterialBySLDImpl.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Material/RefractiveMaterialImpl.h"
-#include "Sample/Material/MaterialBySLDImpl.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
+#include "Sample/Particle/Compound.h"
+#include "Sample/Particle/CoreAndShell.h"
 #include "Sample/Particle/Crystal.h"
 #include "Sample/Particle/Mesocrystal.h"
 #include "Sample/Particle/Particle.h"
-#include "Sample/Particle/Compound.h"
-#include "Sample/Particle/CoreAndShell.h"
-#include "Sample/Interface/LayerRoughness.h"
-#include "Sample/Interface/RoughnessMap.h"
 #include "Sample/Scattering/Rotations.h"
 #include "Sample/SoftParticle/SoftParticles.h"
 %}
@@ -100,7 +100,7 @@
 %include "Sample/Interface/RoughnessMap.h"
 
 %include "Sample/Multilayer/Layer.h"
-%include "Sample/Multilayer/MultiLayer.h"
+%include "Sample/Multilayer/Sample.h"
 
 %include "Sample/Interface/AutocorrelationModels.h"
 %include "Sample/Interface/InterlayerModels.h"
diff --git a/auto/Examples/bayesian/likelihood_sampling.py b/auto/Examples/bayesian/likelihood_sampling.py
index 73f3e0dd84c3f694f79333f44777143bf1a50204..6d7b79bb56c42dbec40f920c7bae93b75df35559 100755
--- a/auto/Examples/bayesian/likelihood_sampling.py
+++ b/auto/Examples/bayesian/likelihood_sampling.py
@@ -33,7 +33,7 @@ def get_sample(ni_thickness, ti_thickness):
     ni_layer = ba.Layer(material_ni, ni_thickness)
     ti_layer = ba.Layer(material_ti, ti_thickness)
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/Examples/fit/scatter2d/consecutive_fitting.py b/auto/Examples/fit/scatter2d/consecutive_fitting.py
index 0fe0f05e1469e0bb3a1d38febef5ae1991d57523..ed392d31a75847a2f6e123d8736c1ee5d5767aab 100755
--- a/auto/Examples/fit/scatter2d/consecutive_fitting.py
+++ b/auto/Examples/fit/scatter2d/consecutive_fitting.py
@@ -33,7 +33,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/fit/scatter2d/expfit_galaxi.py b/auto/Examples/fit/scatter2d/expfit_galaxi.py
index 7c714b29a604cc26fe268eac59b03721f81e004a..26b5547928bb157f87e570c54a6f8e3d2b2348fc 100755
--- a/auto/Examples/fit/scatter2d/expfit_galaxi.py
+++ b/auto/Examples/fit/scatter2d/expfit_galaxi.py
@@ -82,7 +82,7 @@ def get_sample(P):
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/auto/Examples/fit/scatter2d/fit2d.py b/auto/Examples/fit/scatter2d/fit2d.py
index cfab5f347645f6fb5887c73418c7118a338f10f9..c4292199fd86b75e044bf0fece1666c433d11f3d 100755
--- a/auto/Examples/fit/scatter2d/fit2d.py
+++ b/auto/Examples/fit/scatter2d/fit2d.py
@@ -17,7 +17,7 @@ def get_simulation(P):
 
     layer = ba.Layer(ba.RefractiveMaterial("Vacuum", 0, 0))
     layer.addLayout(ba.ParticleLayout(sphere))
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     n = 100
diff --git a/auto/Examples/fit/scatter2d/gisas_model1.py b/auto/Examples/fit/scatter2d/gisas_model1.py
index 2fc5c00fc6134ea72a7825634bb82ffb3d469bf1..c9e639bd0fdf5bde3385dc43148c74cb6da8a0f1 100755
--- a/auto/Examples/fit/scatter2d/gisas_model1.py
+++ b/auto/Examples/fit/scatter2d/gisas_model1.py
@@ -24,7 +24,7 @@ def get_sample(P):
     layer_1.addLayout(layout)
     layer_2 = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     return sample
diff --git a/auto/Examples/fit/scatter2d/hardcode_galaxi.py b/auto/Examples/fit/scatter2d/hardcode_galaxi.py
index dce5578cbb55810c1f2f542a4e3864514d096969..d769f8596a1d1ea78da4a9abe0ea4718c70e9f87 100755
--- a/auto/Examples/fit/scatter2d/hardcode_galaxi.py
+++ b/auto/Examples/fit/scatter2d/hardcode_galaxi.py
@@ -64,7 +64,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/auto/Examples/fit/scatter2d/minimizer_settings.py b/auto/Examples/fit/scatter2d/minimizer_settings.py
index 3fafdc9916c48b10bf97b800578509f1b3a9ef10..ff746b4bb33dea6cdf3f6517114602a372b684f7 100755
--- a/auto/Examples/fit/scatter2d/minimizer_settings.py
+++ b/auto/Examples/fit/scatter2d/minimizer_settings.py
@@ -35,7 +35,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/fit/scatter2d/model1_cylinders.py b/auto/Examples/fit/scatter2d/model1_cylinders.py
index fd3bdeece5bd521b89be49d66f256caa1735c84c..a10fad1082c861182632ca4e53fb0ac38e9f67f3 100755
--- a/auto/Examples/fit/scatter2d/model1_cylinders.py
+++ b/auto/Examples/fit/scatter2d/model1_cylinders.py
@@ -23,7 +23,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/Examples/fit/scatter2d/model2_hexlattice.py b/auto/Examples/fit/scatter2d/model2_hexlattice.py
index 7e44a2331ed23f29fcf95ebdd40e63a1a567ab1f..45f5f4a94a3cd067e68a5466f27790ba9908e1c4 100755
--- a/auto/Examples/fit/scatter2d/model2_hexlattice.py
+++ b/auto/Examples/fit/scatter2d/model2_hexlattice.py
@@ -29,7 +29,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/fit/scatter2d/multiple_datasets.py b/auto/Examples/fit/scatter2d/multiple_datasets.py
index 4af7980d88bd354cc56e4e3c8105c303329b396b..9359ff9c1cf0c93084fccf9db112af43bc2dc0f8 100755
--- a/auto/Examples/fit/scatter2d/multiple_datasets.py
+++ b/auto/Examples/fit/scatter2d/multiple_datasets.py
@@ -31,7 +31,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/fit/specular/Honeycomb_fit.py b/auto/Examples/fit/specular/Honeycomb_fit.py
index 5e7c1d4115deae069e085f6a51e57231e75bd966..7ccda13eb083716468287e722d269707161df920 100755
--- a/auto/Examples/fit/specular/Honeycomb_fit.py
+++ b/auto/Examples/fit/specular/Honeycomb_fit.py
@@ -63,7 +63,7 @@ def get_sample(P, sign, T):
     l_SiO2 = ba.Layer(material_SiO2, P["t_SiO2"]*angstrom, rSiO2)
     l_Si = ba.Layer(material_Si, rSi)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
 
     sample.addLayer(l_Air)
     sample.addLayer(l_PyOx)
diff --git a/auto/Examples/fit/specular/PolarizedSpinAsymmetry.py b/auto/Examples/fit/specular/PolarizedSpinAsymmetry.py
index 824c2d3761de35e011b26d978be3e193e973529d..8aa1d6e6bb37e672ae0a42f01ad47faa75627393 100755
--- a/auto/Examples/fit/specular/PolarizedSpinAsymmetry.py
+++ b/auto/Examples/fit/specular/PolarizedSpinAsymmetry.py
@@ -59,7 +59,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/Examples/fit/specular/Pt_layer_fit.py b/auto/Examples/fit/specular/Pt_layer_fit.py
index 44875ce8c491afa7254c15fb9fcce40fe2a7e509..097ad5712db954a144aa9c61d98c6fd503441118 100755
--- a/auto/Examples/fit/specular/Pt_layer_fit.py
+++ b/auto/Examples/fit/specular/Pt_layer_fit.py
@@ -40,7 +40,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_pt/nm"], r_pt)
     substrate_layer = ba.Layer(material_substrate, r_si)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/Examples/fit/specular/Specular1Par.py b/auto/Examples/fit/specular/Specular1Par.py
index 304351e819f18c74b5a642c525701c757e86f0e1..df62ff3f5f2e41df61079cf1397bf653b30cea58 100755
--- a/auto/Examples/fit/specular/Specular1Par.py
+++ b/auto/Examples/fit/specular/Specular1Par.py
@@ -30,7 +30,7 @@ def get_sample(P):
     layer_Ti = ba.Layer(material_Ti, P["thickness_Ti"])
     layer_Ni = ba.Layer(material_Ni, 70*angstrom)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     for _ in range(10):
         sample.addLayer(layer_Ti)
diff --git a/auto/Examples/fit/specular/TREFF_Ni_film.py b/auto/Examples/fit/specular/TREFF_Ni_film.py
index e49b70eba97203ebd84f32f9c65ab580dcd168e1..5dda26bd3df897602a9ff11143c115495766ec57 100755
--- a/auto/Examples/fit/specular/TREFF_Ni_film.py
+++ b/auto/Examples/fit/specular/TREFF_Ni_film.py
@@ -35,7 +35,7 @@ def get_sample(P):
     layer_Ni = ba.Layer(material_Ni_58, P["thickness"], roughness_Ni)
     substrate = ba.Layer(material_SiO2, roughness_Substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer_Ni)
     sample.addLayer(substrate)
diff --git a/auto/Examples/offspec/Offspec1.py b/auto/Examples/offspec/Offspec1.py
index be8ee72cd9c378263d10c9be9d554968b7d4c35e..e0a7553106832b0c26a5c1c8209650c94bb5100c 100755
--- a/auto/Examples/offspec/Offspec1.py
+++ b/auto/Examples/offspec/Offspec1.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/offspec/OffspecLambda.py b/auto/Examples/offspec/OffspecLambda.py
index 61a096f11d05f93c571adc1ae2306d60ea6623c2..e4cceef760928e5dfa310b452ade0d1e8da7469a 100755
--- a/auto/Examples/offspec/OffspecLambda.py
+++ b/auto/Examples/offspec/OffspecLambda.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/offspec/OffspecResolved.py b/auto/Examples/offspec/OffspecResolved.py
index 1749a23d8bdd6a6ce0ee68bac653c8a8246ab5d5..1d4b2b0158fd4d7a54db0f244f73013d7a73c399 100755
--- a/auto/Examples/offspec/OffspecResolved.py
+++ b/auto/Examples/offspec/OffspecResolved.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/ApproximationDA.py b/auto/Examples/scatter2d/ApproximationDA.py
index 09941ed3dc355a0e2c2e7cabfeb2c20b0a071afb..acdc3c74aa0492bc30e81d7a7df644b514bd26e2 100755
--- a/auto/Examples/scatter2d/ApproximationDA.py
+++ b/auto/Examples/scatter2d/ApproximationDA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/ApproximationLMA.py b/auto/Examples/scatter2d/ApproximationLMA.py
index aa94623937510f31ae121f579e2a1d076b7a024d..d3779ba422e4348184ca1df2aa3149f9fb8124fc 100755
--- a/auto/Examples/scatter2d/ApproximationLMA.py
+++ b/auto/Examples/scatter2d/ApproximationLMA.py
@@ -51,7 +51,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/ApproximationSSCA.py b/auto/Examples/scatter2d/ApproximationSSCA.py
index cae785205ce5675f7b468a20870fca18b1e19a7e..a827c3ad3c13f5fe1aaf4d894406d354fb428cad 100755
--- a/auto/Examples/scatter2d/ApproximationSSCA.py
+++ b/auto/Examples/scatter2d/ApproximationSSCA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/AxesInDifferentUnits.py b/auto/Examples/scatter2d/AxesInDifferentUnits.py
index d6ad9f1062b974f2c4288745d2811b52a76d4db6..177f5d94d8906e50ea47fff6a284f1d87bd18275 100755
--- a/auto/Examples/scatter2d/AxesInDifferentUnits.py
+++ b/auto/Examples/scatter2d/AxesInDifferentUnits.py
@@ -37,7 +37,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/auto/Examples/scatter2d/BiMaterialCylinders.py b/auto/Examples/scatter2d/BiMaterialCylinders.py
index 27c73a926a84da9fe52feda370de1c63500bf0f4..56393a50d07f14d9bdf539478c2a7bc25905e5ac 100755
--- a/auto/Examples/scatter2d/BiMaterialCylinders.py
+++ b/auto/Examples/scatter2d/BiMaterialCylinders.py
@@ -48,7 +48,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/BoxesWithSpecularPeak.py b/auto/Examples/scatter2d/BoxesWithSpecularPeak.py
index 7e7518999a1c0990ef40f17837af3856e19d2b46..e010d2cbbe44a692c8f642b7c85805184ff281c2 100755
--- a/auto/Examples/scatter2d/BoxesWithSpecularPeak.py
+++ b/auto/Examples/scatter2d/BoxesWithSpecularPeak.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/BroadSpecular.py b/auto/Examples/scatter2d/BroadSpecular.py
index 1b9e9b6d1d8dc03baef4f6369813bf6351f65d89..0b64a0e85deee30da008492cb04283f65758fe0a 100755
--- a/auto/Examples/scatter2d/BroadSpecular.py
+++ b/auto/Examples/scatter2d/BroadSpecular.py
@@ -14,7 +14,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_4)
 
diff --git a/auto/Examples/scatter2d/CorrelatedRoughness.py b/auto/Examples/scatter2d/CorrelatedRoughness.py
index 8fcbd4d6bfa8123bb85e678924972a0cbe55637d..a82f59a9064cc247d9f470b981281851965ccd58 100755
--- a/auto/Examples/scatter2d/CorrelatedRoughness.py
+++ b/auto/Examples/scatter2d/CorrelatedRoughness.py
@@ -30,7 +30,7 @@ def get_sample():
     l_part_b = ba.Layer(material_part_b, 5*nm, roughness)
     l_substrate = ba.Layer(material_substrate, roughness)
 
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
 
     # adding layers
     my_sample.addLayer(l_ambience)
diff --git a/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py b/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py
index 56bcdca051fe24817e9cf5fa7aa6eab35acd64fc..41858877f1caa46b6937d1cf8fbe96142ed59aaa 100755
--- a/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py
+++ b/auto/Examples/scatter2d/CosineRipplesAtRectLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/CustomFormFactor.py b/auto/Examples/scatter2d/CustomFormFactor.py
index 512e9b2d1b4b2aece54480c703af8e908515d03c..652c45f4fc3bdb3f99c85b43f8c2e50a680493a6 100755
--- a/auto/Examples/scatter2d/CustomFormFactor.py
+++ b/auto/Examples/scatter2d/CustomFormFactor.py
@@ -68,7 +68,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # assemble sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/scatter2d/CylindersAndPrisms.py b/auto/Examples/scatter2d/CylindersAndPrisms.py
index e5c0eb20a72ec73274391469169141ca73197a56..bf6f8579f45868e03f9676e97ce407a82bbb3ef2 100755
--- a/auto/Examples/scatter2d/CylindersAndPrisms.py
+++ b/auto/Examples/scatter2d/CylindersAndPrisms.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/CylindersInAverageLayer.py b/auto/Examples/scatter2d/CylindersInAverageLayer.py
index 4ec3b65e7bc590c06093dfd0567d3c6f108037be..01de64e66135b1aa335bb02b834845c4cae73ade 100755
--- a/auto/Examples/scatter2d/CylindersInAverageLayer.py
+++ b/auto/Examples/scatter2d/CylindersInAverageLayer.py
@@ -35,7 +35,7 @@ def get_sample(cyl_height=5*nm):
     intermediate_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(intermediate_layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/Examples/scatter2d/CylindersInBA.py b/auto/Examples/scatter2d/CylindersInBA.py
index 6087d97c4723cf3d73028fca52501d1bf3ae19b5..0a4471261c49680523c98fd8137a4b4af6ad4429 100755
--- a/auto/Examples/scatter2d/CylindersInBA.py
+++ b/auto/Examples/scatter2d/CylindersInBA.py
@@ -33,7 +33,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/Examples/scatter2d/DodecahedraSAS.py b/auto/Examples/scatter2d/DodecahedraSAS.py
index 86db0091da124abf97680c4cfa0e94f32a53936c..7fcc26f0ffd17d3bb1b54708114e608570196481 100755
--- a/auto/Examples/scatter2d/DodecahedraSAS.py
+++ b/auto/Examples/scatter2d/DodecahedraSAS.py
@@ -21,7 +21,7 @@ def get_sample():
     solution_layer.addLayout(layout)
 
     # Flat sample layer sandwiched between semi-infinite vacuum layers:
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(solution_layer)
     sample.addLayer(ba.Layer(vacuum))
diff --git a/auto/Examples/scatter2d/FindPeaks.py b/auto/Examples/scatter2d/FindPeaks.py
index 585266ed7a4ea6df61c09e00ffc68c941b513a70..999377653c9b65baff18c851b4355be6f77cdf84 100755
--- a/auto/Examples/scatter2d/FindPeaks.py
+++ b/auto/Examples/scatter2d/FindPeaks.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py b/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py
index bd2a98eb85c4108d624283122c48d6289f2b5103..37f970cd35b4e7a260d0d42b54d3383b0aef2ff4 100755
--- a/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py
+++ b/auto/Examples/scatter2d/HalfSpheresInAverageTopLayer.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py b/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py
index 170253a0971ea736bdb8ea0ae4bd7befed2f1470..4e97ba42ec6dfe28ee31911841c90584f38240e2 100755
--- a/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py
+++ b/auto/Examples/scatter2d/HexagonalLatticesWithBasis.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Interference1DLattice.py b/auto/Examples/scatter2d/Interference1DLattice.py
index c84ead6046c5bfeeebac8de1c97403e57e92f236..6a289c155f4169dcbe01fb6ff2ed5fe0f2235286 100755
--- a/auto/Examples/scatter2d/Interference1DLattice.py
+++ b/auto/Examples/scatter2d/Interference1DLattice.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Interference1DRadialParacrystal.py b/auto/Examples/scatter2d/Interference1DRadialParacrystal.py
index 54d9c4b48369a737937dacca7bf6da22f5290238..e7e3241a1d48bfe892dbb73cb2f56c463d52a792 100755
--- a/auto/Examples/scatter2d/Interference1DRadialParacrystal.py
+++ b/auto/Examples/scatter2d/Interference1DRadialParacrystal.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py b/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py
index c21129d53224824c72f374d72a6398116607ee83..95aaac0023f17dfdf911e2f2c93db6d5ac6b4c4e 100755
--- a/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py
+++ b/auto/Examples/scatter2d/Interference2DCenteredSquareLattice.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Interference2DParacrystal.py b/auto/Examples/scatter2d/Interference2DParacrystal.py
index 0f5ccbd6ea8842e31b84a0132df7d0ee100432e2..93bae0230a1a2809f337ecb440e0e7fb3c1262ae 100755
--- a/auto/Examples/scatter2d/Interference2DParacrystal.py
+++ b/auto/Examples/scatter2d/Interference2DParacrystal.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py b/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py
index e4d8498f570669f6a2c27fbc05051be1d99e418d..afb43de8df6333f6503c2d10439be9a7aade1435 100755
--- a/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py
+++ b/auto/Examples/scatter2d/Interference2DRotatedSquareLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py b/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py
index 16416c1325bc44f8f716fbb91f3373fea0f74205..5f16fdcf40aacca07cf1593f43692b4ac9c184db 100755
--- a/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py
+++ b/auto/Examples/scatter2d/Interference2DSquareFiniteLattice.py
@@ -42,7 +42,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/LargeParticlesFormFactor.py b/auto/Examples/scatter2d/LargeParticlesFormFactor.py
index 7ca9a6a904620a8ca9b9d03776273bea97325b91..2d3e36106cb74707bf6ea891f840f1e1469e4f34 100755
--- a/auto/Examples/scatter2d/LargeParticlesFormFactor.py
+++ b/auto/Examples/scatter2d/LargeParticlesFormFactor.py
@@ -33,7 +33,7 @@ def get_sample(cylinder_radius, cylinder_height):
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/scatter2d/LatticeOrientationDistribution.py b/auto/Examples/scatter2d/LatticeOrientationDistribution.py
index 591d359dbf8e9916d19c661f810156c47102d3e5..17ba325ea68272e4404c8d0fcc979a39ed6fccf0 100755
--- a/auto/Examples/scatter2d/LatticeOrientationDistribution.py
+++ b/auto/Examples/scatter2d/LatticeOrientationDistribution.py
@@ -29,7 +29,7 @@ def get_sample():
         layout.setTotalParticleSurfaceDensity(0.1*parsample.weight)
         toplayer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(toplayer)
     sample.addLayer(substrate)
     return sample
diff --git a/auto/Examples/scatter2d/MagneticCylinders1.py b/auto/Examples/scatter2d/MagneticCylinders1.py
index f3e693739b38cb31a6a34645f0e1cdb11467e7e5..11bbdb894c3acb38b4515e44c2446055370dbd1f 100755
--- a/auto/Examples/scatter2d/MagneticCylinders1.py
+++ b/auto/Examples/scatter2d/MagneticCylinders1.py
@@ -25,7 +25,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/Examples/scatter2d/MagneticCylinders2.py b/auto/Examples/scatter2d/MagneticCylinders2.py
index 65ce52236d915773019aaaa645f597c616a608b8..f0e9c54440f0b742b667cf4370b92d6adeb7ea38 100755
--- a/auto/Examples/scatter2d/MagneticCylinders2.py
+++ b/auto/Examples/scatter2d/MagneticCylinders2.py
@@ -24,7 +24,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/Examples/scatter2d/MagneticSpheres.py b/auto/Examples/scatter2d/MagneticSpheres.py
index d6841c22b9966decf6fb2ee80d86a6003720d338..3b49373487acfb2ddc5044ba1f9eeac984b2b071 100755
--- a/auto/Examples/scatter2d/MagneticSpheres.py
+++ b/auto/Examples/scatter2d/MagneticSpheres.py
@@ -30,7 +30,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
     layer_2.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Mesocrystal.py b/auto/Examples/scatter2d/Mesocrystal.py
index 96d795d2506ad97c1f7bf27bb3b53111b0befcc3..e3da949daff2ac24762016b32b0c41ec04b7c1c6 100755
--- a/auto/Examples/scatter2d/Mesocrystal.py
+++ b/auto/Examples/scatter2d/Mesocrystal.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Mesocrystal2.py b/auto/Examples/scatter2d/Mesocrystal2.py
index 9cabda8d57351d03688ee84ea5593588f3b2fe15..4c15faec69287a13cd58f58d4597eac53b6470f7 100755
--- a/auto/Examples/scatter2d/Mesocrystal2.py
+++ b/auto/Examples/scatter2d/Mesocrystal2.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Mesocrystal3.py b/auto/Examples/scatter2d/Mesocrystal3.py
index fad85d131dc60c6214ffc094417d4b99841adeeb..d3cd6262e6571a5fa6c3a1be55256105dd3e61a7 100755
--- a/auto/Examples/scatter2d/Mesocrystal3.py
+++ b/auto/Examples/scatter2d/Mesocrystal3.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/Mesocrystal4.py b/auto/Examples/scatter2d/Mesocrystal4.py
index 257732e5fe8dbbb6c7215e746cfb5f1e43c616f5..3fbf4814de558100b29a1ce642b062876cdf7095 100755
--- a/auto/Examples/scatter2d/Mesocrystal4.py
+++ b/auto/Examples/scatter2d/Mesocrystal4.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/ParticleAcrossInterface.py b/auto/Examples/scatter2d/ParticleAcrossInterface.py
index 0adb0fce6073dab44bf698cbd087f2ae4f96eb3f..26b0a68266c5a21dbffadd7dd5c2e3371a5875e6 100755
--- a/auto/Examples/scatter2d/ParticleAcrossInterface.py
+++ b/auto/Examples/scatter2d/ParticleAcrossInterface.py
@@ -28,7 +28,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/PolarizedSANS.py b/auto/Examples/scatter2d/PolarizedSANS.py
index e7bb496c295b424b80c95898940521560578b89c..c1ddbf53e76466497a6c71a1d8cdf6d093dfbd32 100755
--- a/auto/Examples/scatter2d/PolarizedSANS.py
+++ b/auto/Examples/scatter2d/PolarizedSANS.py
@@ -42,7 +42,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/Examples/scatter2d/PolydisperseCylinders.py b/auto/Examples/scatter2d/PolydisperseCylinders.py
index ac7bfa7dddd0ffe0445fff4ed5087b1eb13728e8..32517267053e022349c3a3fbd05b6cc68b997b12 100755
--- a/auto/Examples/scatter2d/PolydisperseCylinders.py
+++ b/auto/Examples/scatter2d/PolydisperseCylinders.py
@@ -23,7 +23,7 @@ def get_sample():
     layer = ba.Layer(vacuum)
     layer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/Examples/scatter2d/PositionVariance.py b/auto/Examples/scatter2d/PositionVariance.py
index 3481cc17e01f32d4f382e31d734c998aa00953d1..2f02cf06126b84886c837894d164962265e877e0 100755
--- a/auto/Examples/scatter2d/PositionVariance.py
+++ b/auto/Examples/scatter2d/PositionVariance.py
@@ -36,7 +36,7 @@ def get_sample(hasVariance, xi):
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/auto/Examples/scatter2d/RectangularGrating.py b/auto/Examples/scatter2d/RectangularGrating.py
index ac3cff679d88ed15e8e38c8b59ae7638ead754d4..bcfdfc037b33fa0a115488680258548fbfe75289 100755
--- a/auto/Examples/scatter2d/RectangularGrating.py
+++ b/auto/Examples/scatter2d/RectangularGrating.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/Examples/scatter2d/RotatedPyramids.py b/auto/Examples/scatter2d/RotatedPyramids.py
index a2726b59e65378fabf6a288c59f50246eb69b607..3677ae8d16eda045e713c1e8753a37d755ac646a 100755
--- a/auto/Examples/scatter2d/RotatedPyramids.py
+++ b/auto/Examples/scatter2d/RotatedPyramids.py
@@ -35,7 +35,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/RoughAndSpecular.py b/auto/Examples/scatter2d/RoughAndSpecular.py
index f61f9b5e908e46e4ccb0e7d9fdc82eea1b335802..1e5f2ff15981843c931c88a8adf9bbd682d2f381 100755
--- a/auto/Examples/scatter2d/RoughAndSpecular.py
+++ b/auto/Examples/scatter2d/RoughAndSpecular.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/Examples/scatter2d/SlicedLayer.py b/auto/Examples/scatter2d/SlicedLayer.py
index 81422b11a5c06a900476ddfb9a02d564a37e7d09..2eacfe1eea7cf6279054e0cd5ce94554e2d316f1 100755
--- a/auto/Examples/scatter2d/SlicedLayer.py
+++ b/auto/Examples/scatter2d/SlicedLayer.py
@@ -31,7 +31,7 @@ def get_sample():
     substrate = ba.Layer(material_substrate)
     substrate.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer1)
     sample.addLayer(substrate)
diff --git a/auto/Examples/scatter2d/SpheresAtHexLattice.py b/auto/Examples/scatter2d/SpheresAtHexLattice.py
index 59f495763bc3655586c37705132916798c693a33..337d69ba704629e52f5e6b8f126481df90393469 100755
--- a/auto/Examples/scatter2d/SpheresAtHexLattice.py
+++ b/auto/Examples/scatter2d/SpheresAtHexLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/scatter2d/TriangularRipple.py b/auto/Examples/scatter2d/TriangularRipple.py
index 5f41fced16f83e362aa9861c2a610c91d62cd147..8c1963ff45d149c45e25045399787d624e6b7315 100755
--- a/auto/Examples/scatter2d/TriangularRipple.py
+++ b/auto/Examples/scatter2d/TriangularRipple.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/Examples/specular/AlternatingLayers1.py b/auto/Examples/specular/AlternatingLayers1.py
index 2f6d96fb38375bd61c5f9da5bc0f40fff0894698..35e80492578d9ed005151c2a8e818382097f291a 100755
--- a/auto/Examples/specular/AlternatingLayers1.py
+++ b/auto/Examples/specular/AlternatingLayers1.py
@@ -22,7 +22,7 @@ def get_sample():
     substrate = ba.Layer(material_Si)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(top_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/Examples/specular/Basic.py b/auto/Examples/specular/Basic.py
index 2d508d4c14b54a5cdbe656128f236f8e37c8735e..ac40f3775d93d168ed5b0db4ed87234d1a8d8ff3 100755
--- a/auto/Examples/specular/Basic.py
+++ b/auto/Examples/specular/Basic.py
@@ -18,7 +18,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(film)
     sample.addLayer(substrate_layer)
diff --git a/auto/Examples/specular/MagneticLayer.py b/auto/Examples/specular/MagneticLayer.py
index 653cd3d37930f6ca2e0161ce3a18aac71a8627c8..96ae82f34b59e2984223e6bacbd16e9bf9fecba8 100755
--- a/auto/Examples/specular/MagneticLayer.py
+++ b/auto/Examples/specular/MagneticLayer.py
@@ -26,7 +26,7 @@ def get_sample():
     layer_3 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/Examples/specular/MagneticLayerImperfect.py b/auto/Examples/specular/MagneticLayerImperfect.py
index edd0d85e0ad5e1894c6d4bede5e0d1a6afd8162a..f628bbeacaf0f3426c8297df42b5384ecf51841e 100755
--- a/auto/Examples/specular/MagneticLayerImperfect.py
+++ b/auto/Examples/specular/MagneticLayerImperfect.py
@@ -31,7 +31,7 @@ def get_sample():
     layer_substrate = ba.Layer(material_substrate, roughness)
 
     # Multilayer
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_vacuum)
     sample.addLayer(layer_Pd)
     sample.addLayer(layer_Fe)
diff --git a/auto/Examples/specular/PolarizedSpinAsymmetry.py b/auto/Examples/specular/PolarizedSpinAsymmetry.py
index d130ba14f728857cac4944fa43ffe58e5b7a0ca6..e8ef9967fe05ad9b8320a02df7cc06612d90f4d3 100755
--- a/auto/Examples/specular/PolarizedSpinAsymmetry.py
+++ b/auto/Examples/specular/PolarizedSpinAsymmetry.py
@@ -60,7 +60,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/Examples/specular/RoughnessModel.py b/auto/Examples/specular/RoughnessModel.py
index b8ce9056563778bc07d34cb41fb90e49c9f3f0e2..34d9c58961844fed20e9dce2bcc19496c5d49a0d 100755
--- a/auto/Examples/specular/RoughnessModel.py
+++ b/auto/Examples/specular/RoughnessModel.py
@@ -27,7 +27,7 @@ def get_sample(interlayer):
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # create sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/Examples/specular/SpecularSimulationWithRoughness.py b/auto/Examples/specular/SpecularSimulationWithRoughness.py
index f53ff3d4bc4f4f01e646e67f5aae01ed4b027921..5ee0d357f4ad9c9331353453b15fe12a06cd0caa 100755
--- a/auto/Examples/specular/SpecularSimulationWithRoughness.py
+++ b/auto/Examples/specular/SpecularSimulationWithRoughness.py
@@ -28,7 +28,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/Examples/varia/Depthprobe1.py b/auto/Examples/varia/Depthprobe1.py
index 00f9c6aa6922daa0131c8e65389efad45a7cc056..7c50c029b8dee02e508d85797abdb58ea84e5d3c 100755
--- a/auto/Examples/varia/Depthprobe1.py
+++ b/auto/Examples/varia/Depthprobe1.py
@@ -14,7 +14,7 @@ def get_sample():
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/Examples/varia/MaterialProfile.py b/auto/Examples/varia/MaterialProfile.py
index 0d30e034ceae9bf5ccc838e2641c5a7c6c1091c1..ec87cae13ed237bc6b88fc28acf19b3e962233c4 100755
--- a/auto/Examples/varia/MaterialProfile.py
+++ b/auto/Examples/varia/MaterialProfile.py
@@ -32,7 +32,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     
     for _ in range(4):
diff --git a/auto/Examples/varia/MaterialProfileWithParticles.py b/auto/Examples/varia/MaterialProfileWithParticles.py
index c8ffb060665dcf92f76b7c22ef6aee3d6b41ba08..64179c690fa1c8a0674124e5071de96b4f30051c 100755
--- a/auto/Examples/varia/MaterialProfileWithParticles.py
+++ b/auto/Examples/varia/MaterialProfileWithParticles.py
@@ -30,7 +30,7 @@ def get_sample():
     ambient_layer.setNumberOfSlices(20)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/Examples/varia/OpaqueProfile1.py b/auto/Examples/varia/OpaqueProfile1.py
index 95a5c8ce2a1e99bc1f0e1a1b11eff566ddffed91..dee7e345bb21c5d558bebac853bcbd0842462bde 100755
--- a/auto/Examples/varia/OpaqueProfile1.py
+++ b/auto/Examples/varia/OpaqueProfile1.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_bot = ba.Layer(material_vac)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_top)
     sample.addLayer(layer_1)
     sample.addLayer(layer_bot)
diff --git a/auto/Examples/varia/Resonator.py b/auto/Examples/varia/Resonator.py
index 998cab35a19e37b70c274a1f3aa5d22c638373d2..012a7e4b4a836209ae69972f281840cd5945134f 100755
--- a/auto/Examples/varia/Resonator.py
+++ b/auto/Examples/varia/Resonator.py
@@ -52,7 +52,7 @@ def get_sample():
     layer_6 = ba.Layer(material_D2O)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/Examples/varia/RoughSurface.py b/auto/Examples/varia/RoughSurface.py
index 760cee57d5cfb3b5f7a70becb3258afb14449631..25a2fb5cfe876848618cfc1e1b367b3ebbf936e9 100755
--- a/auto/Examples/varia/RoughSurface.py
+++ b/auto/Examples/varia/RoughSurface.py
@@ -81,7 +81,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate, roughness_sub)
 
     # adding layers
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
     my_sample.addLayer(l_ambience)
     my_sample.addLayer(l_layer)
     my_sample.addLayer(l_substrate)
diff --git a/auto/Examples/varia/Transmission.py b/auto/Examples/varia/Transmission.py
index 2d17a31fcaca6ee0535bb6043870db45a9cd23d3..e15364f0cd5f8022006bea49ac15b09ceac706de 100755
--- a/auto/Examples/varia/Transmission.py
+++ b/auto/Examples/varia/Transmission.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/Examples/varia/TransmissionVsAlpha.py b/auto/Examples/varia/TransmissionVsAlpha.py
index b3805ea4332b61da5b1ff0f0b0a6f8bf455786f3..abe69993b3a086f63277c021ae185b17dbebd720 100755
--- a/auto/Examples/varia/TransmissionVsAlpha.py
+++ b/auto/Examples/varia/TransmissionVsAlpha.py
@@ -14,7 +14,7 @@ def get_sample(depth):
     material_A = ba.RefractiveMaterial("A", 5e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/Examples/varia/TransmissionVsDepth.py b/auto/Examples/varia/TransmissionVsDepth.py
index 269b9610a0c5d2a10bafe6d5aaf865ef5176b1e6..a1260c231a80b97ca9d7d8840de24291aee60fa0 100755
--- a/auto/Examples/varia/TransmissionVsDepth.py
+++ b/auto/Examples/varia/TransmissionVsDepth.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/FigExamples/bayesian/likelihood_sampling.py b/auto/FigExamples/bayesian/likelihood_sampling.py
index 2de8cacdef872ed5123cb01ec1dae17f417d928b..8daa7e0afe294abe43b6c29c0009faff84226898 100755
--- a/auto/FigExamples/bayesian/likelihood_sampling.py
+++ b/auto/FigExamples/bayesian/likelihood_sampling.py
@@ -33,7 +33,7 @@ def get_sample(ni_thickness, ti_thickness):
     ni_layer = ba.Layer(material_ni, ni_thickness)
     ti_layer = ba.Layer(material_ti, ti_thickness)
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/FigExamples/fit/scatter2d/consecutive_fitting.py b/auto/FigExamples/fit/scatter2d/consecutive_fitting.py
index a10da8a27ae23aea44dac051bb6be174990783e5..bd79d61064a12ae1731df89d0f1e08dcd125ba6c 100755
--- a/auto/FigExamples/fit/scatter2d/consecutive_fitting.py
+++ b/auto/FigExamples/fit/scatter2d/consecutive_fitting.py
@@ -33,7 +33,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/fit/scatter2d/expfit_galaxi.py b/auto/FigExamples/fit/scatter2d/expfit_galaxi.py
index e7f44ceb8c4e1238e4c9f5b5e8c1f9defd328419..eef7726e1b813179c94fc6b768e8b87acb441c7a 100755
--- a/auto/FigExamples/fit/scatter2d/expfit_galaxi.py
+++ b/auto/FigExamples/fit/scatter2d/expfit_galaxi.py
@@ -82,7 +82,7 @@ def get_sample(P):
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/auto/FigExamples/fit/scatter2d/fit2d.py b/auto/FigExamples/fit/scatter2d/fit2d.py
index cfab5f347645f6fb5887c73418c7118a338f10f9..c4292199fd86b75e044bf0fece1666c433d11f3d 100755
--- a/auto/FigExamples/fit/scatter2d/fit2d.py
+++ b/auto/FigExamples/fit/scatter2d/fit2d.py
@@ -17,7 +17,7 @@ def get_simulation(P):
 
     layer = ba.Layer(ba.RefractiveMaterial("Vacuum", 0, 0))
     layer.addLayout(ba.ParticleLayout(sphere))
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     n = 100
diff --git a/auto/FigExamples/fit/scatter2d/gisas_model1.py b/auto/FigExamples/fit/scatter2d/gisas_model1.py
index 2fc5c00fc6134ea72a7825634bb82ffb3d469bf1..c9e639bd0fdf5bde3385dc43148c74cb6da8a0f1 100755
--- a/auto/FigExamples/fit/scatter2d/gisas_model1.py
+++ b/auto/FigExamples/fit/scatter2d/gisas_model1.py
@@ -24,7 +24,7 @@ def get_sample(P):
     layer_1.addLayout(layout)
     layer_2 = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     return sample
diff --git a/auto/FigExamples/fit/scatter2d/hardcode_galaxi.py b/auto/FigExamples/fit/scatter2d/hardcode_galaxi.py
index dce5578cbb55810c1f2f542a4e3864514d096969..d769f8596a1d1ea78da4a9abe0ea4718c70e9f87 100755
--- a/auto/FigExamples/fit/scatter2d/hardcode_galaxi.py
+++ b/auto/FigExamples/fit/scatter2d/hardcode_galaxi.py
@@ -64,7 +64,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/auto/FigExamples/fit/scatter2d/minimizer_settings.py b/auto/FigExamples/fit/scatter2d/minimizer_settings.py
index 8720930d49a8fb48c568bf26c5d0ddf032e18422..fd0f04cc3fbd2dde86d7dc537793d066b2f08c8c 100755
--- a/auto/FigExamples/fit/scatter2d/minimizer_settings.py
+++ b/auto/FigExamples/fit/scatter2d/minimizer_settings.py
@@ -35,7 +35,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/fit/scatter2d/model1_cylinders.py b/auto/FigExamples/fit/scatter2d/model1_cylinders.py
index fd3bdeece5bd521b89be49d66f256caa1735c84c..a10fad1082c861182632ca4e53fb0ac38e9f67f3 100755
--- a/auto/FigExamples/fit/scatter2d/model1_cylinders.py
+++ b/auto/FigExamples/fit/scatter2d/model1_cylinders.py
@@ -23,7 +23,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/FigExamples/fit/scatter2d/model2_hexlattice.py b/auto/FigExamples/fit/scatter2d/model2_hexlattice.py
index 7e44a2331ed23f29fcf95ebdd40e63a1a567ab1f..45f5f4a94a3cd067e68a5466f27790ba9908e1c4 100755
--- a/auto/FigExamples/fit/scatter2d/model2_hexlattice.py
+++ b/auto/FigExamples/fit/scatter2d/model2_hexlattice.py
@@ -29,7 +29,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/fit/scatter2d/multiple_datasets.py b/auto/FigExamples/fit/scatter2d/multiple_datasets.py
index eb3aa66b2d88b2c0318f94b46d02a596af4df40f..8e5ba74638dab406066a83810e461514c1675b35 100755
--- a/auto/FigExamples/fit/scatter2d/multiple_datasets.py
+++ b/auto/FigExamples/fit/scatter2d/multiple_datasets.py
@@ -31,7 +31,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/fit/specular/Honeycomb_fit.py b/auto/FigExamples/fit/specular/Honeycomb_fit.py
index 7b5937050a8a36f91c102f2b33064f0527726183..15bafea356383d06a2c4b36548ff38dcc574776a 100755
--- a/auto/FigExamples/fit/specular/Honeycomb_fit.py
+++ b/auto/FigExamples/fit/specular/Honeycomb_fit.py
@@ -63,7 +63,7 @@ def get_sample(P, sign, T):
     l_SiO2 = ba.Layer(material_SiO2, P["t_SiO2"]*angstrom, rSiO2)
     l_Si = ba.Layer(material_Si, rSi)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
 
     sample.addLayer(l_Air)
     sample.addLayer(l_PyOx)
diff --git a/auto/FigExamples/fit/specular/PolarizedSpinAsymmetry.py b/auto/FigExamples/fit/specular/PolarizedSpinAsymmetry.py
index 09a5b85ddc1eb85859ac8d5f0586ce04192c4cfa..904a237c202c8d300d435e0cfbe442c72b81dd7e 100755
--- a/auto/FigExamples/fit/specular/PolarizedSpinAsymmetry.py
+++ b/auto/FigExamples/fit/specular/PolarizedSpinAsymmetry.py
@@ -59,7 +59,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/FigExamples/fit/specular/Pt_layer_fit.py b/auto/FigExamples/fit/specular/Pt_layer_fit.py
index 87ef4678a46325ddb42b7e26ac50cac13167664f..d35f48742e50fe5274ecc89cc8bf7693c740beb8 100755
--- a/auto/FigExamples/fit/specular/Pt_layer_fit.py
+++ b/auto/FigExamples/fit/specular/Pt_layer_fit.py
@@ -40,7 +40,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_pt/nm"], r_pt)
     substrate_layer = ba.Layer(material_substrate, r_si)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/FigExamples/fit/specular/Specular1Par.py b/auto/FigExamples/fit/specular/Specular1Par.py
index 304351e819f18c74b5a642c525701c757e86f0e1..df62ff3f5f2e41df61079cf1397bf653b30cea58 100755
--- a/auto/FigExamples/fit/specular/Specular1Par.py
+++ b/auto/FigExamples/fit/specular/Specular1Par.py
@@ -30,7 +30,7 @@ def get_sample(P):
     layer_Ti = ba.Layer(material_Ti, P["thickness_Ti"])
     layer_Ni = ba.Layer(material_Ni, 70*angstrom)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     for _ in range(10):
         sample.addLayer(layer_Ti)
diff --git a/auto/FigExamples/fit/specular/TREFF_Ni_film.py b/auto/FigExamples/fit/specular/TREFF_Ni_film.py
index 587f9362ca587810d0099c2100c32bc7e3cbfb9a..aa08818685d553094ecc7a1b0c55ec0e674d15f3 100755
--- a/auto/FigExamples/fit/specular/TREFF_Ni_film.py
+++ b/auto/FigExamples/fit/specular/TREFF_Ni_film.py
@@ -35,7 +35,7 @@ def get_sample(P):
     layer_Ni = ba.Layer(material_Ni_58, P["thickness"], roughness_Ni)
     substrate = ba.Layer(material_SiO2, roughness_Substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer_Ni)
     sample.addLayer(substrate)
diff --git a/auto/FigExamples/offspec/Offspec1.py b/auto/FigExamples/offspec/Offspec1.py
index 7fbe979f5eda99967734681a12bc281f079ff1f7..44f189f47f5ba403fe8653784677ca0bf5b31de8 100755
--- a/auto/FigExamples/offspec/Offspec1.py
+++ b/auto/FigExamples/offspec/Offspec1.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/offspec/OffspecLambda.py b/auto/FigExamples/offspec/OffspecLambda.py
index 2bea489c7078001e3657d4ecd25b0a51f3845214..54540acb5061ea3215b2762569905e14f2bd5bfd 100755
--- a/auto/FigExamples/offspec/OffspecLambda.py
+++ b/auto/FigExamples/offspec/OffspecLambda.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/offspec/OffspecResolved.py b/auto/FigExamples/offspec/OffspecResolved.py
index dd76ab5cdeddc736da6cd27cc24fffc2ebc645ee..bbda16f0e93f6bd94c85360f42af0474f15a5ff4 100755
--- a/auto/FigExamples/offspec/OffspecResolved.py
+++ b/auto/FigExamples/offspec/OffspecResolved.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/ApproximationDA.py b/auto/FigExamples/scatter2d/ApproximationDA.py
index 419a0340f8f9776c65b1d702f40567ec7cd50fe6..1a1a1a39cc94868e143482bb20f1e376a8f91b1f 100755
--- a/auto/FigExamples/scatter2d/ApproximationDA.py
+++ b/auto/FigExamples/scatter2d/ApproximationDA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/ApproximationLMA.py b/auto/FigExamples/scatter2d/ApproximationLMA.py
index 077ea2e08012ffa6ed3d73d609592304564f43e3..927a93104167e191665a6eca8321d9af5bdc824e 100755
--- a/auto/FigExamples/scatter2d/ApproximationLMA.py
+++ b/auto/FigExamples/scatter2d/ApproximationLMA.py
@@ -51,7 +51,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/ApproximationSSCA.py b/auto/FigExamples/scatter2d/ApproximationSSCA.py
index 7622ff5a77eac8ebbbf434a3362a29bdff7df786..d724313a7a9dba2f9b003d7107afbb523cb4adf3 100755
--- a/auto/FigExamples/scatter2d/ApproximationSSCA.py
+++ b/auto/FigExamples/scatter2d/ApproximationSSCA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/AxesInDifferentUnits.py b/auto/FigExamples/scatter2d/AxesInDifferentUnits.py
index 01c846e0ae1969973dcd69a4c996800ec452ff05..22ed73fde96ba6f94d60be19dec6f54d55e88076 100755
--- a/auto/FigExamples/scatter2d/AxesInDifferentUnits.py
+++ b/auto/FigExamples/scatter2d/AxesInDifferentUnits.py
@@ -37,7 +37,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/auto/FigExamples/scatter2d/BiMaterialCylinders.py b/auto/FigExamples/scatter2d/BiMaterialCylinders.py
index cd6f59786a0b9b3a53da4fac31f74397d1c646b4..67493a58b425d42f264b22a74d8028e8fc6a1279 100755
--- a/auto/FigExamples/scatter2d/BiMaterialCylinders.py
+++ b/auto/FigExamples/scatter2d/BiMaterialCylinders.py
@@ -48,7 +48,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/BoxesWithSpecularPeak.py b/auto/FigExamples/scatter2d/BoxesWithSpecularPeak.py
index e777db9f39cf157713653cd681d0371ba39d80bf..4cfe9c2f200b609825b1f2399ef80121eeee23fa 100755
--- a/auto/FigExamples/scatter2d/BoxesWithSpecularPeak.py
+++ b/auto/FigExamples/scatter2d/BoxesWithSpecularPeak.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/BroadSpecular.py b/auto/FigExamples/scatter2d/BroadSpecular.py
index 2f28b4ea06487f9cdfbaaab8fb1d833ba760d715..b77d8653e4f831073bb712796196c2fcaa0b98c1 100755
--- a/auto/FigExamples/scatter2d/BroadSpecular.py
+++ b/auto/FigExamples/scatter2d/BroadSpecular.py
@@ -14,7 +14,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_4)
 
diff --git a/auto/FigExamples/scatter2d/CorrelatedRoughness.py b/auto/FigExamples/scatter2d/CorrelatedRoughness.py
index b6277d248f7b9dceb5157f1f61c0aeac60ca4b0d..53a59e5ae6f2d09948fc71187939a7135dbed276 100755
--- a/auto/FigExamples/scatter2d/CorrelatedRoughness.py
+++ b/auto/FigExamples/scatter2d/CorrelatedRoughness.py
@@ -30,7 +30,7 @@ def get_sample():
     l_part_b = ba.Layer(material_part_b, 5*nm, roughness)
     l_substrate = ba.Layer(material_substrate, roughness)
 
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
 
     # adding layers
     my_sample.addLayer(l_ambience)
diff --git a/auto/FigExamples/scatter2d/CosineRipplesAtRectLattice.py b/auto/FigExamples/scatter2d/CosineRipplesAtRectLattice.py
index 6e4af17ebe9da839fa6ff07594b5e915fab8ef75..29a5662c6aa637320aa4b080621add120f5a3335 100755
--- a/auto/FigExamples/scatter2d/CosineRipplesAtRectLattice.py
+++ b/auto/FigExamples/scatter2d/CosineRipplesAtRectLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/CustomFormFactor.py b/auto/FigExamples/scatter2d/CustomFormFactor.py
index 4767ae3c13dab5f0635a2d61e6470c4b53bd32a4..269761e4fa74edbd3140b04288169ff363af4cde 100755
--- a/auto/FigExamples/scatter2d/CustomFormFactor.py
+++ b/auto/FigExamples/scatter2d/CustomFormFactor.py
@@ -68,7 +68,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # assemble sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/scatter2d/CylindersAndPrisms.py b/auto/FigExamples/scatter2d/CylindersAndPrisms.py
index e0f0804c8f68d73116dca0ffac0aba8c28c130b0..8be1fb2c451c1c71f714b3adb594432e79343d87 100755
--- a/auto/FigExamples/scatter2d/CylindersAndPrisms.py
+++ b/auto/FigExamples/scatter2d/CylindersAndPrisms.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/CylindersInAverageLayer.py b/auto/FigExamples/scatter2d/CylindersInAverageLayer.py
index d6ec3bbf82e948c302d7f3eeadbbc61facdfe039..a05acb0f4181ad74af92ff795c326209d4ea2c57 100755
--- a/auto/FigExamples/scatter2d/CylindersInAverageLayer.py
+++ b/auto/FigExamples/scatter2d/CylindersInAverageLayer.py
@@ -35,7 +35,7 @@ def get_sample(cyl_height=5*nm):
     intermediate_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(intermediate_layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/FigExamples/scatter2d/CylindersInBA.py b/auto/FigExamples/scatter2d/CylindersInBA.py
index 481cee2c25ad910a6890c26dcb998ad738ef29a2..e92c9babad44849c1fbef35e84877562c67da9c1 100755
--- a/auto/FigExamples/scatter2d/CylindersInBA.py
+++ b/auto/FigExamples/scatter2d/CylindersInBA.py
@@ -33,7 +33,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/FigExamples/scatter2d/DodecahedraSAS.py b/auto/FigExamples/scatter2d/DodecahedraSAS.py
index 74a40638b9cdae3dc89e3066163ebd51b814f617..668c560a31862c3d1f8406fa574ed2fe2c8d1fdd 100755
--- a/auto/FigExamples/scatter2d/DodecahedraSAS.py
+++ b/auto/FigExamples/scatter2d/DodecahedraSAS.py
@@ -21,7 +21,7 @@ def get_sample():
     solution_layer.addLayout(layout)
 
     # Flat sample layer sandwiched between semi-infinite vacuum layers:
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(solution_layer)
     sample.addLayer(ba.Layer(vacuum))
diff --git a/auto/FigExamples/scatter2d/FindPeaks.py b/auto/FigExamples/scatter2d/FindPeaks.py
index 481f900f9d18a9eaf7b2e6d2698bfa3246869d3e..9947c696afe5446ef4240ba1c346591323fe3285 100755
--- a/auto/FigExamples/scatter2d/FindPeaks.py
+++ b/auto/FigExamples/scatter2d/FindPeaks.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/scatter2d/HalfSpheresInAverageTopLayer.py b/auto/FigExamples/scatter2d/HalfSpheresInAverageTopLayer.py
index c7852393a4f3017e33472c9bf6a39f052cbb6596..d4c8c87211abd293fdad33a3c197633adb51303e 100755
--- a/auto/FigExamples/scatter2d/HalfSpheresInAverageTopLayer.py
+++ b/auto/FigExamples/scatter2d/HalfSpheresInAverageTopLayer.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/HexagonalLatticesWithBasis.py b/auto/FigExamples/scatter2d/HexagonalLatticesWithBasis.py
index e464a70e5011998626e8b5a407375b81ebd385ce..3c7d1269b1a4b3e4f72f1328788300f1e3965e89 100755
--- a/auto/FigExamples/scatter2d/HexagonalLatticesWithBasis.py
+++ b/auto/FigExamples/scatter2d/HexagonalLatticesWithBasis.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Interference1DLattice.py b/auto/FigExamples/scatter2d/Interference1DLattice.py
index ef846a4b0d32726a3db9f58ab3fff0c84323782d..c7d4d610d862bf068ffa13f47788816992a89498 100755
--- a/auto/FigExamples/scatter2d/Interference1DLattice.py
+++ b/auto/FigExamples/scatter2d/Interference1DLattice.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Interference1DRadialParacrystal.py b/auto/FigExamples/scatter2d/Interference1DRadialParacrystal.py
index 6c4342cb5bb8e7588f904f07122a7375aefbb4dc..3e34a775a14dd97e53ffe81e496eaa660bf02d54 100755
--- a/auto/FigExamples/scatter2d/Interference1DRadialParacrystal.py
+++ b/auto/FigExamples/scatter2d/Interference1DRadialParacrystal.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Interference2DCenteredSquareLattice.py b/auto/FigExamples/scatter2d/Interference2DCenteredSquareLattice.py
index c2dadb098886c79b279c788dbb59883e0bd47606..df310ac9113272bed30f768acd9bf88749dde028 100755
--- a/auto/FigExamples/scatter2d/Interference2DCenteredSquareLattice.py
+++ b/auto/FigExamples/scatter2d/Interference2DCenteredSquareLattice.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Interference2DParacrystal.py b/auto/FigExamples/scatter2d/Interference2DParacrystal.py
index 22c86d582af0cb6955fac3eb7ed9539803d025b7..580b0acad19371dffb78879644e489076e0384f6 100755
--- a/auto/FigExamples/scatter2d/Interference2DParacrystal.py
+++ b/auto/FigExamples/scatter2d/Interference2DParacrystal.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Interference2DRotatedSquareLattice.py b/auto/FigExamples/scatter2d/Interference2DRotatedSquareLattice.py
index 36ffc860eb1f7bcbf6e58896fc2394ba934e0bb8..43512af8f7dfead12b2381935a7e57a1575e33d9 100755
--- a/auto/FigExamples/scatter2d/Interference2DRotatedSquareLattice.py
+++ b/auto/FigExamples/scatter2d/Interference2DRotatedSquareLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Interference2DSquareFiniteLattice.py b/auto/FigExamples/scatter2d/Interference2DSquareFiniteLattice.py
index ebf405312a30541bddcc0cc9fa242701ea0b1697..ded28762f001e2aebc72cf9ad45771928774d134 100755
--- a/auto/FigExamples/scatter2d/Interference2DSquareFiniteLattice.py
+++ b/auto/FigExamples/scatter2d/Interference2DSquareFiniteLattice.py
@@ -42,7 +42,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/LargeParticlesFormFactor.py b/auto/FigExamples/scatter2d/LargeParticlesFormFactor.py
index 9a3920ede21e3984b4940e98b7f4ccd2b2a9fdf5..6e6b22bac2470bfe2768af9d3761bdc056597b10 100755
--- a/auto/FigExamples/scatter2d/LargeParticlesFormFactor.py
+++ b/auto/FigExamples/scatter2d/LargeParticlesFormFactor.py
@@ -33,7 +33,7 @@ def get_sample(cylinder_radius, cylinder_height):
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/scatter2d/LatticeOrientationDistribution.py b/auto/FigExamples/scatter2d/LatticeOrientationDistribution.py
index f1fb39bd241268ea425d34385ae7d3e83e114051..847683c12140d60893a56f7179ba27be04714a9b 100755
--- a/auto/FigExamples/scatter2d/LatticeOrientationDistribution.py
+++ b/auto/FigExamples/scatter2d/LatticeOrientationDistribution.py
@@ -29,7 +29,7 @@ def get_sample():
         layout.setTotalParticleSurfaceDensity(0.1*parsample.weight)
         toplayer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(toplayer)
     sample.addLayer(substrate)
     return sample
diff --git a/auto/FigExamples/scatter2d/MagneticCylinders1.py b/auto/FigExamples/scatter2d/MagneticCylinders1.py
index 78fc18db5af9d8d7e9498dd4e4aef98ed28beeb4..13786e861aa6107cb13f66ebb453d15a1c5392b7 100755
--- a/auto/FigExamples/scatter2d/MagneticCylinders1.py
+++ b/auto/FigExamples/scatter2d/MagneticCylinders1.py
@@ -25,7 +25,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/FigExamples/scatter2d/MagneticCylinders2.py b/auto/FigExamples/scatter2d/MagneticCylinders2.py
index b4d5753112670e5aa7c073523826a1d32b515949..edc4609ea1ec41490e1c1ac2c11272e723c5579c 100755
--- a/auto/FigExamples/scatter2d/MagneticCylinders2.py
+++ b/auto/FigExamples/scatter2d/MagneticCylinders2.py
@@ -24,7 +24,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/FigExamples/scatter2d/MagneticSpheres.py b/auto/FigExamples/scatter2d/MagneticSpheres.py
index 238576d8fc703a7b515bf8f62f90d9487280a27f..a93849a3c589bf2645dad2eeec3543bb31963333 100755
--- a/auto/FigExamples/scatter2d/MagneticSpheres.py
+++ b/auto/FigExamples/scatter2d/MagneticSpheres.py
@@ -30,7 +30,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
     layer_2.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Mesocrystal.py b/auto/FigExamples/scatter2d/Mesocrystal.py
index c7875d051f6450b7065a282096ae222c55f7aff9..8b2db9733bf6bb7d67cacfa1b5dd9601c6f1f435 100755
--- a/auto/FigExamples/scatter2d/Mesocrystal.py
+++ b/auto/FigExamples/scatter2d/Mesocrystal.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Mesocrystal2.py b/auto/FigExamples/scatter2d/Mesocrystal2.py
index 47c531a22f8ac88b81f56aca30fd43327b767a54..41a779080d3774a8ae1b98f400ac514e788d3483 100755
--- a/auto/FigExamples/scatter2d/Mesocrystal2.py
+++ b/auto/FigExamples/scatter2d/Mesocrystal2.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Mesocrystal3.py b/auto/FigExamples/scatter2d/Mesocrystal3.py
index 11570329a4a2bb3a2f2ea8d0cb755ec633d34aeb..6eaa23b90dd4ee7b277d688ab2682a83a3e1f65a 100755
--- a/auto/FigExamples/scatter2d/Mesocrystal3.py
+++ b/auto/FigExamples/scatter2d/Mesocrystal3.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/Mesocrystal4.py b/auto/FigExamples/scatter2d/Mesocrystal4.py
index 2e10098f86ac242298bab25daf2f390a558e6cba..2cacdf9ce17824339da7875f5ac1ec0f7e9625f1 100755
--- a/auto/FigExamples/scatter2d/Mesocrystal4.py
+++ b/auto/FigExamples/scatter2d/Mesocrystal4.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/ParticleAcrossInterface.py b/auto/FigExamples/scatter2d/ParticleAcrossInterface.py
index 6562c7356b9e16c1b984e9a4ebf9f433b26c467c..3561c809735790815816c01cc83543f5a66c1224 100755
--- a/auto/FigExamples/scatter2d/ParticleAcrossInterface.py
+++ b/auto/FigExamples/scatter2d/ParticleAcrossInterface.py
@@ -28,7 +28,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/PolarizedSANS.py b/auto/FigExamples/scatter2d/PolarizedSANS.py
index 2d5db352a80664da74084eba3bde579d8a1deedf..735308d8a6632afa21c625df7b4776624263aa8f 100755
--- a/auto/FigExamples/scatter2d/PolarizedSANS.py
+++ b/auto/FigExamples/scatter2d/PolarizedSANS.py
@@ -42,7 +42,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/FigExamples/scatter2d/PolydisperseCylinders.py b/auto/FigExamples/scatter2d/PolydisperseCylinders.py
index 691a6aa02965c6325c5e0943ea160dbf50baa53b..327cc71a765a132fee1c58e1824abecd0051b90c 100755
--- a/auto/FigExamples/scatter2d/PolydisperseCylinders.py
+++ b/auto/FigExamples/scatter2d/PolydisperseCylinders.py
@@ -23,7 +23,7 @@ def get_sample():
     layer = ba.Layer(vacuum)
     layer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/FigExamples/scatter2d/PositionVariance.py b/auto/FigExamples/scatter2d/PositionVariance.py
index 72e359657a7ede83fb3773ac929ef2a6716008ca..4116fff88da13937c03b9fc231665336b3bcc3b7 100755
--- a/auto/FigExamples/scatter2d/PositionVariance.py
+++ b/auto/FigExamples/scatter2d/PositionVariance.py
@@ -36,7 +36,7 @@ def get_sample(hasVariance, xi):
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/auto/FigExamples/scatter2d/RectangularGrating.py b/auto/FigExamples/scatter2d/RectangularGrating.py
index 74504c8213b11abd5e1875955e779c99e355c281..0177e802aad85f130977278b1177eec6e3b67a5a 100755
--- a/auto/FigExamples/scatter2d/RectangularGrating.py
+++ b/auto/FigExamples/scatter2d/RectangularGrating.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/FigExamples/scatter2d/RotatedPyramids.py b/auto/FigExamples/scatter2d/RotatedPyramids.py
index 53c33fa874bd37fdd80e6615d7c9cbd4f952acef..6af094a039db1225282a868efa1503d94ce1061b 100755
--- a/auto/FigExamples/scatter2d/RotatedPyramids.py
+++ b/auto/FigExamples/scatter2d/RotatedPyramids.py
@@ -35,7 +35,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/RoughAndSpecular.py b/auto/FigExamples/scatter2d/RoughAndSpecular.py
index 34ef03d1f99796b748baa77cc47106a169743524..74ba88fcb8c7570fcb274250f505a5b26bd586cd 100755
--- a/auto/FigExamples/scatter2d/RoughAndSpecular.py
+++ b/auto/FigExamples/scatter2d/RoughAndSpecular.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/FigExamples/scatter2d/SlicedLayer.py b/auto/FigExamples/scatter2d/SlicedLayer.py
index 8d2106d9fc38b57bde1403bb4a8cd4dab41e4a8d..f180e73f24238fb99c23eb9f38735bd1e4994391 100755
--- a/auto/FigExamples/scatter2d/SlicedLayer.py
+++ b/auto/FigExamples/scatter2d/SlicedLayer.py
@@ -31,7 +31,7 @@ def get_sample():
     substrate = ba.Layer(material_substrate)
     substrate.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer1)
     sample.addLayer(substrate)
diff --git a/auto/FigExamples/scatter2d/SpheresAtHexLattice.py b/auto/FigExamples/scatter2d/SpheresAtHexLattice.py
index d85eec755e93ad0afc3ecf552cb865d623e40fc8..8dafd8e81bc0741fe766afc31c0359a3213cbb32 100755
--- a/auto/FigExamples/scatter2d/SpheresAtHexLattice.py
+++ b/auto/FigExamples/scatter2d/SpheresAtHexLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/scatter2d/TriangularRipple.py b/auto/FigExamples/scatter2d/TriangularRipple.py
index fa088903169d6df15ccde9ddb1531a9e8341eb5c..13323b96d9502883da19da3f00cab53419b594e2 100755
--- a/auto/FigExamples/scatter2d/TriangularRipple.py
+++ b/auto/FigExamples/scatter2d/TriangularRipple.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/FigExamples/specular/AlternatingLayers1.py b/auto/FigExamples/specular/AlternatingLayers1.py
index 1b34c68e758a4dc40dd3d1bb3fd689a199cc2ee0..d8b588961c76bb7a127132ad6c1e88e1e8129b96 100755
--- a/auto/FigExamples/specular/AlternatingLayers1.py
+++ b/auto/FigExamples/specular/AlternatingLayers1.py
@@ -22,7 +22,7 @@ def get_sample():
     substrate = ba.Layer(material_Si)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(top_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/FigExamples/specular/Basic.py b/auto/FigExamples/specular/Basic.py
index 29ba132d09ec6ff0c7c10dda129d8df826afd349..f049cfd425fdd9377e3bb76832ca42dd3fba9809 100755
--- a/auto/FigExamples/specular/Basic.py
+++ b/auto/FigExamples/specular/Basic.py
@@ -18,7 +18,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(film)
     sample.addLayer(substrate_layer)
diff --git a/auto/FigExamples/specular/MagneticLayer.py b/auto/FigExamples/specular/MagneticLayer.py
index 34a56843c8499e19af8cf6402166ae11c7e9faff..5e3e95d1a979f1533bdec5887f7c50b27eaea12a 100755
--- a/auto/FigExamples/specular/MagneticLayer.py
+++ b/auto/FigExamples/specular/MagneticLayer.py
@@ -26,7 +26,7 @@ def get_sample():
     layer_3 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/FigExamples/specular/MagneticLayerImperfect.py b/auto/FigExamples/specular/MagneticLayerImperfect.py
index 291bef064ebadb77297ff3c11734cf0f57c82e4e..2c181204fdddacc1bc51e8b7be7edd40067dc838 100755
--- a/auto/FigExamples/specular/MagneticLayerImperfect.py
+++ b/auto/FigExamples/specular/MagneticLayerImperfect.py
@@ -31,7 +31,7 @@ def get_sample():
     layer_substrate = ba.Layer(material_substrate, roughness)
 
     # Multilayer
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_vacuum)
     sample.addLayer(layer_Pd)
     sample.addLayer(layer_Fe)
diff --git a/auto/FigExamples/specular/PolarizedSpinAsymmetry.py b/auto/FigExamples/specular/PolarizedSpinAsymmetry.py
index b8ec2ff1dc84d8a0660f13f8fbf3ac12f562455e..8d312c3d7cf0e9e298847151e59dad7ab7613679 100755
--- a/auto/FigExamples/specular/PolarizedSpinAsymmetry.py
+++ b/auto/FigExamples/specular/PolarizedSpinAsymmetry.py
@@ -60,7 +60,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/FigExamples/specular/RoughnessModel.py b/auto/FigExamples/specular/RoughnessModel.py
index 4699a7a31cdd2707fce0b9d75d3ba9d070aae1f0..6ec1272711e93f6bf2e002a019c85872c4511db1 100755
--- a/auto/FigExamples/specular/RoughnessModel.py
+++ b/auto/FigExamples/specular/RoughnessModel.py
@@ -27,7 +27,7 @@ def get_sample(interlayer):
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # create sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/FigExamples/specular/SpecularSimulationWithRoughness.py b/auto/FigExamples/specular/SpecularSimulationWithRoughness.py
index 305bfaab0933fed529a79e279b0254b1c36ab02a..1b60e1888124891010910dfc3cb9e5a65b24fbba 100755
--- a/auto/FigExamples/specular/SpecularSimulationWithRoughness.py
+++ b/auto/FigExamples/specular/SpecularSimulationWithRoughness.py
@@ -28,7 +28,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/FigExamples/varia/Depthprobe1.py b/auto/FigExamples/varia/Depthprobe1.py
index 569593239c174316b40147da27f3ddab07de8a86..353ae3f42fda24349447eeb5d1e81bc25555643d 100755
--- a/auto/FigExamples/varia/Depthprobe1.py
+++ b/auto/FigExamples/varia/Depthprobe1.py
@@ -14,7 +14,7 @@ def get_sample():
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/FigExamples/varia/MaterialProfile.py b/auto/FigExamples/varia/MaterialProfile.py
index dc16882b36a95b0ff1caa53015579ca523a4d298..ad1bc2b08de43716c329fdfb82d32644c92149fb 100755
--- a/auto/FigExamples/varia/MaterialProfile.py
+++ b/auto/FigExamples/varia/MaterialProfile.py
@@ -32,7 +32,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     
     for _ in range(4):
diff --git a/auto/FigExamples/varia/MaterialProfileWithParticles.py b/auto/FigExamples/varia/MaterialProfileWithParticles.py
index c28c365581bb648032d2cbf7a7ecdb3596c68143..6012f7362567d7dd3f0f24a5587ac2afdbd819e5 100755
--- a/auto/FigExamples/varia/MaterialProfileWithParticles.py
+++ b/auto/FigExamples/varia/MaterialProfileWithParticles.py
@@ -30,7 +30,7 @@ def get_sample():
     ambient_layer.setNumberOfSlices(20)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/FigExamples/varia/OpaqueProfile1.py b/auto/FigExamples/varia/OpaqueProfile1.py
index d67a2809b553e18bf4efb423d64949c8bbc70fdb..7fadb7f23113e5dbd5a3e235da36ec398fe8e409 100755
--- a/auto/FigExamples/varia/OpaqueProfile1.py
+++ b/auto/FigExamples/varia/OpaqueProfile1.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_bot = ba.Layer(material_vac)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_top)
     sample.addLayer(layer_1)
     sample.addLayer(layer_bot)
diff --git a/auto/FigExamples/varia/Resonator.py b/auto/FigExamples/varia/Resonator.py
index 0763cf1efd9a91492c8c575b7bd78a9422bfe8b6..9bc0908110ecd7a384333ae3e150d2b8816794d9 100755
--- a/auto/FigExamples/varia/Resonator.py
+++ b/auto/FigExamples/varia/Resonator.py
@@ -52,7 +52,7 @@ def get_sample():
     layer_6 = ba.Layer(material_D2O)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/FigExamples/varia/RoughSurface.py b/auto/FigExamples/varia/RoughSurface.py
index 18bca802f96337cb92562146458014bdcac25025..6cabc9bbd02695f6a35dc661a0387a3879fe9bd2 100755
--- a/auto/FigExamples/varia/RoughSurface.py
+++ b/auto/FigExamples/varia/RoughSurface.py
@@ -81,7 +81,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate, roughness_sub)
 
     # adding layers
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
     my_sample.addLayer(l_ambience)
     my_sample.addLayer(l_layer)
     my_sample.addLayer(l_substrate)
diff --git a/auto/FigExamples/varia/Transmission.py b/auto/FigExamples/varia/Transmission.py
index f268b102b09f6ad972d0f9932a1dd840cb86f0db..684c8d59491d9ff9ec205ab6528c3409f420e7e2 100755
--- a/auto/FigExamples/varia/Transmission.py
+++ b/auto/FigExamples/varia/Transmission.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/FigExamples/varia/TransmissionVsAlpha.py b/auto/FigExamples/varia/TransmissionVsAlpha.py
index 69b0d2aa0dbbc1ae661a7804d32c12c6e6abe2a7..0a81b2d0fbb5777920f2af0b2f554e50771d1739 100755
--- a/auto/FigExamples/varia/TransmissionVsAlpha.py
+++ b/auto/FigExamples/varia/TransmissionVsAlpha.py
@@ -14,7 +14,7 @@ def get_sample(depth):
     material_A = ba.RefractiveMaterial("A", 5e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/FigExamples/varia/TransmissionVsDepth.py b/auto/FigExamples/varia/TransmissionVsDepth.py
index 28731327fe3b4553520e439d8b43cfb89d769849..2a68587b64adbc17eb2d44a70e506b2cc24ff6f6 100755
--- a/auto/FigExamples/varia/TransmissionVsDepth.py
+++ b/auto/FigExamples/varia/TransmissionVsDepth.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/MiniExamples/bayesian/likelihood_sampling.py b/auto/MiniExamples/bayesian/likelihood_sampling.py
index 39b9626ac271c610627fffc2d6d6150c55d27a3b..903512617247647e38f396139703bcfb936a9d2f 100755
--- a/auto/MiniExamples/bayesian/likelihood_sampling.py
+++ b/auto/MiniExamples/bayesian/likelihood_sampling.py
@@ -33,7 +33,7 @@ def get_sample(ni_thickness, ti_thickness):
     ni_layer = ba.Layer(material_ni, ni_thickness)
     ti_layer = ba.Layer(material_ti, ti_thickness)
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py b/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py
index db9ec0f8854455cb92c23084e586d38d0569e32d..307aaa0e59aa9a731ad9fd0f2fec7724c7bf9719 100755
--- a/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py
+++ b/auto/MiniExamples/fit/scatter2d/consecutive_fitting.py
@@ -33,7 +33,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py b/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py
index e7f44ceb8c4e1238e4c9f5b5e8c1f9defd328419..eef7726e1b813179c94fc6b768e8b87acb441c7a 100755
--- a/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py
+++ b/auto/MiniExamples/fit/scatter2d/expfit_galaxi.py
@@ -82,7 +82,7 @@ def get_sample(P):
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/auto/MiniExamples/fit/scatter2d/fit2d.py b/auto/MiniExamples/fit/scatter2d/fit2d.py
index fc1a3f2be06863af3486f8559b4fd7cef2c08ed3..69c146185009bc86e406c072f6e29b429ccdd264 100755
--- a/auto/MiniExamples/fit/scatter2d/fit2d.py
+++ b/auto/MiniExamples/fit/scatter2d/fit2d.py
@@ -17,7 +17,7 @@ def get_simulation(P):
 
     layer = ba.Layer(ba.RefractiveMaterial("Vacuum", 0, 0))
     layer.addLayout(ba.ParticleLayout(sphere))
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     n = 11
diff --git a/auto/MiniExamples/fit/scatter2d/gisas_model1.py b/auto/MiniExamples/fit/scatter2d/gisas_model1.py
index 2fc5c00fc6134ea72a7825634bb82ffb3d469bf1..c9e639bd0fdf5bde3385dc43148c74cb6da8a0f1 100755
--- a/auto/MiniExamples/fit/scatter2d/gisas_model1.py
+++ b/auto/MiniExamples/fit/scatter2d/gisas_model1.py
@@ -24,7 +24,7 @@ def get_sample(P):
     layer_1.addLayout(layout)
     layer_2 = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     return sample
diff --git a/auto/MiniExamples/fit/scatter2d/hardcode_galaxi.py b/auto/MiniExamples/fit/scatter2d/hardcode_galaxi.py
index dce5578cbb55810c1f2f542a4e3864514d096969..d769f8596a1d1ea78da4a9abe0ea4718c70e9f87 100755
--- a/auto/MiniExamples/fit/scatter2d/hardcode_galaxi.py
+++ b/auto/MiniExamples/fit/scatter2d/hardcode_galaxi.py
@@ -64,7 +64,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/auto/MiniExamples/fit/scatter2d/minimizer_settings.py b/auto/MiniExamples/fit/scatter2d/minimizer_settings.py
index 8720930d49a8fb48c568bf26c5d0ddf032e18422..fd0f04cc3fbd2dde86d7dc537793d066b2f08c8c 100755
--- a/auto/MiniExamples/fit/scatter2d/minimizer_settings.py
+++ b/auto/MiniExamples/fit/scatter2d/minimizer_settings.py
@@ -35,7 +35,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/fit/scatter2d/model1_cylinders.py b/auto/MiniExamples/fit/scatter2d/model1_cylinders.py
index 9fd6182064eb7913889f5c2a0f612fa032890611..8216031910f1a82f13c39cf8fd637e3d11dccdca 100755
--- a/auto/MiniExamples/fit/scatter2d/model1_cylinders.py
+++ b/auto/MiniExamples/fit/scatter2d/model1_cylinders.py
@@ -23,7 +23,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py b/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py
index f1d892a52d9e0cfae62858108d176f4bc55a63dd..3d2c95aa08cba8a0308b3b300ecc784b95327704 100755
--- a/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py
+++ b/auto/MiniExamples/fit/scatter2d/model2_hexlattice.py
@@ -29,7 +29,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/fit/scatter2d/multiple_datasets.py b/auto/MiniExamples/fit/scatter2d/multiple_datasets.py
index 957e9675f947366e9c85d07be09dc1c4bd320aba..468f926e50e7d355c079d23dddb62dbb61aac901 100755
--- a/auto/MiniExamples/fit/scatter2d/multiple_datasets.py
+++ b/auto/MiniExamples/fit/scatter2d/multiple_datasets.py
@@ -31,7 +31,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/fit/specular/Honeycomb_fit.py b/auto/MiniExamples/fit/specular/Honeycomb_fit.py
index 7b5937050a8a36f91c102f2b33064f0527726183..15bafea356383d06a2c4b36548ff38dcc574776a 100755
--- a/auto/MiniExamples/fit/specular/Honeycomb_fit.py
+++ b/auto/MiniExamples/fit/specular/Honeycomb_fit.py
@@ -63,7 +63,7 @@ def get_sample(P, sign, T):
     l_SiO2 = ba.Layer(material_SiO2, P["t_SiO2"]*angstrom, rSiO2)
     l_Si = ba.Layer(material_Si, rSi)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
 
     sample.addLayer(l_Air)
     sample.addLayer(l_PyOx)
diff --git a/auto/MiniExamples/fit/specular/PolarizedSpinAsymmetry.py b/auto/MiniExamples/fit/specular/PolarizedSpinAsymmetry.py
index 09a5b85ddc1eb85859ac8d5f0586ce04192c4cfa..904a237c202c8d300d435e0cfbe442c72b81dd7e 100755
--- a/auto/MiniExamples/fit/specular/PolarizedSpinAsymmetry.py
+++ b/auto/MiniExamples/fit/specular/PolarizedSpinAsymmetry.py
@@ -59,7 +59,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/MiniExamples/fit/specular/Pt_layer_fit.py b/auto/MiniExamples/fit/specular/Pt_layer_fit.py
index 87ef4678a46325ddb42b7e26ac50cac13167664f..d35f48742e50fe5274ecc89cc8bf7693c740beb8 100755
--- a/auto/MiniExamples/fit/specular/Pt_layer_fit.py
+++ b/auto/MiniExamples/fit/specular/Pt_layer_fit.py
@@ -40,7 +40,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_pt/nm"], r_pt)
     substrate_layer = ba.Layer(material_substrate, r_si)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/MiniExamples/fit/specular/Specular1Par.py b/auto/MiniExamples/fit/specular/Specular1Par.py
index 304351e819f18c74b5a642c525701c757e86f0e1..df62ff3f5f2e41df61079cf1397bf653b30cea58 100755
--- a/auto/MiniExamples/fit/specular/Specular1Par.py
+++ b/auto/MiniExamples/fit/specular/Specular1Par.py
@@ -30,7 +30,7 @@ def get_sample(P):
     layer_Ti = ba.Layer(material_Ti, P["thickness_Ti"])
     layer_Ni = ba.Layer(material_Ni, 70*angstrom)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     for _ in range(10):
         sample.addLayer(layer_Ti)
diff --git a/auto/MiniExamples/fit/specular/TREFF_Ni_film.py b/auto/MiniExamples/fit/specular/TREFF_Ni_film.py
index c86a05ce2897b9c54995065c771263eca181b3b1..4f362f9c421d3efa92da081cd505f570abfb470d 100755
--- a/auto/MiniExamples/fit/specular/TREFF_Ni_film.py
+++ b/auto/MiniExamples/fit/specular/TREFF_Ni_film.py
@@ -35,7 +35,7 @@ def get_sample(P):
     layer_Ni = ba.Layer(material_Ni_58, P["thickness"], roughness_Ni)
     substrate = ba.Layer(material_SiO2, roughness_Substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer_Ni)
     sample.addLayer(substrate)
diff --git a/auto/MiniExamples/offspec/Offspec1.py b/auto/MiniExamples/offspec/Offspec1.py
index adc32783d54d6fe65e6dc3fe9c7ae6561d013770..927efc8d1e8cf409bcca16cb167d25b1b5574b05 100755
--- a/auto/MiniExamples/offspec/Offspec1.py
+++ b/auto/MiniExamples/offspec/Offspec1.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/offspec/OffspecLambda.py b/auto/MiniExamples/offspec/OffspecLambda.py
index 4306e7928d0dcdbd000b2acc0835136cdb594a36..5d0710d81ca30180edbd700e980f37caab4d82ad 100755
--- a/auto/MiniExamples/offspec/OffspecLambda.py
+++ b/auto/MiniExamples/offspec/OffspecLambda.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/offspec/OffspecResolved.py b/auto/MiniExamples/offspec/OffspecResolved.py
index dd76ab5cdeddc736da6cd27cc24fffc2ebc645ee..bbda16f0e93f6bd94c85360f42af0474f15a5ff4 100755
--- a/auto/MiniExamples/offspec/OffspecResolved.py
+++ b/auto/MiniExamples/offspec/OffspecResolved.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/ApproximationDA.py b/auto/MiniExamples/scatter2d/ApproximationDA.py
index 3e9046860f21e5f8142b085eeb1a2c031bc65357..fa37b60d3554ec8a1d8303d571438a2ad89dd0dc 100755
--- a/auto/MiniExamples/scatter2d/ApproximationDA.py
+++ b/auto/MiniExamples/scatter2d/ApproximationDA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/ApproximationLMA.py b/auto/MiniExamples/scatter2d/ApproximationLMA.py
index db974e1a1031fc8c35f7be256c0e3993c3ce7857..8f0839367ba3734f32fc101cb045ae16dc43604b 100755
--- a/auto/MiniExamples/scatter2d/ApproximationLMA.py
+++ b/auto/MiniExamples/scatter2d/ApproximationLMA.py
@@ -51,7 +51,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/ApproximationSSCA.py b/auto/MiniExamples/scatter2d/ApproximationSSCA.py
index 8d61f2bac120734a230768c260841de45560e136..41d2de243da2270cf7cea784501f3717bbc64143 100755
--- a/auto/MiniExamples/scatter2d/ApproximationSSCA.py
+++ b/auto/MiniExamples/scatter2d/ApproximationSSCA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/AxesInDifferentUnits.py b/auto/MiniExamples/scatter2d/AxesInDifferentUnits.py
index 823f13453f1acd211b4ca2c6cbc265f61d8a1661..60e34dc310c39fb7ac5be8f44eaa23805db1db7d 100755
--- a/auto/MiniExamples/scatter2d/AxesInDifferentUnits.py
+++ b/auto/MiniExamples/scatter2d/AxesInDifferentUnits.py
@@ -37,7 +37,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/auto/MiniExamples/scatter2d/BiMaterialCylinders.py b/auto/MiniExamples/scatter2d/BiMaterialCylinders.py
index 915eddccc288222baccbf29c51d7d6ceb3b7cc19..6a2df8ac4bc8be6c182dd2db63b5ae0d7b2e816e 100755
--- a/auto/MiniExamples/scatter2d/BiMaterialCylinders.py
+++ b/auto/MiniExamples/scatter2d/BiMaterialCylinders.py
@@ -48,7 +48,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py b/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py
index 5df1a1b16e207bd53eac1f850306f65ee15c421f..16e19b085db6836b4412931005cef1cf0b36694c 100755
--- a/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py
+++ b/auto/MiniExamples/scatter2d/BoxesWithSpecularPeak.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/BroadSpecular.py b/auto/MiniExamples/scatter2d/BroadSpecular.py
index f492f8ac125469670fbda85ece8022e841d0cd4c..9b0ffbc318fac6f552112358302e7d121d79be31 100755
--- a/auto/MiniExamples/scatter2d/BroadSpecular.py
+++ b/auto/MiniExamples/scatter2d/BroadSpecular.py
@@ -14,7 +14,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_4)
 
diff --git a/auto/MiniExamples/scatter2d/CorrelatedRoughness.py b/auto/MiniExamples/scatter2d/CorrelatedRoughness.py
index c5bf1e6fef5b4ef757540e89b9784e11daf00a89..af2644904e81a910f85a96d133071b4d6308905e 100755
--- a/auto/MiniExamples/scatter2d/CorrelatedRoughness.py
+++ b/auto/MiniExamples/scatter2d/CorrelatedRoughness.py
@@ -30,7 +30,7 @@ def get_sample():
     l_part_b = ba.Layer(material_part_b, 5*nm, roughness)
     l_substrate = ba.Layer(material_substrate, roughness)
 
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
 
     # adding layers
     my_sample.addLayer(l_ambience)
diff --git a/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py b/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py
index d5b3458b84502cdbd5ba472caf288bf5a286be40..77a801080388345672cbea85ff01e6e076a916b9 100755
--- a/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py
+++ b/auto/MiniExamples/scatter2d/CosineRipplesAtRectLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/CustomFormFactor.py b/auto/MiniExamples/scatter2d/CustomFormFactor.py
index 50d9e3c33fa8be6f7ccb24afd436ded4348b5147..672e2dc485c9cd111f164dad2010aa8cd2773bc9 100755
--- a/auto/MiniExamples/scatter2d/CustomFormFactor.py
+++ b/auto/MiniExamples/scatter2d/CustomFormFactor.py
@@ -68,7 +68,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # assemble sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/scatter2d/CylindersAndPrisms.py b/auto/MiniExamples/scatter2d/CylindersAndPrisms.py
index fc3797921f044a1131ae4b1b72756d35d458dd14..e67d9c977933e2d65ee7bbaa6791c2a50819c806 100755
--- a/auto/MiniExamples/scatter2d/CylindersAndPrisms.py
+++ b/auto/MiniExamples/scatter2d/CylindersAndPrisms.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py b/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py
index 675f60bad7c03462774096ec1202aa564e5832cb..6cd3b72d49d7c126566f3d637418fc4f83a45745 100755
--- a/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py
+++ b/auto/MiniExamples/scatter2d/CylindersInAverageLayer.py
@@ -35,7 +35,7 @@ def get_sample(cyl_height=5*nm):
     intermediate_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(intermediate_layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/MiniExamples/scatter2d/CylindersInBA.py b/auto/MiniExamples/scatter2d/CylindersInBA.py
index a77f98e88d90d3b28913ef705984c7abe6103b4c..07cdea0e6f55142878f6630ca95fd12447f7f096 100755
--- a/auto/MiniExamples/scatter2d/CylindersInBA.py
+++ b/auto/MiniExamples/scatter2d/CylindersInBA.py
@@ -33,7 +33,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/MiniExamples/scatter2d/DodecahedraSAS.py b/auto/MiniExamples/scatter2d/DodecahedraSAS.py
index db0c9d1058094a750178898a6f45ebe02f06e42b..5a1f500f6f7df8743b8243f5b80e3f4ca7776e69 100755
--- a/auto/MiniExamples/scatter2d/DodecahedraSAS.py
+++ b/auto/MiniExamples/scatter2d/DodecahedraSAS.py
@@ -21,7 +21,7 @@ def get_sample():
     solution_layer.addLayout(layout)
 
     # Flat sample layer sandwiched between semi-infinite vacuum layers:
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(solution_layer)
     sample.addLayer(ba.Layer(vacuum))
diff --git a/auto/MiniExamples/scatter2d/FindPeaks.py b/auto/MiniExamples/scatter2d/FindPeaks.py
index c91d672cd9060eca04759e3eb6ad0a1de7614613..2fb440085c39e894445f0338a6cf76ae9d989fb5 100755
--- a/auto/MiniExamples/scatter2d/FindPeaks.py
+++ b/auto/MiniExamples/scatter2d/FindPeaks.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py b/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py
index 0054494e0869364bde86a836d1d797e8ccfdae17..32e10771621d15f8eb674003b2bb619f2a25f5ba 100755
--- a/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py
+++ b/auto/MiniExamples/scatter2d/HalfSpheresInAverageTopLayer.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py b/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py
index 09d436194efb4d55daeda6982b038d3b51b8f0b7..6f5fd1473a317f9122c4164b2182df2e29336735 100755
--- a/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py
+++ b/auto/MiniExamples/scatter2d/HexagonalLatticesWithBasis.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Interference1DLattice.py b/auto/MiniExamples/scatter2d/Interference1DLattice.py
index b3c193577136fdfc5560ea8a67f71e5156d07d26..a4092b49b6449ce9ba9f2bb115ad93477099527c 100755
--- a/auto/MiniExamples/scatter2d/Interference1DLattice.py
+++ b/auto/MiniExamples/scatter2d/Interference1DLattice.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py b/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py
index ca146db531e04200640392737a461229cd0a2f7c..e68192878233162e8eb77ea233f4a0fe95982ec1 100755
--- a/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py
+++ b/auto/MiniExamples/scatter2d/Interference1DRadialParacrystal.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py b/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py
index 6a35eb93697db06220cfb27e67526de4514186bd..4bc0ebdc8f8a0a335c0121a01a7faa9fae1b132c 100755
--- a/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py
+++ b/auto/MiniExamples/scatter2d/Interference2DCenteredSquareLattice.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Interference2DParacrystal.py b/auto/MiniExamples/scatter2d/Interference2DParacrystal.py
index 82f86fa87df77f17e90b650536880a0b30508297..7d373ead7910f1b7bf6036c8899b34514a59addd 100755
--- a/auto/MiniExamples/scatter2d/Interference2DParacrystal.py
+++ b/auto/MiniExamples/scatter2d/Interference2DParacrystal.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py b/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py
index 0b873da131be9730e4423173d008e6d486430852..45a2dadccf703de49089104b85904a247ab69d91 100755
--- a/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py
+++ b/auto/MiniExamples/scatter2d/Interference2DRotatedSquareLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py b/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py
index 96b2d0fe4a0723c06b8eca611d8b3e6e66717f05..5ea46e19792bdef2313bf90e550096d5a4019445 100755
--- a/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py
+++ b/auto/MiniExamples/scatter2d/Interference2DSquareFiniteLattice.py
@@ -42,7 +42,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py b/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py
index 54079e5d47e3efc6f1990fb6306f6eb280719343..562cdc0523a60e98a3a81b8145ca3ccca19bc94e 100755
--- a/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py
+++ b/auto/MiniExamples/scatter2d/LargeParticlesFormFactor.py
@@ -33,7 +33,7 @@ def get_sample(cylinder_radius, cylinder_height):
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py b/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py
index a435774330a43f7ca20f403bae0396c760da2225..96a6f1080f256856afec8af82c65f050142ce721 100755
--- a/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py
+++ b/auto/MiniExamples/scatter2d/LatticeOrientationDistribution.py
@@ -29,7 +29,7 @@ def get_sample():
         layout.setTotalParticleSurfaceDensity(0.1*parsample.weight)
         toplayer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(toplayer)
     sample.addLayer(substrate)
     return sample
diff --git a/auto/MiniExamples/scatter2d/MagneticCylinders1.py b/auto/MiniExamples/scatter2d/MagneticCylinders1.py
index cf076762bfb3c7c61b981c591a484f1eafd304ad..024b21b621cc58589dec4a290550cf5341f25c80 100755
--- a/auto/MiniExamples/scatter2d/MagneticCylinders1.py
+++ b/auto/MiniExamples/scatter2d/MagneticCylinders1.py
@@ -25,7 +25,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/MiniExamples/scatter2d/MagneticCylinders2.py b/auto/MiniExamples/scatter2d/MagneticCylinders2.py
index 93449ce05f2d4e3f79a24b151aaf218437bab91e..ca57c930c684a3902e422398b23ce3841b69587b 100755
--- a/auto/MiniExamples/scatter2d/MagneticCylinders2.py
+++ b/auto/MiniExamples/scatter2d/MagneticCylinders2.py
@@ -24,7 +24,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/MiniExamples/scatter2d/MagneticSpheres.py b/auto/MiniExamples/scatter2d/MagneticSpheres.py
index 3f94674a5a25a01e694f79fd6a7d04283a066b64..6f08328f2363ad9979c69e62a714367da0e19fbe 100755
--- a/auto/MiniExamples/scatter2d/MagneticSpheres.py
+++ b/auto/MiniExamples/scatter2d/MagneticSpheres.py
@@ -30,7 +30,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
     layer_2.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Mesocrystal.py b/auto/MiniExamples/scatter2d/Mesocrystal.py
index 2d73b59108e9f8365f3f900a3c79d5dbb46edc14..f08e32a673a602bf6b0b0bd7bc194044ac7a8f79 100755
--- a/auto/MiniExamples/scatter2d/Mesocrystal.py
+++ b/auto/MiniExamples/scatter2d/Mesocrystal.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Mesocrystal2.py b/auto/MiniExamples/scatter2d/Mesocrystal2.py
index dc411de4a607ac057bafcbb96b0f04820474b63d..6a6a3c985bc14664f594d1b53bd2534eda5d1eb1 100755
--- a/auto/MiniExamples/scatter2d/Mesocrystal2.py
+++ b/auto/MiniExamples/scatter2d/Mesocrystal2.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Mesocrystal3.py b/auto/MiniExamples/scatter2d/Mesocrystal3.py
index 0b163eba3a5000c4b8440352568f43ec8ccdf3b7..18dc27f830f7b31b22b5139798077f7cdf07594c 100755
--- a/auto/MiniExamples/scatter2d/Mesocrystal3.py
+++ b/auto/MiniExamples/scatter2d/Mesocrystal3.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/Mesocrystal4.py b/auto/MiniExamples/scatter2d/Mesocrystal4.py
index 2a19d37a99a925698d6ecc916b5c6d7429477537..877b1d89323aaa99b184938c4a13529c9a11fb55 100755
--- a/auto/MiniExamples/scatter2d/Mesocrystal4.py
+++ b/auto/MiniExamples/scatter2d/Mesocrystal4.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py b/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py
index 35e2821411ddc05438ed81a6dc0ff9005245d10f..8982e0ff6343fcf765aa67bd8db078d8cadb36f1 100755
--- a/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py
+++ b/auto/MiniExamples/scatter2d/ParticleAcrossInterface.py
@@ -28,7 +28,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/PolarizedSANS.py b/auto/MiniExamples/scatter2d/PolarizedSANS.py
index 82548ef8f1ae61a14702b3f1ae059b2e619e067c..2f715a3cd71a333bd423cbbefd04ed3c89242d26 100755
--- a/auto/MiniExamples/scatter2d/PolarizedSANS.py
+++ b/auto/MiniExamples/scatter2d/PolarizedSANS.py
@@ -42,7 +42,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/MiniExamples/scatter2d/PolydisperseCylinders.py b/auto/MiniExamples/scatter2d/PolydisperseCylinders.py
index 340d5d7cff5348c698aca67e9a0e2dffbe2db10e..7482b13211840b07e20e8ee77b13c09520413678 100755
--- a/auto/MiniExamples/scatter2d/PolydisperseCylinders.py
+++ b/auto/MiniExamples/scatter2d/PolydisperseCylinders.py
@@ -23,7 +23,7 @@ def get_sample():
     layer = ba.Layer(vacuum)
     layer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/auto/MiniExamples/scatter2d/PositionVariance.py b/auto/MiniExamples/scatter2d/PositionVariance.py
index 21f758a6788013fbbe133c30a956a95ffd710443..4ccfe41051a5f69d30c1b77de51ace7b8e887bf1 100755
--- a/auto/MiniExamples/scatter2d/PositionVariance.py
+++ b/auto/MiniExamples/scatter2d/PositionVariance.py
@@ -36,7 +36,7 @@ def get_sample(hasVariance, xi):
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/auto/MiniExamples/scatter2d/RectangularGrating.py b/auto/MiniExamples/scatter2d/RectangularGrating.py
index e274965f772a4aa459fd53e5164b5ed10560f7b9..2726deebd0428371ba60b9f7bd02cd9b5aa583a8 100755
--- a/auto/MiniExamples/scatter2d/RectangularGrating.py
+++ b/auto/MiniExamples/scatter2d/RectangularGrating.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/auto/MiniExamples/scatter2d/RotatedPyramids.py b/auto/MiniExamples/scatter2d/RotatedPyramids.py
index 779d857ab859cac8b7daf0d8880271bb5dbb7f1f..9a52cdb2a202c60efda5809caed24beecbc4c3dd 100755
--- a/auto/MiniExamples/scatter2d/RotatedPyramids.py
+++ b/auto/MiniExamples/scatter2d/RotatedPyramids.py
@@ -35,7 +35,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/RoughAndSpecular.py b/auto/MiniExamples/scatter2d/RoughAndSpecular.py
index 50290728ac5497eff0efcd7f9948d292e20d34c0..e8dad648e25d370836dc493d8915e1016f2c9322 100755
--- a/auto/MiniExamples/scatter2d/RoughAndSpecular.py
+++ b/auto/MiniExamples/scatter2d/RoughAndSpecular.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/MiniExamples/scatter2d/SlicedLayer.py b/auto/MiniExamples/scatter2d/SlicedLayer.py
index a12c458e7062cc27240437fa9cac21c9d9ecc761..b75b1b54449ebe7c54b3c61a4e9da35607a55955 100755
--- a/auto/MiniExamples/scatter2d/SlicedLayer.py
+++ b/auto/MiniExamples/scatter2d/SlicedLayer.py
@@ -31,7 +31,7 @@ def get_sample():
     substrate = ba.Layer(material_substrate)
     substrate.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer1)
     sample.addLayer(substrate)
diff --git a/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py b/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py
index efc1713af1af16b6c80fd782affd279add1ba2d2..1308587a29f10b2ce656edd6cc1740d95f60ecd0 100755
--- a/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py
+++ b/auto/MiniExamples/scatter2d/SpheresAtHexLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/scatter2d/TriangularRipple.py b/auto/MiniExamples/scatter2d/TriangularRipple.py
index 76c3250420093320b996dc885ed46b8e15baf22d..b00f5b955f9f4891b47d9f18e5ecc8eb83e7edbb 100755
--- a/auto/MiniExamples/scatter2d/TriangularRipple.py
+++ b/auto/MiniExamples/scatter2d/TriangularRipple.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/auto/MiniExamples/specular/AlternatingLayers1.py b/auto/MiniExamples/specular/AlternatingLayers1.py
index be3e85b871e02d1d4658343ceacf51ad1f6b4752..9e782e691570cdb4db8f4bfa81d7690453862051 100755
--- a/auto/MiniExamples/specular/AlternatingLayers1.py
+++ b/auto/MiniExamples/specular/AlternatingLayers1.py
@@ -22,7 +22,7 @@ def get_sample():
     substrate = ba.Layer(material_Si)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(top_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/MiniExamples/specular/Basic.py b/auto/MiniExamples/specular/Basic.py
index 4b8942b872e12f92f558a28b6bbe64b0aa5ea33a..54653ebe1abff3405c6533237573ed4790d93f9e 100755
--- a/auto/MiniExamples/specular/Basic.py
+++ b/auto/MiniExamples/specular/Basic.py
@@ -18,7 +18,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(film)
     sample.addLayer(substrate_layer)
diff --git a/auto/MiniExamples/specular/MagneticLayer.py b/auto/MiniExamples/specular/MagneticLayer.py
index a30d89cffe82f9ff06b4e3000c3f81a8219b2af9..da41023d1cb94870d507814745387bdc48a1a8e2 100755
--- a/auto/MiniExamples/specular/MagneticLayer.py
+++ b/auto/MiniExamples/specular/MagneticLayer.py
@@ -26,7 +26,7 @@ def get_sample():
     layer_3 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/MiniExamples/specular/MagneticLayerImperfect.py b/auto/MiniExamples/specular/MagneticLayerImperfect.py
index 291bef064ebadb77297ff3c11734cf0f57c82e4e..2c181204fdddacc1bc51e8b7be7edd40067dc838 100755
--- a/auto/MiniExamples/specular/MagneticLayerImperfect.py
+++ b/auto/MiniExamples/specular/MagneticLayerImperfect.py
@@ -31,7 +31,7 @@ def get_sample():
     layer_substrate = ba.Layer(material_substrate, roughness)
 
     # Multilayer
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_vacuum)
     sample.addLayer(layer_Pd)
     sample.addLayer(layer_Fe)
diff --git a/auto/MiniExamples/specular/PolarizedSpinAsymmetry.py b/auto/MiniExamples/specular/PolarizedSpinAsymmetry.py
index b8ec2ff1dc84d8a0660f13f8fbf3ac12f562455e..8d312c3d7cf0e9e298847151e59dad7ab7613679 100755
--- a/auto/MiniExamples/specular/PolarizedSpinAsymmetry.py
+++ b/auto/MiniExamples/specular/PolarizedSpinAsymmetry.py
@@ -60,7 +60,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/auto/MiniExamples/specular/RoughnessModel.py b/auto/MiniExamples/specular/RoughnessModel.py
index 20643d08d3757cbb11281df05e5ddf3e272cab6d..7e7141fb0df9a10a9dc550811b7433aeea86eb1f 100755
--- a/auto/MiniExamples/specular/RoughnessModel.py
+++ b/auto/MiniExamples/specular/RoughnessModel.py
@@ -27,7 +27,7 @@ def get_sample(interlayer):
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # create sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/MiniExamples/specular/SpecularSimulationWithRoughness.py b/auto/MiniExamples/specular/SpecularSimulationWithRoughness.py
index 73ccd906f8f6923e9d7e84da34930f070a43c374..c408770b87243eb109caa94abee6f7cbf6a2c38d 100755
--- a/auto/MiniExamples/specular/SpecularSimulationWithRoughness.py
+++ b/auto/MiniExamples/specular/SpecularSimulationWithRoughness.py
@@ -28,7 +28,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/auto/MiniExamples/varia/Depthprobe1.py b/auto/MiniExamples/varia/Depthprobe1.py
index e96427d4096f301a53b1679ab15436a9042c7762..2a2bd9ca5eca4e2fc3ce9893e60c4e465c8b0473 100755
--- a/auto/MiniExamples/varia/Depthprobe1.py
+++ b/auto/MiniExamples/varia/Depthprobe1.py
@@ -14,7 +14,7 @@ def get_sample():
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/MiniExamples/varia/MaterialProfile.py b/auto/MiniExamples/varia/MaterialProfile.py
index dc16882b36a95b0ff1caa53015579ca523a4d298..ad1bc2b08de43716c329fdfb82d32644c92149fb 100755
--- a/auto/MiniExamples/varia/MaterialProfile.py
+++ b/auto/MiniExamples/varia/MaterialProfile.py
@@ -32,7 +32,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     
     for _ in range(4):
diff --git a/auto/MiniExamples/varia/MaterialProfileWithParticles.py b/auto/MiniExamples/varia/MaterialProfileWithParticles.py
index c28c365581bb648032d2cbf7a7ecdb3596c68143..6012f7362567d7dd3f0f24a5587ac2afdbd819e5 100755
--- a/auto/MiniExamples/varia/MaterialProfileWithParticles.py
+++ b/auto/MiniExamples/varia/MaterialProfileWithParticles.py
@@ -30,7 +30,7 @@ def get_sample():
     ambient_layer.setNumberOfSlices(20)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/auto/MiniExamples/varia/OpaqueProfile1.py b/auto/MiniExamples/varia/OpaqueProfile1.py
index d67a2809b553e18bf4efb423d64949c8bbc70fdb..7fadb7f23113e5dbd5a3e235da36ec398fe8e409 100755
--- a/auto/MiniExamples/varia/OpaqueProfile1.py
+++ b/auto/MiniExamples/varia/OpaqueProfile1.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_bot = ba.Layer(material_vac)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_top)
     sample.addLayer(layer_1)
     sample.addLayer(layer_bot)
diff --git a/auto/MiniExamples/varia/Resonator.py b/auto/MiniExamples/varia/Resonator.py
index 8649d7ac17ddd69abf8520dcb00881d26a352a1e..21d70e29d0b9d9e7232c2e5a1d18ca616e84f157 100755
--- a/auto/MiniExamples/varia/Resonator.py
+++ b/auto/MiniExamples/varia/Resonator.py
@@ -52,7 +52,7 @@ def get_sample():
     layer_6 = ba.Layer(material_D2O)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/auto/MiniExamples/varia/RoughSurface.py b/auto/MiniExamples/varia/RoughSurface.py
index 045be5bde5e3f7a878d8f231cfcdc17cb2a32932..e5561602601c450ef5a02692c6bbf93d533370ad 100755
--- a/auto/MiniExamples/varia/RoughSurface.py
+++ b/auto/MiniExamples/varia/RoughSurface.py
@@ -81,7 +81,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate, roughness_sub)
 
     # adding layers
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
     my_sample.addLayer(l_ambience)
     my_sample.addLayer(l_layer)
     my_sample.addLayer(l_substrate)
diff --git a/auto/MiniExamples/varia/Transmission.py b/auto/MiniExamples/varia/Transmission.py
index f268b102b09f6ad972d0f9932a1dd840cb86f0db..684c8d59491d9ff9ec205ab6528c3409f420e7e2 100755
--- a/auto/MiniExamples/varia/Transmission.py
+++ b/auto/MiniExamples/varia/Transmission.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/MiniExamples/varia/TransmissionVsAlpha.py b/auto/MiniExamples/varia/TransmissionVsAlpha.py
index 683a15b9041590ad0969c66ae3f277b497a1dd2a..43a9bd36b93770656b4283b4baf109a09fb98db7 100755
--- a/auto/MiniExamples/varia/TransmissionVsAlpha.py
+++ b/auto/MiniExamples/varia/TransmissionVsAlpha.py
@@ -14,7 +14,7 @@ def get_sample(depth):
     material_A = ba.RefractiveMaterial("A", 5e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/MiniExamples/varia/TransmissionVsDepth.py b/auto/MiniExamples/varia/TransmissionVsDepth.py
index fc3f2d4a49c53c3e0807770edcf0045297e1be89..fca8b83f7fcf4e1a8b2ecbd6657fd346a5f1bf76 100755
--- a/auto/MiniExamples/varia/TransmissionVsDepth.py
+++ b/auto/MiniExamples/varia/TransmissionVsDepth.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/auto/Wrap/libBornAgainResample.py b/auto/Wrap/libBornAgainResample.py
index 372210715be13d2cad0a7cd1278089994efc9493..a13245307874891bc13e15814547cd7abb259733 100644
--- a/auto/Wrap/libBornAgainResample.py
+++ b/auto/Wrap/libBornAgainResample.py
@@ -2089,13 +2089,13 @@ def generateZValues(n_points, z_min, z_max):
     return _libBornAgainResample.generateZValues(n_points, z_min, z_max)
 
 def materialProfileSLD(sample, n_points, z_min, z_max):
-    r"""materialProfileSLD(MultiLayer const & sample, int n_points, double z_min, double z_max) -> vector_complex_T"""
+    r"""materialProfileSLD(Sample const & sample, int n_points, double z_min, double z_max) -> vector_complex_T"""
     return _libBornAgainResample.materialProfileSLD(sample, n_points, z_min, z_max)
 
 def magnetizationProfile(sample, xyz, n_points, z_min, z_max):
-    r"""magnetizationProfile(MultiLayer const & sample, std::string xyz, int n_points, double z_min, double z_max) -> vdouble1d_T"""
+    r"""magnetizationProfile(Sample const & sample, std::string xyz, int n_points, double z_min, double z_max) -> vdouble1d_T"""
     return _libBornAgainResample.magnetizationProfile(sample, xyz, n_points, z_min, z_max)
 
 def defaultMaterialProfileLimits(sample):
-    r"""defaultMaterialProfileLimits(MultiLayer const & sample) -> pvacuum_double_T"""
+    r"""defaultMaterialProfileLimits(Sample const & sample) -> pvacuum_double_T"""
     return _libBornAgainResample.defaultMaterialProfileLimits(sample)
diff --git a/auto/Wrap/libBornAgainResample_wrap.cpp b/auto/Wrap/libBornAgainResample_wrap.cpp
index 14b0b92e55a4e534d2b91d73d99aa61e5a8fa0cd..abf8bf2bef5eac6dea4e181e324789b1e3504539 100644
--- a/auto/Wrap/libBornAgainResample_wrap.cpp
+++ b/auto/Wrap/libBornAgainResample_wrap.cpp
@@ -3646,8 +3646,8 @@ namespace Swig {
 /* -------- TYPES TABLE (BEGIN) -------- */
 
 #define SWIGTYPE_p_MesoOptions swig_types[0]
-#define SWIGTYPE_p_MultiLayer swig_types[1]
-#define SWIGTYPE_p_Rotation3DT_double_t swig_types[2]
+#define SWIGTYPE_p_Rotation3DT_double_t swig_types[1]
+#define SWIGTYPE_p_Sample swig_types[2]
 #define SWIGTYPE_p_SimulationOptions swig_types[3]
 #define SWIGTYPE_p_Vec3T_double_t swig_types[4]
 #define SWIGTYPE_p_Vec3T_int_t swig_types[5]
@@ -29565,7 +29565,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_materialProfileSLD(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = 0 ;
+  Sample *arg1 = 0 ;
   int arg2 ;
   double arg3 ;
   double arg4 ;
@@ -29582,14 +29582,14 @@ SWIGINTERN PyObject *_wrap_materialProfileSLD(PyObject *self, PyObject *args) {
   
   (void)self;
   if (!SWIG_Python_UnpackTuple(args, "materialProfileSLD", 4, 4, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "materialProfileSLD" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "materialProfileSLD" "', argument " "1"" of type '" "Sample const &""'"); 
   }
   if (!argp1) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "materialProfileSLD" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "materialProfileSLD" "', argument " "1"" of type '" "Sample const &""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "materialProfileSLD" "', argument " "2"" of type '" "int""'");
@@ -29607,7 +29607,7 @@ SWIGINTERN PyObject *_wrap_materialProfileSLD(PyObject *self, PyObject *args) {
   arg4 = static_cast< double >(val4);
   {
     try {
-      result = swigAPI::materialProfileSLD((MultiLayer const &)*arg1,arg2,arg3,arg4);
+      result = swigAPI::materialProfileSLD((Sample const &)*arg1,arg2,arg3,arg4);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -29625,7 +29625,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_magnetizationProfile(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = 0 ;
+  Sample *arg1 = 0 ;
   std::string arg2 ;
   int arg3 ;
   double arg4 ;
@@ -29643,14 +29643,14 @@ SWIGINTERN PyObject *_wrap_magnetizationProfile(PyObject *self, PyObject *args)
   
   (void)self;
   if (!SWIG_Python_UnpackTuple(args, "magnetizationProfile", 5, 5, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "magnetizationProfile" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "magnetizationProfile" "', argument " "1"" of type '" "Sample const &""'"); 
   }
   if (!argp1) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "magnetizationProfile" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "magnetizationProfile" "', argument " "1"" of type '" "Sample const &""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   {
     std::string *ptr = (std::string *)0;
     int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
@@ -29677,7 +29677,7 @@ SWIGINTERN PyObject *_wrap_magnetizationProfile(PyObject *self, PyObject *args)
   arg5 = static_cast< double >(val5);
   {
     try {
-      result = swigAPI::magnetizationProfile((MultiLayer const &)*arg1,SWIG_STD_MOVE(arg2),arg3,arg4,arg5);
+      result = swigAPI::magnetizationProfile((Sample const &)*arg1,SWIG_STD_MOVE(arg2),arg3,arg4,arg5);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -29695,7 +29695,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_defaultMaterialProfileLimits(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = 0 ;
+  Sample *arg1 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
@@ -29704,17 +29704,17 @@ SWIGINTERN PyObject *_wrap_defaultMaterialProfileLimits(PyObject *self, PyObject
   (void)self;
   if (!args) SWIG_fail;
   swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "defaultMaterialProfileLimits" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "defaultMaterialProfileLimits" "', argument " "1"" of type '" "Sample const &""'"); 
   }
   if (!argp1) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "defaultMaterialProfileLimits" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "defaultMaterialProfileLimits" "', argument " "1"" of type '" "Sample const &""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   {
     try {
-      result = swigAPI::defaultMaterialProfileLimits((MultiLayer const &)*arg1);
+      result = swigAPI::defaultMaterialProfileLimits((Sample const &)*arg1);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -30441,9 +30441,9 @@ static PyMethodDef SwigMethods[] = {
 	 { "vector_R3_swigregister", vector_R3_swigregister, METH_O, NULL},
 	 { "vector_R3_swiginit", vector_R3_swiginit, METH_VARARGS, NULL},
 	 { "generateZValues", _wrap_generateZValues, METH_VARARGS, "generateZValues(int n_points, double z_min, double z_max) -> vdouble1d_T"},
-	 { "materialProfileSLD", _wrap_materialProfileSLD, METH_VARARGS, "materialProfileSLD(MultiLayer const & sample, int n_points, double z_min, double z_max) -> vector_complex_T"},
-	 { "magnetizationProfile", _wrap_magnetizationProfile, METH_VARARGS, "magnetizationProfile(MultiLayer const & sample, std::string xyz, int n_points, double z_min, double z_max) -> vdouble1d_T"},
-	 { "defaultMaterialProfileLimits", _wrap_defaultMaterialProfileLimits, METH_O, "defaultMaterialProfileLimits(MultiLayer const & sample) -> pvacuum_double_T"},
+	 { "materialProfileSLD", _wrap_materialProfileSLD, METH_VARARGS, "materialProfileSLD(Sample const & sample, int n_points, double z_min, double z_max) -> vector_complex_T"},
+	 { "magnetizationProfile", _wrap_magnetizationProfile, METH_VARARGS, "magnetizationProfile(Sample const & sample, std::string xyz, int n_points, double z_min, double z_max) -> vdouble1d_T"},
+	 { "defaultMaterialProfileLimits", _wrap_defaultMaterialProfileLimits, METH_O, "defaultMaterialProfileLimits(Sample const & sample) -> pvacuum_double_T"},
 	 { NULL, NULL, 0, NULL }
 };
 
@@ -30451,8 +30451,8 @@ static PyMethodDef SwigMethods[] = {
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
 static swig_type_info _swigt__p_MesoOptions = {"_p_MesoOptions", "MesoOptions *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_MultiLayer = {"_p_MultiLayer", "MultiLayer *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Rotation3DT_double_t = {"_p_Rotation3DT_double_t", "RotMatrix *|Rotation3D< double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_Sample = {"_p_Sample", "Sample *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_SimulationOptions = {"_p_SimulationOptions", "SimulationOptions *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Vec3T_double_t = {"_p_Vec3T_double_t", "R3 *|std::vector< Vec3< double > >::value_type *|Vec3< double > *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Vec3T_int_t = {"_p_Vec3T_int_t", "I3 *|Vec3< int > *", 0, 0, (void*)0, 0};
@@ -30504,8 +30504,8 @@ static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0
 
 static swig_type_info *swig_type_initial[] = {
   &_swigt__p_MesoOptions,
-  &_swigt__p_MultiLayer,
   &_swigt__p_Rotation3DT_double_t,
+  &_swigt__p_Sample,
   &_swigt__p_SimulationOptions,
   &_swigt__p_Vec3T_double_t,
   &_swigt__p_Vec3T_int_t,
@@ -30557,8 +30557,8 @@ static swig_type_info *swig_type_initial[] = {
 };
 
 static swig_cast_info _swigc__p_MesoOptions[] = {  {&_swigt__p_MesoOptions, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_MultiLayer[] = {  {&_swigt__p_MultiLayer, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_Rotation3DT_double_t[] = {  {&_swigt__p_Rotation3DT_double_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_Sample[] = {  {&_swigt__p_Sample, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_SimulationOptions[] = {  {&_swigt__p_SimulationOptions, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_Vec3T_double_t[] = {  {&_swigt__p_Vec3T_double_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_Vec3T_int_t[] = {  {&_swigt__p_Vec3T_int_t, 0, 0, 0},{0, 0, 0, 0}};
@@ -30610,8 +30610,8 @@ static swig_cast_info _swigc__p_value_type[] = {  {&_swigt__p_value_type, 0, 0,
 
 static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_MesoOptions,
-  _swigc__p_MultiLayer,
   _swigc__p_Rotation3DT_double_t,
+  _swigc__p_Sample,
   _swigc__p_SimulationOptions,
   _swigc__p_Vec3T_double_t,
   _swigc__p_Vec3T_int_t,
diff --git a/auto/Wrap/libBornAgainSample.py b/auto/Wrap/libBornAgainSample.py
index f209238069463e1b9f19b5643e614e80cc0fc23b..7b3831576356377a434bb7ec88ce7b278aea858b 100644
--- a/auto/Wrap/libBornAgainSample.py
+++ b/auto/Wrap/libBornAgainSample.py
@@ -4213,7 +4213,7 @@ class RoughnessMap(object):
     __repr__ = _swig_repr
 
     def __init__(self, x_points, y_points, Lx, Ly, sample, i_layer, seed=-1):
-        r"""__init__(RoughnessMap self, size_t x_points, size_t y_points, double Lx, double Ly, MultiLayer sample, int i_layer, int seed=-1) -> RoughnessMap"""
+        r"""__init__(RoughnessMap self, size_t x_points, size_t y_points, double Lx, double Ly, Sample sample, int i_layer, int seed=-1) -> RoughnessMap"""
         _libBornAgainSample.RoughnessMap_swiginit(self, _libBornAgainSample.new_RoughnessMap(x_points, y_points, Lx, Ly, sample, i_layer, seed))
 
     def generateMap(self):
@@ -4263,47 +4263,47 @@ class Layer(ISampleNode):
 
 # Register Layer in _libBornAgainSample:
 _libBornAgainSample.Layer_swigregister(Layer)
-class MultiLayer(ISampleNode):
-    r"""Proxy of C++ MultiLayer class."""
+class Sample(ISampleNode):
+    r"""Proxy of C++ Sample class."""
 
     thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
     __repr__ = _swig_repr
 
     def __init__(self):
-        r"""__init__(MultiLayer self) -> MultiLayer"""
-        _libBornAgainSample.MultiLayer_swiginit(self, _libBornAgainSample.new_MultiLayer())
-    __swig_destroy__ = _libBornAgainSample.delete_MultiLayer
+        r"""__init__(Sample self) -> Sample"""
+        _libBornAgainSample.Sample_swiginit(self, _libBornAgainSample.new_Sample())
+    __swig_destroy__ = _libBornAgainSample.delete_Sample
 
     def clone(self):
-        r"""clone(MultiLayer self) -> MultiLayer"""
-        return _libBornAgainSample.MultiLayer_clone(self)
+        r"""clone(Sample self) -> Sample"""
+        return _libBornAgainSample.Sample_clone(self)
 
     def className(self):
-        r"""className(MultiLayer self) -> std::string"""
-        return _libBornAgainSample.MultiLayer_className(self)
+        r"""className(Sample self) -> std::string"""
+        return _libBornAgainSample.Sample_className(self)
 
     def addLayer(self, layer):
-        r"""addLayer(MultiLayer self, Layer layer)"""
-        return _libBornAgainSample.MultiLayer_addLayer(self, layer)
+        r"""addLayer(Sample self, Layer layer)"""
+        return _libBornAgainSample.Sample_addLayer(self, layer)
 
     def setExternalField(self, ext_field):
-        r"""setExternalField(MultiLayer self, R3 ext_field)"""
-        return _libBornAgainSample.MultiLayer_setExternalField(self, ext_field)
+        r"""setExternalField(Sample self, R3 ext_field)"""
+        return _libBornAgainSample.Sample_setExternalField(self, ext_field)
 
     def setName(self, name):
-        r"""setName(MultiLayer self, std::string const & name)"""
-        return _libBornAgainSample.MultiLayer_setName(self, name)
+        r"""setName(Sample self, std::string const & name)"""
+        return _libBornAgainSample.Sample_setName(self, name)
 
     def layerRoughnessSpectrum(self, spatial_f, i_layer):
-        r"""layerRoughnessSpectrum(MultiLayer self, double spatial_f, int i_layer) -> double"""
-        return _libBornAgainSample.MultiLayer_layerRoughnessSpectrum(self, spatial_f, i_layer)
+        r"""layerRoughnessSpectrum(Sample self, double spatial_f, int i_layer) -> double"""
+        return _libBornAgainSample.Sample_layerRoughnessSpectrum(self, spatial_f, i_layer)
 
     def layerRoughnessRMS(self, i_layer):
-        r"""layerRoughnessRMS(MultiLayer self, size_t i_layer) -> double"""
-        return _libBornAgainSample.MultiLayer_layerRoughnessRMS(self, i_layer)
+        r"""layerRoughnessRMS(Sample self, size_t i_layer) -> double"""
+        return _libBornAgainSample.Sample_layerRoughnessRMS(self, i_layer)
 
-# Register MultiLayer in _libBornAgainSample:
-_libBornAgainSample.MultiLayer_swigregister(MultiLayer)
+# Register Sample in _libBornAgainSample:
+_libBornAgainSample.Sample_swigregister(Sample)
 class AutocorrelationModel(libBornAgainBase.ICloneable, libBornAgainParam.INode):
     r"""Proxy of C++ AutocorrelationModel class."""
 
diff --git a/auto/Wrap/libBornAgainSample_wrap.cpp b/auto/Wrap/libBornAgainSample_wrap.cpp
index b7f7a6019e8659f9b50e0cecf9a1379390e0f06b..344939057295fe0c210d5e947ea6169c954c8d28 100644
--- a/auto/Wrap/libBornAgainSample_wrap.cpp
+++ b/auto/Wrap/libBornAgainSample_wrap.cpp
@@ -3718,35 +3718,35 @@ namespace Swig {
 #define SWIGTYPE_p_Mesocrystal swig_types[70]
 #define SWIGTYPE_p_MisesFisherGaussPeakShape swig_types[71]
 #define SWIGTYPE_p_MisesGaussPeakShape swig_types[72]
-#define SWIGTYPE_p_MultiLayer swig_types[73]
-#define SWIGTYPE_p_Particle swig_types[74]
-#define SWIGTYPE_p_ParticleLayout swig_types[75]
-#define SWIGTYPE_p_PlatonicOctahedron swig_types[76]
-#define SWIGTYPE_p_PlatonicTetrahedron swig_types[77]
-#define SWIGTYPE_p_Prism3 swig_types[78]
-#define SWIGTYPE_p_Prism6 swig_types[79]
-#define SWIGTYPE_p_Profile1DCauchy swig_types[80]
-#define SWIGTYPE_p_Profile1DCosine swig_types[81]
-#define SWIGTYPE_p_Profile1DGate swig_types[82]
-#define SWIGTYPE_p_Profile1DGauss swig_types[83]
-#define SWIGTYPE_p_Profile1DTriangle swig_types[84]
-#define SWIGTYPE_p_Profile1DVoigt swig_types[85]
-#define SWIGTYPE_p_Profile2DCauchy swig_types[86]
-#define SWIGTYPE_p_Profile2DCone swig_types[87]
-#define SWIGTYPE_p_Profile2DGate swig_types[88]
-#define SWIGTYPE_p_Profile2DGauss swig_types[89]
-#define SWIGTYPE_p_Profile2DVoigt swig_types[90]
-#define SWIGTYPE_p_Pyramid2 swig_types[91]
-#define SWIGTYPE_p_Pyramid3 swig_types[92]
-#define SWIGTYPE_p_Pyramid4 swig_types[93]
-#define SWIGTYPE_p_Pyramid6 swig_types[94]
-#define SWIGTYPE_p_RefractiveMaterialImpl swig_types[95]
-#define SWIGTYPE_p_Rotation3DT_double_t swig_types[96]
-#define SWIGTYPE_p_RotationEuler swig_types[97]
-#define SWIGTYPE_p_RotationX swig_types[98]
-#define SWIGTYPE_p_RotationY swig_types[99]
-#define SWIGTYPE_p_RotationZ swig_types[100]
-#define SWIGTYPE_p_RoughnessMap swig_types[101]
+#define SWIGTYPE_p_Particle swig_types[73]
+#define SWIGTYPE_p_ParticleLayout swig_types[74]
+#define SWIGTYPE_p_PlatonicOctahedron swig_types[75]
+#define SWIGTYPE_p_PlatonicTetrahedron swig_types[76]
+#define SWIGTYPE_p_Prism3 swig_types[77]
+#define SWIGTYPE_p_Prism6 swig_types[78]
+#define SWIGTYPE_p_Profile1DCauchy swig_types[79]
+#define SWIGTYPE_p_Profile1DCosine swig_types[80]
+#define SWIGTYPE_p_Profile1DGate swig_types[81]
+#define SWIGTYPE_p_Profile1DGauss swig_types[82]
+#define SWIGTYPE_p_Profile1DTriangle swig_types[83]
+#define SWIGTYPE_p_Profile1DVoigt swig_types[84]
+#define SWIGTYPE_p_Profile2DCauchy swig_types[85]
+#define SWIGTYPE_p_Profile2DCone swig_types[86]
+#define SWIGTYPE_p_Profile2DGate swig_types[87]
+#define SWIGTYPE_p_Profile2DGauss swig_types[88]
+#define SWIGTYPE_p_Profile2DVoigt swig_types[89]
+#define SWIGTYPE_p_Pyramid2 swig_types[90]
+#define SWIGTYPE_p_Pyramid3 swig_types[91]
+#define SWIGTYPE_p_Pyramid4 swig_types[92]
+#define SWIGTYPE_p_Pyramid6 swig_types[93]
+#define SWIGTYPE_p_RefractiveMaterialImpl swig_types[94]
+#define SWIGTYPE_p_Rotation3DT_double_t swig_types[95]
+#define SWIGTYPE_p_RotationEuler swig_types[96]
+#define SWIGTYPE_p_RotationX swig_types[97]
+#define SWIGTYPE_p_RotationY swig_types[98]
+#define SWIGTYPE_p_RotationZ swig_types[99]
+#define SWIGTYPE_p_RoughnessMap swig_types[100]
+#define SWIGTYPE_p_Sample swig_types[101]
 #define SWIGTYPE_p_SawtoothRippleBox swig_types[102]
 #define SWIGTYPE_p_SawtoothRippleGauss swig_types[103]
 #define SWIGTYPE_p_SawtoothRippleLorentz swig_types[104]
@@ -7134,21 +7134,21 @@ SWIGINTERN void std_vector_Sl_std_pair_Sl_double_Sc_double_Sg__Sg__insert__SWIG_
 #include "Sample/Aggregate/ParticleLayout.h"
 #include "Sample/Correlation/IPeakShape.h"
 #include "Sample/HardParticle/HardParticles.h"
-#include "Sample/Lattice/Lattice3D.h"
+#include "Sample/Interface/LayerRoughness.h"
+#include "Sample/Interface/RoughnessMap.h"
 #include "Sample/Lattice/BakeLattice.h"
 #include "Sample/Lattice/ISelectionRule.h"
+#include "Sample/Lattice/Lattice3D.h"
+#include "Sample/Material/MaterialBySLDImpl.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
 #include "Sample/Material/RefractiveMaterialImpl.h"
-#include "Sample/Material/MaterialBySLDImpl.h"
 #include "Sample/Multilayer/Layer.h"
-#include "Sample/Multilayer/MultiLayer.h"
+#include "Sample/Multilayer/Sample.h"
+#include "Sample/Particle/Compound.h"
+#include "Sample/Particle/CoreAndShell.h"
 #include "Sample/Particle/Crystal.h"
 #include "Sample/Particle/Mesocrystal.h"
 #include "Sample/Particle/Particle.h"
-#include "Sample/Particle/Compound.h"
-#include "Sample/Particle/CoreAndShell.h"
-#include "Sample/Interface/LayerRoughness.h"
-#include "Sample/Interface/RoughnessMap.h"
 #include "Sample/Scattering/Rotations.h"
 #include "Sample/SoftParticle/SoftParticles.h"
 
@@ -50879,7 +50879,7 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap__SWIG_0(PyObject *self, Py_ssize_t n
   size_t arg2 ;
   double arg3 ;
   double arg4 ;
-  MultiLayer *arg5 = 0 ;
+  Sample *arg5 = 0 ;
   int arg6 ;
   int arg7 ;
   size_t val1 ;
@@ -50920,14 +50920,14 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap__SWIG_0(PyObject *self, Py_ssize_t n
     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_RoughnessMap" "', argument " "4"" of type '" "double""'");
   } 
   arg4 = static_cast< double >(val4);
-  res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "Sample const &""'"); 
   }
   if (!argp5) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "Sample const &""'"); 
   }
-  arg5 = reinterpret_cast< MultiLayer * >(argp5);
+  arg5 = reinterpret_cast< Sample * >(argp5);
   ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
   if (!SWIG_IsOK(ecode6)) {
     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_RoughnessMap" "', argument " "6"" of type '" "int""'");
@@ -50940,7 +50940,7 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap__SWIG_0(PyObject *self, Py_ssize_t n
   arg7 = static_cast< int >(val7);
   {
     try {
-      result = (RoughnessMap *)new RoughnessMap(arg1,arg2,arg3,arg4,(MultiLayer const &)*arg5,arg6,arg7);
+      result = (RoughnessMap *)new RoughnessMap(arg1,arg2,arg3,arg4,(Sample const &)*arg5,arg6,arg7);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -50962,7 +50962,7 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap__SWIG_1(PyObject *self, Py_ssize_t n
   size_t arg2 ;
   double arg3 ;
   double arg4 ;
-  MultiLayer *arg5 = 0 ;
+  Sample *arg5 = 0 ;
   int arg6 ;
   size_t val1 ;
   int ecode1 = 0 ;
@@ -51000,14 +51000,14 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap__SWIG_1(PyObject *self, Py_ssize_t n
     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_RoughnessMap" "', argument " "4"" of type '" "double""'");
   } 
   arg4 = static_cast< double >(val4);
-  res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res5 = SWIG_ConvertPtr(swig_obj[4], &argp5, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res5)) {
-    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "Sample const &""'"); 
   }
   if (!argp5) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_RoughnessMap" "', argument " "5"" of type '" "Sample const &""'"); 
   }
-  arg5 = reinterpret_cast< MultiLayer * >(argp5);
+  arg5 = reinterpret_cast< Sample * >(argp5);
   ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
   if (!SWIG_IsOK(ecode6)) {
     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_RoughnessMap" "', argument " "6"" of type '" "int""'");
@@ -51015,7 +51015,7 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap__SWIG_1(PyObject *self, Py_ssize_t n
   arg6 = static_cast< int >(val6);
   {
     try {
-      result = (RoughnessMap *)new RoughnessMap(arg1,arg2,arg3,arg4,(MultiLayer const &)*arg5,arg6);
+      result = (RoughnessMap *)new RoughnessMap(arg1,arg2,arg3,arg4,(Sample const &)*arg5,arg6);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -51061,7 +51061,7 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap(PyObject *self, PyObject *args) {
             _v = SWIG_CheckState(res);
           }
           if (_v) {
-            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_MultiLayer, SWIG_POINTER_NO_NULL | 0);
+            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_Sample, SWIG_POINTER_NO_NULL | 0);
             _v = SWIG_CheckState(res);
             if (_v) {
               {
@@ -51099,7 +51099,7 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap(PyObject *self, PyObject *args) {
             _v = SWIG_CheckState(res);
           }
           if (_v) {
-            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_MultiLayer, SWIG_POINTER_NO_NULL | 0);
+            int res = SWIG_ConvertPtr(argv[4], 0, SWIGTYPE_p_Sample, SWIG_POINTER_NO_NULL | 0);
             _v = SWIG_CheckState(res);
             if (_v) {
               {
@@ -51125,8 +51125,8 @@ SWIGINTERN PyObject *_wrap_new_RoughnessMap(PyObject *self, PyObject *args) {
 fail:
   SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_RoughnessMap'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    RoughnessMap::RoughnessMap(size_t,size_t,double,double,MultiLayer const &,int,int)\n"
-    "    RoughnessMap::RoughnessMap(size_t,size_t,double,double,MultiLayer const &,int)\n");
+    "    RoughnessMap::RoughnessMap(size_t,size_t,double,double,Sample const &,int,int)\n"
+    "    RoughnessMap::RoughnessMap(size_t,size_t,double,double,Sample const &,int)\n");
   return 0;
 }
 
@@ -51718,15 +51718,15 @@ SWIGINTERN PyObject *Layer_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
   return SWIG_Python_InitShadowInstance(args);
 }
 
-SWIGINTERN PyObject *_wrap_new_MultiLayer(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_new_Sample(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *result = 0 ;
+  Sample *result = 0 ;
   
   (void)self;
-  if (!SWIG_Python_UnpackTuple(args, "new_MultiLayer", 0, 0, 0)) SWIG_fail;
+  if (!SWIG_Python_UnpackTuple(args, "new_Sample", 0, 0, 0)) SWIG_fail;
   {
     try {
-      result = (MultiLayer *)new MultiLayer();
+      result = (Sample *)new Sample();
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -51735,16 +51735,16 @@ SWIGINTERN PyObject *_wrap_new_MultiLayer(PyObject *self, PyObject *args) {
       SWIG_exception(SWIG_RuntimeError, msg.c_str());
     }
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MultiLayer, SWIG_POINTER_NEW |  0 );
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Sample, SWIG_POINTER_NEW |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_delete_MultiLayer(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_delete_Sample(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
@@ -51752,11 +51752,11 @@ SWIGINTERN PyObject *_wrap_delete_MultiLayer(PyObject *self, PyObject *args) {
   (void)self;
   if (!args) SWIG_fail;
   swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, SWIG_POINTER_DISOWN |  0 );
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, SWIG_POINTER_DISOWN |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiLayer" "', argument " "1"" of type '" "MultiLayer *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Sample" "', argument " "1"" of type '" "Sample *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   {
     try {
       delete arg1;
@@ -51775,25 +51775,25 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_MultiLayer_clone(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Sample_clone(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
-  MultiLayer *result = 0 ;
+  Sample *result = 0 ;
   
   (void)self;
   if (!args) SWIG_fail;
   swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, 0 |  0 );
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiLayer_clone" "', argument " "1"" of type '" "MultiLayer const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sample_clone" "', argument " "1"" of type '" "Sample const *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   {
     try {
-      result = (MultiLayer *)((MultiLayer const *)arg1)->clone();
+      result = (Sample *)((Sample const *)arg1)->clone();
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -51802,16 +51802,16 @@ SWIGINTERN PyObject *_wrap_MultiLayer_clone(PyObject *self, PyObject *args) {
       SWIG_exception(SWIG_RuntimeError, msg.c_str());
     }
   }
-  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MultiLayer, 0 |  0 );
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Sample, 0 |  0 );
   return resultobj;
 fail:
   return NULL;
 }
 
 
-SWIGINTERN PyObject *_wrap_MultiLayer_className(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Sample_className(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
@@ -51820,14 +51820,14 @@ SWIGINTERN PyObject *_wrap_MultiLayer_className(PyObject *self, PyObject *args)
   (void)self;
   if (!args) SWIG_fail;
   swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, 0 |  0 );
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiLayer_className" "', argument " "1"" of type '" "MultiLayer const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sample_className" "', argument " "1"" of type '" "Sample const *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   {
     try {
-      result = ((MultiLayer const *)arg1)->className();
+      result = ((Sample const *)arg1)->className();
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -51843,9 +51843,9 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_MultiLayer_addLayer(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Sample_addLayer(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   Layer *arg2 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -51854,18 +51854,18 @@ SWIGINTERN PyObject *_wrap_MultiLayer_addLayer(PyObject *self, PyObject *args) {
   PyObject *swig_obj[2] ;
   
   (void)self;
-  if (!SWIG_Python_UnpackTuple(args, "MultiLayer_addLayer", 2, 2, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args, "Sample_addLayer", 2, 2, swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiLayer_addLayer" "', argument " "1"" of type '" "MultiLayer *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sample_addLayer" "', argument " "1"" of type '" "Sample *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Layer,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiLayer_addLayer" "', argument " "2"" of type '" "Layer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Sample_addLayer" "', argument " "2"" of type '" "Layer const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MultiLayer_addLayer" "', argument " "2"" of type '" "Layer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Sample_addLayer" "', argument " "2"" of type '" "Layer const &""'"); 
   }
   arg2 = reinterpret_cast< Layer * >(argp2);
   {
@@ -51886,9 +51886,9 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_MultiLayer_setExternalField(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Sample_setExternalField(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   R3 *arg2 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -51897,18 +51897,18 @@ SWIGINTERN PyObject *_wrap_MultiLayer_setExternalField(PyObject *self, PyObject
   PyObject *swig_obj[2] ;
   
   (void)self;
-  if (!SWIG_Python_UnpackTuple(args, "MultiLayer_setExternalField", 2, 2, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args, "Sample_setExternalField", 2, 2, swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiLayer_setExternalField" "', argument " "1"" of type '" "MultiLayer *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sample_setExternalField" "', argument " "1"" of type '" "Sample *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Vec3T_double_t,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiLayer_setExternalField" "', argument " "2"" of type '" "R3 const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Sample_setExternalField" "', argument " "2"" of type '" "R3 const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MultiLayer_setExternalField" "', argument " "2"" of type '" "R3 const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Sample_setExternalField" "', argument " "2"" of type '" "R3 const &""'"); 
   }
   arg2 = reinterpret_cast< R3 * >(argp2);
   {
@@ -51929,9 +51929,9 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_MultiLayer_setName(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Sample_setName(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   std::string *arg2 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -51939,20 +51939,20 @@ SWIGINTERN PyObject *_wrap_MultiLayer_setName(PyObject *self, PyObject *args) {
   PyObject *swig_obj[2] ;
   
   (void)self;
-  if (!SWIG_Python_UnpackTuple(args, "MultiLayer_setName", 2, 2, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args, "Sample_setName", 2, 2, swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiLayer_setName" "', argument " "1"" of type '" "MultiLayer *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sample_setName" "', argument " "1"" of type '" "Sample *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   {
     std::string *ptr = (std::string *)0;
     res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr);
     if (!SWIG_IsOK(res2)) {
-      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiLayer_setName" "', argument " "2"" of type '" "std::string const &""'"); 
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Sample_setName" "', argument " "2"" of type '" "std::string const &""'"); 
     }
     if (!ptr) {
-      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MultiLayer_setName" "', argument " "2"" of type '" "std::string const &""'"); 
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Sample_setName" "', argument " "2"" of type '" "std::string const &""'"); 
     }
     arg2 = ptr;
   }
@@ -51976,9 +51976,9 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_MultiLayer_layerRoughnessSpectrum(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Sample_layerRoughnessSpectrum(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   double arg2 ;
   int arg3 ;
   void *argp1 = 0 ;
@@ -51991,25 +51991,25 @@ SWIGINTERN PyObject *_wrap_MultiLayer_layerRoughnessSpectrum(PyObject *self, PyO
   double result;
   
   (void)self;
-  if (!SWIG_Python_UnpackTuple(args, "MultiLayer_layerRoughnessSpectrum", 3, 3, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args, "Sample_layerRoughnessSpectrum", 3, 3, swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiLayer_layerRoughnessSpectrum" "', argument " "1"" of type '" "MultiLayer const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sample_layerRoughnessSpectrum" "', argument " "1"" of type '" "Sample const *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiLayer_layerRoughnessSpectrum" "', argument " "2"" of type '" "double""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Sample_layerRoughnessSpectrum" "', argument " "2"" of type '" "double""'");
   } 
   arg2 = static_cast< double >(val2);
   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
   if (!SWIG_IsOK(ecode3)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MultiLayer_layerRoughnessSpectrum" "', argument " "3"" of type '" "int""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Sample_layerRoughnessSpectrum" "', argument " "3"" of type '" "int""'");
   } 
   arg3 = static_cast< int >(val3);
   {
     try {
-      result = (double)((MultiLayer const *)arg1)->layerRoughnessSpectrum(arg2,arg3);
+      result = (double)((Sample const *)arg1)->layerRoughnessSpectrum(arg2,arg3);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -52025,9 +52025,9 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_MultiLayer_layerRoughnessRMS(PyObject *self, PyObject *args) {
+SWIGINTERN PyObject *_wrap_Sample_layerRoughnessRMS(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = (MultiLayer *) 0 ;
+  Sample *arg1 = (Sample *) 0 ;
   size_t arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -52037,20 +52037,20 @@ SWIGINTERN PyObject *_wrap_MultiLayer_layerRoughnessRMS(PyObject *self, PyObject
   double result;
   
   (void)self;
-  if (!SWIG_Python_UnpackTuple(args, "MultiLayer_layerRoughnessRMS", 2, 2, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_MultiLayer, 0 |  0 );
+  if (!SWIG_Python_UnpackTuple(args, "Sample_layerRoughnessRMS", 2, 2, swig_obj)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Sample, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiLayer_layerRoughnessRMS" "', argument " "1"" of type '" "MultiLayer const *""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Sample_layerRoughnessRMS" "', argument " "1"" of type '" "Sample const *""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
   if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MultiLayer_layerRoughnessRMS" "', argument " "2"" of type '" "size_t""'");
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Sample_layerRoughnessRMS" "', argument " "2"" of type '" "size_t""'");
   } 
   arg2 = static_cast< size_t >(val2);
   {
     try {
-      result = (double)((MultiLayer const *)arg1)->layerRoughnessRMS(arg2);
+      result = (double)((Sample const *)arg1)->layerRoughnessRMS(arg2);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -52066,14 +52066,14 @@ fail:
 }
 
 
-SWIGINTERN PyObject *MultiLayer_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *Sample_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
-  SWIG_TypeNewClientData(SWIGTYPE_p_MultiLayer, SWIG_NewClientData(obj));
+  SWIG_TypeNewClientData(SWIGTYPE_p_Sample, SWIG_NewClientData(obj));
   return SWIG_Py_Void();
 }
 
-SWIGINTERN PyObject *MultiLayer_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+SWIGINTERN PyObject *Sample_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   return SWIG_Python_InitShadowInstance(args);
 }
 
@@ -75310,7 +75310,7 @@ static PyMethodDef SwigMethods[] = {
 	 { "delete_LayerRoughness", _wrap_delete_LayerRoughness, METH_O, "delete_LayerRoughness(LayerRoughness self)"},
 	 { "LayerRoughness_swigregister", LayerRoughness_swigregister, METH_O, NULL},
 	 { "LayerRoughness_swiginit", LayerRoughness_swiginit, METH_VARARGS, NULL},
-	 { "new_RoughnessMap", _wrap_new_RoughnessMap, METH_VARARGS, "RoughnessMap(size_t x_points, size_t y_points, double Lx, double Ly, MultiLayer sample, int i_layer, int seed=-1)"},
+	 { "new_RoughnessMap", _wrap_new_RoughnessMap, METH_VARARGS, "RoughnessMap(size_t x_points, size_t y_points, double Lx, double Ly, Sample sample, int i_layer, int seed=-1)"},
 	 { "RoughnessMap_generateMap", _wrap_RoughnessMap_generateMap, METH_O, "RoughnessMap_generateMap(RoughnessMap self) -> double2d_t"},
 	 { "RoughnessMap_generate", _wrap_RoughnessMap_generate, METH_O, "RoughnessMap_generate(RoughnessMap self) -> Arrayf64Wrapper"},
 	 { "delete_RoughnessMap", _wrap_delete_RoughnessMap, METH_O, "delete_RoughnessMap(RoughnessMap self)"},
@@ -75328,17 +75328,17 @@ static PyMethodDef SwigMethods[] = {
 	 { "Layer_setNumberOfSlices", _wrap_Layer_setNumberOfSlices, METH_VARARGS, "Layer_setNumberOfSlices(Layer self, unsigned int n_slices)"},
 	 { "Layer_swigregister", Layer_swigregister, METH_O, NULL},
 	 { "Layer_swiginit", Layer_swiginit, METH_VARARGS, NULL},
-	 { "new_MultiLayer", _wrap_new_MultiLayer, METH_NOARGS, "new_MultiLayer() -> MultiLayer"},
-	 { "delete_MultiLayer", _wrap_delete_MultiLayer, METH_O, "delete_MultiLayer(MultiLayer self)"},
-	 { "MultiLayer_clone", _wrap_MultiLayer_clone, METH_O, "MultiLayer_clone(MultiLayer self) -> MultiLayer"},
-	 { "MultiLayer_className", _wrap_MultiLayer_className, METH_O, "MultiLayer_className(MultiLayer self) -> std::string"},
-	 { "MultiLayer_addLayer", _wrap_MultiLayer_addLayer, METH_VARARGS, "MultiLayer_addLayer(MultiLayer self, Layer layer)"},
-	 { "MultiLayer_setExternalField", _wrap_MultiLayer_setExternalField, METH_VARARGS, "MultiLayer_setExternalField(MultiLayer self, R3 ext_field)"},
-	 { "MultiLayer_setName", _wrap_MultiLayer_setName, METH_VARARGS, "MultiLayer_setName(MultiLayer self, std::string const & name)"},
-	 { "MultiLayer_layerRoughnessSpectrum", _wrap_MultiLayer_layerRoughnessSpectrum, METH_VARARGS, "MultiLayer_layerRoughnessSpectrum(MultiLayer self, double spatial_f, int i_layer) -> double"},
-	 { "MultiLayer_layerRoughnessRMS", _wrap_MultiLayer_layerRoughnessRMS, METH_VARARGS, "MultiLayer_layerRoughnessRMS(MultiLayer self, size_t i_layer) -> double"},
-	 { "MultiLayer_swigregister", MultiLayer_swigregister, METH_O, NULL},
-	 { "MultiLayer_swiginit", MultiLayer_swiginit, METH_VARARGS, NULL},
+	 { "new_Sample", _wrap_new_Sample, METH_NOARGS, "new_Sample() -> Sample"},
+	 { "delete_Sample", _wrap_delete_Sample, METH_O, "delete_Sample(Sample self)"},
+	 { "Sample_clone", _wrap_Sample_clone, METH_O, "Sample_clone(Sample self) -> Sample"},
+	 { "Sample_className", _wrap_Sample_className, METH_O, "Sample_className(Sample self) -> std::string"},
+	 { "Sample_addLayer", _wrap_Sample_addLayer, METH_VARARGS, "Sample_addLayer(Sample self, Layer layer)"},
+	 { "Sample_setExternalField", _wrap_Sample_setExternalField, METH_VARARGS, "Sample_setExternalField(Sample self, R3 ext_field)"},
+	 { "Sample_setName", _wrap_Sample_setName, METH_VARARGS, "Sample_setName(Sample self, std::string const & name)"},
+	 { "Sample_layerRoughnessSpectrum", _wrap_Sample_layerRoughnessSpectrum, METH_VARARGS, "Sample_layerRoughnessSpectrum(Sample self, double spatial_f, int i_layer) -> double"},
+	 { "Sample_layerRoughnessRMS", _wrap_Sample_layerRoughnessRMS, METH_VARARGS, "Sample_layerRoughnessRMS(Sample self, size_t i_layer) -> double"},
+	 { "Sample_swigregister", Sample_swigregister, METH_O, NULL},
+	 { "Sample_swiginit", Sample_swiginit, METH_VARARGS, NULL},
 	 { "AutocorrelationModel_clone", _wrap_AutocorrelationModel_clone, METH_O, "AutocorrelationModel_clone(AutocorrelationModel self) -> AutocorrelationModel"},
 	 { "AutocorrelationModel_setMaxSpatialFrequency", _wrap_AutocorrelationModel_setMaxSpatialFrequency, METH_VARARGS, "AutocorrelationModel_setMaxSpatialFrequency(AutocorrelationModel self, double val)"},
 	 { "AutocorrelationModel_maxSpatialFrequency", _wrap_AutocorrelationModel_maxSpatialFrequency, METH_O, "AutocorrelationModel_maxSpatialFrequency(AutocorrelationModel self) -> double"},
@@ -76241,9 +76241,6 @@ static void *_p_MisesFisherGaussPeakShapeTo_p_ICloneable(void *x, int *SWIGUNUSE
 static void *_p_MisesGaussPeakShapeTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ICloneable *) (IPeakShape *) ((MisesGaussPeakShape *) x));
 }
-static void *_p_MultiLayerTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ICloneable *) (ISampleNode *) ((MultiLayer *) x));
-}
 static void *_p_ParticleTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ICloneable *) (ISampleNode *)(IParticle *) ((Particle *) x));
 }
@@ -76319,6 +76316,9 @@ static void *_p_RotationYTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)
 static void *_p_RotationZTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ICloneable *) (IRotation *) ((RotationZ *) x));
 }
+static void *_p_SampleTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ICloneable *) (ISampleNode *) ((Sample *) x));
+}
 static void *_p_SawtoothRippleBoxTo_p_ICloneable(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ICloneable *) (ISampleNode *)(IFormfactor *)(IProfileRipple *)(ISawtoothRipple *) ((SawtoothRippleBox *) x));
 }
@@ -76763,9 +76763,6 @@ static void *_p_MisesFisherGaussPeakShapeTo_p_INode(void *x, int *SWIGUNUSEDPARM
 static void *_p_MisesGaussPeakShapeTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((INode *) (IPeakShape *) ((MisesGaussPeakShape *) x));
 }
-static void *_p_MultiLayerTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((INode *) (ISampleNode *) ((MultiLayer *) x));
-}
 static void *_p_ParticleTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((INode *) (ISampleNode *)(IParticle *) ((Particle *) x));
 }
@@ -76841,6 +76838,9 @@ static void *_p_RotationYTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
 static void *_p_RotationZTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((INode *) (IRotation *) ((RotationZ *) x));
 }
+static void *_p_SampleTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((INode *) (ISampleNode *) ((Sample *) x));
+}
 static void *_p_SawtoothRippleBoxTo_p_INode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((INode *) (ISampleNode *)(IFormfactor *)(IProfileRipple *)(ISawtoothRipple *) ((SawtoothRippleBox *) x));
 }
@@ -77090,9 +77090,6 @@ static void *_p_LongBoxLorentzTo_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newm
 static void *_p_MesocrystalTo_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ISampleNode *) (IParticle *) ((Mesocrystal *) x));
 }
-static void *_p_MultiLayerTo_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
-    return (void *)((ISampleNode *)  ((MultiLayer *) x));
-}
 static void *_p_ParticleTo_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ISampleNode *) (IParticle *) ((Particle *) x));
 }
@@ -77123,6 +77120,9 @@ static void *_p_Pyramid4To_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newmemory)
 static void *_p_Pyramid6To_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ISampleNode *) (IFormfactor *)(IFormfactorPolyhedron *) ((Pyramid6 *) x));
 }
+static void *_p_SampleTo_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((ISampleNode *)  ((Sample *) x));
+}
 static void *_p_SawtoothRippleBoxTo_p_ISampleNode(void *x, int *SWIGUNUSEDPARM(newmemory)) {
     return (void *)((ISampleNode *) (IFormfactor *)(IProfileRipple *)(ISawtoothRipple *) ((SawtoothRippleBox *) x));
 }
@@ -77250,7 +77250,6 @@ static swig_type_info _swigt__p_MaterialBySLDImpl = {"_p_MaterialBySLDImpl", "Ma
 static swig_type_info _swigt__p_Mesocrystal = {"_p_Mesocrystal", "Mesocrystal *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_MisesFisherGaussPeakShape = {"_p_MisesFisherGaussPeakShape", "MisesFisherGaussPeakShape *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_MisesGaussPeakShape = {"_p_MisesGaussPeakShape", "MisesGaussPeakShape *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_MultiLayer = {"_p_MultiLayer", "MultiLayer *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Particle = {"_p_Particle", "Particle *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_ParticleLayout = {"_p_ParticleLayout", "ParticleLayout *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_PlatonicOctahedron = {"_p_PlatonicOctahedron", "PlatonicOctahedron *", 0, 0, (void*)0, 0};
@@ -77279,6 +77278,7 @@ static swig_type_info _swigt__p_RotationX = {"_p_RotationX", "RotationX *", 0, 0
 static swig_type_info _swigt__p_RotationY = {"_p_RotationY", "RotationY *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_RotationZ = {"_p_RotationZ", "RotationZ *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_RoughnessMap = {"_p_RoughnessMap", "RoughnessMap *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_Sample = {"_p_Sample", "Sample *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_SawtoothRippleBox = {"_p_SawtoothRippleBox", "SawtoothRippleBox *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_SawtoothRippleGauss = {"_p_SawtoothRippleGauss", "SawtoothRippleGauss *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_SawtoothRippleLorentz = {"_p_SawtoothRippleLorentz", "SawtoothRippleLorentz *", 0, 0, (void*)0, 0};
@@ -77420,7 +77420,6 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_Mesocrystal,
   &_swigt__p_MisesFisherGaussPeakShape,
   &_swigt__p_MisesGaussPeakShape,
-  &_swigt__p_MultiLayer,
   &_swigt__p_Particle,
   &_swigt__p_ParticleLayout,
   &_swigt__p_PlatonicOctahedron,
@@ -77449,6 +77448,7 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_RotationY,
   &_swigt__p_RotationZ,
   &_swigt__p_RoughnessMap,
+  &_swigt__p_Sample,
   &_swigt__p_SawtoothRippleBox,
   &_swigt__p_SawtoothRippleGauss,
   &_swigt__p_SawtoothRippleLorentz,
@@ -77544,14 +77544,14 @@ static swig_cast_info _swigc__p_GaussSphere[] = {  {&_swigt__p_GaussSphere, 0, 0
 static swig_cast_info _swigc__p_HemiEllipsoid[] = {  {&_swigt__p_HemiEllipsoid, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_HexagonalLattice2D[] = {  {&_swigt__p_HexagonalLattice2D, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_HorizontalCylinder[] = {  {&_swigt__p_HorizontalCylinder, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_ICloneable[] = {  {&_swigt__p_ICloneable, 0, 0, 0},  {&_swigt__p_AutocorrelationModel, _p_AutocorrelationModelTo_p_ICloneable, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_BasicLattice2D, _p_BasicLattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_ICloneable, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_ICloneable, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_ICloneable, 0, 0},  {&_swigt__p_CommonDepthCrosscorrelation, _p_CommonDepthCrosscorrelationTo_p_ICloneable, 0, 0},  {&_swigt__p_Compound, _p_CompoundTo_p_ICloneable, 0, 0},  {&_swigt__p_Cone, _p_ConeTo_p_ICloneable, 0, 0},  {&_swigt__p_CoreAndShell, _p_CoreAndShellTo_p_ICloneable, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_ICloneable, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_CrosscorrelationModel, _p_CrosscorrelationModelTo_p_ICloneable, 0, 0},  {&_swigt__p_Crystal, _p_CrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_Cylinder, _p_CylinderTo_p_ICloneable, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_EllipsoidalCylinder, _p_EllipsoidalCylinderTo_p_ICloneable, 0, 0},  {&_swigt__p_ErfInterlayer, _p_ErfInterlayerTo_p_ICloneable, 0, 0},  {&_swigt__p_FuzzySphere, _p_FuzzySphereTo_p_ICloneable, 0, 0},  {&_swigt__p_GaussFisherPeakShape, _p_GaussFisherPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_GaussSphere, _p_GaussSphereTo_p_ICloneable, 0, 0},  {&_swigt__p_HemiEllipsoid, _p_HemiEllipsoidTo_p_ICloneable, 0, 0},  {&_swigt__p_HexagonalLattice2D, _p_HexagonalLattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_HorizontalCylinder, _p_HorizontalCylinderTo_p_ICloneable, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_IFormfactor, _p_IFormfactorTo_p_ICloneable, 0, 0},  {&_swigt__p_IFormfactorPolyhedron, _p_IFormfactorPolyhedronTo_p_ICloneable, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_ICloneable, 0, 0},  {&_swigt__p_IInterference, _p_IInterferenceTo_p_ICloneable, 0, 0},  {&_swigt__p_IParticle, _p_IParticleTo_p_ICloneable, 0, 0},  {&_swigt__p_IPeakShape, _p_IPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfile1D, _p_IProfile1DTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfile2D, _p_IProfile2DTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfileRipple, _p_IProfileRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_IRotation, _p_IRotationTo_p_ICloneable, 0, 0},  {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_ICloneable, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_IdentityRotation, _p_IdentityRotationTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference1DLattice, _p_Interference1DLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference2DLattice, _p_Interference2DLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference2DParacrystal, _p_Interference2DParacrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference2DSuperLattice, _p_Interference2DSuperLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceFinite2DLattice, _p_InterferenceFinite2DLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceHardDisk, _p_InterferenceHardDiskTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceNone, _p_InterferenceNoneTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceRadialParacrystal, _p_InterferenceRadialParacrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_InterlayerModel, _p_InterlayerModelTo_p_ICloneable, 0, 0},  {&_swigt__p_IsotropicGaussPeakShape, _p_IsotropicGaussPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_IsotropicLorentzPeakShape, _p_IsotropicLorentzPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_K_CorrelationModel, _p_K_CorrelationModelTo_p_ICloneable, 0, 0},  {&_swigt__p_Lattice2D, _p_Lattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_Layer, _p_LayerTo_p_ICloneable, 0, 0},  {&_swigt__p_LayerRoughness, _p_LayerRoughnessTo_p_ICloneable, 0, 0},  {&_swigt__p_LinearGrowthModel, _p_LinearGrowthModelTo_p_ICloneable, 0, 0},  {&_swigt__p_LongBoxGauss, _p_LongBoxGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_LongBoxLorentz, _p_LongBoxLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_LorentzFisherPeakShape, _p_LorentzFisherPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_Mesocrystal, _p_MesocrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_MisesFisherGaussPeakShape, _p_MisesFisherGaussPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_MisesGaussPeakShape, _p_MisesGaussPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_MultiLayer, _p_MultiLayerTo_p_ICloneable, 0, 0},  {&_swigt__p_Particle, _p_ParticleTo_p_ICloneable, 0, 0},  {&_swigt__p_ParticleLayout, _p_ParticleLayoutTo_p_ICloneable, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_ICloneable, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DCauchy, _p_Profile1DCauchyTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DCosine, _p_Profile1DCosineTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DGate, _p_Profile1DGateTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DGauss, _p_Profile1DGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DTriangle, _p_Profile1DTriangleTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DVoigt, _p_Profile1DVoigtTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DCauchy, _p_Profile2DCauchyTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DCone, _p_Profile2DConeTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DGate, _p_Profile2DGateTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DGauss, _p_Profile2DGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DVoigt, _p_Profile2DVoigtTo_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_ICloneable, 0, 0},  {&_swigt__p_RotationEuler, _p_RotationEulerTo_p_ICloneable, 0, 0},  {&_swigt__p_RotationX, _p_RotationXTo_p_ICloneable, 0, 0},  {&_swigt__p_RotationY, _p_RotationYTo_p_ICloneable, 0, 0},  {&_swigt__p_RotationZ, _p_RotationZTo_p_ICloneable, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_ICloneable, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_SpatialFrequencyCrosscorrelation, _p_SpatialFrequencyCrosscorrelationTo_p_ICloneable, 0, 0},  {&_swigt__p_Sphere, _p_SphereTo_p_ICloneable, 0, 0},  {&_swigt__p_Spheroid, _p_SpheroidTo_p_ICloneable, 0, 0},  {&_swigt__p_SquareLattice2D, _p_SquareLattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_TanhInterlayer, _p_TanhInterlayerTo_p_ICloneable, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_ICloneable, 0, 0},  {&_swigt__p_TruncatedSphere, _p_TruncatedSphereTo_p_ICloneable, 0, 0},  {&_swigt__p_TruncatedSpheroid, _p_TruncatedSpheroidTo_p_ICloneable, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_ICloneable[] = {  {&_swigt__p_ICloneable, 0, 0, 0},  {&_swigt__p_AutocorrelationModel, _p_AutocorrelationModelTo_p_ICloneable, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_BasicLattice2D, _p_BasicLattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_ICloneable, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_ICloneable, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_ICloneable, 0, 0},  {&_swigt__p_CommonDepthCrosscorrelation, _p_CommonDepthCrosscorrelationTo_p_ICloneable, 0, 0},  {&_swigt__p_Compound, _p_CompoundTo_p_ICloneable, 0, 0},  {&_swigt__p_Cone, _p_ConeTo_p_ICloneable, 0, 0},  {&_swigt__p_CoreAndShell, _p_CoreAndShellTo_p_ICloneable, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_ICloneable, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_CrosscorrelationModel, _p_CrosscorrelationModelTo_p_ICloneable, 0, 0},  {&_swigt__p_Crystal, _p_CrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_Cylinder, _p_CylinderTo_p_ICloneable, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_EllipsoidalCylinder, _p_EllipsoidalCylinderTo_p_ICloneable, 0, 0},  {&_swigt__p_ErfInterlayer, _p_ErfInterlayerTo_p_ICloneable, 0, 0},  {&_swigt__p_FuzzySphere, _p_FuzzySphereTo_p_ICloneable, 0, 0},  {&_swigt__p_GaussFisherPeakShape, _p_GaussFisherPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_GaussSphere, _p_GaussSphereTo_p_ICloneable, 0, 0},  {&_swigt__p_HemiEllipsoid, _p_HemiEllipsoidTo_p_ICloneable, 0, 0},  {&_swigt__p_HexagonalLattice2D, _p_HexagonalLattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_HorizontalCylinder, _p_HorizontalCylinderTo_p_ICloneable, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_IFormfactor, _p_IFormfactorTo_p_ICloneable, 0, 0},  {&_swigt__p_IFormfactorPolyhedron, _p_IFormfactorPolyhedronTo_p_ICloneable, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_ICloneable, 0, 0},  {&_swigt__p_IInterference, _p_IInterferenceTo_p_ICloneable, 0, 0},  {&_swigt__p_IParticle, _p_IParticleTo_p_ICloneable, 0, 0},  {&_swigt__p_IPeakShape, _p_IPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfile1D, _p_IProfile1DTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfile2D, _p_IProfile2DTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_IProfileRipple, _p_IProfileRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_IRotation, _p_IRotationTo_p_ICloneable, 0, 0},  {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_ICloneable, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_ICloneable, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_IdentityRotation, _p_IdentityRotationTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference1DLattice, _p_Interference1DLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference2DLattice, _p_Interference2DLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference2DParacrystal, _p_Interference2DParacrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_Interference2DSuperLattice, _p_Interference2DSuperLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceFinite2DLattice, _p_InterferenceFinite2DLatticeTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceHardDisk, _p_InterferenceHardDiskTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceNone, _p_InterferenceNoneTo_p_ICloneable, 0, 0},  {&_swigt__p_InterferenceRadialParacrystal, _p_InterferenceRadialParacrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_InterlayerModel, _p_InterlayerModelTo_p_ICloneable, 0, 0},  {&_swigt__p_IsotropicGaussPeakShape, _p_IsotropicGaussPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_IsotropicLorentzPeakShape, _p_IsotropicLorentzPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_K_CorrelationModel, _p_K_CorrelationModelTo_p_ICloneable, 0, 0},  {&_swigt__p_Lattice2D, _p_Lattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_Layer, _p_LayerTo_p_ICloneable, 0, 0},  {&_swigt__p_LayerRoughness, _p_LayerRoughnessTo_p_ICloneable, 0, 0},  {&_swigt__p_LinearGrowthModel, _p_LinearGrowthModelTo_p_ICloneable, 0, 0},  {&_swigt__p_LongBoxGauss, _p_LongBoxGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_LongBoxLorentz, _p_LongBoxLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_LorentzFisherPeakShape, _p_LorentzFisherPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_Mesocrystal, _p_MesocrystalTo_p_ICloneable, 0, 0},  {&_swigt__p_MisesFisherGaussPeakShape, _p_MisesFisherGaussPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_MisesGaussPeakShape, _p_MisesGaussPeakShapeTo_p_ICloneable, 0, 0},  {&_swigt__p_Particle, _p_ParticleTo_p_ICloneable, 0, 0},  {&_swigt__p_ParticleLayout, _p_ParticleLayoutTo_p_ICloneable, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_ICloneable, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_ICloneable, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DCauchy, _p_Profile1DCauchyTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DCosine, _p_Profile1DCosineTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DGate, _p_Profile1DGateTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DGauss, _p_Profile1DGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DTriangle, _p_Profile1DTriangleTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile1DVoigt, _p_Profile1DVoigtTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DCauchy, _p_Profile2DCauchyTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DCone, _p_Profile2DConeTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DGate, _p_Profile2DGateTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DGauss, _p_Profile2DGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_Profile2DVoigt, _p_Profile2DVoigtTo_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_ICloneable, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_ICloneable, 0, 0},  {&_swigt__p_RotationEuler, _p_RotationEulerTo_p_ICloneable, 0, 0},  {&_swigt__p_RotationX, _p_RotationXTo_p_ICloneable, 0, 0},  {&_swigt__p_RotationY, _p_RotationYTo_p_ICloneable, 0, 0},  {&_swigt__p_RotationZ, _p_RotationZTo_p_ICloneable, 0, 0},  {&_swigt__p_Sample, _p_SampleTo_p_ICloneable, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_ICloneable, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_ICloneable, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_ICloneable, 0, 0},  {&_swigt__p_SpatialFrequencyCrosscorrelation, _p_SpatialFrequencyCrosscorrelationTo_p_ICloneable, 0, 0},  {&_swigt__p_Sphere, _p_SphereTo_p_ICloneable, 0, 0},  {&_swigt__p_Spheroid, _p_SpheroidTo_p_ICloneable, 0, 0},  {&_swigt__p_SquareLattice2D, _p_SquareLattice2DTo_p_ICloneable, 0, 0},  {&_swigt__p_TanhInterlayer, _p_TanhInterlayerTo_p_ICloneable, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_ICloneable, 0, 0},  {&_swigt__p_TruncatedSphere, _p_TruncatedSphereTo_p_ICloneable, 0, 0},  {&_swigt__p_TruncatedSpheroid, _p_TruncatedSpheroidTo_p_ICloneable, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ICosineRipple[] = {  {&_swigt__p_ICosineRipple, 0, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_ICosineRipple, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_ICosineRipple, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_ICosineRipple, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IFormfactor[] = {  {&_swigt__p_IFormfactor, 0, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_IFormfactor, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_IFormfactor, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_IFormfactor, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_IFormfactor, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_IFormfactor, 0, 0},  {&_swigt__p_Cone, _p_ConeTo_p_IFormfactor, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_IFormfactor, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_IFormfactor, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_IFormfactor, 0, 0},  {&_swigt__p_Cylinder, _p_CylinderTo_p_IFormfactor, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_IFormfactor, 0, 0},  {&_swigt__p_EllipsoidalCylinder, _p_EllipsoidalCylinderTo_p_IFormfactor, 0, 0},  {&_swigt__p_FuzzySphere, _p_FuzzySphereTo_p_IFormfactor, 0, 0},  {&_swigt__p_GaussSphere, _p_GaussSphereTo_p_IFormfactor, 0, 0},  {&_swigt__p_HemiEllipsoid, _p_HemiEllipsoidTo_p_IFormfactor, 0, 0},  {&_swigt__p_HorizontalCylinder, _p_HorizontalCylinderTo_p_IFormfactor, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_IFormfactor, 0, 0},  {&_swigt__p_IFormfactorPolyhedron, _p_IFormfactorPolyhedronTo_p_IFormfactor, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_IFormfactor, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_IFormfactor, 0, 0},  {&_swigt__p_IProfileRipple, _p_IProfileRippleTo_p_IFormfactor, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_IFormfactor, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_IFormfactor, 0, 0},  {&_swigt__p_LongBoxGauss, _p_LongBoxGaussTo_p_IFormfactor, 0, 0},  {&_swigt__p_LongBoxLorentz, _p_LongBoxLorentzTo_p_IFormfactor, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_IFormfactor, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_IFormfactor, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_IFormfactor, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_IFormfactor, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_IFormfactor, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_IFormfactor, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_IFormfactor, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_IFormfactor, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_IFormfactor, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_IFormfactor, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_IFormfactor, 0, 0},  {&_swigt__p_Sphere, _p_SphereTo_p_IFormfactor, 0, 0},  {&_swigt__p_Spheroid, _p_SpheroidTo_p_IFormfactor, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_IFormfactor, 0, 0},  {&_swigt__p_TruncatedSphere, _p_TruncatedSphereTo_p_IFormfactor, 0, 0},  {&_swigt__p_TruncatedSpheroid, _p_TruncatedSpheroidTo_p_IFormfactor, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IFormfactorPolyhedron[] = {  {&_swigt__p_IFormfactorPolyhedron, 0, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_IFormfactorPolyhedron, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_IFormfactorPolyhedron, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IFormfactorPrism[] = {  {&_swigt__p_IFormfactorPrism, 0, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_IFormfactorPrism, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_IFormfactorPrism, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_IFormfactorPrism, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IInterference[] = {  {&_swigt__p_IInterference, 0, 0, 0},  {&_swigt__p_Interference1DLattice, _p_Interference1DLatticeTo_p_IInterference, 0, 0},  {&_swigt__p_Interference2DLattice, _p_Interference2DLatticeTo_p_IInterference, 0, 0},  {&_swigt__p_Interference2DParacrystal, _p_Interference2DParacrystalTo_p_IInterference, 0, 0},  {&_swigt__p_Interference2DSuperLattice, _p_Interference2DSuperLatticeTo_p_IInterference, 0, 0},  {&_swigt__p_InterferenceFinite2DLattice, _p_InterferenceFinite2DLatticeTo_p_IInterference, 0, 0},  {&_swigt__p_InterferenceHardDisk, _p_InterferenceHardDiskTo_p_IInterference, 0, 0},  {&_swigt__p_InterferenceNone, _p_InterferenceNoneTo_p_IInterference, 0, 0},  {&_swigt__p_InterferenceRadialParacrystal, _p_InterferenceRadialParacrystalTo_p_IInterference, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IMaterialImpl[] = {  {&_swigt__p_IMaterialImpl, 0, 0, 0},  {&_swigt__p_MaterialBySLDImpl, _p_MaterialBySLDImplTo_p_IMaterialImpl, 0, 0},  {&_swigt__p_RefractiveMaterialImpl, _p_RefractiveMaterialImplTo_p_IMaterialImpl, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_INode[] = {  {&_swigt__p_INode, 0, 0, 0},  {&_swigt__p_AutocorrelationModel, _p_AutocorrelationModelTo_p_INode, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_INode, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_INode, 0, 0},  {&_swigt__p_BasicLattice2D, _p_BasicLattice2DTo_p_INode, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_INode, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_INode, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_INode, 0, 0},  {&_swigt__p_CommonDepthCrosscorrelation, _p_CommonDepthCrosscorrelationTo_p_INode, 0, 0},  {&_swigt__p_Compound, _p_CompoundTo_p_INode, 0, 0},  {&_swigt__p_Cone, _p_ConeTo_p_INode, 0, 0},  {&_swigt__p_CoreAndShell, _p_CoreAndShellTo_p_INode, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_INode, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_INode, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_INode, 0, 0},  {&_swigt__p_CrosscorrelationModel, _p_CrosscorrelationModelTo_p_INode, 0, 0},  {&_swigt__p_Crystal, _p_CrystalTo_p_INode, 0, 0},  {&_swigt__p_Cylinder, _p_CylinderTo_p_INode, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_INode, 0, 0},  {&_swigt__p_EllipsoidalCylinder, _p_EllipsoidalCylinderTo_p_INode, 0, 0},  {&_swigt__p_ErfInterlayer, _p_ErfInterlayerTo_p_INode, 0, 0},  {&_swigt__p_FuzzySphere, _p_FuzzySphereTo_p_INode, 0, 0},  {&_swigt__p_GaussFisherPeakShape, _p_GaussFisherPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_GaussSphere, _p_GaussSphereTo_p_INode, 0, 0},  {&_swigt__p_HemiEllipsoid, _p_HemiEllipsoidTo_p_INode, 0, 0},  {&_swigt__p_HexagonalLattice2D, _p_HexagonalLattice2DTo_p_INode, 0, 0},  {&_swigt__p_HorizontalCylinder, _p_HorizontalCylinderTo_p_INode, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_INode, 0, 0},  {&_swigt__p_IFormfactor, _p_IFormfactorTo_p_INode, 0, 0},  {&_swigt__p_IFormfactorPolyhedron, _p_IFormfactorPolyhedronTo_p_INode, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_INode, 0, 0},  {&_swigt__p_IInterference, _p_IInterferenceTo_p_INode, 0, 0},  {&_swigt__p_IParticle, _p_IParticleTo_p_INode, 0, 0},  {&_swigt__p_IPeakShape, _p_IPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_IProfile1D, _p_IProfile1DTo_p_INode, 0, 0},  {&_swigt__p_IProfile2D, _p_IProfile2DTo_p_INode, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_INode, 0, 0},  {&_swigt__p_IProfileRipple, _p_IProfileRippleTo_p_INode, 0, 0},  {&_swigt__p_IRotation, _p_IRotationTo_p_INode, 0, 0},  {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_INode, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_INode, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_INode, 0, 0},  {&_swigt__p_IdentityRotation, _p_IdentityRotationTo_p_INode, 0, 0},  {&_swigt__p_Interference1DLattice, _p_Interference1DLatticeTo_p_INode, 0, 0},  {&_swigt__p_Interference2DLattice, _p_Interference2DLatticeTo_p_INode, 0, 0},  {&_swigt__p_Interference2DParacrystal, _p_Interference2DParacrystalTo_p_INode, 0, 0},  {&_swigt__p_Interference2DSuperLattice, _p_Interference2DSuperLatticeTo_p_INode, 0, 0},  {&_swigt__p_InterferenceFinite2DLattice, _p_InterferenceFinite2DLatticeTo_p_INode, 0, 0},  {&_swigt__p_InterferenceHardDisk, _p_InterferenceHardDiskTo_p_INode, 0, 0},  {&_swigt__p_InterferenceNone, _p_InterferenceNoneTo_p_INode, 0, 0},  {&_swigt__p_InterferenceRadialParacrystal, _p_InterferenceRadialParacrystalTo_p_INode, 0, 0},  {&_swigt__p_InterlayerModel, _p_InterlayerModelTo_p_INode, 0, 0},  {&_swigt__p_IsotropicGaussPeakShape, _p_IsotropicGaussPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_IsotropicLorentzPeakShape, _p_IsotropicLorentzPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_K_CorrelationModel, _p_K_CorrelationModelTo_p_INode, 0, 0},  {&_swigt__p_Lattice2D, _p_Lattice2DTo_p_INode, 0, 0},  {&_swigt__p_Lattice3D, _p_Lattice3DTo_p_INode, 0, 0},  {&_swigt__p_Layer, _p_LayerTo_p_INode, 0, 0},  {&_swigt__p_LayerRoughness, _p_LayerRoughnessTo_p_INode, 0, 0},  {&_swigt__p_LinearGrowthModel, _p_LinearGrowthModelTo_p_INode, 0, 0},  {&_swigt__p_LongBoxGauss, _p_LongBoxGaussTo_p_INode, 0, 0},  {&_swigt__p_LongBoxLorentz, _p_LongBoxLorentzTo_p_INode, 0, 0},  {&_swigt__p_LorentzFisherPeakShape, _p_LorentzFisherPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_Mesocrystal, _p_MesocrystalTo_p_INode, 0, 0},  {&_swigt__p_MisesFisherGaussPeakShape, _p_MisesFisherGaussPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_MisesGaussPeakShape, _p_MisesGaussPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_MultiLayer, _p_MultiLayerTo_p_INode, 0, 0},  {&_swigt__p_Particle, _p_ParticleTo_p_INode, 0, 0},  {&_swigt__p_ParticleLayout, _p_ParticleLayoutTo_p_INode, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_INode, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_INode, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_INode, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_INode, 0, 0},  {&_swigt__p_Profile1DCauchy, _p_Profile1DCauchyTo_p_INode, 0, 0},  {&_swigt__p_Profile1DCosine, _p_Profile1DCosineTo_p_INode, 0, 0},  {&_swigt__p_Profile1DGate, _p_Profile1DGateTo_p_INode, 0, 0},  {&_swigt__p_Profile1DGauss, _p_Profile1DGaussTo_p_INode, 0, 0},  {&_swigt__p_Profile1DTriangle, _p_Profile1DTriangleTo_p_INode, 0, 0},  {&_swigt__p_Profile1DVoigt, _p_Profile1DVoigtTo_p_INode, 0, 0},  {&_swigt__p_Profile2DCauchy, _p_Profile2DCauchyTo_p_INode, 0, 0},  {&_swigt__p_Profile2DCone, _p_Profile2DConeTo_p_INode, 0, 0},  {&_swigt__p_Profile2DGate, _p_Profile2DGateTo_p_INode, 0, 0},  {&_swigt__p_Profile2DGauss, _p_Profile2DGaussTo_p_INode, 0, 0},  {&_swigt__p_Profile2DVoigt, _p_Profile2DVoigtTo_p_INode, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_INode, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_INode, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_INode, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_INode, 0, 0},  {&_swigt__p_RotationEuler, _p_RotationEulerTo_p_INode, 0, 0},  {&_swigt__p_RotationX, _p_RotationXTo_p_INode, 0, 0},  {&_swigt__p_RotationY, _p_RotationYTo_p_INode, 0, 0},  {&_swigt__p_RotationZ, _p_RotationZTo_p_INode, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_INode, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_INode, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_INode, 0, 0},  {&_swigt__p_SpatialFrequencyCrosscorrelation, _p_SpatialFrequencyCrosscorrelationTo_p_INode, 0, 0},  {&_swigt__p_Sphere, _p_SphereTo_p_INode, 0, 0},  {&_swigt__p_Spheroid, _p_SpheroidTo_p_INode, 0, 0},  {&_swigt__p_SquareLattice2D, _p_SquareLattice2DTo_p_INode, 0, 0},  {&_swigt__p_TanhInterlayer, _p_TanhInterlayerTo_p_INode, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_INode, 0, 0},  {&_swigt__p_TruncatedSphere, _p_TruncatedSphereTo_p_INode, 0, 0},  {&_swigt__p_TruncatedSpheroid, _p_TruncatedSpheroidTo_p_INode, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_INode[] = {  {&_swigt__p_INode, 0, 0, 0},  {&_swigt__p_AutocorrelationModel, _p_AutocorrelationModelTo_p_INode, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_INode, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_INode, 0, 0},  {&_swigt__p_BasicLattice2D, _p_BasicLattice2DTo_p_INode, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_INode, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_INode, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_INode, 0, 0},  {&_swigt__p_CommonDepthCrosscorrelation, _p_CommonDepthCrosscorrelationTo_p_INode, 0, 0},  {&_swigt__p_Compound, _p_CompoundTo_p_INode, 0, 0},  {&_swigt__p_Cone, _p_ConeTo_p_INode, 0, 0},  {&_swigt__p_CoreAndShell, _p_CoreAndShellTo_p_INode, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_INode, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_INode, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_INode, 0, 0},  {&_swigt__p_CrosscorrelationModel, _p_CrosscorrelationModelTo_p_INode, 0, 0},  {&_swigt__p_Crystal, _p_CrystalTo_p_INode, 0, 0},  {&_swigt__p_Cylinder, _p_CylinderTo_p_INode, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_INode, 0, 0},  {&_swigt__p_EllipsoidalCylinder, _p_EllipsoidalCylinderTo_p_INode, 0, 0},  {&_swigt__p_ErfInterlayer, _p_ErfInterlayerTo_p_INode, 0, 0},  {&_swigt__p_FuzzySphere, _p_FuzzySphereTo_p_INode, 0, 0},  {&_swigt__p_GaussFisherPeakShape, _p_GaussFisherPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_GaussSphere, _p_GaussSphereTo_p_INode, 0, 0},  {&_swigt__p_HemiEllipsoid, _p_HemiEllipsoidTo_p_INode, 0, 0},  {&_swigt__p_HexagonalLattice2D, _p_HexagonalLattice2DTo_p_INode, 0, 0},  {&_swigt__p_HorizontalCylinder, _p_HorizontalCylinderTo_p_INode, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_INode, 0, 0},  {&_swigt__p_IFormfactor, _p_IFormfactorTo_p_INode, 0, 0},  {&_swigt__p_IFormfactorPolyhedron, _p_IFormfactorPolyhedronTo_p_INode, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_INode, 0, 0},  {&_swigt__p_IInterference, _p_IInterferenceTo_p_INode, 0, 0},  {&_swigt__p_IParticle, _p_IParticleTo_p_INode, 0, 0},  {&_swigt__p_IPeakShape, _p_IPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_IProfile1D, _p_IProfile1DTo_p_INode, 0, 0},  {&_swigt__p_IProfile2D, _p_IProfile2DTo_p_INode, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_INode, 0, 0},  {&_swigt__p_IProfileRipple, _p_IProfileRippleTo_p_INode, 0, 0},  {&_swigt__p_IRotation, _p_IRotationTo_p_INode, 0, 0},  {&_swigt__p_ISampleNode, _p_ISampleNodeTo_p_INode, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_INode, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_INode, 0, 0},  {&_swigt__p_IdentityRotation, _p_IdentityRotationTo_p_INode, 0, 0},  {&_swigt__p_Interference1DLattice, _p_Interference1DLatticeTo_p_INode, 0, 0},  {&_swigt__p_Interference2DLattice, _p_Interference2DLatticeTo_p_INode, 0, 0},  {&_swigt__p_Interference2DParacrystal, _p_Interference2DParacrystalTo_p_INode, 0, 0},  {&_swigt__p_Interference2DSuperLattice, _p_Interference2DSuperLatticeTo_p_INode, 0, 0},  {&_swigt__p_InterferenceFinite2DLattice, _p_InterferenceFinite2DLatticeTo_p_INode, 0, 0},  {&_swigt__p_InterferenceHardDisk, _p_InterferenceHardDiskTo_p_INode, 0, 0},  {&_swigt__p_InterferenceNone, _p_InterferenceNoneTo_p_INode, 0, 0},  {&_swigt__p_InterferenceRadialParacrystal, _p_InterferenceRadialParacrystalTo_p_INode, 0, 0},  {&_swigt__p_InterlayerModel, _p_InterlayerModelTo_p_INode, 0, 0},  {&_swigt__p_IsotropicGaussPeakShape, _p_IsotropicGaussPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_IsotropicLorentzPeakShape, _p_IsotropicLorentzPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_K_CorrelationModel, _p_K_CorrelationModelTo_p_INode, 0, 0},  {&_swigt__p_Lattice2D, _p_Lattice2DTo_p_INode, 0, 0},  {&_swigt__p_Lattice3D, _p_Lattice3DTo_p_INode, 0, 0},  {&_swigt__p_Layer, _p_LayerTo_p_INode, 0, 0},  {&_swigt__p_LayerRoughness, _p_LayerRoughnessTo_p_INode, 0, 0},  {&_swigt__p_LinearGrowthModel, _p_LinearGrowthModelTo_p_INode, 0, 0},  {&_swigt__p_LongBoxGauss, _p_LongBoxGaussTo_p_INode, 0, 0},  {&_swigt__p_LongBoxLorentz, _p_LongBoxLorentzTo_p_INode, 0, 0},  {&_swigt__p_LorentzFisherPeakShape, _p_LorentzFisherPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_Mesocrystal, _p_MesocrystalTo_p_INode, 0, 0},  {&_swigt__p_MisesFisherGaussPeakShape, _p_MisesFisherGaussPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_MisesGaussPeakShape, _p_MisesGaussPeakShapeTo_p_INode, 0, 0},  {&_swigt__p_Particle, _p_ParticleTo_p_INode, 0, 0},  {&_swigt__p_ParticleLayout, _p_ParticleLayoutTo_p_INode, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_INode, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_INode, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_INode, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_INode, 0, 0},  {&_swigt__p_Profile1DCauchy, _p_Profile1DCauchyTo_p_INode, 0, 0},  {&_swigt__p_Profile1DCosine, _p_Profile1DCosineTo_p_INode, 0, 0},  {&_swigt__p_Profile1DGate, _p_Profile1DGateTo_p_INode, 0, 0},  {&_swigt__p_Profile1DGauss, _p_Profile1DGaussTo_p_INode, 0, 0},  {&_swigt__p_Profile1DTriangle, _p_Profile1DTriangleTo_p_INode, 0, 0},  {&_swigt__p_Profile1DVoigt, _p_Profile1DVoigtTo_p_INode, 0, 0},  {&_swigt__p_Profile2DCauchy, _p_Profile2DCauchyTo_p_INode, 0, 0},  {&_swigt__p_Profile2DCone, _p_Profile2DConeTo_p_INode, 0, 0},  {&_swigt__p_Profile2DGate, _p_Profile2DGateTo_p_INode, 0, 0},  {&_swigt__p_Profile2DGauss, _p_Profile2DGaussTo_p_INode, 0, 0},  {&_swigt__p_Profile2DVoigt, _p_Profile2DVoigtTo_p_INode, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_INode, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_INode, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_INode, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_INode, 0, 0},  {&_swigt__p_RotationEuler, _p_RotationEulerTo_p_INode, 0, 0},  {&_swigt__p_RotationX, _p_RotationXTo_p_INode, 0, 0},  {&_swigt__p_RotationY, _p_RotationYTo_p_INode, 0, 0},  {&_swigt__p_RotationZ, _p_RotationZTo_p_INode, 0, 0},  {&_swigt__p_Sample, _p_SampleTo_p_INode, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_INode, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_INode, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_INode, 0, 0},  {&_swigt__p_SpatialFrequencyCrosscorrelation, _p_SpatialFrequencyCrosscorrelationTo_p_INode, 0, 0},  {&_swigt__p_Sphere, _p_SphereTo_p_INode, 0, 0},  {&_swigt__p_Spheroid, _p_SpheroidTo_p_INode, 0, 0},  {&_swigt__p_SquareLattice2D, _p_SquareLattice2DTo_p_INode, 0, 0},  {&_swigt__p_TanhInterlayer, _p_TanhInterlayerTo_p_INode, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_INode, 0, 0},  {&_swigt__p_TruncatedSphere, _p_TruncatedSphereTo_p_INode, 0, 0},  {&_swigt__p_TruncatedSpheroid, _p_TruncatedSpheroidTo_p_INode, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IParticle[] = {  {&_swigt__p_IParticle, 0, 0, 0},  {&_swigt__p_Compound, _p_CompoundTo_p_IParticle, 0, 0},  {&_swigt__p_CoreAndShell, _p_CoreAndShellTo_p_IParticle, 0, 0},  {&_swigt__p_Mesocrystal, _p_MesocrystalTo_p_IParticle, 0, 0},  {&_swigt__p_Particle, _p_ParticleTo_p_IParticle, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IPeakShape[] = {  {&_swigt__p_IPeakShape, 0, 0, 0},  {&_swigt__p_GaussFisherPeakShape, _p_GaussFisherPeakShapeTo_p_IPeakShape, 0, 0},  {&_swigt__p_IsotropicGaussPeakShape, _p_IsotropicGaussPeakShapeTo_p_IPeakShape, 0, 0},  {&_swigt__p_IsotropicLorentzPeakShape, _p_IsotropicLorentzPeakShapeTo_p_IPeakShape, 0, 0},  {&_swigt__p_LorentzFisherPeakShape, _p_LorentzFisherPeakShapeTo_p_IPeakShape, 0, 0},  {&_swigt__p_MisesFisherGaussPeakShape, _p_MisesFisherGaussPeakShapeTo_p_IPeakShape, 0, 0},  {&_swigt__p_MisesGaussPeakShape, _p_MisesGaussPeakShapeTo_p_IPeakShape, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IProfile1D[] = {  {&_swigt__p_IProfile1D, 0, 0, 0},  {&_swigt__p_Profile1DCauchy, _p_Profile1DCauchyTo_p_IProfile1D, 0, 0},  {&_swigt__p_Profile1DCosine, _p_Profile1DCosineTo_p_IProfile1D, 0, 0},  {&_swigt__p_Profile1DGate, _p_Profile1DGateTo_p_IProfile1D, 0, 0},  {&_swigt__p_Profile1DGauss, _p_Profile1DGaussTo_p_IProfile1D, 0, 0},  {&_swigt__p_Profile1DTriangle, _p_Profile1DTriangleTo_p_IProfile1D, 0, 0},  {&_swigt__p_Profile1DVoigt, _p_Profile1DVoigtTo_p_IProfile1D, 0, 0},{0, 0, 0, 0}};
@@ -77559,7 +77559,7 @@ static swig_cast_info _swigc__p_IProfile2D[] = {  {&_swigt__p_IProfile2D, 0, 0,
 static swig_cast_info _swigc__p_IProfileRectangularRipple[] = {  {&_swigt__p_IProfileRectangularRipple, 0, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_IProfileRectangularRipple, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_IProfileRectangularRipple, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IProfileRipple[] = {  {&_swigt__p_IProfileRipple, 0, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_IProfileRipple, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_IProfileRipple, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_IProfileRipple, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_IProfileRipple, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_IProfileRipple, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_IProfileRipple, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_IProfileRipple, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_IProfileRipple, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_IProfileRipple, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_IProfileRipple, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_IProfileRipple, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IRotation[] = {  {&_swigt__p_IRotation, 0, 0, 0},  {&_swigt__p_IdentityRotation, _p_IdentityRotationTo_p_IRotation, 0, 0},  {&_swigt__p_RotationEuler, _p_RotationEulerTo_p_IRotation, 0, 0},  {&_swigt__p_RotationX, _p_RotationXTo_p_IRotation, 0, 0},  {&_swigt__p_RotationY, _p_RotationYTo_p_IRotation, 0, 0},  {&_swigt__p_RotationZ, _p_RotationZTo_p_IRotation, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_ISampleNode[] = {  {&_swigt__p_ISampleNode, 0, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_ISampleNode, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_ISampleNode, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_ISampleNode, 0, 0},  {&_swigt__p_Compound, _p_CompoundTo_p_ISampleNode, 0, 0},  {&_swigt__p_Cone, _p_ConeTo_p_ISampleNode, 0, 0},  {&_swigt__p_CoreAndShell, _p_CoreAndShellTo_p_ISampleNode, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_ISampleNode, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Crystal, _p_CrystalTo_p_ISampleNode, 0, 0},  {&_swigt__p_Cylinder, _p_CylinderTo_p_ISampleNode, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_EllipsoidalCylinder, _p_EllipsoidalCylinderTo_p_ISampleNode, 0, 0},  {&_swigt__p_FuzzySphere, _p_FuzzySphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_GaussSphere, _p_GaussSphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_HemiEllipsoid, _p_HemiEllipsoidTo_p_ISampleNode, 0, 0},  {&_swigt__p_HorizontalCylinder, _p_HorizontalCylinderTo_p_ISampleNode, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_IFormfactor, _p_IFormfactorTo_p_ISampleNode, 0, 0},  {&_swigt__p_IFormfactorPolyhedron, _p_IFormfactorPolyhedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_ISampleNode, 0, 0},  {&_swigt__p_IParticle, _p_IParticleTo_p_ISampleNode, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_IProfileRipple, _p_IProfileRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_Layer, _p_LayerTo_p_ISampleNode, 0, 0},  {&_swigt__p_LayerRoughness, _p_LayerRoughnessTo_p_ISampleNode, 0, 0},  {&_swigt__p_LongBoxGauss, _p_LongBoxGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_LongBoxLorentz, _p_LongBoxLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Mesocrystal, _p_MesocrystalTo_p_ISampleNode, 0, 0},  {&_swigt__p_MultiLayer, _p_MultiLayerTo_p_ISampleNode, 0, 0},  {&_swigt__p_Particle, _p_ParticleTo_p_ISampleNode, 0, 0},  {&_swigt__p_ParticleLayout, _p_ParticleLayoutTo_p_ISampleNode, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_ISampleNode, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_ISampleNode, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_ISampleNode, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Sphere, _p_SphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_Spheroid, _p_SpheroidTo_p_ISampleNode, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_ISampleNode, 0, 0},  {&_swigt__p_TruncatedSphere, _p_TruncatedSphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_TruncatedSpheroid, _p_TruncatedSpheroidTo_p_ISampleNode, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_ISampleNode[] = {  {&_swigt__p_ISampleNode, 0, 0, 0},  {&_swigt__p_BarGauss, _p_BarGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_BarLorentz, _p_BarLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Bipyramid4, _p_Bipyramid4To_p_ISampleNode, 0, 0},  {&_swigt__p_Box, _p_BoxTo_p_ISampleNode, 0, 0},  {&_swigt__p_CantellatedCube, _p_CantellatedCubeTo_p_ISampleNode, 0, 0},  {&_swigt__p_Compound, _p_CompoundTo_p_ISampleNode, 0, 0},  {&_swigt__p_Cone, _p_ConeTo_p_ISampleNode, 0, 0},  {&_swigt__p_CoreAndShell, _p_CoreAndShellTo_p_ISampleNode, 0, 0},  {&_swigt__p_CosineRippleBox, _p_CosineRippleBoxTo_p_ISampleNode, 0, 0},  {&_swigt__p_CosineRippleGauss, _p_CosineRippleGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_CosineRippleLorentz, _p_CosineRippleLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Crystal, _p_CrystalTo_p_ISampleNode, 0, 0},  {&_swigt__p_Cylinder, _p_CylinderTo_p_ISampleNode, 0, 0},  {&_swigt__p_Dodecahedron, _p_DodecahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_EllipsoidalCylinder, _p_EllipsoidalCylinderTo_p_ISampleNode, 0, 0},  {&_swigt__p_FuzzySphere, _p_FuzzySphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_GaussSphere, _p_GaussSphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_HemiEllipsoid, _p_HemiEllipsoidTo_p_ISampleNode, 0, 0},  {&_swigt__p_HorizontalCylinder, _p_HorizontalCylinderTo_p_ISampleNode, 0, 0},  {&_swigt__p_ICosineRipple, _p_ICosineRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_IFormfactor, _p_IFormfactorTo_p_ISampleNode, 0, 0},  {&_swigt__p_IFormfactorPolyhedron, _p_IFormfactorPolyhedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_IFormfactorPrism, _p_IFormfactorPrismTo_p_ISampleNode, 0, 0},  {&_swigt__p_IParticle, _p_IParticleTo_p_ISampleNode, 0, 0},  {&_swigt__p_IProfileRectangularRipple, _p_IProfileRectangularRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_IProfileRipple, _p_IProfileRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_ISawtoothRipple, _p_ISawtoothRippleTo_p_ISampleNode, 0, 0},  {&_swigt__p_Icosahedron, _p_IcosahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_Layer, _p_LayerTo_p_ISampleNode, 0, 0},  {&_swigt__p_LayerRoughness, _p_LayerRoughnessTo_p_ISampleNode, 0, 0},  {&_swigt__p_LongBoxGauss, _p_LongBoxGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_LongBoxLorentz, _p_LongBoxLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Mesocrystal, _p_MesocrystalTo_p_ISampleNode, 0, 0},  {&_swigt__p_Particle, _p_ParticleTo_p_ISampleNode, 0, 0},  {&_swigt__p_ParticleLayout, _p_ParticleLayoutTo_p_ISampleNode, 0, 0},  {&_swigt__p_PlatonicOctahedron, _p_PlatonicOctahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_PlatonicTetrahedron, _p_PlatonicTetrahedronTo_p_ISampleNode, 0, 0},  {&_swigt__p_Prism3, _p_Prism3To_p_ISampleNode, 0, 0},  {&_swigt__p_Prism6, _p_Prism6To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid2, _p_Pyramid2To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid3, _p_Pyramid3To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid4, _p_Pyramid4To_p_ISampleNode, 0, 0},  {&_swigt__p_Pyramid6, _p_Pyramid6To_p_ISampleNode, 0, 0},  {&_swigt__p_Sample, _p_SampleTo_p_ISampleNode, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_ISampleNode, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_ISampleNode, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_ISampleNode, 0, 0},  {&_swigt__p_Sphere, _p_SphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_Spheroid, _p_SpheroidTo_p_ISampleNode, 0, 0},  {&_swigt__p_TruncatedCube, _p_TruncatedCubeTo_p_ISampleNode, 0, 0},  {&_swigt__p_TruncatedSphere, _p_TruncatedSphereTo_p_ISampleNode, 0, 0},  {&_swigt__p_TruncatedSpheroid, _p_TruncatedSpheroidTo_p_ISampleNode, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ISawtoothRipple[] = {  {&_swigt__p_ISawtoothRipple, 0, 0, 0},  {&_swigt__p_SawtoothRippleBox, _p_SawtoothRippleBoxTo_p_ISawtoothRipple, 0, 0},  {&_swigt__p_SawtoothRippleGauss, _p_SawtoothRippleGaussTo_p_ISawtoothRipple, 0, 0},  {&_swigt__p_SawtoothRippleLorentz, _p_SawtoothRippleLorentzTo_p_ISawtoothRipple, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ISelectionRule[] = {  {&_swigt__p_ISelectionRule, 0, 0, 0},  {&_swigt__p_SimpleSelectionRule, _p_SimpleSelectionRuleTo_p_ISelectionRule, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_Icosahedron[] = {  {&_swigt__p_Icosahedron, 0, 0, 0},{0, 0, 0, 0}};
@@ -77590,7 +77590,6 @@ static swig_cast_info _swigc__p_MaterialBySLDImpl[] = {  {&_swigt__p_MaterialByS
 static swig_cast_info _swigc__p_Mesocrystal[] = {  {&_swigt__p_Mesocrystal, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_MisesFisherGaussPeakShape[] = {  {&_swigt__p_MisesFisherGaussPeakShape, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_MisesGaussPeakShape[] = {  {&_swigt__p_MisesGaussPeakShape, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_MultiLayer[] = {  {&_swigt__p_MultiLayer, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_Particle[] = {  {&_swigt__p_Particle, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ParticleLayout[] = {  {&_swigt__p_ParticleLayout, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_PlatonicOctahedron[] = {  {&_swigt__p_PlatonicOctahedron, 0, 0, 0},{0, 0, 0, 0}};
@@ -77619,6 +77618,7 @@ static swig_cast_info _swigc__p_RotationX[] = {  {&_swigt__p_RotationX, 0, 0, 0}
 static swig_cast_info _swigc__p_RotationY[] = {  {&_swigt__p_RotationY, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_RotationZ[] = {  {&_swigt__p_RotationZ, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_RoughnessMap[] = {  {&_swigt__p_RoughnessMap, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_Sample[] = {  {&_swigt__p_Sample, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_SawtoothRippleBox[] = {  {&_swigt__p_SawtoothRippleBox, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_SawtoothRippleGauss[] = {  {&_swigt__p_SawtoothRippleGauss, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_SawtoothRippleLorentz[] = {  {&_swigt__p_SawtoothRippleLorentz, 0, 0, 0},{0, 0, 0, 0}};
@@ -77760,7 +77760,6 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_Mesocrystal,
   _swigc__p_MisesFisherGaussPeakShape,
   _swigc__p_MisesGaussPeakShape,
-  _swigc__p_MultiLayer,
   _swigc__p_Particle,
   _swigc__p_ParticleLayout,
   _swigc__p_PlatonicOctahedron,
@@ -77789,6 +77788,7 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_RotationY,
   _swigc__p_RotationZ,
   _swigc__p_RoughnessMap,
+  _swigc__p_Sample,
   _swigc__p_SawtoothRippleBox,
   _swigc__p_SawtoothRippleGauss,
   _swigc__p_SawtoothRippleLorentz,
diff --git a/auto/Wrap/libBornAgainSim.py b/auto/Wrap/libBornAgainSim.py
index 4f9e7e7221671e690b48d079f0f6667bbbfcc757..e3ff3d3a7dc631743c9984c0bc910841cb1c380a 100644
--- a/auto/Wrap/libBornAgainSim.py
+++ b/auto/Wrap/libBornAgainSim.py
@@ -2699,7 +2699,7 @@ class ScatteringSimulation(ISimulation):
     __repr__ = _swig_repr
 
     def __init__(self, beam, sample, detector):
-        r"""__init__(ScatteringSimulation self, Beam const & beam, MultiLayer const & sample, IDetector const & detector) -> ScatteringSimulation"""
+        r"""__init__(ScatteringSimulation self, Beam const & beam, Sample const & sample, IDetector const & detector) -> ScatteringSimulation"""
         _libBornAgainSim.ScatteringSimulation_swiginit(self, _libBornAgainSim.new_ScatteringSimulation(beam, sample, detector))
     __swig_destroy__ = _libBornAgainSim.delete_ScatteringSimulation
 
@@ -2724,7 +2724,7 @@ class DepthprobeSimulation(ISimulation):
     __repr__ = _swig_repr
 
     def __init__(self, scan, sample, zaxis, flags=0):
-        r"""__init__(DepthprobeSimulation self, BeamScan scan, MultiLayer const & sample, Scale zaxis, int flags=0) -> DepthprobeSimulation"""
+        r"""__init__(DepthprobeSimulation self, BeamScan scan, Sample const & sample, Scale zaxis, int flags=0) -> DepthprobeSimulation"""
         _libBornAgainSim.DepthprobeSimulation_swiginit(self, _libBornAgainSim.new_DepthprobeSimulation(scan, sample, zaxis, flags))
     __swig_destroy__ = _libBornAgainSim.delete_DepthprobeSimulation
 
@@ -2748,7 +2748,7 @@ class SpecularSimulation(ISimulation):
     __repr__ = _swig_repr
 
     def __init__(self, scan, sample):
-        r"""__init__(SpecularSimulation self, BeamScan scan, MultiLayer const & sample) -> SpecularSimulation"""
+        r"""__init__(SpecularSimulation self, BeamScan scan, Sample const & sample) -> SpecularSimulation"""
         _libBornAgainSim.SpecularSimulation_swiginit(self, _libBornAgainSim.new_SpecularSimulation(scan, sample))
     __swig_destroy__ = _libBornAgainSim.delete_SpecularSimulation
 
@@ -2765,7 +2765,7 @@ class OffspecSimulation(ISimulation):
     __repr__ = _swig_repr
 
     def __init__(self, scan, sample, detector):
-        r"""__init__(OffspecSimulation self, PhysicalScan scan, MultiLayer const & sample, OffspecDetector const & detector) -> OffspecSimulation"""
+        r"""__init__(OffspecSimulation self, PhysicalScan scan, Sample const & sample, OffspecDetector const & detector) -> OffspecSimulation"""
         _libBornAgainSim.OffspecSimulation_swiginit(self, _libBornAgainSim.new_OffspecSimulation(scan, sample, detector))
     __swig_destroy__ = _libBornAgainSim.delete_OffspecSimulation
 
@@ -2866,7 +2866,7 @@ def codeHeader(code):
     return _libBornAgainSim.codeHeader(code)
 
 def sampleCode(sample):
-    r"""sampleCode(MultiLayer const & sample) -> std::string"""
+    r"""sampleCode(Sample const & sample) -> std::string"""
     return _libBornAgainSim.sampleCode(sample)
 
 def simulationPlotCode(simulation):
diff --git a/auto/Wrap/libBornAgainSim_wrap.cpp b/auto/Wrap/libBornAgainSim_wrap.cpp
index a5ad5deb549a52b102ba243207d80d4e57cccc0c..08d82d652a259417c8a33f2ce2e24dfd2301e42d 100644
--- a/auto/Wrap/libBornAgainSim_wrap.cpp
+++ b/auto/Wrap/libBornAgainSim_wrap.cpp
@@ -3668,15 +3668,15 @@ namespace Swig {
 #define SWIGTYPE_p_IntensityFunctionSqrt swig_types[20]
 #define SWIGTYPE_p_IterationInfo swig_types[21]
 #define SWIGTYPE_p_LambdaScan swig_types[22]
-#define SWIGTYPE_p_MultiLayer swig_types[23]
-#define SWIGTYPE_p_OffspecDetector swig_types[24]
-#define SWIGTYPE_p_OffspecSimulation swig_types[25]
-#define SWIGTYPE_p_PhysicalScan swig_types[26]
-#define SWIGTYPE_p_PoissonBackground swig_types[27]
-#define SWIGTYPE_p_PyBuilderCallback swig_types[28]
-#define SWIGTYPE_p_PyObserverCallback swig_types[29]
-#define SWIGTYPE_p_QzScan swig_types[30]
-#define SWIGTYPE_p_Rotation3DT_double_t swig_types[31]
+#define SWIGTYPE_p_OffspecDetector swig_types[23]
+#define SWIGTYPE_p_OffspecSimulation swig_types[24]
+#define SWIGTYPE_p_PhysicalScan swig_types[25]
+#define SWIGTYPE_p_PoissonBackground swig_types[26]
+#define SWIGTYPE_p_PyBuilderCallback swig_types[27]
+#define SWIGTYPE_p_PyObserverCallback swig_types[28]
+#define SWIGTYPE_p_QzScan swig_types[29]
+#define SWIGTYPE_p_Rotation3DT_double_t swig_types[30]
+#define SWIGTYPE_p_Sample swig_types[31]
 #define SWIGTYPE_p_Scale swig_types[32]
 #define SWIGTYPE_p_ScatteringSimulation swig_types[33]
 #define SWIGTYPE_p_SimulationOptions swig_types[34]
@@ -35948,7 +35948,7 @@ SWIGINTERN PyObject *ISimulation_swigregister(PyObject *SWIGUNUSEDPARM(self), Py
 SWIGINTERN PyObject *_wrap_new_ScatteringSimulation(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   Beam *arg1 = 0 ;
-  MultiLayer *arg2 = 0 ;
+  Sample *arg2 = 0 ;
   IDetector *arg3 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -35969,14 +35969,14 @@ SWIGINTERN PyObject *_wrap_new_ScatteringSimulation(PyObject *self, PyObject *ar
     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ScatteringSimulation" "', argument " "1"" of type '" "Beam const &""'"); 
   }
   arg1 = reinterpret_cast< Beam * >(argp1);
-  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ScatteringSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_ScatteringSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ScatteringSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ScatteringSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
-  arg2 = reinterpret_cast< MultiLayer * >(argp2);
+  arg2 = reinterpret_cast< Sample * >(argp2);
   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_IDetector,  0  | 0);
   if (!SWIG_IsOK(res3)) {
     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_ScatteringSimulation" "', argument " "3"" of type '" "IDetector const &""'"); 
@@ -35987,7 +35987,7 @@ SWIGINTERN PyObject *_wrap_new_ScatteringSimulation(PyObject *self, PyObject *ar
   arg3 = reinterpret_cast< IDetector * >(argp3);
   {
     try {
-      result = (ScatteringSimulation *)new ScatteringSimulation((Beam const &)*arg1,(MultiLayer const &)*arg2,(IDetector const &)*arg3);
+      result = (ScatteringSimulation *)new ScatteringSimulation((Beam const &)*arg1,(Sample const &)*arg2,(IDetector const &)*arg3);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -36236,7 +36236,7 @@ SWIGINTERN PyObject *Swig_var_WaveProperty_Phase_get(void) {
 SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
   PyObject *resultobj = 0;
   BeamScan *arg1 = 0 ;
-  MultiLayer *arg2 = 0 ;
+  Sample *arg2 = 0 ;
   Scale *arg3 = 0 ;
   int arg4 ;
   void *argp1 = 0 ;
@@ -36259,14 +36259,14 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_0(PyObject *self, Py_s
     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DepthprobeSimulation" "', argument " "1"" of type '" "BeamScan const &""'"); 
   }
   arg1 = reinterpret_cast< BeamScan * >(argp1);
-  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
-  arg2 = reinterpret_cast< MultiLayer * >(argp2);
+  arg2 = reinterpret_cast< Sample * >(argp2);
   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_Scale,  0  | 0);
   if (!SWIG_IsOK(res3)) {
     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_DepthprobeSimulation" "', argument " "3"" of type '" "Scale const &""'"); 
@@ -36282,7 +36282,7 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_0(PyObject *self, Py_s
   arg4 = static_cast< int >(val4);
   {
     try {
-      result = (DepthprobeSimulation *)new DepthprobeSimulation((BeamScan const &)*arg1,(MultiLayer const &)*arg2,(Scale const &)*arg3,arg4);
+      result = (DepthprobeSimulation *)new DepthprobeSimulation((BeamScan const &)*arg1,(Sample const &)*arg2,(Scale const &)*arg3,arg4);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -36301,7 +36301,7 @@ fail:
 SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
   PyObject *resultobj = 0;
   BeamScan *arg1 = 0 ;
-  MultiLayer *arg2 = 0 ;
+  Sample *arg2 = 0 ;
   Scale *arg3 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -36321,14 +36321,14 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_1(PyObject *self, Py_s
     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DepthprobeSimulation" "', argument " "1"" of type '" "BeamScan const &""'"); 
   }
   arg1 = reinterpret_cast< BeamScan * >(argp1);
-  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DepthprobeSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
-  arg2 = reinterpret_cast< MultiLayer * >(argp2);
+  arg2 = reinterpret_cast< Sample * >(argp2);
   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_Scale,  0  | 0);
   if (!SWIG_IsOK(res3)) {
     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_DepthprobeSimulation" "', argument " "3"" of type '" "Scale const &""'"); 
@@ -36339,7 +36339,7 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation__SWIG_1(PyObject *self, Py_s
   arg3 = reinterpret_cast< Scale * >(argp3);
   {
     try {
-      result = (DepthprobeSimulation *)new DepthprobeSimulation((BeamScan const &)*arg1,(MultiLayer const &)*arg2,(Scale const &)*arg3);
+      result = (DepthprobeSimulation *)new DepthprobeSimulation((BeamScan const &)*arg1,(Sample const &)*arg2,(Scale const &)*arg3);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -36368,7 +36368,7 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation(PyObject *self, PyObject *ar
     int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_BeamScan, SWIG_POINTER_NO_NULL | 0);
     _v = SWIG_CheckState(res);
     if (_v) {
-      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_MultiLayer, SWIG_POINTER_NO_NULL | 0);
+      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_Sample, SWIG_POINTER_NO_NULL | 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_Scale, SWIG_POINTER_NO_NULL | 0);
@@ -36384,7 +36384,7 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation(PyObject *self, PyObject *ar
     int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_BeamScan, SWIG_POINTER_NO_NULL | 0);
     _v = SWIG_CheckState(res);
     if (_v) {
-      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_MultiLayer, SWIG_POINTER_NO_NULL | 0);
+      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_Sample, SWIG_POINTER_NO_NULL | 0);
       _v = SWIG_CheckState(res);
       if (_v) {
         int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_Scale, SWIG_POINTER_NO_NULL | 0);
@@ -36405,8 +36405,8 @@ SWIGINTERN PyObject *_wrap_new_DepthprobeSimulation(PyObject *self, PyObject *ar
 fail:
   SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_DepthprobeSimulation'.\n"
     "  Possible C/C++ prototypes are:\n"
-    "    DepthprobeSimulation::DepthprobeSimulation(BeamScan const &,MultiLayer const &,Scale const &,int)\n"
-    "    DepthprobeSimulation::DepthprobeSimulation(BeamScan const &,MultiLayer const &,Scale const &)\n");
+    "    DepthprobeSimulation::DepthprobeSimulation(BeamScan const &,Sample const &,Scale const &,int)\n"
+    "    DepthprobeSimulation::DepthprobeSimulation(BeamScan const &,Sample const &,Scale const &)\n");
   return 0;
 }
 
@@ -36492,7 +36492,7 @@ SWIGINTERN PyObject *DepthprobeSimulation_swiginit(PyObject *SWIGUNUSEDPARM(self
 SWIGINTERN PyObject *_wrap_new_SpecularSimulation(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   BeamScan *arg1 = 0 ;
-  MultiLayer *arg2 = 0 ;
+  Sample *arg2 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   void *argp2 = 0 ;
@@ -36510,17 +36510,17 @@ SWIGINTERN PyObject *_wrap_new_SpecularSimulation(PyObject *self, PyObject *args
     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_SpecularSimulation" "', argument " "1"" of type '" "BeamScan const &""'"); 
   }
   arg1 = reinterpret_cast< BeamScan * >(argp1);
-  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_SpecularSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_SpecularSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_SpecularSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_SpecularSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
-  arg2 = reinterpret_cast< MultiLayer * >(argp2);
+  arg2 = reinterpret_cast< Sample * >(argp2);
   {
     try {
-      result = (SpecularSimulation *)new SpecularSimulation((BeamScan const &)*arg1,(MultiLayer const &)*arg2);
+      result = (SpecularSimulation *)new SpecularSimulation((BeamScan const &)*arg1,(Sample const &)*arg2);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -36617,7 +36617,7 @@ SWIGINTERN PyObject *SpecularSimulation_swiginit(PyObject *SWIGUNUSEDPARM(self),
 SWIGINTERN PyObject *_wrap_new_OffspecSimulation(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
   PhysicalScan *arg1 = 0 ;
-  MultiLayer *arg2 = 0 ;
+  Sample *arg2 = 0 ;
   OffspecDetector *arg3 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
@@ -36638,14 +36638,14 @@ SWIGINTERN PyObject *_wrap_new_OffspecSimulation(PyObject *self, PyObject *args)
     SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OffspecSimulation" "', argument " "1"" of type '" "PhysicalScan const &""'"); 
   }
   arg1 = reinterpret_cast< PhysicalScan * >(argp1);
-  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res2)) {
-    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_OffspecSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_OffspecSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
   if (!argp2) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OffspecSimulation" "', argument " "2"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_OffspecSimulation" "', argument " "2"" of type '" "Sample const &""'"); 
   }
-  arg2 = reinterpret_cast< MultiLayer * >(argp2);
+  arg2 = reinterpret_cast< Sample * >(argp2);
   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_OffspecDetector,  0  | 0);
   if (!SWIG_IsOK(res3)) {
     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_OffspecSimulation" "', argument " "3"" of type '" "OffspecDetector const &""'"); 
@@ -36656,7 +36656,7 @@ SWIGINTERN PyObject *_wrap_new_OffspecSimulation(PyObject *self, PyObject *args)
   arg3 = reinterpret_cast< OffspecDetector * >(argp3);
   {
     try {
-      result = (OffspecSimulation *)new OffspecSimulation((PhysicalScan const &)*arg1,(MultiLayer const &)*arg2,(OffspecDetector const &)*arg3);
+      result = (OffspecSimulation *)new OffspecSimulation((PhysicalScan const &)*arg1,(Sample const &)*arg2,(OffspecDetector const &)*arg3);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -37442,7 +37442,7 @@ fail:
 
 SWIGINTERN PyObject *_wrap_sampleCode(PyObject *self, PyObject *args) {
   PyObject *resultobj = 0;
-  MultiLayer *arg1 = 0 ;
+  Sample *arg1 = 0 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   PyObject *swig_obj[1] ;
@@ -37451,17 +37451,17 @@ SWIGINTERN PyObject *_wrap_sampleCode(PyObject *self, PyObject *args) {
   (void)self;
   if (!args) SWIG_fail;
   swig_obj[0] = args;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_MultiLayer,  0  | 0);
+  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1, SWIGTYPE_p_Sample,  0  | 0);
   if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sampleCode" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sampleCode" "', argument " "1"" of type '" "Sample const &""'"); 
   }
   if (!argp1) {
-    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "sampleCode" "', argument " "1"" of type '" "MultiLayer const &""'"); 
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "sampleCode" "', argument " "1"" of type '" "Sample const &""'"); 
   }
-  arg1 = reinterpret_cast< MultiLayer * >(argp1);
+  arg1 = reinterpret_cast< Sample * >(argp1);
   {
     try {
-      result = Py::Export::sampleCode((MultiLayer const &)*arg1);
+      result = Py::Export::sampleCode((Sample const &)*arg1);
     } catch (const std::exception& ex) {
       // message shown in the Python interpreter
       const std::string msg {
@@ -39816,24 +39816,24 @@ static PyMethodDef SwigMethods[] = {
 	 { "ISimulation_options", _wrap_ISimulation_options, METH_O, "ISimulation_options(ISimulation self) -> SimulationOptions &"},
 	 { "ISimulation_simulate", _wrap_ISimulation_simulate, METH_O, "ISimulation_simulate(ISimulation self) -> Datafield"},
 	 { "ISimulation_swigregister", ISimulation_swigregister, METH_O, NULL},
-	 { "new_ScatteringSimulation", _wrap_new_ScatteringSimulation, METH_VARARGS, "new_ScatteringSimulation(Beam const & beam, MultiLayer const & sample, IDetector const & detector) -> ScatteringSimulation"},
+	 { "new_ScatteringSimulation", _wrap_new_ScatteringSimulation, METH_VARARGS, "new_ScatteringSimulation(Beam const & beam, Sample const & sample, IDetector const & detector) -> ScatteringSimulation"},
 	 { "delete_ScatteringSimulation", _wrap_delete_ScatteringSimulation, METH_O, "delete_ScatteringSimulation(ScatteringSimulation self)"},
 	 { "ScatteringSimulation_className", _wrap_ScatteringSimulation_className, METH_O, "ScatteringSimulation_className(ScatteringSimulation self) -> std::string"},
 	 { "ScatteringSimulation_beam", _wrap_ScatteringSimulation_beam, METH_O, "ScatteringSimulation_beam(ScatteringSimulation self) -> Beam &"},
 	 { "ScatteringSimulation_detector", _wrap_ScatteringSimulation_detector, METH_O, "ScatteringSimulation_detector(ScatteringSimulation self) -> IDetector &"},
 	 { "ScatteringSimulation_swigregister", ScatteringSimulation_swigregister, METH_O, NULL},
 	 { "ScatteringSimulation_swiginit", ScatteringSimulation_swiginit, METH_VARARGS, NULL},
-	 { "new_DepthprobeSimulation", _wrap_new_DepthprobeSimulation, METH_VARARGS, "DepthprobeSimulation(BeamScan scan, MultiLayer const & sample, Scale zaxis, int flags=0)"},
+	 { "new_DepthprobeSimulation", _wrap_new_DepthprobeSimulation, METH_VARARGS, "DepthprobeSimulation(BeamScan scan, Sample const & sample, Scale zaxis, int flags=0)"},
 	 { "delete_DepthprobeSimulation", _wrap_delete_DepthprobeSimulation, METH_O, "delete_DepthprobeSimulation(DepthprobeSimulation self)"},
 	 { "DepthprobeSimulation_className", _wrap_DepthprobeSimulation_className, METH_O, "DepthprobeSimulation_className(DepthprobeSimulation self) -> std::string"},
 	 { "DepthprobeSimulation_swigregister", DepthprobeSimulation_swigregister, METH_O, NULL},
 	 { "DepthprobeSimulation_swiginit", DepthprobeSimulation_swiginit, METH_VARARGS, NULL},
-	 { "new_SpecularSimulation", _wrap_new_SpecularSimulation, METH_VARARGS, "new_SpecularSimulation(BeamScan scan, MultiLayer const & sample) -> SpecularSimulation"},
+	 { "new_SpecularSimulation", _wrap_new_SpecularSimulation, METH_VARARGS, "new_SpecularSimulation(BeamScan scan, Sample const & sample) -> SpecularSimulation"},
 	 { "delete_SpecularSimulation", _wrap_delete_SpecularSimulation, METH_O, "delete_SpecularSimulation(SpecularSimulation self)"},
 	 { "SpecularSimulation_className", _wrap_SpecularSimulation_className, METH_O, "SpecularSimulation_className(SpecularSimulation self) -> std::string"},
 	 { "SpecularSimulation_swigregister", SpecularSimulation_swigregister, METH_O, NULL},
 	 { "SpecularSimulation_swiginit", SpecularSimulation_swiginit, METH_VARARGS, NULL},
-	 { "new_OffspecSimulation", _wrap_new_OffspecSimulation, METH_VARARGS, "new_OffspecSimulation(PhysicalScan scan, MultiLayer const & sample, OffspecDetector const & detector) -> OffspecSimulation"},
+	 { "new_OffspecSimulation", _wrap_new_OffspecSimulation, METH_VARARGS, "new_OffspecSimulation(PhysicalScan scan, Sample const & sample, OffspecDetector const & detector) -> OffspecSimulation"},
 	 { "delete_OffspecSimulation", _wrap_delete_OffspecSimulation, METH_O, "delete_OffspecSimulation(OffspecSimulation self)"},
 	 { "OffspecSimulation_className", _wrap_OffspecSimulation_className, METH_O, "OffspecSimulation_className(OffspecSimulation self) -> std::string"},
 	 { "OffspecSimulation_swigregister", OffspecSimulation_swigregister, METH_O, NULL},
@@ -39863,7 +39863,7 @@ static PyMethodDef SwigMethods[] = {
 	 { "PoissonBackground_swigregister", PoissonBackground_swigregister, METH_O, NULL},
 	 { "PoissonBackground_swiginit", PoissonBackground_swiginit, METH_VARARGS, NULL},
 	 { "codeHeader", _wrap_codeHeader, METH_O, "codeHeader(std::string const & code) -> std::string"},
-	 { "sampleCode", _wrap_sampleCode, METH_O, "sampleCode(MultiLayer const & sample) -> std::string"},
+	 { "sampleCode", _wrap_sampleCode, METH_O, "sampleCode(Sample const & sample) -> std::string"},
 	 { "simulationPlotCode", _wrap_simulationPlotCode, METH_O, "simulationPlotCode(ISimulation simulation) -> std::string"},
 	 { "simulationSaveCode", _wrap_simulationSaveCode, METH_VARARGS, "simulationSaveCode(ISimulation simulation, std::string const & fname) -> std::string"},
 	 { "delete_IIntensityFunction", _wrap_delete_IIntensityFunction, METH_O, "delete_IIntensityFunction(IIntensityFunction self)"},
@@ -40070,7 +40070,6 @@ static swig_type_info _swigt__p_IntensityFunctionLog = {"_p_IntensityFunctionLog
 static swig_type_info _swigt__p_IntensityFunctionSqrt = {"_p_IntensityFunctionSqrt", "IntensityFunctionSqrt *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_IterationInfo = {"_p_IterationInfo", "IterationInfo *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_LambdaScan = {"_p_LambdaScan", "LambdaScan *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_MultiLayer = {"_p_MultiLayer", "MultiLayer *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_OffspecDetector = {"_p_OffspecDetector", "OffspecDetector *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_OffspecSimulation = {"_p_OffspecSimulation", "OffspecSimulation *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_PhysicalScan = {"_p_PhysicalScan", "PhysicalScan *", 0, 0, (void*)0, 0};
@@ -40079,6 +40078,7 @@ static swig_type_info _swigt__p_PyBuilderCallback = {"_p_PyBuilderCallback", "Py
 static swig_type_info _swigt__p_PyObserverCallback = {"_p_PyObserverCallback", "PyObserverCallback *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_QzScan = {"_p_QzScan", "QzScan *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Rotation3DT_double_t = {"_p_Rotation3DT_double_t", "RotMatrix *|Rotation3D< double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_Sample = {"_p_Sample", "Sample *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_Scale = {"_p_Scale", "Scale *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_ScatteringSimulation = {"_p_ScatteringSimulation", "ScatteringSimulation *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_SimulationOptions = {"_p_SimulationOptions", "SimulationOptions *", 0, 0, (void*)0, 0};
@@ -40162,7 +40162,6 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_IntensityFunctionSqrt,
   &_swigt__p_IterationInfo,
   &_swigt__p_LambdaScan,
-  &_swigt__p_MultiLayer,
   &_swigt__p_OffspecDetector,
   &_swigt__p_OffspecSimulation,
   &_swigt__p_PhysicalScan,
@@ -40171,6 +40170,7 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_PyObserverCallback,
   &_swigt__p_QzScan,
   &_swigt__p_Rotation3DT_double_t,
+  &_swigt__p_Sample,
   &_swigt__p_Scale,
   &_swigt__p_ScatteringSimulation,
   &_swigt__p_SimulationOptions,
@@ -40254,7 +40254,6 @@ static swig_cast_info _swigc__p_IntensityFunctionLog[] = {  {&_swigt__p_Intensit
 static swig_cast_info _swigc__p_IntensityFunctionSqrt[] = {  {&_swigt__p_IntensityFunctionSqrt, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_IterationInfo[] = {  {&_swigt__p_IterationInfo, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_LambdaScan[] = {  {&_swigt__p_LambdaScan, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_MultiLayer[] = {  {&_swigt__p_MultiLayer, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_OffspecDetector[] = {  {&_swigt__p_OffspecDetector, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_OffspecSimulation[] = {  {&_swigt__p_OffspecSimulation, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_PhysicalScan[] = {  {&_swigt__p_PhysicalScan, 0, 0, 0},  {&_swigt__p_AlphaScan, _p_AlphaScanTo_p_PhysicalScan, 0, 0},  {&_swigt__p_LambdaScan, _p_LambdaScanTo_p_PhysicalScan, 0, 0},{0, 0, 0, 0}};
@@ -40263,6 +40262,7 @@ static swig_cast_info _swigc__p_PyBuilderCallback[] = {  {&_swigt__p_PyBuilderCa
 static swig_cast_info _swigc__p_PyObserverCallback[] = {  {&_swigt__p_PyObserverCallback, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_QzScan[] = {  {&_swigt__p_QzScan, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_Rotation3DT_double_t[] = {  {&_swigt__p_Rotation3DT_double_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_Sample[] = {  {&_swigt__p_Sample, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_Scale[] = {  {&_swigt__p_Scale, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_ScatteringSimulation[] = {  {&_swigt__p_ScatteringSimulation, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_SimulationOptions[] = {  {&_swigt__p_SimulationOptions, 0, 0, 0},{0, 0, 0, 0}};
@@ -40346,7 +40346,6 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_IntensityFunctionSqrt,
   _swigc__p_IterationInfo,
   _swigc__p_LambdaScan,
-  _swigc__p_MultiLayer,
   _swigc__p_OffspecDetector,
   _swigc__p_OffspecSimulation,
   _swigc__p_PhysicalScan,
@@ -40355,6 +40354,7 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_PyObserverCallback,
   _swigc__p_QzScan,
   _swigc__p_Rotation3DT_double_t,
+  _swigc__p_Sample,
   _swigc__p_Scale,
   _swigc__p_ScatteringSimulation,
   _swigc__p_SimulationOptions,
diff --git a/devtools/fakeData/fake-gisas1.py b/devtools/fakeData/fake-gisas1.py
index f40ea3f0a43b716351183963bf8ffbc78d4b5ff8..8f3fcd59105f05b2fb07cb77c053bdd927f83d18 100755
--- a/devtools/fakeData/fake-gisas1.py
+++ b/devtools/fakeData/fake-gisas1.py
@@ -39,7 +39,7 @@ def get_sample(params):
     sigma, hurst, corrLength = 0.2*nm, 0.3, 20*nm
     roughness = ba.LayerRoughness(sigma, hurst, corrLength)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayerWithTopRoughness(layer_2, roughness)
     return sample
diff --git a/hugo/content/ex/sample/assemblies/lattice-ori-distr.md b/hugo/content/ex/sample/assemblies/lattice-ori-distr.md
index 2c0e1255c67f8e5ceb40bea2c0a2064be896314f..d17159de67a479f6c9d5a4c0a23c88b01b5d48af 100644
--- a/hugo/content/ex/sample/assemblies/lattice-ori-distr.md
+++ b/hugo/content/ex/sample/assemblies/lattice-ori-distr.md
@@ -14,7 +14,7 @@ The differently oriented lattices are incoherently summed
 using a loop over the parameter distribution samples.
 This is currently supported only under Python scripting, not in the GUI.
 
-Class references: [Layer](/ref/sample/multilayer/layer), [Distributions](/ref/other/distributions).
+Class references: [Layer](/ref/sample/sample/layer), [Distributions](/ref/other/distributions).
 
 {{< galleryscg >}}
 {{< figscg src="/img/auto/scatter2d/LatticeOrientationDistribution.png" width="450px">}}
diff --git a/hugo/content/ex/sample/particles/polydispersity.md b/hugo/content/ex/sample/particles/polydispersity.md
index 9edb3b367d24d37d1f1e60c59b6a476de2540ebd..c80743ba33a929aa60f0ae008d1b3d895a7ab3ca 100644
--- a/hugo/content/ex/sample/particles/polydispersity.md
+++ b/hugo/content/ex/sample/particles/polydispersity.md
@@ -12,7 +12,7 @@ The uncorrelated particles are added to a layout using a loop
 over the parameter distribution samples. This is currently supported
 only under Python scripting, not in the GUI.
 
-Class references: [Layout](/ref/sample/multilayer/layout),
+Class references: [Layout](/ref/sample/sample/layout),
 [Distributions](/ref/other/distributions).
 
 {{< galleryscg >}}
diff --git a/hugo/content/gui/gui-fitting/index.md b/hugo/content/gui/gui-fitting/index.md
index e99a028a96cc2fa4e9356a6a5065315309da391c..8a2b68c0e605c88368e0f69d35c0c1871f06b48b 100644
--- a/hugo/content/gui/gui-fitting/index.md
+++ b/hugo/content/gui/gui-fitting/index.md
@@ -80,7 +80,7 @@ Remember to set the instrument linked to the data (here, "GISAS").
 ### 4. Performing a fit
 
 #### 4.1 Preparation for fitting
-To setup the fitting job, switch back to the Simulation View. In the "Real Data" field, select the name of the real (experimental) dataset which was imported. Now, the data selection box states, as shown below, that an instrument "GISAS" will be used together with the sample "Sample", which represents the multilayer with cylinders that was constructed in section 1, in order to fit the dataset "experimental_data". Click on the "Run Simulation" button to start the simulation.
+To setup the fitting job, switch back to the Simulation View. In the "Real Data" field, select the name of the real (experimental) dataset which was imported. Now, the data selection box states, as shown below, that an instrument "GISAS" will be used together with the sample "Sample", which represents the sample with cylinders that was constructed in section 1, in order to fit the dataset "experimental_data". Click on the "Run Simulation" button to start the simulation.
 
 {{< figscg src="/img/draw/tutorial_fitintro04_simulation.png" width="800px" class="center" >}}
 
diff --git a/hugo/content/introduction/architecture/index.md b/hugo/content/introduction/architecture/index.md
index 63c7611ff88a84c124733132acf6222f680209d8..299d254182216e96e961ed0924f2fa8daa1ac600 100644
--- a/hugo/content/introduction/architecture/index.md
+++ b/hugo/content/introduction/architecture/index.md
@@ -37,7 +37,7 @@ to be created.
 
 {{< figure src="/img/draw/nodes_architecture4.png" class="center">}}
 
-The parent MultiLayer object represents the sample and contains three
+The parent Sample object represents the sample and contains three
 children: the semi-infinite air layer, the semi-infinite substrate
 layer, and the interface between them. The air layer contains the
 so-called ParticleLayout object, which holds information about the
diff --git a/hugo/content/ref/sample/multilayer/_index.md b/hugo/content/ref/sample/multilayer/_index.md
index 594eab1d62af8342ff3cc9806fafc6cff85f0af7..f76db700ddb403a65a1e8b96f716e843fa3dbfb6 100644
--- a/hugo/content/ref/sample/multilayer/_index.md
+++ b/hugo/content/ref/sample/multilayer/_index.md
@@ -1,27 +1,26 @@
 +++
-title = "Multilayer"
+title = "Sample"
 weight = 35
 +++
 
-## Class MultiLayer (toplevel sample model)
+## Class Sample (toplevel sample model)
 
 In BornAgain, for the time being, a sample is always represented by an
-instance of class `MultiLayer`, even if it is a single-layer SAS sample.
+instance of class `Sample`, even if it is a single-layer SAS sample.
 
 ##### Create an instance and add layers
 
 The sample is created by the constructor call
 ```python
-sample = ba.MultiLayer()
+sample = ba.Sample()
 ```
 
 Layers are then added using either of
 ```python
 sample.addLayer(layer)
-sample.addLayerWithTopRoughness(layer, roughness)
 ```
 
-For the arguments, see sections [Layer](/ref/sample/multilayer/layer) and [Roughness](/ref/sample/roughness).
+For the arguments, see sections [Layer](/ref/sample/Sample/layer) and [Roughness](/ref/sample/roughness).
 
 The layer added first is the top layer (typically vacuum).
 The layer added last is the bottom layer (typically substrate).
diff --git a/hugo/content/ref/sample/multilayer/layer.md b/hugo/content/ref/sample/multilayer/layer.md
index 890553cd4e6cbb695033a90dcaa04bda20cfc174..4f0fd4549dd3dc162535d65687a870203752e98e 100644
--- a/hugo/content/ref/sample/multilayer/layer.md
+++ b/hugo/content/ref/sample/multilayer/layer.md
@@ -5,14 +5,14 @@ weight = 36
 
 ## Class Layer
 
-A [MultiLayer](/ref/sample/multilayer) is composed of one or several instances
+A [Sample](/ref/sample/multilayer) is composed of one or several instances
 of class `Layer`.
 
 ##### Create an instance
 
 Each instance is created using the constructor call
 ```python
-layer_i = ba.Layer(material, thickness=0)
+layer_i = ba.Layer(material, thickness=0, roughness=nullptr)
 ```
 Typically, the variable name will contain an index `i`.
 By convention, the numbering starts with the top layer, typically `layer_1`.
diff --git a/hugo/content/ref/sample/multilayer/layout.md b/hugo/content/ref/sample/multilayer/layout.md
index 03c0ef388cf66ff10b49a1ede09d47c59fae5454..119ae15998de8609612f20f44786a7f41a34406f 100644
--- a/hugo/content/ref/sample/multilayer/layout.md
+++ b/hugo/content/ref/sample/multilayer/layout.md
@@ -5,7 +5,7 @@ weight = 37
 
 ## Class ParticleLayout
 
-A [Layer](/ref/sample/multilayer/layer) may contain any number of instances of class `ParticleLayout`.
+A [Layer](/ref/sample/Sample/layer) may contain any number of instances of class `ParticleLayout`.
 If a layer has more than one layout, then their scattering intensities add incoherently.
 
 ##### Create an instance and add particles
diff --git a/hugo/content/ref/sample/particle/_index.md b/hugo/content/ref/sample/particle/_index.md
index eb2097083027c0c61b9c5b3047ef8950c86285fd..6f969b5280642637acedff2166b00eea049d7e77 100644
--- a/hugo/content/ref/sample/particle/_index.md
+++ b/hugo/content/ref/sample/particle/_index.md
@@ -17,7 +17,7 @@ layout.addParticle(particle, abundance)
 layer = ba.Layer(material, thickness)
 layer.addLayout(layout)
 
-sample = ba.MultiLayer()
+sample = ba.Sample()
 sample.addLayer(layer)
 ```
 
diff --git a/rawEx/bayesian/likelihood_sampling.py b/rawEx/bayesian/likelihood_sampling.py
index 83e1deebcd0581403cd990fad0f23308b734a987..f3ac9f5e0125b7dabf24d115ff497ba2a1f13662 100755
--- a/rawEx/bayesian/likelihood_sampling.py
+++ b/rawEx/bayesian/likelihood_sampling.py
@@ -33,7 +33,7 @@ def get_sample(ni_thickness, ti_thickness):
     ni_layer = ba.Layer(material_ni, ni_thickness)
     ti_layer = ba.Layer(material_ti, ti_thickness)
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/rawEx/fit/scatter2d/consecutive_fitting.py b/rawEx/fit/scatter2d/consecutive_fitting.py
index b93a927014e679b2ddc56e22fef53c0453a03bb2..a2f0ad0764f7612ffc1456d7534e220538c74cbb 100755
--- a/rawEx/fit/scatter2d/consecutive_fitting.py
+++ b/rawEx/fit/scatter2d/consecutive_fitting.py
@@ -33,7 +33,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/fit/scatter2d/expfit_galaxi.py b/rawEx/fit/scatter2d/expfit_galaxi.py
index 832075302e49c83564cb2d253e29613953013559..9a4465fc97db0aa51cec04820874695a5e8408e9 100755
--- a/rawEx/fit/scatter2d/expfit_galaxi.py
+++ b/rawEx/fit/scatter2d/expfit_galaxi.py
@@ -82,7 +82,7 @@ def get_sample(P):
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/rawEx/fit/scatter2d/fit2d.py b/rawEx/fit/scatter2d/fit2d.py
index a5bda7efab527d91a10a8e87cf22fe9da3d0f1e2..6b155fbc4171870ab472007343030dcd79d0538d 100755
--- a/rawEx/fit/scatter2d/fit2d.py
+++ b/rawEx/fit/scatter2d/fit2d.py
@@ -17,7 +17,7 @@ def get_simulation(P):
 
     layer = ba.Layer(ba.RefractiveMaterial("Vacuum", 0, 0))
     layer.addLayout(ba.ParticleLayout(sphere))
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     n = <%= test_mode ? 11 : 100 %>
diff --git a/rawEx/fit/scatter2d/gisas_model1.py b/rawEx/fit/scatter2d/gisas_model1.py
index 2fc5c00fc6134ea72a7825634bb82ffb3d469bf1..c9e639bd0fdf5bde3385dc43148c74cb6da8a0f1 100644
--- a/rawEx/fit/scatter2d/gisas_model1.py
+++ b/rawEx/fit/scatter2d/gisas_model1.py
@@ -24,7 +24,7 @@ def get_sample(P):
     layer_1.addLayout(layout)
     layer_2 = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     return sample
diff --git a/rawEx/fit/scatter2d/hardcode_galaxi.py b/rawEx/fit/scatter2d/hardcode_galaxi.py
index dce5578cbb55810c1f2f542a4e3864514d096969..d769f8596a1d1ea78da4a9abe0ea4718c70e9f87 100755
--- a/rawEx/fit/scatter2d/hardcode_galaxi.py
+++ b/rawEx/fit/scatter2d/hardcode_galaxi.py
@@ -64,7 +64,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_Si)
 
     # assembling sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(hmdso_layer)
     sample.addLayer(ptfe_layer)
diff --git a/rawEx/fit/scatter2d/minimizer_settings.py b/rawEx/fit/scatter2d/minimizer_settings.py
index 1af54638ab6064759b754b512f202475ba4dc7da..1fc611f4c3241ed74d985859df954852ca269939 100755
--- a/rawEx/fit/scatter2d/minimizer_settings.py
+++ b/rawEx/fit/scatter2d/minimizer_settings.py
@@ -35,7 +35,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/fit/scatter2d/model1_cylinders.py b/rawEx/fit/scatter2d/model1_cylinders.py
index 72db5d2bb4e8cf24a51ec38d192f01a6021f08d1..052114218ddedcb3fcfab2ea062c9574d8764807 100644
--- a/rawEx/fit/scatter2d/model1_cylinders.py
+++ b/rawEx/fit/scatter2d/model1_cylinders.py
@@ -23,7 +23,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
     substrate_layer = ba.Layer(material_substrate, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/rawEx/fit/scatter2d/model2_hexlattice.py b/rawEx/fit/scatter2d/model2_hexlattice.py
index 8e827d1b9a3699027798423e6971e3beec99f220..c805940f3e9e04cebfd5628d563ef84efaa666e6 100644
--- a/rawEx/fit/scatter2d/model2_hexlattice.py
+++ b/rawEx/fit/scatter2d/model2_hexlattice.py
@@ -29,7 +29,7 @@ def get_sample(P):
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/fit/scatter2d/multiple_datasets.py b/rawEx/fit/scatter2d/multiple_datasets.py
index 0b493962cc8d13e4a51b498234fc71de9b8ff56e..f27bff7d32dbbbaea0d55420199f432a7f2b8f40 100755
--- a/rawEx/fit/scatter2d/multiple_datasets.py
+++ b/rawEx/fit/scatter2d/multiple_datasets.py
@@ -31,7 +31,7 @@ def get_sample(P):
     vacuum_layer.addLayout(layout)
 
     substrate_layer = ba.Layer(material_substrate)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/fit/specular/Honeycomb_fit.py b/rawEx/fit/specular/Honeycomb_fit.py
index f5d118abc5a3f17303dc3a6cf8b16b958f8d4374..3d9159531c03069ecac3530886d540439439dd01 100755
--- a/rawEx/fit/specular/Honeycomb_fit.py
+++ b/rawEx/fit/specular/Honeycomb_fit.py
@@ -63,7 +63,7 @@ def get_sample(P, sign, T):
     l_SiO2 = ba.Layer(material_SiO2, P["t_SiO2"]*angstrom, rSiO2)
     l_Si = ba.Layer(material_Si, rSi)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
 
     sample.addLayer(l_Air)
     sample.addLayer(l_PyOx)
diff --git a/rawEx/fit/specular/PolarizedSpinAsymmetry.py b/rawEx/fit/specular/PolarizedSpinAsymmetry.py
index 0f93a677597e7c605771b98aa2e677cdd9e5a436..d7b861e296de055e900f4b1d0e5c8662836c7827 100755
--- a/rawEx/fit/specular/PolarizedSpinAsymmetry.py
+++ b/rawEx/fit/specular/PolarizedSpinAsymmetry.py
@@ -59,7 +59,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/rawEx/fit/specular/Pt_layer_fit.py b/rawEx/fit/specular/Pt_layer_fit.py
index 51c37b6ebbf0a5bc3e53e6bf97c087ddcd73d07c..a11c941900507abf15c83af67a4cab11ed2b6237 100755
--- a/rawEx/fit/specular/Pt_layer_fit.py
+++ b/rawEx/fit/specular/Pt_layer_fit.py
@@ -40,7 +40,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_pt/nm"], r_pt)
     substrate_layer = ba.Layer(material_substrate, r_si)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/rawEx/fit/specular/Specular1Par.py b/rawEx/fit/specular/Specular1Par.py
index 304351e819f18c74b5a642c525701c757e86f0e1..df62ff3f5f2e41df61079cf1397bf653b30cea58 100755
--- a/rawEx/fit/specular/Specular1Par.py
+++ b/rawEx/fit/specular/Specular1Par.py
@@ -30,7 +30,7 @@ def get_sample(P):
     layer_Ti = ba.Layer(material_Ti, P["thickness_Ti"])
     layer_Ni = ba.Layer(material_Ni, 70*angstrom)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     for _ in range(10):
         sample.addLayer(layer_Ti)
diff --git a/rawEx/fit/specular/TREFF_Ni_film.py b/rawEx/fit/specular/TREFF_Ni_film.py
index fbd96289b55a4237229ee872192a0668953cb1db..5ca940cb3788eb6734af93a12c1dd2992ec5a95c 100755
--- a/rawEx/fit/specular/TREFF_Ni_film.py
+++ b/rawEx/fit/specular/TREFF_Ni_film.py
@@ -35,7 +35,7 @@ def get_sample(P):
     layer_Ni = ba.Layer(material_Ni_58, P["thickness"], roughness_Ni)
     substrate = ba.Layer(material_SiO2, roughness_Substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer_Ni)
     sample.addLayer(substrate)
diff --git a/rawEx/offspec/Offspec1.py b/rawEx/offspec/Offspec1.py
index 178a4dbb0f21e7391dc785274da2dd53d708ccf8..446836258255c5f2d91dc4e823bf014a4603e133 100755
--- a/rawEx/offspec/Offspec1.py
+++ b/rawEx/offspec/Offspec1.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/offspec/OffspecLambda.py b/rawEx/offspec/OffspecLambda.py
index 35d602b7619e00f11e10482c306737f18857814f..979172318822db239710ab260f1d2f035acd81e5 100755
--- a/rawEx/offspec/OffspecLambda.py
+++ b/rawEx/offspec/OffspecLambda.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/offspec/OffspecResolved.py b/rawEx/offspec/OffspecResolved.py
index 04df472c96cda397376fabf9a3b16d8cec6cca17..5f87873894b6a5b3342398733deb8d9d670eb1c7 100755
--- a/rawEx/offspec/OffspecResolved.py
+++ b/rawEx/offspec/OffspecResolved.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/ApproximationDA.py b/rawEx/scatter2d/ApproximationDA.py
index 7d9e1fce4758146a65b26782ee90b5a4cba99205..ba3095d11c20479adc08708f5a73d2f25c023d87 100755
--- a/rawEx/scatter2d/ApproximationDA.py
+++ b/rawEx/scatter2d/ApproximationDA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/ApproximationLMA.py b/rawEx/scatter2d/ApproximationLMA.py
index 6ecea36ee36b6696343afdbf0c7c6d621e4d925c..e0c5a992ec15ba03189a13e7df1ac4d2430a8ae7 100755
--- a/rawEx/scatter2d/ApproximationLMA.py
+++ b/rawEx/scatter2d/ApproximationLMA.py
@@ -51,7 +51,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/ApproximationSSCA.py b/rawEx/scatter2d/ApproximationSSCA.py
index 5e80f9265238cab47b0e7b9da946aa0b51c20b16..38d08dfb024f41d60928f7b5008114c28565b5e6 100755
--- a/rawEx/scatter2d/ApproximationSSCA.py
+++ b/rawEx/scatter2d/ApproximationSSCA.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/AxesInDifferentUnits.py b/rawEx/scatter2d/AxesInDifferentUnits.py
index 91d814ec5c777d4c081495df4402dd2330811a82..b6486501de9ed5e270313ea538d1379b3c1e7da2 100755
--- a/rawEx/scatter2d/AxesInDifferentUnits.py
+++ b/rawEx/scatter2d/AxesInDifferentUnits.py
@@ -37,7 +37,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/rawEx/scatter2d/BiMaterialCylinders.py b/rawEx/scatter2d/BiMaterialCylinders.py
index a40c6e74508ac3c18c973ed74260edd3d8b65fda..3541639cde02a1865e4abaafb95515b05cb866f3 100755
--- a/rawEx/scatter2d/BiMaterialCylinders.py
+++ b/rawEx/scatter2d/BiMaterialCylinders.py
@@ -48,7 +48,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/BoxesWithSpecularPeak.py b/rawEx/scatter2d/BoxesWithSpecularPeak.py
index d4de93d3b2cd8862b45e8a7f6fa0d379e7d9acf0..b34bdca59696854bb51d4eb1366900318674d5fa 100755
--- a/rawEx/scatter2d/BoxesWithSpecularPeak.py
+++ b/rawEx/scatter2d/BoxesWithSpecularPeak.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/BroadSpecular.py b/rawEx/scatter2d/BroadSpecular.py
index 1424834685f32cb4ecdb4865a0733a2f11969cb7..de8ed88b2f8a8bff54f82f5b7c08adf7da5716f4 100755
--- a/rawEx/scatter2d/BroadSpecular.py
+++ b/rawEx/scatter2d/BroadSpecular.py
@@ -14,7 +14,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_4)
 
diff --git a/rawEx/scatter2d/CorrelatedRoughness.py b/rawEx/scatter2d/CorrelatedRoughness.py
index e4ce4b0b9ffcaf6cdda45e41761e28ef8b88cd0d..c331bf5bdba5c6b3f7d8b9b7054f033d48627308 100755
--- a/rawEx/scatter2d/CorrelatedRoughness.py
+++ b/rawEx/scatter2d/CorrelatedRoughness.py
@@ -30,7 +30,7 @@ def get_sample():
     l_part_b = ba.Layer(material_part_b, 5*nm, roughness)
     l_substrate = ba.Layer(material_substrate, roughness)
 
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
 
     # adding layers
     my_sample.addLayer(l_ambience)
diff --git a/rawEx/scatter2d/CosineRipplesAtRectLattice.py b/rawEx/scatter2d/CosineRipplesAtRectLattice.py
index 6e56cfed6c5dde0bbae2c055c9a777a648b4c3a5..15bd2e32f12dc35fdfd118fb294445b0a9c346ef 100755
--- a/rawEx/scatter2d/CosineRipplesAtRectLattice.py
+++ b/rawEx/scatter2d/CosineRipplesAtRectLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/CustomFormFactor.py b/rawEx/scatter2d/CustomFormFactor.py
index 54b8a2909d92432c4ca3e1ee8121a14b961dc92e..553ba5dddb5c5d4ef83544ec8eedacfdd982465b 100755
--- a/rawEx/scatter2d/CustomFormFactor.py
+++ b/rawEx/scatter2d/CustomFormFactor.py
@@ -68,7 +68,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # assemble sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/scatter2d/CylindersAndPrisms.py b/rawEx/scatter2d/CylindersAndPrisms.py
index 2f1d16ef8de1205d1dee66962db5b7c34da3f116..c1c6788db4c3186c75d053b5a84f78515198e289 100755
--- a/rawEx/scatter2d/CylindersAndPrisms.py
+++ b/rawEx/scatter2d/CylindersAndPrisms.py
@@ -37,7 +37,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/CylindersInAverageLayer.py b/rawEx/scatter2d/CylindersInAverageLayer.py
index 282cf34bb1d1d0bb68e3ba5b0b2188dadc99f6d3..98a7ab1d738d87f46252a0a6a68bce4092db4971 100755
--- a/rawEx/scatter2d/CylindersInAverageLayer.py
+++ b/rawEx/scatter2d/CylindersInAverageLayer.py
@@ -35,7 +35,7 @@ def get_sample(cyl_height=5*nm):
     intermediate_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(intermediate_layer)
     sample.addLayer(substrate_layer)
diff --git a/rawEx/scatter2d/CylindersInBA.py b/rawEx/scatter2d/CylindersInBA.py
index ce367b248c10ed935e875199fd7b0c868e61a964..74a40d4af0bae72c366747923922cbfd70cde9d4 100755
--- a/rawEx/scatter2d/CylindersInBA.py
+++ b/rawEx/scatter2d/CylindersInBA.py
@@ -33,7 +33,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/rawEx/scatter2d/DodecahedraSAS.py b/rawEx/scatter2d/DodecahedraSAS.py
index 2c7f7f3647461db0618b98bb378ebd67cbbcc394..5e13d3b5dcfc902b6a62f585b20ec2b5a8682782 100755
--- a/rawEx/scatter2d/DodecahedraSAS.py
+++ b/rawEx/scatter2d/DodecahedraSAS.py
@@ -21,7 +21,7 @@ def get_sample():
     solution_layer.addLayout(layout)
 
     # Flat sample layer sandwiched between semi-infinite vacuum layers:
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(solution_layer)
     sample.addLayer(ba.Layer(vacuum))
diff --git a/rawEx/scatter2d/FindPeaks.py b/rawEx/scatter2d/FindPeaks.py
index db7c12daa157e659ab5c63338c7543b738c2febb..92426b9d2f25735d696bd3ac8c89867d3b415255 100755
--- a/rawEx/scatter2d/FindPeaks.py
+++ b/rawEx/scatter2d/FindPeaks.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py b/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py
index 7b0fd0bff35e2ff971977be863e43ad47554743f..553744527c1b6e4c83792e3190dd0565b93c42ab 100755
--- a/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py
+++ b/rawEx/scatter2d/HalfSpheresInAverageTopLayer.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/HexagonalLatticesWithBasis.py b/rawEx/scatter2d/HexagonalLatticesWithBasis.py
index 42bdce6e796fac7fa7d42d6c3365a88cb4615164..a13a938df9f07e0080068b09c41dcfaa1e18b460 100755
--- a/rawEx/scatter2d/HexagonalLatticesWithBasis.py
+++ b/rawEx/scatter2d/HexagonalLatticesWithBasis.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Interference1DLattice.py b/rawEx/scatter2d/Interference1DLattice.py
index cd52ad298149d010726e3c0580a879473891ea8e..07716ecfd1f03576c740eba1f847ed4af9e85f9a 100755
--- a/rawEx/scatter2d/Interference1DLattice.py
+++ b/rawEx/scatter2d/Interference1DLattice.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Interference1DRadialParacrystal.py b/rawEx/scatter2d/Interference1DRadialParacrystal.py
index b1ac3f7bd7b58528c38cd539d943b272eeed2759..576e7110b32849d25eee4f0db116b64e128dbc8f 100755
--- a/rawEx/scatter2d/Interference1DRadialParacrystal.py
+++ b/rawEx/scatter2d/Interference1DRadialParacrystal.py
@@ -39,7 +39,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Interference2DCenteredSquareLattice.py b/rawEx/scatter2d/Interference2DCenteredSquareLattice.py
index 8b423ad0974588fe83388d2213b82254543201d6..858f80178c50b418331854e939ad5081961b3165 100755
--- a/rawEx/scatter2d/Interference2DCenteredSquareLattice.py
+++ b/rawEx/scatter2d/Interference2DCenteredSquareLattice.py
@@ -53,7 +53,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Interference2DParacrystal.py b/rawEx/scatter2d/Interference2DParacrystal.py
index f0bf2b31c80f5d58c0e85868e752166377e79b71..8d1e1856bce9208aee2da76b3a7f360a3c3b86f2 100755
--- a/rawEx/scatter2d/Interference2DParacrystal.py
+++ b/rawEx/scatter2d/Interference2DParacrystal.py
@@ -45,7 +45,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Interference2DRotatedSquareLattice.py b/rawEx/scatter2d/Interference2DRotatedSquareLattice.py
index 9b302e41855fe9ccfc392553412277213980fcc4..54891f4c78c4db521f5f32d749709c45eb6d05a7 100755
--- a/rawEx/scatter2d/Interference2DRotatedSquareLattice.py
+++ b/rawEx/scatter2d/Interference2DRotatedSquareLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Interference2DSquareFiniteLattice.py b/rawEx/scatter2d/Interference2DSquareFiniteLattice.py
index 3f026f34d75d83343b91c2b0cc93fbad10b9b061..70906d35c00b53264f08c340c28c0a04f12d6c3f 100755
--- a/rawEx/scatter2d/Interference2DSquareFiniteLattice.py
+++ b/rawEx/scatter2d/Interference2DSquareFiniteLattice.py
@@ -42,7 +42,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/LargeParticlesFormFactor.py b/rawEx/scatter2d/LargeParticlesFormFactor.py
index 1ce618e80ceb30b3b611701f9f561f3b063fecae..0f2d60b660be02d96eb4135f5067d708dd64b862 100755
--- a/rawEx/scatter2d/LargeParticlesFormFactor.py
+++ b/rawEx/scatter2d/LargeParticlesFormFactor.py
@@ -33,7 +33,7 @@ def get_sample(cylinder_radius, cylinder_height):
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/scatter2d/LatticeOrientationDistribution.py b/rawEx/scatter2d/LatticeOrientationDistribution.py
index 97f08a68e383935de29b91cb4384bedb3617b296..9638d3de9edd1c69e7228719dde81d1bd0b500e0 100755
--- a/rawEx/scatter2d/LatticeOrientationDistribution.py
+++ b/rawEx/scatter2d/LatticeOrientationDistribution.py
@@ -29,7 +29,7 @@ def get_sample():
         layout.setTotalParticleSurfaceDensity(0.1*parsample.weight)
         toplayer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(toplayer)
     sample.addLayer(substrate)
     return sample
diff --git a/rawEx/scatter2d/MagneticCylinders1.py b/rawEx/scatter2d/MagneticCylinders1.py
index 70da0352cccd1367153c9fdef8f8739ee58afab8..efd745dd680514c650307ae9b48bb18b7016e1e9 100755
--- a/rawEx/scatter2d/MagneticCylinders1.py
+++ b/rawEx/scatter2d/MagneticCylinders1.py
@@ -25,7 +25,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/rawEx/scatter2d/MagneticCylinders2.py b/rawEx/scatter2d/MagneticCylinders2.py
index d497927308a15e29507bbddcf6b5a67e9f5aa491..46f28ac0203476f8a4858023067be51ff6fec2a4 100755
--- a/rawEx/scatter2d/MagneticCylinders2.py
+++ b/rawEx/scatter2d/MagneticCylinders2.py
@@ -24,7 +24,7 @@ def get_sample():
     vacuum_layer = ba.Layer(vacuum)
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_substrate, 0)
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/rawEx/scatter2d/MagneticSpheres.py b/rawEx/scatter2d/MagneticSpheres.py
index 7187fa0a0c78a4d6c5e6dc4cd9ad6f6f29b000a2..6745d4b5ad895af888322c464ca8cc8352867698 100755
--- a/rawEx/scatter2d/MagneticSpheres.py
+++ b/rawEx/scatter2d/MagneticSpheres.py
@@ -30,7 +30,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
     layer_2.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Mesocrystal.py b/rawEx/scatter2d/Mesocrystal.py
index e4454ad99ddc171e5cb16e4291190e836bb63c04..b47bcdafc13766a9286570bc92b5340bacdd5699 100755
--- a/rawEx/scatter2d/Mesocrystal.py
+++ b/rawEx/scatter2d/Mesocrystal.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Mesocrystal2.py b/rawEx/scatter2d/Mesocrystal2.py
index 1feef766b7932b58f7f88a57599d669820b5ea10..c24c0502abd2165ccd0bedb9d99df18155cf3f37 100755
--- a/rawEx/scatter2d/Mesocrystal2.py
+++ b/rawEx/scatter2d/Mesocrystal2.py
@@ -43,7 +43,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Mesocrystal3.py b/rawEx/scatter2d/Mesocrystal3.py
index 4b46e8785aac45f1d823d0db2f4f5f24f50f7e34..dd19f4cf2de6dad230483a885158d6445bb3dd8c 100755
--- a/rawEx/scatter2d/Mesocrystal3.py
+++ b/rawEx/scatter2d/Mesocrystal3.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/Mesocrystal4.py b/rawEx/scatter2d/Mesocrystal4.py
index 02aad4bf17a15c9b1bb04c10c8c4e0dc6c3682f6..98d8e54748faf74463accb6b0e4dce46bbba8dec 100755
--- a/rawEx/scatter2d/Mesocrystal4.py
+++ b/rawEx/scatter2d/Mesocrystal4.py
@@ -60,7 +60,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/ParticleAcrossInterface.py b/rawEx/scatter2d/ParticleAcrossInterface.py
index 584ea1957bcee6da58491ac264a5c0d03bde5d4b..cff78dfc8cf88d1feb424b25e9e7b87c2aae6a53 100755
--- a/rawEx/scatter2d/ParticleAcrossInterface.py
+++ b/rawEx/scatter2d/ParticleAcrossInterface.py
@@ -28,7 +28,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/PolarizedSANS.py b/rawEx/scatter2d/PolarizedSANS.py
index 20dae94395673b1532b215f117a2233536056470..67d046d814892b808cfe2dac958e5b99c870373a 100755
--- a/rawEx/scatter2d/PolarizedSANS.py
+++ b/rawEx/scatter2d/PolarizedSANS.py
@@ -42,7 +42,7 @@ def get_sample():
     layer.addLayout(layout)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/rawEx/scatter2d/PolydisperseCylinders.py b/rawEx/scatter2d/PolydisperseCylinders.py
index 7243fa4d743e752022076378c3955d2602e534df..b723cf2b9088e8f6dc1eeacec263d8d3ed20f088 100755
--- a/rawEx/scatter2d/PolydisperseCylinders.py
+++ b/rawEx/scatter2d/PolydisperseCylinders.py
@@ -23,7 +23,7 @@ def get_sample():
     layer = ba.Layer(vacuum)
     layer.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer)
 
     return sample
diff --git a/rawEx/scatter2d/PositionVariance.py b/rawEx/scatter2d/PositionVariance.py
index 9b461db337d2891848dadf3d8d4e6bc487c8be5c..a6391064d34859a583c15e61d0b51db3ab688d7c 100755
--- a/rawEx/scatter2d/PositionVariance.py
+++ b/rawEx/scatter2d/PositionVariance.py
@@ -36,7 +36,7 @@ def get_sample(hasVariance, xi):
     l_substrate = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(l_air)
     sample.addLayer(l_substrate)
     return sample
diff --git a/rawEx/scatter2d/RectangularGrating.py b/rawEx/scatter2d/RectangularGrating.py
index 9f865dec3f73349585225dd627b591a3a90ce32d..c8d00f1f216146ff01ac8a0754d1f4ce64eaecb3 100755
--- a/rawEx/scatter2d/RectangularGrating.py
+++ b/rawEx/scatter2d/RectangularGrating.py
@@ -46,7 +46,7 @@ def get_sample(lattice_rotation_angle=0*deg):
     vacuum_layer.addLayout(particle_layout)
     substrate_layer = ba.Layer(material_si, roughness)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(vacuum_layer)
     sample.addLayer(substrate_layer)
     return sample
diff --git a/rawEx/scatter2d/RotatedPyramids.py b/rawEx/scatter2d/RotatedPyramids.py
index 4278c11df0112314886b7430ee65a58e174223ed..8a4d19e91ee1aaca4318634159c5f366f7fdd743 100755
--- a/rawEx/scatter2d/RotatedPyramids.py
+++ b/rawEx/scatter2d/RotatedPyramids.py
@@ -35,7 +35,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/RoughAndSpecular.py b/rawEx/scatter2d/RoughAndSpecular.py
index fe751b4c1801348cfb8e425d02a1a63a694bf6bf..d721df916415b9b77b4b4cb7a8ee196193b74713 100755
--- a/rawEx/scatter2d/RoughAndSpecular.py
+++ b/rawEx/scatter2d/RoughAndSpecular.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_4 = ba.Layer(material_Si)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/rawEx/scatter2d/SlicedLayer.py b/rawEx/scatter2d/SlicedLayer.py
index 9a2df3458c6a85da12e4be6988a9e7abcc9af5f6..e7bd82262feb8acc9f389e359f409b0842e81d99 100755
--- a/rawEx/scatter2d/SlicedLayer.py
+++ b/rawEx/scatter2d/SlicedLayer.py
@@ -31,7 +31,7 @@ def get_sample():
     substrate = ba.Layer(material_substrate)
     substrate.addLayout(layout)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(vacuum))
     sample.addLayer(layer1)
     sample.addLayer(substrate)
diff --git a/rawEx/scatter2d/SpheresAtHexLattice.py b/rawEx/scatter2d/SpheresAtHexLattice.py
index 78f4ef131b31837d9ac238fd18498730b0f6aa5b..cda279676abe03546cd37bc30d905b91b23ba3c3 100755
--- a/rawEx/scatter2d/SpheresAtHexLattice.py
+++ b/rawEx/scatter2d/SpheresAtHexLattice.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/scatter2d/TriangularRipple.py b/rawEx/scatter2d/TriangularRipple.py
index 38c1b29735500b7a8b10197475fe63f340e781f3..393a48a372c8f05b631b23624174402711662d6b 100755
--- a/rawEx/scatter2d/TriangularRipple.py
+++ b/rawEx/scatter2d/TriangularRipple.py
@@ -44,7 +44,7 @@ def get_sample():
     layer_2 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
 
diff --git a/rawEx/specular/AlternatingLayers1.py b/rawEx/specular/AlternatingLayers1.py
index a0ed68dbf1750949e3554aced0533cb905d21cdc..df3c75fb9f0ff9c754fca44f5ed1aa2082886f76 100755
--- a/rawEx/specular/AlternatingLayers1.py
+++ b/rawEx/specular/AlternatingLayers1.py
@@ -22,7 +22,7 @@ def get_sample():
     substrate = ba.Layer(material_Si)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(top_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/rawEx/specular/Basic.py b/rawEx/specular/Basic.py
index 99b7249b4721666beeb5c611eff5c33fc87c52f3..5201d86560b306ad323cdde425deafb7d49934c4 100755
--- a/rawEx/specular/Basic.py
+++ b/rawEx/specular/Basic.py
@@ -18,7 +18,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(film)
     sample.addLayer(substrate_layer)
diff --git a/rawEx/specular/MagneticLayer.py b/rawEx/specular/MagneticLayer.py
index 272afb9b699d5a475438d7a130a7615a9ef7fa8b..d7b13e75a6ac749ccec55c80aa9481bb9cabee0f 100755
--- a/rawEx/specular/MagneticLayer.py
+++ b/rawEx/specular/MagneticLayer.py
@@ -26,7 +26,7 @@ def get_sample():
     layer_3 = ba.Layer(material_substrate)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/rawEx/specular/MagneticLayerImperfect.py b/rawEx/specular/MagneticLayerImperfect.py
index 9f097d78e1ba18164c118476cdc38ce060693b67..45f4297084e192dd9944e39aec4bec1545ee3458 100755
--- a/rawEx/specular/MagneticLayerImperfect.py
+++ b/rawEx/specular/MagneticLayerImperfect.py
@@ -31,7 +31,7 @@ def get_sample():
     layer_substrate = ba.Layer(material_substrate, roughness)
 
     # Multilayer
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_vacuum)
     sample.addLayer(layer_Pd)
     sample.addLayer(layer_Fe)
diff --git a/rawEx/specular/PolarizedSpinAsymmetry.py b/rawEx/specular/PolarizedSpinAsymmetry.py
index 1eaa33e3368390e0e67cce0df23d70c5a7a76b30..0bedf790216835865b7021d68b7aef9c3cf8671c 100755
--- a/rawEx/specular/PolarizedSpinAsymmetry.py
+++ b/rawEx/specular/PolarizedSpinAsymmetry.py
@@ -60,7 +60,7 @@ def get_sample(P):
     layer = ba.Layer(material_layer, P["t_Mafo"]*angstrom, r_Mafo)
     substrate_layer = ba.Layer(material_substrate, r_substrate)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(layer)
     sample.addLayer(substrate_layer)
diff --git a/rawEx/specular/RoughnessModel.py b/rawEx/specular/RoughnessModel.py
index 195c7632e395802e0fe2db3280547f15365da670..a43de63a238f0b9b61773e000b905b8c8953ca40 100755
--- a/rawEx/specular/RoughnessModel.py
+++ b/rawEx/specular/RoughnessModel.py
@@ -27,7 +27,7 @@ def get_sample(interlayer):
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # create sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/rawEx/specular/SpecularSimulationWithRoughness.py b/rawEx/specular/SpecularSimulationWithRoughness.py
index f9dc7f97965b1c95e00233ca813f97f35fdabd03..38f9ea968bddaa59b65449d53e4d2c29eb924142 100755
--- a/rawEx/specular/SpecularSimulationWithRoughness.py
+++ b/rawEx/specular/SpecularSimulationWithRoughness.py
@@ -28,7 +28,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate, roughness)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     for _ in range(10):
         sample.addLayer(ti_layer)
diff --git a/rawEx/varia/Depthprobe1.py b/rawEx/varia/Depthprobe1.py
index b1b5bc138ac9ad7bc6c27fe7b63be3e4ca41f58f..fefb30fbd6a938d6f3226dfd432dad3518ae44b1 100755
--- a/rawEx/varia/Depthprobe1.py
+++ b/rawEx/varia/Depthprobe1.py
@@ -14,7 +14,7 @@ def get_sample():
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/rawEx/varia/MaterialProfile.py b/rawEx/varia/MaterialProfile.py
index 8ae7cdaada354d11c05eb19167f8c24230632c5a..582b05f147e48e946b6b1577cd6fbf0cb41b216a 100755
--- a/rawEx/varia/MaterialProfile.py
+++ b/rawEx/varia/MaterialProfile.py
@@ -32,7 +32,7 @@ def get_sample():
     substrate_layer = ba.Layer(material_substrate)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     
     for _ in range(4):
diff --git a/rawEx/varia/MaterialProfileWithParticles.py b/rawEx/varia/MaterialProfileWithParticles.py
index 2108c1cf2969c3dc99af851d99e4d4004bd3e88f..c424f9136ed1c0e6ccc5a951bb76bb3254b857e0 100755
--- a/rawEx/varia/MaterialProfileWithParticles.py
+++ b/rawEx/varia/MaterialProfileWithParticles.py
@@ -30,7 +30,7 @@ def get_sample():
     ambient_layer.setNumberOfSlices(20)
 
     # sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ambient_layer)
     sample.addLayer(substrate_layer)
 
diff --git a/rawEx/varia/OpaqueProfile1.py b/rawEx/varia/OpaqueProfile1.py
index 88239e78fe1df8d3169250ebf644ff15f949ca33..69b7c472a875abfb048c73a0d306d9bde42dfe02 100755
--- a/rawEx/varia/OpaqueProfile1.py
+++ b/rawEx/varia/OpaqueProfile1.py
@@ -27,7 +27,7 @@ def get_sample():
     layer_bot = ba.Layer(material_vac)
 
     # Define sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_top)
     sample.addLayer(layer_1)
     sample.addLayer(layer_bot)
diff --git a/rawEx/varia/Resonator.py b/rawEx/varia/Resonator.py
index eb1a6f36cb6285e233a53e60cde160412663378c..de7499e317d484f1b1737c89c216d8ad06175595 100755
--- a/rawEx/varia/Resonator.py
+++ b/rawEx/varia/Resonator.py
@@ -52,7 +52,7 @@ def get_sample():
     layer_6 = ba.Layer(material_D2O)
 
     # Sample
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(layer_1)
     sample.addLayer(layer_2)
     sample.addLayer(layer_3)
diff --git a/rawEx/varia/RoughSurface.py b/rawEx/varia/RoughSurface.py
index 24a0029a9a139862140e251d9aea14eab4981218..e2524c4bffc8ea0f2ca68cbe35f5d5ead2ed79b4 100755
--- a/rawEx/varia/RoughSurface.py
+++ b/rawEx/varia/RoughSurface.py
@@ -81,7 +81,7 @@ def get_sample():
     l_substrate = ba.Layer(material_substrate, roughness_sub)
 
     # adding layers
-    my_sample = ba.MultiLayer()
+    my_sample = ba.Sample()
     my_sample.addLayer(l_ambience)
     my_sample.addLayer(l_layer)
     my_sample.addLayer(l_substrate)
diff --git a/rawEx/varia/Transmission.py b/rawEx/varia/Transmission.py
index 6c60574337e262965a5107a6c599db9470b9dabb..baba7e60bbedfc793281773e6e85ad294844f51d 100755
--- a/rawEx/varia/Transmission.py
+++ b/rawEx/varia/Transmission.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/rawEx/varia/TransmissionVsAlpha.py b/rawEx/varia/TransmissionVsAlpha.py
index d516e070f4b5508e266724a6afe24ce9fd00b632..877cf1a23ea6f1cf57e8483920366ebd05cf7419 100755
--- a/rawEx/varia/TransmissionVsAlpha.py
+++ b/rawEx/varia/TransmissionVsAlpha.py
@@ -14,7 +14,7 @@ def get_sample(depth):
     material_A = ba.RefractiveMaterial("A", 5e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, depth))
     sample.addLayer(ba.Layer(material_sub))
diff --git a/rawEx/varia/TransmissionVsDepth.py b/rawEx/varia/TransmissionVsDepth.py
index e027e4a4e1604a68b2dbee7862d07a98cc36d2e7..e82b92e68251b3b36f8db0a579203c67d4da4598 100755
--- a/rawEx/varia/TransmissionVsDepth.py
+++ b/rawEx/varia/TransmissionVsDepth.py
@@ -14,7 +14,7 @@ def get_sample():
     material_A = ba.RefractiveMaterial("A", 6e-5, 0)
     material_sub = ba.RefractiveMaterial("Substrate", 3e-05, 0)
 
-    sample = ba.MultiLayer()
+    sample = ba.Sample()
     sample.addLayer(ba.Layer(material_vac))
     sample.addLayer(ba.Layer(material_A, 100*nm))
     sample.addLayer(ba.Layer(material_sub))