Changeset 3547 for trunk/MagicSoft/Mars
- Timestamp:
- 03/18/04 17:17:41 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3546 r3547 46 46 - new TArrayF fMinRadius of each pixel area type 47 47 - backward compatibility should be given, 48 call to GetMaxRadius() return fMaxRadius.At(fNumAreas-1)48 call to GetMaxRadius() returns the value for the whole camera 49 49 (which corresponds to the previous value for the Magic camera) 50 50 -
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r3545 r3547 196 196 { 197 197 198 fMaxRadius.Set(fNumAreas );199 fMinRadius.Set(fNumAreas );200 201 for (Int_t i=0; i<fNumAreas ; i++)202 { 203 fMaxRadius .AddAt(0.,i);204 fMinRadius .AddAt(3.3e38,i);198 fMaxRadius.Set(fNumAreas+1); 199 fMinRadius.Set(fNumAreas+1); 200 201 for (Int_t i=0; i<fNumAreas+1; i++) 202 { 203 fMaxRadius[i] = 0.; 204 fMinRadius[i] = FLT_MAX; 205 205 } 206 206 … … 214 214 const Float_t y = pix.GetY(); 215 215 const Float_t d = pix.GetD(); 216 const Float_t r = sqrt(x*x+y*y); 216 217 const Float_t r = TMath::Hypot(x, y); 217 218 218 219 const Float_t maxr = r + d; 219 const Float_t minr = r ;220 const Float_t minr = r>d ? r-d : 0; 220 221 221 if (maxr>fMaxRadius.At(s)) 222 fMaxRadius.AddAt(maxr,s); 223 if (minr<fMinRadius.At(s)) 224 fMinRadius.AddAt(minr,s); 225 } 226 227 } 222 if (maxr>fMaxRadius[s+1]) 223 fMaxRadius[s+1] = maxr; 224 225 if (minr<fMinRadius[s+1]) 226 fMinRadius[s+1] = minr; 227 228 if (minr<fMinRadius[0]) 229 fMinRadius[0] = minr; 230 231 if (maxr>fMaxRadius[0]) 232 fMaxRadius[0] = maxr; 233 234 } 235 } 236 237 // 238 // Have to call the radii of the subcameras starting to count from 1 239 // 240 Float_t MGeomCam::GetMaxRadius(const Int_t i) const 241 { 242 if (i==-1) return fMaxRadius[0]; 243 return i>fNumAreas ? -1 : fMaxRadius[i+1]; 244 } 245 246 // 247 // Have to call the radii of the subcameras starting to count from 1 248 // 249 Float_t MGeomCam::GetMinRadius(const Int_t i) const 250 { 251 if (i==-1) return fMinRadius[0]; 252 return i>fNumAreas ? -1 : fMinRadius[i+1]; 253 } 254 228 255 229 256 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r3545 r3547 64 64 UInt_t GetNumPixels() const { return fNumPixels; } 65 65 66 Float_t GetMaxRadius(const Int_t i=-1) const { if (i >= fNumAreas) return -1.; 67 else if (i==-1) return fMaxRadius.At(fNumAreas-1); 68 else return fMaxRadius.At(i); } 69 Float_t GetMinRadius(const Int_t i=-1) const { if (i >= fNumAreas) return -1.; 70 else if (i==-1) return fMinRadius.At(0); 71 else return fMinRadius.At(i); } 72 66 Float_t GetMaxRadius(const Int_t i=-1) const; 67 Float_t GetMinRadius(const Int_t i=-1) const; 68 73 69 UInt_t GetNumSectors() const { return fNumSectors; } 74 70 UInt_t GetNumAreas() const { return fNumAreas; }
Note:
See TracChangeset
for help on using the changeset viewer.