npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
ScanExtremum1D.hh
Go to the documentation of this file.
1 #ifndef NPSTAT_SCANEXTREMUM1D_HH_
2 #define NPSTAT_SCANEXTREMUM1D_HH_
3 
4 /*!
5 // \file ScanExtremum1D.hh
6 //
7 // \brief Finding extrema of scanned 1-d curves
8 //
9 // Author: I. Volobouev
10 //
11 // June 2022
12 */
13 
14 namespace npstat {
16  {
17  public:
18  inline ScanExtremum1D(const double loc, const double val,
19  const bool isMin, const bool b)
20  : location_(loc), value_(val),
21  isMinimum_(isMin), onTheBoundary_(b) {}
22 
23  inline double location() const {return location_;}
24  inline double value() const {return value_;}
25  inline bool isMinimum() const {return isMinimum_;}
26  inline bool isOnTheBoundary() const {return onTheBoundary_;}
27 
28  private:
29  double location_;
30  double value_;
31  bool isMinimum_;
32  bool onTheBoundary_;
33  };
34 
35  //@{
36  /**
37  // The input arrays must have at least two elements.
38  // Coordinates must be monotonously increasing.
39  */
40  ScanExtremum1D findScanMinimum1D(const double* xcoords, unsigned long xLen,
41  const double* yvalues, unsigned long yLen);
42 
43  ScanExtremum1D findScanMaximum1D(const double* xcoords, unsigned long xLen,
44  const double* yvalues, unsigned long yLen);
45  //@}
46 }
47 
48 #endif // NPSTAT_SCANEXTREMUM1D_HH_
Definition: ScanExtremum1D.hh:16
Definition: AbsArrayProjector.hh:14
ScanExtremum1D findScanMinimum1D(const double *xcoords, unsigned long xLen, const double *yvalues, unsigned long yLen)