Ignore:
Timestamp:
06/26/03 16:21:57 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgeom
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.cc

    r2234 r2236  
    9797// --------------------------------------------------------------------------
    9898//
     99// Calculate the highest sector index+1 of all pixels, please make sure
     100// the the sector numbers are continous.
     101//
     102void MGeomCam::CalcNumSectors()
     103{
     104    fNumSectors = 0;
     105
     106    for (UInt_t i=0; i<fNumPixels; i++)
     107    {
     108        const MGeomPix &pix = (*this)[i];
     109        const UInt_t s = pix.GetSector();
     110
     111        if (s>fNumSectors)
     112            fNumSectors = s;
     113    }
     114
     115    fNumSectors++;
     116}
     117
     118// --------------------------------------------------------------------------
     119//
    99120// Calculate the maximum radius of the camera. This is ment for GUI layout.
    100121//
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.h

    r2209 r2236  
    2222    TObjArray fPixels;     // Array of singel pixels storing the geometry
    2323
     24    UInt_t    fNumSectors; // Number of sectors
     25
    2426protected:
    2527    void CalcMaxRadius();
     28    void CalcNumSectors();
    2629    void InitOuterRing();
    2730
     
    3235    virtual TObject *Clone(const char *newname=NULL) const;
    3336
    34     Float_t GetCameraDist() const      { return fCamDist; }
    35     Float_t GetConvMm2Deg() const      { return fConvMm2Deg; }
     37    Float_t GetCameraDist() const { return fCamDist; }
     38    Float_t GetConvMm2Deg() const { return fConvMm2Deg; }
    3639
    37     UInt_t  GetNumPixels() const       { return fNumPixels; }
    38     Float_t GetMaxRadius() const       { return fMaxRadius; }
     40    UInt_t  GetNumPixels() const  { return fNumPixels; }
     41    Float_t GetMaxRadius() const  { return fMaxRadius; }
     42    UInt_t  GetNumSectors() const { return fNumSectors; }
    3943    Float_t GetPixRatio(UInt_t i) const;
    4044
  • trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc

    r2037 r2236  
    5656    CreateCam();
    5757    CreateNN();
     58    CalcNumSectors();
    5859    CalcMaxRadius();
    5960}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc

    r2195 r2236  
    5252    CreateCam();
    5353    CreateNN();
     54    CalcNumSectors();
    5455    CalcMaxRadius();
    5556}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000HG.cc

    r2195 r2236  
    5656    CreateCam();
    5757    CreateNN();
     58    CalcNumSectors();
    5859    CalcMaxRadius();
    5960}
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc

    r2135 r2236  
    5353    CreateCam();
    5454    CreateNN();
     55    CalcNumSectors();
    5556    CalcMaxRadius();
    5657}
     
    221222        -034.641                                                                         // 576
    222223    };
    223 
     224/*
    224225    const Float_t dtemp[577] = {
    225226        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //   0
     
    296297        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 568
    297298        60.00  };                                                // 576
     299*/
     300    const Byte_t sector[577] = {
     301        0, 1, 2, 3, 4, 5, 6, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
     302        1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 1,
     303        1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5,
     304        6, 6, 6, 6, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
     305        4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 1, 1, 1, 1,
     306        1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
     307        4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1,
     308        1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
     309        4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 1, 1,
     310        1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
     311        3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
     312        6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
     313        2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
     314        4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,
     315        6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
     316        2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
     317        4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
     318        6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     319        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
     320        3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5,
     321        5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1,
     322        1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4,
     323        4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1,
     324        1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4,
     325        4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
     326        1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3,
     327        3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5,
     328        5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     329        2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4,
     330        4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
     331        6, 6, 6, 6, 6, 6, 6 };
    298332
    299333    //
    300334    //   fill the pixels list with this data
    301335    //
    302 
    303336    for (UInt_t i=0; i<GetNumPixels(); i++)
    304         (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]) ;
     337        (*this)[i].Set(xtemp[i], ytemp[i], i>396?60:30, sector[i]);
    305338}
    306339
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagicHG.cc

    r2187 r2236  
    5353    CreateCam();
    5454    CreateNN();
     55    CalcNumSectors();
    5556    CalcMaxRadius();
    5657}
     
    983984
    984985    for (UInt_t i=0; i<GetNumPixels(); i++)
    985         (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]) ;
     986        (*this)[i].Set(xtemp[i], ytemp[i], dtemp[i]);
    986987}
    987988
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.cc

    r2178 r2236  
    5656// Initializes one pixel
    5757//
    58 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r) : fX(x), fY(y), fD(r)
     58MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s) : fX(x), fY(y), fD(r), fSector(s)
    5959{
    6060    //  default constructor
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.h

    r2135 r2236  
    2525    Short_t fNeighbors[6]; // the IDs of the pixel next to it (we are assuming an hexagonal geometry)
    2626
     27    UInt_t fSector; // Number of sector the pixels corresponds to
     28
    2729public:
    28     MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0);
     30    MGeomPix(Float_t x=0, Float_t y=0, Float_t d=0, UInt_t s=0);
    2931
    3032    void Print(Option_t *opt=NULL) const;
    3133
    32     void Set(Float_t x, Float_t y, Float_t d) { fX=x; fY=y; fD=d; }
     34    void Set(Float_t x, Float_t y, Float_t d, UInt_t s=0) { fX=x; fY=y; fD=d; fSector=s; }
    3335
    3436    void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
     
    3638
    3739    void CheckOuterRing(const MGeomCam &cam);
    38 
    39     void SetX(Float_t x) { fX = x; }
    40     void SetY(Float_t y) { fY = y; }
    41     void SetD(Float_t d) { fD = d; }
     40    /*
     41     void SetX(Float_t x) { fX = x; }
     42     void SetY(Float_t y) { fY = y; }
     43     void SetD(Float_t d) { fD = d; }
     44     void SetSector(UInt_t s) { fSector = s; }
     45     */
    4246
    4347    Float_t GetX() const  { return fX; }
    4448    Float_t GetY() const  { return fY; }
    4549    Float_t GetD() const  { return fD; }
     50    UInt_t  GetSector() const { return fSector; }
    4651
    4752    Float_t GetA() const;
Note: See TracChangeset for help on using the changeset viewer.