Index: /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.cc	(revision 4704)
+++ /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.cc	(revision 4705)
@@ -48,6 +48,6 @@
 #include "MBinning.h"
 
-#include "MStarLocalCam.h"
-#include "MStarLocalPos.h"
+#include "MStarCam.h"
+#include "MStarPos.h"
 #include "MSkyCamTrans.h"
 #include "MSrcPosCam.h"
@@ -78,4 +78,9 @@
     fNdoF->SetYTitle("Counts");
 
+    fLog10Chi2 = new TH1D("log10Chi2", "log10Chi2", 60, -10, 5);
+    fLog10Chi2->SetDirectory(NULL);
+    fLog10Chi2->SetXTitle("log10(Chi2)");
+    fLog10Chi2->SetYTitle("Counts");
+
     fChi2Prob = new TH1D("Chi2-Prob", "Chi2 probability",     40,  0.0,  1.0);
     fChi2Prob->SetDirectory(NULL);
@@ -103,5 +108,5 @@
 
     fShift = new TH2D("Shift", "Sky-Cam transformnation : (x,y) shift", 
-                                                51, -445, 445, 51, -445, 445);
+                      72, -534.0707, 534.0707, 72, -534.0707, 534.0707);
     fShift->SetDirectory(NULL);
     fShift->SetZTitle("Counts");
@@ -111,19 +116,27 @@
 
     fEstPos1 = new TH2D("EstPos1", "Estimated position1", 
-                                               51, -445, 445, 51, -445, 445);
+                      72, -534.0707, 534.0707, 72, -534.0707, 534.0707);
     fEstPos1->SetDirectory(NULL);
     fEstPos1->SetZTitle("Counts");
-    fEstPos1->SetXTitle("Estimated position1 x [\\circ]");
-    fEstPos1->SetYTitle("Estimated position1 y [\\circ]");
+    fEstPos1->SetXTitle("Estimated position1    x [\\circ]");
+    fEstPos1->SetYTitle("Estimated position1    y [\\circ]");
 
     fEstPos2 = new TH2D("EstPos2", "Estimated position2", 
-                                               51, -445, 445, 51, -445, 445);
+                      72, -534.0707, 534.0707, 72, -534.0707, 534.0707);
     fEstPos2->SetDirectory(NULL);
     fEstPos2->SetZTitle("Counts");
-    fEstPos2->SetXTitle("Estimated position2 x [\\circ]");
-    fEstPos2->SetYTitle("Estimated position2 y [\\circ]");
-
-    // default input type : results from correlated Gauss fit
-    fInputType = 2;
+    fEstPos2->SetXTitle("Estimated position2    x [\\circ]");
+    fEstPos2->SetYTitle("Estimated position2    y [\\circ]");
+
+    fEstPos3 = new TH2D("EstPos3", "Estimated position3", 
+                      72, -534.0707, 534.0707, 72, -534.0707, 534.0707);
+    fEstPos3->SetDirectory(NULL);
+    fEstPos3->SetZTitle("Counts");
+    fEstPos3->SetXTitle("Estimated position3    x [\\circ]");
+    fEstPos3->SetYTitle("Estimated position3    y [\\circ]");
+
+
+    // default input type : results from Gauss fit
+    fInputType = 1;
 }
 
@@ -133,6 +146,5 @@
 //
 //     type = 0        calculated star positions (by averaging)
-//     type = 1        fitted star positions (by uncorrelated Gauss fit)
-//     type = 2        fitted star positions (by correlated   Gauss fit)
+//     type = 1        fitted star positions (by Gauss fit)
 //
 void MHTelAxisFromStars::SetInputType(Int_t type)
@@ -151,6 +163,9 @@
 MHTelAxisFromStars::~MHTelAxisFromStars()
 {
+  //*fLog << "MHTelAxisFromStars::Destructor" << endl;
+
     delete fNStars;
     delete fNdoF;
+    delete fLog10Chi2;
     delete fChi2Prob;
     delete fNumIter;
@@ -161,4 +176,5 @@
     delete fEstPos1;
     delete fEstPos2;
+    delete fEstPos3;
 }
 
