Skip to content
Snippets Groups Projects
Commit 87733acb authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

inline vars in OffspecSimulation::generateElements

parent 1b02c2e4
No related branches found
No related tags found
1 merge request!1318merge functions in main computation
...@@ -225,21 +225,17 @@ SimulationResult OffspecSimulation::packResult() ...@@ -225,21 +225,17 @@ SimulationResult OffspecSimulation::packResult()
//... Local functions: //... Local functions:
std::vector<DiffuseElement> OffspecSimulation::generateElements(const Beam& beam) std::vector<DiffuseElement> OffspecSimulation::generateElements(const Beam& beam2)
{ {
const double wavelength = beam.wavelength();
const double alpha_i = beam.alpha_i();
const double phi_i = beam.phi_i();
const SpinMatrix beam_polMatrices = beam.polMatrix();
const SpinMatrix analyzer_operator = m_detector->analyzer().matrix();
const size_t i_specular = m_detector->indexOfSpecular(beam);
const size_t N = m_active_indices.size(); const size_t N = m_active_indices.size();
std::vector<DiffuseElement> result; std::vector<DiffuseElement> result;
result.reserve(N); result.reserve(N);
for (size_t i = 0; i < N; ++i) for (size_t i = 0; i < N; ++i)
result.emplace_back(DiffuseElement( result.emplace_back(
wavelength, alpha_i, phi_i, std::unique_ptr<IPixel>(m_pixels[i]->clone()), DiffuseElement(beam2.wavelength(), beam2.alpha_i(), beam2.phi_i(),
beam_polMatrices, analyzer_operator, m_active_indices[i] == i_specular)); std::unique_ptr<IPixel>(m_pixels[i]->clone()), beam2.polMatrix(),
m_detector->analyzer().matrix(),
m_active_indices[i] == m_detector->indexOfSpecular(beam2)));
return result; return result;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment