Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1744)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1745)
@@ -3,13 +3,14 @@
  2003/02/06: Thomas Bretz
 
-   * mbase/MLog.[h,cc]:
-     - serialized the GUI output (problems with mutithreded prgs, eg Cosy)
-
-   * mtemp/MObservatoryLocation.[h,cc], mtemp/MVPObject.[h,cc],
-     mtemp/MVPPlotter.[h,cc]:
-     - added changes discussed in Wuerzburg
-
-   * mfileio/MCT1ReadPreProc.cc:
-     - some simplifications
+    * mbase/MLog.[h,cc]:
+      - serialized the GUI output (problems with mutithreded prgs,
+        eg Cosy)
+
+    * mtemp/MObservatoryLocation.[h,cc], mtemp/MVPObject.[h,cc],
+      mtemp/MVPPlotter.[h,cc]:
+      - added changes discussed in Wuerzburg
+   
+    * mfileio/MCT1ReadPreProc.cc:
+      - some simplifications
 
 
@@ -22,10 +23,11 @@
         color of a given pixel 
 
-    * created two new classes for simulating the second level trigger in the 
-      directory manalysis:
-      - MTrigLvl2.[cc|h]         // Implement the Lvl2 topology and selection
-                                 // strategies
-      - MTrigLvl2FillTask.[cc|h] // For a given MMc event, fill the MTrigLvl2 
-                                    with the Lvl1 trigger information 
+    * created two new classes for simulating the second level trigger 
+      in the directory manalysis:
+      - MTrigLvl2.[cc|h]         // Implement the Lvl2 topology and
+                                 // selection strategies
+      - MTrigLvl2FillTask.[cc|h] // For a given MMc event, fill the
+                                 // MTrigLvl2 with the Lvl1 trigger 
+                                 // information 
 
     * manalysis/Makefile
@@ -38,11 +40,11 @@
  2003/01/27: Robert Wagner
 
-  * mfileio/MCT1ReadPreProc.[cc|h]
-    - Added call of MTaskList::ReInit after processing of new 
-      run header
-    - Filling of MC container complies to Oscar's changes of 
-      MMcEvt.[hxx,cxx] dated 2003/01/20
-    - Added filling of run number in MRawRunHeader object while
-      processing a new run header
+    * mfileio/MCT1ReadPreProc.[cc|h]
+      - Added call of MTaskList::ReInit after processing of new 
+        run header
+      - Filling of MC container complies to Oscar's changes of 
+        MMcEvt.[hxx,cxx] dated 2003/01/20
+      - Added filling of run number in MRawRunHeader object while
+        processing a new run header
 
 
@@ -50,7 +52,7 @@
  2003/01/23: Robert Wagner
 
-  * manalyis/MSigmabarCalc.cc
-    - MSigmabarCalc::Process()
-      Replaced fMcEvt->GetTheta() by fMcEvt->GetTelescopeTheta()
+    * manalyis/MSigmabarCalc.cc
+      - MSigmabarCalc::Process()
+        Replaced fMcEvt->GetTheta() by fMcEvt->GetTelescopeTheta()
 
 
@@ -58,38 +60,38 @@
  2003/01/20: Oscar Blanch
   
-  * mmc/MMcEvt.[hxx,cxx]
-    - Data members: fElecCphFraction, fMuonCphFraction, 
-      fOtherCphFraction have been introduced.
-    - Class version updated to 3.
-
-  * mmc/MMcCorsikaRunHeader.[h.cc]
-    - Data members: fWobbleMode and fAtmosphericModel introduced.
-    - Class version updated to 2.
+    * mmc/MMcEvt.[hxx,cxx]
+      - Data members: fElecCphFraction, fMuonCphFraction, 
+        fOtherCphFraction have been introduced.
+      - Class version updated to 3.
+
+    * mmc/MMcCorsikaRunHeader.[h.cc]
+      - Data members: fWobbleMode and fAtmosphericModel introduced.
+      - Class version updated to 2.
 
 
 
  2003/01/19: Thomas Bretz
