Berkeley Nuclear Data Software
TTOFAna.h
Go to the documentation of this file.
1 #ifndef _TTOF_ANA_
2 #define _TTOF_ANA_
3 //project
4 #include "PostProcBase.h"
5 #include "TTOFEvent.h"
6 #include "TTOFConfig.h"
7 #include "CutManager.h"
8 #include "CutBuilder.h"
9 #include <Eigen/Dense>
10 //root
11 #include "TH1.h"
12 #include "TH2.h"
13 //c++
14 #include <string>
15 #include <map>
16 #include <random>
25 class TTOFAna : public PostProcBase<TTOFEvent>
26 {
27 public:
31  TTOFAna();
34  TTOFAna(std::string a_configFile);
38  void buildThetaEstimationPlots(std::string a_outFile = "detThetatHist.root",
39  double a_startLight = 1.4,
40  double a_stopLight = 14,
41  double a_step = 0.8
42  );
45  void testTransform();
46  void addGraphicalPIDCuts(string a_cutFile);
47  vector<TH2F*> buildRotatedPIDPlot(int a_intP1,
48  int a_intP2,
49  int a_intP3,
50  int a_intP4,
51  double a_lightThreshold=2.0,
52  double a_maxLight=10.0,
53  double a_theta=-18.3);
54  double calcFOM(TH2F* a_histX1, TH2F* a_histX2);
55  void plotFOMVsEner(TH2F* a_hist);
56  void getPIDSlice(double a_eLow, double a_eHigh);
57  double fitPIDSlice(double a_ener,
58  double a_mean1=-.038,
59  double a_mean2=-.03,
60  double a_amp1=100,
61  double a_amp2=100,
62  double a_sig1=.001,
63  double a_sig2=.001);
64  void makeFOMVsLight();
65 
66  void procFileToCLYCTOTWFTree(std::string a_outFileName);
67 
68  std::vector<TH2F*> buildResponseFunction(double a_deltaT=4.);
69 
77  void testUnfoldingWithReg(TH2F* a_response,
78  TH1F* a_lightYield,
79  TH1F* a_guessFlux
80  );
81 
82  TH2F* m_pidVsLight;
84  std::map<double, vector<double>> m_fomFits;
85  std::map<double, Eigen::MatrixXf> m_fomFitCovs;
104  std::map<string, bool> m_cutState;
105 private:
108  TTOFConfig m_config;
110  CutManager m_cutManager;
113  bool passesCuts(TTOFEvent* a_event);
114  //these are used to functionalize the templated base class
115  void setTreeName();
116  void setBranchName();
117  //used to store histograms from various routines
118  std::map<std::string , TH1*> m_hists;
119  //used to control simulation smearing and histogram generation
120  //set up random generator
121  std::default_random_engine generator;
122 };
123 
124 
125 #endif
Definition: CutManager.h:21
Definition: PostProcBase.h:21
Definition: TTOFAna.h:26
void testTransform()
Definition: TTOFAna.cpp:114
void plotFOMVsEner(TH2F *a_hist)
Definition: TTOFAna.cpp:579
std::map< double, Eigen::MatrixXf > m_fomFitCovs
Definition: TTOFAna.h:85
std::vector< TH2F * > buildResponseFunction(double a_deltaT=4.)
Definition: TTOFAna.cpp:999
vector< TH2F * > buildRotatedPIDPlot(int a_intP1, int a_intP2, int a_intP3, int a_intP4, double a_lightThreshold=2.0, double a_maxLight=10.0, double a_theta=-18.3)
Definition: TTOFAna.cpp:173
void addGraphicalPIDCuts(string a_cutFile)
Definition: TTOFAna.cpp:168
std::map< double, vector< double > > m_fomFits
Definition: TTOFAna.h:84
void makeFOMVsLight()
Definition: TTOFAna.cpp:746
TTOFAna()
Definition: TTOFAna.cpp:16
std::map< string, bool > m_cutState
Definition: TTOFAna.h:104
void procFileToCLYCTOTWFTree(std::string a_outFileName)
Definition: TTOFAna.cpp:858
TH2F * m_pidVsLight
Definition: TTOFAna.h:82
TH1D * m_currLightSlice
Definition: TTOFAna.h:83
void testUnfoldingWithReg(TH2F *a_response, TH1F *a_lightYield, TH1F *a_guessFlux)
Definition: TTOFAna.cpp:1102
void getPIDSlice(double a_eLow, double a_eHigh)
Definition: TTOFAna.cpp:693
double fitPIDSlice(double a_ener, double a_mean1=-.038, double a_mean2=-.03, double a_amp1=100, double a_amp2=100, double a_sig1=.001, double a_sig2=.001)
Definition: TTOFAna.cpp:703
double calcFOM(TH2F *a_histX1, TH2F *a_histX2)
Definition: TTOFAna.cpp:519
void buildThetaEstimationPlots(std::string a_outFile="detThetatHist.root", double a_startLight=1.4, double a_stopLight=14, double a_step=0.8)
Definition: TTOFAna.cpp:46
Definition: TTOFConfig.h:17
Definition: TTOFEvent.h:14