StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSvtAnalysis.hh
1 /***************************************************************************
2  *
3  * $Id: StSvtAnalysis.hh,v 1.9 2005/07/23 03:37:33 perev Exp $
4  *
5  * Author:
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StSvtAnalysis.hh,v $
13  * Revision 1.9 2005/07/23 03:37:33 perev
14  * IdTruth + Cleanup
15  *
16  * Revision 1.8 2003/01/28 20:27:49 munhoz
17  * new filters for clusters
18  *
19  * Revision 1.7 2002/05/09 16:55:40 munhoz
20  * add reading bad anodes from DB
21  *
22  * Revision 1.6 2002/04/25 20:34:50 caines
23  * Pass bad anode information into cluster fitter
24  *
25  * Revision 1.5 2000/10/31 16:20:57 caines
26  * Added more functions to make the code more readable
27  *
28  * Revision 1.4 2000/08/24 04:27:56 caines
29  * Fixed casting warnings so compiles without errors on linux
30  *
31  * Revision 1.3 2000/08/21 13:06:58 caines
32  * Much improved hit finding and fitting
33  *
34  **************************************************************************/
35 
36 
37 #ifndef STSVTANALYSIS_HH
38 #define STSVTANALYSIS_HH
39 #include <string.h>
40 
41 #include "TArrayC.h"
42 #include "myPoint.h"
43 #include "StSvtHybridCluster.hh"
44 
45 class StSvtHybridData;
47 class StSequence;
49 {
50 public:
51  int mCluFirstAnode;
52  int mCluLastAnode;
53  int mCluFirstTimeBin;
54  int mCluLastTimeBin;
55  int mCluFlag;
56  int m_oneortwo_flag; // added by JT
57  int mCluPeakAdc;
58  int mCluNumPixels;
59  int mCluNumAnodes;
60  int mHybridNum;
61  int mCluID;
62  int mCluDeconvID;
63  StSvtClusterMemberInfo* mInfo;
64  int mTruth;
65  double mCluCharge;
66  double mMeanClusterTimeBin;
67  double mMeanClusterAnode;
68  double mSecondMomClusterTimeBin;
69  double mSecondMomClusterAnode;
70  double mCluXCov;
71  double mCluYCov;
72 };
74 {
75 
76 public:
77  StSvtAnalysis(int numOfHybrids);
78  virtual ~StSvtAnalysis();
79 
80  void SetPointers(StSvtHybridData* hybAdjData,StSvtHybridData* hybRawData,
81  StSvtHybridCluster* hybClu, StSvtHybridBadAnodes* SvtBadAnode,int numOfHybrids,
82  int PedOffset);
83  void setArrays(int TotalNumberOfHybrids);
84  void setMemory();
85  void calcMoments(int clu);
86  void oneOrTwoAnodeMoments(int clu, int peakPosTim);
87  void finalMoments(int clu , int numAnodes);
88  void newCluster(int clu, int numAnodes,int igt3);
89  void FirstAndLastAnodes();
90  void CluFirstTimeBin();
91  void CluLastTimeBin();
92  void MomentAnalysis();
93  int GetFirstAnode(int clu);
94  int GetLastAnode(int clu);
95  int GetFirstTimeBin(int clu);
96  int GetLastTimeBin(int clu);
97  int GetCluFlag(int clu);
98  int GetDeconvFlag(int clu);
99  int return_oneortwoanode_flag(int clu);
100  int GetCluPeakAdc(int clu);
101  int GetCluNumAnodes(int clu);
102  int GetCluNumPixels(int clu);
103  int GetnSvtClu();
104  int GetCluID(int clu);
105  int GetCluDeconvID(int clu);
106  int GetTruth(int clu);
107  double GetCluCharge(int clu);
108  double GetMeanClusterAnode(int clu);
109  double GetMeanClusterTimeBin(int clu);
110  double GetSecondMomClusterAnode(int clu);
111  double GetSecondMomClusterTimeBin(int clu);
112  double GetCluXCov(int clu);
113  double GetCluYCov(int clu);
114  void Report(int index);
115 //void ResetMeanValues();
116  void SetBadAnTb(int numClus);
117  void LoadAnodeGains();
118 
119  int Print_Pixels(int iRows, int iCols, int clu);
120  int Fill_Pixel_Array(int clu);
121  void free_matrix_d (int**, int);
122  int **malloc_matrix_d (int iRows, int iCols);
123  POINT *Find_Peaks (int iRows, int iCols, int *iNumPeaks);
124  float IsValidPeak (int iRows, int iCols, POINT *Peaks, int iNumPeaks);
125  int BlockOut (int x, int y);
126  int Fit_Peaks(int iRows, int iCols, int iNumPeaks, POINT *Peaks, int clu);
127  int CatagorizeCluster(int iRows, int iCols, int igt3, int clu);
128  int Deconvolve_Cluster(int iRows, int iCols, int clu);
129  void SetHybIndex(int index);
130  int FillRawAdc();
131  void ClearRawAdc();
132  void updateTruth();
133 
134 private:
135 
136  int m_clu;
137  int m_row_p;
138  int m_col_p;
139  int m_adc_p;
140  int m_SvtEvt;
141 
142  int m_deconv;
143  int m_nWrkBkt;
144  int m_nGt8;
145  int m_nUndBkt;
146  int m_nSig;
147 
148  int m_hybIndex;
149 
150  int mHitId;
151  int mMyflag; // added by JT
152  int mNeff;
153  int mNumOfClusters, mNumOfMembers;
154  int mNumPixels, mPeakADC, mSumAdc;
155 
156  double mDriftMom1, mAnodeMom1;
157  double mDriftMom2, mAnodeMom2, mMom0;
158  double mX_err, mY_err;
159  double mAnodeGain[433][241]; // added by JT
160 
161  StSvtHybridData* mHybridData;
162  StSvtHybridData* mHybridRawData;
163  StSvtHybridCluster* mHybridCluster;
164  StSvtHybridBadAnodes* mSvtBadAnode;
165  StSequence* mSvtSequence;
166 
167  TArrayC mAuxArr;
168  int mMaxClu;
169  StSvtAnalysisAux *mAux;
170 
171  int** m_countBadAn;
172  int** m_countBadTb;
173 
174  StSvtClusterMemberInfo** tempMemberInfo;
175 
176  int** m_Pixels;
177  int** m_Shadow;
178  int** m_Raw;
179 
180  int mPedOffset;
181 
182  };
183 
184 #endif