23 #include "StSsdUtil/StSsdLadder.hh"
26 #include "tables/St_ssdWaferConfiguration_Table.h"
28 StSsdLadder::StSsdLadder(Int_t rLadderNumb,Int_t rSsdLayer,Int_t rNWaferPerLadder,Int_t rNStripPerSide) : mDebug(0)
32 memset (first, 0, last-first);
33 mLadderNumb = rLadderNumb;
34 mSsdLayer = rSsdLayer;
35 mNWaferPerLadder = rNWaferPerLadder;
36 mNStripPerSide = rNStripPerSide;
38 Int_t nWafer = mNWaferPerLadder;
42 for (Int_t iWaf=0; iWaf < nWafer; iWaf++)
44 idWaf = waferNumbToIdWafer(iWaf);
46 if (Debug()) mWafers[iWaf]->SetDebug(Debug());
50 StSsdLadder::~StSsdLadder()
52 for (Int_t iWaf = 0 ; iWaf < mNWaferPerLadder ; iWaf++)
56 void StSsdLadder::initWafers(St_ssdWafersPosition *Position)
60 ssdWafersPosition_st *position = Position->GetTable();
61 Int_t N = Position->GetNRows();
62 for (Int_t i = 0; i < N; i++)
64 idWafer = position[i].id;
65 iWaf = idWaferToWafer(idWafer);
66 if ((idWafer > mSsdLayer*1000)&&
67 (mLadderNumb == idWafer%100-1)){
68 mWafers[iWaf]->
init(idWafer, position[i].driftDirection, position[i].transverseDirection, position[i].normalDirection, position[i].centerPosition);}
72 void StSsdLadder::initWafers(St_ssdWafersPosition *Position,Int_t WafStatus[20][16])
76 ssdWafersPosition_st *position = Position->GetTable();
77 Int_t N = Position->GetNRows();
78 for (Int_t i = 0; i < N; i++)
80 idWafer = position[i].id;
81 iWaf = idWaferToWafer(idWafer);
82 if ((idWafer > mSsdLayer*1000)&&
83 (mLadderNumb == idWafer%100-1)){
84 if(WafStatus[mLadderNumb][iWaf]!=0){
85 printf(
"Ladder %d Wafer %d status %d\n",mLadderNumb,iWaf,WafStatus[mLadderNumb][iWaf]);
86 mWafers[iWaf]->
init(idWafer, position[i].driftDirection, position[i].transverseDirection, position[i].normalDirection, position[i].centerPosition);
92 void StSsdLadder::Reset(){
93 for (Int_t iWaf = 0; iWaf < mNWaferPerLadder; iWaf++)mWafers[iWaf]->Reset();
97 Int_t StSsdLadder::idWaferToWaferNumb(Int_t idWafer)
99 Int_t iW = (int)((idWafer - mSsdLayer*1000)/100);
103 Int_t StSsdLadder::waferNumbToIdWafer(Int_t waferNumb)
105 Int_t iL = mLadderNumb+1;
106 Int_t iW = waferNumb+1;
107 return mSsdLayer*1000 + iW*100 + iL;
110 void StSsdLadder::debugUnPeu(Int_t monwafer)
112 for (Int_t j=0;j<this->getWaferPerLadder();j++)
114 if (this->mWafers[j]->getIdWafer()==this->waferNumbToIdWafer(monwafer))
116 cout<<
" Wafer "<<monwafer<<
" found with id :"<<this->mWafers[j]->getIdWafer()<<endl;
117 this->mWafers[j]->debugStrips();
118 this->mWafers[j]->debugClusters();
void init(Int_t rId, Double_t *rD, Double_t *rT, Double_t *rN, Double_t *rX)