Changeset 1956


Ignore:
Timestamp:
04/12/03 21:48:57 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc

    r1951 r1956  
    4242#include "MBinning.h"
    4343#include "MParList.h"
     44#include "MSigmabar.h"
     45
     46#include "MGeomCam.h"
     47
    4448#include "MPedestalCam.h"
    4549#include "MPedestalPix.h"
     50
    4651#include "MCerPhotEvt.h"
    4752#include "MCerPhotPix.h"
     
    5055#include "MLogManip.h"
    5156
    52 #include "MSigmabar.h"
    5357
    5458ClassImp(MHSigmaTheta);
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r1951 r1956  
    156156    const float sind = sqrt(1.0-cosd*cosd);
    157157
    158     const float t = h.GetMeanY() - m*h.GetMeanX();
     158    float t = h.GetMeanY() - m*h.GetMeanX();
    159159
    160160    if (!fUseMmScale)
     
    162162
    163163    // get step size ds along the main axis of the ellipse
    164     const TAxis &axe = *fStarMap->GetXaxis();
    165     const int   N    = axe.GetNbins();
    166     const float xmin = axe.GetXmin();
    167     const float xmax = axe.GetXmax();
     164    const TAxis &axex = *fStarMap->GetXaxis();
     165    const float xmin = axex.GetXmin();
     166    const float xmax = axex.GetXmax();
     167
    168168    // FIXME: Fixed number?
    169     const float ds   = (xmax-xmin) / 200.0;
     169    const float ds = (xmax-xmin) / 200.0;
    170170
    171171    if (m>-1 && m<1)
    172172    {
    173173        const float dx = ds * cosd;
    174         const float  x = xmin + dx/2.0;
    175         const int   N1 = (int) ((xmax-xmin)/dx+1.0);
    176 
    177         for (int i=0; i<N1; i++)
    178         {
    179             const float y = m*x+t;
    180             fStarMap->Fill(x, y);
    181             x += dx;
    182         }
     174
     175        for (float x=xmin+dx/2; x<(xmax-xmin)+dx; x+=dx)
     176            fStarMap->Fill(x, m*x+t);
    183177    }
    184178    else
    185179    {
    186         const TAxis &axe = *fStarMap->GetYaxis();
    187         const int   M    = axe.GetNbins();
    188         const float ymin = axe.GetXmin();
    189         const float ymax = axe.GetXmax();
     180        const TAxis &axey = *fStarMap->GetYaxis();
     181        const float ymin = axey.GetXmin();
     182        const float ymax = axey.GetXmax();
    190183
    191184        const float dy = ds * sind;
    192         const float  y = ymin + dy/2.0;
    193         const int   M1 = (int) ((ymax-ymin)/dy+1.0);
    194 
    195         for (int i=0; i<M1; i++)
    196         {
    197             const float x = (y-t)/m;
    198             fStarMap->Fill(x, y);
    199             y += dy;
    200         }
     185
     186        for (float y=ymin+dy/2; y<(ymax-ymin)+dy; y+=dy)
     187            fStarMap->Fill((y-t)/m, y);
    201188    }
    202189
Note: See TracChangeset for help on using the changeset viewer.