00001
00002
00003
00004
00005
00006
00007
00008 #ifndef EMC_REC_PARAMETER_A_H
00009 #define EMC_REC_PARAMETER_A_H
00010 #include <pthread.h>
00011 #include <iostream>
00012 #include <vector>
00013
00014 using namespace std;
00015
00016 class TGraph2DErrors;
00017
00018 class EmcRecParameter
00019 {
00020 private:
00021
00022 EmcRecParameter();
00023 ~EmcRecParameter();
00024
00025 public:
00026
00027 static EmcRecParameter& GetInstance();
00028 static bool Exist();
00029 static void Kill();
00030 static void lock(){
00031 if(pthread_mutex_lock(&m_pthread_lock) != 0){
00032 std::cerr << "LOCK MUTEX_LOCK @ GZFSSTREAM" << std::endl;
00033 }
00034 };
00035 static void unlock(){
00036 if(pthread_mutex_unlock(&m_pthread_lock) != 0){
00037 std::cerr << "UNLOCK MUTEX_LOCK @ GZFSSTREAM" << std::endl;
00038 }
00039 };
00040
00041
00042
00043 private:
00044
00045 static EmcRecParameter* fpInstance;
00046 static pthread_mutex_t m_pthread_lock;
00047
00048
00049 public:
00050
00051 double ElectronicsNoiseLevel() const;
00052 double EThresholdSeed() const;
00053 double EThresholdCluster() const;
00054 double LogPosOffset() const;
00055
00056 double TimeMin() const;
00057 double TimeMax() const;
00058 double MethodMode() const;
00059 double PosCorr() const;
00060 double DataMode() const;
00061 int ElecSaturation() const;
00062
00063 double MoliereRadius() const;
00064 double LateralProfile() const;
00065
00066 double ECorr(int n) const;
00067 double SigE(int n) const;
00068 double SigTheta(int n) const;
00069 double SigPhi(int n) const;
00070
00071 double HitNb(int n) const;
00072 double ElecBias(int n) const;
00073 double SmCut(int n) const;
00074
00075 double Peak(int n) const;
00076
00077 double EastLogThetaPara(int n, int m) const;
00078 double WestLogThetaPara(int n, int m) const;
00079
00080 double EastLogPhiPara(int n, int m) const;
00081 double WestLogPhiPara(int n, int m) const;
00082
00083
00084 double EastDataLogThetaPara(int n, int m) const;
00085 double WestDataLogThetaPara(int n, int m) const;
00086
00087
00088 double EastLinThetaPara(int n, int m) const;
00089 double WestLinThetaPara(int n, int m) const;
00090
00091 double EastLinPhiPara(int n, int m) const;
00092 double WestLinPhiPara(int n, int m) const;
00093
00094 double BarrPosDataCor(int ntheta, int nphi) const;
00095 double WestPosDataCor(int ntheta, int nphi) const;
00096 double EastPosDataCor(int ntheta, int nphi) const;
00097
00098 double BarrPosMCCor(int ntheta, int nphi) const;
00099 double WestPosMCCor(int ntheta, int nphi) const;
00100 double EastPosMCCor(int ntheta, int nphi) const;
00101
00102 double BarrLogThetaPara(int n, int m) const;
00103 double BarrLogPhiPara(int n, int m) const;
00104
00105 double BarrLoglinThetaPara(int n, int m) const;
00106 double BarrLoglinPhiPara(int n, int m) const;
00107
00108
00109 double BarrLinThetaPara(int n, int m) const;
00110 double BarrLinPhiPara(int n, int m) const;
00111
00112 double BarrShLogThetaPara(int n, int m) const;
00113 double BarrShLogPhiPara(int n, int m) const;
00114
00115 double BarrShLinThetaPara(int n, int m) const;
00116 double BarrShLinPhiPara(int n, int m) const;
00117
00118 double BarrDataLogThetaPara(int n, int m) const;
00119
00120 inline bool DigiCalib() const { return digiCalib; }
00121 inline void SetDigiCalib(bool digi) { digiCalib=digi; }
00122
00123 inline void SetTimeMin(double min) { fTimeMin=min; }
00124 inline void SetTimeMax(double max) { fTimeMax=max; }
00125
00126 inline void SetMethodMode(double en) { fMethodMode=en; }
00127 inline void SetPosCorr(double en) { fPosCorr=en; }
00128 inline void SetDataMode(double en) { fDataMode=en; }
00129
00130 inline void SetElecSaturation(int IO){ fElecSaturation=IO;}
00131
00132
00133
00134 inline void SetPeak(double e, int n) { peak[n]=e; }
00135
00136 inline void SetEastLogThetaPara(double p,int n,int m) { eastLogThetaPara[n][m]=p; }
00137 inline void SetWestLogThetaPara(double p,int n,int m) { westLogThetaPara[n][m]=p; }
00138
00139 inline void SetEastLogPhiPara(double p,int n,int m) { eastLogPhiPara[n][m]=p; }
00140 inline void SetWestLogPhiPara(double p,int n,int m) { westLogPhiPara[n][m]=p; }
00141
00142 inline void SetEastDataLogThetaPara(double p,int n,int m) { eastDataLogThetaPara[n][m]=p; }
00143 inline void SetWestDataLogThetaPara(double p,int n,int m) { westDataLogThetaPara[n][m]=p; }
00144
00145
00146 inline void SetEastLinThetaPara(double p,int n,int m) { eastLinThetaPara[n][m]=p; }
00147 inline void SetWestLinThetaPara(double p,int n,int m) { westLinThetaPara[n][m]=p; }
00148
00149 inline void SetEastLinPhiPara(double p,int n,int m) { eastLinPhiPara[n][m]=p; }
00150 inline void SetWestLinPhiPara(double p,int n,int m) { westLinPhiPara[n][m]=p; }
00151
00152
00153 inline void SetBarrLogThetaPara(double p,int n,int m) {barrLogThetaPara[n][m]=p; }
00154 inline void SetBarrLogPhiPara(double p,int n,int m) { barrLogPhiPara[n][m]=p; }
00155
00156 inline void SetBarrLoglinThetaPara(double p,int n,int m) {barrLoglinThetaPara[n][m]=p; }
00157 inline void SetBarrLoglinPhiPara(double p,int n,int m) { barrLoglinPhiPara[n][m]=p; }
00158
00159 inline void SetBarrLinThetaPara(double p,int n,int m) { barrLinThetaPara[n][m]=p; }
00160 inline void SetBarrLinPhiPara(double p,int n,int m) { barrLinPhiPara[n][m]=p; }
00161
00162 inline void SetBarrShLogThetaPara(double p,int n,int m) { barrShLogThetaPara[n][m]=p; }
00163 inline void SetBarrShLogPhiPara(double p,int n,int m) { barrShLogPhiPara[n][m]=p; }
00164
00165 inline void SetBarrShLinThetaPara(double p,int n,int m) { barrShLinThetaPara[n][m]=p; }
00166 inline void SetBarrShLinPhiPara(double p,int n,int m) { barrShLinPhiPara[n][m]=p; }
00167
00168 inline void SetBarrPosDataCor(double p, int nphi,int ntheta) {barrPosDataCorPara[ntheta][nphi]=p; }
00169 inline void SetWestPosDataCor(double p, int nphi,int ntheta) {westPosDataCorPara[ntheta][nphi]=p; }
00170 inline void SetEastPosDataCor(double p, int nphi,int ntheta) {eastPosDataCorPara[ntheta][nphi]=p; }
00171
00172 inline void SetBarrPosMCCor(double p, int nphi,int ntheta) {barrPosMCCorPara[ntheta][nphi]=p; }
00173 inline void SetWestPosMCCor(double p, int nphi,int ntheta) {westPosMCCorPara[ntheta][nphi]=p; }
00174 inline void SetEastPosMCCor(double p, int nphi,int ntheta) {eastPosMCCorPara[ntheta][nphi]=p; }
00175
00176 inline void SetBarrDataLogThetaPara(double p,int n,int m) {barrDataLogThetaPara[n][m]=p; }
00177
00178 inline std::string PositionMode1() const { return positionMode1; }
00179 inline std::string PositionMode2() const { return positionMode2; }
00180 void SetPositionMode(std::vector<std::string>& mode);
00181
00182 double ECorrMC(double eg, double theid) const;
00183 double ErrMC(double eg, double theid) const;
00184 double E25min(int n) const;
00185 double E25max(int n) const;
00186
00187 double e25min[28];
00188 double e25max[28];
00189 private:
00190
00191
00192 double fElectronicsNoiseLevel;
00193
00194 double fEThresholdSeed;
00195
00196 double fEThresholdCluster;
00197
00198 double fLogPosOffset;
00199
00200
00201 double fTimeMin;
00202
00203 double fTimeMax;
00204
00205 double fMethodMode;
00206
00207
00208
00209
00210 int fElecSaturation;
00211
00212
00213 double fPosCorr;
00214 double fDataMode;
00215
00216 double fMoliereRadius;
00217
00218 double fLateralProfile;
00219
00220
00221 double eCorr[4];
00222
00223 double sigE[3];
00224
00225 double sigTheta[2];
00226
00227 double sigPhi[2];
00228
00229
00230 double hitNb[3];
00231
00232 double elecBias[5];
00233
00234 double smCut[4];
00235
00236
00237 bool digiCalib;
00238
00239
00240 double peak[56];
00241
00242 double barrLogThetaPara[66][5];
00243 double barrLogPhiPara[66][5];
00244
00245 double eastLogThetaPara[18][5];
00246 double westLogThetaPara[18][5];
00247
00248 double eastLogPhiPara[3][5];
00249 double westLogPhiPara[3][5];
00250
00251
00252 double eastDataLogThetaPara[6][5];
00253 double westDataLogThetaPara[6][5];
00254
00255
00256 double eastLinThetaPara[6][5];
00257 double westLinThetaPara[6][5];
00258
00259 double eastLinPhiPara[1][5];
00260 double westLinPhiPara[1][5];
00261
00262 double barrLoglinThetaPara[22][5];
00263 double barrLoglinPhiPara[1][5];
00264
00265 double barrLinThetaPara[66][5];
00266 double barrLinPhiPara[3][5];
00267
00268 double barrShLogThetaPara[66][5];
00269 double barrShLogPhiPara[3][5];
00270
00271 double barrShLinThetaPara[66][5];
00272 double barrShLinPhiPara[3][5];
00273
00274 double barrDataLogThetaPara[22][5];
00275
00276 double barrPosDataCorPara[44][120];
00277 double westPosDataCorPara[6][100];
00278 double eastPosDataCorPara[6][100];
00279
00280 double barrPosMCCorPara[44][120];
00281 double westPosMCCorPara[6][100];
00282 double eastPosMCCorPara[6][100];
00283
00284 std::string positionMode1;
00285 std::string positionMode2;
00286
00287
00288 TGraph2DErrors *dt;
00289
00290 TGraph2DErrors *dtErr;
00291 };
00292
00293 #endif // EMC_REC_PARAMETER_A_H
00294