StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSsdBarrel.hh
1 // $Id: StSsdBarrel.hh,v 1.13 2014/10/18 19:31:56 smirnovd Exp $
2 //
3 // $Log: StSsdBarrel.hh,v $
4 // Revision 1.13 2014/10/18 19:31:56 smirnovd
5 // Revert "1st commit" asked by Jonathan
6 //
7 // Revision 1.11 2012/06/11 14:58:24 fisyak
8 // std namespace
9 //
10 // Revision 1.10 2009/10/29 18:34:25 fine
11 // Fix FindMcHit signature
12 //
13 // Revision 1.9 2008/10/20 19:30:37 bouchet
14 // add methods for the calculation of quality
15 //
16 // Revision 1.8 2008/05/07 22:48:36 bouchet
17 // calculation of quality of hits used embedding
18 //
19 // Revision 1.7 2008/04/12 14:22:36 bouchet
20 // Add a method to fill with constant noise and pedestal
21 //
22 // Revision 1.6 2008/01/11 10:40:38 bouchet
23 // Use of the wafer configuration table
24 //
25 // Revision 1.5 2007/07/14 13:53:45 bouchet
26 // add default pedestal/noise ; noise value is 60/16 = 3.75 adc
27 //
28 // Revision 1.4 2007/07/12 17:08:08 bouchet
29 // add method to decode new ssdNoise Table
30 //
31 // Revision 1.3 2007/03/27 23:11:48 bouchet
32 // Add a method to use the gain calibration for the Charge Matching between pulse of p and n sides
33 //
34 // Revision 1.2 2007/03/21 17:20:41 fisyak
35 // use TGeoHMatrix for coordinate transformation
36 //
37 // Revision 1.1 2006/10/16 16:43:29 bouchet
38 // StSsdUtil regroups now methods for the classes StSsdStrip, StSsdCluster and StSsdPoint
39 //
40 // Revision 1.8 2006/09/15 21:03:14 bouchet
41 // id_mctrack is using for setIdTruth and propagated to the hit
42 //
43 // Revision 1.7 2005/04/23 08:56:20 lmartin
44 // physics and pedestal data processing separated
45 //
46 // Revision 1.6 2005/03/22 13:45:01 lmartin
47 // new member mActiveLadders added
48 //
49 // Revision 1.5 2005/03/18 14:04:06 lmartin
50 // missing CVS header added
51 //
52 
53 #ifndef STSSDBARREL_HH
54 #define STSSDBARREL_HH
55 
56 #include "StSsdUtil/StSsdWafer.hh"
57 #include "StSsdUtil/StSsdLadder.hh"
58 
59 class TFile;
60 class ssdDimensions_st;
61 class ssdConfiguration_st;
62 class ssdWafersPosition_st;
63 class slsCtrl_st;
64 class St_sls_strip;
65 class St_spa_strip;
66 class St_ssdWafersPosition;
67 class St_ssdStripCalib;
68 class St_ssdPedStrip;
69 class St_spa_strip;
70 class St_sdm_calib_db;
71 class St_sdm_condition_db;
72 class St_scf_cluster;
73 class St_scm_spt;
74 class St_ssdStripCalib;
77 class StSsdHitCollection;
78 class St_ssdGainCalibWafer;
79 class St_ssdNoise;
80 
81 class St_ssdWaferConfiguration;
82 class StMcEvent;
84 class StMcSsdHit;
85 #include <vector>
86 
88 {
89  public:
90  StSsdBarrel(ssdDimensions_st *dimensions, ssdConfiguration_st *config=0);
91  ~StSsdBarrel();
92 
93  StSsdBarrel(const StSsdBarrel & originalBarrel);
94  StSsdBarrel& operator=(const StSsdBarrel originalBarrel);
95 
96  void initLadders(St_ssdWafersPosition *wafpos);
97 
98  // Int_t readDeadStripFromTable(table_head_st *condition_db_h, sdm_condition_db_st *condition_db);
99  void addNoiseToStrip(slsCtrl_st* ctrl); //
100  Int_t readStripFromTable(St_spa_strip *spa_strip);
101  Int_t readStripFromTable(St_sls_strip *sls_strip); //
102  Int_t readNoiseFromTable(St_sdm_calib_db *spa_noise, StSsdDynamicControl *dynamicControl);
103  Int_t readNoiseFromTable(St_ssdStripCalib *strip_noise, StSsdDynamicControl *dynamicControl);
104  Int_t readNoiseFromTable(St_ssdStripCalib *noise); //
105  Int_t readNoiseFromTable(St_ssdNoise *strip_noise, StSsdDynamicControl *dynamicControl);
106  Int_t readNoiseDefault(StSsdDynamicControl *dynamicControl);
107  Int_t readNoiseDefaultForSimu();
108  Int_t readConditionDbFromTable(St_sdm_condition_db *condition);//
109  Int_t writeNoiseToFile(St_spa_strip *spa_strip);
110  Int_t writeNoiseToFile(St_ssdPedStrip *pedStrip, char myLabel[]);
111  Int_t readClusterFromTable(St_scf_cluster *scf_cluster);
112  Int_t writeClusterToTable(St_scf_cluster *cluster);
113  Int_t writeClusterToTable(St_scf_cluster *scf_cluster,St_spa_strip *spa_strip);
114  Int_t writePointToContainer(St_scm_spt *scm_spt,StSsdHitCollection *ssdHitColl);
115  Int_t writePointToContainer(St_scm_spt *scm_spt, StSsdHitCollection* ssdHitColl,St_scf_cluster *scf_cluster);
116  Int_t writePointToContainer(St_scm_spt *scm_spt, StSsdHitCollection* ssdHitColl,St_scf_cluster *scf_cluster,St_spa_strip *spa_strip,StSsdDynamicControl *dynamicControl,StMcEvent *mcEvent);
117  Int_t writeStripToTable(St_spa_strip * spa_strip); //
118  Int_t writeStripToTable(St_spa_strip * spa_strip,St_sls_strip *sls_strip); //
119  Int_t writeNewNoiseToFile3(St_ssdPedStrip *pedStrip, char myLabel[]);
120  void doSideClusterisation(Int_t *numberOfCluster);
121  void doSideClusterisation(Int_t *numberOfCluster,Int_t WafStatus[20][16]);
122  Int_t doClusterMatching(Float_t CalibArray[320]);
123  void doDaqSimulation(slsCtrl_st* ctrl); //
124  void convertDigitToAnalog(StSsdDynamicControl *dynamicControl);
125  void convertGlobalFrameToOther();
126  void convertUFrameToOther();
127  void convertToStrip(Double_t pairCreationEnergy,
128  Int_t nstripInACluster,
129  Double_t parDiffP,
130  Double_t parDiffN,
131  Double_t parIndRightP,
132  Double_t parIndRightN,
133  Double_t parIndLeftP,
134  Double_t parIndLeftN
135  );
136  void sortListStrip();
137  void sortListCluster();
138  Int_t getNumberOfLadders() { return mNLadder;}
139  Int_t getNWaferPerLadder() { return mNWaferPerLadder;}
140  Int_t getSsdLayer() { return mSsdLayer;};
141  void Calculation_Ratio(int idWafer,int idClusterP,int idClusterN,std::vector<const StMcSsdHit*> hitCol, int *ratio, int *idTruth);
142  static Int_t FindMcHit(const std::vector<int> &id,const std::vector<const StMcSsdHit*> &hitCol);
143  Int_t isSplit(StSsdCluster *currentCluster,int iSide,int lad,int waf);
144  StSsdLadder *getLadder(Int_t i=0) {return mLadders[i];}
145  ssdDimensions_st *getDimensions() {return mDimensions;}
146  StSsdClusterControl *getClusterControl() {return mClusterControl;}
147  Int_t isActiveLadder(Int_t i);
148  void debugUnPeu(Int_t monLadder, Int_t monwafer);
149  void setSsdParameters(ssdDimensions_st *geom_par);
150  void setLorentzShift(ssdDimensions_st *geom_par);
151  void setClusterControl(StSsdClusterControl *clusterControl) {mClusterControl = clusterControl;}
152  void initWafers(St_ssdWafersPosition *geom_class) {initLadders(geom_class);}
153  void renumHitAfterRemove();
154 
155  Int_t idWaferToWaferNumb(Int_t idWafer); // idwafer = layer*1000+waf*100+ladder => waferNumb = mNWaferPerLadder*(ladder-1) + waf - 1
156  Int_t idWaferToLadderNumb(Int_t idWafer);// idwafer => ladder-1
157  Int_t waferNumbToIdWafer(Int_t waferNumb);// waferNumb = mNWaferPerLadder*(ladder-1) + waf - 1 => idwafer
158  Int_t idWaferToWafer(Int_t idWafer) {return (idWafer-7000)/100-1;}
159  StSsdPointList *getInactiveHitList();
160  void Reset();
161  void SetDebug(Int_t k = 0) {mDebug = k;}
162  Int_t Debug() {return mDebug;}
163  private:
164  Char_t first[1];
165  public:
166  StSsdLadder** mLadders;
167  static StSsdBarrel* Instance() {return fSsdBarrel;}
168  private:
169  Int_t mSsdLayer;
170  Int_t mNLadder;
171  Int_t mNWaferPerLadder;
172  Int_t mNStripPerSide;
173  Int_t mActiveLadders[20];
174  Float_t mDetectorLargeEdge;
175  Float_t mDetectorSmallEdge;
176  Float_t mStripPitch;
177  Float_t mTheta;
178  Float_t mShift_hole;
179  Float_t mShift_elec;
180  ssdDimensions_st *mDimensions;
181  StSsdClusterControl *mClusterControl;
182  Int_t mDebug;
183  Char_t last[1];
184  static StSsdBarrel* fSsdBarrel;
185 };
186 #endif
StSsdBarrel(ssdDimensions_st *dimensions, ssdConfiguration_st *config=0)
Definition: StSsdBarrel.cc:164
Int_t readNoiseFromTable(St_sdm_calib_db *spa_noise, StSsdDynamicControl *dynamicControl)
Definition: StSsdBarrel.cc:345
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169