BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DWBASingleComputation Class Reference

Class that handles all the computations involved in GISAS (particles, roughness,...) for a single detector bin. More...

Public Member Functions

 DWBASingleComputation ()
 
 ~DWBASingleComputation ()
 
void addLayoutComputation (ParticleLayoutComputation *p_layout_comp)
 
void compute (SimulationElement &elem) const
 
void setProgressHandler (ProgressHandler *p_progress)
 
void setRoughnessComputation (RoughMultiLayerComputation *p_roughness_comp)
 
void setSpecularBinComputation (GISASSpecularComputation *p_spec_comp)
 

Private Attributes

std::vector< std::unique_ptr< ParticleLayoutComputation > > m_layout_comps
 
std::unique_ptr< DelayedProgressCounterm_progress_counter
 
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
 
std::unique_ptr< RoughMultiLayerComputationm_roughness_comp
 
std::unique_ptr< GISASSpecularComputationm_spec_comp
 

Detailed Description

Class that handles all the computations involved in GISAS (particles, roughness,...) for a single detector bin.

Called by DWBASimulation on each detector bin.

Definition at line 42 of file DWBASingleComputation.h.

Constructor & Destructor Documentation

◆ DWBASingleComputation()

DWBASingleComputation::DWBASingleComputation ( )
default

◆ ~DWBASingleComputation()

DWBASingleComputation::~DWBASingleComputation ( )
default

Member Function Documentation

◆ addLayoutComputation()

void DWBASingleComputation::addLayoutComputation ( ParticleLayoutComputation p_layout_comp)

Definition at line 30 of file DWBASingleComputation.cpp.

31 {
32  m_layout_comps.emplace_back(p_layout_comp);
33  p_layout_comp->mergeRegionMap(m_region_map);
34 }
std::map< size_t, std::vector< HomogeneousRegion > > m_region_map
std::vector< std::unique_ptr< ParticleLayoutComputation > > m_layout_comps
void mergeRegionMap(std::map< size_t, std::vector< HomogeneousRegion >> &region_map) const
Merges its region map into the given one (notice non-const reference parameter)

References m_layout_comps, m_region_map, and ParticleLayoutComputation::mergeRegionMap().

Referenced by DWBAComputation::DWBAComputation().

Here is the call graph for this function:

◆ compute()

void DWBASingleComputation::compute ( SimulationElement elem) const

Definition at line 46 of file DWBASingleComputation.cpp.

47 {
48  for (auto& layout_comp : m_layout_comps)
49  layout_comp->compute(elem);
50 
51  if (m_roughness_comp) // also check absence of matrix RT coefficients
52  m_roughness_comp->compute(elem);
53 
54  if (m_spec_comp) // also check absence of matrix RT coefficients
55  m_spec_comp->compute(elem);
56 
58  m_progress_counter->stepProgress();
59 }
std::unique_ptr< GISASSpecularComputation > m_spec_comp
std::unique_ptr< DelayedProgressCounter > m_progress_counter
std::unique_ptr< RoughMultiLayerComputation > m_roughness_comp

References m_layout_comps, m_progress_counter, m_roughness_comp, and m_spec_comp.

Referenced by DWBAComputation::runProtected().

◆ setProgressHandler()

void DWBASingleComputation::setProgressHandler ( ProgressHandler p_progress)

Definition at line 25 of file DWBASingleComputation.cpp.

26 {
27  m_progress_counter = std::make_unique<DelayedProgressCounter>(p_progress, 100);
28 }

References m_progress_counter.

Referenced by DWBAComputation::runProtected().

◆ setRoughnessComputation()

void DWBASingleComputation::setRoughnessComputation ( RoughMultiLayerComputation p_roughness_comp)

Definition at line 36 of file DWBASingleComputation.cpp.

37 {
38  m_roughness_comp.reset(p_roughness_comp);
39 }

References m_roughness_comp.

Referenced by DWBAComputation::DWBAComputation().

◆ setSpecularBinComputation()

void DWBASingleComputation::setSpecularBinComputation ( GISASSpecularComputation p_spec_comp)

Definition at line 41 of file DWBASingleComputation.cpp.

42 {
43  m_spec_comp.reset(p_spec_comp);
44 }

References m_spec_comp.

Referenced by DWBAComputation::DWBAComputation().

Member Data Documentation

◆ m_layout_comps

std::vector<std::unique_ptr<ParticleLayoutComputation> > DWBASingleComputation::m_layout_comps
private

Definition at line 55 of file DWBASingleComputation.h.

Referenced by addLayoutComputation(), and compute().

◆ m_progress_counter

std::unique_ptr<DelayedProgressCounter> DWBASingleComputation::m_progress_counter
private

Definition at line 58 of file DWBASingleComputation.h.

Referenced by compute(), and setProgressHandler().

◆ m_region_map

std::map<size_t, std::vector<HomogeneousRegion> > DWBASingleComputation::m_region_map
private

Definition at line 59 of file DWBASingleComputation.h.

Referenced by addLayoutComputation().

◆ m_roughness_comp

std::unique_ptr<RoughMultiLayerComputation> DWBASingleComputation::m_roughness_comp
private

Definition at line 56 of file DWBASingleComputation.h.

Referenced by compute(), and setRoughnessComputation().

◆ m_spec_comp

std::unique_ptr<GISASSpecularComputation> DWBASingleComputation::m_spec_comp
private

Definition at line 57 of file DWBASingleComputation.h.

Referenced by compute(), and setSpecularBinComputation().


The documentation for this class was generated from the following files: