/usr/include/root/Fit/BinPoint.h is in libroot-math-mathcore-dev 5.34.30-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | // @(#)root/mathcore:$Id$
// Author: L. Moneta Wed Aug 30 11:10:03 2006
/**********************************************************************
* *
* Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
* *
* *
**********************************************************************/
// Header file for class BinPoint
#ifndef ROOT_Fit_BinPoint
#define ROOT_Fit_BinPoint
namespace ROOT {
namespace Fit {
class DataRange;
/**
Obsolete class, no more in use.
class describing the point with bins ( x coordinates, y and error on y )
but not error in X . For the Error in x one should use onother class
*/
class BinPoint {
public:
//typedef std::vector<double> CoordData;
/**
Constructor
*/
explicit BinPoint (unsigned int n = 1) :
fDim(n),
fCoords(0 ),
fCoordErr( 0),
fValue(0),
fError(1),
fInvError(1)
{}
// /**
// constructor from a vector of coordinates, y value and y error
// */
// BinPoint (const std::vector<double> & x, double y, double ey = 1) :
// fCoords(x),
// fValue(y),
// fInvError( ey!= 0 ? 1.0/ey : 0 )
// { }
// template <class Iterator>
// BinPoint (const Iterator begin, const Iterator end, double y, double ey = 1) :
// fCoords(begin,end),
// fValue(y),
// fInvError( ey!= 0. ? 1.0/ey : 1. )
// { }
void Set(const double * x, double value, double invErr) {
fCoords = x;
fValue = value;
fInvError = invErr;
}
void Set(const double * x, double value, const double * ex, double err) {
fCoords = x;
fValue = value;
fCoordErr = ex;
fError = err;
}
/**
Destructor (no operations)
*/
~BinPoint () {}
// use default copy constructor and assignment
// accessors
/**
return pointer to coordinates
*/
//const double * Coords() const { return &fCoords.front(); }
/**
return vector of coordinates
*/
const double * Coords() const { return fCoords; }
/**
return the value (bin height in case of an histogram)
*/
double Value() const { return fValue; }
/**
return the error on the value
*/
double Error() const {
//return fInvError != 0 ? 1.0/fInvError : 0;
return fError;
}
/**
return the inverse of error on the value
*/
double InvError() const { return fInvError; }
/**
get the dimension (dimension of the cooordinates)
*/
unsigned int NDim() const { return fDim; }
/**
check if a Point is inside the given range
*/
bool IsInRange( const DataRange & range) const;
private:
unsigned int fDim;
//double fCoords[N];
const double * fCoords;
const double * fCoordErr;
double fValue;
// better to store the inverse of the error (is more efficient)
double fError;
double fInvError;
};
} // end namespace Fit
} // end namespace ROOT
// #ifndef ROOT_Fit_DataRange
// #include "Fit/DataRange.h"
// #endif
// #include <cassert>
// namespace ROOT {
// namespace Fit {
// template<unsigned int N>
// bool BinPoint<N>::IsInRange(const DataRange & range) const
// {
// // check if given point is inside the given range
// // need to check that datarange size is same as point size
// if (range.NDim() == 0) return true; // (range is empty is equivalent to (-inf, + inf)
// // in case not zero dimension must be equal to the coordinates
// assert( kSize == range.NDim() );
// for (unsigned int i = 0; i < kSize; ++i) {
// if ( ! range.IsInside( fCoords[i] ) ) return false;
// }
// return true;
// }
// } // end namespace Fit
// } // end namespace ROOT
#endif /* ROOT_Fit_BinPoint */
|