DDASToys for NSCLDAQ  6.2-000
Public Member Functions | List of all members
FitManager Class Reference

Provides an interface for calculating trace fits using HitExtension fit parameters. More...

#include <FitManager.h>

Public Member Functions

 FitManager ()
 Constructor. More...
 
 ~FitManager ()
 Destructor. More...
 
void configure (std::string method)
 Configure the fit method settings. More...
 
void readConfigFile ()
 Read the configuration file using the Configuration class. More...
 
void readTemplateFile ()
 Read the template file using the Configuration class. More...
 
std::vector< double > getSinglePulseFit (const ddastoys::HitExtension &ext, unsigned low, unsigned high)
 Create and return a vector of fit values for each trace sample in the fit range. More...
 
std::vector< double > getDoublePulseFit (const ddastoys::HitExtension &ext, unsigned low, unsigned high)
 Create and return a vector of fit values for each trace sample in the fit range. More...
 
unsigned getLowFitLimit (const ddastoys::DDASFitHit &hit)
 Get the lower limit of the fit range. More...
 
unsigned getHighFitLimit (const ddastoys::DDASFitHit &hit)
 Get the upper limit of the fit range. More...
 
void setMethod (fitMethod m)
 Set the fitting method. More...
 
enum fitMethod getMethod ()
 Get the fitting method. More...
 

Detailed Description

Provides an interface for calculating trace fits using HitExtension fit parameters.

Wrapper class to call fitting functions from either the analytic fit or the template fit using the same signature. This is achieved by encapsulating the template-specfic data (the template itself and its align point) in this class by accessing the Configuration settings and switching based on the enum type.

Constructor & Destructor Documentation

◆ FitManager()

FitManager::FitManager ( )

Constructor.

The FitManager owns a Configuration object used to read settings from configuration files.

◆ ~FitManager()

FitManager::~FitManager ( )

Destructor.

Delete the Configuration object owned by this class.

Member Function Documentation

◆ configure()

void FitManager::configure ( std::string  method)

Configure the fit method settings.

Parameters
methodString describing the fit method.

Configuration is performed based on a text string which comes directly from the text of the fit method selection box. We do need to know what those possible strings are. Terminate the program and issue an error message if the fit method is not known.

◆ getDoublePulseFit()

std::vector< double > FitManager::getDoublePulseFit ( const ddastoys::HitExtension ext,
unsigned  low,
unsigned  high 
)

Create and return a vector of fit values for each trace sample in the fit range.

Parameters
extReferences the HitExtension containing the fit parameters for this hit.
lowLow limit of the fit in samples.
highHigh limit of the fit in samples.
Returns
Vector of fit values for range [low, high].

◆ getHighFitLimit()

unsigned FitManager::getHighFitLimit ( const ddastoys::DDASFitHit hit)

Get the upper limit of the fit range.

Parameters
hitReferences the hit we are currently processing.
Returns
The upper limit of the fitting range.

The fitting range is mapped in the Configuration class for hits keyed by a unique identifier derived from their crate/slot/channel. Note that the high fitting limit is inclusive.

◆ getLowFitLimit()

unsigned FitManager::getLowFitLimit ( const ddastoys::DDASFitHit hit)

Get the lower limit of the fit range.

Parameters
hitReferences the hit we are currently processing.
Returns
The lower limit of the fitting range.

The fitting range is mapped in the Configuration class for hits keyed by a unique identifier derived from their crate/slot/channel. Note that the low fitting limit is inclusive.

◆ getMethod()

enum fitMethod FitManager::getMethod ( )
inline

Get the fitting method.

Returns
fitMethod enum type.

◆ getSinglePulseFit()

std::vector< double > FitManager::getSinglePulseFit ( const ddastoys::HitExtension ext,
unsigned  low,
unsigned  high 
)

Create and return a vector of fit values for each trace sample in the fit range.

Parameters
extReferences the HitExtension containing the fit parameters for this hit.
lowLow limit of the fit in samples.
highHigh limit of the fit in samples.
Returns
Vector of fit values for range [low, high].

◆ readConfigFile()

void FitManager::readConfigFile ( )

Read the configuration file using the Configuration class.

Will terminate the program and issue an error message if the configuration file cannot be read.

◆ readTemplateFile()

void FitManager::readTemplateFile ( )

Read the template file using the Configuration class.

Will terminate the program and issue an error message if the configuration file cannot be read.

◆ setMethod()

void FitManager::setMethod ( fitMethod  m)
inline

Set the fitting method.

Parameters
mfitMethod enum type.

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