Changeset 3808 for trunk


Ignore:
Timestamp:
04/22/04 21:08:57 (21 years ago)
Author:
jlopez
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MAstroCamera.cc

    r3710 r3808  
    8989                               // HOW TO GET RID OF IT? Move MHCamera to mgeom?
    9090
     91#include "MStarLocalPos.h"
     92
    9193ClassImp(MAstroCamera);
    9294
     
    116118
    117119    delete fMirror0;
     120
    118121}
    119122
     
    335338}
    336339
     340// --------------------------------------------------------------------------
     341//
     342// Options:
     343//
     344//  '*' Draw the mean of the reflections on all mirrors
     345//  '.' Draw a dot for the reflection on each individual mirror
     346//  'h' To create a TH2D of the star-light which is displayed
     347//  'c' Use the underlaying MHCamera as histogram
     348//  '0' Draw the reflection on a virtual perfect mirror
     349//
     350// If the Pad contains an object MHCamera of type MHCamera it is used.
     351// Otherwise a new object is created.
     352//
     353void MAstroCamera::FillStarList()
     354{
     355    fStars->SetOwner();
     356    fStars->Delete();
     357
     358    if (!fTime || !fObservatory || !fMirrors || !fStars)
     359    {
     360        cout << "Missing data..." << endl;
     361        return;
     362    }
     363
     364    // Get camera
     365    MHCamera *camera=(MHCamera*)FindObjectInPad("MHCamera", gPad);
     366    if (camera)
     367    {
     368        if (!camera->GetGeometry() || camera->GetGeometry()->IsA()!=fGeom->IsA())
     369            camera->SetGeometry(*fGeom);
     370    }
     371    else
     372    {
     373        camera = new MHCamera(*fGeom);
     374        camera->SetName("MHCamera");
     375        camera->SetStats(0);
     376        camera->SetInvDeepBlueSeaPalette();
     377        camera->SetBit(kCanDelete);
     378        camera->Draw();
     379    }
     380
     381    const TRotation rot(GetGrid(kTRUE));
     382
     383    MVector3 *radec;
     384    TIter Next(&fList);
     385
     386    while ((radec=(MVector3*)Next()))
     387    {
     388        const Double_t mag = radec->Magnitude();
     389
     390        TVector3 mean;
     391        Int_t num = 0;
     392
     393        TVector3 star(*radec);
     394        star *= rot;
     395        const TVector3 spot = fMirror0->GetReflection(star, fGeom->GetCameraDist())*1000;
     396
     397        MStarLocalPos *starpos = new MStarLocalPos;
     398        starpos->SetExpValues(mag,mean(0),mean(1));
     399        fStars->Add(starpos);
     400    }
     401}
     402
    337403// ------------------------------------------------------------------------
    338404//
  • trunk/MagicSoft/Mars/mastro/MAstroCamera.h

    r3704 r3808  
    77
    88class TClonesArray;
     9class TList;
    910
    1011class MTime;
     
    1819    MGeomCam     *fGeom;
    1920    TClonesArray *fMirrors;
     21    TList        *fStars;
    2022
    2123    MGeomMirror  *fMirror0;     //!
     
    3234    void SetMirrors(TClonesArray &arr);
    3335    void SetGeom(const MGeomCam &cam);
     36    void SetStarList(TList* s) { fStars = s; }
     37
     38    void FillStarList();
     39
     40    TList *GetList() const { return fStars; }
    3441
    3542    ClassDef(MAstroCamera, 1) // Display class to display stars on the camera
Note: See TracChangeset for help on using the changeset viewer.