BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/EmcRec/EmcRec/EmcRecParameter.h
Go to the documentation of this file.
1//
2// Parameters for Emc Reconstruction
3//
4// No Parameter is allowed to be hard coded into code!
5//
6// Created by Zhe Wang, May 31, 2004
7//
8#ifndef EMC_REC_PARAMETER_A_H
9#define EMC_REC_PARAMETER_A_H
10#include <pthread.h>
11#include <iostream>
12#include <vector>
13
14using namespace std;
15
16class TGraph2DErrors;
17
19{
20 private:
21 // Constructors and destructors
24
25 public:
26 //static member functions
28 static bool Exist();
29 static void Kill();
30 static void lock(){
31 if(pthread_mutex_lock(&m_pthread_lock) != 0){
32 std::cerr << "LOCK MUTEX_LOCK @ GZFSSTREAM" << std::endl;
33 }
34 };
35 static void unlock(){
36 if(pthread_mutex_unlock(&m_pthread_lock) != 0){
37 std::cerr << "UNLOCK MUTEX_LOCK @ GZFSSTREAM" << std::endl;
38 }
39 };
40
41
42
43 private:
44 //static data members
45 static EmcRecParameter* fpInstance;
46 static pthread_mutex_t m_pthread_lock;
47
48
49 public:
50 //access to each parameter
51 double ElectronicsNoiseLevel() const;
52 double EThresholdSeed() const;
53 double EThresholdCluster() const;
54 double LogPosOffset() const;
55
56 double TimeMin() const;
57 double TimeMax() const;
58 double MethodMode() const;
59 double PosCorr() const;
60 double DataMode() const;
61 int ElecSaturation() const;
62
63 double MoliereRadius() const;
64 double LateralProfile() const;
65
66 double ECorr(int n) const;
67 double SigE(int n) const;
68 double SigTheta(int n) const;
69 double SigPhi(int n) const;
70
71 double HitNb(int n) const;
72 double ElecBias(int n) const;
73 double SmCut(int n) const;
74
75 double Peak(int n) const;
76
77 double EastLogThetaPara(int n, int m) const;
78 double WestLogThetaPara(int n, int m) const;
79
80 double EastLogPhiPara(int n, int m) const;
81 double WestLogPhiPara(int n, int m) const;
82
83 double EastLogShMaxThetaPara(int n, int m) const;
84 double WestLogShMaxThetaPara(int n, int m) const;
85
86 double EastLogShMaxPhiPara(int n, int m) const;
87 double WestLogShMaxPhiPara(int n, int m) const;
88
89
90
91 double EastDataLogThetaPara(int n, int m) const;
92 double WestDataLogThetaPara(int n, int m) const;
93
94
95 double EastLinThetaPara(int n, int m) const;
96 double WestLinThetaPara(int n, int m) const;
97
98 double EastLinPhiPara(int n, int m) const;
99 double WestLinPhiPara(int n, int m) const;
100
101 double BarrPosDataCor(int ntheta, int nphi) const;
102 double WestPosDataCor(int ntheta, int nphi) const;
103 double EastPosDataCor(int ntheta, int nphi) const;
104
105 double BarrPosMCCor(int ntheta, int nphi) const;
106 double WestPosMCCor(int ntheta, int nphi) const;
107 double EastPosMCCor(int ntheta, int nphi) const;
108
109 double BarrLogThetaPara(int n, int m) const;
110 double BarrLogPhiPara(int n, int m) const;
111
112 double BarrLogShMaxThetaPara(int n, int m) const;
113 double BarrLogShMaxPhiPara(int n, int m) const;
114
115 double BarrLoglinThetaPara(int n, int m) const;
116 double BarrLoglinPhiPara(int n, int m) const;
117
118
119 double BarrLinThetaPara(int n, int m) const;
120 double BarrLinPhiPara(int n, int m) const;
121
122
123 double BarrShLinThetaPara(int n, int m) const;
124 double BarrShLinPhiPara(int n, int m) const;
125
126 double BarrDataLogThetaPara(int n, int m) const;
127
128 inline bool DigiCalib() const { return digiCalib; }
129 inline void SetDigiCalib(bool digi) { digiCalib=digi; }
130
131 inline void SetTimeMin(double min) { fTimeMin=min; }
132 inline void SetTimeMax(double max) { fTimeMax=max; }
133
134 inline void SetMethodMode(double en) { fMethodMode=en; }
135 inline void SetPosCorr(double en) { fPosCorr=en; }
136 inline void SetDataMode(double en) { fDataMode=en; }
137
138 inline void SetElecSaturation(int IO){ fElecSaturation=IO;}
139
140
141
142 inline void SetPeak(double e, int n) { peak[n]=e; }
143
144 inline void SetEastLogThetaPara(double p,int n,int m) { eastLogThetaPara[n][m]=p; }
145 inline void SetWestLogThetaPara(double p,int n,int m) { westLogThetaPara[n][m]=p; }
146
147 inline void SetEastLogPhiPara(double p,int n,int m) { eastLogPhiPara[n][m]=p; }
148 inline void SetWestLogPhiPara(double p,int n,int m) { westLogPhiPara[n][m]=p; }
149
150 inline void SetEastLogShMaxThetaPara(double p,int n,int m) { eastLogShMaxThetaPara[n][m]=p; }
151 inline void SetWestLogShMaxThetaPara(double p,int n,int m) { westLogShMaxThetaPara[n][m]=p; }
152
153 inline void SetEastLogShMaxPhiPara(double p,int n,int m) { eastLogShMaxPhiPara[n][m]=p; }
154 inline void SetWestLogShMaxPhiPara(double p,int n,int m) { westLogShMaxPhiPara[n][m]=p; }
155
156
157 inline void SetEastDataLogThetaPara(double p,int n,int m) { eastDataLogThetaPara[n][m]=p; }
158 inline void SetWestDataLogThetaPara(double p,int n,int m) { westDataLogThetaPara[n][m]=p; }
159
160
161 inline void SetEastLinThetaPara(double p,int n,int m) { eastLinThetaPara[n][m]=p; }
162 inline void SetWestLinThetaPara(double p,int n,int m) { westLinThetaPara[n][m]=p; }
163
164 inline void SetEastLinPhiPara(double p,int n,int m) { eastLinPhiPara[n][m]=p; }
165 inline void SetWestLinPhiPara(double p,int n,int m) { westLinPhiPara[n][m]=p; }
166
167
168 inline void SetBarrLogThetaPara(double p,int n,int m) {barrLogThetaPara[n][m]=p; }
169 inline void SetBarrLogPhiPara(double p,int n,int m) { barrLogPhiPara[n][m]=p; }
170
171 inline void SetBarrLoglinThetaPara(double p,int n,int m) {barrLoglinThetaPara[n][m]=p; }
172 inline void SetBarrLoglinPhiPara(double p,int n,int m) { barrLoglinPhiPara[n][m]=p; }
173
174 inline void SetBarrLinThetaPara(double p,int n,int m) { barrLinThetaPara[n][m]=p; }
175 inline void SetBarrLinPhiPara(double p,int n,int m) { barrLinPhiPara[n][m]=p; }
176
177 inline void SetBarrLogShMaxThetaPara(double p,int n,int m) { barrLogShMaxThetaPara[n][m]=p; }
178 inline void SetBarrLogShMaxPhiPara(double p,int n,int m) { barrLogShMaxPhiPara[n][m]=p; }
179
180 inline void SetBarrShLinThetaPara(double p,int n,int m) { barrShLinThetaPara[n][m]=p; }
181 inline void SetBarrShLinPhiPara(double p,int n,int m) { barrShLinPhiPara[n][m]=p; }
182
183 inline void SetBarrPosDataCor(double p, int nphi,int ntheta) {barrPosDataCorPara[ntheta][nphi]=p; }
184 inline void SetWestPosDataCor(double p, int nphi,int ntheta) {westPosDataCorPara[ntheta][nphi]=p; }
185 inline void SetEastPosDataCor(double p, int nphi,int ntheta) {eastPosDataCorPara[ntheta][nphi]=p; }
186
187 inline void SetBarrPosMCCor(double p, int nphi,int ntheta) {barrPosMCCorPara[ntheta][nphi]=p; }
188 inline void SetWestPosMCCor(double p, int nphi,int ntheta) {westPosMCCorPara[ntheta][nphi]=p; }
189 inline void SetEastPosMCCor(double p, int nphi,int ntheta) {eastPosMCCorPara[ntheta][nphi]=p; }
190
191 inline void SetBarrDataLogThetaPara(double p,int n,int m) {barrDataLogThetaPara[n][m]=p; }
192
193 inline std::string PositionMode1() const { return positionMode1; }
194 inline std::string PositionMode2() const { return positionMode2; }
195 void SetPositionMode(std::vector<std::string>& mode);
196
197 double ECorrMC(double eg, double theid) const;
198 double ErrMC(double eg, double theid) const;
199 double E25min(int n) const;
200 double E25max(int n) const;
201
202 double e25min[28];
203 double e25max[28];
204 private:
205 //each parameter
206 // ElectronicsNoiseLevel
207 double fElectronicsNoiseLevel;
208 // Energy threshold for seed search
209 double fEThresholdSeed;
210 // Energy threshold for cluster search
211 double fEThresholdCluster;
212 // LogPosOffset
213 double fLogPosOffset;
214
215 // Time window left
216 double fTimeMin;
217 // Time window right
218 double fTimeMax;
219 //Position correction method
220 double fMethodMode;
221
222 //MC reconstruction for electronics saturation
223 // 0: using Bhabha calibration constants
224 // 1: using Emaxdata from data
225 int fElecSaturation;
226
227 //Position correction or not
228 double fPosCorr;
229 double fDataMode;
230 // Moliere radius
231 double fMoliereRadius;
232 // Lateral profile
233 double fLateralProfile;
234
235 // Energy correction
236 double eCorr[4];
237 // Energy error
238 double sigE[3];
239 // Theta error
240 double sigTheta[2];
241 // Phi error
242 double sigPhi[2];
243
244 // Hit number
245 double hitNb[3];
246 // Correction of electronics bias
247 double elecBias[5];
248 // Cluster splitting cut with second moment
249 double smCut[4];
250
251 // Digi calibration
252 bool digiCalib;
253
254 // Shower energy correction VS theta
255 double peak[56];
256
257 double barrLogThetaPara[66][5];
258 double barrLogPhiPara[66][5];
259
260 double eastLogThetaPara[18][5];
261 double westLogThetaPara[18][5];
262
263 double eastLogPhiPara[3][5];
264 double westLogPhiPara[3][5];
265
266 double barrLogShMaxThetaPara[132][5];
267 double barrLogShMaxPhiPara[132][5];
268
269 double eastLogShMaxThetaPara[18][5];
270 double westLogShMaxThetaPara[18][5];
271
272 double eastLogShMaxPhiPara[3][5];
273 double westLogShMaxPhiPara[3][5];
274
275 double eastDataLogThetaPara[6][5];
276 double westDataLogThetaPara[6][5];
277
278
279 double eastLinThetaPara[6][5];
280 double westLinThetaPara[6][5];
281
282 double eastLinPhiPara[1][5];
283 double westLinPhiPara[1][5];
284
285 double barrLoglinThetaPara[22][5];
286 double barrLoglinPhiPara[1][5];
287
288 double barrLinThetaPara[66][5];
289 double barrLinPhiPara[3][5];
290
291 double barrShLinThetaPara[66][5];
292 double barrShLinPhiPara[3][5];
293
294 double barrDataLogThetaPara[22][5];
295
296 double barrPosDataCorPara[44][120];
297 double westPosDataCorPara[6][100];
298 double eastPosDataCorPara[6][100];
299
300 double barrPosMCCorPara[44][120];
301 double westPosMCCorPara[6][100];
302 double eastPosMCCorPara[6][100];
303
304 std::string positionMode1;
305 std::string positionMode2;
306
307 // Shower energy correction
308 TGraph2DErrors *dt;
309 // Energy error
310 TGraph2DErrors *dtErr;
311};
312
313#endif // EMC_REC_PARAMETER_A_H
314
const Int_t n
void SetWestPosDataCor(double p, int nphi, int ntheta)
double LogPosOffset() const
double WestLogShMaxPhiPara(int n, int m) const
void SetWestLogShMaxPhiPara(double p, int n, int m)
double ECorr(int n) const
double BarrLogShMaxPhiPara(int n, int m) const
double WestPosMCCor(int ntheta, int nphi) const
double SigE(int n) const
void SetBarrLoglinThetaPara(double p, int n, int m)
double BarrPosMCCor(int ntheta, int nphi) const
void SetPositionMode(std::vector< std::string > &mode)
double ECorrMC(double eg, double theid) const
static EmcRecParameter & GetInstance()
double EastDataLogThetaPara(int n, int m) const
double EastLogShMaxPhiPara(int n, int m) const
double EastPosMCCor(int ntheta, int nphi) const
double WestDataLogThetaPara(int n, int m) const
double EastLinThetaPara(int n, int m) const
double EastPosDataCor(int ntheta, int nphi) const
double EastLinPhiPara(int n, int m) const
double EThresholdCluster() const
void SetBarrPosMCCor(double p, int nphi, int ntheta)
double EThresholdSeed() const
double WestPosDataCor(int ntheta, int nphi) const
void SetBarrPosDataCor(double p, int nphi, int ntheta)
double BarrLogPhiPara(int n, int m) const
double BarrDataLogThetaPara(int n, int m) const
double HitNb(int n) const
double EastLogShMaxThetaPara(int n, int m) const
void SetBarrLogShMaxThetaPara(double p, int n, int m)
double ElectronicsNoiseLevel() const
double E25min(int n) const
double PosCorr() const
double BarrShLinPhiPara(int n, int m) const
void SetWestDataLogThetaPara(double p, int n, int m)
void SetEastDataLogThetaPara(double p, int n, int m)
double LateralProfile() const
double E25max(int n) const
double MethodMode() const
void SetWestLogShMaxThetaPara(double p, int n, int m)
double SigTheta(int n) const
void SetEastLogShMaxThetaPara(double p, int n, int m)
void SetEastPosMCCor(double p, int nphi, int ntheta)
void SetBarrLogShMaxPhiPara(double p, int n, int m)
double TimeMax() const
void SetEastPosDataCor(double p, int nphi, int ntheta)
double WestLogShMaxThetaPara(int n, int m) const
double WestLogThetaPara(int n, int m) const
void SetEastLogShMaxPhiPara(double p, int n, int m)
double ElecBias(int n) const
double BarrShLinThetaPara(int n, int m) const
void SetBarrDataLogThetaPara(double p, int n, int m)
int ElecSaturation() const
double BarrPosDataCor(int ntheta, int nphi) const
double BarrLogThetaPara(int n, int m) const
static void Kill()
double BarrLoglinThetaPara(int n, int m) const
double WestLinThetaPara(int n, int m) const
double MoliereRadius() const
double TimeMin() const
void SetBarrShLinThetaPara(double p, int n, int m)
static bool Exist()
double WestLogPhiPara(int n, int m) const
double BarrLinPhiPara(int n, int m) const
double BarrLinThetaPara(int n, int m) const
double EastLogPhiPara(int n, int m) const
double EastLogThetaPara(int n, int m) const
void SetWestPosMCCor(double p, int nphi, int ntheta)
double BarrLoglinPhiPara(int n, int m) const
double WestLinPhiPara(int n, int m) const
double DataMode() const
double SmCut(int n) const
double SigPhi(int n) const
double Peak(int n) const
double BarrLogShMaxThetaPara(int n, int m) const
double ErrMC(double eg, double theid) const