All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
hit::ICARUSlongHitFitCache Class Reference

Customized function cache for ICARUS long hit shape. More...

Inheritance diagram for hit::ICARUSlongHitFitCache:
hit::GausFitCache

Public Member Functions

 ICARUSlongHitFitCache (std::string const &new_name="ICARUSlongHitFitCache")
 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...
 

Static Public Member Functions

static Double_t fitlong (Double_t const *x, Double_t const *par)
 ICARUS hit shape. More...
 

Protected Member Functions

virtual TF1 * CreateFunction (size_t nFunc) const
 Creates and returns the function with specified number of peaks. More...
 

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 ICARUS long hit shape.

Definition at line 95 of file ICARUSHitFinder_module.cc.

Constructor & Destructor Documentation

hit::ICARUSlongHitFitCache::ICARUSlongHitFitCache ( std::string const &  new_name = "ICARUSlongHitFitCache")
inline

Constructor (see base class constructor).

Definition at line 99 of file ICARUSHitFinder_module.cc.

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

Member Function Documentation

virtual TF1* hit::ICARUSlongHitFitCache::CreateFunction ( size_t  nFunc) const
inlineprotectedvirtual

Creates and returns the function with specified number of peaks.

Reimplemented from hit::GausFitCache.

Definition at line 109 of file ICARUSHitFinder_module.cc.

110  {
111  unsigned int const nPeaks = nFunc;
112  std::string const func_name = FunctionName(nFunc);
113  auto* pF = new TF1(func_name.c_str(), fitlong, 0.0, 1.0, 1 + nFunc * 7);
114  pF->SetParName(0, "NPeaks");
115  pF->FixParameter(0, (double) nPeaks);
116  return pF;
117  } // CreateFunction()
static Double_t fitlong(Double_t const *x, Double_t const *par)
ICARUS hit shape.
virtual std::string FunctionName(size_t nFunc) const
Returns a name for the function with nFunc base functions.
Double_t hit::ICARUSlongHitFitCache::fitlong ( Double_t const *  x,
Double_t const *  par 
)
static

ICARUS hit shape.

Definition at line 1372 of file ICARUSHitFinder_module.cc.

1373  {
1374  auto const nPeaks = static_cast<std::size_t>(par[0]);
1375  Double_t fitval = 0.0;
1376  for(std::size_t jp = 0; jp < nPeaks; ++jp) {
1377  Double_t const* parj = par + (7 * jp);
1378  int const smax = std::floor(parj[6]);
1379  if (smax == 0) continue;
1380  double const neg_dxj = -(x[0] - parj[3]);
1381  fitval += (smax + parj[7] * (smax*(smax-1)/2))
1382  * (
1383  parj[1]+parj[2]*std::exp(neg_dxj/parj[4])
1384  / (1.0 + std::exp(neg_dxj/parj[5]))
1385  ) / (parj[6]);
1386  } // for
1387  return fitval;
1388  }
process_name opflash particleana ie x

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