Ignore:
Timestamp:
07/30/04 12:19:16 (21 years ago)
Author:
rwagner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mastro
Files:
2 edited

Legend:

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

    r4058 r4433  
    1111! * provided that the above copyright notice appear in all copies and
    1212! * that both that copyright notice and this permission notice appear
    13 ! * in supporting documentation. It is provided "as is" without express
     13! * in supporting documentation. It is provided "as is" without expressed
    1414! * or implied warranty.
    1515! *
     
    4545// Algorithm:
    4646// ----------
    47 // The caluclation of the position of the reflection in the camera is
     47// The calculation of the position of the reflection in the camera is
    4848// done by:
    4949//   - Rotation of the star-field such that the camera is looking into
     
    9292                      // HOW TO GET RID OF IT? Move MHCamera to mgeom?
    9393
    94 //#include "MStarLocalPos.h"
     94#include "MStarLocalPos.h"
    9595
    9696ClassImp(MAstroCamera);
     
    133133    if (arr.GetClass()!=MGeomMirror::Class())
    134134    {
    135         cout << "ERROR - TClonesArray doesn't contain objects of type MGeomMirror... ignored." << endl;
    136         return;
     135      cout << "ERROR - TClonesArray doesn't contain objects of type MGeomMirror... ignored." << endl;
     136      return;
    137137    }
    138138
     
    148148
    149149}
     150
    150151
    151152// --------------------------------------------------------------------------
     
    301302    if (!fTime || !fObservatory || !fMirrors)
    302303    {
    303         cout << "Missing data..." << endl;
     304      cout << "Missing data..." << endl;
    304305        return;
    305306    }
     
    405406        mean *= 1./num;
    406407        DrawStar(mean(0), mean(1), *radec, hasmean?kBlack:-1, Form("x=%.1fmm y=%.1fmm", mean(0), mean(1)), resize);
    407 
    408408        if (hasnull)
    409409        {
     
    418418}
    419419
    420 // --------------------------------------------------------------------------
    421 //
    422 // Options:
    423 //
    424 //  '*' Draw the mean of the reflections on all mirrors
    425 //  '.' Draw a dot for the reflection on each individual mirror
    426 //  'h' To create a TH2D of the star-light which is displayed
    427 //  'c' Use the underlaying MHCamera as histogram
    428 //  '0' Draw the reflection on a virtual perfect mirror
    429 //
    430 // If the Pad contains an object MHCamera of type MHCamera it is used.
    431 // Otherwise a new object is created.
    432 //
    433 /*void MAstroCamera::FillStarList(TList *list)
    434 {
    435     list->SetOwner();
    436     list->Delete();
    437 
    438     if (!fTime || !fObservatory || !fMirrors || !list)
    439     {
    440         cout << "Missing data..." << endl;
    441         return;
    442     }
    443 
    444     const MAstroSky2Local s2l(*fTime, *fObservatory);
    445     const TRotation trans(AlignCoordinates(rot*fRaDec));
    446 
    447     // Return the correct rotation matrix
    448     const TRotation rot = trans*s2l;
    449 
     420
     421// --------------------------------------------------------------------------
     422//
     423// Fills a TList with all stars found under current presets
     424// (Coordinates, Time, FOV). The list is emptied before the filling is done.
     425// Currently, the mean spot when averaging over all mirrors is used.
     426//
     427void MAstroCamera::FillStarList(TList* list)
     428{
     429    if (!fTime || !fObservatory || !fMirrors) {
     430      cout << "Missing data..." << endl;
     431      return;
     432    }
     433
     434    if (!list) {
     435      cout << "Missing storage list for stars found..." << endl;
     436      return;
     437    }
     438
     439    list->Delete(); // dump old list... (otherwise the same stars would pile up)
     440   
     441    const TRotation rot(GetGrid(kTRUE));
    450442    MVector3 *radec;
    451443    TIter Next(&fList);
    452444
    453     while ((radec=(MVector3*)Next()))
    454     {
    455         const Double_t mag = radec->Magnitude();
    456 
    457         TVector3 mean;
    458         TVector3 star(*radec);
    459         star *= rot;
    460         const TVector3 spot = fMirror0->GetReflection(star, fGeom->GetCameraDist())*1000;
    461 
    462         MStarLocalPos *starpos = new MStarLocalPos;
    463         starpos->SetExpValues(mag,mean(0),mean(1));
    464         list->Add(starpos);
    465     }
    466     // For MAGIC the distance of the mean of the light distribution
    467     // to the Mirror0 reflection of the star (Abberation) can be
    468     // expressed as:  dr = (0.0713 +/- 0.0002) * r = r/14.03
    469     // with r = hypot(mean(0), mean(1))
    470 }
    471 */
     445    while ((radec=(MVector3*)Next())) {
     446      const Double_t mag = radec->Magnitude();
     447      if (mag>GetLimMag())
     448        continue;
     449      TVector3 star(*radec);
     450      // Rotate Star into telescope system
     451      star *= rot;
     452      TVector3 mean;
     453      Int_t num = 0;
     454      MGeomMirror *mirror = 0;
     455      TIter NextM(fMirrors);
     456      while ((mirror=(MGeomMirror*)NextM())) {
     457        const TVector3 spot = mirror->GetReflection(star, fGeom->GetCameraDist())*1000;
     458        mean += spot;
     459        num++;
     460      }
     461      mean *= 1./num;
     462      MStarLocalPos *starpos = new MStarLocalPos;
     463      starpos->SetExpValues(mag,mean(0),mean(1));
     464     
     465      TString name = radec->GetName();
     466      if (name.Length()==0) {
     467        starpos->SetName("unknown");
     468      } else {
     469        starpos->SetName(radec->GetName());
     470      } 
     471      list->Add(starpos);   
     472    }
     473}
    472474
    473475// ------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mastro/MAstroCamera.h

    r4214 r4433  
    3535    void SetGeom(const MGeomCam &cam);
    3636
     37    void FillStarList(TList *list);
     38
    3739    void GetDiffZdAz(Double_t x, Double_t y, Double_t &dzd, Double_t &daz);
    3840
Note: See TracChangeset for help on using the changeset viewer.