StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSsdWafer.hh
1 // $Id: StSsdWafer.hh,v 1.9 2015/06/28 13:50:48 bouchet Exp $
2 //
3 // $Log: StSsdWafer.hh,v $
4 // Revision 1.9 2015/06/28 13:50:48 bouchet
5 // re-enable St_sdm_condition_db table (used in StSsdBarrel)
6 //
7 // Revision 1.8 2015/06/26 20:13:45 smirnovd
8 // Removed unused St_sdm_condition_db_Table header
9 //
10 // Revision 1.7 2014/10/18 19:31:56 smirnovd
11 // Revert "1st commit" asked by Jonathan
12 //
13 // Revision 1.5 2009/02/23 21:10:40 bouchet
14 // increase NSaturationSignal to reflect the energy increase of the GEANT hit
15 //
16 // Revision 1.4 2007/07/01 15:47:38 bouchet
17 // add method to remove strips which signal < 3*rms
18 //
19 // Revision 1.3 2007/03/27 23:11:49 bouchet
20 // Add a method to use the gain calibration for the Charge Matching between pulse of p and n sides
21 //
22 // Revision 1.2 2007/03/21 17:20:42 fisyak
23 // use TGeoHMatrix for coordinate transformation
24 //
25 // Revision 1.1 2006/10/16 16:43:30 bouchet
26 // StSsdUtil regroups now methods for the classes StSsdStrip, StSsdCluster and StSsdPoint
27 //
28 // Revision 1.6 2006/09/15 21:03:15 bouchet
29 // id_mctrack is using for setIdTruth and propagated to the hit
30 //
31 // Revision 1.5 2005/03/18 14:59:32 lmartin
32 // setPedestalSigmaStrip method added, setSigmaStrip removed
33 //
34 // Revision 1.4 2005/03/18 14:01:32 lmartin
35 // Remove first include accidentaly added
36 //
37 // Revision 1.3 2005/03/18 13:55:50 lmartin
38 // missing CVS header added
39 //
40 
59 #ifndef STSSDWAFER_HH
60 #define STSSDWAFER_HH
61 #include "tables/St_ssdWafersPosition_Table.h"
62 #include "tables/St_ssdConfiguration_Table.h"
63 #include "tables/St_ssdDimensions_Table.h"
64 #include "tables/St_sdm_condition_db_Table.h"
65 #include "StSsdStripList.hh"
66 #include "StSsdStrip.hh"
67 #include "StSpaNoise.hh"
68 #include "StSpaListNoise.hh"
69 #include "StSsdUtil/StSsdClusterList.hh"
70 #include "StSsdUtil/StSsdCluster.hh"
71 #include "StSsdUtil/StSsdPackageList.hh"
72 #include "StSsdUtil/StSsdPackage.hh"
73 #include "StSsdUtil/StSsdPointList.hh"
74 #include "StSsdUtil/StSsdPoint.hh"
75 #include "StSsdUtil/StSsdClusterControl.h"
76 #include "StSsdDynamicControl.h"
77 #include "TGeoMatrix.h"
78 class St_ssdGainCalib;
79 
80 class StSsdWafer: public TGeoHMatrix {
81  public:
82  // StSsdWafer(Int_t id, Int_t *deadStripP, Int_t *deadStripN);
83  StSsdWafer(Int_t id);
84  ~StSsdWafer();
85  StSsdWafer(const StSsdWafer & originalWafer);
86  StSsdWafer& operator=(const StSsdWafer originalWafer);
87 
88  void init(Int_t rId, Double_t *rD, Double_t *rT, Double_t *rN, Double_t *rX);
89 
90  void setID(Int_t i){mId = i;}
91  void setDriftDirection(Double_t x1, Double_t x2, Double_t x3)
92  {Double_t *r = GetRotationMatrix(); r[0] = x1; r[3] = x2; r[6] = x3;}
93  void setTransverseDirection(Double_t x1, Double_t x2, Double_t x3)
94  {Double_t *r = GetRotationMatrix(); r[1] = x1; r[4] = x2; r[7] = x3;}
95  void setNormalDirection(Double_t x1, Double_t x2, Double_t x3)
96  {Double_t *r = GetRotationMatrix(); r[2] = x1; r[5] = x2; r[8] = x3;}
97  void setCenterPosition(Double_t x1, Double_t x2, Double_t x3) {Double_t *t = GetTranslation(); t[0] = x1; t[1] = x2; t[2] = x3;}
98  StSsdClusterList* getClusterP() { return mClusterP; }
99  StSsdClusterList* getClusterN() { return mClusterN; }
100  StSsdPointList* getDeadHits(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge,Float_t Test);
101  StSsdPointList* getNonActivePointBorder(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge);
102  StSsdPointList* getNonActivePointTriangle(Float_t Test);
103  StSsdStripList* getStripP() { return mStripP; }
104  StSsdStripList* getStripN() { return mStripN; }
105  StSsdPackageList* getPackage() { return mPackage; }
106  StSsdPointList* getPoint() { return mPoint; }
107  Int_t getIdWafer() { return mId; }
108  Int_t getId() {return getIdWafer();}
109  Double_t d(Int_t i){Double_t *r = GetRotationMatrix(); return r[3*i]; }
110  Double_t t(Int_t i){Double_t *r = GetRotationMatrix(); return r[3*i+1];}
111  Double_t n(Int_t i){Double_t *r = GetRotationMatrix(); return r[3*i+2];}
112  Double_t x(Int_t i){Double_t *t = GetTranslation(); return t[i]; }
113 
114  void addCluster(StSsdCluster *ptr, Int_t iSide);
115  void addHit(Int_t rNId , Int_t rMcHit, Int_t rMcTrack, Float_t *rXg , Float_t rDe, Float_t *p);
116  void addNoiseToStripSignal(StSpaNoise *ptr, Int_t iSide);
117  void addNoiseToStripSignal(long nElectronInAMip,long adcDynamic);
118  void addPackage(StSsdPackage *ptr);
119  void addPoint(StSsdPoint *ptr);
120  void addStrip(StSsdStrip *ptr, Int_t iSide);
121  Int_t geoMatched(ssdDimensions_st *dimensions, StSsdCluster *ptr1, StSsdCluster *ptr2);
123  Double_t matchDistr(StSsdClusterControl *clusterControl, Double_t x);
124  static Double_t myErf(Double_t x);
125  void setIsActive(Int_t rIsActive, Int_t iSide, Int_t rNStrip);
126  Int_t setMatcheds(ssdDimensions_st *dimensions, StSsdPoint *Point, StSsdCluster *pMatched, StSsdCluster *nMatched);
127  void setPedestalSigmaStrip(Int_t iStrip, Int_t iSide, Int_t iPedestal, Int_t iSigma, StSsdDynamicControl *dynamicControl);
128 
129  void Reset();
130  void sortCluster();
131  void sortNoise();
132  void sortPoint();
133  void sortStrip(); //?
134 
135  void doClusterisation(Int_t *numberOfCluster, StSsdClusterControl *clusterControl);
136  Int_t doClusterSplitting(StSsdClusterControl *clusterControl, Int_t iSide);
137  Int_t doFindCluster(StSsdClusterControl *clusterControl, Int_t iSide);
138  Int_t doFindPackage(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl);
139  Int_t doSolvePackage(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl,Float_t CalibArray);
140  Int_t doSolvePerfect(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl,Float_t CalibArray);
141  void doStatPerfect(Int_t nPerfectPoint, StSsdClusterControl *clusterControl);
142  void doLorentzShift(ssdDimensions_st *dimensions,Float_t mShift_hole,Float_t mShift_elec);
143  Int_t doLorentzShiftSide(Int_t side,Float_t shift,ssdDimensions_st *dimensions);
144  void convertAnalogToDigit(Double_t pairCreationEnergy);
145  void convertAnalogToDigit(Long_t nElectronInAMip,Long_t adcDynamic,Long_t nbitEncoding, Float_t daqCutValue);
146  Int_t convertDigitToAnalog(Double_t pairCreationEnergy);
147  Int_t convertUFrameToLocal(ssdDimensions_st *dimensions);
148  Int_t convertLocalToGlobal();
149  Int_t convertGlobalToLocal();
150  Int_t convertLocalToUFrame(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge, Float_t Theta);
151  void convertHitToStrip(Float_t Pitch,
152  Int_t nStripPerSide,
153  Int_t nstripInACluster,
154  Double_t parDiffP,
155  Double_t parDiffN,
156  Double_t parIndRightP,
157  Double_t parIndRightN,
158  Double_t parIndLeftP,
159  Double_t parIndLeftN,
160  Float_t mShift_hole,
161  Float_t mShift_elec
162  );
163  void convertToStrip(Float_t Pitch,
164  Int_t nStripPerSide,
165  Double_t pairCreationEnergy,
166  Int_t nstripInACluster,
167  Double_t parDiffP,
168  Double_t parDiffN,
169  Double_t parIndRightP,
170  Double_t parIndRightN,
171  Double_t parIndLeftP,
172  Double_t parIndLeftN,
173  Float_t mShift_hole,
174  Float_t mShift_elec
175  );
176  void debugStrips();
177  void debugClusters();
178  Float_t* findAngle(Float_t *p, Float_t *alpha);
179  void pedestalSubstraction();
180  Int_t printborder();
181  void updateStripList();
182  void zeroSubstraction();
183  void UndoLorentzShift(StSsdPoint *ptr, Int_t iSide,Float_t mShift_hole,Float_t mShift_elec,Float_t pitch);
184  void doCleanListStrip(StSsdStripList *myListStrip);
185  void SetDebug(Int_t k = 0) {mDebug = k;}
186  Int_t Debug() {return mDebug;}
187 
188  private:
189  Char_t first[1];
190  Int_t mId;
191  Float_t mPerfectMean;
192  Float_t mPerfectSigma;
193 // Int_t *mDeadStripP;
194 // Int_t *mDeadStripN;
195 
196  StSsdStripList *mStripP;
197  StSsdStripList *mStripN;
198  StSpaListNoise *mNoiseP;
199  StSpaListNoise *mNoiseN;
200  StSsdClusterList *mClusterP;
201  StSsdClusterList *mClusterN;
202  StSsdPackageList *mPackage;
203  StSsdPointList *mPoint;
204  Int_t mDebug;
205  Char_t last[1];
206  StSsdStripList *cleanListStrip;
207  StSsdStripList *myStripList;
208 
209 };
210 #endif
StSsdPointList * getPoint()
Returns the point list attached to this wafer.
Definition: StSsdWafer.hh:106
void addCluster(StSsdCluster *ptr, Int_t iSide)
Attaches the ptr cluster on the iSide of the wafer.
Definition: StSsdWafer.cc:212
StSsdStripList * getStripP()
Returns the P-side strip list attached to this wafer.
Definition: StSsdWafer.hh:103
void sortCluster()
Definition: StSsdWafer.cc:252
void sortStrip()
Definition: StSsdWafer.cc:243
void sortPoint()
Definition: StSsdWafer.cc:261
void doLorentzShift(ssdDimensions_st *dimensions, Float_t mShift_hole, Float_t mShift_elec)
Definition: StSsdWafer.cc:446
StSsdStripList * getStripN()
Returns the N-side strip list attached to this wafer.
Definition: StSsdWafer.hh:104
void addPoint(StSsdPoint *ptr)
Attaches the ptr point on that wafer.
Definition: StSsdWafer.cc:229
Int_t setMatcheds(ssdDimensions_st *dimensions, StSsdPoint *Point, StSsdCluster *pMatched, StSsdCluster *nMatched)
Definition: StSsdWafer.cc:2689
void addPackage(StSsdPackage *ptr)
Attaches the ptr package on that wafer.
Definition: StSsdWafer.cc:223
Int_t doClusterSplitting(StSsdClusterControl *clusterControl, Int_t iSide)
Definition: StSsdWafer.cc:395
Int_t doFindPackage(ssdDimensions_st *dimensions, StSsdClusterControl *clusterControl)
Definition: StSsdWafer.cc:492
void addStrip(StSsdStrip *ptr, Int_t iSide)
Definition: StSsdWafer.cc:201
void init(Int_t rId, Double_t *rD, Double_t *rT, Double_t *rN, Double_t *rX)
Definition: StSsdWafer.cc:126
void doClusterisation(Int_t *numberOfCluster, StSsdClusterControl *clusterControl)
Definition: StSsdWafer.cc:270
StSsdPackageList * getPackage()
Returns the package list attached to this wafer.
Definition: StSsdWafer.hh:105
Int_t geoMatched(ssdDimensions_st *dimensions, StSsdCluster *ptr1, StSsdCluster *ptr2)
Determines if two clusters are geometricaly compatible.
Definition: StSsdWafer.cc:2674
StSsdClusterList * getClusterN()
Returns the N-side cluster list attached to this wafer.
Definition: StSsdWafer.hh:99
StSsdClusterList * getClusterP()
Returns the P-side cluster list attached to this wafer.
Definition: StSsdWafer.hh:98
Int_t doFindCluster(StSsdClusterControl *clusterControl, Int_t iSide)
Does the cluster finding.
Definition: StSsdWafer.cc:309