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)
 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?


Constructor & Destructor Documentation

QCalPeak::QCalPeak ( const QCalPeak orig  ) 

copy constructor

Parameters:
orig original QCalPeak

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 
)

constructor

Parameters:
Name Name to identify the peak
actualEnergy Energy of the peak
fitFunction to use for peak (MUST be self normalized!)


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.

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

Get name of peak.

Returns:
Name of peak

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

Set the name of the peak.

Parameters:
name New name

double QCalPeak::GetMinimum (  )  [inline]

Get minimum.

Returns:
Minimum

double QCalPeak::GetMaximum (  )  [inline]

Get maximum.

Returns:
Maximum

void QCalPeak::SetFitFunction ( TF1 *  newFitFunction  ) 

Set fit function.

Parameters:
New fit function

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

Set Range.

Parameters:
New minimum
New maximum

void QCalPeak::SetMinimum ( double  newMin  ) 

Set minimum.

Parameters:
New minimum

void QCalPeak::SetMaximum ( double  newMax  ) 

Set maximum.

Parameters:
New maximum

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)

TF1* QCalPeak::Fit ( std::vector< double >  data  ) 

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


The documentation for this class was generated from the following files:
Generated on Fri Mar 6 13:40:42 2009 for CUORE Software by  doxygen 1.5.1