BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/EmcRec/EmcRec-01-02-57/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
84 double EastDataLogThetaPara(int n, int m) const;
85 double WestDataLogThetaPara(int n, int m) const;
86
87
88 double EastLinThetaPara(int n, int m) const;
89 double WestLinThetaPara(int n, int m) const;
90
91 double EastLinPhiPara(int n, int m) const;
92 double WestLinPhiPara(int n, int m) const;
93
94 double BarrPosDataCor(int ntheta, int nphi) const;
95 double WestPosDataCor(int ntheta, int nphi) const;
96 double EastPosDataCor(int ntheta, int nphi) const;
97
98 double BarrPosMCCor(int ntheta, int nphi) const;
99 double WestPosMCCor(int ntheta, int nphi) const;
100 double EastPosMCCor(int ntheta, int nphi) const;
101
102 double BarrLogThetaPara(int n, int m) const;
103 double BarrLogPhiPara(int n, int m) const;
104
105 double BarrLoglinThetaPara(int n, int m) const;
106 double BarrLoglinPhiPara(int n, int m) const;
107
108
109 double BarrLinThetaPara(int n, int m) const;
110 double BarrLinPhiPara(int n, int m) const;
111
112 double BarrShLogThetaPara(int n, int m) const;
113 double BarrShLogPhiPara(int n, int m) const;
114
115 double BarrShLinThetaPara(int n, int m) const;
116 double BarrShLinPhiPara(int n, int m) const;
117
118 double BarrDataLogThetaPara(int n, int m) const;
119
120 inline bool DigiCalib() const { return digiCalib; }
121 inline void SetDigiCalib(bool digi) { digiCalib=digi; }
122
123 inline void SetTimeMin(double min) { fTimeMin=min; }
124 inline void SetTimeMax(double max) { fTimeMax=max; }
125
126 inline void SetMethodMode(double en) { fMethodMode=en; }
127 inline void SetPosCorr(double en) { fPosCorr=en; }
128 inline void SetDataMode(double en) { fDataMode=en; }
129
130 inline void SetElecSaturation(int IO){ fElecSaturation=IO;}
131
132
133
134 inline void SetPeak(double e, int n) { peak[n]=e; }
135
136 inline void SetEastLogThetaPara(double p,int n,int m) { eastLogThetaPara[n][m]=p; }
137 inline void SetWestLogThetaPara(double p,int n,int m) { westLogThetaPara[n][m]=p; }
138
139 inline void SetEastLogPhiPara(double p,int n,int m) { eastLogPhiPara[n][m]=p; }
140 inline void SetWestLogPhiPara(double p,int n,int m) { westLogPhiPara[n][m]=p; }
141
142 inline void SetEastDataLogThetaPara(double p,int n,int m) { eastDataLogThetaPara[n][m]=p; }
143 inline void SetWestDataLogThetaPara(double p,int n,int m) { westDataLogThetaPara[n][m]=p; }
144
145
146 inline void SetEastLinThetaPara(double p,int n,int m) { eastLinThetaPara[n][m]=p; }
147 inline void SetWestLinThetaPara(double p,int n,int m) { westLinThetaPara[n][m]=p; }
148
149 inline void SetEastLinPhiPara(double p,int n,int m) { eastLinPhiPara[n][m]=p; }
150 inline void SetWestLinPhiPara(double p,int n,int m) { westLinPhiPara[n][m]=p; }
151
152
153 inline void SetBarrLogThetaPara(double p,int n,int m) {barrLogThetaPara[n][m]=p; }
154 inline void SetBarrLogPhiPara(double p,int n,int m) { barrLogPhiPara[n][m]=p; }
155
156 inline void SetBarrLoglinThetaPara(double p,int n,int m) {barrLoglinThetaPara[n][m]=p; }
157 inline void SetBarrLoglinPhiPara(double p,int n,int m) { barrLoglinPhiPara[n][m]=p; }
158
159 inline void SetBarrLinThetaPara(double p,int n,int m) { barrLinThetaPara[n][m]=p; }
160 inline void SetBarrLinPhiPara(double p,int n,int m) { barrLinPhiPara[n][m]=p; }
161
162 inline void SetBarrShLogThetaPara(double p,int n,int m) { barrShLogThetaPara[n][m]=p; }
163 inline void SetBarrShLogPhiPara(double p,int n,int m) { barrShLogPhiPara[n][m]=p; }
164
165 inline void SetBarrShLinThetaPara(double p,int n,int m) { barrShLinThetaPara[n][m]=p; }
166 inline void SetBarrShLinPhiPara(double p,int n,int m) { barrShLinPhiPara[n][m]=p; }
167
168 inline void SetBarrPosDataCor(double p, int nphi,int ntheta) {barrPosDataCorPara[ntheta][nphi]=p; }
169 inline void SetWestPosDataCor(double p, int nphi,int ntheta) {westPosDataCorPara[ntheta][nphi]=p; }
170 inline void SetEastPosDataCor(double p, int nphi,int ntheta) {eastPosDataCorPara[ntheta][nphi]=p; }
171
172 inline void SetBarrPosMCCor(double p, int nphi,int ntheta) {barrPosMCCorPara[ntheta][nphi]=p; }
173 inline void SetWestPosMCCor(double p, int nphi,int ntheta) {westPosMCCorPara[ntheta][nphi]=p; }
174 inline void SetEastPosMCCor(double p, int nphi,int ntheta) {eastPosMCCorPara[ntheta][nphi]=p; }
175
176 inline void SetBarrDataLogThetaPara(double p,int n,int m) {barrDataLogThetaPara[n][m]=p; }
177
178 inline std::string PositionMode1() const { return positionMode1; }
179 inline std::string PositionMode2() const { return positionMode2; }
180 void SetPositionMode(std::vector<std::string>& mode);
181
182 double ECorrMC(double eg, double theid) const;
183 double ErrMC(double eg, double theid) const;
184 double E25min(int n) const;
185 double E25max(int n) const;
186
187 double e25min[28];
188 double e25max[28];
189 private:
190 //each parameter
191 // ElectronicsNoiseLevel
192 double fElectronicsNoiseLevel;
193 // Energy threshold for seed search
194 double fEThresholdSeed;
195 // Energy threshold for cluster search
196 double fEThresholdCluster;
197 // LogPosOffset
198 double fLogPosOffset;
199
200 // Time window left
201 double fTimeMin;
202 // Time window right
203 double fTimeMax;
204 //Position correction method
205 double fMethodMode;
206
207 //MC reconstruction for electronics saturation
208 // 0: using Bhabha calibration constants
209 // 1: using Emaxdata from data
210 int fElecSaturation;
211
212 //Position correction or not
213 double fPosCorr;
214 double fDataMode;
215 // Moliere radius
216 double fMoliereRadius;
217 // Lateral profile
218 double fLateralProfile;
219
220 // Energy correction
221 double eCorr[4];
222 // Energy error
223 double sigE[3];
224 // Theta error
225 double sigTheta[2];
226 // Phi error
227 double sigPhi[2];
228
229 // Hit number
230 double hitNb[3];
231 // Correction of electronics bias
232 double elecBias[5];
233 // Cluster splitting cut with second moment
234 double smCut[4];
235
236 // Digi calibration
237 bool digiCalib;
238
239 // Shower energy correction VS theta
240 double peak[56];
241
242 double barrLogThetaPara[66][5];
243 double barrLogPhiPara[66][5];
244
245 double eastLogThetaPara[18][5];
246 double westLogThetaPara[18][5];
247
248 double eastLogPhiPara[3][5];
249 double westLogPhiPara[3][5];
250
251
252 double eastDataLogThetaPara[6][5];
253 double westDataLogThetaPara[6][5];
254
255
256 double eastLinThetaPara[6][5];
257 double westLinThetaPara[6][5];
258
259 double eastLinPhiPara[1][5];
260 double westLinPhiPara[1][5];
261
262 double barrLoglinThetaPara[22][5];
263 double barrLoglinPhiPara[1][5];
264
265 double barrLinThetaPara[66][5];
266 double barrLinPhiPara[3][5];
267
268 double barrShLogThetaPara[66][5];
269 double barrShLogPhiPara[3][5];
270
271 double barrShLinThetaPara[66][5];
272 double barrShLinPhiPara[3][5];
273
274 double barrDataLogThetaPara[22][5];
275
276 double barrPosDataCorPara[44][120];
277 double westPosDataCorPara[6][100];
278 double eastPosDataCorPara[6][100];
279
280 double barrPosMCCorPara[44][120];
281 double westPosMCCorPara[6][100];
282 double eastPosMCCorPara[6][100];
283
284 std::string positionMode1;
285 std::string positionMode2;
286
287 // Shower energy correction
288 TGraph2DErrors *dt;
289 // Energy error
290 TGraph2DErrors *dtErr;
291};
292
293#endif // EMC_REC_PARAMETER_A_H
294
const Int_t n
double LogPosOffset() const
double ECorr(int n) const
double WestPosMCCor(int ntheta, int nphi) const
double SigE(int n) const
double BarrPosMCCor(int ntheta, int nphi) const
void SetPositionMode(std::vector< std::string > &mode)
double ECorrMC(double eg, double theid) const
double EastDataLogThetaPara(int n, int m) const
double EastPosMCCor(int ntheta, int nphi) const
static void Kill()
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
double EThresholdSeed() const
double WestPosDataCor(int ntheta, int nphi) const
double BarrLogPhiPara(int n, int m) const
double BarrDataLogThetaPara(int n, int m) const
double HitNb(int n) const
double ElectronicsNoiseLevel() const
double E25min(int n) const
double PosCorr() const
double BarrShLinPhiPara(int n, int m) const
double LateralProfile() const
double E25max(int n) const
double MethodMode() const
double SigTheta(int n) const
double TimeMax() const
double BarrShLogThetaPara(int n, int m) const
double WestLogThetaPara(int n, int m) const
double ElecBias(int n) const
double BarrShLogPhiPara(int n, int m) const
double BarrShLinThetaPara(int n, int m) const
int ElecSaturation() const
double BarrPosDataCor(int ntheta, int nphi) const
double BarrLogThetaPara(int n, int m) const
static EmcRecParameter & GetInstance()
double BarrLoglinThetaPara(int n, int m) const
double WestLinThetaPara(int n, int m) const
double MoliereRadius() const
double TimeMin() const
double WestLogPhiPara(int n, int m) const
static bool Exist()
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
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 ErrMC(double eg, double theid) const