BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DetectorContext.h
Go to the documentation of this file.
1
// ************************************************************************** //
2
//
3
// BornAgain: simulate and fit scattering at grazing incidence
4
//
5
//! @file Device/Detector/DetectorContext.h
6
//! @brief Define DetectorContext class.
7
//!
8
//! @homepage http://www.bornagainproject.org
9
//! @license GNU General Public License v3 or higher (see COPYING)
10
//! @copyright Forschungszentrum Jülich GmbH 2018
11
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12
//
13
// ************************************************************************** //
14
15
#ifndef BORNAGAIN_CORE_DETECTOR_DETECTORCONTEXT_H
16
#define BORNAGAIN_CORE_DETECTOR_DETECTORCONTEXT_H
17
18
#include "
Base/Pixel/IPixel.h
"
19
#include "
Base/Vector/EigenCore.h
"
20
#include <memory>
21
#include <vector>
22
23
class
IDetector2D
;
24
25
//! Holds precalculated information for faster SimulationElement generation.
26
//! @ingroup detector
27
28
class
DetectorContext
29
{
30
public
:
31
DetectorContext
(
const
IDetector2D
* detector);
32
33
DetectorContext
(
const
DetectorContext
& other) =
delete
;
34
DetectorContext
& operator=(
const
DetectorContext
& other) =
delete
;
35
36
size_t
numberOfSimulationElements()
const
;
37
38
std::unique_ptr<IPixel>
createPixel
(
size_t
element_index)
const
;
39
40
size_t
detectorIndex(
size_t
element_index)
const
;
41
42
private
:
43
void
setup_context(
const
IDetector2D
* detector);
44
45
Eigen::Matrix2cd analyzer_operator;
46
std::vector<std::unique_ptr<IPixel>> pixels;
//! All unmasked pixels inside ROI.
47
std::vector<size_t> active_indices;
//! The sequence of detector bin indices (unmasked, in ROI)
48
};
49
50
#endif
// BORNAGAIN_CORE_DETECTOR_DETECTORCONTEXT_H
EigenCore.h
Include to deal with Eigen alignment centrally.
IPixel.h
Defines pure virtual interface IPixel (has no cpp file)
DetectorContext
Holds precalculated information for faster SimulationElement generation.
Definition:
DetectorContext.h:29
DetectorContext::createPixel
std::unique_ptr< IPixel > createPixel(size_t element_index) const
Creates pixel for given element index.
Definition:
DetectorContext.cpp:32
IDetector2D
Abstract 2D detector interface.
Definition:
IDetector2D.h:31
Device
Detector
DetectorContext.h
Generated by
1.9.1