Changeset 3545


Ignore:
Timestamp:
03/18/04 13:49:16 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3544 r3545  
    3636     - fill Ra/Dec into MPointingPos
    3737
    38 
    39 
    4038 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 
    4147
    4248   * mimage/MConcentration.cc
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.cc

    r3392 r3545  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
    19 !   Author(s): Harald Kornmayer 1/2001
    20 !
    21 !   Copyright: MAGIC Software Development, 2000-2002
    22 !
     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
    2323!
    2424\* ======================================================================== */
     
    6868//
    6969MGeomCam::MGeomCam()
    70     : fNumPixels(0), fCamDist(0), fConvMm2Deg(0)
     70    : fNumPixels(0), fCamDist(0), fConvMm2Deg(0), fMaxRadius(1), fMinRadius(1)
    7171{
    7272    fName  = "MGeomCam";
     
    8080//
    8181MGeomCam::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)
    8384{
    8485    fName  = name  ? name  : "MGeomCam";
     
    159160    for (UInt_t i=0; i<fNumPixels; i++)
    160161    {
    161         const UInt_t s = (*this)[i].GetSector();
     162        const Int_t s = (*this)[i].GetSector();
    162163
    163164        if (s>fNumSectors)
     
    179180    for (UInt_t i=0; i<fNumPixels; i++)
    180181    {
    181         const UInt_t s = (*this)[i].GetAidx();
     182        const Int_t s = (*this)[i].GetAidx();
    182183
    183184        if (s>fNumAreas)
     
    194195void MGeomCam::CalcMaxRadius()
    195196{
    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
    211227}
    212228
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.h

    r3392 r3545  
    1818private:
    1919    UInt_t    fNumPixels;    // Number of pixels in this camera
    20     Float_t   fMaxRadius;    // maximum radius of the camera (eg. for GUI layout)
    2120
    2221    Float_t   fCamDist;      // [m] Average distance of the camera from the mirror
     
    2524    TObjArray fPixels;       // Array of singel pixels storing the geometry
    2625
     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)   
    2728    TArrayF   fPixRatio;     // Array storing the ratio between size of pixel 0 and pixel idx (for speed reasons)
    2829    TArrayF   fPixRatioSqrt; // Array storing the square root ratio between size of pixel 0 and pixel idx (for speed reasons)
    2930
    30     UInt_t    fNumSectors;   // Number of sectors
    31     UInt_t    fNumAreas;     // Number of different pixel sizes
     31    Int_t     fNumSectors;   // Number of sectors
     32    Int_t     fNumAreas;     // Number of different pixel sizes
    3233
    3334protected:
     35
    3436    void CalcMaxRadius();
    3537    void CalcNumSectors();
     
    6062    Float_t GetConvMm2Deg() const { return fConvMm2Deg; }
    6163
    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;
    6877
    6978    MGeomPix &operator[](Int_t i);
    70     MGeomPix &operator[](Int_t i) const;
     79    MGeomPix &operator[](Int_t i)          const;
    7180
    72     virtual void Print(Option_t *opt=NULL) const;
     81    virtual void Print(Option_t *opt=NULL)   const;
    7382
    7483    ClassDef(MGeomCam, 3)  // Geometry base class for the camera
Note: See TracChangeset for help on using the changeset viewer.