A mask for energy masking.
More...
#include <EnergyMask.h>
|
| EnergyMask (double dyde, double dydL, double dydx, double dy, double dL, double dx, double dE) |
| Constructor. More...
|
|
double | getStep () const |
| Returns energy step size of the discrete mask. More...
|
|
double | getFullWidth () const |
| Returns mask full width. More...
|
|
const std::vector< double > & | getMask () const |
| Returns discrete mask (note: only half of the mask is stored) More...
|
|
double | getMask (double E) const |
| Returns mask value at given energy difference by calling direct calculation of the convolution. More...
|
|
double | getMask (int i) const |
| Returns mask value at given index from stored discrete mask. More...
|
|
double | getMask (int i, double fract) const |
| Returns mask value with linear interpolation between stored discrete mask elements. More...
|
|
double | getEnergyDifference (int i) |
| Returns energy difference w.r.t center of mask. More...
|
|
|
static void | setNMin (unsigned Nmin) |
| Sets minimal size of discrete mask. More...
|
|
static void | setNMax (unsigned Nmax) |
| Sets maximal size of discrete mask. More...
|
|
|
double | twoSquareConvolution (double E) const |
| Returns a value of convolution of two square distributions at given photon energy using the largest two of full widths (m_A, m_B). More...
|
|
double | threeSquareConvolution (double E) const |
| Returns a value of convolution of three square distributions at given photon energy. More...
|
|
double | mask (int i) const |
| Returns mask value at given index from stored discrete mask. More...
|
|
|
double | m_dE = 0 |
| energy step
|
|
double | m_Wy = 0 |
| enegy full width of dy
|
|
double | m_A = 0 |
| the largest energy full width
|
|
double | m_B = 0 |
| the middle energy full width
|
|
double | m_C = 0 |
| the smallset energy full width
|
|
std::vector< double > | m_mask |
| discrete mask (half of)
|
|
|
static unsigned | s_Nmin = 4 |
| minimal mask size
|
|
static unsigned | s_Nmax = 256 |
| maximal mask size
|
|
A mask for energy masking.
Definition at line 24 of file EnergyMask.h.
◆ EnergyMask()
EnergyMask |
( |
double |
dyde, |
|
|
double |
dydL, |
|
|
double |
dydx, |
|
|
double |
dy, |
|
|
double |
dL, |
|
|
double |
dx, |
|
|
double |
dE |
|
) |
| |
Constructor.
- Parameters
-
dyde | derivative dy/de [cm/eV] |
dydL | derivative dy/dL |
dydx | derivative dy/dx |
dy | effective PMT pad size in y [cm] |
dL | length of particle trajectory within the quartz [cm] |
dx | PMT pad size in x [cm] |
dE | energy step [eV] |
Definition at line 25 of file EnergyMask.cc.
29 B2ERROR(
"TOP::EnergyMask: dy must be > 0");
33 std::vector<double> x;
35 x.push_back(std::abs(dL * dydL / dyde));
36 x.push_back(std::abs(dx * dydx / dyde));
37 std::sort(x.begin(), x.end());
43 unsigned N = (
m_A +
m_B +
m_C) / 2.0 / dE + 1;
44 if (N < s_Nmin or N >
s_Nmax)
return;
47 for (
unsigned i = 0; i <= N; i++) {
53 for (
unsigned i = 0; i <= N; i++) {
double threeSquareConvolution(double E) const
Returns a value of convolution of three square distributions at given photon energy.
double m_C
the smallset energy full width
double twoSquareConvolution(double E) const
Returns a value of convolution of two square distributions at given photon energy using the largest t...
double m_Wy
enegy full width of dy
std::vector< double > m_mask
discrete mask (half of)
double m_A
the largest energy full width
double m_B
the middle energy full width
static unsigned s_Nmax
maximal mask size
◆ getEnergyDifference()
double getEnergyDifference |
( |
int |
i | ) |
|
|
inline |
Returns energy difference w.r.t center of mask.
- Parameters
-
i | index (all values are valid) |
- Returns
- energy difference w.r.t center of mask [eV]
Definition at line 99 of file EnergyMask.h.
◆ getFullWidth()
double getFullWidth |
( |
| ) |
const |
|
inline |
Returns mask full width.
- Returns
- full width [eV]
Definition at line 62 of file EnergyMask.h.
◆ getMask() [1/4]
const std::vector<double>& getMask |
( |
| ) |
const |
|
inline |
Returns discrete mask (note: only half of the mask is stored)
- Returns
- discrete mask
Definition at line 68 of file EnergyMask.h.
◆ getMask() [2/4]
double getMask |
( |
double |
E | ) |
const |
Returns mask value at given energy difference by calling direct calculation of the convolution.
- Parameters
-
E | photon energy difference w.r.t center of mask [eV] |
- Returns
- mask value
Definition at line 62 of file EnergyMask.cc.
◆ getMask() [3/4]
double getMask |
( |
int |
i | ) |
const |
Returns mask value at given index from stored discrete mask.
If discrete mask is empty it calls direct calculation of convolution.
- Parameters
-
i | index (all values are valid) |
- Returns
- mask value
Definition at line 72 of file EnergyMask.cc.
◆ getMask() [4/4]
double getMask |
( |
int |
i, |
|
|
double |
fract |
|
) |
| const |
Returns mask value with linear interpolation between stored discrete mask elements.
If discrete mask is empty it calls direct calculation of convolution.
- Parameters
-
i | index (all values are valid) |
fract | fractional part for linear interpolation (values btw. -0.5 and 0.5) |
- Returns
- mask value
Definition at line 79 of file EnergyMask.cc.
◆ getStep()
Returns energy step size of the discrete mask.
- Returns
- step [eV]
Definition at line 56 of file EnergyMask.h.
◆ mask()
double mask |
( |
int |
i | ) |
const |
|
inlineprivate |
Returns mask value at given index from stored discrete mask.
- Parameters
-
i | index (all values are valid) |
- Returns
- mask value or 0 if index is out of array range
Definition at line 138 of file EnergyMask.h.
◆ setNMax()
static void setNMax |
( |
unsigned |
Nmax | ) |
|
|
inlinestatic |
Sets maximal size of discrete mask.
- Parameters
-
Definition at line 50 of file EnergyMask.h.
◆ setNMin()
static void setNMin |
( |
unsigned |
Nmin | ) |
|
|
inlinestatic |
Sets minimal size of discrete mask.
- Parameters
-
Definition at line 44 of file EnergyMask.h.
◆ threeSquareConvolution()
double threeSquareConvolution |
( |
double |
E | ) |
const |
|
private |
Returns a value of convolution of three square distributions at given photon energy.
- Parameters
-
E | photon energy difference w.r.t center of mask [eV] |
- Returns
- convolution value
Definition at line 107 of file EnergyMask.cc.
◆ twoSquareConvolution()
double twoSquareConvolution |
( |
double |
E | ) |
const |
|
private |
Returns a value of convolution of two square distributions at given photon energy using the largest two of full widths (m_A, m_B).
- Parameters
-
E | photon energy difference w.r.t center of mask [eV] |
- Returns
- convolution value
Definition at line 91 of file EnergyMask.cc.
The documentation for this class was generated from the following files: