IMP.bff
|
A class for scaling a DecayCurve by a constant factor and subtracting a constant background value. More...
#include <DecayScale.h>
Public Member Functions | |
double | get_number_of_photons () |
double | get_constant_background () const |
void | set_constant_background (double v) |
void | set_blank_outside (double v) |
bool | get_blank_outside () |
void | set (DecayCurve *data=nullptr, double constant_background=0.0, int start=0, int stop=-1, bool active=true, bool blank_outside=true) |
DecayScale (DecayCurve *data=nullptr, double constant_background=0.0, int start=0, int stop=-1, bool active=true, bool blank_outside=true) | |
void | add (DecayCurve *decay) |
![]() | |
virtual void | set_data (DecayCurve *v) |
virtual DecayCurve * | get_data () |
bool | is_active () const |
void | set_active (bool v) |
void | set (DecayCurve *data, int start=0, int stop=-1, bool active=true) |
void | resize (size_t n, double v=0.0) |
DecayModifier (DecayCurve *data=nullptr, int start=0, int stop=-1, bool active=true) | |
~DecayModifier () | |
![]() | |
void | set_start (int v) |
Set the start index of the decay range. | |
size_t | get_start (DecayCurve *d=nullptr) const |
Get the start index of the decay range. | |
void | set_stop (int v) |
Set the stop index of the decay range. | |
size_t | get_stop (DecayCurve *d=nullptr) const |
Get the stop index of the decay range. | |
void | set_range (std::vector< int > v) |
Set the range using a vector of indices. | |
std::vector< int > | get_range (DecayCurve *d=nullptr) |
Get the range as a vector of indices. | |
void | set (int start=0, int stop=-1) |
Set the start and stop indices of the decay range. | |
DecayRange (int start, int stop) | |
Constructor. | |
virtual | ~DecayRange ()=default |
Destructor. | |
Additional Inherited Members | |
![]() | |
DecayCurve * | data = nullptr |
DecayCurve * | default_data = nullptr |
A class for scaling a DecayCurve by a constant factor and subtracting a constant background value.
The DecayScale class is a subclass of DecayModifier and is used to scale a DecayCurve by a constant factor and subtract a constant background value. It provides methods to set and get the constant background value, as well as to set whether the curve should be blanked outside a specified range. The scaling and background subtraction are applied to the DecayCurve when the modify() method is called.
DecayScale::DecayScale | ( | DecayCurve * | data = nullptr , |
double | constant_background = 0.0 , |
||
int | start = 0 , |
||
int | stop = -1 , |
||
bool | active = true , |
||
bool | blank_outside = true |
||
) |
Construct a DecayScale object with the specified parameters.
data | The DecayCurve to be scaled. |
constant_background | The constant background value to be subtracted. |
start | The start index of the range to be considered. |
stop | The stop index of the range to be considered. |
active | Flag indicating whether the DecayScale object is active. |
blank_outside | Flag indicating whether the curve should be blanked outside the specified range. |
|
virtual |
Add a DecayCurve to be scaled by the DecayScale object.
decay | The DecayCurve to be added. |
Implements DecayModifier.
bool DecayScale::get_blank_outside | ( | ) |
Get whether the curve should be blanked outside a specified range.
double DecayScale::get_constant_background | ( | ) | const |
Get the constant background value.
double DecayScale::get_number_of_photons | ( | ) |
Get the number of photons in the data between the start and stop indices. If the model is scaled to the data, the number of photons is returned. Otherwise, the user-specified number of photons is returned.
void DecayScale::set | ( | DecayCurve * | data = nullptr , |
double | constant_background = 0.0 , |
||
int | start = 0 , |
||
int | stop = -1 , |
||
bool | active = true , |
||
bool | blank_outside = true |
||
) |
Set the parameters of the DecayScale object.
data | The DecayCurve to be scaled. |
constant_background | The constant background value to be subtracted. |
start | The start index of the range to be considered. |
stop | The stop index of the range to be considered. |
active | Flag indicating whether the DecayScale object is active. |
blank_outside | Flag indicating whether the curve should be blanked outside the specified range. |
void DecayScale::set_blank_outside | ( | double | v | ) |
Set whether the curve should be blanked outside a specified range.
v | Flag indicating whether the curve should be blanked outside a specified range. |
void DecayScale::set_constant_background | ( | double | v | ) |
Set the constant background value.
v | The constant background value to be set. |