Changeset 3514


Ignore:
Timestamp:
03/15/04 19:51:13 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3511 r3514  
    2020
    2121 2004/03/15: Markus Gaug
    22    * mcalib/MCalibrationChargePix.[h,cc]
    23    * mcalib/MCalibrationChargeCam.[h,cc]
    24    * mcalib/MCalibrationChargeCalc.cc
    25 
     22
     23   * mcalib/MCalibrationChargePix.[h,cc],
     24     mcalib/MCalibrationChargeCam.[h,cc],
     25     mcalib/MCalibrationChargeCalc.cc:
    2626   - conversion from hi- to logain now not applied until the value is
    2727     exported outside the class. This is necessary for the error
    … …  
    2929     number of Phe, the conversion factors cancel out and do not
    3030     enlarge the errors
    31 
    3231   - pixels with number of phe's outside the range defined by
    3332     fPheFFactorRelErrLimit are not any more declared as:
    … …  
    3837     no reasonable results in the calibration without bothering that
    3938     too many pixels fall out. Enjoy!
    40 
    4139   - In that procedure, the classes passed _internally_ from calculation
    4240     of sigmas to calculation of variances which saves all the useless
    4341     square rooting.
    44 
    4542   - took out pointers to MCalibraitonChargeBlindPix and
    4643     MCalibrationChargePINDiode in MCalibrationChargeCam.
     44
    4745
    4846
    … …  
    119117   * mbase/Makefile, mbase/BaseLinkDef.h:
    120118     - added MStatusArray
     119
     120   * mraw/MRawEvtPixelIter.cc:
     121     - GetIdxMaxLoGainSample(const Byte_t lofirst) const
     122       accelerated and fixed (the first slice was compared to itself
     123       and the last slice was not taken into account)
     124
     125   * mhits/MHCamera.[h,cc], mgui/MHexagon.[h,cc]:
     126     - improved drawing MHCamera with 'same' option
    121127
    122128
  • trunk/MagicSoft/Mars/mgui/MHexagon.cc

    r3230 r3514  
    112112// All calcutations are running in pixel coordinates
    113113//
    114 Int_t MHexagon::DistancetoPrimitive(Int_t px, Int_t py)
     114Int_t MHexagon::DistancetoPrimitive(Int_t px, Int_t py, Float_t conv)
    115115{
    116116    //
    117117    //  compute the distance of the Point to the center of the Hexagon
    118118    //
    119     const Int_t pxhex = gPad->XtoAbsPixel(fX);
    120     const Int_t pyhex = gPad->YtoAbsPixel(fY);
     119    const Int_t pxhex = gPad->XtoAbsPixel(fX*conv);
     120    const Int_t pyhex = gPad->YtoAbsPixel(fY*conv);
    121121
    122122    const Double_t x = TMath::Abs(px-pxhex);
    … …  
    137137    const Double_t dy = fD/2 * sina;
    138138
    139     const Int_t pxborder = gPad->XtoAbsPixel(fX + dx);
    140     const Int_t pyborder = gPad->YtoAbsPixel(fY + dy);
     139    const Int_t pxborder = gPad->XtoAbsPixel((fX + dx)*conv);
     140    const Int_t pyborder = gPad->YtoAbsPixel((fY + dy)*conv);
    141141
    142142    const Double_t bx = pxhex-pxborder;
    … …  
    149149    //  here in the first implementation is just circle inside
    150150    //
    151     return distborder < disthex ? (int)(disthex-distborder+1) : 0;
     151    return distborder < disthex ? (int)((disthex-distborder)/conv+1) : 0;
    152152}
    153153
  • trunk/MagicSoft/Mars/mgui/MHexagon.h

    r2231 r3514  
    4949        ;
    5050
    51     virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
     51    Int_t DistancetoPrimitive(Int_t px, Int_t py, Float_t conv);
     52    virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
     53    {
     54        return DistancetoPrimitive(px, py, 1);
     55    }
    5256    virtual Float_t DistanceToPrimitive(Float_t px, Float_t py);
    5357    virtual void  DrawHexagon(Float_t x, Float_t y, Float_t d);
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r3513 r3514  
    12621262        return TH1D::DistancetoPrimitive(px, py);
    12631263
    1264     if (GetPixelIndex(px, py)>=0)
     1264    const Bool_t issame = TString(GetDrawOption()).Contains("same", TString::kIgnoreCase);
     1265
     1266    const Float_t maxr = (1-fGeomCam->GetConvMm2Deg())*fGeomCam->GetMaxRadius()/2;
     1267    const Float_t conv = !issame ||
     1268        gPad->GetX1()<-maxr || gPad->GetY1()<-maxr ||
     1269        gPad->GetX2()> maxr || gPad->GetY2()>maxr ? 1 : fGeomCam->GetConvMm2Deg();
     1270
     1271    cout << conv << endl;
     1272
     1273    if (GetPixelIndex(px, py, conv)>=0)
    12651274        return 0;
    12661275
    … …  
    12791288//
    12801289//
    1281 Int_t MHCamera::GetPixelIndex(Int_t px, Int_t py) const
     1290Int_t MHCamera::GetPixelIndex(Int_t px, Int_t py, Float_t conv) const
    12821291{
    12831292    if (fNcells<=1)
    … …  
    12881297    {
    12891298        MHexagon hex((*fGeomCam)[i]);
    1290         if (hex.DistancetoPrimitive(px, py)>0)
     1299        if (hex.DistancetoPrimitive(px, py, conv)>0)
    12911300            continue;
    12921301
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r3487 r3514  
    6666    TPaveStats *GetStatisticBox();
    6767
    68     Int_t GetPixelIndex(Int_t px, Int_t py) const;
     68    Int_t GetPixelIndex(Int_t px, Int_t py, Float_t conv=1) const;
    6969
    7070    void PaintAxisTitle();
Note: See TracChangeset for help on using the changeset viewer.