@@ -177,17 +193,16 @@
 {
 
-   fStarLocalCam = (MStarLocalCam*)plist->FindObject("MStarLocalCam", "MStarLocalCam");
-   if (!fStarLocalCam)
+   fStarCam = (MStarCam*)plist->FindObject("MStarCam", "MStarCam");
+   if (!fStarCam)
    {
-       *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MStarLocalCam' not found... aborting." << endl;
+       *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MStarCam' not found... aborting." << endl;
        return kFALSE;
    }
 
    
-   fSourceLocalCam = (MStarLocalCam*)plist->FindObject("MSourceLocalCam", "MStarLocalCam");
-   if (!fSourceLocalCam)
+   fSourceCam = (MStarCam*)plist->FindObject("MSourceCam", "MStarCam");
+   if (!fSourceCam)
    {
-       *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MSourceLocalCam' not found... aborting." << endl;
-       return kFALSE;
+       *fLog << err << "MHTelAxisFromStars::SetupFill; container 'MSourceCam' not found... " << endl;
    }
    
@@ -226,4 +241,5 @@
     ApplyBinning(*plist, "NStars",   fNStars);
     ApplyBinning(*plist, "NdoF",     fNdoF);
+    ApplyBinning(*plist, "Log10Chi2",fLog10Chi2);
     ApplyBinning(*plist, "Chi2Prob", fChi2Prob);
     ApplyBinning(*plist, "NumIter",  fNumIter);
@@ -244,4 +260,5 @@
         SetBinning(fEstPos1, &b, &b);
         SetBinning(fEstPos2, &b, &b);
+        SetBinning(fEstPos3, &b, &b);
     }
     else
@@ -250,20 +267,48 @@
         SetBinning(fEstPos1, bins, bins);
         SetBinning(fEstPos2, bins, bins);
-    }
-
-    //-----------------------------------------------
-    // copy names from MStarLocalCam to the histograms
-    MStarLocalPos *starSource = 0;
-    TIter nextSource(fSourceLocalCam->GetList());
-
-    starSource = (MStarLocalPos*)nextSource();
-    if (starSource)
-    {
-      fEstPos1->SetName(starSource->GetName());
-
-      starSource = (MStarLocalPos*)nextSource();
+        SetBinning(fEstPos3, bins, bins);
+    }
+
+    
+    // copy names from MStarCam to the histograms
+    if (fSourceCam)
+    {
+      *fLog << "Source container exists " << endl;
+
+      MStarPos *starSource = 0;
+      TIter nextSource(fSourceCam->GetList());
+
+      *fLog << "&nextSource = " << &nextSource << endl;
+
+      starSource = (MStarPos*)nextSource();
       if (starSource)
-        fEstPos2->SetName(starSource->GetName());
-    }
+      {
+        *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());
+	  }
+	}
+      }
+    }
+    
 
     return kTRUE;
@@ -317,4 +362,5 @@
     MH::ScaleAxis(fEstPos1, scale, scale);
     MH::ScaleAxis(fEstPos2, scale, scale);
+    MH::ScaleAxis(fEstPos3, scale, scale);
 
     if (mmscale)
@@ -328,4 +374,7 @@
         fEstPos2->SetXTitle("Estimated position2 x [mm]");
         fEstPos2->SetYTitle("Estimated position2 y [mm]");
+
+        fEstPos3->SetXTitle("Estimated position3 x [mm]");
+        fEstPos3->SetYTitle("Estimated position3 y [mm]");
     }
     else
@@ -339,4 +388,7 @@
         fEstPos2->SetXTitle("Estimated position2 x [\\circ]");
         fEstPos2->SetYTitle("Estimated position2 y [\\circ]");
+
+        fEstPos3->SetXTitle("Estimated position3 x [\\circ]");
+        fEstPos3->SetYTitle("Estimated position3 y [\\circ]");
     }
 
@@ -358,10 +410,12 @@
 
 
-    fNStars   ->Fill(fSkyCamTrans->GetNStars(),        w);
-    fNdoF     ->Fill(fSkyCamTrans->GetNdof(),          w);
-    fChi2Prob ->Fill(fSkyCamTrans->GetChiSquareProb(), w);
-    fNumIter  ->Fill(fSkyCamTrans->GetNumIter(),       w);
-    fLambda   ->Fill(fSkyCamTrans->GetLambda(),        w);
-    fAlfa     ->Fill(fSkyCamTrans->GetAlfa(),          w);
+    fNStars   ->Fill(fSkyCamTrans->GetNStars(),               w);
+    fNdoF     ->Fill(fSkyCamTrans->GetNdof(),                 w);
+    if (fSkyCamTrans->GetChiSquare() > 0.0)
+      fLog10Chi2->Fill( log10(fSkyCamTrans->GetChiSquare() ), w);
+    fChi2Prob ->Fill(fSkyCamTrans->GetChiSquareProb(),        w);
+    fNumIter  ->Fill(fSkyCamTrans->GetNumIter(),              w);
+    fLambda   ->Fill(fSkyCamTrans->GetLambda(),               w);
+    fAlfa     ->Fill(fSkyCamTrans->GetAlfa(),                 w);
 
 
@@ -390,42 +444,13 @@
     }
 
