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, std::vector< double > initialValues) | |
constructor | |
QCalPeak (std::string Name, double actualEnergy, TF1 *fitFunction, double *initialValues) | |
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. | |
bool | SetInitialValues () |
bool | SetMean (double newMean) |
Set mean. | |
bool | SetWidth (double newWidth) |
Set width. | |
TF1 * | Fit (std::vector< double > data, bool force=false) |
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. | |
std::vector< double > | fInitialValues |
Vector containing values to initialize fit. | |
bool | fFound |
Did we sucessfully locate the peak? |
QCalPeak::QCalPeak | ( | const QCalPeak & | orig | ) |
copy constructor
orig | original QCalPeak |
References fActualEnergy, fFitFunction, fFound, fInitialValues, and fName.
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, | |||
std::vector< double > | initialValues | |||
) |
constructor
Name | Name to identify the peak | |
actualEnergy | Energy of the peak | |
fitFunction | to use for peak (MUST be self normalized!) | |
initialValues | values used to initialize fit function. Size of vector MUST equal number of parameters in fit |
QCalPeak::QCalPeak | ( | std::string | Name, | |
double | actualEnergy, | |||
TF1 * | fitFunction, | |||
double * | initialValues | |||
) |
constructor
Name | Name to identify the peak | |
actualEnergy | Energy of the peak | |
fitFunction | to use for peak (MUST be self normalized!) | |
initialValues | values used to initialize fit function. Size of array MUST equal number of parameters in fit function |
bool QCalPeak::Found | ( | ) | const [inline] |
Have we sucessfully located the peak yet?
References fFound.
std::string QCalPeak::GetName | ( | ) | [inline] |
void QCalPeak::SetName | ( | std::string | name | ) | [inline] |
double QCalPeak::GetMinimum | ( | ) | [inline] |
double QCalPeak::GetMaximum | ( | ) | [inline] |
void QCalPeak::SetFitFunction | ( | TF1 * | newFitFunction | ) |
void QCalPeak::SetRange | ( | double | newMin, | |
double | newMax | |||
) |
void QCalPeak::SetMinimum | ( | double | newMin | ) |
void QCalPeak::SetMaximum | ( | double | newMax | ) |
bool QCalPeak::SetInitialValues | ( | std::vector< double > | init | ) |
Set initial values for fit.
seeds | vector of initial values for fit |
bool QCalPeak::SetMean | ( | double | newMean | ) |
Set mean.
newmean | New value for mean |
References fFitFunction, and fFound.
bool QCalPeak::SetWidth | ( | double | newWidth | ) |
Set width.
newwidth | New value for width |
References fFitFunction, and fFound.
TF1* QCalPeak::Fit | ( | std::vector< double > | data, | |
bool | force = false | |||
) |
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 |
References fActualEnergy, fFitFunction, fFound, and fName.