IMP.bff
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DecayScale Class Reference

A class for scaling a DecayCurve by a constant factor and subtracting a constant background value. More...

#include <DecayScale.h>

Inheritance diagram for DecayScale:
Inheritance graph
Collaboration diagram for DecayScale:
Collaboration graph

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)
 
- Public Member Functions inherited from DecayModifier
virtual void set_data (DecayCurve *v)
 
virtual DecayCurveget_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 ()
 
- Public Member Functions inherited from DecayRange
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

- Protected Attributes inherited from DecayModifier
DecayCurvedata = nullptr
 
DecayCurvedefault_data = nullptr
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DecayScale()

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.

Parameters
dataThe DecayCurve to be scaled.
constant_backgroundThe constant background value to be subtracted.
startThe start index of the range to be considered.
stopThe stop index of the range to be considered.
activeFlag indicating whether the DecayScale object is active.
blank_outsideFlag indicating whether the curve should be blanked outside the specified range.

Member Function Documentation

◆ add()

void DecayScale::add ( DecayCurve decay)
virtual

Add a DecayCurve to be scaled by the DecayScale object.

Parameters
decayThe DecayCurve to be added.

Implements DecayModifier.

◆ get_blank_outside()

bool DecayScale::get_blank_outside ( )

Get whether the curve should be blanked outside a specified range.

Returns
Flag indicating whether the curve should be blanked outside a specified range.

◆ get_constant_background()

double DecayScale::get_constant_background ( ) const

Get the constant background value.

Returns
The constant background value.

◆ get_number_of_photons()

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.

Returns
The number of photons in the data.

◆ set()

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.

Parameters
dataThe DecayCurve to be scaled.
constant_backgroundThe constant background value to be subtracted.
startThe start index of the range to be considered.
stopThe stop index of the range to be considered.
activeFlag indicating whether the DecayScale object is active.
blank_outsideFlag indicating whether the curve should be blanked outside the specified range.

◆ set_blank_outside()

void DecayScale::set_blank_outside ( double  v)

Set whether the curve should be blanked outside a specified range.

Parameters
vFlag indicating whether the curve should be blanked outside a specified range.

◆ set_constant_background()

void DecayScale::set_constant_background ( double  v)

Set the constant background value.

Parameters
vThe constant background value to be set.

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