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 26 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 30 of file PeakFitterGaussian_tool.cc.

31  : hit::GausFitCache(new_name)
32  {}
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 39 of file PeakFitterGaussian_tool.cc.

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

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