Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 8764)
+++ trunk/MagicSoft/Mars/Changelog	(revision 8765)
@@ -19,8 +19,41 @@
                                                  -*-*- END OF LINE -*-*-
 
+ 2007/10/27 Thomas Bretz
+
+   * mastro/MAstro.[h,cc]:
+     - added new member functio Mjd2Yymmdd and Yymmmdd2Mjd
+
+   * mastro/MAstroSky2Local.cc:
+     - fixed a typo within a comment
+
+   * mbase/MTime.[h,cc]:
+     - added a member function to set a corsika time
+
+   * mimage/MImgCleanStd.h:
+     - added a setter to set post-clean type
+
+   * mmc/MMcEvtBasic.[h,cc]:
+     - made GetParticleName a static member function usable from
+       the outside
+
+   * mpointing/MPointingDevCalc.cc:
+     - added another comment
+
+   * mreflector/MRflEvtHeader.[h,cc]:
+     - added Print function
+
+   * resources/starguider00000001.txt:
+     - fixed comment
+
+   * resources/starguider00089180.txt:
+     - added comment
+
+
+
  2007/10/17 Daniel Hoehne
 
    * datacenter/scripts/mcsequences:
-     - included sql query and update/insert sequence information in MCDB
+     - included sql query and update/insert sequence information
+       in MCDB
      - small bugfixes: corrected grep for epoch and mode
 
@@ -30,5 +63,6 @@
 
    * datacenter/scripts/mcsequences:
-     - bugfix: Now a sequence is written for every folder and particle mode
+     - bugfix: Now a sequence is written for every folder and
+       particle mode
 
 
@@ -45,5 +79,6 @@
 
    * datacenter/scripts/mcsequences:
-     - included handling of more than two P/C runs per rawfile directory
+     - included handling of more than two P/C runs per rawfile
+       directory
      - building sequences based on rawfile dirs and MC epochs
 
@@ -52,5 +87,6 @@
 
    * mmc/MMcCorsikaRunHeader.h:
-   - included GetViewConeAngle[Inner,Outer], GetAtmosphericModel
+     - included GetViewConeAngle[Inner,Outer], 
+       GetAtmosphericModel
 
 
Index: trunk/MagicSoft/Mars/mastro/MAstro.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 8764)
+++ trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 8765)
@@ -323,4 +323,36 @@
     // Perform the conversion
     return 1461L*lm10/4 + (306*((m+9)%12)+5)/10 - (3*((lm10+188)/100))/4 + d - 2399904;
+}
+
+// --------------------------------------------------------------------------
+//
+// Convert a mjd to a number yymmdd. The century is just cuts away, e.g.
+//   54393 -->  71020   (2007/10/20)
+//   50741 --> 971020   (1997/10/20)
+//   17868 -->  71020   (1907/10/20)
+//
+UInt_t MAstro::Mjd2Yymmdd(UInt_t mjd)
+{
+    UShort_t y;
+    Byte_t m, d;
+    Mjd2Ymd(mjd, y, m, d);
+
+    return d + m*100 + (y%100)*10000;
+}
+
+// --------------------------------------------------------------------------
+//
+// Convert a yymmdd number to mjd. The century is defined as 2000 for
+// yy<70, 1900 elsewise.
+//    71020 --> 54393 (2007/10/20)
+//   971020 --> 50741 (1997/10/20)
+//
+UInt_t MAstro::Yymmdd2Mjd(UInt_t yymmdd)
+{
+    const Byte_t   dd =  yymmdd%100;
+    const Byte_t   mm = (yymmdd/100)%100;
+    const UShort_t yy = (yymmdd/10000)%100;
+
+    return Ymd2Mjd(yy + (yy<70 ? 2000 : 1900), mm, dd);
 }
 
Index: trunk/MagicSoft/Mars/mastro/MAstro.h
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstro.h	(revision 8764)
+++ trunk/MagicSoft/Mars/mastro/MAstro.h	(revision 8765)
@@ -74,4 +74,7 @@
     static Int_t Ymd2Mjd(UShort_t y, Byte_t m, Byte_t d);
 
