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

initialize ff directly

parent aed35f28
No related branches found
No related tags found
1 merge request!169Get rid of a number of fcts that are never reached
......@@ -106,25 +106,24 @@ CoherentFFSum ProcessedLayout::processParticle(const IParticle& particle, const
std::vector<CoherentFFTerm> terms;
for (size_t i = 0; i < sliced_ffs.size(); ++i) { // TODO provide slices_ffs.cbegin() etc
const auto pair = sliced_ffs.getPair(i);
const IFormFactor& ff = *pair.first;
const size_t iLayer = pair.second;
const Material& material = slices[iLayer].material();
const std::unique_ptr<IFormFactor> ff(pair.first->clone());
ff->setAmbientMaterial(material);
std::unique_ptr<IComputeFF> computer;
if (slices.size() > 1) {
if (m_polarized)
computer = std::make_unique<ComputeDWBAPol>(ff, iLayer);
computer = std::make_unique<ComputeDWBAPol>(*ff, iLayer);
else
computer = std::make_unique<ComputeDWBA>(ff, iLayer);
computer = std::make_unique<ComputeDWBA>(*ff, iLayer);
} else {
// no need for DWBA, use BA
if (m_polarized)
computer = std::make_unique<ComputeBAPol>(ff, iLayer);
computer = std::make_unique<ComputeBAPol>(*ff, iLayer);
else
computer = std::make_unique<ComputeBA>(ff, iLayer);
computer = std::make_unique<ComputeBA>(*ff, iLayer);
}
const Material& slice_material = slices[iLayer].material();
computer->setAmbientMaterial(slice_material);
terms.emplace_back(CoherentFFTerm(computer.release()));
}
return CoherentFFSum(abundance / total_abundance, terms);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment