LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
A set of TF1 linear sum of truncated Gaussians. More...
#include "GausFitCache.h"
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 | |
CompiledTruncatedGausFitCache (std::string new_name="CompiledTruncatedGausFitCache") | |
Constructor: initializes all the functions. More... | |
virtual unsigned int | MaxGaussians () const |
Returns the maximum number of Gaussians in a function that we support. More... | |
constexpr unsigned int | StoredMaxGaussians () const |
Returns the maximum number of Gaussians in a function that we support. More... | |
virtual TF1 * | GetClone (size_t nGaus) |
Throws an exception (ROOT does not support cloning compiled functions) 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 | |
virtual TF1 * | CreateFunction (size_t nGaus) const |
Throws an error, since this class can't create functions run-time. More... | |
template<unsigned int NGaus> | |
void | InitializeCompiledGausFitVector () |
Returns a vector initialized with multigaussians. More... | |
template<> | |
void | InitializeCompiledGausFitVector () |
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... | |
Protected Attributes | |
std::string | name |
name of the cache More... | |
std::vector< TF1 * > | funcs |
Private Types | |
template<unsigned int NGaus> | |
using | CutOffNGaussianClass = NGaussTruncClass< NGaus, CutOff > |
A set of TF1 linear sum of truncated Gaussians.
MaxGaus | the maximum number of Gaussians in the stored functions |
CutOff | number of sigmas beyond which the function evaluates as 0 |
This class stores a predefined number MaxGaus of TF1 from pre-compiled functions. Each function is the linear sum of truncated Gaussians, at most MaxGaus of them,
Definition at line 314 of file GausFitCache.h.
|
private |
Definition at line 318 of file GausFitCache.h.
|
inherited |
Class around sum of NGaus Gaussian functions truncated at CutOff sigmas.
Definition at line 221 of file GausFitCache.h.
|
inline |
Constructor: initializes all the functions.
Definition at line 324 of file GausFitCache.h.
References trkf::fill().
|
protectedinherited |
Adds one function.
Definition at line 400 of file GausFitCache.h.
References hit::GausFitCache::funcs, and hit::GausFitCache::FunctionName().
|
protectedinherited |
Throws an error asserting compiled functions can't be cretead run-time.
Definition at line 102 of file GausFitCache.cxx.
References art::errors::LogicError.
|
inlineprotectedvirtual |
Throws an error, since this class can't create functions run-time.
Reimplemented from hit::GausFitCache.
Definition at line 339 of file GausFitCache.h.
|
virtualinherited |
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 hit::GausFitCache::GetName().
|
staticinherited |
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().
|
staticinherited |
|
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().
|
virtualinherited |
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.
|
protectedinherited |
Returns a vector initialized with multigaussians.
Definition at line 387 of file GausFitCache.h.
|
inlineprotectedinherited |
Definition at line 395 of file GausFitCache.h.
|
inlinevirtual |
Returns the maximum number of Gaussians in a function that we support.
Reimplemented from hit::details::CompiledGausFitCacheBaseStruct.
Definition at line 331 of file GausFitCache.h.
|
inlinestaticinherited |
Definition at line 210 of file GausFitCache.h.
References x.
|
inlineinherited |
|
inlinestaticinherited |
Sum of NGaus Gaussian functions truncated at CutOff sigmas.
Definition at line 216 of file GausFitCache.h.
|
inline |
Returns the maximum number of Gaussians in a function that we support.
Definition at line 334 of file GausFitCache.h.
|
protectedinherited |
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().
|
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().