Index: /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.cc	(revision 4719)
+++ /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.cc	(revision 4720)
@@ -276,42 +276,32 @@
     }
 
-    
+    //-------------------------------------------    
     // copy names from MStarCam to the histograms
+    MStarPos* starpos;
+    Int_t istar = 0;
+    TIter Next(fSourceCam->GetList());
+
+    while ((starpos=(MStarPos*)Next())) {
+      fStarnames[istar] =  starpos->GetName();
+      //*fLog << "istar, star name = " << istar << ",  " 
+      //      << fStarnames[istar] << endl;
+      istar++;
+      if (istar >= fNstarnames) break;
+    }
+
     if (fSourceCam)
     {
-      *fLog << "Source container exists " << endl;
-
       MStarPos *starSource = 0;
       TIter nextSource(fSourceCam->GetList());
-
-      *fLog << "&nextSource = " << &nextSource << endl;
-
-      starSource = (MStarPos*)nextSource();
-      if (starSource)
+      while ( (starSource = (MStarPos*)nextSource()) )
       {
-        *fLog << "name of source container1 : " << starSource->GetName()
-              << endl;
-
-        fEstPos1->SetName(starSource->GetName());
-
-        starSource = (MStarPos*)nextSource();
-        if (starSource)
-	{
-        *fLog << "name of source container2 : " << starSource->GetName()
-              << endl;
-
-
-          fEstPos2->SetName(starSource->GetName());
-
-          starSource = (MStarPos*)nextSource();
-          if (starSource)
-	  {
-
-        *fLog << "name of source container3 : " << starSource->GetName()
-              << endl;
-
-            fEstPos3->SetName(starSource->GetName());
-	  }
-	}
+         if     ( fNstarnames > 0  &&  starSource->GetName() == fStarnames[0] )
+           fEstPos1->SetName(starSource->GetName());
+
+         else if( fNstarnames > 1  &&  starSource->GetName() == fStarnames[1] )
+           fEstPos2->SetName(starSource->GetName());
+
+         else if( fNstarnames > 2  &&  starSource->GetName() == fStarnames[2] )
+           fEstPos3->SetName(starSource->GetName());
       }
     }
@@ -455,6 +445,6 @@
       TIter nextSource(fSourceCam->GetList());
 
-      starSource = (MStarPos*)nextSource();
-      if (starSource)
+      while( (starSource = (MStarPos*)nextSource()) )
+      //if (starSource)
       {
         if (fInputType == 1)
@@ -471,9 +461,15 @@
         if (x>lowx  && x<higx  && y>lowy  && y<higy)
         {
-          fEstPos1  ->Fill(x, y, w);
-          //fEstPos1->SetName(starSource->GetName());
+         if     ( fNstarnames > 0  &&  starSource->GetName() == fStarnames[0] )
+           fEstPos1->Fill(x, y, w);
+
+         else if( fNstarnames > 1  &&  starSource->GetName() == fStarnames[1] )
+           fEstPos2->Fill(x, y, w);
+
+         else if( fNstarnames > 2  &&  starSource->GetName() == fStarnames[2] )
+           fEstPos3->Fill(x, y, w);
         }
 
-
+	/*
         starSource = (MStarPos*)nextSource();
         if (starSource)
@@ -517,4 +513,6 @@
 	  }
         }
+	*/
+
       }
     }
Index: /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.h
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.h	(revision 4719)
+++ /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.h	(revision 4720)
@@ -35,9 +35,10 @@
     MSkyCamTrans    *fSkyCamTrans; //!
 
-
-
     Float_t fMm2Deg;                    //!
     Bool_t  fUseMmScale;                //!
     Int_t   fInputType;                 //!
+
+    const static Int_t fNstarnames = 3;        //!
+    TString fStarnames[fNstarnames];    //!
 
     void SetColors() const;
Index: /trunk/MagicSoft/Mars/mtemp/MSourceDirections.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MSourceDirections.cc	(revision 4719)
+++ /trunk/MagicSoft/Mars/mtemp/MSourceDirections.cc	(revision 4720)
@@ -115,4 +115,15 @@
   fAstro.SetObservatory(magic1);  
 
+
+  // make the starlist available already in the preprocessing
+  fStars->GetList()->Delete();
+  fAstro.SetTime(*fTimeCurr);
+  fAstro.SetGuiActive();
+  fAstro.FillStarList(fStars->GetList());      
+  *fLog << inf << "in preprocessing " << GetName() << " found " 
+        << fStars->GetList()->GetSize() 
+	<< " directions inside the chosen FOV." << endl;          
+
+
   return kTRUE;
 }
@@ -164,2 +175,14 @@
 }
 
+
+
+
+
+
+
+
+
+
+
+
+
