IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
DecayScale.h
Go to the documentation of this file.
1 /**
2  * \file IMP/bff/DecayScale.h
3  * \brief Simple Accessible Volume decorator.
4  *
5  * This file contains the declaration of the DecayScale class, which is a subclass
6  * of DecayModifier. DecayScale is used to scale a DecayCurve by a constant factor
7  * and subtract a constant background value.
8  *
9  * \authors Thomas-Otavio Peulen
10  * Copyright 2007-2023 IMP Inventors. All rights reserved.
11  */
12 
13 #ifndef IMPBFF_DECAYSCALE_H
14 #define IMPBFF_DECAYSCALE_H
15 
16 #include <IMP/bff/bff_config.h>
17 #include <iostream>
18 #include <IMP/bff/DecayCurve.h>
19 #include <IMP/bff/DecayModifier.h>
20 #include <IMP/bff/DecayRoutines.h>
21 
22 IMPBFF_BEGIN_NAMESPACE
23 
24 /**
25  * \class DecayScale
26  * \brief A class for scaling a DecayCurve by a constant factor and subtracting a constant background value.
27  *
28  * The DecayScale class is a subclass of DecayModifier and is used to scale a DecayCurve
29  * by a constant factor and subtract a constant background value. It provides methods to
30  * set and get the constant background value, as well as to set whether the curve should be
31  * blanked outside a specified range. The scaling and background subtraction are applied
32  * to the DecayCurve when the modify() method is called.
33  */
34 class IMPBFFEXPORT DecayScale : public DecayModifier {
35 private:
36  double _constant_background = 0.0; //!< A constant that is subtracted from the data
37  bool _blank_outside = true; //!< Flag indicating whether the curve should be blanked outside a specified range
38 
39 public:
40  /**
41  * Get the number of photons in the data between the start and stop indices.
42  * If the model is scaled to the data, the number of photons is returned.
43  * Otherwise, the user-specified number of photons is returned.
44  * \return The number of photons in the data.
45  */
46  double get_number_of_photons();
47 
48  /**
49  * Get the constant background value.
50  * \return The constant background value.
51  */
52  double get_constant_background() const;
53 
54  /**
55  * Set the constant background value.
56  * \param v The constant background value to be set.
57  */
58  void set_constant_background(double v);
59 
60  /**
61  * Set whether the curve should be blanked outside a specified range.
62  * \param v Flag indicating whether the curve should be blanked outside a specified range.
63  */
64  void set_blank_outside(double v);
65 
66  /**
67  * Get whether the curve should be blanked outside a specified range.
68  * \return Flag indicating whether the curve should be blanked outside a specified range.
69  */
70  bool get_blank_outside();
71 
72  /**
73  * Set the parameters of the DecayScale object.
74  * \param data The DecayCurve to be scaled.
75  * \param constant_background The constant background value to be subtracted.
76  * \param start The start index of the range to be considered.
77  * \param stop The stop index of the range to be considered.
78  * \param active Flag indicating whether the DecayScale object is active.
79  * \param blank_outside Flag indicating whether the curve should be blanked outside the specified range.
80  */
81  void set(DecayCurve* data = nullptr, double constant_background = 0.0,
82  int start = 0, int stop = -1, bool active = true,
83  bool blank_outside = true);
84 
85  /**
86  * Construct a DecayScale object with the specified parameters.
87  * \param data The DecayCurve to be scaled.
88  * \param constant_background The constant background value to be subtracted.
89  * \param start The start index of the range to be considered.
90  * \param stop The stop index of the range to be considered.
91  * \param active Flag indicating whether the DecayScale object is active.
92  * \param blank_outside Flag indicating whether the curve should be blanked outside the specified range.
93  */
94  DecayScale(DecayCurve* data = nullptr, double constant_background = 0.0,
95  int start = 0, int stop = -1, bool active = true,
96  bool blank_outside = true);
97 
98  /**
99  * Add a DecayCurve to be scaled by the DecayScale object.
100  * \param decay The DecayCurve to be added.
101  */
102  void add(DecayCurve* decay) override;
103 };
104 
106 
107 IMPBFF_END_NAMESPACE
108 
109 #endif // IMPBFF_DECAYSCALE_H
Simple Accessible Volume decorator.
void set(DecayCurve *data, int start=0, int stop=-1, bool active=true)
Decay routines (e.g. convolution, scaling, and lamp shift routines)
A decorator that modifies a DecayCurve within a specified range.
Definition: DecayModifier.h:29
A more IMP-like version of the std::vector.
Definition: Vector.h:50
A class for scaling a DecayCurve by a constant factor and subtracting a constant background value...
Definition: DecayScale.h:34
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
Class for fluorescence decay curves.
Class for fluorescence decay curves.
Definition: DecayCurve.h:38
virtual void add(DecayCurve *out)=0