-
-    MStarLocalPos *starSource = 0;
-    TIter nextSource(fSourceLocalCam->GetList());
-
-    starSource = (MStarLocalPos*)nextSource();
-    if (starSource)
-    {
-      if (fInputType == 2)
-      {
-        x = scale * starSource->GetMeanXCGFit(); 
-        y = scale * starSource->GetMeanYCGFit(); 
-      }
-      else if (fInputType == 1)
-      {
-        x = scale * starSource->GetMeanXFit(); 
-        y = scale * starSource->GetMeanYFit(); 
-      }
-      else 
-      {
-        x = scale * starSource->GetMeanXCalc(); 
-        y = scale * starSource->GetMeanYCalc(); 
-      }
-
-      if (x>lowx  && x<higx  && y>lowy  && y<higy)
-      {
-        fEstPos1  ->Fill(x, y, w);
-      }
-
-
-      starSource = (MStarLocalPos*)nextSource();
+    if (fSourceCam)
+    {
+      MStarPos *starSource = 0;
+      TIter nextSource(fSourceCam->GetList());
+
+      starSource = (MStarPos*)nextSource();
       if (starSource)
       {
-        if (fInputType == 2)
-        {
-          x = scale * starSource->GetMeanXCGFit(); 
-          y = scale * starSource->GetMeanYCGFit(); 
-        }
-        else if (fInputType == 1)
+        if (fInputType == 1)
         {
           x = scale * starSource->GetMeanXFit(); 
@@ -440,5 +465,49 @@
         if (x>lowx  && x<higx  && y>lowy  && y<higy)
         {
-          fEstPos2  ->Fill(x, y, w);
+          fEstPos1  ->Fill(x, y, w);
+          //fEstPos1->SetName(starSource->GetName());
+        }
+
+
+        starSource = (MStarPos*)nextSource();
+        if (starSource)
+        {
+          if (fInputType == 1)
+          {
+            x = scale * starSource->GetMeanXFit(); 
+            y = scale * starSource->GetMeanYFit(); 
+          }
+          else 
+          {
+            x = scale * starSource->GetMeanXCalc(); 
+            y = scale * starSource->GetMeanYCalc(); 
+          }
+
+          if (x>lowx  && x<higx  && y>lowy  && y<higy)
+          {
+            fEstPos2  ->Fill(x, y, w);
+            //fEstPos2->SetName(starSource->GetName());
+          }
+
+          starSource = (MStarPos*)nextSource();
+          if (starSource)
+          {
+            if (fInputType == 1)
+            {
+              x = scale * starSource->GetMeanXFit(); 
+              y = scale * starSource->GetMeanYFit(); 
+            }
+            else 
+            {
+              x = scale * starSource->GetMeanXCalc(); 
+              y = scale * starSource->GetMeanYCalc(); 
+            }
+
+            if (x>lowx  && x<higx  && y>lowy  && y<higy)
+            {
+              fEstPos3  ->Fill(x, y, w);
+              //fEstPos3->SetName(starSource->GetName());
+            }
+	  }
         }
       }
@@ -457,4 +526,6 @@
 Bool_t MHTelAxisFromStars::Finalize()
 {
+  //*fLog << "MHTelAxisFromStars::Finalize;  fSourceCam = " 
+  //      << fSourceCam  << endl; 
 
   return kTRUE;
@@ -475,8 +546,8 @@
   AppendPad("");
   
-  //TCanvas *pad = new TCanvas("TelAxisFromStars", "TelAxis plots", 900, 900);
+  //TCanvas *pad = new TCanvas("TelAxisFromStars", "TelAxis plots", 1200, 900);
   //gROOT->SetSelectedPad(NULL);
 
-    pad->Divide(3,3);
+    pad->Divide(4,3);
 
     pad->cd(1);
@@ -490,19 +561,23 @@
     pad->cd(3);
     gPad->SetBorderMode(0);
-    fChi2Prob->Draw(opt); 
+    fLog10Chi2->Draw(opt); 
 
     pad->cd(4);
     gPad->SetBorderMode(0);
-    fNumIter->Draw(opt);
+    fChi2Prob->Draw(opt); 
 
     pad->cd(5);
     gPad->SetBorderMode(0);
-    fLambda->Draw(opt);
+    fNumIter->Draw(opt);
 
     pad->cd(6);
     gPad->SetBorderMode(0);
+    fLambda->Draw(opt);
+
+    pad->cd(7);
+    gPad->SetBorderMode(0);
     fAlfa->Draw(opt);
 
-    pad->cd(7);
+    pad->cd(8);
     gPad->SetBorderMode(0);
     //SetColors();
@@ -510,13 +585,71 @@
     fShift->Draw("");
 
-    pad->cd(8);
-    gPad->SetBorderMode(0);
-    //SetColors();
-    fEstPos1->Draw("");
-
-    pad->cd(9);
-    gPad->SetBorderMode(0);
-    //SetColors();
-    fEstPos2->Draw("");
+
+    //-----------------------------------------------
+    // plot the expected positions of some sources
+    *fLog << "fSourcsCam = " << fSourceCam << endl;
+
+    /*
+    // copy names from MStarCam to the histograms
+    if (fSourceCam)
+    {
+      *fLog << "Source container exists " << endl;
+
+      MStarPos *starSource = 0;
+      TIter nextSource(fSourceCam->GetList());
+
+      *fLog << "&nextSource = " << &nextSource << endl;
+
+      starSource = (MStarPos*)nextSource();
+      if (starSource)
+      {
+        *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 (fSourceCam)
+    {
+      *fLog << "MHTelAxisFromSrars::Draw; plotting" << endl;
+
+      pad->cd(9);
+      gPad->SetBorderMode(0);
+      //SetColors();
+      fEstPos1->Draw("");
+
+      pad->cd(10);
+      gPad->SetBorderMode(0);
+      //SetColors();
+      fEstPos2->Draw("");
+
+      pad->cd(11);
+      gPad->SetBorderMode(0);
+      //SetColors();
+      fEstPos3->Draw("");
+    }
 
     pad->Modified();
@@ -533,4 +666,6 @@
     if (name.Contains("NdoF", TString::kIgnoreCase))
         return fNdoF;
+    if (name.Contains("Log10Chi2", TString::kIgnoreCase))
+        return fLog10Chi2;
     if (name.Contains("Chi2Prob", TString::kIgnoreCase))
         return fChi2Prob;
@@ -548,4 +683,6 @@
     if (name.Contains("EstPos2", TString::kIgnoreCase))
         return fEstPos2;
+    if (name.Contains("EstPos3", TString::kIgnoreCase))
+        return fEstPos3;
 
     return NULL;
Index: /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.h
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.h	(revision 4704)
+++ /trunk/MagicSoft/Mars/mtemp/MHTelAxisFromStars.h	(revision 4705)
@@ -11,5 +11,5 @@
 class MSrcPosCam;
 class MSkyCamTrans;
-class MStarLocalCam;
+class MStarCam;
 
 class MHTelAxisFromStars : public MH
@@ -19,4 +19,5 @@
     TH1D *fNStars;     //-> Number of stars
     TH1D *fNdoF;       //-> Number of degrees of freedom
+    TH1D *fLog10Chi2;  //-> log10(Chi2) 
     TH1D *fChi2Prob;   //-> Chi2 probability
     TH1D *fNumIter;    //-> Number of iterations
@@ -27,9 +28,10 @@
     TH2D *fEstPos1;    //-> Estimated position 1
     TH2D *fEstPos2;    //-> Estimated position 2
+    TH2D *fEstPos3;    //-> Estimated position 3
 
-    MStarLocalCam   *fStarLocalCam;     //!
-    MStarLocalCam   *fSourceLocalCam;   //!
-    MSrcPosCam      *fSrcPos;           //!
-    MSkyCamTrans    *fSkyCamTrans;      //!
+    MStarCam        *fStarCam;     //!
+    MStarCam        *fSourceCam;   
+    MSrcPosCam      *fSrcPos;      //!
+    MSkyCamTrans    *fSkyCamTrans; //!
 
 
@@ -58,4 +60,5 @@
     TH1D *GetHistNStars()    { return fNStars;    }
     TH1D *GetHistNdoF()      { return fNdoF;      }
+    TH1D *GetHistLog10Chi2() { return fLog10Chi2; }
     TH1D *GetHistChi2Prob()  { return fChi2Prob;  }
 
@@ -68,4 +71,5 @@
     TH2D *GetHistEstPos1()   { return fEstPos1;   }
     TH2D *GetHistEstPos2()   { return fEstPos2;   }
+    TH2D *GetHistEstPos3()   { return fEstPos3;   }
 
     void Draw(Option_t *opt=NULL);
Index: /trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.cc	(revision 4704)
+++ /trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.cc	(revision 4705)
@@ -34,5 +34,5 @@
 //
 //  Input Containers :
-//   MStarLocalCam[MStarLocalCam], MStarLocalCamSource[MStarLocalCam]
+//   MStarCam[MStarCam], MStarCamSource[MStarCam]
 //
 //  Output Containers :
@@ -53,6 +53,6 @@
 #include "MLogManip.h"
 
-#include "MStarLocalCam.h"
-#include "MStarLocalPos.h"
+#include "MStarCam.h"
+#include "MStarPos.h"
 #include "MSkyCamTrans.h"
 
@@ -78,8 +78,8 @@
     fFixedRotationAngle = 0.0;
 
-    // default type of input is :    the result of the correlated Gauss fit
+    // default type of input is :    the result of the Gauss fit
     // type 0 : result from the weighted average
-    // type 1 : result from the uncorrelated Gauss fit
-    fInputType = 2;
+    // type 1 : result from the Gauss fit
+    fInputType = 1;
 }
 
@@ -100,16 +100,16 @@
 {
   
-   fStarLocalCam = (MStarLocalCam*)pList->FindObject("MStarLocalCam", "MStarLocalCam");
-   if (!fStarLocalCam)
+   fStarCam = (MStarCam*)pList->FindObject("MStarCam", "MStarCam");
+   if (!fStarCam)
    {
-       *fLog << err << "MTelAxisFromStars::PreProcess; container 'MStarLocalCam' not found... aborting." << endl;
+       *fLog << err << "MTelAxisFromStars::PreProcess; container 'MStarCam' not found... aborting." << endl;
        return kFALSE;
    }
 
    
-   fSourceLocalCam = (MStarLocalCam*)pList->FindObject("MSourceLocalCam", "MStarLocalCam");
-   if (!fSourceLocalCam)
+   fSourceCam = (MStarCam*)pList->FindObject("MSourceCam", "MStarCam");
+   if (!fSourceCam)
    {
-       *fLog << err << "MTelAxisFromStars::PreProcess; container 'MSourceLocalCam' not found... continue  " << endl;
+       *fLog << err << "MTelAxisFromStars::PreProcess; container 'MSourceCam' not found... continue  " << endl;
    }
 
@@ -138,11 +138,14 @@
 //
 //     type = 0        calculated star positions (by averaging)
-//     type = 1        fitted star positions (by uncorrelated Gauss fit)
-//     type = 2        fitted star positions (by correlated   Gauss fit)
+//     type = 1        fitted star positions (by Gauss fit)
 //
 void MTelAxisFromStars::SetInputType(Int_t type)
 {
-  *fLog << all << "MTelAxisFromStars::SetInputType; input type is set equal to : " 
-        << type << endl;
+  *fLog << all   << "MTelAxisFromStars::SetInputType; input type is set equal to : " 
+        << type ;
+  if (type == 0)
+    *fLog << " (calculated star positions)" << endl;
+  else
+    *fLog << " (fitted star positions)" << endl;
 
   fInputType = type;
@@ -197,6 +200,6 @@
 
   // get the expected (axy[0], axy[1]) and the measured positions 
-  // (bxy[0], bxy[1]) of stars in the camera from MStarLocalCam 
-  Int_t fNumStars = fStarLocalCam->GetNumStars();
+  // (bxy[0], bxy[1]) of stars in the camera from MStarCam 
+  Int_t fNumStars = fStarCam->GetNumStars();
 
   if (fNumStars <= 0)
@@ -229,10 +232,10 @@
   Double_t fChi2Prob;
 
-  MStarLocalPos *star = 0;
-  TIter next(fStarLocalCam->GetList());
+  MStarPos *star = 0;
+  TIter next(fStarCam->GetList());
   Int_t ix = 0;
 
   // loop over all stars
-  while ( (star = (MStarLocalPos*)next()) )
+  while ( (star = (MStarPos*)next()) )
   {
     axy[0][ix]   = star->GetXExp(); 
@@ -242,43 +245,40 @@
     {
       // values from averaging
-      bxy[0][ix]   = star->GetMeanXCalc(); 
-      bxy[1][ix]   = star->GetMeanYCalc(); 
-      exy[0][0][ix]= star->GetSigmaMinorAxisCalc()*star->GetSigmaMinorAxisCalc(); 
-      exy[0][1][ix]  =  0.0;
-      exy[1][0][ix]  =  0.0;
-      exy[1][1][ix]= star->GetSigmaMajorAxisCalc()*star->GetSigmaMajorAxisCalc(); 
+      bxy[0][ix]     = star->GetMeanXCalc(); 
+      bxy[1][ix]     = star->GetMeanYCalc(); 
+
+      // this is the error matrix for (MeanXCalc, MeanYCalc);
+      // this is the error matrix which should be used
+      exy[0][0][ix]  =  star->GetXXErrCalc(); 
+      exy[0][1][ix]  =  star->GetXYErrCalc();
+      exy[1][0][ix]  =  star->GetXYErrCalc();
+      exy[1][1][ix]  =  star->GetYYErrCalc();
+
+      //exy[0][0][ix]  = star->GetSigmaXCalc()*star->GetSigmaXCalc(); 
+      //exy[0][1][ix]  =  0.0;
+      //exy[1][0][ix]  =  0.0;
+      //exy[1][1][ix]  = star->GetSigmaYCalc()*star->GetSigmaYCalc(); 
     }
 
     else if (fInputType == 1)
     {
-      // values from uncorrelatd Gauss fit
+      // values from Gauss fit
       bxy[0][ix]   = star->GetMeanXFit(); 
       bxy[1][ix]   = star->GetMeanYFit(); 
-      exy[0][0][ix]= star->GetSigmaMinorAxisFit()*star->GetSigmaMinorAxisFit(); 
-      exy[0][1][ix]  =  0.0;
-      exy[1][0][ix]  =  0.0;
-      exy[1][1][ix]= star->GetSigmaMajorAxisFit()*star->GetSigmaMajorAxisFit(); 
-    }
-
-    else if (fInputType == 2)
-    {
-      // values from correlatd Gauss fit
-      bxy[0][ix]   = star->GetMeanXCGFit(); 
-      bxy[1][ix]   = star->GetMeanYCGFit(); 
-
-      // this is the error matrix for (MeanXCGFit, MeanYCGFit);
+
+      // this is the error matrix for (MeanXFit, MeanYFit);
       // this is the error matrix which should be used
-      exy[0][0][ix]  =  star->GetXXErrCGFit(); 
-      exy[0][1][ix]  =  star->GetXYErrCGFit();
-      exy[1][0][ix]  =  star->GetXYErrCGFit();
-      exy[1][1][ix]  =  star->GetYYErrCGFit();
-
-      // this is the error matrix constructed from SigmaXCGFit and SigmaYCGFit;
+      exy[0][0][ix]  =  star->GetXXErrFit(); 
+      exy[0][1][ix]  =  star->GetXYErrFit();
+      exy[1][0][ix]  =  star->GetXYErrFit();
+      exy[1][1][ix]  =  star->GetYYErrFit();
+
+      // this is the error matrix constructed from SigmaXFit and SigmaYFit;
       // it is used because the errors above are too small, at present
-      //exy[0][0][ix]  =  star->GetSigmaXCGFit() * star->GetSigmaXCGFit(); 
-      //exy[0][1][ix]  =  star->GetCorrXYCGFit() * 
-      //                  star->GetSigmaXCGFit() * star->GetSigmaYCGFit();
+      //exy[0][0][ix]  =  star->GetSigmaXFit() * star->GetSigmaXFit(); 
+      //exy[0][1][ix]  =  star->GetCorrXYFit() * 
+      //                  star->GetSigmaXFit() * star->GetSigmaYFit();
       //exy[1][0][ix]  =  exy[0][1][ix];
-      //exy[1][1][ix]  =  star->GetSigmaYCGFit() * star->GetSigmaYCGFit();
+      //exy[1][1][ix]  =  star->GetSigmaYFit() * star->GetSigmaYFit();
     }
 
@@ -375,5 +375,5 @@
   //--------------------------------------
   // Put the estimated position, obtained by transforming the expected
-  // position (0, 0), into SrcPosCam
+  // position (0,0), into SrcPosCam
 
   fSrcPos->SetXY(fD[0], fD[1]);
@@ -386,7 +386,10 @@
   //      and their error matrices esxy[2][2]
 
-  // get the expected positions (asxy[1], asxy[2]) from another MStarLocalCam 
-  // container (with the name "MSourceLocalCam") 
-  Int_t fNumStarsSource = fSourceLocalCam->GetNumStars();
+  // get the expected positions (asxy[1], asxy[2]) from another MStarCam 
+  // container (with the name "MSourceCam") 
+  Int_t fNumStarsSource = 0; 
+
+  if (fSourceCam)
+    fNumStarsSource = fSourceCam->GetNumStars();
 
   //*fLog << "MTelAxisFromStars::Process;  fNumStarsSource = " 
@@ -409,8 +412,8 @@
     esxy[1][1].Set(fNumStarsSource);
 
-    MStarLocalPos *starSource = 0;
-    TIter nextSource(fSourceLocalCam->GetList());
+    MStarPos *starSource = 0;
+    TIter nextSource(fSourceCam->GetList());
     ix = 0;
-    while ( (starSource = (MStarLocalPos*)nextSource()) )
+    while ( (starSource = (MStarPos*)nextSource()) )
     {
       asxy[0][ix]  = starSource->GetXExp(); 
@@ -422,22 +425,15 @@
     TransSkyCam(fLambda, fA, fD, fErrD, asxy, bsxy,  esxy);   
 
-    // put the estimated positions into the MStarLocalPos container
-    TIter setnextSource(fSourceLocalCam->GetList());
+    // put the estimated positions into the MStarCam container
+    // with name "MSourceCam"
+    TIter setnextSource(fSourceCam->GetList());
     ix = 0;
-    while ( (starSource = (MStarLocalPos*)setnextSource()) )
-    {
-      if (fInputType == 1)
-      {
-        starSource->SetFitValues(100.0, 100.0,   bsxy[0][ix],    bsxy[1][ix],
-              sqrt(esxy[0][0][ix]), sqrt(esxy[1][1][ix]), fChi2, fNdof); 
-      }
-      else if (fInputType == 2)
-      {
-        Double_t corr = esxy[0][1][ix]/ sqrt( esxy[0][0][ix] * esxy[1][1][ix] );
-        starSource->SetCGFitValues(100.0, 100.0, bsxy[0][ix], bsxy[1][ix],
-	      sqrt(esxy[0][0][ix]), sqrt(esxy[1][1][ix]), corr,
-              esxy[0][0][ix], esxy[0][1][ix],  esxy[1][1][ix], 
-              fChi2, fNdof); 
-      }
+    while ( (starSource = (MStarPos*)setnextSource()) )
+    {
+       Double_t corr = esxy[0][1][ix]/ sqrt( esxy[0][0][ix] * esxy[1][1][ix] );
+       starSource->SetFitValues(100.0, 100.0, bsxy[0][ix], bsxy[1][ix],
+	        sqrt(esxy[0][0][ix]), sqrt(esxy[1][1][ix]), corr,
+                esxy[0][0][ix],       esxy[0][1][ix],       esxy[1][1][ix], 
+                fChi2, fNdof); 
 
       ix++;
Index: /trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.h
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.h	(revision 4704)
+++ /trunk/MagicSoft/Mars/mtemp/MTelAxisFromStars.h	(revision 4705)
@@ -21,5 +21,5 @@
 
 class MSrcPosCam;
-class MStarLocalCam;
+class MStarCam;
 class MSkyCamTrans;
 
@@ -28,6 +28,6 @@
  private:
 
-    const MStarLocalCam *fStarLocalCam;          //!
-    const MStarLocalCam *fSourceLocalCam;        //!
+    const MStarCam *fStarCam;          //!
+    const MStarCam *fSourceCam;        //!
 
     MSrcPosCam          *fSrcPos;         //!
