Changeset 9863 for trunk/Mars/mgeom/MGeomPix.cc
- Timestamp:
- 08/16/10 09:04:57 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/mgeom/MGeomPix.cc
r9385 r9863 209 209 } 210 210 211 // -------------------------------------------------------------------------- 212 // 213 // Calculate in the direction 0-5 (kind of sector) in the ring-th ring 214 // the x and y coordinate of the i-th pixel. The unitx are unity, 215 // distance to (0,0) is retruned. 216 // 217 Double_t MGeomPix::CalcXY(Int_t dir, Int_t ring, Int_t i, Double_t &x, Double_t &y) 218 { 219 switch (dir) 220 { 221 case kDirCenter: // Center 222 x = 0; 223 y = 0; 224 break; 225 226 case kDirNE: // Direction North East 227 x = ring-i*0.5; 228 y = i*gsSin60; 229 break; 230 231 case kDirN: // Direction North 232 x = ring*0.5-i; 233 y = ring*gsSin60; 234 break; 235 236 case kDirNW: // Direction North West 237 x = -(ring+i)*0.5; 238 y = (ring-i)*gsSin60; 239 break; 240 241 case kDirSW: // Direction South West 242 x = 0.5*i-ring; 243 y = -i*gsSin60; 244 break; 245 246 case kDirS: // Direction South 247 x = i-ring*0.5; 248 y = -ring*gsSin60; 249 break; 250 251 case kDirSE: // Direction South East 252 x = (ring+i)*0.5; 253 y = (-ring+i)*gsSin60; 254 break; 255 } 256 return x*x + y*y; 257 } 258 211 259 // ============================================================================== 212 260 /*
Note:
See TracChangeset
for help on using the changeset viewer.