Changeset 3545
- Timestamp:
- 03/18/04 13:49:16 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3544 r3545 36 36 - fill Ra/Dec into MPointingPos 37 37 38 39 40 38 2004/03/18: Markus Gaug 39 40 * mgeom/MGeomCam.[h,cc] 41 - replace fMaxRadius by a TArrayF of pixel area types 42 - new TArrayF fMinRadius of each pixel area type 43 - backward compatibility should be given, 44 call to GetMaxRadius() return fMaxRadius.At(fNumAreas-1) 45 (which corresponds to the previous value for the Magic camera) 46 41 47 42 48 * mimage/MConcentration.cc -
trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
r3392 r3545 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>19 ! Author(s): Harald Kornmayer1/200120 ! 21 ! Copyright: MAGIC Software Development, 2000-200222 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de> 19 ! Harald Kornmayer 01/2001 20 ! Markus Gaug 03/2004 <mailto:markus@ifae.es> 21 ! 22 ! Copyright: MAGIC Software Development, 2000-2004 23 23 ! 24 24 \* ======================================================================== */ … … 68 68 // 69 69 MGeomCam::MGeomCam() 70 : fNumPixels(0), fCamDist(0), fConvMm2Deg(0) 70 : fNumPixels(0), fCamDist(0), fConvMm2Deg(0), fMaxRadius(1), fMinRadius(1) 71 71 { 72 72 fName = "MGeomCam"; … … 80 80 // 81 81 MGeomCam::MGeomCam(UInt_t npix, Float_t dist, const char *name, const char *title) 82 : fNumPixels(npix), fCamDist(dist), fConvMm2Deg(kRad2Deg/(dist*1000)), fPixels(npix), fPixRatio(npix), fPixRatioSqrt(npix) 82 : fNumPixels(npix), fCamDist(dist), fConvMm2Deg(kRad2Deg/(dist*1000)), 83 fPixels(npix), fMaxRadius(1), fMinRadius(1), fPixRatio(npix), fPixRatioSqrt(npix) 83 84 { 84 85 fName = name ? name : "MGeomCam"; … … 159 160 for (UInt_t i=0; i<fNumPixels; i++) 160 161 { 161 const UInt_t s = (*this)[i].GetSector();162 const Int_t s = (*this)[i].GetSector(); 162 163 163 164 if (s>fNumSectors) … … 179 180 for (UInt_t i=0; i<fNumPixels; i++) 180 181 { 181 const UInt_t s = (*this)[i].GetAidx();182 const Int_t s = (*this)[i].GetAidx(); 182 183 183 184 if (s>fNumAreas) … … 194 195 void MGeomCam::CalcMaxRadius() 195 196 { 196 fMaxRadius = 0; 197 198 for (UInt_t i=0; i<fNumPixels; i++) 199 { 200 const MGeomPix &pix = (*this)[i]; 201 202 const Float_t x = pix.GetX(); 203 const Float_t y = pix.GetY(); 204 const Float_t d = pix.GetD(); 205 206 const Float_t maxr = sqrt(x*x+y*y) + d; 207 208 if (maxr>fMaxRadius) 209 fMaxRadius = maxr; 210 } 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); 205 } 206 207 for (UInt_t i=0; i<fNumPixels; i++) 208 { 209 210 const MGeomPix &pix = (*this)[i]; 211 212 const UInt_t s = pix.GetAidx(); 213 const Float_t x = pix.GetX(); 214 const Float_t y = pix.GetY(); 215 const Float_t d = pix.GetD(); 216 const Float_t r = sqrt(x*x+y*y); 217 218 const Float_t maxr = r + d; 219 const Float_t minr = r; 220 221 if (maxr>fMaxRadius.At(s)) 222 fMaxRadius.AddAt(maxr,s); 223 if (minr<fMinRadius.At(s)) 224 fMinRadius.AddAt(minr,s); 225 } 226 211 227 } 212 228 -
trunk/MagicSoft/Mars/mgeom/MGeomCam.h
r3392 r3545 18 18 private: 19 19 UInt_t fNumPixels; // Number of pixels in this camera 20 Float_t fMaxRadius; // maximum radius of the camera (eg. for GUI layout)21 20 22 21 Float_t fCamDist; // [m] Average distance of the camera from the mirror … … 25 24 TObjArray fPixels; // Array of singel pixels storing the geometry 26 25 26 TArrayF fMaxRadius; // maximum radius of the part of the camera with the same pixel size (eg. for GUI layout) 27 TArrayF fMinRadius; // minimum radius of the part of the camera with the same pixel size (eg. for GUI layout) 27 28 TArrayF fPixRatio; // Array storing the ratio between size of pixel 0 and pixel idx (for speed reasons) 28 29 TArrayF fPixRatioSqrt; // Array storing the square root ratio between size of pixel 0 and pixel idx (for speed reasons) 29 30 30 UInt_tfNumSectors; // Number of sectors31 UInt_tfNumAreas; // Number of different pixel sizes31 Int_t fNumSectors; // Number of sectors 32 Int_t fNumAreas; // Number of different pixel sizes 32 33 33 34 protected: 35 34 36 void CalcMaxRadius(); 35 37 void CalcNumSectors(); … … 60 62 Float_t GetConvMm2Deg() const { return fConvMm2Deg; } 61 63 62 UInt_t GetNumPixels() const { return fNumPixels; } 63 Float_t GetMaxRadius() const { return fMaxRadius; } 64 UInt_t GetNumSectors() const { return fNumSectors; } 65 UInt_t GetNumAreas() const { return fNumAreas; } 66 Float_t GetPixRatio(UInt_t i) const; 67 Float_t GetPixRatioSqrt(UInt_t i) const; 64 UInt_t GetNumPixels() const { return fNumPixels; } 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 73 UInt_t GetNumSectors() const { return fNumSectors; } 74 UInt_t GetNumAreas() const { return fNumAreas; } 75 Float_t GetPixRatio(UInt_t i) const; 76 Float_t GetPixRatioSqrt(UInt_t i) const; 68 77 69 78 MGeomPix &operator[](Int_t i); 70 MGeomPix &operator[](Int_t i) const;79 MGeomPix &operator[](Int_t i) const; 71 80 72 virtual void Print(Option_t *opt=NULL) const;81 virtual void Print(Option_t *opt=NULL) const; 73 82 74 83 ClassDef(MGeomCam, 3) // Geometry base class for the camera
Note:
See TracChangeset
for help on using the changeset viewer.