forked from gsmith23/Simlab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTLab.h
executable file
·214 lines (141 loc) · 3.94 KB
/
TLab.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#ifndef TLab_h
#define TLab_h
#include "./includes.h"
//------------------------------------------------------------------------------------------------
class TLab : public TObject{
public :
TLab( );
TLab( TString);
TLab( TString, TString);
TLab( TString, TString, TString);
~TLab();
//======================
//======================
//== Member Functions ==
//======================
//======================
void SetFilenames(TString);
Bool_t RawTextFileExists();
Bool_t RawROOTFileExists();
Bool_t CalibratedROOTFileExists();
void MakeRawDataTreeFile();
void MakeCalibratedDataTreeFile();
void SetPedestals();
Float_t GetPedestal(Int_t);
Int_t DefaultPedestalRun();
void FillQSumHistos();
void SetPhotopeaks();
void InitPhotopeaks();
Int_t GetMinQ(Int_t);
Int_t GetMaxQ(Int_t);
void FitPhotopeaks();
Float_t GetPhotopeak(Int_t);
Int_t DefaultPhotopeakRun(Int_t);
Bool_t QIsInComptonRange(Float_t, Int_t);
Bool_t GoodTiming(Float_t);
Bool_t GoodTheta(Float_t);
Float_t ElectronEnergyToTheta(Float_t);
Float_t PhotonEnergyToTheta(Float_t);
Float_t ThetaToThetaError(Float_t, Int_t);
Float_t ThetaToPhotonEnergy(Float_t);
Float_t ThetaToElectronEnergy(Float_t);
Int_t Chan2ArrayA(Int_t channel);
Int_t Chan2ArrayB(Int_t channel);
void CalculateAsymmetry();
void GetThetaBinValues();
void GraphAsymmetry(Char_t);
void SetStyle();
Float_t RandomLabPhi();
Bool_t RandomGoodLabPhi(Float_t, Int_t);
void SetEventNumbers(Int_t);
//======================
//======================
//==== Data Members ====
//======================
//======================
// OR, AND, OR
const static Int_t nRuns = 3;
Bool_t oneRun = kFALSE;
// crystals per array
static const Int_t nCrystals = 9;
// only five per array are recorded
//static const Int_t nChannels = 18;
static const Int_t nChannels = 10;
// For Graphing
static const Int_t nPhiBins = 4;
//static const Int_t nThBins = 7;
static const Int_t nThBins = 8;
// 39, 54, 69, 84, 99, 114, 129
/* Float_t thetaLowEdge = 31.5; */
/* Float_t thetaHighEdge = 136.5; */
Float_t thetaLowEdge = 10.0;
Float_t thetaHighEdge = 170.;
Long64_t nOR1;
Long64_t nAND;
Long64_t nOR2;
Long64_t eventSum;
Float_t ThMin[nThBins];
Float_t ThMax[nThBins];
Float_t plotTheta[nThBins];
Float_t AsymMatrix[nThBins][nPhiBins];
//Float_t comp
Int_t runNumberInt;
TString simRun;
TString simRunU;
ifstream *inData;
TFile *rootFileRawData;
TTree *rawDataTree;
TFile *rootFileCalData;
TTree *calDataTree;
TString textFileName;
TString rootFileRawName;
TString rootFileCalName;
TCanvas *canvas1;
TCanvas *canvas2;
// Raw data
//TH1F *hQ[nChannels][nRuns];
// pre-run OR data
TH1F *hQ_0[nChannels];
// main run
TH1F *hQ_1[nChannels];
// main run outer summed with inner
TH1F *hQQ_1[nChannels];
// post-run OR data
TH1F *hQ_2[nChannels];
TH1F *hT[nChannels];
Long64_t eventNumber;
Float_t Q[nChannels];
Float_t T[nChannels];
// Fit Results
Float_t pedQ[nChannels][nRuns];
Float_t phoQ[nChannels][nRuns];
Float_t HWHM[nChannels][nRuns];
// Cal data
TH1F *hEA[nCrystals];
TH1F *hEB[nCrystals];
Float_t QA[nCrystals];
Float_t QB[nCrystals];
Float_t EA[nCrystals];
Float_t EB[nCrystals];
Float_t TA[nCrystals];
Float_t TB[nCrystals];
Float_t tHA[nCrystals];
Float_t tHB[nCrystals];
Float_t tHAErr[nCrystals];
Float_t tHBErr[nCrystals];
Float_t Asym;
Float_t AsymErr;
Float_t AsymPhi[nPhiBins];
Float_t AsymPhiErr[nPhiBins];
Double_t R000;
Double_t R090;
Float_t AR;
Float_t BR;
Char_t type;
TSim *simData;
Int_t npeaks;
TH1F *hr;
/* ClassDef(TLab,1); */
};
#endif
// ------------------------------------------------------------------------------------------------