Ignore:
Timestamp:
04/10/04 16:02:20 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3666 r3704  
    3333// PRELIMINARY!!
    3434//
     35// The caluclation of the position of the reflection in the camera is
     36// done by:
     37//   - Rotation of the star-field such that the camera is looking into
     38//     the pointing direction
     39//   - Calculation of the reflected star-light vector by calling
     40//     MGeomMirror::GetReflection (which returns the point at which
     41//     the vector hits the camera plain)
     42//   - Depending on the draw-option you get each reflected point, the
     43//     reflection on a virtual ideal mirror or the reflection on each
     44//     individual mirror
     45//
     46// GUI: You can use the the cursor keys to change the pointing position
     47//      and plus/minus to change the time by a quarter of an hour.
     48//
    3549/////////////////////////////////////////////////////////////////////////////
    3650#include "MAstroCamera.h"
     
    5872
    5973// --------------------------------------------------------------------------
     74//
     75// Create a virtual MGeomMirror which is in the center of the coordinate
     76// system and has a normal vector in z-direction.
     77//
    6078MAstroCamera::MAstroCamera() : fGeom(0), fMirrors(0)
    6179{
     
    6583
    6684// --------------------------------------------------------------------------
     85//
     86// Delete fGeom, fMirrors and the virtual 0-Mirror fMirror0
     87//
    6788MAstroCamera::~MAstroCamera()
    6889{
     
    7697
    7798// --------------------------------------------------------------------------
     99//
     100// Set a list of mirrors. The Mirrors must be of type MGeomMirror and
     101// stored in a TClonesArray
     102//
    78103void MAstroCamera::SetMirrors(TClonesArray &arr)
    79104{
    80105    if (arr.GetClass()!=MGeomMirror::Class())
     106    {
     107        cout << "ERROR - TClonesArray doesn't contain objects of type MGeomMirror... ignored." << endl;
    81108        return;
     109    }
    82110
    83111    const Int_t n = arr.GetSize();
     
    94122
    95123// --------------------------------------------------------------------------
     124//
     125// Set the camera geometry. The MGeomCam object is cloned.
     126//
    96127void MAstroCamera::SetGeom(const MGeomCam &cam)
    97128{
     
    103134
    104135// --------------------------------------------------------------------------
     136//
     137// Convert To Pad coordinates (see MAstroCatalog)
     138//
    105139Int_t MAstroCamera::ConvertToPad(const TVector3 &w, TVector2 &v) const
    106140{
     
    124158
    125159// --------------------------------------------------------------------------
     160//
     161// Find an object with a given name in the list of primitives of this pad.
     162//
    126163TObject *FindObjectInPad(const char *name, TVirtualPad *pad)
    127164{
     
    152189//
    153190//  '*' Draw the mean of the reflections on all mirrors
    154 //  '.' Draw a dot for the reflection on each mirror
     191//  '.' Draw a dot for the reflection on each individual mirror
     192//  'h' To create a TH2D of the star-light which is displayed
     193//  'c' Use the underlaying MHCamera as histogram
     194//  '0' Draw the reflection on a virtual perfect mirror
     195//
     196// If the Pad contains an object MHCamera of type MHCamera it is used.
     197// Otherwise a new object is created.
    155198//
    156199void MAstroCamera::AddPrimitives(TString o)
     
    165208        o = "*.";
    166209
     210    const Bool_t hasnull = o.Contains("0", TString::kIgnoreCase);
    167211    const Bool_t hashist = o.Contains("h", TString::kIgnoreCase);
    168212    const Bool_t hasmean = o.Contains("*", TString::kIgnoreCase);
     
    257301        // transform meters into millimeters (camera display works with mm)
    258302        mean *= 1./num;
    259 
    260303        DrawStar(mean(0), mean(1), *radec, !hasmean, Form("x=%.1fmm y=%.1fmm", mean(0), mean(1)));
     304
     305        if (hasnull)
     306        {
     307            TVector3 star(*radec);
     308            star *= rot;
     309            const TVector3 spot = fMirror0->GetReflection(star, fGeom->GetCameraDist())*1000;
     310            DrawStar(spot(0), spot(1), *radec, !hasmean, Form("x=%.1fmm y=%.1fmm", mean(0), mean(1)));
     311        }
    261312    }
    262313}
Note: See TracChangeset for help on using the changeset viewer.