IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
IMP::bff::DecayScale Class Reference

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

#include <IMP/bff/DecayScale.h>

+ Inheritance diagram for IMP::bff::DecayScale:

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.

Definition at line 34 of file DecayScale.h.

Public Member Functions

 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) override
 
bool get_blank_outside ()
 
double get_constant_background () const
 
double get_number_of_photons ()
 
void set (DecayCurve *data=nullptr, double constant_background=0.0, int start=0, int stop=-1, bool active=true, bool blank_outside=true)
 
void set_blank_outside (double v)
 
void set_constant_background (double v)
 
- Public Member Functions inherited from IMP::bff::DecayModifier
 DecayModifier (DecayCurve *data=nullptr, int start=0, int stop=-1, bool active=true)
 
 ~DecayModifier ()
 
virtual DecayCurveget_data ()
 
bool is_active () const
 
void resize (size_t n, double v=0.0)
 
void set (DecayCurve *data, int start=0, int stop=-1, bool active=true)
 
void set_active (bool v)
 
virtual void set_data (DecayCurve *v)
 
- Public Member Functions inherited from IMP::bff::DecayRange
 DecayRange (int start, int stop)
 Constructor. More...
 
virtual ~DecayRange ()=default
 Destructor. More...
 
std::vector< int > get_range (DecayCurve *d=nullptr)
 Get the range as a vector of indices. More...
 
size_t get_start (DecayCurve *d=nullptr) const
 Get the start index of the decay range. More...
 
size_t get_stop (DecayCurve *d=nullptr) const
 Get the stop index of the decay range. More...
 
void set (int start=0, int stop=-1)
 Set the start and stop indices of the decay range. More...
 
void set_range (std::vector< int > v)
 Set the range using a vector of indices. More...
 
void set_start (int v)
 Set the start index of the decay range. More...
 
void set_stop (int v)
 Set the stop index of the decay range. More...
 
void show (std::ostream &out=std::cout) const
 

Additional Inherited Members

- Protected Attributes inherited from IMP::bff::DecayModifier
DecayCurvedata = nullptr
 
DecayCurvedefault_data = nullptr
 

Constructor & Destructor Documentation

IMP::bff::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

void IMP::bff::DecayScale::add ( DecayCurve decay)
overridevirtual

Add a DecayCurve to be scaled by the DecayScale object.

Parameters
decayThe DecayCurve to be added.

Implements IMP::bff::DecayModifier.

bool IMP::bff::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.
double IMP::bff::DecayScale::get_constant_background ( ) const

Get the constant background value.

Returns
The constant background value.
double IMP::bff::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.
void IMP::bff::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.
void IMP::bff::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.
void IMP::bff::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: