Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7431)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7432)
@@ -18,4 +18,27 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/11/28 Thomas Bretz
+
+   * callisto.cc, ganymed.cc, mars.cc, merpp.cc, readdaq.cc, 
+     readraw.cc, showlog.cc, showplot.cc, sponde.cc, star.cc:
+     - fixed a bug in displaying the startup message which prevented
+       the compilation date from beeing displayed
+     - added abbreviations for calling some programs (see NEWS)
+
+   * mastro/MAstro.[h,cc]:
+     - added function to calc date of easter
+
+   * mbase/MEnv.[h,cc]:
+     - added function to support some attributes (TAtt*)
+
+   * mbase/MTime.[h,cc]:
+     - added support for locales in Set/GetStringFmt
+     - added function to calc date of easter
+
+   * mjobs/MJCut.cc:
+     - output is called "Hadronness" not "MHadronness"
+
+
+
  2005/11/25 Thomas Bretz
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 7431)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 7432)
@@ -2,4 +2,18 @@
 
  *** Version  <cvs>
+
+   - general: Fixed a bug in most of the programs which prevented the
+     compile date in the startup message to be displayed
+
+   - general: Simplified program calls. The following abbreviations 
+     are now possible:
+        showlog callisto 55599
+        showplot signal 55599
+        star 55599
+        callisto 55999
+        ganymed 2
+     In this cases the corrsponding root-, log-, sequence- or dataset-
+     filename is automatically compiled using the default datacenter
+     paths ("/magic/*")
 
    - general: Fixed a long outstanding bug which made axis tick marks
@@ -18,4 +32,10 @@
      is useful to perform g/h-separation cuts before training the random
      forest.
+
+   - StatusDisplay: Fixed the algorithm to calculate the size ratio
+     of the display, it gave wrong results espacially for big sizes.
+     Now the embedded canvas should always have a ratio width/height=3/2.
+     The "Size" options have been updated with values fitting the 3/2 
+     size ratio.
 
    - RanForest:
Index: /trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/callisto.cc	(revision 7432)
@@ -33,5 +33,5 @@
     gLog << "                 Callisto - MARS V" << MARSVER            << endl;
     gLog << "    MARS -- CALibrate LIght Signals and Time Offsets"     << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "========================================================" << endl;
     gLog << endl;
@@ -44,7 +44,8 @@
     gLog << all << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << " callisto [-c] [-y] [options] sequence.txt" << endl << endl;
+    gLog << " callisto [-c] [-y] [options] sequence.txt|number" << endl << endl;
     gLog << " Arguments:" << endl;
     gLog << "   sequence.txt:             ASCII file defining a sequence of runs" << endl;
+    gLog << "   number:                   The sequence number (using file in the datacenter)" << endl;
     gLog << "                             For more details see MSequence" << endl;
     gLog << " Root Options:" << endl;
@@ -248,5 +249,12 @@
     // Setup sequence file and check for its existance
     //
-    const TString kSequence = arg.GetArgumentStr(0);
+    TString kSequence = arg.GetArgumentStr(0);
+
+    if (kSequence.IsDigit())
+    {
+        const Int_t numseq = kSequence.Atoi();
+        kSequence = Form("/magic/sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
+        gLog << inf << "Inflated sequence file: " << kSequence << endl;
+    }
 
     if (gSystem->AccessPathName(kSequence, kFileExists))
Index: /trunk/MagicSoft/Mars/ganymed.cc
===================================================================
--- /trunk/MagicSoft/Mars/ganymed.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/ganymed.cc	(revision 7432)
@@ -30,5 +30,5 @@
     gLog << "                  Ganymed - MARS V" << MARSVER            << endl;
     gLog << "   MARS -- Gammas Are Now Your Most Exciting Discovery"   << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "========================================================" << endl;
     gLog << endl;
@@ -41,7 +41,8 @@
     gLog << all << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << " ganymed [options] dataset.txt" << endl << endl;
+    gLog << " ganymed [options] dataset.txt|number" << endl << endl;
     gLog << " Arguments:" << endl;
     gLog << "   dataset.txt:              ASCII file defining a collection of sequences" << endl;
+    gLog << "   number:                   The dataset number (using file in the datacenter)" << endl;
     gLog << "                             For more details see MDataSet." << endl;
     gLog << " Root Options:" << endl;
@@ -164,9 +165,19 @@
     // Setup sequence file and check for its existence
     //
-    const TString kSequences = arg.GetArgumentStr(0);
+    TString kSequences = arg.GetArgumentStr(0);
+
+    //
+    // Something special for datacenter access
+    //
+    if (kSequences.IsDigit())
+    {
+        const Int_t numseq = kSequences.Atoi();
+        kSequences = Form("/magic/datasets/%04d/dataset%08d.txt", numseq/10000, numseq);
+        gLog << inf << "inflated dataset file: " << kSequences << endl;
+    }
 
     if (gSystem->AccessPathName(kSequences, kFileExists))
     {
-        gLog << err << "Sorry, sequences file '" << kSequences << "' doesn't exist." << endl;
+        gLog << err << "Sorry, dataset file '" << kSequences << "' doesn't exist." << endl;
         return 2;
     }
@@ -196,5 +207,5 @@
     if (!seq.IsValid())
     {
-        gLog << err << "Sequences read but not valid!" << endl << endl;
+        gLog << err << "Dataset read but not valid (maybe analysis number not set)!" << endl << endl;
         return 2;
     }
Index: /trunk/MagicSoft/Mars/mars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mars.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/mars.cc	(revision 7432)
@@ -36,5 +36,5 @@
     gLog << "                    MARS V" << MARSVER              << endl;
     gLog << "    Magic Analysis and Reconstruction Software"     << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "==================================================" << endl;
     gLog << endl;
Index: /trunk/MagicSoft/Mars/mastro/MAstro.cc
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/mastro/MAstro.cc	(revision 7432)
@@ -623,2 +623,152 @@
     return TMath::ACos(d)*TMath::RadToDeg();
 }
