~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to src/common_cpp/Recon/Bayes/PDF.hh

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus
 
2
 *
 
3
 * MAUS is free software: you can redistribute it and/or modify
 
4
 * it under the terms of the GNU General Public License as published by
 
5
 * the Free Software Foundation, either version 3 of the License, or
 
6
 * (at your option) any later version.
 
7
 *
 
8
 * MAUS is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with MAUS.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 */
 
17
 
 
18
#ifndef PDF_HH
 
19
#define PDF_HH
 
20
 
 
21
// C headers
 
22
#include <assert.h>
 
23
 
 
24
// C++ headers
 
25
#include <vector>
 
26
#include <string>
 
27
#include "TH1D.h"
 
28
#include "TMath.h"
 
29
#include "TMatrixD.h"
 
30
 
 
31
namespace MAUS {
 
32
 
 
33
/** @class pdf
 
34
 *
 
35
 *  @brief A Probability Distribution Function.
 
36
 *
 
37
 */
 
38
class PDF {
 
39
 public:
 
40
  PDF();
 
41
 
 
42
  PDF(std::string name, double bins, double min, double max);
 
43
 
 
44
  ~PDF();
 
45
 
 
46
  PDF(const PDF &site);
 
47
 
 
48
  PDF& operator=(const PDF& pdf);
 
49
 
 
50
  void ComputeNewPosterior(TH1D likelihood);
 
51
 
 
52
  double GetMean()     const { return _probability->GetMean(); }
 
53
 
 
54
  double GetRMS()      const { return _probability->GetRMS();  }
 
55
 
 
56
  TH1D *probability()  const { return _probability; }
 
57
 
 
58
  std::string name()   const { return _name;        }
 
59
 
 
60
  int n_bins()         const { return _n_bins;      }
 
61
 
 
62
  double bin_width()   const { return _bin_width;   }
 
63
 
 
64
  double min()         const { return _min;         }
 
65
 
 
66
  double max()         const { return _max;         }
 
67
 
 
68
 private:
 
69
  TH1D *_probability;
 
70
 
 
71
  std::string _name;
 
72
 
 
73
  int _n_bins;
 
74
 
 
75
  double _bin_width;
 
76
 
 
77
  double _min;
 
78
 
 
79
  double _max;
 
80
};
 
81
 
 
82
} // ~namespace MAUS
 
83
 
 
84
#endif