- 
-   * manalysis/MCerPhotCalc.[h,cc]:
-     - slight changes, mainly to the layout
-   
-   * manalysis/MCerPhotEvt.[h,cc]:
-     - some small changes to make the code a bit faster
-
-   * manalysis/MCerPhotPix.[h,cc]:
-     - added AddNumPhotons
-     
-   * mbase/MContinue.[h,cc]:
-     - changed comments
-     - enhanced functionality and fixed some small bugs
-
-   * mbase/Makefile:
-     - added mfilter to paths (to be fixed)
-   
-   * mfileio/MCT1ReadPreProc.cc:
-     - Init fNumEvents = 0
-     
-   * mgeom/MGeomCam.cc:
-     - return 0 Ratio if the pixel number exceeds the number of pixels
+
+    * manalysis/MCerPhotCalc.[h,cc]:
+      - slight changes, mainly to the layout
+
+    * manalysis/MCerPhotEvt.[h,cc]:
+      - some small changes to make the code a bit faster
+
+    * manalysis/MCerPhotPix.[h,cc]:
+      - added AddNumPhotons
+
+    * mbase/MContinue.[h,cc]:
+      - changed comments
+      - enhanced functionality and fixed some small bugs
+
+    * mbase/Makefile:
+      - added mfilter to paths (to be fixed)
+
+    * mfileio/MCT1ReadPreProc.cc:
+      - Init fNumEvents = 0
+
+    * mgeom/MGeomCam.cc:
+      - return 0 Ratio if the pixel number exceeds the number of pixels
 
    * mgui/MCamDisplay.[h,cc]:
@@ -99,22 +101,22 @@
      - fixed the context menu display
    
-   * mhist/HistLinkDef.h, mhist/Makefile:
-     - added MHCerPhotEvt
-
-   * mhist/MHCerPhotEvt.[h,cc]:
-     - added
-     
-   * mhist/MFillH.cc:
-     - changed the initialization of fParContainer from pList to NULL
-   
-   * mhist/MHHillasExt.cc:
-     - fixed a smallo bug when filling the histograms (crached when scaling
-       under some circumstances)
-   
-   * mhist/MHStarMap.cc:
-     - added a warning output
-
-   * mmontecarlo/MMcCollectionAreaCalc.cc:
-     - added a check for impact=NaN (some MC Files have this)
+    * mhist/HistLinkDef.h, mhist/Makefile:
+      - added MHCerPhotEvt
+
+    * mhist/MHCerPhotEvt.[h,cc]:
+      - added
+     
+    * mhist/MFillH.cc:
+      - changed the initialization of fParContainer from pList to NULL
+   
+    * mhist/MHHillasExt.cc:
+      - fixed a smallo bug when filling the histograms (crached when scaling
+        under some circumstances)
+   
+    * mhist/MHStarMap.cc:
+      - added a warning output
+
+    * mmontecarlo/MMcCollectionAreaCalc.cc:
+      - added a check for impact=NaN (some MC Files have this)
 
 
@@ -163,13 +165,7 @@
       	otherwise, we got a compilation error in Alpha machines.
 
-<<<<<<< Changelog
-
-
- 2002/12/13: Oscar Blanch
-=======
 
 
  2002/12/13: Oscar blanch
->>>>>>> 1.369
 
     * mgeom/MGeomMirror.[h,cc]
Index: /trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc	(revision 1744)
+++ /trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc	(revision 1745)
@@ -431,4 +431,7 @@
     fIn->read((Byte_t*)&outpars, sizeof(struct outputpars));
 
+<<<<<<< MCT1ReadPreProc.cc
+    return ProcessRunHeader(outpars);
+=======
     ProcessRunHeader(outpars);
 
@@ -438,4 +441,5 @@
 
     return kTRUE;
+>>>>>>> 1.13
 }
 
@@ -908,16 +912,10 @@
         *fLog << "-----------------------------------------------------------------------" << endl;
 
-	switch (ReadRunHeader())
-	  {
-	  case kTRUE:
-	    return kTRUE;
-	    break;
-	  case -1:
-	    *fLog << warn << "ReInit of Tasklist didn't succeed." << endl;
-	    return kFALSE;
-	    break;
-          default:
-            return kTRUE;
-	  }
+        if (ReadRunHeader() < 0)
+        {
+            *fLog << warn << "ReInit of Tasklist didn't succeed." << endl;
+            return kFALSE;
+        }
+        return kTRUE;
     }
 }
