Ignore:
Timestamp:
04/08/04 19:52:13 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mimage/MHillasExt.cc

    r3666 r3682  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz    12/2000 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz    12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!   Author(s): Rudolf Bock     10/2001 <mailto:Rudolf.Bock@cern.ch>
    2020!   Author(s): Wolfgang Wittek 06/2002 <mailto:wittek@mppmu.mpg.de>
    2121!
    22 !   Copyright: MAGIC Software Development, 2000-2002
     22!   Copyright: MAGIC Software Development, 2000-2004
    2323!
    2424!
     
    101101    fM3Trans =  0;
    102102
    103     fMaxDist = -1;
     103    fMaxDist =  0;
    104104}
    105105
     
    170170        const Double_t dy = gpix.GetY() - hil.GetMeanY();      // [mm]
    171171
    172         const Double_t dist = dx*dx+dy*dy;
    173         if (dist>maxdist)
    174             maxdist=dist;                                      // [mm^2]
    175 
    176172        Double_t nphot = pix.GetNumPhotons();                  // [1]
    177173
    178174        const Double_t dzx =  hil.GetCosDelta()*dx + hil.GetSinDelta()*dy; // [mm]
    179175        const Double_t dzy = -hil.GetSinDelta()*dx + hil.GetCosDelta()*dy; // [mm]
     176
     177        const Double_t dist = dx*dx+dy*dy;
     178        if (TMath::Abs(dist)>TMath::Abs(maxdist))
     179            maxdist = dzx<0 ? -dist : dist;                    // [mm^2]
    180180
    181181        m3x += nphot * dzx*dzx*dzx;                            // [mm^3]
     
    210210    fM3Trans = m3y<0 ? -pow(-m3y, 1./3) : pow(m3y, 1./3);      // [mm]
    211211
    212     fMaxDist = TMath::Sqrt(maxdist);                           // [mm]
     212    const Double_t md = TMath::Sqrt(TMath::Abs(maxdist));
     213    fMaxDist = maxdist<0 ? -md : md;                           // [mm]
    213214
    214215    SetReadyToSave();
     
    224225void MHillasExt::Set(const TArrayF &arr)
    225226{
    226     if (arr.GetSize() != 3)
     227    if (arr.GetSize() != 4)
    227228        return;
    228229
    229     fAsym    = arr.At(0); // [mm] fDist minus dist: center of ellipse, highest pixel
    230     fM3Long  = arr.At(1); // [mm] 3rd moment (e-weighted) along major axis
    231     fM3Trans = arr.At(2); // [mm] 3rd moment (e-weighted) along minor axis
    232 }
     230    fAsym    = arr.At(0);
     231    fM3Long  = arr.At(1);
     232    fM3Trans = arr.At(2);
     233    fMaxDist = arr.At(3);
     234}
Note: See TracChangeset for help on using the changeset viewer.