Logo ROOT   6.08/07
Reference Guide
BinPoint.cxx
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: L. Moneta Wed Aug 30 11:10:03 2006
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7  * *
8  * *
9  **********************************************************************/
10 
11 // Implementation file for class BinPoint
12 
13 #include "Fit/BinPoint.h"
14 #include "Fit/DataRange.h"
15 
16 #include <cassert>
17 
18 namespace ROOT {
19 
20  namespace Fit {
21 
22 
23 bool BinPoint::IsInRange(const DataRange & range) const
24 {
25  // check if given point is inside the given range
26 
27  unsigned int ndim = NDim();
28  // need to check that datarange size is same as point size
29  if (range.NDim() == 0) return true; // (range is empty is equivalent to (-inf, + inf)
30  // in case not zero dimension must be equal to the coordinates
31  assert( ndim == range.NDim() );
32  for (unsigned int i = 0; i < ndim; ++i) {
33  if ( ! range.IsInside( fCoords[i] ) ) return false;
34  }
35  return true;
36 }
37 
38  } // end namespace Fit
39 
40 } // end namespace ROOT
41 
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
bool IsInside(double x, unsigned int icoord=0) const
check if a point is inside the range for the given coordinate
Definition: DataRange.cxx:146
class describing the range in the coordinates it supports multiple range in a coordinate.
Definition: DataRange.h:34
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
Definition: HFitImpl.cxx:134
const double * fCoords
Definition: BinPoint.h:135
unsigned int NDim() const
get range dimension
Definition: DataRange.h:64
unsigned int NDim() const
get the dimension (dimension of the cooordinates)
Definition: BinPoint.h:124
bool IsInRange(const DataRange &range) const
check if a Point is inside the given range
Definition: BinPoint.cxx:23