Index: /trunk/MagicSoft/Mars/mtemp/MObservatoryLocation.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MObservatoryLocation.cc	(revision 1744)
+++ /trunk/MagicSoft/Mars/mtemp/MObservatoryLocation.cc	(revision 1745)
@@ -38,15 +38,37 @@
 ClassImp(MObservatoryLocation);
 
-MObservatoryLocation::MObservatoryLocation(const char *name, const char *title)
+void MObservatoryLocation::Init(const char *name, const char *title)
 {
     fName  = name  ? name  : "MObservatoryLocation";
     fTitle = title ? title : "Storage container for coordinates of an observatory";   
-    //    TH1F fHorizon=new TH1F;   
-    fgDegToRad=2*TMath::Pi()/360;    
-    fLatitude  =  28.7594 * fgDegToRad; // rad; 28 45 34
-    fLongitude =  17.8761 * fgDegToRad; // rad; 17 52 34;
+}
+
+MObservatoryLocation::MObservatoryLocation(const char *name, const char *title)
+{
+    Init();
+
+    fLatitude  =  28.7594 / kRad2Deg; // rad; 28 45 34
+    fLongitude =  17.8761 / kRad2Deg; // rad; 17 52 34;
                                         // slalib uses + for WEST !!!
     fElevation = 2300; // m
     fObsName = "Observatorio del Roque de los Muchachos";
+}
+
+MObservatoryLocation::MObservatoryLocation(LocationName_t name, const char *name=NULL, const char *title=NULL)
+{
+    Init();
+
+    switch (name)
+    {
+    case kMagic1:
+    case kMagic2:
+    case kRobertGarten:
+        fLatitude  =  28.7594 / kRad2Deg; // rad; 28 45 34
+        fLongitude =  17.8761 / kRad2Deg; // rad; 17 52 34;
+                                          // slalib uses + for WEST !!!
+        fElevation = 2300; // m
+        fObsName = "Observatorio del Roque de los Muchachos";
+        break;
+    }
 }
 
@@ -64,6 +86,7 @@
   *fLog << all;
   *fLog << fObsName << endl;
-  *fLog << "Latitude " << (fLatitude > 0 ? (fLatitude/fgDegToRad) : -(fLatitude/fgDegToRad)) << " deg " << (fLatitude > 0 ? "W" : "E") << endl;
-  *fLog << "Longitude " << (fLongitude > 0 ? (fLongitude/fgDegToRad) : -(fLongitude/fgDegToRad)) <<" deg " << (fLongitude < 0 ? "N" : "S") << endl;
+  *fLog << "Latitude " << (fLatitude > 0 ? (fLatitude*kRad2Deg) : -(fLatitude*kRad2Deg)) << " deg " << (fLatitude > 0 ? "W" : "E") << endl;
+  *fLog << "Longitude " << (fLongitude > 0 ? (fLongitude*kRad2Deg) : -(fLongitude*kRad2Deg)) <<" deg " << (fLongitude < 0 ? "N" : "S") << endl;
   *fLog << "Elevation " << fElevation << "m" << endl;
 }
