Changeset 7360 for trunk/MagicSoft/Mars/mgeom
- Timestamp:
- 09/22/05 12:06:41 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/mgeom
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r7355 r7360 223 223 // -------------------------------------------------------------------------- 224 224 // 225 // sort neighbours from angle of -180 degree to -180 degree 226 // 227 // where right side of main pixel contains negative degrees 228 // and left side positive degrees 229 // 230 // angle measured from top (0 degree) to bottom (180 degree) 231 // ^ - | + // 232 // | _ | _ // 233 // | / \|/ \ // 234 // 30 degree -+- | | | // 235 // | / \ / \ / \ // 236 // 90 degree -+- | | X | | // 237 // | \ / \ / \ / // 238 // 150 degree -+- | | | // 239 // | \_/|\_/ // 240 // | | // 241 // | - | + // 242 // ------------------> // 243 // // 244 void MGeomCam::SortNeighbors() 245 { 246 for (unsigned int i=0; i<fNumPixels; i++) 247 { 248 MGeomPix &gpix = (*this)[i]; 249 250 Double_t phi[6]; 251 Int_t idx[7] = { 0, 0, 0, 0, 0, 0, -1 }; 252 253 const Int_t n2 = gpix.GetNumNeighbors(); 254 for (int j=0; j<n2; j++) 255 { 256 idx[j] = gpix.GetNeighbor(j); 257 phi[j] = (*this)[idx[j]].GetAngle(gpix); 258 } 259 260 Int_t sort[6] = { 6, 6, 6, 6, 6, 6 }; 261 262 TMath::Sort(n2, phi, sort, kFALSE); 263 264 gpix.SetNeighbors(idx[sort[0]], idx[sort[1]], idx[sort[2]], 265 idx[sort[3]], idx[sort[4]], idx[sort[5]]); 266 } 267 } 268 269 // -------------------------------------------------------------------------- 270 // 225 271 // Returns the distance between the pixels i and j. -1 if an index 226 272 // doesn't exist. The default for j is 0. Assuming that 0 is the index -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r7355 r7360 39 39 void CalcNumAreas(); 40 40 void InitOuterRing(); 41 void SortNeighbors(); 41 42 42 43 public: … … 56 57 CalcPixRatio(); 57 58 InitOuterRing(); 59 SortNeighbors(); 58 60 } 59 61
Note:
See TracChangeset
for help on using the changeset viewer.