+
+// --------------------------------------------------------------------------
+//
+// Returned is the offset (number of days) which must be added to
+// March 1st of the given year, eg:
+//
+//    Int_t offset = GetDayOfEaster(2004);
+//
+//    MTime t;
+//    t.Set(year, 3, 1);
+//    t.SetMjd(t.GetMjd()+offset);
+//
+//    cout << t << endl;
+//
+//  If the date coudn't be calculated -1 is returned.
+//
+//  The minimum value returned is 21 corresponding to March 22.
+//  The maximum value returned is 55 corresponding to April 25.
+//
+// --------------------------------------------------------------------------
+//
+// Gauss'sche Formel zur Berechnung des Osterdatums
+// Wann wird Ostern gefeiert? Wie erfährt man das Osterdatum für ein
+// bestimmtes Jahr, ohne in einen Kalender zu schauen?
+//
+// Ostern ist ein "bewegliches" Fest. Es wird am ersten Sonntag nach dem
+// ersten Frühlingsvollmond gefeiert. Damit ist der 22. März der früheste
+// Termin, der 25. April der letzte, auf den Ostern fallen kann. Von
+// diesem Termin hängen auch die Feste Christi Himmelfahrt, das 40 Tage
+// nach Ostern, und Pfingsten, das 50 Tage nach Ostern gefeiert wird, ab.
+//
+// Von Carl Friedrich Gauß (Mathematiker, Astronom und Physiker;
+// 1777-1855) stammt ein Algorithmus, der es erlaubt ohne Kenntnis des
+// Mondkalenders die Daten der Osterfeste für die Jahre 1700 bis 2199 zu
+// bestimmen.
+//
+// Gib eine Jahreszahl zwischen 1700 und 2199 ein:
+//
+// Und so funktioniert der Algorithmus:
+//
+// Es sei:
+//
+// J	die Jahreszahl
+// a	der Divisionsrest von	J/19
+// b	der Divisionsrest von	J/4
+// c	der Divisionsrest von	J/7
+// d	der Divisionsrest von	(19*a + M)/30
+// e	der Divisionsrest von	(2*b + 4*c + 6*d + N)/7
+//
+// wobei M und N folgende Werte annehmen:
+//
+// für die Jahre	M	N
+// 1700-1799	23	3
+// 1800-1899	23	4
+// 1900-2099	24	5
+// 2100-2199	24	6
+//
+// Dann fällt Ostern auf den
+// (22 + d + e)ten März
+//
+// oder den
+// (d + e - 9)ten April
+//
+// Beachte:
+// Anstelle des 26. Aprils ist immer der 19. April zu setzen,
+// anstelle des 25. Aprils immer dann der 18. April, wenn d=28 und a>10.
+//
+// Literatur:
+// Schüler-Rechenduden
+// Bibliographisches Institut
+// Mannheim, 1966
+//
+// --------------------------------------------------------------------------
+//
+// Der Ostersonntag ist ein sog. unregelmäßiger Feiertag. Alle anderen
+// unregelmäßigen Feiertage eines Jahres leiten sich von diesem Tag ab:
+//
+//    * Aschermittwoch ist 46 Tage vor Ostern.
+//    * Pfingsten ist 49 Tage nach Ostern.
+//    * Christi Himmelfahrt ist 10 Tage vor Pfingsten.
+//    * Fronleichnam ist 11 Tage nach Pfingsten.
+//
+// Man muß also nur den Ostersonntag ermitteln, um alle anderen
+// unregelmäßigen Feiertage zu berechnen. Doch wie geht das?
+//
+// Dazu etwas Geschichte:
+//
+// Das 1. Kirchenkonzil im Jahre 325 hat festgelegt:
+//
+//    * Ostern ist stets am ersten Sonntag nach dem ersten Vollmond des
+//      Frühlings.
+//    * Stichtag ist der 21. März, die "Frühlings-Tagundnachtgleiche".
+//
+// Am 15.10.1582 wurde von Papst Gregor XIII. der bis dahin gültige
+// Julianische Kalender reformiert. Der noch heute gültige Gregorianische
+// Kalender legt dabei folgendes fest:
+//
+// Ein Jahr hat 365 Tage und ein Schaltjahr wird eingefügt, wenn das Jahr
+// durch 4 oder durch 400, aber nicht durch 100 teilbar ist. Hieraus
+// ergeben sich die zwei notwendigen Konstanten, um den Ostersonntag zu
+// berechnen:
+//
+//   1. Die Jahreslänge von und bis zum Zeitpunkt der
+//      Frühlings-Tagundnachtgleiche: 365,2422 mittlere Sonnentage
+//   2. Ein Mondmonat: 29,5306 mittlere Sonnentage
+//
+// Mit der "Osterformel", von Carl Friedrich Gauß (1777-1855) im Jahre 1800
+// entwickelt, läßt sich der Ostersonntag für jedes Jahr von 1583 bis 8202
+// berechnen.
+//
+// Der früheste mögliche Ostertermin ist der 22. März. (Wenn der Vollmond
+// auf den 21. März fällt und der 22. März ein Sonntag ist.)
+//
+// Der späteste mögliche Ostertermin ist der 25. April. (Wenn der Vollmond
+// auf den 21. März fällt und der 21. März ein Sonntag ist.)
+//
+Int_t MAstro::GetEasterOffset(UShort_t year)
+{
+    if (year<1700 || year>2199)
+    {
+        cout << "MAstro::GetDayOfEaster - Year " << year << " not between 1700 and 2199" << endl;
+        return -1;
+    }
+
+    const Int_t M = (year+2900)/200;
+
+    Int_t N=0;
+    switch (year/100)
+    {
+    case 17: N=3; break;
+    case 18: N=4; break;
+    case 19:
+    case 20: N=5; break;
+    case 21: N=6; break;
+    }
+
+    const Int_t a = year%19;
+    const Int_t b = year%4;
+    const Int_t c = year%7;
+    const Int_t d = (19*a + M)%30;
+    const Int_t e = (2*b + 4*c + 6*d + N)%7;
+
+    if (e==6 && d==28 && a>10)
+        return 48;
+
+    if (d+e==35)
+        return 49;
+
+    return d + e + 21;
+}
Index: /trunk/MagicSoft/Mars/mastro/MAstro.h
===================================================================
--- /trunk/MagicSoft/Mars/mastro/MAstro.h	(revision 7431)
+++ /trunk/MagicSoft/Mars/mastro/MAstro.h	(revision 7432)
@@ -10,4 +10,5 @@
 
 class TVector3;
