From 96ea8947066e671f95a736cbacef6959d977f44b Mon Sep 17 00:00:00 2001
From: Joachim Wuttke <j.wuttke@fz-juelich.de>
Date: Tue, 6 Sep 2022 07:25:40 +0200
Subject: [PATCH 1/2] rm unused fct arg 'polarized'

---
 Resample/Processed/ReLayout.cpp |  2 +-
 Resample/Processed/ReLayout.h   |  2 +-
 Resample/Processed/ReSample.cpp | 12 +++++-------
 auto/Wrap/doxygenResample.i     |  2 +-
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/Resample/Processed/ReLayout.cpp b/Resample/Processed/ReLayout.cpp
index decbeb8733e..c1bdb5cda9e 100644
--- a/Resample/Processed/ReLayout.cpp
+++ b/Resample/Processed/ReLayout.cpp
@@ -25,7 +25,7 @@ namespace {
 //  class implementation
 //  ************************************************************************************************
 
-reLayout::reLayout(bool /*polarized*/, double surface_density,
+reLayout::reLayout(double surface_density,
                    std::vector<std::unique_ptr<const CoherentFFSum>>&& formfactors,
                    const IInterference* iff, std::map<size_t, Admixtures>&& slice2admixtures)
     : m_surface_density(surface_density)
diff --git a/Resample/Processed/ReLayout.h b/Resample/Processed/ReLayout.h
index 37a5d12a5de..10ba027b874 100644
--- a/Resample/Processed/ReLayout.h
+++ b/Resample/Processed/ReLayout.h
@@ -35,7 +35,7 @@ class Admixtures;
 
 class reLayout {
 public:
-    reLayout(bool polarized, double surface_density,
+    reLayout(double surface_density,
              std::vector<std::unique_ptr<const CoherentFFSum>>&& formfactors,
              const IInterference* iff, std::map<size_t, Admixtures>&& slice2admixtures);
     reLayout(reLayout&& other);
diff --git a/Resample/Processed/ReSample.cpp b/Resample/Processed/ReSample.cpp
index 4981b9ed1b7..9a97c361422 100644
--- a/Resample/Processed/ReSample.cpp
+++ b/Resample/Processed/ReSample.cpp
@@ -219,8 +219,7 @@ std::pair<size_t, size_t> SliceIndexSpan(const IParticle& particle, const SliceS
     return {top_index, bottom_index};
 }
 
-reLayout makereLayout(const ParticleLayout& layout, const SliceStack& slices, double z_ref,
-                      bool polarized)
+reLayout makereLayout(const ParticleLayout& layout, const SliceStack& slices, double z_ref)
 {
     const double layout_abundance = layout.totalAbundance();
     ASSERT(layout_abundance > 0);
@@ -277,14 +276,13 @@ reLayout makereLayout(const ParticleLayout& layout, const SliceStack& slices, do
 
     const auto* iff = layout.interferenceFunction();
 
-    return reLayout(polarized, surface_density, std::move(formfactors),
+    return reLayout(surface_density, std::move(formfactors),
                     iff ? iff->clone() : nullptr, std::move(slice2admixtures));
 }
 
 //! Returns collection of all reLayout%s, for use in reSample constructor.
 
-std::vector<reLayout> collectLayouts(const MultiLayer& sample, const SliceStack& slices,
-                                     bool polarized)
+std::vector<reLayout> collectLayouts(const MultiLayer& sample, const SliceStack& slices)
 {
     std::vector<reLayout> result;
 
@@ -294,7 +292,7 @@ std::vector<reLayout> collectLayouts(const MultiLayer& sample, const SliceStack&
         if (i > 1)
             z_ref -= sample.layer(i - 1)->thickness();
         for (const auto* layout : sample.layer(i)->layouts())
-            result.emplace_back(makereLayout(*layout, slices, z_ref, polarized));
+            result.emplace_back(makereLayout(*layout, slices, z_ref));
     }
     return result;
 }
@@ -314,7 +312,7 @@ reSample reSample::make(const MultiLayer& sample, const SimulationOptions& optio
     // slices1: accounting for roughness, but not yet for particles
     const SliceStack slices1 = slicify(sample, options).setBField(sample.externalField());
 
-    std::vector<reLayout> layouts = collectLayouts(sample, slices1, polarized);
+    std::vector<reLayout> layouts = collectLayouts(sample, slices1);
 
     const SliceStack refined_stack =
         options.useAvgMaterials() ? refineStack(slices1, layouts) : slices1;
diff --git a/auto/Wrap/doxygenResample.i b/auto/Wrap/doxygenResample.i
index f614e6bb77d..7424642f075 100644
--- a/auto/Wrap/doxygenResample.i
+++ b/auto/Wrap/doxygenResample.i
@@ -472,7 +472,7 @@ If particles in the layout crossed the limits of the layer slices, these particl
 C++ includes: ReLayout.h
 ";
 
-%feature("docstring")  reLayout::reLayout "reLayout::reLayout(bool polarized, double surface_density, std::vector< std::unique_ptr< const CoherentFFSum > > &&formfactors, const IInterference *iff, std::map< size_t, Admixtures > &&slice2admixtures)
+%feature("docstring")  reLayout::reLayout "reLayout::reLayout(double surface_density, std::vector< std::unique_ptr< const CoherentFFSum > > &&formfactors, const IInterference *iff, std::map< size_t, Admixtures > &&slice2admixtures)
 reLayout::reLayout";
 
 %feature("docstring")  reLayout::reLayout "reLayout::reLayout(reLayout &&other)
-- 
GitLab


From ace3f331b8a61c66d097030e4350613b338626d3 Mon Sep 17 00:00:00 2001
From: Joachim Wuttke <j.wuttke@fz-juelich.de>
Date: Tue, 6 Sep 2022 08:40:36 +0200
Subject: [PATCH 2/2] Doxy class comment

---
 Resample/Processed/ReLayout.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Resample/Processed/ReLayout.h b/Resample/Processed/ReLayout.h
index 10ba027b874..fcda652b544 100644
--- a/Resample/Processed/ReLayout.h
+++ b/Resample/Processed/ReLayout.h
@@ -30,8 +30,7 @@ class Admixtures;
 
 //! Data structure that contains preprocessed data for a single layout.
 //!
-//! If particles in the layout crossed the limits of the layer slices,
-//! these particles will be sliced themselves.
+//! It is set by the preprocessor makereLayout in ReSample.cpp.
 
 class reLayout {
 public:
-- 
GitLab