LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
A set of TF1 linear sum of base functions (Gaussians) More...
#include "GausFitCache.h"
Public Member Functions | |
GausFitCache (std::string new_name="GausFitCache") | |
Constructor; optionally set the name of the repository. More... | |
virtual | ~GausFitCache () |
Destructor. More... | |
std::string | GetName () const |
Return the name of this cache. More... | |
virtual TF1 * | Get (size_t nFunc) |
Returns a function sum of nFunc base functions. More... | |
virtual TF1 * | GetClone (size_t nGaus) |
virtual std::string | FunctionName (size_t nFunc) const |
Returns a name for the function with nFunc base functions. More... | |
Protected Member Functions | |
virtual TF1 * | CreateFunction (size_t nFunc) const |
Creates a new sum function. More... | |
Protected Attributes | |
std::string | name |
name of the cache More... | |
std::vector< TF1 * > | funcs |
A set of TF1 linear sum of base functions (Gaussians)
This object holds and owns a number of functions that are linear sum of "base" functions. The original use is for Gaussian functions, and this class implements Gaussians as base functions. This class is used as a base class for other function caches that do not necessarily use Gaussian base functions.
The idea is that if you need a temporary function to perform a fit and extract the parameters, you can reuse the same function over and over rather than creating a new one each time.
The expected use for an algorithm is to have one of these caches as a data member and when the algorithm code needs a function it obtains it with:
TF1* pFunc = fitcache.Get(nGaussians);
Then pFunc
is used for fitting but never destroyed.
Definition at line 50 of file GausFitCache.h.
|
inline |
Constructor; optionally set the name of the repository.
Definition at line 53 of file GausFitCache.h.
References ~GausFitCache().
|
virtual |
|
protectedvirtual |
Creates a new sum function.
Reimplemented in hit::CompiledTruncatedGausFitCache< MaxGaus, CutOff >, hit::CompiledGausFitCache< MaxGaus >, and reco_tool::BaselinedGausFitCache.
Definition at line 60 of file GausFitCache.cxx.
|
virtual |
Returns a name for the function with nFunc base functions.
Definition at line 78 of file GausFitCache.cxx.
Referenced by hit::details::CompiledGausFitCacheBaseStruct::AppendFunction(), reco_tool::BaselinedGausFitCache::CreateFunction(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< NFunc, Func >::fill(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< 0U, Func >::fill(), and GetName().
|
virtual |
Returns a function sum of nFunc base functions.
nGaus | the number of base functions in the function |
The returned function must not be deleted at any time!
This implementation returns a function sum of nFunc Gaussians. The parameters are sorted by Gaussian: first normalization (not the area, but the coefficient), first mean, first sigma, second normalization etc.
Definition at line 41 of file GausFitCache.cxx.
Referenced by GetName().
|
virtual |
Returns a new function sum of nFunc base functions (caller needs to set limits and parameters)
Reimplemented in hit::details::CompiledGausFitCacheBaseStruct.
Definition at line 55 of file GausFitCache.cxx.
References Get.
Referenced by GetName().
|
inline |
Return the name of this cache.
Definition at line 59 of file GausFitCache.h.
References FunctionName(), Get(), GetClone(), and name.
|
protected |
Definition at line 86 of file GausFitCache.h.
Referenced by hit::details::CompiledGausFitCacheBaseStruct::AppendFunction(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< NFunc, Func >::fill(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< 0U, Func >::fill(), and hit::details::CompiledGausFitCacheBaseStruct::MaxGaussians().
|
protected |
name of the cache
Gaussian sum functions; n-th element is sum of n base functions
Definition at line 83 of file GausFitCache.h.
Referenced by GetName().