Changeset 3580


Ignore:
Timestamp:
03/22/04 17:13:19 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3579 r3580  
    134134   * mimage/MNewImagePar.[h,cc]:
    135135     - added some comments
     136
     137   * mhist/MHStarMap.[h,cc]:
     138     - fixed to use the correct MPointingPos instead of the
     139       deprecated MMcEvt. Use MPointingPosCalc to copy the
     140       pointing position from MMcEvt to MPointingPos
    136141
    137142
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r3370 r3580  
    4848#include <TColor.h>   // SetRGB
    4949#include <TCanvas.h>  // TCanvas
     50#include <TVector2.h>
    5051
    5152#include "MLog.h"
     
    5859#include "MHillas.h"
    5960#include "MBinning.h"
    60 #include "MMcEvt.hxx"
    6161#include "MSrcPosCam.h"
    6262#include "MObservatory.h"
     63#include "MPointingPos.h"
    6364
    6465ClassImp(MHStarMap);
     
    131132    }
    132133
    133    fMcEvt = (MMcEvt*)plist->FindObject("MMcEvt");
    134    if (!fMcEvt)
     134   fPointPos = (MPointingPos*)plist->FindObject("MPointingPos");
     135   if (!fPointPos)
    135136   {
    136        *fLog << err << "MMcEvt not found... aborting." << endl;
     137       *fLog << err << "MPointingPos not found... aborting." << endl;
    137138       return kFALSE;
    138139   }
     
    190191// --------------------------------------------------------------------------
    191192//
    192 // Calls MObservatory::RotationAngle
    193 //
    194 void MHStarMap::GetRotationAngle(Double_t &sin, Double_t &cos)
    195 {
    196     fObservatory->RotationAngle(fMcEvt->GetTelescopeTheta(),
    197                                 fMcEvt->GetTelescopePhi(), sin, cos);
    198 }
    199 
    200 // --------------------------------------------------------------------------
    201 //
    202193// Fill the four histograms with data from a MHillas-Container.
    203194// Be careful: Only call this with an object of type MHillas
     
    216207    Float_t t = h.GetMeanY() - m*h.GetMeanX();
    217208
    218     Float_t xSource = fSrcPos->GetX();
    219     Float_t ySource = fSrcPos->GetY();
     209    TVector2 src(fSrcPos->GetXY());
    220210
    221211    if (!fUseMmScale)
    222212    {
    223         t *= fMm2Deg;
    224         xSource *= fMm2Deg;
    225         ySource *= fMm2Deg;
     213        t   *= fMm2Deg;
     214        src *= fMm2Deg;
    226215    }
    227216
     
    239228    //   - and perform a rotation to compensate the rotation of the
    240229    //     sky image in the camera
    241     Double_t cosal;
    242     Double_t sinal;
    243     GetRotationAngle(sinal, cosal);
     230    const Double_t rho = fPointPos->RotationAngle(*fObservatory);
    244231
    245232    if (m>-1 && m<1)
     
    248235
    249236        for (float x=xmin+dx/2; x<(xmax-xmin)+dx; x+=dx)
    250         {
    251             const Float_t xorig = x     - xSource;
    252             const Float_t yorig = m*x+t - ySource;
    253 
    254             const Float_t xfill =  cosal*xorig + sinal*yorig;
    255             const Float_t yfill = -sinal*xorig + cosal*yorig;
    256             fStarMap->Fill(xfill, yfill, w);
     237        {
     238            TVector2 v(x, m*x+t);
     239            v -= src;
     240            v.Rotate(-rho);
     241
     242            fStarMap->Fill(v.X(), v.Y(), w);
    257243        }
    258244    }
     
    266252
    267253        for (float y=ymin+dy/2; y<(ymax-ymin)+dy; y+=dy)
    268         {
    269             const Float_t xorig = (y-t)/m - xSource;
    270             const Float_t yorig = y       - ySource;
    271 
    272             const Float_t xfill =  cosal*xorig + sinal*yorig;
    273             const Float_t yfill = -sinal*xorig + cosal*yorig;
    274             fStarMap->Fill(xfill, yfill, w);
     254        {
     255            TVector2 v((y-t)/m, y);
     256            v -= src;
     257            v.Rotate(-rho);
     258
     259            fStarMap->Fill(v.X(), v.Y(), w);
    275260        }
    276261    }
  • trunk/MagicSoft/Mars/mhist/MHStarMap.h

    r3384 r3580  
    99class MHillas;
    1010class MSrcPosCam;
    11 class MMcEvt;
    1211class MObservatory;
     12class MPointingPos;
    1313
    1414class MHStarMap : public MH
    1515{
    1616private:
    17     MSrcPosCam   *fSrcPos; //!
    18     MMcEvt       *fMcEvt;  //!
     17    MSrcPosCam   *fSrcPos;      //!
     18    MPointingPos *fPointPos;    //!
    1919    MObservatory *fObservatory; //!
    2020
Note: See TracChangeset for help on using the changeset viewer.