Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TDataPoint.h
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Authors: C. Gumpert 09/2011
3/**********************************************************************
4 * *
5 * Copyright (c) 2011 , LCG ROOT MathLib Team *
6 * *
7 * *
8 **********************************************************************/
9//
10// Header file for TDataPointclass
11//
12
13#ifndef ROOT_Math_TDataPoint
14#define ROOT_Math_TDataPoint
15
16//ROOT include(s)
17#include "RtypesCore.h"
18
19
20namespace ROOT
21{
22namespace Math
23{
24
25
26template<unsigned int K,typename _val_type = float>
28{
29public:
30 typedef _val_type value_type;
31 enum {
32 kDimension = K //the dimensionality of this data point
33 };
34 static UInt_t Dimension() {return kDimension;}
35 TDataPoint();
36#ifndef __MAKECINT__
37 template<typename _coord_typ>
38 TDataPoint(const _coord_typ* pData,_val_type fWeight = 1);
39#endif
40 //virtual ~TDataPoint() {}
41#ifndef __MAKECINT__
42 template<typename _val>
44#endif
45 value_type GetCoordinate(unsigned int iAxis) const;
46 value_type GetWeight() const {return m_fWeight;}
47 Bool_t Less(TDataPoint& rPoint,unsigned int iAxis) const;
48 void SetCoordinate(unsigned int iAxis,_val_type fValue);
49 void SetWeight(float fWeight) {m_fWeight = fWeight;}
50
51private:
52 value_type m_vCoordinates[K]; ///< coordinates
53 value_type m_fWeight; ///< weight at this point
54};
55
56// some typedef definitions
63
64}//namespace Math
65}//namespace ROOT
66
67#include "Math/TDataPoint.icc"
68
69
70#endif // ROOT_Math_TDataPoint
bool Bool_t
Definition RtypesCore.h:63
Bool_t Less(TDataPoint &rPoint, unsigned int iAxis) const
static UInt_t Dimension()
Definition TDataPoint.h:34
value_type Distance(const TDataPoint< K, _val > &rPoint) const
TDataPoint(const _coord_typ *pData, _val_type fWeight=1)
void SetCoordinate(unsigned int iAxis, _val_type fValue)
void SetWeight(float fWeight)
Definition TDataPoint.h:49
value_type m_vCoordinates[K]
coordinates
Definition TDataPoint.h:52
value_type GetCoordinate(unsigned int iAxis) const
value_type m_fWeight
weight at this point
Definition TDataPoint.h:53
value_type GetWeight() const
Definition TDataPoint.h:46
Namespace for new Math classes and functions.
TDataPoint< 3, Float_t > TDataPoint3F
Definition TDataPoint.h:59
TDataPoint< 1, Float_t > TDataPoint1F
Definition TDataPoint.h:57
TDataPoint< 2, Float_t > TDataPoint2F
Definition TDataPoint.h:58
TDataPoint< 1, Double_t > TDataPoint1D
Definition TDataPoint.h:60
TDataPoint< 3, Double_t > TDataPoint3D
Definition TDataPoint.h:62
TDataPoint< 2, Double_t > TDataPoint2D
Definition TDataPoint.h:61
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.