+class MTime;
 
 class MAstro
@@ -76,4 +77,6 @@
     static Double_t GetDevAbs(Double_t nomzd, Double_t devzd, Double_t devaz);
 
+    static Int_t GetEasterOffset(UShort_t year);
+
     ClassDef(MAstro, 0)
 };
Index: /trunk/MagicSoft/Mars/mbase/MEnv.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/mbase/MEnv.cc	(revision 7432)
@@ -34,5 +34,11 @@
 #include "MEnv.h"
 
+#include <Gtypes.h>
 #include <TObjString.h>
+
+#include <TAttText.h>
+#include <TAttFill.h>
+#include <TAttLine.h>
+#include <TAttMarker.h>
 
 #include "MLog.h"
@@ -62,4 +68,155 @@
         fChecked.Add(new TObjString(name));
     return TEnv::GetValue(name, dflt);
+}
+
+Int_t MEnv::GetColor(const char *name, Int_t dftl)
+{
+    TString str = GetValue(name, "");
+
+    str = str.Strip(TString::kBoth);
+    if (str.IsNull())
+        return dftl;
+
+    str.ToLower();
+
+    switch (str.Hash())
+    {
+    case (unsigned)-1926423925/*2368543371*/: return kWhite;
+    case 1814927399: return kBlack;
+    case 7496964:    return kRed;
+    case (unsigned)-1397860222/*2897107074*/: return kGreen;
+    case 1702194402: return kBlue;
+    case (unsigned)-1920149414/* 2374817882*/: return kYellow;
+    case (unsigned)-1400748595/*2894218701*/: return kMagenta;
+    case 1851881955: return kCyan;
+    case 749623518: return 18; // grey1
+    case 749623517: return 17; // grey2
+    case 749623516: return 16; // grey3
+    case 749623515: return 15; // grey4
+    case 749623514: return 14; // grey5
+    case 741234910: return 18; // gray1
+    case 741234909: return 17; // gray2
+    case 741234908: return 16; // gray3
+    case 741234907: return 15; // gray4
+    case 741234906: return 14; // gray5
+    }
+    return str.Atoi();
+}
+
+TString MEnv::Compile(TString str, const char *post) const
+{
+    if (!str.IsNull() && str[str.Length()-1]!='.')
+        str += ".";
+
+    str += post;
+
+    return str;
+}
+
+void MEnv::GetAttLine(const char *name, TAttLine &line, TAttLine *dftl)
+{
+    const TString color = Compile(name, "LineColor");
+    const TString style = Compile(name, "LineStyle");
+    const TString width = Compile(name, "LineWidth");
+
+    if (!dftl)
+        dftl = &line;
+
+    const Color_t col = GetColor(color, dftl->GetLineColor());
+    const Style_t sty = GetValue(style, dftl->GetLineStyle());
+    const Style_t wid = GetValue(width, dftl->GetLineWidth());
+
+    line.SetLineColor(col);
+    line.SetLineStyle(sty);
+    line.SetLineWidth(wid);
+}
+
+void MEnv::GetAttText(const char *name, TAttText &text, TAttText *dftl)
+{
+   const TString color = Compile(name, "TextColor");
+   const TString align = Compile(name, "TextAlign");
+   const TString angle = Compile(name, "TextAngle");
+   const TString font  = Compile(name, "TextFont");
+   const TString size  = Compile(name, "TextSize");
+
+    if (!dftl)
+        dftl = &text;
+
+    const Color_t col = GetColor(color, dftl->GetTextColor());
+    const Short_t ali = GetValue(align, dftl->GetTextAlign());
+    const Float_t ang = GetValue(angle, dftl->GetTextAngle());
+    const Font_t  fon = GetValue(font,  dftl->GetTextFont());
+    const Float_t siz = GetValue(size,  dftl->GetTextSize());
+
+    text.SetTextColor(col);
+    text.SetTextAlign(ali);
+    text.SetTextAngle(ang);
+    text.SetTextFont(fon);
+    text.SetTextSize(siz);
+}
+
+void MEnv::GetAttFill(const char *name, TAttFill &fill, TAttFill *dftl)
+{
+    const TString color = Compile(name, "FillColor");
+    const TString style = Compile(name, "FillStyle");
+
+    if (!dftl)
+        dftl = &fill;
+
+    const Color_t col = GetColor(color, dftl->GetFillColor());
+    const Style_t sty = GetValue(style, dftl->GetFillStyle());
+
+    fill.SetFillColor(col);
+    fill.SetFillStyle(sty);
+}
+
+void MEnv::GetAttMarker(const char *name, TAttMarker &marker, TAttMarker *dftl)
+{
+    const TString color = Compile(name, "MarkerColor");
+    const TString style = Compile(name, "MarkerStyle");
+    const TString size  = Compile(name, "MarkerSize");
+
+    if (!dftl)
+        dftl = &marker;
+
+    const Color_t col = GetColor(color, dftl->GetMarkerColor());
+    const Style_t sty = GetValue(style, dftl->GetMarkerStyle());
+    const Size_t  siz = GetValue(size,  dftl->GetMarkerSize());
+
+    marker.SetMarkerColor(col);
+    marker.SetMarkerStyle(sty);
+    marker.SetMarkerSize(siz);
+}
+
+void MEnv::GetAttributes(const char *name, TObject *obj, TObject *dftl)
+{
+    //TAttAxis         *line = dynamic_cast<TAttAxis*>(obj);
+    //TAtt3D           *line = dynamic_cast<TAtt3D*>(obj);
+    //TAttCanvas       *line = dynamic_cast<TAttCanvas*>(obj);
+    //TAttFillCanvas   *line = dynamic_cast<TAttFillEitor*>(obj);
+    //TAttLineCanvas   *line = dynamic_cast<TAttLineCanvas*>(obj);
+    //TAttLineEditor   *line = dynamic_cast<TAttLineEditor*>(obj);
+    //TAttMarkerCanvas *line = dynamic_cast<TAttMarkerCanvas*>(obj);
+    //TAttMarkerEditor *line = dynamic_cast<TAttMarkerEditor*>(obj);
+    //TAttPad          *line = dynamic_cast<TAttPad*>(obj);
+    //TAttParticle     *line = dynamic_cast<TAttParticle*>(obj);
+    //TAttTextCanvas   *line = dynamic_cast<TAttTextCanvas*>(obj);
+    //TAttTextEditor   *line = dynamic_cast<TAttTextEditor*>(obj);
+
+    TAttLine   *line = dynamic_cast<TAttLine*>(/*(TAttLine*)*/obj);
+    TAttText   *text = dynamic_cast<TAttText*>(/*(TAttText*)*/obj);
+    TAttFill   *fill = dynamic_cast<TAttFill*>(/*(TAttFill*)*/obj);
+    TAttMarker *mark = dynamic_cast<TAttMarker*>(/*(TAttMarker*)*/obj);
+
+    cout << line << " " << text << " " << fill << " " << mark << endl;
+
+    if (line)
+        GetAttLine(name, *line, dynamic_cast<TAttLine*>(/*(TAttLine*)*/dftl));
+    if (text)
+        GetAttText(name, *text, dynamic_cast<TAttText*>(/*(TAttText*)*/dftl));
+    if (fill)
+        GetAttFill(name, *fill, dynamic_cast<TAttFill*>(/*(TAttFill*)*/dftl));
+    if (mark)
+        GetAttMarker(name, *mark, dynamic_cast<TAttMarker*>(/*(TAttMarker*)*/dftl));
 }
 
