StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EvtPdfMax.hh
1 /*******************************************************************************
2  * Project: BaBar detector at the SLAC PEP-II B-factory
3  * Package: EvtGenBase
4  * File: $Id: EvtPdfMax.hh,v 1.1 2016/09/23 18:37:31 jwebb Exp $
5  * Author: Alexei Dvoretskii, dvoretsk@slac.stanford.edu, 2001-2002
6  *
7  * Copyright (C) 2002 Caltech
8  *******************************************************************************/
9 
10 // Pdf maximum and its location
11 
12 #ifndef EVT_PDF_MAX_HH
13 #define EVT_PDF_MAX_HH
14 
15 #include "EvtGenBase/EvtMacros.hh"
16 
17 // PDF maximum - helper class
18 
19 template <class Point>
20 class EvtPdfMax {
21 
22 public:
23 
24  EvtPdfMax()
25  : _value(-1),_valueKnown(false), _locKnown(false)
26  {}
27  EvtPdfMax(double value)
28  : _value(value),_valueKnown(true), _locKnown(false)
29  {}
30  EvtPdfMax(Point p, double value)
31  : _value(value), _valueKnown(true), _locKnown(true), _loc(p)
32  {}
33  EvtPdfMax(const EvtPdfMax& other)
34  : COPY_MEM(_value), COPY_MEM(_valueKnown), COPY_MEM(_locKnown), COPY_MEM(_loc)
35  {}
36  ~EvtPdfMax() {}
37 
38  bool valueKnown() const { return _valueKnown; }
39  double value() const { assert(_valueKnown); return _value; }
40  bool locKnown() const { return _locKnown; }
41  Point loc() const { assert(_locKnown); return _loc; }
42 
43 private:
44 
45  double _value;
46  bool _valueKnown;
47  bool _locKnown;
48  Point _loc;
49 
50 };
51 
52 #endif