LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "GausFitCache.h"
Classes | |
struct | InitializeFuncSumVector |
A helper class initializing the function vector. More... | |
struct | InitializeFuncSumVector< 0U, Func > |
Public Types | |
template<unsigned int NGaus, unsigned int CutOff> | |
using | NGaussTruncClass = FuncSum< NGaus, gaus_trunc< CutOff >, 3U > |
Class around sum of NGaus Gaussian functions truncated at CutOff sigmas. More... | |
Public Member Functions | |
virtual TF1 * | GetClone (size_t nGaus) |
Throws an exception (ROOT does not support cloning compiled functions) More... | |
virtual unsigned int | MaxGaussians () const |
Returns the maximum number of Gaussians in a function that we support. More... | |
template<> | |
Double_t | ngaus (Double_t const *x, Double_t const *params) |
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 std::string | FunctionName (size_t nFunc) const |
Returns a name for the function with nFunc base functions. More... | |
Static Public Member Functions | |
static Double_t | gaus (Double_t const *x, Double_t const *params) |
Single Gaussian function. More... | |
template<unsigned int CutOff> | |
static Double_t | gaus_trunc (Double_t const *x, Double_t const *params) |
template<unsigned int NGaus> | |
static Double_t | ngaus (Double_t const *x, Double_t const *params) |
template<unsigned int NGaus, unsigned int CutOff> | |
static Double_t | ngaus_trunc (Double_t const *x, Double_t const *params) |
Sum of NGaus Gaussian functions truncated at CutOff sigmas. More... | |
Protected Member Functions | |
template<unsigned int NGaus> | |
void | InitializeCompiledGausFitVector () |
Returns a vector initialized with multigaussians. More... | |
template<unsigned int NGaus> | |
void | AppendFunction () |
Adds one function. More... | |
void | CannotCreateFunction (size_t nGaus) const |
Throws an error asserting compiled functions can't be cretead run-time. More... | |
template<> | |
void | InitializeCompiledGausFitVector () |
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 |
Definition at line 152 of file GausFitCache.h.
using hit::details::CompiledGausFitCacheBaseStruct::NGaussTruncClass = FuncSum<NGaus, gaus_trunc<CutOff>, 3U> |
Class around sum of NGaus Gaussian functions truncated at CutOff sigmas.
Definition at line 221 of file GausFitCache.h.
|
protected |
Adds one function.
Definition at line 400 of file GausFitCache.h.
References hit::GausFitCache::funcs, and hit::GausFitCache::FunctionName().
|
protected |
Throws an error asserting compiled functions can't be cretead run-time.
Definition at line 102 of file GausFitCache.cxx.
References art::errors::LogicError.
|
protectedvirtualinherited |
Creates a new sum function.
Reimplemented in hit::CompiledTruncatedGausFitCache< MaxGaus, CutOff >, and hit::CompiledGausFitCache< MaxGaus >.
Definition at line 60 of file GausFitCache.cxx.
|
virtualinherited |
Returns a name for the function with nFunc base functions.
Definition at line 78 of file GausFitCache.cxx.
Referenced by AppendFunction(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< NFunc, Func >::fill(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< 0U, Func >::fill(), and hit::GausFitCache::GetName().
|
static |
Single Gaussian function.
x | vector; [0] variable value |
params | vector: [0] coefficient of the exponent [1] mean [2] sigma |
This function is equivalent to ROOT's "gaus".
Definition at line 89 of file GausFitCache.cxx.
References geo::sqr().
|
static |
|
virtualinherited |
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 hit::GausFitCache::GetName().
|
virtual |
Throws an exception (ROOT does not support cloning compiled functions)
Reimplemented from hit::GausFitCache.
Definition at line 95 of file GausFitCache.cxx.
References art::errors::LogicError.
|
inlineinherited |
Return the name of this cache.
Definition at line 59 of file GausFitCache.h.
References hit::GausFitCache::FunctionName(), hit::GausFitCache::Get(), hit::GausFitCache::GetClone(), and hit::GausFitCache::name.
|
protected |
Returns a vector initialized with multigaussians.
Definition at line 387 of file GausFitCache.h.
|
inlineprotected |
Definition at line 395 of file GausFitCache.h.
|
inlinevirtual |
Returns the maximum number of Gaussians in a function that we support.
Reimplemented in hit::CompiledTruncatedGausFitCache< MaxGaus, CutOff >, and hit::CompiledGausFitCache< MaxGaus >.
Definition at line 192 of file GausFitCache.h.
References hit::GausFitCache::funcs, and x.
|
inlinestatic |
Definition at line 210 of file GausFitCache.h.
References x.
|
inline |
|
inlinestatic |
Sum of NGaus Gaussian functions truncated at CutOff sigmas.
Definition at line 216 of file GausFitCache.h.
|
protectedinherited |
|
protectedinherited |
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 hit::GausFitCache::GetName().