00001 #ifndef CLUSTER_H
00002 #define CLUSTER_H
00003
00004 #include <list.h>
00005
00006 struct hit { int ich; float amp; float tof; };
00007
00008 class emshower;
00009 class peakarea;
00010
00011 class cluster {
00012 protected:
00013 list<hit> HitList;
00014 public:
00015 cluster() {};
00016 cluster( list<hit> hlist ) { HitList = hlist; }
00017 void ReInitialize( list<hit> hlist ) { HitList = hlist; }
00018 int GetNofHits() { return HitList.size(); }
00019 void GetHits(hit* phit, int n);
00020 void GetHitList(list<hit>* plist) { *plist = HitList; };
00021 hit GetMaxTower();
00022 hit GetImpactTower();
00023 float GetTowerEnergy( int ich );
00024 float GetTowerToF( int ich );
00025 float GetE9( int ich );
00026 float GetTotalEnergy();
00027 void GetMoments( float* pxcg, float* pycg,
00028 float* pxx, float* pxy, float* pyy );
00029 void GetCorrPos( float* pxc, float* pyc );
00030 void GetGlobalPos( float* pxg, float* pyg, float* pzg );
00031 void GetErrors( float* pde, float* pdx, float* pdy, float* pdz);
00032 void GetChar( float* pe,
00033 float* pxcg, float* pysg,
00034 float* pxc, float* pyc,
00035 float* pxg, float* pyg, float* pzg,
00036 float* pxx, float* pxy, float* pyy,
00037 float* pde, float* pdx, float* pdy, float* pdz );
00038 int GetPeaks( peakarea*, hit* );
00039 };
00040
00041 class peakarea: public cluster{
00042 public:
00043 peakarea(){}
00044 peakarea( list<hit> hlist ):cluster(hlist) {}
00045 float GetChi2();
00046 void GetCGmin( float* pxcgmin, float* pycgmin );
00047 void GetChar( float* pe,
00048 float* pxcg, float* pysg,
00049 float* pxcgmin, float* pysgmin,
00050 float* pxc, float* pyc,
00051 float* pxg, float* pyg, float* pzg,
00052 float* pxx, float* pxy, float* pyy,
00053 float* pchi,
00054 float* pde, float* pdx, float* pdy, float* pdz );
00055 int GetGammas( emshower* );
00056 };
00057
00058 class emshower {
00059 float energy;
00060 float xcg;
00061 float ycg;
00062 float chisq;
00063 public:
00064 emshower() { energy=0; xcg=0; ycg=0; }
00065 emshower( float e, float x, float y, float chi ) { energy=e; xcg=x; ycg=y; chisq=chi; }
00066 void ReInitialize( float e, float x, float y, float chi ) { energy=e; xcg=x; ycg=y; chisq=chi; }
00067 float GetTotalEnergy() { return energy; }
00068 void GetCG( float* px, float* py ) { *px=xcg; *py=ycg; }
00069 void GetCorrPos( float*, float* );
00070 void GetGlobalPos( float*, float*, float* );
00071 float GetChi2() { return chisq; }
00072 void GetErrors( float* pde, float* pdx, float* pdy, float* pdz);
00073 void GetChar( float* pe,
00074 float* pxcg, float* pysg,
00075 float* pxc, float* pyc,
00076 float* pxg, float* pyg, float* pzg,
00077 float* pchi,
00078 float* pde, float* pdx, float* pdy, float* pdz );
00079 };
00080
00081 struct SecGeom {
00082 short nz;
00083 short ny;
00084 float Tower_zSize;
00085 float Tower_ySize;
00086 float xyz0[3];
00087 float nxyz[3];
00088 short zFlag;
00089 };
00090
00091 extern float EMCcell(float, float, float);
00092 extern int Find_Clusters( list<hit>, list<cluster>* );
00093 extern void SetGeometry( SecGeom, float* );
00094 extern void SetThreshold( float );
00095 extern void SetChi2Limit( int );
00096 extern float Chi2Correct( float Chi2, int ND );
00097
00098 #endif
00099
00100
00101