Index: trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCamera.cc	(revision 4358)
+++ trunk/MagicSoft/Mars/mastro/MAstroCamera.cc	(revision 4433)
@@ -11,5 +11,5 @@
 ! * provided that the above copyright notice appear in all copies and
 ! * that both that copyright notice and this permission notice appear
-! * in supporting documentation. It is provided "as is" without express
+! * in supporting documentation. It is provided "as is" without expressed
 ! * or implied warranty.
 ! *
@@ -45,5 +45,5 @@
 // Algorithm:
 // ----------
-// The caluclation of the position of the reflection in the camera is
+// The calculation of the position of the reflection in the camera is
 // done by:
 //   - Rotation of the star-field such that the camera is looking into
@@ -92,5 +92,5 @@
                       // HOW TO GET RID OF IT? Move MHCamera to mgeom?
 
-//#include "MStarLocalPos.h"
+#include "MStarLocalPos.h"
 
 ClassImp(MAstroCamera);
@@ -133,6 +133,6 @@
     if (arr.GetClass()!=MGeomMirror::Class())
     {
-        cout << "ERROR - TClonesArray doesn't contain objects of type MGeomMirror... ignored." << endl;
-        return;
+      cout << "ERROR - TClonesArray doesn't contain objects of type MGeomMirror... ignored." << endl;
+      return;
     }
 
@@ -148,4 +148,5 @@
 
 }
+
 
 // --------------------------------------------------------------------------
@@ -301,5 +302,5 @@
     if (!fTime || !fObservatory || !fMirrors)
     {
-        cout << "Missing data..." << endl;
+      cout << "Missing data..." << endl;
         return;
     }
@@ -405,5 +406,4 @@
         mean *= 1./num;
         DrawStar(mean(0), mean(1), *radec, hasmean?kBlack:-1, Form("x=%.1fmm y=%.1fmm", mean(0), mean(1)), resize);
-
         if (hasnull)
         {
@@ -418,56 +418,58 @@
 }
 
-// --------------------------------------------------------------------------
-//
-// Options:
-//
-//  '*' Draw the mean of the reflections on all mirrors
-//  '.' Draw a dot for the reflection on each individual mirror
-//  'h' To create a TH2D of the star-light which is displayed
-//  'c' Use the underlaying MHCamera as histogram
-//  '0' Draw the reflection on a virtual perfect mirror
-//
-// If the Pad contains an object MHCamera of type MHCamera it is used.
-// Otherwise a new object is created.
-//
-/*void MAstroCamera::FillStarList(TList *list)
-{
-    list->SetOwner();
-    list->Delete();
-
-    if (!fTime || !fObservatory || !fMirrors || !list)
-    {
-        cout << "Missing data..." << endl;
-        return;
-    }
-
-    const MAstroSky2Local s2l(*fTime, *fObservatory);
-    const TRotation trans(AlignCoordinates(rot*fRaDec));
-
-    // Return the correct rotation matrix
-    const TRotation rot = trans*s2l;
-
+
+// --------------------------------------------------------------------------
+//
+// Fills a TList with all stars found under current presets
+// (Coordinates, Time, FOV). The list is emptied before the filling is done.
+// Currently, the mean spot when averaging over all mirrors is used.
+//
+void MAstroCamera::FillStarList(TList* list)
+{
+    if (!fTime || !fObservatory || !fMirrors) {
+      cout << "Missing data..." << endl;
+      return;
+    }
+
+    if (!list) {
+      cout << "Missing storage list for stars found..." << endl;
+      return;
+    }
+
+    list->Delete(); // dump old list... (otherwise the same stars would pile up)
+   
+    const TRotation rot(GetGrid(kTRUE));
     MVector3 *radec;
     TIter Next(&fList);
 
-    while ((radec=(MVector3*)Next()))
-    {
-        const Double_t mag = radec->Magnitude();
-
-        TVector3 mean;
-	TVector3 star(*radec);
-	star *= rot;
-	const TVector3 spot = fMirror0->GetReflection(star, fGeom->GetCameraDist())*1000;
-
-	MStarLocalPos *starpos = new MStarLocalPos;
-	starpos->SetExpValues(mag,mean(0),mean(1));
-	list->Add(starpos);
-    }
-    // For MAGIC the distance of the mean of the light distribution
-    // to the Mirror0 reflection of the star (Abberation) can be
-    // expressed as:  dr = (0.0713 +/- 0.0002) * r = r/14.03
-    // with r = hypot(mean(0), mean(1))
-}
-*/
+    while ((radec=(MVector3*)Next())) {
+      const Double_t mag = radec->Magnitude();
+      if (mag>GetLimMag())
+	continue;
+      TVector3 star(*radec);
+      // Rotate Star into telescope system
+      star *= rot;
+      TVector3 mean;
+      Int_t num = 0;
+      MGeomMirror *mirror = 0;
+      TIter NextM(fMirrors);
+      while ((mirror=(MGeomMirror*)NextM())) {
+	const TVector3 spot = mirror->GetReflection(star, fGeom->GetCameraDist())*1000;
+	mean += spot;
+	num++;
+      }
+      mean *= 1./num;
+      MStarLocalPos *starpos = new MStarLocalPos;
+      starpos->SetExpValues(mag,mean(0),mean(1));
+      
+      TString name = radec->GetName();
+      if (name.Length()==0) {
+	starpos->SetName("unknown"); 
+      } else {
+	starpos->SetName(radec->GetName());
+      }	 
+      list->Add(starpos);   
+    }
+}
 
 // ------------------------------------------------------------------------
Index: trunk/MagicSoft/Mars/mastro/MAstroCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroCamera.h	(revision 4358)
+++ trunk/MagicSoft/Mars/mastro/MAstroCamera.h	(revision 4433)
@@ -35,4 +35,6 @@
     void SetGeom(const MGeomCam &cam);
 
+    void FillStarList(TList *list);
+
     void GetDiffZdAz(Double_t x, Double_t y, Double_t &dzd, Double_t &daz);
 
