All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
lar_content::RPhiFeatureTool::KernelEstimate Class Reference

Kernel estimate class. More...

Public Types

typedef std::multimap< float,
float > 
ContributionList
 Map from x coord to weight, ATTN avoid map.find, etc. with float key. More...
 

Public Member Functions

 KernelEstimate (const float sigma)
 Constructor. More...
 
float Sample (const float x) const
 Sample the parameterised distribution at a specified x coordinate. More...
 
const ContributionListGetContributionList () const
 Get the contribution list. More...
 
float GetSigma () const
 Get the assigned width. More...
 
void AddContribution (const float x, const float weight)
 Add a contribution to the distribution. More...
 

Private Attributes

ContributionList m_contributionList
 The contribution list. More...
 
const float m_sigma
 The assigned width. More...
 

Detailed Description

Kernel estimate class.

Definition at line 49 of file RPhiFeatureTool.h.

Member Typedef Documentation

Map from x coord to weight, ATTN avoid map.find, etc. with float key.

Definition at line 68 of file RPhiFeatureTool.h.

Constructor & Destructor Documentation

lar_content::RPhiFeatureTool::KernelEstimate::KernelEstimate ( const float  sigma)
inline

Constructor.

Parameters
sigmathe width associated with the kernel estimate

Definition at line 183 of file RPhiFeatureTool.h.

183  : m_sigma(sigma)
184 {
185  if (m_sigma < std::numeric_limits<float>::epsilon())
186  throw pandora::StatusCodeException(pandora::STATUS_CODE_INVALID_PARAMETER);
187 }
const float m_sigma
The assigned width.

Member Function Documentation

void lar_content::RPhiFeatureTool::KernelEstimate::AddContribution ( const float  x,
const float  weight 
)

Add a contribution to the distribution.

Parameters
xthe position
weightthe weight

Definition at line 236 of file RPhiFeatureTool.cc.

237 {
238  m_contributionList.insert(ContributionList::value_type(x, weight));
239 }
process_name opflash particleana ie x
ContributionList m_contributionList
The contribution list.
const RPhiFeatureTool::KernelEstimate::ContributionList & lar_content::RPhiFeatureTool::KernelEstimate::GetContributionList ( ) const
inline

Get the contribution list.

Returns
the contribution list

Definition at line 191 of file RPhiFeatureTool.h.

192 {
193  return m_contributionList;
194 }
ContributionList m_contributionList
The contribution list.
float lar_content::RPhiFeatureTool::KernelEstimate::GetSigma ( ) const
inline

Get the assigned width.

Returns
the assigned width

Definition at line 198 of file RPhiFeatureTool.h.

199 {
200  return m_sigma;
201 }
const float m_sigma
The assigned width.
float lar_content::RPhiFeatureTool::KernelEstimate::Sample ( const float  x) const

Sample the parameterised distribution at a specified x coordinate.

Parameters
xthe position at which to sample
Returns
the sample value

Definition at line 215 of file RPhiFeatureTool.cc.

216 {
217  const ContributionList &contributionList(this->GetContributionList());
218  ContributionList::const_iterator lowerIter(contributionList.lower_bound(x - 3.f * m_sigma));
219  ContributionList::const_iterator upperIter(contributionList.upper_bound(x + 3.f * m_sigma));
220 
221  float sample(0.f);
222  const float gaussConstant(1.f / std::sqrt(2.f * M_PI * m_sigma * m_sigma));
223 
224  for (ContributionList::const_iterator iter = lowerIter; iter != upperIter; ++iter)
225  {
226  const float deltaSigma((x - iter->first) / m_sigma);
227  const float gaussian(gaussConstant * std::exp(-0.5f * deltaSigma * deltaSigma));
228  sample += iter->second * gaussian;
229  }
230 
231  return sample;
232 }
process_name opflash particleana ie x
const ContributionList & GetContributionList() const
Get the contribution list.
std::multimap< float, float > ContributionList
Map from x coord to weight, ATTN avoid map.find, etc. with float key.
const float m_sigma
The assigned width.

Member Data Documentation

ContributionList lar_content::RPhiFeatureTool::KernelEstimate::m_contributionList
private

The contribution list.

Definition at line 93 of file RPhiFeatureTool.h.

const float lar_content::RPhiFeatureTool::KernelEstimate::m_sigma
private

The assigned width.

Definition at line 94 of file RPhiFeatureTool.h.


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