Mantid
Loading...
Searching...
No Matches
Framework
Algorithms
inc
MantidAlgorithms
WeightingStrategy.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2011 ISIS Rutherford Appleton Laboratory UKRI,
4
// NScD Oak Ridge National Laboratory, European Spallation Source,
5
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8
9
#include "MantidAlgorithms/DllConfig.h"
10
#include "
MantidKernel/V3D.h
"
11
12
namespace
Mantid
{
13
namespace
Algorithms {
14
23
class
MANTID_ALGORITHMS_DLL
WeightingStrategy
{
24
public
:
26
WeightingStrategy
(
const
double
cutOff);
28
WeightingStrategy
();
30
virtual
~WeightingStrategy
() =
default
;
37
virtual
double
weightAt
(
const
Mantid::Kernel::V3D
&distance) = 0;
38
46
virtual
double
weightAt
(
const
double
&adjX,
const
double
&ix,
const
double
&adjY,
const
double
&iy) = 0;
47
48
protected
:
50
double
m_cutOff
;
51
};
52
53
/*
54
Flat (no weighting) strategy. Concrete WeightingStrategy
55
*/
56
class
MANTID_ALGORITHMS_DLL
FlatWeighting
:
public
WeightingStrategy
{
57
public
:
58
double
weightAt(
const
double
&,
const
double
&,
const
double
&,
const
double
&)
override
;
59
double
weightAt(
const
Mantid::Kernel::V3D
&)
override
;
60
};
61
62
/*
63
Linear weighting strategy.
64
*/
65
class
MANTID_ALGORITHMS_DLL
LinearWeighting
:
public
WeightingStrategy
{
66
public
:
67
LinearWeighting
(
const
double
cutOff);
68
double
weightAt(
const
Mantid::Kernel::V3D
&)
override
;
69
double
weightAt(
const
double
&adjX,
const
double
&ix,
const
double
&adjY,
const
double
&iy)
override
;
70
};
71
72
/*
73
Parabolic weighting strategy.
74
*/
75
class
MANTID_ALGORITHMS_DLL
ParabolicWeighting
:
public
WeightingStrategy
{
76
public
:
77
ParabolicWeighting
(
const
double
cutOff);
78
double
weightAt(
const
Mantid::Kernel::V3D
&)
override
;
79
double
weightAt(
const
double
&adjX,
const
double
&ix,
const
double
&adjY,
const
double
&iy)
override
;
80
};
81
82
/*
83
Null weighting strategy.
84
*/
85
class
MANTID_ALGORITHMS_DLL
NullWeighting
:
public
WeightingStrategy
{
86
public
:
87
double
weightAt(
const
Mantid::Kernel::V3D
&)
override
;
88
double
weightAt(
const
double
&,
const
double
&,
const
double
&,
const
double
&)
override
;
89
};
90
91
/*
92
Gaussian nD Strategy.
93
94
y = exp(-0.5*((r./p(1)).^2) where p = sqtr(2)*sigma
95
*/
96
class
MANTID_ALGORITHMS_DLL
GaussianWeightingnD
:
public
WeightingStrategy
{
97
public
:
98
GaussianWeightingnD
(
double
cutOff,
double
sigma
);
99
double
weightAt(
const
Mantid::Kernel::V3D
&)
override
;
100
double
weightAt(
const
double
&,
const
double
&,
const
double
&,
const
double
&)
override
;
101
102
private
:
103
double
calculateGaussian(
const
double
normalisedDistanceSq);
104
double
m_twiceSigmaSquared
;
105
};
106
107
}
// namespace Algorithms
108
}
// namespace Mantid
sigma
double sigma
Definition:
GetAllEi.cpp:156
V3D.h
Mantid::Algorithms::FlatWeighting
Definition:
WeightingStrategy.h:56
Mantid::Algorithms::GaussianWeightingnD
Definition:
WeightingStrategy.h:96
Mantid::Algorithms::GaussianWeightingnD::m_twiceSigmaSquared
double m_twiceSigmaSquared
Definition:
WeightingStrategy.h:104
Mantid::Algorithms::LinearWeighting
Definition:
WeightingStrategy.h:65
Mantid::Algorithms::NullWeighting
Definition:
WeightingStrategy.h:85
Mantid::Algorithms::ParabolicWeighting
Definition:
WeightingStrategy.h:75
Mantid::Algorithms::WeightingStrategy
WeightingStrategy :
Definition:
WeightingStrategy.h:23
Mantid::Algorithms::WeightingStrategy::weightAt
virtual double weightAt(const double &adjX, const double &ix, const double &adjY, const double &iy)=0
Calculate the weight at distance from epicenter.
Mantid::Algorithms::WeightingStrategy::weightAt
virtual double weightAt(const Mantid::Kernel::V3D &distance)=0
Calculate the weight at distance from epicenter.
Mantid::Algorithms::WeightingStrategy::~WeightingStrategy
virtual ~WeightingStrategy()=default
Destructor.
Mantid::Algorithms::WeightingStrategy::m_cutOff
double m_cutOff
Cutoff member.
Definition:
WeightingStrategy.h:50
Mantid::Kernel::V3D
Class for 3D vectors.
Definition:
V3D.h:34
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition:
AbsorptionCorrection.h:18
Generated on Tue Jan 3 2023 11:57:16 for Mantid by
1.9.5