Index: /trunk/MagicSoft/Mars/mbase/MEnv.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 7431)
+++ /trunk/MagicSoft/Mars/mbase/MEnv.h	(revision 7432)
@@ -10,8 +10,15 @@
 #endif
 
+class TAttLine;
+class TAttMarker;
+class TAttText;
+class TAttFill;
+
 class MEnv : public TEnv
 {
 private:
     TOrdCollection fChecked;
+
+    TString Compile(TString str, const char *post) const;
 
 public:
@@ -22,4 +29,12 @@
     const char *GetValue(const char *name, const char *dflt);
 
+    Int_t       GetColor(const char *name, Int_t dftl);
+
+    void        GetAttributes(const char *name, TObject *obj, TObject *dftl=0);
+    void        GetAttLine(const char *name, TAttLine &line, TAttLine *dftl=0);
+    void        GetAttText(const char *name, TAttText &text, TAttText *dftl=0);
+    void        GetAttFill(const char *name, TAttFill &fill, TAttFill *dftl=0);
+    void        GetAttMarker(const char *name, TAttMarker &marker, TAttMarker *dftl=0);
+
     void PrintUntouched() const;
 
Index: /trunk/MagicSoft/Mars/mbase/MTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/mbase/MTime.cc	(revision 7432)
@@ -239,4 +239,21 @@
 {
     SetMjd(time*1000/kDay+49718);
+}
+
+// --------------------------------------------------------------------------
+//
+// Set this to the date of easter corresponding to the given year.
+// If calculation was not possible it is set to MTime()
+//
+// The date corresponding to the year of MTime(-1) is returned
+// if year<0
+//
+// The date corresponding to the Year() is returned if year==0.
+//
+//  for more information see: GetEaster and MAstro::GetEasterOffset()
+//
+void MTime::SetEaster(Short_t year)
+{
+    *this = GetEaster(year==0 ? Year() : year);
 }
 
@@ -515,5 +532,25 @@
 // The maximum size of the return string is 128 (incl. NULL)
 //
-TString MTime::GetStringFmt(const char *fmt) const
+// For dates before 1.1.1902  a null string is returned
+// For dates after 31.12.2037 a null string is returned
+//
+// To change the localization use loc, eg loc = "da_DK", "de_DE".
+// Leaving the argument empty will just take the default localization.
+//
+// If loc is "", each part of the locale that should be modified is set
+// according  to the environment variables. The details are implementation
+// dependent.  For glibc, first (regardless of category), the  environment
+// variable  LC_ALL  is  inspected, next the environment variable with the
+// same name as the category (LC_COLLATE, LC_CTYPE, LC_MESSAGES,  LC_MONE?
+// TARY,  LC_NUMERIC,  LC_TIME) and finally the environment variable LANG.
+// The first existing environment variable is used.
+//
+// A  locale  name  is  typically  of the form language[_territory][.code?
+// set][@modifier], where language is an ISO 639 language code,  territory
+// is an ISO 3166 country code, and codeset is a character set or encoding
+// identifier like ISO-8859-1 or UTF-8.   For  a  list  of  all  supported
+// locales, try "locale -a", cf. locale(1).
+//
+TString MTime::GetStringFmt(const char *fmt, const char *loc) const
 {
     if (!fmt)
@@ -525,4 +562,7 @@
     GetDate(y, mon, d);
     GetTime(h, m, s, ms);
+
+    if (y<1902 || y>2037)
+        return "";
 
     struct tm time;
@@ -535,9 +575,17 @@
     time.tm_isdst = 0;
 
+    const TString locale = setlocale(LC_TIME, 0);
+
+    setlocale(LC_TIME, loc);
+
     // recalculate tm_yday and tm_wday
     mktime(&time);
 
     char ret[128];
-    return TString(strftime(ret, 127, fmt, &time) ? ret : "");
+    const size_t rc = strftime(ret, 127, fmt, &time);
+
+    setlocale(LC_TIME, locale);
+
+    return rc ? ret : "";
 }
 
@@ -549,5 +597,5 @@
 // For more information see GetStringFmt
 //
-Bool_t MTime::SetStringFmt(const char *time, const char *fmt)
+Bool_t MTime::SetStringFmt(const char *time, const char *fmt, const char *loc)
 {
     if (!fmt)
@@ -556,5 +604,10 @@
     struct tm t;
     memset(&t, 0, sizeof(struct tm));
+
+    const TString locale = setlocale(LC_TIME, 0);
+
+    setlocale(LC_TIME, loc);
     strptime(time, fmt, &t);
+    setlocale(LC_TIME, locale);
 
     return Set(t.tm_year+1900, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec);
@@ -795,2 +848,29 @@
     return out;
 }
+
+// --------------------------------------------------------------------------
+//
+// Calculate the day of easter for the given year.
+// MTime() is returned if this was not possible.
+//
+// In case of the default argument or the year less than zero
+// the date of eastern of the current year (the year corresponding to
+// MTime(-1)) is returned.
+//
+//  for more information see: MAstro::GetDayOfEaster()
+//
+MTime MTime::GetEaster(Short_t year)
+{
+    if (year<0)
+        year = MTime(-1).Year();
+
+    const Int_t day = MAstro::GetEasterOffset(year);
+    if (day<0)
+        return MTime();
+
+    MTime t;
+    t.Set(year, 3, 1);
+    t.SetMjd(t.GetMjd() + day);
+
+    return t;
+}
Index: /trunk/MagicSoft/Mars/mbase/MTime.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTime.h	(revision 7431)
+++ /trunk/MagicSoft/Mars/mbase/MTime.h	(revision 7432)
@@ -83,9 +83,10 @@
     Bool_t   SetSqlTimeStamp(const char *str);
     void     SetCT1Time(UInt_t mjd, UInt_t t1, UInt_t t0);
-    Bool_t   SetStringFmt(const char *time, const char *fmt);
+    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);
     Bool_t   SetMjd(UInt_t mjd, ULong_t ms, UInt_t ns=0);
     void     SetMjd(Double_t m);
     void     SetAxisTime(Double_t time);
