00001
00002
00003
00004
00005
00006 #include "CSCStrip.h"
00007 #include"TH1.h"
00008 #include"TF1.h"
00009 #include"CalServer.h"
00010
00011
00012 #ifndef TRUE
00013 #define TRUE 1
00014 #endif
00015
00016 #ifndef FALSE
00017 #define FALSE 0
00018 #endif
00019
00020 #define MODE_PARABOLIC 1 // no fit, use parabolic interpolation
00021 #define MODE_FIT 2 // root fit with 3 parameters
00022
00023
00024
00025
00026 Double_t fitshape(Double_t *x, Double_t *parm);
00027
00028
00029 class PulseFitter{
00030
00031 private:
00032 double paraAmp, paraPeak, paraWidth;
00033 double adc[50];
00034 TH1F* his;
00035 TF1 *fit;
00036 int mode;
00037 void Parabolic (double a, double b, double c);
00038 int bad;
00039
00040
00041 public:
00042 PulseFitter();
00043 ~PulseFitter();
00044
00045
00046
00047
00048
00049 void Fit (CSCStrip* strip, int mode, CalServer* cal);
00050
00051 double GetAmplitude ();
00052
00053 double GetPeakingTime ();
00054
00055 double GetWidth ();
00056
00057 double GetChi2 () {return fit->GetChisquare();};
00058 int GetBad() { return bad;};
00059
00060 };
00061