+
Index: /trunk/MagicSoft/Mars/mtemp/MObservatoryLocation.h
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MObservatoryLocation.h	(revision 1744)
+++ /trunk/MagicSoft/Mars/mtemp/MObservatoryLocation.h	(revision 1745)
@@ -9,28 +9,38 @@
 {
 private:
-  char* fObsName;
+  TString  fObsName;
   Double_t fLatitude;
   Double_t fLongitude;
   Double_t fElevation;
-  Double_t fgDegToRad;
+  static Double_t fgDegToRad;
   //  TH1F     fHorizon;
 
+  void Init(const char *name, const char *title);
+
 public:
+    enum LocationName_t
+    {
+        kMagic1,
+        kMagic2,
+        kRobertGarten
+    };
+
   MObservatoryLocation(const char *name=NULL, const char *title=NULL);
+  MObservatoryLocation(LocationName_t name, const char *name=NULL, const char *title=NULL);
   ~MObservatoryLocation();
 
-  inline void SetLatitude(Double_t latitude) { fLatitude = latitude; }
-  inline void SetLongitude(Double_t longitude) { fLongitude = longitude; }
-  inline void SetElevation(Double_t elevation) { fElevation = elevation; }
-  inline void SetObservatoryName(char* name) { fObsName = name; }
+  void SetLatitude(Double_t latitude)   { fLatitude = latitude; }
+  void SetLongitude(Double_t longitude) { fLongitude = longitude; }
+  void SetElevation(Double_t elevation) { fElevation = elevation; }
+  void SetObservatoryName(TString name) { fObsName = name; }
   
-  void MObservatoryLocation::Print(Option_t *) const;
+  void Print(Option_t *) const;
   
-  inline Double_t GetLatitude() { return fLatitude/fgDegToRad; }
-  inline Double_t GetLongitude() { return fLongitude/fgDegToRad; }
-  inline Double_t GetElevation() { return fElevation; }
-  Double_t GetLatitudeRad() { return fLatitude; }
-  Double_t GetLongitudeRad() { return fLongitude; }
-  char* GetObservatoryName() { return fObsName; }
+  Double_t GetLatitude() const        { return fLatitude*kRad2Deg; }
+  Double_t GetLongitude() const       { return fLongitude*kRad2Deg; }
+  Double_t GetElevation() const       { return fElevation; }
+  Double_t GetLatitudeRad() const     { return fLatitude; }
+  Double_t GetLongitudeRad() const    { return fLongitude; }
+  TString  GetObservatoryName() const { return fObsName; }
   // Double_t GetHorizon(Double_t phi);
   // void SetHorizonLine(TF1 hor) { fHorizon = hor; }
Index: /trunk/MagicSoft/Mars/mtemp/MVPObject.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MVPObject.cc	(revision 1744)
+++ /trunk/MagicSoft/Mars/mtemp/MVPObject.cc	(revision 1745)
@@ -113,48 +113,16 @@
 // HHMMsDDT, where RA is given in hours and minutes and Declination is
 // given by degrees DD and tenths of degrees T. "s" may be "+" or
-// "-"
-//
-void MVPObject::SetObjectByName(char* object)
+// "-", eg. "1959+650"
+//
+void MVPObject::SetObjectByName(const char *object)
 {
   fObjectName=object;
   fGotName=kTRUE;
   
-//   cout<<"OBJ:"<<object<<endl;
-
-  unsigned int delim=0;
-  for (unsigned int i=0; i<strlen(object); i++) 
-    if ((object[i]=='+')||(object[i]=='-'))
-      delim=i;
-  
-  char ra[6];
-  char de[6];
-  
-  unsigned int i;
-  for (i=0;  i<=delim; i++)
-    ra[i]=object[i];
-  ra[i-1]=0;
-
-  for (i=delim+1;  i<strlen(object); i++)
-    de[i-delim-1]=object[i];
-  de[i-delim-1]=0;
-
-  Float_t RA, Dec;
-
-  sscanf(ra,"%f",&RA);
-  sscanf(de,"%f",&Dec);
-
-//   cout<<"OBJd:"<<Dec<<endl; //220
-//   cout<<"OBJr:"<<RA<<endl; //1959
-
-  if (object[delim]=='-') Dec*=-1;
-
-  fRA=(Double_t)( fgHrsToRad*  ((Int_t)(RA/100) + ( RA-(Int_t)(RA/100)*100)/60        ));
-  fDec=(Double_t)( fgDegToRad* ((Int_t)(Dec/10) + (Dec-(Int_t)(Dec/10)*10 )/10        ));
-
- //  fRA=(Double_t)( fgHrsToRad*  ((Int_t)(RA/100)   + ((RA / 100)-(Int_t)(RA/100))/60   ));
-//   fDec=(Double_t)( fgDegToRad* ((Int_t)(Dec/10)  + ((Dec / 10)-(Int_t)(Dec/100))/10 ));
-
-//     cout<<"OBJd:"<<fDec/fgDegToRad<<endl;
-//     cout<<"OBJr:"<<fRA/fgHrsToRad<<endl;
+  Int_t ra, dec;
+  sscanf(object, "%d%d", &ra, &dec);
+
+  fRA  = fgHrsToRad * (0.01*ra + (r%100)/60.);
+  fDec = fgDegToRad * 0.1 * dec;
 
   fGotRA=kTRUE;
Index: /trunk/MagicSoft/Mars/mtemp/MVPPlotter.cc
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MVPPlotter.cc	(revision 1744)
+++ /trunk/MagicSoft/Mars/mtemp/MVPPlotter.cc	(revision 1745)
@@ -190,8 +190,10 @@
   // each month [1]..[12]
   Float_t visibility[13][18];
+  memset(visibility, 0, 13*18*sizeof(Float_t));
+  /*
   for (int m=0;m<13;m++)
     for (int z=0;z<18;z++)
       visibility[m][z]=0;
-
+  */
   int fday, ftime;
   Double_t phase=0;	
@@ -201,7 +203,6 @@
     Double_t todaysPhase=0;
     Double_t moonIntensity;
-    UInt_t i;
     obsHours=0;
-    for (i=0; i<daySlices; i++)
+    for (UInt_t i=0; i<daySlices; i++)
       {	 
 	// Rearrange filling of bins such that a "day" doesn't start at midnight,
@@ -251,5 +252,5 @@
 
 	  // If moon is not up (or we should not use moon information...)
-	  if ((!fUseMoon)||(fMoon->GetAltitudeDeg()<=0)||(moonIntensity<60)) {
+	  if (!fUseMoon || fMoon->GetAltitudeDeg()<=0 || moonIntensity<60) {
 	    // Fill MJD-UTC histogram
 	    fMjdUtcYear->Fill(fgSecPerDay*(fday-fgMJD010170),fgSecPerDay*ftime/daySlices,fObject->GetAltitudeDeg());
@@ -296,7 +297,7 @@
 
       Double_t distance = fVenus->GetDistance(fObject);
-      distance = distance < fMars->GetDistance(fObject) ? distance : fMars->GetDistance(fObject);
-      distance = distance < fJupiter->GetDistance(fObject) ? distance : fJupiter->GetDistance(fObject);
-      distance = distance < fSaturn->GetDistance(fObject) ? distance : fSaturn->GetDistance(fObject);
+      distance = TMath::Min(distance, fMars->GetDistance(fObject));
+      distance = TMath::Min(distance, fJupiter->GetDistance(fObject));
+      distance = TMath::Min(distance, fSaturn->GetDistance(fObject));
 
       fMjdPlanetDistance->Fill(fgSecPerDay*(fday-fgMJD010170),distance);      
@@ -319,19 +320,19 @@
       printf("%5d ",(Int_t)(visibility[m][z]/60));	
     }
-    cout<<endl;
+    printf("\n");
   }
   
   int vistimestart=0;
   int vistimeend=0;  
-  for (int m=1;m<13;m++) {
+  for (int m=1; m<13; m++) {
     int n = (m==1 ? 12 : m-1);
-    if (((visibility[m][8]/60)>20)&&((visibility[n][8])/60 <= 20)) {
+    if (visibility[m][8]/60>20 && visibility[n][8]/60<=20) {
       vistimestart=m; // we're on the rising slope
     }
   }
   
-  for (int m=1;m<13;m++) {
+  for (int m=1; m<13; m++) {
     int n = (m==1 ? 12 : m-1);
-    if (((visibility[m][8]/60)<20)&&((visibility[n][8]/60)>=20)) {
+    if (visibility[m][8]/60<20 && visibility[n][8]/60>=20) {
       vistimeend=n; // we're on the falling slope
     }
@@ -341,5 +342,5 @@
 
 
-  gROOT->Reset();  
+  /*!!!!!!!!!!!!!!!!!!!!!!!*/gROOT->Reset();
 
   TCanvas *cMjdUtcYear = new TCanvas("cMjdUtcYear", "Object Visibility MjdUtcYear", 1100,500);
@@ -430,72 +431,76 @@
   weekCounter++;
   
-  Int_t startday2 = fTime->MJDStartOfYear(year);
-  Int_t stopday2  = fTime->MJDStartOfYear(year+1)-1;
-  
-    for (int day=startday2; day<stopday2+1; day=day+7)       
-    {     
-      simpleCounter[weekCounter]=weekCounter-1;
-      objectHeight[weekCounter]=0;	
-      for (int i=0; i<daySlices; i++)
-	{	 
- 	  if (i>=48) {
-	    fday=day;
-	    ftime=i-48;
-	  } else {
-	    fday=day-1;
-	    ftime=i+48;
-	  }
-	  
-	  fTime->SetMJD(day,(Double_t)i/daySlices);	  
-	  fObject->Process();	  	 	 	    
-	  fSun->Process();
-	  
-	  if (fSun->GetAltitudeDeg() < -25.0) {
-	    if (objectHeight[weekCounter]<(fObject->GetAltitudeDeg()))
-	      objectHeight[weekCounter]=fObject->GetAltitudeDeg();	
-	  }   
-	  
-	} //i
-      weekCounter++;
-    } //day    
-  simpleCounter[weekCounter]=weekCounter-2;
-  objectHeight[weekCounter]=0;
-  weekCounter++;
-  
-  TString months[12] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
-  
-  TCanvas *c2 = new TCanvas("c2", "Object Visibility",600,100);
+  const Int_t startday2 = fTime->MJDStartOfYear(year);
+  const Int_t stopday2  = fTime->MJDStartOfYear(year+1)-1;
+  
+    for (int day=startday2; day<stopday2+1; day+=7)
+    {
+        simpleCounter[weekCounter]=weekCounter-1;
+        objectHeight[weekCounter]=0;
+        for (int i=0; i<daySlices; i++)
+        {
+            if (i>=48)
+            {
+                fday=day;
+                ftime=i-48;
+            }
+            else
+            {
+                fday=day-1;
+                ftime=i+48;
+            }
+
+            fTime->SetMJD(day,(Double_t)i/daySlices);
+            fObject->Process();
+            fSun->Process();
+
+            if (fSun->GetAltitudeDeg() < -25.0)
+            {
+                if (objectHeight[weekCounter]<(fObject->GetAltitudeDeg()))
+                    objectHeight[weekCounter]=fObject->GetAltitudeDeg();
+            }
+
+        } //i
+        weekCounter++;
+    } //day
+    simpleCounter[weekCounter]=weekCounter-2;
+    objectHeight[weekCounter]=0;
+    weekCounter++;
+
+    TString months[12] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
+
+    TCanvas *c2 = new TCanvas("c2", "Object Visibility",600,100);
  
-  //  gStyle->SetOptTitle(0);
-//   gStyle->SetPadLeftMargin(0.000001);
-//   gStyle->SetPadRightMargin(0.000001);
-//   gStyle->SetPadTopMargin(0.001);
-//   gStyle->SetPadBottomMargin(0.000001);
-  gPad->SetGrid();
-  
-  c2->SetGrid();
-  TGraph *tg=new TGraph(weekCounter,simpleCounter,objectHeight);
-  
-  tg->SetMinimum(1);
-  tg->SetMaximum(90);
-  
-  Double_t maxza = abs(fObject->GetDec()-fObs->GetLatitude());
-  
-  if (maxza > 90) maxza=90;
-  if (maxza < 0) maxza=00;
-  
-  cout << "MaxZA:    ";
-  cout << maxza << endl;
-  
-  if (maxza < 30) { //colors=green to yellow
-    maxza=9*maxza/30;
-    maxza=80+maxza;
-    
-  } else { //colors=yellow to red
-    maxza-=30;
-    maxza=11*maxza/60;
-    maxza=89+maxza;
-  }   
-  
+    //  gStyle->SetOptTitle(0);
+    //   gStyle->SetPadLeftMargin(0.000001);
+    //   gStyle->SetPadRightMargin(0.000001);
+    //   gStyle->SetPadTopMargin(0.001);
+    //   gStyle->SetPadBottomMargin(0.000001);
+    gPad->SetGrid();
+
+    c2->SetGrid();
+    TGraph *tg=new TGraph(weekCounter,simpleCounter,objectHeight);
+
+    tg->SetMinimum(1);
+    tg->SetMaximum(90);
+
+    Double_t maxza = abs(fObject->GetDec()-fObs->GetLatitude());
+
+    if (maxza > 90) maxza=90;
+    if (maxza < 0) maxza=00;
+
+    cout << "MaxZA:    ";
+    cout << maxza << endl;
+
+    if (maxza < 30) { //colors=green to yellow
+        maxza *= 9/30;
+        maxza += 80;
+
+    } else { //colors=yellow to red
+        maxza -= 30;
+        maxza *= 11/60;
+        maxza += 89;
+    }
+
   tg->SetFillColor((Int_t)maxza);
   tg->SetLineColor((Int_t)maxza);
@@ -515,6 +520,5 @@
   
   if ((vistimestart<13)&&(vistimeend>0)) {
-    TString label;
-    label=months[vistimestart-1]+"-"+months[vistimeend-1];
+    TString label=months[vistimestart-1]+"-"+months[vistimeend-1];
     TPaveLabel* l2= new TPaveLabel(35,46,50,88, label);
     l2->SetBorderSize(0);
@@ -528,5 +532,5 @@
   c2->Update();
   
-return kTRUE;
+  return kTRUE;
 }
 
@@ -553,5 +557,5 @@
     istar =  pow(10.,istar);
     if(fabs(alpha) < 7.)   /* crude accounting for opposition effect */
-	istar = istar * (1.35 - 0.05 * fabs(istar));
+	istar *= 1.35 - 0.05 * fabs(istar);
 	/* 35 per cent brighter at full, effect tapering linearly to
 	   zero at 7 degrees away from full. mentioned peripherally in
@@ -559,16 +563,20 @@
     double fofrho = 229087. * (1.06 + cos(rho_rad)*cos(rho_rad));
     if(fabs(rho) > 10.)
-       fofrho=fofrho+pow(10.,(6.15 - rho/40.));            /* eqn 21 */
+        fofrho+=pow(10.,(6.15 - rho/40.));            /* eqn 21 */
     else if (fabs(rho) > 0.25)
-       fofrho= fofrho+ 6.2e7 / (rho*rho);   /* eqn 19 */
+        fofrho+=6.2e7 / (rho*rho);   /* eqn 19 */
     else fofrho = fofrho+9.9e8;  /*for 1/4 degree -- radius of moon! */
+
     double Xzm = sqrt(1.0 - 0.96*sin(Zmoon)*sin(Zmoon));
+
     if(Xzm != 0.) Xzm = 1./Xzm;
-	  else Xzm = 10000.;
+    else Xzm = 10000.;
+
     double Xo = sqrt(1.0 - 0.96*sin(Z)*sin(Z));
     if(Xo != 0.) Xo = 1./Xo;
-	  else Xo = 10000.;
+    else Xo = 10000.;
+
     double Bmoon = fofrho * istar * pow(10.,(-0.4*kzen*Xzm))
-	  * (1. - pow(10.,(-0.4*kzen*Xo)));   /* nanoLamberts */
+        * (1. - pow(10.,(-0.4*kzen*Xo)));   /* nanoLamberts */
     //    cout << " Bmoon=" << Bmoon;
     if(Bmoon > 0.001)
Index: /trunk/MagicSoft/Mars/mtemp/MVPPlotter.h
===================================================================
--- /trunk/MagicSoft/Mars/mtemp/MVPPlotter.h	(revision 1744)
+++ /trunk/MagicSoft/Mars/mtemp/MVPPlotter.h	(revision 1745)
@@ -1,12 +1,4 @@
 #ifndef MARS_MVPPlotter
 #define MARS_MVPPlotter
-
-#ifndef MARS_MTask
-#include "MTask.h"
-#endif
-
-#ifndef MARS_MParList
-#include "MParList.h"
-#endif
 
 #ifndef MARS_MTaskList