+    static UInt_t Mjd2Yymmdd(UInt_t mjd);
+    static UInt_t Yymmdd2Mjd(UInt_t yymmdd);
+
     static Double_t UT2GMST(Double_t ut1);
 
Index: trunk/MagicSoft/Mars/mastro/MAstroSky2Local.cc
===================================================================
--- trunk/MagicSoft/Mars/mastro/MAstroSky2Local.cc	(revision 8764)
+++ trunk/MagicSoft/Mars/mastro/MAstroSky2Local.cc	(revision 8765)
@@ -87,5 +87,5 @@
 //   C = RotY(r2)     (Make zenith and sky pole the same point)
 //
-//   D = RotZ(180deg) (Align rottaion angle to N=0, E=90)
+//   D = RotZ(180deg) (Align rotation angle to N=0, E=90)
 //
 // with
Index: trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 8764)
+++ trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 8765)
@@ -426,4 +426,19 @@
 
     fMjd = mjd+1;
+}
+
+// --------------------------------------------------------------------------
+//
+// Set MTime to time expressed as float (yymmdd.ffff)
+//  for details see MAstro::Yymmdd2Mjd
+//
+void MTime::SetCorsikaTime(Float_t t)
+{
+    const UInt_t   yymmdd = (UInt_t)TMath::Floor(t);
+    const UInt_t   mjd    = MAstro::Yymmdd2Mjd(yymmdd);
+    const Double_t frac   = fmod(t, 1)*kDay; // [ms] Fraction of day
+    const UInt_t   ns     = (UInt_t)fmod(frac*1e6, 1000000);
+
+    SetMjd(mjd, (ULong_t)TMath::Floor(frac), ns);
 }
 
Index: trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MTime.h	(revision 8764)
+++ trunk/MagicSoft/Mars/mbase/MTime.h	(revision 8765)
@@ -94,4 +94,5 @@
     Bool_t   SetSqlTimeStamp(const char *str);
     void     SetCT1Time(UInt_t mjd, UInt_t t1, UInt_t t0);
+    void     SetCorsikaTime(Float_t time);
     Bool_t   SetStringFmt(const char *time, const char *fmt, const char *loc=0);
     Bool_t   UpdMagicTime(Byte_t h, Byte_t m, Byte_t s, UInt_t ns);
Index: trunk/MagicSoft/Mars/mimage/MImgCleanStd.h
===================================================================
--- trunk/MagicSoft/Mars/mimage/MImgCleanStd.h	(revision 8764)
+++ trunk/MagicSoft/Mars/mimage/MImgCleanStd.h	(revision 8765)
@@ -99,4 +99,6 @@
     UShort_t GetCleanRings() const { return fCleanRings;}
 
+    void SetPostCleanType(Int_t t) { fPostCleanType=t; }
+
     void SetMethod(CleaningMethod_t m) { fCleaningMethod = m; }
     void SetKeepIsolatedPixels(Bool_t b=kTRUE) { fKeepIsolatedPixels=b; }
Index: trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 8764)
+++ trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 8765)
@@ -156,4 +156,5 @@
 //   17. Oct. 2006   ~103130
 //   17. Jun. 2007   ~248193
+//   18. Oct. 2007
 //
 // From 2.2.2006 beginnig of the night (21:05h, run >=81855) to 24.2.2006
@@ -166,4 +167,9 @@
 // Lid is closed. (< run 84980)
 //
+// Mirror refocussing around 23.Apr.2006, from the Runbook.
+//
+// 25./26.4.2006: Run 89180
+//
+// (Note: The year here is not a typo!)
 // [2007-04-25 23:50:39]
 // Markus is performing AMC focussing.
Index: trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.cc	(revision 8764)
+++ trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.cc	(revision 8765)
@@ -30,5 +30,10 @@
 #include "MRflEvtHeader.h"
 
+#include "MLog.h"
+#include "MLogManip.h"
+
 ClassImp(MRflEvtHeader);
+
+using namespace std;
 
 // --------------------------------------------------------------------------
