Berkeley Nuclear Data Software
SingleTOFAnalysis.h
Go to the documentation of this file.
1 #ifndef _SINGLE_TOF_ANALYSIS_H_
2 #define _SINGLE_TOF_ANALYSIS_H_
3 
4 
5 #include "TTree.h"
6 #include "TH1.h"
7 #include "TH2.h"
8 #include "TH3.h"
9 #include "TGraph.h"
10 #include "TMultiGraph.h"
11 
12 #include <string>
13 #include <vector>
22 {
23 public:
27 
28 
31  SingleTOFAnalysis(double a_flightPath,
32  double a_timeCalib = 0
33  );
34 
37  int loadExpDataTrees(std::string a_fileName,int a_ch);
38 
39 
42  int addResponseTree(std::string a_filename);
43 
45  TH1* generatePSDPlot();
46 
47 
49  std::vector<TH1*> generateCalibrationAndPSDCutPlots(std::string a_psdBoundFileName);
52 
55  int loadPSDBounds(std::string a_psdBoundFileName);
56 
60  TH1* correctGammaPeak(TH1* a_gammaTimeHistory,
61  double a_startTime,
62  double a_stopTime
63  );
64  TH3* createResponseMatrix(TH1* a_gammaTimeHistory
65  );
67  TMultiGraph* getPSDBoundPlot();
68 
69 
70  TH2F* producePH_V_TOF(TH1* a_spectrum,
71  TH3* a_responseMatrix
72  );
73 
74  //getters and setters
75  int setTimeBinWidth(double a_timeBinWidth);
76  int setTofMin(double a_tofMin);
77  int setTofMax(double a_tofMax);
78  int setPhRes(double a_phRes);
79  int setPhMin(double a_phMin);
80  int setPhMax(double a_phMax);
81  //getters
82  double getTimeBinWidth();
83  double getTofMin();
84  double getTofMax();
85  double getPhRes();
86  double getPhMin();
87  double getPhMax();
88 
89 
90 private:
91 
92  //required for calculations
94  double m_flightPath;
96  double m_gammaFlightTime;
98  double m_timeCalib;
99  double m_tdcConversion;
100  //histogram deffinitions
101  double m_timeBinWidth;
102  double m_tofMin;
103  double m_tofMax;
104  double m_phRes;
105  double m_phMin;
106  double m_phMax;
107 
109  /*
110  tmpTreePtr->Branch("amp",&curEn);
111  tmpTreePtr->Branch("shape",&curShape);
112  tmpTreePtr->Branch("pileUpCliping",&piledOrClipped);
113  tmpTreePtr->Branch("hitTime",&deltaTs);
114  */
115  TTree* m_dataTree;
116  //variable for tree association
117  int m_amp;
118  float m_shape;
119  bool m_pileUpCliping;
120  std::vector<int>* m_hitTime;
121  //is the data tree present
122  bool m_hasExpData;
123  bool dataLoaded();
125  TTree* m_respTree;
126  //variables for tree association
127  double m_ph;
128  double m_en;
129  double m_tof;
130  //is the data tree present
131  bool m_hasSimData;
132  bool simLoaded();
134  TH1* m_neutronFluxHistory;
135 
137  std::vector<TGraph*> m_psdBoundGraphs;
144  int getPSDMetric(double a_amp,double a_shape);
145 
146 
147  TH1* m_psdPlot;
148 
149 
150 };
151 
152 #endif
Definition: SingleTOFAnalysis.h:22
std::vector< TH1 * > generateCalibrationAndPSDCutPlots(std::string a_psdBoundFileName)
this function reads a series of xy pairs for boundary lines
Definition: SingleTOFAnalysis.cpp:161
int setTofMax(double a_tofMax)
Definition: SingleTOFAnalysis.cpp:421
TH1 * correctGammaPeak(TH1 *a_gammaTimeHistory, double a_startTime, double a_stopTime)
Definition: SingleTOFAnalysis.cpp:268
SingleTOFAnalysis()
Definition: SingleTOFAnalysis.cpp:16
int loadPSDBounds(std::string a_psdBoundFileName)
Definition: SingleTOFAnalysis.cpp:221
int setPhMin(double a_phMin)
Definition: SingleTOFAnalysis.cpp:431
double getTimeBinWidth()
Definition: SingleTOFAnalysis.cpp:442
int setPhMax(double a_phMax)
Definition: SingleTOFAnalysis.cpp:436
int addResponseTree(std::string a_filename)
Definition: SingleTOFAnalysis.cpp:100
TMultiGraph * getPSDBoundPlot()
this function returns a multigraph with the psd bounds
Definition: SingleTOFAnalysis.cpp:326
int setPhRes(double a_phRes)
Definition: SingleTOFAnalysis.cpp:426
int setTofMin(double a_tofMin)
Definition: SingleTOFAnalysis.cpp:416
double getPhMin()
Definition: SingleTOFAnalysis.cpp:458
double getPhRes()
Definition: SingleTOFAnalysis.cpp:454
TH3 * createResponseMatrix(TH1 *a_gammaTimeHistory)
Definition: SingleTOFAnalysis.cpp:300
TH1 * generatePSDPlot()
this function constructs histograms for obtaining psd cuts
Definition: SingleTOFAnalysis.cpp:136
double getPhMax()
Definition: SingleTOFAnalysis.cpp:462
double getTofMin()
Definition: SingleTOFAnalysis.cpp:446
int setTimeBinWidth(double a_timeBinWidth)
Definition: SingleTOFAnalysis.cpp:411
double getTofMax()
Definition: SingleTOFAnalysis.cpp:450
TH2F * producePH_V_TOF(TH1 *a_spectrum, TH3 *a_responseMatrix)
Definition: SingleTOFAnalysis.cpp:380
int loadExpDataTrees(std::string a_fileName, int a_ch)
Definition: SingleTOFAnalysis.cpp:55