26 #include "StSstUtil/StSstLadder.hh"
28 #include "tables/St_sstWaferConfiguration_Table.h"
30 StSstLadder::StSstLadder(Int_t rLadderNumb,Int_t rSstLayer,Int_t rNWaferPerLadder,Int_t rNStripPerSide) : mDebug(0)
34 memset (first, 0, last-first);
35 mLadderNumb = rLadderNumb;
36 mSstLayer = rSstLayer;
37 mNWaferPerLadder = rNWaferPerLadder;
38 mNStripPerSide = rNStripPerSide;
40 Int_t nWafer = mNWaferPerLadder;
44 for (Int_t iWaf=0; iWaf < nWafer; iWaf++)
46 idWaf = waferNumbToIdWafer(iWaf);
48 if (Debug()) mWafers[iWaf]->SetDebug(Debug());
52 StSstLadder::~StSstLadder(){
56 void StSstLadder::initWafers(St_sstWafersPosition *Position)
64 sstWafersPosition_st *position = Position->GetTable();
66 for (Int_t i = 0; i < N; i++){
69 idWafer = 7000 + (iWaf+1)*100 + (iLad)+1;
70 if (mLadderNumb == idWafer%100-1){
71 Double_t rr[3] = {position[0].driftDirection[i*3], position[0].driftDirection[i*3+1], position[0].driftDirection[i*3+2]};
72 Double_t nn[3] = {position[0].normalDirection[i*3], position[0].normalDirection[i*3+1], position[0].normalDirection[i*3+2]};
73 Double_t tr[3] = {position[0].transverseDirection[i*3], position[0].transverseDirection[i*3+1], position[0].transverseDirection[i*3+2]};
74 Double_t cr[3] = {position[0].centerPosition[i*3], position[0].centerPosition[i*3+1], position[0].centerPosition[i*3+2]};
75 mWafers[iWaf]->init(idWafer,rr,nn,tr,cr);
80 void StSstLadder::Reset(){
81 for (Int_t iWaf = 0; iWaf < mNWaferPerLadder; iWaf++)mWafers[iWaf]->Reset();
85 Int_t StSstLadder::idWaferToWaferNumb(Int_t idWafer)
87 Int_t iW = (int)((idWafer - mSstLayer*1000)/100);
91 Int_t StSstLadder::waferNumbToIdWafer(Int_t waferNumb)
93 Int_t iL = mLadderNumb+1;
94 Int_t iW = waferNumb+1;
95 return mSstLayer*1000 + iW*100 + iL;
98 void StSstLadder::debugUnPeu(Int_t monwafer)
100 for (Int_t j=0;j<this->getWaferPerLadder();j++)
102 if (this->mWafers[j]->getIdWafer()==this->waferNumbToIdWafer(monwafer))
104 cout<<
" Wafer "<<monwafer<<
" found with id :"<<this->mWafers[j]->getIdWafer()<<endl;
105 this->mWafers[j]->debugStrips();
106 this->mWafers[j]->debugClusters();