@@ -40,2 +45,12 @@
 }
 
+void MRflEvtHeader::Print(Option_t *) const
+{
+    *fLog << all;
+    *fLog << "Event Number:                " << fEvtNumber << endl;
+    *fLog << "Energy:                      " << fEnergy << "GeV" << endl;
+    *fLog << "Height of first intercation: " << fHeightFirstInt << "cm" << endl;
+    *fLog << "Momentum X/Y/Z:              " << fMomentum.X() << "/" << fMomentum.Y() << "/" << fMomentum.Z() << endl;
+    *fLog << "Zenith/Azimuth angle:        " << fTheta*TMath::RadToDeg() << "/" << fPhi*TMath::RadToDeg() << endl;
+    *fLog << endl;
+}
Index: trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.h	(revision 8764)
+++ trunk/MagicSoft/Mars/mreflector/MRflEvtHeader.h	(revision 8765)
@@ -72,14 +72,17 @@
     void SetPhi(Float_t x)   { fPhi = x; }
     void SetTheta(Float_t x) { fTheta = x; }
-     
+
     void SetNmax(Float_t x)  { fNmax = x ; }
     void SetT0(Float_t x)    { fT0 = x; }
     void SetTmax(Float_t x)  { fTmax = x ; }
     void SetChi2(Float_t x)  { fChi2 = x ; }
-     
+
     void SetEFraction(Float_t x) { fEFraction = x ; }
     void SetMFraction(Float_t x) { fMFraction = x ; }
     void SetOFraction(Float_t x) { fOFraction = x ; }
-     
+
+    // TObject
+    void Print(Option_t *o="") const;
+
     ClassDef(MRflEvtHeader, 1) // Header of an event from the reflector program
 };
Index: trunk/MagicSoft/Mars/resources/starguider00000001.txt
===================================================================
--- trunk/MagicSoft/Mars/resources/starguider00000001.txt	(revision 8764)
+++ trunk/MagicSoft/Mars/resources/starguider00000001.txt	(revision 8765)
@@ -24,5 +24,5 @@
 # This is identical with the later pointing model applied since
 # run 85420, which is done with TPoints taken after 18.3.2006 and
-# in April 2006. It seems that is already valid earlier. 
-# (For unknown reasons that pointing model made from the TPoints 
-#  before 18.3.2006 doesn't seem to givbe a reasonable pointing model)
+# in April 2006. It seems that it is already valid earlier.
+# (For unknown reasons the pointing model made from the TPoints
+# before 18.3.2006 doesn't seem to give a reasonable pointing model)
Index: trunk/MagicSoft/Mars/resources/starguider00089180.txt
===================================================================
--- trunk/MagicSoft/Mars/resources/starguider00089180.txt	(revision 8764)
+++ trunk/MagicSoft/Mars/resources/starguider00089180.txt	(revision 8765)
@@ -21,2 +21,4 @@
  MAGIC2             0             0
 END
+
+# Made from the TPoints between: 6/2006 and 4/2007
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 8764)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 8765)
@@ -49,7 +49,7 @@
   Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
 
-  TString GetParticleName() const
+  static TString GetParticleName(Int_t id)
   {
-      switch (fPartId)
+      switch (id)
       {
       case kUNDEFINED:return "Undefined";
@@ -67,10 +67,10 @@
       }
 
-      return Form("Id:%d", fPartId);
+      return Form("Id:%d", id);
   }
 
-  TString GetParticleSymbol() const
+  static TString GetParticleSymbol(Int_t id)
   {
-      switch (fPartId)
+      switch (id)
       {
       case kUNDEFINED:return "N/A";
@@ -88,5 +88,5 @@
       }
 
-      return Form("Id:%d", fPartId);
+      return Form("Id:%d", id);
   }
 
@@ -103,4 +103,14 @@
 
       return Form("%dMeV", (Int_t)(e*1000+.5));
+  }
+
+  TString GetParticleSymbol() const
+  {
+      return GetParticleSymbol(fPartId);
+  }
+
+  TString GetParticleName() const
+  {
+      return GetParticleName(fPartId);
   }
 
