Logo ROOT   6.13/01
Reference Guide
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 "Rtypes.h"
18 
19 
20 namespace ROOT
21 {
22 namespace Math
23 {
24 
25 
26 template<unsigned int K,typename _val_type = float>
28 {
29 public:
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>
43  value_type Distance(const TDataPoint<K,_val>& rPoint) const;
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 
51 private:
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
TDataPoint< 2, Float_t > TDataPoint2F
Definition: TDataPoint.h:58
TDataPoint< 2, Double_t > TDataPoint2D
Definition: TDataPoint.h:61
constexpr Double_t K()
Boltzmann&#39;s constant in .
Definition: TMath.h:247
Bool_t Less(TDataPoint &rPoint, unsigned int iAxis) const
Definition: TDataPoint.icc:125
Namespace for new ROOT classes and functions.
Definition: TFoamSampler.h:19
TDataPoint< 1, Double_t > TDataPoint1D
Definition: TDataPoint.h:60
value_type GetWeight() const
Definition: TDataPoint.h:46
TDataPoint< 3, Double_t > TDataPoint3D
Definition: TDataPoint.h:62
TDataPoint< 1, Float_t > TDataPoint1F
Definition: TDataPoint.h:57
value_type m_fWeight
Definition: TDataPoint.h:53
value_type GetCoordinate(unsigned int iAxis) const
Definition: TDataPoint.icc:100
void SetCoordinate(unsigned int iAxis, _val_type fValue)
Definition: TDataPoint.icc:112
void SetWeight(float fWeight)
Definition: TDataPoint.h:49
Namespace for new Math classes and functions.
static UInt_t Dimension()
Definition: TDataPoint.h:34
value_type m_vCoordinates[K]
Definition: TDataPoint.h:52
value_type Distance(const TDataPoint< K, _val > &rPoint) const
TDataPoint< 3, Float_t > TDataPoint3F
Definition: TDataPoint.h:59