+    void     SetEaster(Short_t year=0);
 
     // Getter functions
@@ -93,5 +94,5 @@
     Double_t GetGmst() const;
     TString  GetString() const;
-    TString  GetStringFmt(const char *fmt=0) const;
+    TString  GetStringFmt(const char *fmt=0, const char *loc=0) const;
     TString  GetSqlDateTime() const;
     TString  GetSqlTimeStamp() const;
@@ -112,10 +113,11 @@
     }
 
-    UInt_t Year() const  { UShort_t y; Byte_t m, d; GetDate(y,m,d); return y; }
-    UInt_t Month() const { UShort_t y; Byte_t m, d; GetDate(y,m,d); return m; }
-    UInt_t Day() const   { UShort_t y; Byte_t m, d; GetDate(y,m,d); return d; }
-    UInt_t Hour() const  { Byte_t h, m, s; GetTime(h,m,s); return h; }
-    UInt_t Min() const   { Byte_t h, m, s; GetTime(h,m,s); return m; }
-    UInt_t Sec() const   { Byte_t h, m, s; GetTime(h,m,s); return s; }
+    UInt_t Year() const    { UShort_t y; Byte_t m, d; GetDate(y,m,d); return y; }
+    UInt_t Month() const   { UShort_t y; Byte_t m, d; GetDate(y,m,d); return m; }
+    UInt_t Day() const     { UShort_t y; Byte_t m, d; GetDate(y,m,d); return d; }
+    Byte_t WeekDay() const { return TMath::Nint(TMath::Floor(GetMjd()+3))%7; } // Return Day of the week: Sun=0, Mon=1, ..., Sat=6
+    UInt_t Hour() const    { Byte_t h, m, s; GetTime(h,m,s); return h; }
+    UInt_t Min() const     { Byte_t h, m, s; GetTime(h,m,s); return m; }
+    UInt_t Sec() const     { Byte_t h, m, s; GetTime(h,m,s); return s; }
 
     Bool_t IsMidnight() const { return (Long_t)fTime==0 && fNanoSec==0; }
