Index: trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc	(revision 3375)
+++ trunk/MagicSoft/Mars/manalysis/MSourcePosfromStarPos.cc	(revision 3376)
@@ -79,5 +79,4 @@
     fRuns  = 0;
     fSize  = 100;
-    fStars = 0;
 
     fRunNr.Set(fSize);
@@ -95,4 +94,7 @@
     fdyStar.ResizeTo(1,fSize);
 
+    fStars = 0;
+    fDecSource = 0.0;
+    fRaSource  = 0.0;
 }
 
@@ -255,5 +257,5 @@
     if (fDecSource == 0.0  ||  fRaSource == 0.0  ||  fStars == 0) 
     {
-      *fLog << err << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars" 
+      *fLog << err << "MSourcePosfromStarPos::PreProcess; there are no sky coordinates defined for the source or from stars; fStars = " << fStars 
             << endl;
     }
@@ -603,10 +605,10 @@
     fdThetaTel.Set(fSize);
     fdPhiTel.Set(fSize);
-
-    fStars = fxStar.GetNrows();
-    fxStar.ResizeTo(fStars, fSize);
-    fyStar.ResizeTo(fStars, fSize);
-    fdxStar.ResizeTo(fStars, fSize);
-    fdyStar.ResizeTo(fStars, fSize);
+    
+    Int_t fRows = fxStar.GetNrows();
+    fxStar.ResizeTo(fRows, fSize);
+    fyStar.ResizeTo(fRows, fSize);
+    fdxStar.ResizeTo(fRows, fSize);
+    fdyStar.ResizeTo(fRows, fSize);
   }
 
@@ -641,20 +643,24 @@
   //      << fRunNr[fRuns-1] << ",  " << fRunNr[fRuns] << endl;
 
+ 
   // read mjdS, hmsS, mjdE, hmsE
-  *fIn >> val; 
-  *fIn >> val; 
-  *fIn >> val; 
-  *fIn >> val; 
-
-  *fIn >> val; 
-  *fIn >> val; 
-  *fIn >> val; 
-  *fIn >> val; 
-
+  // these data are present only for ON data (fStars > 0)
+  if (fStars > 0)
+  {
+    *fIn >> val; 
+    *fIn >> val; 
+    *fIn >> val; 
+    *fIn >> val; 
+
+    *fIn >> val; 
+    *fIn >> val; 
+    *fIn >> val; 
+    *fIn >> val; 
+  }
 
   *fIn >> val;
   fThetaTel.AddAt(val/kRad2Deg, fRuns-1);
   //*fLog << "val, fThetaTel[fRuns-1] = " << val << ",  "
-  //    << fThetaTel[fRuns-1] << endl;
+  //      << fThetaTel[fRuns-1] << endl;
 
 
@@ -671,5 +677,6 @@
 
   // input is in [deg], convert to [mm]
-  fStars = fxStar.GetNrows();
+
+  //*fLog << "ReadData : fStars = " << fStars << endl;
   for (Int_t i=0; i<fStars; i++)
   {
