This class is to be used in calibration to identify and fit calibration peaks.
Public Member Functions | |
| QCalPeak () | |
| default constructor | |
| QCalPeak (const QCalPeak &orig) | |
| copy constructor | |
| QCalPeak (std::string Name, double actualEnergy) | |
| constructor | |
| QCalPeak (std::string Name, double actualEnergy, TF1 *fitFunction) | |
| constructor | |
| virtual | ~QCalPeak () |
| destructor | |
| bool | Found () const |
| Have we sucessfully located the peak yet? | |
| double | GetEnergy () const |
| Returns the actual peak energy. | |
| std::pair< double, double > | GetPeakMean () |
| Returns fit parameter named "mean" and its error. Returns <0,0> if the peak has not been found yet or if the fit function does not contain a parameter named "mean". | |
| std::pair< double, double > | GetPeakWidth () |
| Returns fit parameter named "width" and its error. Returns <0,0> if the peak has not been found yet or if the fit function does not contain a parameter named "width". | |
| std::string | GetName () |
| Get name of peak. | |
| void | SetName (std::string name) |
| Set the name of the peak. | |
| double | GetMinimum () |
| Get minimum. | |
| double | GetMaximum () |
| Get maximum. | |
| void | SetFitFunction (TF1 *newFitFunction) |
| Set fit function. | |
| void | SetRange (double newMin, double newMax) |
| Set Range. | |
| void | SetMinimum (double newMin) |
| Set minimum. | |
| void | SetMaximum (double newMax) |
| Set maximum. | |
| bool | SetInitialValues (std::vector< double > init) |
| Set initial values for fit. | |
| TF1 * | Fit (std::vector< double > data) |
| Fit to the data. | |
| bool | AutoInitialize (double ApproximateMean, std::vector< double > data, double NearestNeighbor, double ApproximateWidth=-1) |
| Intelligently guess inital values based on peak mean and data. | |
| std::string | Print (bool toScreen=true) |
| Print information about Calibration peak on screen or to string. | |
Private Attributes | |
| double | fActualEnergy |
| Actual energy of peak. | |
| std::string | fName |
| Name to identify peak. | |
| TF1 * | fFitFunction |
| Fitting function. | |
| bool | fFound |
| Did we sucessfully locate the peak? | |
| QCalPeak::QCalPeak | ( | std::string | Name, | |
| double | actualEnergy | |||
| ) |
constructor
| Name | Name to identify the peak | |
| actualEnergy | Energy of the peak |
| QCalPeak::QCalPeak | ( | std::string | Name, | |
| double | actualEnergy, | |||
| TF1 * | fitFunction | |||
| ) |
constructor
| Name | Name to identify the peak | |
| actualEnergy | Energy of the peak | |
| fitFunction | to use for peak (MUST be self normalized!) |
| bool QCalPeak::Found | ( | ) | const [inline] |
Have we sucessfully located the peak yet?
| std::string QCalPeak::GetName | ( | ) | [inline] |
Get name of peak.
| void QCalPeak::SetName | ( | std::string | name | ) | [inline] |
Set the name of the peak.
| name | New name |
| double QCalPeak::GetMinimum | ( | ) | [inline] |
Get minimum.
| double QCalPeak::GetMaximum | ( | ) | [inline] |
Get maximum.
| void QCalPeak::SetFitFunction | ( | TF1 * | newFitFunction | ) |
Set fit function.
| New | fit function |
| void QCalPeak::SetRange | ( | double | newMin, | |
| double | newMax | |||
| ) |
Set Range.
| New | minimum | |
| New | maximum |
| void QCalPeak::SetMinimum | ( | double | newMin | ) |
Set minimum.
| New | minimum |
| void QCalPeak::SetMaximum | ( | double | newMax | ) |
Set maximum.
| New | maximum |
| bool QCalPeak::SetInitialValues | ( | std::vector< double > | init | ) |
Set initial values for fit.
| seeds | vector of initial values for fit |
| TF1* QCalPeak::Fit | ( | std::vector< double > | data | ) |
Fit to the data.
| data | data to which we will fit |
| bool QCalPeak::AutoInitialize | ( | double | ApproximateMean, | |
| std::vector< double > | data, | |||
| double | NearestNeighbor, | |||
| double | ApproximateWidth = -1 | |||
| ) |
Intelligently guess inital values based on peak mean and data.
| mean | approximate mean of peak | |
| data | stabilized amplitudes | |
| NearestNeighbor | distance to nearest neighbor peak in keV |
| string QCalPeak::Print | ( | bool | toScreen = true |
) |
Print information about Calibration peak on screen or to string.
| toScreen | If true print to cout; else just return string |
1.5.1