StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StSstBarrel.hh
1 //$Id: StSstBarrel.hh,v 1.3 2016/06/08 20:53:01 bouchet Exp $
2 //
3 //$Log: StSstBarrel.hh,v $
4 //Revision 1.3 2016/06/08 20:53:01 bouchet
5 //coverity : PASS_BY_VALUE
6 //
7 //Revision 1.2 2015/06/27 19:48:51 bouchet
8 //removed obsolete libraries : ssdConfiguration, ssdDimensions, ssdWafersPosition ; fixed static StSstBarrel name
9 //
10 //Revision 1.1 2015/06/23 16:26:19 jeromel
11 //First version created from the SSD code and reshaped
12 //
13 //Revision 1.6 2015/06/19 14:16:24 bouchet
14 //readNoiseFromTable() takes sstStripCalib data as input, not the structure
15 //
16 //Revision 1.5 2015/05/23 20:52:08 bouchet
17 //ADC hits set properly in writePointToContainer()
18 //
19 //Revision 1.4 2015/04/21 18:26:08 bouchet
20 //typos between SSD and SST name fixed
21 //
22 //Revision 1.3 2015/04/20 20:09:20 bouchet
23 //added readNoiseFromTable() method using sstStripCalib table ; added includes for sstStripCalib and sstWafersPosition
24 //
25 //Revision 1.2 2015/04/20 19:01:25 bouchet
26 //removed some hard coded constants ; removed unused writePointToContainer() method
27 //
28 //Revision 1.1 2015/04/19 17:30:31 bouchet
29 //initial commit ; SST codes
30 //
31 
32 //fork from the SSD code, move along - see history therein
33 
34 #ifndef STSSTBARREL_HH
35 #define STSSTBARREL_HH
36 
37 #include "StSstUtil/StSstWafer.hh"
38 #include "StSstUtil/StSstLadder.hh"
39 
40 class TFile;
41 //20150406
42 class sstDimensions_st;
43 class sstConfiguration_st;
44 class sstWafersPosition_st;
45 class sstSlsCtrl_st;
46 class sstStripCalib_st;
47 class slsCtrl_st;
48 class St_sls_strip;
49 class St_spa_strip;
50 class St_ssdWafersPosition;
51 class St_sstWafersPosition;
52 class St_sstStripCalib;
53 class St_ssdStripCalib;
54 class St_ssdPedStrip;
55 class St_spa_strip;
56 class St_sdm_calib_db;
57 class St_sdm_condition_db;
58 class St_scf_cluster;
59 class St_scm_spt;
60 class St_ssdStripCalib;
63 class StSstHitCollection;
64 class St_ssdGainCalibWafer;
65 class St_ssdNoise;
66 class St_ssdWaferConfiguration;
67 //new
68 class St_sstGainCalibWafer;
69 class St_sstNoise;
70 class St_sstWaferConfiguration;
71 class StMcEvent;
73 class StMcSsdHit;
74 #include <vector>
75 
77 {
78  public:
79  StSstBarrel(sstDimensions_st *dimensions, sstConfiguration_st *config=0);
80  ~StSstBarrel();
81 
82  StSstBarrel(const StSstBarrel & originalBarrel);
83  StSstBarrel& operator=(const StSstBarrel & originalBarrel);
84 
85  void initLadders(St_sstWafersPosition *wafpos);
86 
87  // Int_t readDeadStripFromTable(table_head_st *condition_db_h, sdm_condition_db_st *condition_db);
88  void addNoiseToStrip(slsCtrl_st* ctrl); //
89  Int_t readStripFromTable(St_spa_strip *spa_strip);
90  Int_t readStripFromTable(St_sls_strip *sls_strip); //
91  Int_t readNoiseFromTable(St_sdm_calib_db *spa_noise, StSstDynamicControl *dynamicControl);
92  Int_t readNoiseFromTable(St_ssdStripCalib *strip_noise, StSstDynamicControl *dynamicControl);
93  Int_t readNoiseFromTable(St_ssdStripCalib *noise); //
94  Int_t readNoiseFromTable(St_ssdNoise *strip_noise, StSstDynamicControl *dynamicControl);
95  Int_t readNoiseFromTable(sstStripCalib_st *noise, StSstDynamicControl *dynamicControl);
96  Int_t readNoiseDefault(StSstDynamicControl *dynamicControl);
97  Int_t readNoiseDefaultForSimu();
98  Int_t readConditionDbFromTable(St_sdm_condition_db *condition);//
99  Int_t writeNoiseToFile(St_spa_strip *spa_strip);
100  Int_t writeNoiseToFile(St_ssdPedStrip *pedStrip, char myLabel[]);
101  Int_t readClusterFromTable(St_scf_cluster *scf_cluster);
102  Int_t writeClusterToTable(St_scf_cluster *cluster);
103  Int_t writeClusterToTable(St_scf_cluster *scf_cluster,St_spa_strip *spa_strip);
104  Int_t writePointToContainer(St_scm_spt *scm_spt, StSstHitCollection* sstHitColl,St_scf_cluster *scf_cluster,StSstDynamicControl *dynamicControl);
105  Int_t writePointToContainer(St_scm_spt *scm_spt, StSstHitCollection* sstHitColl,St_scf_cluster *scf_cluster,StSstDynamicControl *dynamicControl,StMcEvent *mcEvent);
106  Int_t writeStripToTable(St_spa_strip * spa_strip); //
107  Int_t writeStripToTable(St_spa_strip * spa_strip,St_sls_strip *sls_strip); //
108  Int_t writeNewNoiseToFile3(St_ssdPedStrip *pedStrip, char myLabel[]);
109  void doSideClusterisation(Int_t *numberOfCluster);
110  void doSideClusterisation(Int_t *numberOfCluster,Int_t WafStatus[20][16]);
111  Int_t doClusterMatching(Float_t CalibArray[320]);
112  void doDaqSimulation(slsCtrl_st* ctrl); //
113  void convertDigitToAnalog(StSstDynamicControl *dynamicControl);
114  void convertGlobalFrameToOther();
115  void convertUFrameToOther();
116  void convertToStrip(Double_t pairCreationEnergy,
117  Int_t nstripInACluster,
118  Double_t parDiffP,
119  Double_t parDiffN,
120  Double_t parIndRightP,
121  Double_t parIndRightN,
122  Double_t parIndLeftP,
123  Double_t parIndLeftN
124  );
125  void sortListStrip();
126  void sortListCluster();
127  Int_t getNumberOfLadders() { return mNLadder;}
128  Int_t getNWaferPerLadder() { return mNWaferPerLadder;}
129  Int_t getSstLayer() { return mSstLayer;};
130  void Calculation_Ratio(int idWafer,int idClusterP,int idClusterN,std::vector<const StMcSsdHit*> hitCol, int *ratio, int *idTruth);
131  static Int_t FindMcHit(const std::vector<int> &id,const std::vector<const StMcSsdHit*> &hitCol);
132  Int_t isSplit(StSstCluster *currentCluster,int iSide,int lad,int waf);
133  StSstLadder *getLadder(Int_t i=0) {return mLadders[i];}
134  sstDimensions_st *getDimensions() {return mDimensions;}
135  StSstClusterControl *getClusterControl() {return mClusterControl;}
136  Int_t isActiveLadder(Int_t i);
137  void debugUnPeu(Int_t monLadder, Int_t monwafer);
138  void setSstParameters(sstDimensions_st *geom_par);
139  void setLorentzShift(sstDimensions_st *geom_par);
140  void setClusterControl(StSstClusterControl *clusterControl) {mClusterControl = clusterControl;}
141  void initWafers(St_sstWafersPosition *geom_class) {initLadders(geom_class);}
142  void renumHitAfterRemove();
143 
144  Int_t idWaferToWaferNumb(Int_t idWafer); // idwafer = layer*1000+waf*100+ladder => waferNumb = mNWaferPerLadder*(ladder-1) + waf - 1
145  Int_t idWaferToLadderNumb(Int_t idWafer);// idwafer => ladder-1
146  Int_t waferNumbToIdWafer(Int_t waferNumb);// waferNumb = mNWaferPerLadder*(ladder-1) + waf - 1 => idwafer
147  Int_t idWaferToWafer(Int_t idWafer) {return (idWafer-7000)/100-1;}
148  StSstPointList *getInactiveHitList();
149  void Reset();
150  void SetDebug(Int_t k = 0) {mDebug = k;}
151  Int_t Debug() {return mDebug;}
152  private:
153  Char_t first[1];
154  public:
155  StSstLadder** mLadders;
156  static StSstBarrel* Instance() {return fSstBarrel;}
157  private:
158  Int_t mSstLayer;
159  Int_t mNLadder;
160  Int_t mNWaferPerLadder;
161  Int_t mNStripPerSide;
162  Int_t mActiveLadders[20];
163  Float_t mDetectorLargeEdge;
164  Float_t mDetectorSmallEdge;
165  Float_t mStripPitch;
166  Float_t mTheta;
167  Float_t mShift_hole;
168  Float_t mShift_elec;
169  sstDimensions_st *mDimensions;
170  StSstClusterControl *mClusterControl;
171  Int_t mDebug;
172  Char_t last[1];
173  static StSstBarrel* fSstBarrel;
174 };
175 #endif
StSstBarrel(sstDimensions_st *dimensions, sstConfiguration_st *config=0)
Definition: StSstBarrel.cc:107
Int_t readNoiseFromTable(St_sdm_calib_db *spa_noise, StSstDynamicControl *dynamicControl)
Definition: StSstBarrel.cc:286
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169