All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
reco_tool::BaselinedGausFitCache Class Reference
Inheritance diagram for reco_tool::BaselinedGausFitCache:
hit::GausFitCache

Public Member Functions

 BaselinedGausFitCache (std::string const &new_name="BaselinedGausFitCache")
 Constructor (see base class constructor). More...
 
- Public Member Functions inherited from hit::GausFitCache
 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
 

Additional Inherited Members

- Protected Attributes inherited from hit::GausFitCache
std::string name
 name of the cache More...
 
std::vector< TF1 * > funcs
 

Detailed Description

Customized function cache for Gaussians with a baseline.

The baseline parameter is always the last one.

Definition at line 28 of file PeakFitterGaussian_tool.cc.

Constructor & Destructor Documentation

reco_tool::BaselinedGausFitCache::BaselinedGausFitCache ( std::string const &  new_name = "BaselinedGausFitCache")
inline

Constructor (see base class constructor).

Definition at line 32 of file PeakFitterGaussian_tool.cc.

33  : hit::GausFitCache(new_name)
34  {}
A set of TF1 linear sum of base functions (Gaussians)
Definition: GausFitCache.h:46

Member Function Documentation

virtual TF1* reco_tool::BaselinedGausFitCache::CreateFunction ( size_t  nFunc) const
inlineprotectedvirtual

Creates and returns the function with specified number of Gaussians.

The formula is gaus(0) + gaus(3) + ... + gaus(3*(nFunc-1)) + [nFunc*3].

Reimplemented from hit::GausFitCache.

Definition at line 41 of file PeakFitterGaussian_tool.cc.

42  {
43  // add the Gaussians first
44  std::string formula;
45  std::size_t iGaus = 0;
46  while (iGaus < nFunc) formula += "gaus(" + std::to_string(3 * (iGaus++)) + ") + ";
47  formula += "[" + std::to_string(3 * nFunc) + "]";
48 
49  std::string const func_name = FunctionName(nFunc);
50  auto* pF = new TF1(func_name.c_str(), formula.c_str());
51  pF->SetParName(iGaus * 3, "baseline");
52  return pF;
53  } // CreateFunction()
std::string to_string(WindowPattern const &pattern)
virtual std::string FunctionName(size_t nFunc) const
Returns a name for the function with nFunc base functions.

The documentation for this class was generated from the following file: