13 printf(
"inFGT geom\n");
23 StFgtGeom::initialize() {
26 double zDisk[kFgtMxDisk+1]={69.08, 79.08, 89.08, 99.08, 109.08, 119.08, 168.68, 218.68, 66.98};
27 for(
int i=0;i<kFgtMxDisk+1;i++)mDiskZ[i]=zDisk[i];
35 mRadStripOff = ((Rout()-Rin())/radStrip_pitch() -
36 int( (Rout()-Rin())/radStrip_pitch())) * radStrip_pitch();
38 mRadStripLOCId_number = int ((Rout()-Rin()-radStripOff())/radStrip_pitch()) + 5;
40 mPhiStripOff = (halfpi/phiStrip_pitch() -
41 int( halfpi/phiStrip_pitch())) * phiStrip_pitch();
42 mPhiStripLOCId_number = int ((halfpi-phiStripOff())/phiStrip_pitch()) + 5;
44 mRadStripGBLId_number = kFgtMxQuad * radStripLOCId_number();
45 mPhiStripGBLId_number = kFgtMxQuad * phiStripLOCId_number();
52 StFgtGeom::inDisk(TVector3 r){
54 if(Rxy<Rin())
return false;
55 if(Rxy>Rout())
return false;
56 if(fabs(r.y())>yLimit())
return false;
63 StFgtGeom::getQuad(
double phiLab){
67 if(phiLab>phiQuadXaxis(0) && phiLab<=phiQuadXaxis(1))
return 0;
68 if(phiLab>phiQuadXaxis(1) && phiLab<=phiQuadXaxis(2))
return 1;
69 if(phiLab>phiQuadXaxis(3) && phiLab<=phiQuadXaxis(0))
return 3;
76 StFgtGeom::phiQuadXaxis(
int iquad) {
85 case 0:
return -15.0*pi/180.0;
86 case 1:
return 75.0*pi/180.0;
87 case 2:
return 165.0*pi/180.0;
88 case 3:
return -105.0*pi/180.0;
97 StFgtGeom::localXYtoStripID(
int iquad,
double xLoc,
double yLoc,
int &iRadID,
int &iPhiID,
int dbg){
100 int locRadID, locPhiID;
101 double r=sqrt(xLoc*xLoc+yLoc*yLoc);
103 if(r< Rin() )
return false;
104 if(r> Rout() )
return false;
107 double phiLoc=atan2(yLoc,xLoc);
110 double radBinFrac,phiBinFrac;
111 locRadID=rad2LocalStripId(r,&radBinFrac);
112 locPhiID=phiLoc2LocalStripId(phiLoc,&phiBinFrac);
114 iRadID = radIdLocal2Global(iquad, locRadID);
115 iPhiID = phiIdLocal2Global(iquad, locPhiID);
118 printf(
"strip: yLoc=%f xLoc=%f phi=%f, lradID=%d, lphiID=%d\n",yLoc,xLoc,phiLoc*57.3,locRadID,locPhiID);
119 printf(
"strip: radID=%d +(%.2f) phiID=%d +(%.2f)\n",iRadID,radBinFrac, iPhiID,phiBinFrac);
127 StFgtGeom::stripID2Rxy(
double fRadBin){
129 int iRadId = (int)fRadBin;
130 if (iRadId < 0)
return -1;
131 double eps=fRadBin-iRadId;
132 int localId = radIdGlobal2Local(iRadId);
133 double pos = Rout()-(localId + eps)*radStrip_pitch();
141 StFgtGeom::stripID2PhiLoc(
double fPhiBin){
143 int iPhiId = (int)fPhiBin;
144 if (iPhiId < 0)
return -999.0;
145 double eps=fPhiBin-iPhiId;
146 int localId = phiIdGlobal2Local(iPhiId);
147 double phiLocal = (localId+eps)*phiStrip_pitch();
155 StFgtGeom::stripID2PhiLab(
double fPhiBin){
158 double phiLocal = stripID2PhiLoc(fPhiBin);
159 int iPhiId = (int)fPhiBin;
160 int iquad = iPhiId/phiStripLOCId_number();
163 phiLab = (phiLocal != -999.0)?
166 phiLocal + phiQuadXaxis(iquad): phiLocal;
174 StFgtGeom::printParam(){
175 cout <<
" Parementers of StFgtGeom" << endl;
176 cout <<
" -------------------------" << endl;
177 cout <<
"\tRout, Rmid, Rin = " << Rout() <<
" cm, " << Rmid() <<
" cm, "
178 << Rin() <<
" cm" << endl;
179 cout <<
"\tRad/Phi Strip pitch = " << radStrip_pitch() <<
" cm, "
180 << kFgtPhiPitch <<
" cm" << endl;
181 cout <<
"\tOffset of Rad/Phi = " << radStripOff() <<
" cm, "
182 << phiStripOff()*Rout() <<
" cm"<< endl;
183 cout <<
"\tNumber of Rad/Phi Strip Ids = " << radStripLOCId_number() <<
" "
184 << phiStripLOCId_number() << endl;
185 cout <<
"\tZ0 - Z4 = " << mDiskZ[0] <<
" " << mDiskZ[1] <<
" "
186 << mDiskZ[2] <<
" " << mDiskZ[3] <<
" "
187 << mDiskZ[4] <<
" cm" << endl;
188 cout <<
"\tZ5 - Z8 = " << mDiskZ[5] <<
" " << mDiskZ[6] <<
" "
189 << mDiskZ[7] <<
" " << mDiskZ[8] <<
" cm" << endl;
197 StFgtGeom::rad2LocalStripId(
double rad,
double *binFrac){
200 double ratio=(Rout()-rad)/radStrip_pitch();
201 int irad=(int) ratio;
202 if(binFrac) *binFrac=ratio-irad;
203 if(irad >= 0 && irad < radStripLOCId_number())
212 StFgtGeom::phiLoc2LocalStripId(
double phiLoc,
double *binFrac){
215 double ratio=phiLoc/phiStrip_pitch();
216 int iphi=(int) ratio;
217 if(binFrac) *binFrac=ratio-iphi;
218 if(iphi >=0 && iphi < phiStripLOCId_number())
227 StFgtGeom::phiLab2LocalStripId(
int iquad,
double phiLab,
double *binFrac){
230 double phi=phiLab-phiQuadXaxis(iquad);
231 while(phi<0.) phi+=dpi;
232 while(phi>=dpi) phi-=dpi;
234 int iphi = phiLoc2LocalStripId(phi, &phiBinFrac);