@@ -155,4 +157,6 @@
     bool operator!() const;
 
+    static MTime GetEaster(Short_t year=-1);
+
     ClassDef(MTime, 3)	//A generalized MARS time stamp
 };
Index: /trunk/MagicSoft/Mars/merpp.cc
===================================================================
--- /trunk/MagicSoft/Mars/merpp.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/merpp.cc	(revision 7432)
@@ -53,5 +53,5 @@
     gLog << "                MERPP - MARS V" << MARSVER          << endl;
     gLog << "     MARS - Merging and Preprocessing Program"      << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "==================================================" << endl;
     gLog << endl;
Index: /trunk/MagicSoft/Mars/mjobs/MJCut.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/mjobs/MJCut.cc	(revision 7432)
@@ -356,5 +356,5 @@
     write->AddContainer("MNewImagePar",   "Events", kFALSE);
     write->AddContainer("MNewImagePar2",  "Events", kFALSE);
-    write->AddContainer("MHadronness",    "Events", kFALSE);
+    write->AddContainer("Hadronness",     "Events", kFALSE);
     write->AddContainer("MSrcPosCam",     "Events", kFALSE);
     write->AddContainer("MSrcPosAnti",    "Events", kFALSE);
Index: /trunk/MagicSoft/Mars/readdaq.cc
===================================================================
--- /trunk/MagicSoft/Mars/readdaq.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/readdaq.cc	(revision 7432)
@@ -39,5 +39,5 @@
     gLog << "              ReadDaq - MARS V" << MARSVER          << endl;
     gLog << "       MARS - Read and print daq data files"        << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "==================================================" << endl;
     gLog << endl;
