Berkeley Nuclear Data Software
PSDCutFinder.h
Go to the documentation of this file.
1 #ifndef _PSD_CUT_FINDER_H_
2 #define _PSD_CUT_FINDER_H_
3 
4 
5 #include "TF1.h"
6 #include "TTree.h"
7 #include "TH1.h"
8 #include "TH2.h"
9 #include "TH3.h"
10 #include "TGraph.h"
11 #include "TCanvas.h"
12 
13 #include <string>
14 #include <vector>
15 
16 
18 {
19 
20  Double_t mu;
21  Double_t D;
22  Double_t sigma1;
23  Double_t sigma2;
24  Double_t area1;
25  Double_t area2;
26 
27 };
28 
29 
34 {
35 public:
38  PSDCutFinder(TFile* a_rootFile, std::string a_psdHistoName);
39 
40  PSDCutFinder(TH2F* a_psdHisto);
41 
42  ~PSDCutFinder();
43 
45  void setProjections(double a_xmin,
46  double a_xmax,
47  const std::vector<unsigned int> &a_bins);
48 
49  void setProjections(double a_xmin,
50  double a_xmax,
51  unsigned int a_start,
52  unsigned int a_stop,
53  unsigned int a_step=1);
54 
55  void drawPolyCut(std::string a_psdHistoName);
56 
57  void clear();
58 
60  std::vector< std::pair<Double_t, Double_t> >
61  findPeaks(unsigned int a_hindex);
62 
64  static Double_t totalFit(Double_t *x, Double_t *par);
65 
66  std::vector<Double_t>
67  doFit( unsigned int a_hindex, std::vector< std::pair<Double_t, Double_t> > a_peaks );
68 
70  const std::vector<unsigned int> &getBins() const;
71 
73  std::vector<TH1D*> m_projY;
74 
75 private:
77  FitParameters getCutParameters();
78 
79 private:
81  std::string m_psdHistoName;
82  TH2F* m_psdHisto;
83  std::vector<unsigned int> m_bins;
84 
85 
86  double m_xmin;
87  double m_xmax;
88  int m_npeaks;
89 };
90 
91 #endif
Definition: PSDCutFinder.h:34
PSDCutFinder(TFile *a_rootFile, std::string a_psdHistoName)
Definition: PSDCutFinder.cpp:18
std::vector< Double_t > doFit(unsigned int a_hindex, std::vector< std::pair< Double_t, Double_t > > a_peaks)
Definition: PSDCutFinder.cpp:305
void clear()
Definition: PSDCutFinder.cpp:216
static Double_t totalFit(Double_t *x, Double_t *par)
Total fit function: sum of 2gaussians.
Definition: PSDCutFinder.cpp:285
std::vector< TH1D * > m_projY
1D projection Y histogram
Definition: PSDCutFinder.h:73
~PSDCutFinder()
Definition: PSDCutFinder.cpp:362
void drawPolyCut(std::string a_psdHistoName)
Definition: PSDCutFinder.cpp:133
std::vector< std::pair< Double_t, Double_t > > findPeaks(unsigned int a_hindex)
Finds the peaks in the 1D histogram and stores it to pair.
Definition: PSDCutFinder.cpp:225
const std::vector< unsigned int > & getBins() const
Get bins: start, stop and step vector.
Definition: PSDCutFinder.cpp:73
void setProjections(double a_xmin, double a_xmax, const std::vector< unsigned int > &a_bins)
This function constructs histograms for obtaining psd cuts.
Definition: PSDCutFinder.cpp:43
Definition: PSDCutFinder.h:18
Double_t area2
Definition: PSDCutFinder.h:25
Double_t sigma2
Definition: PSDCutFinder.h:23
Double_t sigma1
Definition: PSDCutFinder.h:22
Double_t mu
Definition: PSDCutFinder.h:20
Double_t area1
Definition: PSDCutFinder.h:24
Double_t D
Definition: PSDCutFinder.h:21