QCalPeak Class Reference

List of all members.


Detailed Description

Class to store data regarding calibration peaks.

Author:
L. Kogler 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, 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?

Constructor & Destructor Documentation

QCalPeak::QCalPeak ( const QCalPeak orig  ) 

copy constructor

Parameters:
orig original QCalPeak

References fActualEnergy, fFitFunction, fFound, fInitialValues, and fName.

QCalPeak::QCalPeak ( std::string  Name,
double  actualEnergy 
)

constructor

Parameters:
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

Parameters:
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

Parameters:
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


Member Function Documentation

bool QCalPeak::Found (  )  const [inline]

Have we sucessfully located the peak yet?

Returns:
True if we found the peak, false if not.

References fFound.

std::string QCalPeak::GetName (  )  [inline]

Get name of peak.

Returns:
Name of peak

References fName.

void QCalPeak::SetName ( std::string  name  )  [inline]

Set the name of the peak.

Parameters:
name New name

References fName.

double QCalPeak::GetMinimum (  )  [inline]

Get minimum.

Returns:
Minimum

References fFitFunction.

double QCalPeak::GetMaximum (  )  [inline]

Get maximum.

Returns:
Maximum

References fFitFunction.

void QCalPeak::SetFitFunction ( TF1 *  newFitFunction  ) 

Set fit function.

Parameters:
New fit function

References fFitFunction, and fFound.

void QCalPeak::SetRange ( double  newMin,
double  newMax 
)

Set Range.

Parameters:
New minimum
New maximum

References fFitFunction.

void QCalPeak::SetMinimum ( double  newMin  ) 

Set minimum.

Parameters:
New minimum

References fFitFunction.

void QCalPeak::SetMaximum ( double  newMax  ) 

Set maximum.

Parameters:
New maximum

References fFitFunction.

bool QCalPeak::SetInitialValues ( std::vector< double >  init  ) 

Set initial values for fit.

Parameters:
seeds vector of initial values for fit
Returns:
Returns true if successful, false if failed (wrong number of fit parameters)

bool QCalPeak::SetMean ( double  newMean  ) 

Set mean.

Parameters:
newmean New value for mean
Returns:
Returns true if successful, false if failed (no param named mean)

References fFitFunction, and fFound.

bool QCalPeak::SetWidth ( double  newWidth  ) 

Set width.

Parameters:
newwidth New value for width
Returns:
Returns true if successful, false if failed (no param named width)

References fFitFunction, and fFound.

TF1* QCalPeak::Fit ( std::vector< double >  data,
bool  force = false 
)

Fit to the data.

Parameters:
data data to which we will fit
Returns:
Returns pointer to fitted function

bool QCalPeak::AutoInitialize ( double  ApproximateMean,
std::vector< double >  data,
double  NearestNeighbor,
double  ApproximateWidth = -1 
)

Intelligently guess inital values based on peak mean and data.

Parameters:
mean approximate mean of peak
data stabilized amplitudes
NearestNeighbor distance to nearest neighbor peak in keV
Returns:
Returns true if successful, false if failed

string QCalPeak::Print ( bool  toScreen = true  ) 

Print information about Calibration peak on screen or to string.

Parameters:
toScreen If true print to cout; else just return string
Returns:
Returns string containing information about peak

References fActualEnergy, fFitFunction, fFound, and fName.


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

Generated on Tue Nov 16 10:50:04 2010 for CUORE Software by  doxygen 1.5.6