Index: /trunk/MagicSoft/Mars/readraw.cc
===================================================================
--- /trunk/MagicSoft/Mars/readraw.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/readraw.cc	(revision 7432)
@@ -42,5 +42,5 @@
     gLog << "              ReadRaw - MARS V" << MARSVER          << endl;
     gLog << "       MARS - Read and print raw data files"        << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "==================================================" << endl;
     gLog << endl;
Index: /trunk/MagicSoft/Mars/showlog.cc
===================================================================
--- /trunk/MagicSoft/Mars/showlog.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/showlog.cc	(revision 7432)
@@ -11,11 +11,24 @@
 using namespace std;
 
+static void StartUpMessage()
+{
+    //                1         2         3         4         5
+    //       12345678901234567890123456789012345678901234567890
+    gLog << endl;
+    gLog << "showlog --- Mars V" << MARSVER << " compiled on <" << __DATE__ << "> using ROOT v" << ROOTVER << endl;
+    gLog << endl;
+}
+
 static void Usage()
 {
     gLog << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << "   showlog [options] filename" << endl;
+    gLog << "   showlog [options] {filename}|{location number}" << endl;
     gLog << " or" << endl;
     gLog << "   showlog [options] < filename" << endl << endl;
+    gLog << " Arguments:" << endl;
+    gLog << "   filename                  Input log file" << endl;
+    gLog << "   location number           Open file from location callisto, star, etc." << endl;
+    gLog << "                             of sequence or dataset number" << endl << endl;
     gLog.Usage();
     gLog << "   --version, -V             Show startup message with version number" << endl;
@@ -52,5 +65,8 @@
 
     if (arg.HasOnly("-V") || arg.HasOnly("--version"))
+    {
+        StartUpMessage();
         return 0;
+    }
 
     if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
@@ -74,5 +90,5 @@
     // check for the right usage of the program
     //
-    if (arg.GetNumArguments()>1)
+    if (arg.GetNumArguments()>2)
     {
         Usage();
@@ -80,9 +96,28 @@
     }
 
+    //
+    // Something special for datacenter access
+    //
+    TString kInput = arg.GetArgumentStr(0);
+    if (arg.GetNumArguments()==2)
+    {
+        const Int_t num = arg.GetArgumentStr(1).Atoi();
+        TString file = "/magic/data/";
+        file += kInput;
+        file += Form("/%04d/%08d/", num/10000, num);
+        file += kInput;
+        file += Form("%08d.log", num);
+
+        kInput = file;
+
+        gLog << inf << "Inflated file name: " << kInput << endl;
+    }
+
+
     // casts necessary for gcc 2.95.3
-    istream *in = arg.GetNumArguments()==1 ? (istream*)new ifstream(arg.GetArgumentStr(0)) : (istream*)&cin;
+    istream *in = arg.GetNumArguments()>0 ? (istream*)new ifstream(kInput) : (istream*)&cin;
     if (!*in)
     {
-        gLog << "Cannot open file " << arg.GetArgumentStr(0) << ": " << strerror(errno) << endl;
+        gLog << err << "Cannot open file " << kInput << ": " << strerror(errno) << endl;
         return 2;
     }
Index: /trunk/MagicSoft/Mars/showplot.cc
===================================================================
--- /trunk/MagicSoft/Mars/showplot.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/showplot.cc	(revision 7432)
@@ -28,7 +28,9 @@
     gLog << all << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << " showplot [options] filename" << endl << endl;
+    gLog << " showplot [options] {filename}|{filetype number}" << endl << endl;
     gLog << " Arguments:" << endl;
-    gLog << "   filename                  Input file containing an MStatusArray" << endl << endl;
+    gLog << "   filename                  Input file containing an MStatusArray" << endl;
+    gLog << "   filetype number           Open file of filetype calib, signal, star, etc." << endl;
+    gLog << "                             of sequence or dataset number" << endl << endl;
     gLog << " Root Options:" << endl;
     gLog << "   -b                        Batch mode (no graphical output to screen)" << endl<<endl;
@@ -135,5 +137,5 @@
         return 3;
     }
