StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSstWafer.hh
1 //$Id: StSstWafer.hh,v 1.8 2016/06/08 20:53:24 bouchet Exp $
2 //
3 //$Log: StSstWafer.hh,v $
4 //Revision 1.8 2016/06/08 20:53:24 bouchet
5 //coverity : PASS_BY_VALUE
6 //
7 //Revision 1.7 2016/06/07 21:40:14 bouchet
8 //setMatcheds() changed to void (since it returns nothing)
9 //
10 //Revision 1.6 2016/05/30 21:39:28 bouchet
11 //coverity : FORWARD_NULL fixed ; cleanup + simplified method
12 //
13 //Revision 1.5 2015/07/21 14:54:28 bouchet
14 //removed unused variables ; Int_t doLorentzShiftSide moved to void()
15 //
16 //Revision 1.4 2015/06/27 19:48:51 bouchet
17 //removed obsolete libraries : ssdConfiguration, ssdDimensions, ssdWafersPosition ; fixed static StSstBarrel name
18 //
19 //Revision 1.3 2015/06/27 19:30:12 bouchet
20 // re-enable St_sdm_condition_db table (used in StSstBarrel) ; last commit did not check compilation
21 //
22 //Revision 1.2 2015/06/26 20:13:46 smirnovd
23 //Removed unused St_sdm_condition_db_Table header
24 //
25 //Revision 1.1 2015/06/23 16:26:19 jeromel
26 //First version created from the SSD code and reshaped
27 //
28 //Revision 1.1 2015/04/19 17:30:32 bouchet
29 //initial commit ; SST codes
30 //
31 
32 //fork from the SSD code, move along - see history therein
33 
34 #ifndef STSSTWAFER_HH
35 #define STSSTWAFER_HH
36 #include "tables/St_sstWafersPosition_Table.h"
37 #include "tables/St_sstConfiguration_Table.h"
38 #include "tables/St_sstDimensions_Table.h"
39 #include "tables/St_sdm_condition_db_Table.h"
40 #include "StSstStripList.hh"
41 #include "StSstStrip.hh"
42 #include "StSpaNoise.hh"
43 #include "StSpaListNoise.hh"
44 #include "StSstUtil/StSstClusterList.hh"
45 #include "StSstUtil/StSstCluster.hh"
46 #include "StSstUtil/StSstPackageList.hh"
47 #include "StSstUtil/StSstPackage.hh"
48 #include "StSstUtil/StSstPointList.hh"
49 #include "StSstUtil/StSstPoint.hh"
50 #include "StSstUtil/StSstClusterControl.h"
51 #include "StSstDynamicControl.h"
52 #include "TGeoMatrix.h"
53 
54 class StSstWafer: public TGeoHMatrix {
55  public:
56  // StSstWafer(Int_t id, Int_t *deadStripP, Int_t *deadStripN);
57  StSstWafer(Int_t id);
58  ~StSstWafer();
59  StSstWafer(const StSstWafer & originalWafer);
60  StSstWafer& operator=(const StSstWafer & originalWafer);
61 
62  void init(Int_t rId, Double_t *rD, Double_t *rN, Double_t *rT, Double_t *rX);
63 
64  void setID(Int_t i){mId = i;}
65  void setDriftDirection(Double_t x1, Double_t x2, Double_t x3)
66  {Double_t *r = GetRotationMatrix(); r[0] = x1; r[3] = x2; r[6] = x3;}
67  void setNormalDirection(Double_t x1, Double_t x2, Double_t x3)
68  {Double_t *r = GetRotationMatrix(); r[1] = x1; r[4] = x2; r[7] = x3;}
69  void setTransverseDirection(Double_t x1, Double_t x2, Double_t x3)
70  {Double_t *r = GetRotationMatrix(); r[2] = x1; r[5] = x2; r[8] = x3;}
71  void setCenterPosition(Double_t x1, Double_t x2, Double_t x3) {Double_t *t = GetTranslation(); t[0] = x1; t[1] = x2; t[2] = x3;}
72  StSstClusterList* getClusterP() { return mClusterP; }
73  StSstClusterList* getClusterN() { return mClusterN; }
74  StSstPointList* getDeadHits(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge,Float_t Test);
75  StSstPointList* getNonActivePointBorder(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge);
76  StSstPointList* getNonActivePointTriangle(Float_t Test);
77  StSstStripList* getStripP() { return mStripP; }
78  StSstStripList* getStripN() { return mStripN; }
79  StSstPackageList* getPackage() { return mPackage; }
80  StSstPointList* getPoint() { return mPoint; }
81  Int_t getIdWafer() { return mId; }
82  Int_t getId() {return getIdWafer();}
83  Double_t d(Int_t i){Double_t *r = GetRotationMatrix(); return r[3*i]; }
84  Double_t n(Int_t i){Double_t *r = GetRotationMatrix(); return r[3*i+1];}
85  Double_t t(Int_t i){Double_t *r = GetRotationMatrix(); return r[3*i+2];}
86  Double_t x(Int_t i){Double_t *t = GetTranslation(); return t[i]; }
87 
88  void addCluster(StSstCluster *ptr, Int_t iSide);
89  void addHit(Int_t rNId , Int_t rMcHit, Int_t rMcTrack, Float_t *rXg , Float_t rDe, Float_t *p);
90  void addNoiseToStripSignal(StSpaNoise *ptr, Int_t iSide);
91  void addNoiseToStripSignal(long nElectronInAMip,long adcDynamic);
92  void addPackage(StSstPackage *ptr);
93  void addPoint(StSstPoint *ptr);
94  void addStrip(StSstStrip *ptr, Int_t iSide);
95  Int_t geoMatched(sstDimensions_st *dimensions, StSstCluster *ptr1, StSstCluster *ptr2);
97  Double_t matchDistr(StSstClusterControl *clusterControl, Double_t x);
98  static Double_t myErf(Double_t x);
99  void setIsActive(Int_t rIsActive, Int_t iSide, Int_t rNStrip);
100  void setMatcheds(sstDimensions_st *dimensions, StSstPoint *Point, StSstCluster *pMatched, StSstCluster *nMatched);
101  void setPedestalSigmaStrip(Int_t iStrip, Int_t iSide, Int_t iPedestal, Int_t iSigma, StSstDynamicControl *dynamicControl);
102 
103  void Reset();
104  void sortCluster();
105  void sortNoise();
106  void sortPoint();
107  void sortStrip(); //?
108 
109  void doClusterisation(Int_t *numberOfCluster, StSstClusterControl *clusterControl);
110  Int_t doClusterSplitting(StSstClusterControl *clusterControl, Int_t iSide);
111  Int_t doFindCluster(StSstClusterControl *clusterControl, Int_t iSide);
112  Int_t doFindPackage(sstDimensions_st *dimensions, StSstClusterControl *clusterControl);
113  Int_t doSolvePackage(sstDimensions_st *dimensions, StSstClusterControl *clusterControl,Float_t CalibArray);
114  Int_t doSolvePerfect(sstDimensions_st *dimensions, StSstClusterControl *clusterControl,Float_t CalibArray);
115  void doStatPerfect(Int_t nPerfectPoint, StSstClusterControl *clusterControl);
116  void doLorentzShift(sstDimensions_st *dimensions,Float_t mShift_hole,Float_t mShift_elec);
117  void doLorentzShiftSide(Float_t shift, Float_t pitch, StSstClusterList *currentList);
118  void convertAnalogToDigit(Double_t pairCreationEnergy);
119  void convertAnalogToDigit(Long_t nElectronInAMip,Long_t adcDynamic,Long_t nbitEncoding, Float_t daqCutValue);
120  Int_t convertDigitToAnalog(Double_t pairCreationEnergy);
121  Int_t convertUFrameToLocal(sstDimensions_st *dimensions);
122  Int_t convertLocalToGlobal();
123  Int_t convertGlobalToLocal();
124  Int_t convertLocalToUFrame(Float_t ActiveLargeEdge, Float_t ActiveSmallEdge, Float_t Theta);
125  void convertHitToStrip(Float_t Pitch,
126  Int_t nStripPerSide,
127  Int_t nstripInACluster,
128  Double_t parDiffP,
129  Double_t parDiffN,
130  Double_t parIndRightP,
131  Double_t parIndRightN,
132  Double_t parIndLeftP,
133  Double_t parIndLeftN,
134  Float_t mShift_hole,
135  Float_t mShift_elec
136  );
137  void convertToStrip(Float_t Pitch,
138  Int_t nStripPerSide,
139  Double_t pairCreationEnergy,
140  Int_t nstripInACluster,
141  Double_t parDiffP,
142  Double_t parDiffN,
143  Double_t parIndRightP,
144  Double_t parIndRightN,
145  Double_t parIndLeftP,
146  Double_t parIndLeftN,
147  Float_t mShift_hole,
148  Float_t mShift_elec
149  );
150  void debugStrips();
151  void debugClusters();
152  Float_t* findAngle(Float_t *p, Float_t *alpha);
153  void pedestalSubstraction();
154  Int_t printborder();
155  void updateStripList();
156  void zeroSubstraction();
157  void UndoLorentzShift(StSstPoint *ptr, Int_t iSide,Float_t mShift_hole,Float_t mShift_elec,Float_t pitch);
158  void doCleanListStrip(StSstStripList *myListStrip);
159  void SetDebug(Int_t k = 0) {mDebug = k;}
160  Int_t Debug() {return mDebug;}
161 
162  private:
163  Char_t first[1];
164  Int_t mId;
165  Float_t mPerfectMean;
166  Float_t mPerfectSigma;
167 // Int_t *mDeadStripP;
168 // Int_t *mDeadStripN;
169 
170  StSstStripList *mStripP;
171  StSstStripList *mStripN;
172  StSpaListNoise *mNoiseP;
173  StSpaListNoise *mNoiseN;
174  StSstClusterList *mClusterP;
175  StSstClusterList *mClusterN;
176  StSstPackageList *mPackage;
177  StSstPointList *mPoint;
178  Int_t mDebug;
179  Char_t last[1];
180  StSstStripList *cleanListStrip;
181  StSstStripList *myStripList;
182 
183 };
184 #endif
void doLorentzShift(sstDimensions_st *dimensions, Float_t mShift_hole, Float_t mShift_elec)
Definition: StSstWafer.cc:418
StSstClusterList * getClusterP()
Returns the P-side cluster list attached to this wafer.
Definition: StSstWafer.hh:72
void addPoint(StSstPoint *ptr)
Attaches the ptr point on that wafer.
Definition: StSstWafer.cc:193
void sortPoint()
Definition: StSstWafer.cc:225
StSstStripList * getStripP()
Returns the P-side strip list attached to this wafer.
Definition: StSstWafer.hh:77
Int_t doFindPackage(sstDimensions_st *dimensions, StSstClusterControl *clusterControl)
Definition: StSstWafer.cc:441
Int_t geoMatched(sstDimensions_st *dimensions, StSstCluster *ptr1, StSstCluster *ptr2)
Determines if two clusters are geometricaly compatible.
Definition: StSstWafer.cc:2610
void addCluster(StSstCluster *ptr, Int_t iSide)
Attaches the ptr cluster on the iSide of the wafer.
Definition: StSstWafer.cc:176
StSstPointList * getPoint()
Returns the point list attached to this wafer.
Definition: StSstWafer.hh:80
void addStrip(StSstStrip *ptr, Int_t iSide)
Definition: StSstWafer.cc:165
StSstClusterList * getClusterN()
Returns the N-side cluster list attached to this wafer.
Definition: StSstWafer.hh:73
Int_t doClusterSplitting(StSstClusterControl *clusterControl, Int_t iSide)
Definition: StSstWafer.cc:369
void sortCluster()
Definition: StSstWafer.cc:216
Int_t doFindCluster(StSstClusterControl *clusterControl, Int_t iSide)
Does the cluster finding.
Definition: StSstWafer.cc:281
StSstPackageList * getPackage()
Returns the package list attached to this wafer.
Definition: StSstWafer.hh:79
void addPackage(StSstPackage *ptr)
Attaches the ptr package on that wafer.
Definition: StSstWafer.cc:187
void sortStrip()
Definition: StSstWafer.cc:207
void setMatcheds(sstDimensions_st *dimensions, StSstPoint *Point, StSstCluster *pMatched, StSstCluster *nMatched)
Definition: StSstWafer.cc:2625
StSstStripList * getStripN()
Returns the N-side strip list attached to this wafer.
Definition: StSstWafer.hh:78
void doClusterisation(Int_t *numberOfCluster, StSstClusterControl *clusterControl)
Definition: StSstWafer.cc:232