![]() |
LArSoft
v10_06_00
Liquid Argon Software toolkit - https://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 *, Double_t const *) |
| 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 291 of file GausFitCache.h.
|
private |
Definition at line 293 of file GausFitCache.h.
|
inherited |
Class around sum of NGaus Gaussian functions truncated at CutOff sigmas.
Definition at line 206 of file GausFitCache.h.
|
inline |
Constructor: initializes all the functions.
Definition at line 297 of file GausFitCache.h.
References trkf::fill().
|
protectedinherited |
Adds one function.
Definition at line 358 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 104 of file GausFitCache.cxx.
References art::errors::LogicError, and hit::GausFitCache::name.
|
inlineprotectedvirtual |
Throws an error, since this class can't create functions run-time.
Reimplemented from hit::GausFitCache.
Definition at line 310 of file GausFitCache.h.
|
virtualinherited |
Returns a name for the function with nFunc base functions.
Definition at line 83 of file GausFitCache.cxx.
References hit::GausFitCache::name.
Referenced by hit::details::CompiledGausFitCacheBaseStruct::AppendFunction(), reco_tool::BaselinedGausFitCache::CreateFunction(), hit::GausFitCache::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 93 of file GausFitCache.cxx.
References 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 44 of file GausFitCache.cxx.
References hit::GausFitCache::CreateFunction(), and hit::GausFitCache::funcs.
Referenced by reco_tool::PeakFitterGaussian::findPeakParameters(), hit::GausFitCache::GetClone(), and hit::GausFitCache::GetName().
|
virtualinherited |
Throws an exception (ROOT does not support cloning compiled functions)
Reimplemented from hit::GausFitCache.
Definition at line 98 of file GausFitCache.cxx.
References art::errors::LogicError.
|
inlineinherited |
Return the name of this cache.
Definition at line 54 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 345 of file GausFitCache.h.
|
inlineprotectedinherited |
Definition at line 352 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 303 of file GausFitCache.h.
|
inlinestaticinherited |
Definition at line 192 of file GausFitCache.h.
References x.
|
inlineinherited |
Definition at line 374 of file GausFitCache.h.
|
inlinestaticinherited |
Sum of NGaus Gaussian functions truncated at CutOff sigmas.
Definition at line 199 of file GausFitCache.h.
|
inline |
Returns the maximum number of Gaussians in a function that we support.
Definition at line 306 of file GausFitCache.h.
|
protectedinherited |
Definition at line 80 of file GausFitCache.h.
Referenced by hit::details::CompiledGausFitCacheBaseStruct::AppendFunction(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< NFunc, Func >::fill(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< 0U, Func >::fill(), hit::GausFitCache::Get(), hit::details::CompiledGausFitCacheBaseStruct::MaxGaussians(), and hit::GausFitCache::~GausFitCache().
|
protectedinherited |
name of the cache
Gaussian sum functions; n-th element is sum of n base functions
Definition at line 77 of file GausFitCache.h.
Referenced by hit::details::CompiledGausFitCacheBaseStruct::CannotCreateFunction(), hit::GausFitCache::FunctionName(), and hit::GausFitCache::GetName().