-    if (arg.GetNumArguments()!=1)
+    if (arg.GetNumArguments()<1 || arg.GetNumArguments()>2 || !arg.GetArgumentStr(1).IsDigit())
     {
         Usage();
@@ -151,5 +153,32 @@
     // Process filenames
     //
-    const TString kInput = arg.GetArgumentStr(0);
+    TString kInput = arg.GetArgumentStr(0);
+
+    //
+    // Something special for datacenter access
+    //
+    if (arg.GetNumArguments()==2)
+    {
+        const Int_t num = arg.GetArgumentStr(1).Atoi();
+        TString file = "/magic/data/";
+        switch (kInput.Hash())
+
+        {
+        case (unsigned long)-856860927:
+        case  764164111:
+            file += "callisto";
+            break;
+        default:
+            file += kInput;
+            break;
+        }
+        file += Form("/%04d/%08d/", num/10000, num);
+        file += kInput;
+        file += Form("%08d.root", num);
+
+        kInput = file;
+
+        gLog << inf << "Inflated file name: " << kInput << endl;
+    }
 
     if (kNamePs.IsNull()    && kSaveAsPs)
Index: /trunk/MagicSoft/Mars/sponde.cc
===================================================================
--- /trunk/MagicSoft/Mars/sponde.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/sponde.cc	(revision 7432)
@@ -30,5 +30,5 @@
     gLog << "                  Sponde - MARS V" << MARSVER             << endl;
     gLog << "               MARS -- SPectrum ON DEmand"                << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "========================================================" << endl;
     gLog << endl;
Index: /trunk/MagicSoft/Mars/star.cc
===================================================================
--- /trunk/MagicSoft/Mars/star.cc	(revision 7431)
+++ /trunk/MagicSoft/Mars/star.cc	(revision 7432)
@@ -30,5 +30,5 @@
     gLog << "                   Star - MARS V" << MARSVER              << endl;
     gLog << "      MARS -- STandard Analysis and Reconstruction"       << endl;
-    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ ">" << endl;
+    gLog << "   Compiled with ROOT v" << ROOTVER << " on <" << __DATE__ << ">" << endl;
     gLog << "========================================================" << endl;
     gLog << endl;
@@ -41,7 +41,8 @@
     gLog << all << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << " star [options] sequence.txt" << endl << endl;
+    gLog << " star [options] sequence.txt|number" << endl << endl;
     gLog << " Arguments:" << endl;
     gLog << "   sequence.txt:             Ascii file defining a sequence of runs" << endl;
+    gLog << "   number:                   The sequence number (using file in the datacenter)" << endl;
     gLog << "                             For more details see MSequence" << endl;
     gLog << " Root Options:" << endl;
@@ -146,5 +147,15 @@
     // Setup sequence file and check for its existance
     //
-    const TString kSequence = arg.GetArgumentStr(0);
+    TString kSequence = arg.GetArgumentStr(0);
+
+    //
+    // Something special for datacenter access
+    //
+    if (kSequence.IsDigit())
+    {
+        const Int_t numseq = kSequence.Atoi();
+        kSequence = Form("/magic/sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
+        gLog << inf << "Inflated sequence file: " << kSequence <<  endl;
+    }
 
     if (gSystem->AccessPathName(kSequence, kFileExists))
