fdhwlib
2.0.25
|
00001 /*************************************************************************** 00002 calibPulse.h - description 00003 00004 begin : Tue Sep 12 2001 00005 copyright : (C) 2001 by A Kopmann 00006 email : kopmann@hpe.fzk.de 00007 status : 00008 test : 00009 history : 00010 ***************************************************************************/ 00011 00012 00013 #ifndef CALIBPULSE_H 00014 #define CALIBPULSE_H 00015 00016 00017 #include <Hw/FltDef.h> 00018 00019 00027 class CalibPulse 00028 { 00029 public: 00030 CalibPulse(); 00031 virtual ~CalibPulse(); 00032 00058 void findPosition(unsigned short *data, int n, 00059 float *t1, float *t2, 00060 int fLen=4, int prec=-1, int iBegin=0); 00061 00062 00079 float getIntegral(unsigned short *data, int n, 00080 float *t1, float *t2, 00081 float prec=0, int iBegin=0); 00082 00083 00096 float getGain(unsigned short *data, int n, int nRamp = 4); 00097 00098 00102 void getFilteredData(float *t, float *y, int *n); 00103 00108 void getInterpolatedData(float *t, float *y, int *n); 00109 00110 00112 void getPulseShape(float *t, float *y, int *n); 00113 00115 void displayHeader(FILE *fout); 00116 00118 void display(FILE *fout, int col=0, int row=0); 00119 00121 void displayIntegral(FILE *fout, int col=0, int row=0); 00122 00128 float getSNR(); 00129 00134 float getGradient(); 00135 00136 00138 float getPedestal(); 00139 00141 float getPulseHeight(); 00142 00144 int isPulse(float minSNR = 1.); 00145 00152 int isMuonPulse(float minGradient = 100.); 00153 00154 00155 00156 private: 00157 00158 00160 float tMin; 00161 00163 float tMax; 00164 00166 float tBegin; 00167 00169 float tEnd; 00170 00172 float tIntBegin; 00173 00175 float tIntEnd; 00176 00178 int filterLength; 00179 00181 int len; 00182 00186 int indexBegin; 00187 00189 long dy1[FLT_PAGE_SIZE]; 00190 00194 long dy2[FLT_PAGE_SIZE]; 00195 00196 00199 int nPed; 00200 00202 float meanPed; 00203 00205 float varPed; 00206 00209 int nPulse; 00210 00212 float meanPulse; 00213 00215 float varPulse; 00216 00218 float maxPulse; 00219 00221 float gain; 00222 00224 float gradient; 00225 00229 float integral; 00230 00231 }; 00232 00233 #endif