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