LArSoft
v09_90_00
Liquid Argon Software toolkit - https://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 *, 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 | |
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 136 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 206 of file GausFitCache.h.
|
protected |
Adds one function.
Definition at line 358 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 104 of file GausFitCache.cxx.
References art::errors::LogicError, and hit::GausFitCache::name.
|
protectedvirtualinherited |
Creates a new sum function.
Reimplemented in hit::CompiledTruncatedGausFitCache< MaxGaus, CutOff >, hit::CompiledGausFitCache< MaxGaus >, and reco_tool::BaselinedGausFitCache.
Definition at line 65 of file GausFitCache.cxx.
References hit::GausFitCache::FunctionName().
Referenced by hit::GausFitCache::Get().
|
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 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().
|
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 93 of file GausFitCache.cxx.
References 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 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().
|
virtual |
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.
|
protected |
Returns a vector initialized with multigaussians.
Definition at line 345 of file GausFitCache.h.
|
inlineprotected |
Definition at line 352 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 176 of file GausFitCache.h.
References hit::GausFitCache::funcs, and x.
|
inlinestatic |
Definition at line 192 of file GausFitCache.h.
References x.
|
inline |
Definition at line 374 of file GausFitCache.h.
|
inlinestatic |
Sum of NGaus Gaussian functions truncated at CutOff sigmas.
Definition at line 199 of file GausFitCache.h.
|
protectedinherited |
Definition at line 80 of file GausFitCache.h.
Referenced by AppendFunction(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< NFunc, Func >::fill(), hit::details::CompiledGausFitCacheBaseStruct::InitializeFuncSumVector< 0U, Func >::fill(), hit::GausFitCache::Get(), 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 CannotCreateFunction(), hit::GausFitCache::FunctionName(), and hit::GausFitCache::GetName().