Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 9302)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 9303)
@@ -30,5 +30,5 @@
      - changed a comment
 
-   * mbase/MEnv.h:
+   * mbase/MEnv.h, mbase/MMath.cc:
      - Do not assign a temporary TString to const char *
 
@@ -37,5 +37,12 @@
 
    * mhflux/MHCollectionArea.cc, mhflux/MHDisp.cc, mhflux/MHEnergyEst.cc,
-     mhflux/MHFalseSource.cc, mhflux/MHThreshold.cc:
+     mhflux/MHFalseSource.cc, mhflux/MHThreshold.cc, mhbase/MFillH.cc,
+     mastro/MAstroCamera.cc, mastro/MAstroCatalog.cc, mbase/MContinue.cc,
+     mbase/MFilter.cc, mbase/MLog.cc, mbase/MParContainer.cc, mhbase/MH.cc,
+     mbase/MParEmulated.cc, mbase/MStatusDisplay.cc, mbase/MTime.cc,
+     mhbase/MH3.cc, mhbase/MHn.cc,mhflux/MHAlpha.cc, mhist/MHCamera.cc,
+     mhflux/MHEffectiveOnTime.cc, mmuon/MHMuonPar.cc, mmovie/MMovieWrite.cc,
+     mhflux/MHFalseSource.cc, mhist/MHCamEvent.cc, 
+     mmain/MEventDisplay.cc, mreflector/MHReflector.cc:
      - use MString::Format instead of Form
 
@@ -48,4 +55,26 @@
    * msimcamera/MSimPSF.cc:
      - changed default for fSigma from 1 to -1
+
+   * mbase/MContinue.cc:
+     - changed default title
+
+   * mfileio/MWriteRootFile.cc:
+     - set kMustCleanup bit, otherwise it is not correctly deleted from
+       the list of cleanups
+
+   * mhbase/MH3.[h,cc]:
+     - added RecursiveRemove
+
+   * mhflux/MAlphaFitter.[h,cc]:
+     - moved code to source file
+     - improved setting of a new fFunc
+
+   * mhflux/MHAlpha.[h,cc], mhvstime/MHSectorVsTime.[h,cc]
+     - added RecursiveRemove
+
+   * mjobs/MJSimulation.cc:
+     - added MSimPSF
+     - Show only the non NightSky photons in the size plot
+     - changed the binning of BinningEvtWidth
 
 
Index: /trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHAlpha.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhflux/MHAlpha.cc	(revision 9303)
@@ -46,11 +46,8 @@
 #include "MHAlpha.h"
 
-#include <TF1.h>
-#include <TGraph.h>
 #include <TStyle.h>
 #include <TLatex.h>
 #include <TCanvas.h>
 #include <TPaveStats.h>
-#include <TStopwatch.h>
 
 #include "MSrcPosCam.h"
@@ -82,5 +79,5 @@
 MHAlpha::MHAlpha(const char *name, const char *title)
     : fNameParameter("MHillasSrc"), fParameter(0),
-    fOffData(0), fResult(0), fEnergy(0), fBin(0),
+    fOffData(0), fResult(0), fSigma(0), fEnergy(0), fBin(0),
     fPointPos(0), fTimeEffOn(0), fTime(0), fNumTimeBins(10),
     fHillas(0), fMatrix(0), fSkipHistTime(kFALSE), fSkipHistTheta(kFALSE),
@@ -100,4 +97,5 @@
     fHist.SetDirectory(NULL);
     fHist.UseCurrentStyle();
+    fHist.Sumw2();
 
     // Main histogram
@@ -107,5 +105,5 @@
     fHistTime.UseCurrentStyle();
     fHistTime.SetDirectory(NULL);
-
+    fHistTime.Sumw2();
 
     fHEnergy.SetName("Excess");
@@ -115,4 +113,5 @@
     fHEnergy.SetDirectory(NULL);
     fHEnergy.UseCurrentStyle();
+    fHEnergy.Sumw2();
 
     fHTheta.SetName("ExcessTheta");
@@ -123,4 +122,5 @@
     fHTheta.UseCurrentStyle();
     fHTheta.SetMinimum(0);
+    fHTheta.Sumw2();
 
     // effective on time versus time
@@ -1024,20 +1024,13 @@
     pave->SetLabel(title);
 
-    char txt[1000];
-    TText *ptxt;
-    sprintf(txt, " ");
-    ptxt = pave->AddText(txt);
+    TText *ptxt = pave->AddText(" ");
     ptxt->SetTextAlign(23);
 
-    //sprintf(txt, "Significance %.1f\\sigma,  off-scale %.2f  (\\omega=%.2f\\circ)",
-    //        fFit.GetSignificance(), fFit.GetScaleFactor(), fFit.GetGausSigma());
-    sprintf(txt, "Significance %.1f\\sigma,  off-scale %.2f",
-            fit.GetSignificance(), fit.GetScaleFactor());
-    ptxt = pave->AddText(txt);
+    ptxt = pave->AddText(MString::Format("Significance %.1f\\sigma,  off-scale %.2f",
+                                         fit.GetSignificance(), fit.GetScaleFactor()));
     ptxt->SetTextAlign(23);
 
-    sprintf(txt, "%.1f excess events,  %.1f background events",
-            fit.GetEventsExcess(), fit.GetEventsBackground());
-    ptxt = pave->AddText(txt);
+    ptxt = pave->AddText(MString::Format("%.1f excess events,  %.1f background events",
+                                         fit.GetEventsExcess(), fit.GetEventsBackground()));
     ptxt->SetTextAlign(23);
     pave->SetBit(kCanDelete);
@@ -1062,15 +1055,15 @@
     if (!fSkipHistEnergy)
     {
-        *fLog << inf << "Processing energy bins..." << endl;
+        *fLog << inf3 << "Processing energy bins..." << endl;
         FitEnergyBins();
     }
     if (!fSkipHistTheta)
     {
-        *fLog << inf << "Processing theta bins..." << endl;
+        *fLog << inf3 << "Processing theta bins..." << endl;
         FitThetaBins();
     }
     if (!fSkipHistTime)
     {
-        *fLog << inf << "Processing time bins..." << endl;
+        *fLog << inf3 << "Processing time bins..." << endl;
         UpdateAlphaTime(kTRUE);
         MH::RemoveFirstBin(fHTime);
@@ -1164,2 +1157,8 @@
     return gPad->GetPad(1)->DistancetoPrimitive(px,py)==0 ? 0 : 9999;
 }
+
+void MHAlpha::RecursiveRemove(TObject *obj)
+{
+    if (obj==fOffData)
+        fOffData = 0;
+}
Index: /trunk/MagicSoft/Mars/mhflux/MHAlpha.h
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHAlpha.h	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhflux/MHAlpha.h	(revision 9303)
@@ -152,4 +152,5 @@
     void Paint(Option_t *opt="");
     void Draw(Option_t *option="");
+    void RecursiveRemove(TObject *obj);
 
     // MParContainer
Index: /trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc	(revision 9303)
@@ -280,4 +280,5 @@
 
 #include "MTime.h"
+#include "MString.h"
 #include "MParameters.h"
 #include "MPointingPos.h"
@@ -609,5 +610,5 @@
 
     // Use a random name to make sure the object is unique
-    const TString name = Form("CalcTheta%d", (UInt_t)gRandom->Uniform(999999999));
+    const TString name = MString::Format("CalcTheta%d", (UInt_t)gRandom->Uniform(999999999));
 
     // nbins = number of Theta bins
@@ -795,9 +796,9 @@
     text.SetTextSize(0.04);
 
-    TString txt = Form("T_{eff} = %.1fs \\pm %.1fs", val, error);
+    TString txt = MString::Format("T_{eff} = %.1fs \\pm %.1fs", val, error);
     if (range>0)
-        txt += Form("     T_{axe} = %.1fs", range);
+        txt += MString::Format("     T_{axe} = %.1fs", range);
     if (fTotalTime>0)
-        txt += Form("     T_{max} = %.1fs", fTotalTime);
+        txt += MString::Format("     T_{max} = %.1fs", fTotalTime);
 
     text.SetText(0.35, 0.94, txt);
@@ -807,6 +808,6 @@
 void MHEffectiveOnTime::PaintText(Double_t *res) const
 {
-    TLatex text(0.27, 0.94, Form("T_{eff}=%.1fs\\pm%.1fs  \\lambda=%.1f\\pm%.1fHz  p=%.1f%%  \\chi^{2}/%d=%.1f",
-                                 res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5]));
+    TLatex text(0.27, 0.94, MString::Format("T_{eff}=%.1fs\\pm%.1fs  \\lambda=%.1f\\pm%.1fHz  p=%.1f%%  \\chi^{2}/%d=%.1f",
+                                            res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5]));
     text.SetBit(TLatex::kTextNDC);
     text.SetTextSize(0.04);
@@ -828,5 +829,5 @@
         return;
 
-    TLatex text(0.47, 0.94, Form("\\bar{p} = %.1f%%", sum/n));
+    TLatex text(0.47, 0.94, MString::Format("\\bar{p} = %.1f%%", sum/n));
     text.SetBit(TLatex::kTextNDC);
     text.SetTextSize(0.04);
Index: /trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc	(revision 9303)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.24 2009-02-07 16:11:57 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.25 2009-02-07 20:47:33 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -243,8 +243,8 @@
     fMm2Deg = geom->GetConvMm2Deg();
 
-    const TString off(Form("%sOff", fName.Data()));
+    const TString off(MString::Format("%sOff", fName.Data()));
     if (fName!=off && fHistOff==NULL)
     {
-        const TString desc(Form("%s [%s] found... using ", off.Data(), ClassName()));
+        const TString desc(MString::Format("%s [%s] found... using ", off.Data(), ClassName()));
         MHFalseSource *hoff = (MHFalseSource*)plist->FindObject(off, ClassName());
         if (!hoff)
@@ -1143,7 +1143,7 @@
     if (maxx>0 && maxy>0)
     {
-        const char *title = MString::Format(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ",
-                                            hist->GetXaxis()->GetBinCenter(maxx),
-                                            hist->GetYaxis()->GetBinCenter(maxy), maxs);
+        const TString title = MString::Format(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ",
+                                              hist->GetXaxis()->GetBinCenter(maxx),
+                                              hist->GetYaxis()->GetBinCenter(maxy), maxs);
 
         h = fHist.ProjectionZ("AlphaFit", maxx, maxx, maxy, maxy);
Index: /trunk/MagicSoft/Mars/mhist/MHCamEvent.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCamEvent.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhist/MHCamEvent.cc	(revision 9303)
@@ -57,4 +57,5 @@
 #include "MLogManip.h"
 
+#include "MString.h"
 #include "MParList.h"
 #include "MCamEvent.h"
@@ -232,7 +233,7 @@
 
     pad->cd(2);
-    if (gPad->FindObject(Form("%s;proj", fName.Data())))
-    {
-        TH1 *h=fSum->Projection(Form("%s;proj", fName.Data()));
+    if (gPad->FindObject(MString::Format("%s;proj", fName.Data())))
+    {
+        TH1 *h=fSum->Projection(MString::Format("%s;proj", fName.Data()));
         if (h->GetMaximum()>0)
             gPad->SetLogy();
@@ -240,14 +241,14 @@
 
     pad->cd(5);
-    if (gPad->FindObject(Form("%s;rad", fName.Data())))
-        fSum->RadialProfile(Form("%s;rad", fName.Data()));
+    if (gPad->FindObject(MString::Format("%s;rad", fName.Data())))
+        fSum->RadialProfile(MString::Format("%s;rad", fName.Data()));
 
     pad->cd(6);
-    if (gPad->FindObject(Form("%s;az", fName.Data())))
-        fSum->AzimuthProfile(Form("%s;az", fName.Data()));
+    if (gPad->FindObject(MString::Format("%s;az", fName.Data())))
+        fSum->AzimuthProfile(MString::Format("%s;az", fName.Data()));
 
     pad->cd(4);
     gPad->cd(1);
-    MHCamera *cam = (MHCamera*)gPad->FindObject(Form("%s;err", fName.Data()));
+    MHCamera *cam = (MHCamera*)gPad->FindObject(MString::Format("%s;err", fName.Data()));
     if (cam)
         cam->SetCamContent(*fSum, fErrorRelative ? 1 : 2);
@@ -262,5 +263,5 @@
     AppendPad();
 
-    TString name = Form("%s_1", pad->GetName());
+    TString name = MString::Format("%s_1", pad->GetName());
     TPad *p = new TPad(name,name,0.005, 0.5, 0.66, 0.995,col,0,0);
     p->SetFrameBorderMode(0);
@@ -271,5 +272,5 @@
 
     pad->cd();
-    name = Form("%s_2", pad->GetName());
+    name = MString::Format("%s_2", pad->GetName());
     p = new TPad(name,name,0.66, 0.5, 0.995, 0.995,col,0,0);
     p->SetFrameBorderMode(0);
@@ -277,5 +278,5 @@
     p->Draw();
     p->cd();
-    TH1 *h = fSum->Projection(Form("%s;proj", fName.Data()), 50);
+    TH1 *h = fSum->Projection(MString::Format("%s;proj", fName.Data()), 50);
     h->SetTitle("Projection");
     h->SetBit(kCanDelete);
@@ -283,5 +284,5 @@
 
     pad->cd();
-    name = Form("%s_3", pad->GetName());
+    name = MString::Format("%s_3", pad->GetName());
     p = new TPad(name,name,0.005, 0.005, 3./8, 0.5,col,0,0);
     p->SetFrameBorderMode(0);
@@ -292,5 +293,5 @@
 
     pad->cd();
-    name = Form("%s_4", pad->GetName());
+    name = MString::Format("%s_4", pad->GetName());
     p = new TPad(name,name,3./8, 0.005, 6./8-0.005, 0.5,col,0,0);
     p->SetFrameBorderMode(0);
@@ -306,5 +307,5 @@
 
     MHCamera *cam = new MHCamera(*fSum->GetGeometry());
-    cam->SetName(Form("%s;err", fName.Data()));
+    cam->SetName(MString::Format("%s;err", fName.Data()));
     cam->SetTitle(e);
     cam->SetYTitle(fSum->GetYaxis()->GetTitle());
@@ -314,5 +315,5 @@
 
     pad->cd();
-    name = Form("%s_5", pad->GetName());
+    name = MString::Format("%s_5", pad->GetName());
     p = new TPad(name,name,6./8,0.25,0.995,0.5,col,0,0);
     p->SetFrameBorderMode(0);
@@ -320,5 +321,5 @@
     p->Draw();
     p->cd();
-    h = (TH1*)fSum->RadialProfile(Form("%s;rad", fName.Data()), 20);
+    h = (TH1*)fSum->RadialProfile(MString::Format("%s;rad", fName.Data()), 20);
     h->SetTitle("Radial Profile");
     h->SetBit(kCanDelete|TH1::kNoStats);
@@ -326,5 +327,5 @@
 
     pad->cd();
-    name = Form("%s_6", pad->GetName());
+    name = MString::Format("%s_6", pad->GetName());
     p = new TPad(name,name,6./8,0.005,0.995,0.25,col,0,0);
     p->SetFrameBorderMode(0);
@@ -332,5 +333,5 @@
     p->Draw();
     p->cd();
-    h = (TH1*)fSum->AzimuthProfile(Form("%s;az", fName.Data()), 30);
+    h = (TH1*)fSum->AzimuthProfile(MString::Format("%s;az", fName.Data()), 30);
     h->SetTitle("Azimuth Profile");
     h->SetBit(kCanDelete|TH1::kNoStats);
Index: /trunk/MagicSoft/Mars/mhist/MHCamera.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhist/MHCamera.cc	(revision 9303)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.112 2009-01-21 14:37:07 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MHCamera.cc,v 1.113 2009-02-07 20:47:41 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -77,4 +77,5 @@
 
 #include "MH.h"
+#include "MString.h"
 #include "MBinning.h"
 #include "MHexagon.h"
@@ -1848,7 +1849,5 @@
         newtxt2.PaintText(-range*.85, -range*.85, text);
 
-        text = "";
-        text += Form("%.2f", range*.3*fGeomCam->GetConvMm2Deg());
-        text += "\\circ";
+        text = MString::Format("%.2f\\circ", range*.3*fGeomCam->GetConvMm2Deg());
         text = text.Strip(TString::kLeading);
 
@@ -1881,5 +1880,5 @@
         const Float_t step   = (islog && min>0 ? log10(max/min) : max-min);
         const Int_t   firsts = step/48*3 < 1e-8 ? 8 : (Int_t)floor(log10(step/48*3));
-        const TString opt    = Form("%%.%if", firsts>0 ? 0 : TMath::Abs(firsts));
+        const TString opt    = MString::Format("%%.%if", firsts>0 ? 0 : TMath::Abs(firsts));
 /*
         for (Int_t i=0; i<ncol+1; i+=3)
@@ -1898,5 +1897,5 @@
 
         for (Int_t i=0; i<=25; i++)
-            newtxt.PaintText(range+1.5*w, H*(i*ncol/25*h-1)-offset, Form(opt, bins[i]));
+            newtxt.PaintText(range+1.5*w, H*(i*ncol/25*h-1)-offset, MString::Format(opt, bins[i]));
 
         for (Int_t i=0; i<ncol; i++)
@@ -2081,5 +2080,5 @@
         // MHCamera and on the pad on which it is drawn --> The name
         // is unique. For ExecuteEvent gPad is always correctly set.
-        const TString name = Form("%p;%p;PixelContent", this, gPad);
+        const TString name = MString::Format("%p;%p;PixelContent", this, gPad);
 
         TCanvas *old = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(name);
@@ -2375,6 +2374,6 @@
         // Just to get the right (maximum) binning
         TProfile *half[2];
-        half[0] = RadialProfileS(s0, inner,Form("%sInner",GetName()));
-        half[1] = RadialProfileS(s0, outer,Form("%sOuter",GetName()));
+        half[0] = RadialProfileS(s0, inner, MString::Format("%sInner",GetName()));
+        half[1] = RadialProfileS(s0, outer, MString::Format("%sOuter",GetName()));
 
         for (Int_t i=0; i<2; i++)
@@ -2420,6 +2419,6 @@
         // Just to get the right (maximum) binning
         TProfile *half[2];
-        half[0] = AzimuthProfileA(inner,Form("%sInner",GetName()));
-        half[1] = AzimuthProfileA(outer,Form("%sOuter",GetName()));
+        half[0] = AzimuthProfileA(inner, MString::Format("%sInner",GetName()));
+        half[1] = AzimuthProfileA(outer, MString::Format("%sOuter",GetName()));
 
         for (Int_t i=0; i<2; i++)
Index: /trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc	(revision 9303)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MHSectorVsTime.cc,v 1.14 2008-11-11 11:42:16 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MHSectorVsTime.cc,v 1.15 2009-02-07 20:47:55 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -350,2 +350,8 @@
     AppendPad(opt);
 }
+
+void MHSectorVsTime::RecursiveRemove(TObject *obj)
+{
+    if (obj==fGraph)
+        fGraph = 0;
+}
Index: /trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.h
===================================================================
--- /trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.h	(revision 9302)
+++ /trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.h	(revision 9303)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-!  $Name: not supported by cvs2svn $:$Id: MHSectorVsTime.h,v 1.8 2008-11-11 11:42:16 tbretz Exp $
+!  $Name: not supported by cvs2svn $:$Id: MHSectorVsTime.h,v 1.9 2009-02-07 20:47:52 tbretz Exp $
 \* ======================================================================== */
 #ifndef MARS_MHSectorVsTime
@@ -87,4 +87,6 @@
     void Paint(Option_t *o=NULL);
 
+    void RecursiveRemove(TObject *obj);
+
     ClassDef(MHSectorVsTime, 3) // Histogram to sum camera events
 };
Index: /trunk/MagicSoft/Mars/mjobs/MJSimulation.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJSimulation.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mjobs/MJSimulation.cc	(revision 9303)
@@ -56,4 +56,5 @@
 #include "MSimReflector.h"
 #include "MSimPointingPos.h"
+#include "MSimPSF.h"
 #include "MSimGeomCam.h"
 #include "MSimSignalCam.h"
@@ -142,5 +143,5 @@
     hist.SetLog(kTRUE, kTRUE, kFALSE);
 
-    hist.AddHist("MPhotonEvent.GetNumPhotons");
+    hist.AddHist("MPhotonEvent.GetNumExternal");
     hist.InitName("Size");
     hist.InitTitle("Size;S [#]");
@@ -288,5 +289,5 @@
     MBinning binsvc(155,     0,       31, "BinningViewCone");
     MBinning binstr(150,   -25,      125, "BinningTrigger");
-    MBinning binsew(150,     0,      150, "BinningEvtWidth");
+    MBinning binsew(150,     0,       25, "BinningEvtWidth");
 
     plist.AddToList(&binse);
@@ -402,4 +403,6 @@
 
     MGeomApply apply;
+
+    MSimPSF simpsf;
 
     MSimGeomCam simgeom;
@@ -503,4 +506,5 @@
     if (header.IsDataRun())
     {
+        tasks.AddToList(&simpsf);
         tasks.AddToList(&simgeom);
         tasks.AddToList(&cont2);
Index: /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 9303)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.66 2009-01-14 12:31:36 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.67 2009-02-07 20:47:44 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -55,4 +55,5 @@
 //
 #include "MGList.h"              // MGList
+#include "MString.h"
 
 #include "MLog.h"
@@ -442,5 +443,5 @@
     // create gui elements
     //
-    TGLabel *file = new TGLabel(top1, new TGString(Form("%s#%s", filename, treename)));
+    TGLabel *file = new TGLabel(top1, new TGString(MString::Format("%s#%s", filename, treename)));
     fList->Add(file);
 
@@ -657,5 +658,5 @@
     //
     *fLog << all;
-    fLog->Separator(Form("Entry %d", reader->GetNumEntry()+1));
+    fLog->Separator(MString::Format("Entry %d", reader->GetNumEntry()+1));
     ((MHillas*)     plist->FindObject("MHillas"))->Print(*geom);
     ((MHillasExt*)  plist->FindObject("MHillasExt"))->Print(*geom);
@@ -673,5 +674,5 @@
 
     TGTextEntry *entry = (TGTextEntry*)fList->FindWidget(kEvtNumber);
-    entry->SetText(Form("%d", reader->GetNumEntry()+1));
+    entry->SetText(MString::Format("%d", reader->GetNumEntry()+1));
 }
 
@@ -757,5 +758,5 @@
 
     MReadTree *reader = (MReadTree*)fEvtLoop->FindTask("MRead");
-    TGString *txt = new TGString(Form("of %d", reader->GetEntries()));
+    TGString *txt = new TGString(MString::Format("of %d", reader->GetEntries()));
     fNumOfEvts->SetText(txt);
 
@@ -838,5 +839,5 @@
                 if (!o)
                     break;
-                fCanvas->SetName(Form("%p;%p;PixelContent", o->GetHist(), c->GetPad(1)->GetPad(1)));
+                fCanvas->SetName(MString::Format("%p;%p;PixelContent", o->GetHist(), c->GetPad(1)->GetPad(1)));
             }
             break;
Index: /trunk/MagicSoft/Mars/mmovie/MMovieWrite.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmovie/MMovieWrite.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mmovie/MMovieWrite.cc	(revision 9303)
@@ -93,4 +93,6 @@
 #include <TStopwatch.h>
 
+#include "MString.h"
+
 #include "MParList.h"
 #include "MTaskList.h"
@@ -173,5 +175,5 @@
 
     name += " -f 9 -E 40 -r 0 -K kvcd ";
-    name += Form("-g %d -G %d", n, n);
+    name += MString::Format("-g %d -G %d", n, n);
 
     // For higher resolution add "--no-constraints"
@@ -651,5 +653,5 @@
 
         // Set new name to be displayed
-        h.SetName(Form("%d: %.2f/%.1fns", i+1, t*freq, t));
+        h.SetName(MString::Format("%d: %.2f/%.1fns", i+1, t*freq, t));
 
         // Update existing image with new data and encode into pipe
@@ -660,5 +662,5 @@
     DeletePalette(colidx);
 
-    cout << setw(3) << GetNumExecutions() << ": " << Form("%6.2f", (float)numframes/(slices-2)) << " f/sl " << slices << " " << numframes+1 << endl;
+    cout << setw(3) << GetNumExecutions() << ": " << MString::Format("%6.2f", (float)numframes/(slices-2)) << " f/sl " << slices << " " << numframes+1 << endl;
 
     return kTRUE;
@@ -782,5 +784,5 @@
     */
 
-    TString s = Form("%d:  Evt #", GetNumExecutions()+1);
+    TString s = MString::Format("%d:  Evt #", GetNumExecutions()+1);
     s += fHead->GetDAQEvtNumber();
     s += " of ";
Index: /trunk/MagicSoft/Mars/mmuon/MHMuonPar.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmuon/MHMuonPar.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mmuon/MHMuonPar.cc	(revision 9303)
@@ -54,4 +54,6 @@
 #include "MLogManip.h"
 
+#include "MString.h"
+
 #include "MGeomCam.h"
 #include "MBinning.h"
@@ -274,6 +276,6 @@
     if (TString(opt)==TString("pad4"))
     {
-        const TString txt = Form("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.3f",
-                                 fgIntegralLoLim, fgIntegralUpLim, Integral(fHistBroad));
+        const TString txt = MString::Format("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.3f",
+                                            fgIntegralLoLim, fgIntegralUpLim, Integral(fHistBroad));
 
         TLatex text(0.55, 0.93, txt);
@@ -285,6 +287,6 @@
     if (TString(opt)==TString("pad3"))
     {
-        const TString txt = Form("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.f",
-                                 fgIntegralLoLim, fgIntegralUpLim, Integral(fHistSize));
+        const TString txt = MString::Format("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.f",
+                                            fgIntegralLoLim, fgIntegralUpLim, Integral(fHistSize));
 
         TLatex text(0.47, 0.93, txt);
Index: /trunk/MagicSoft/Mars/mreflector/MHReflector.cc
===================================================================
--- /trunk/MagicSoft/Mars/mreflector/MHReflector.cc	(revision 9302)
+++ /trunk/MagicSoft/Mars/mreflector/MHReflector.cc	(revision 9303)
@@ -226,5 +226,5 @@
     for (int i=1; i<=fHistRad.GetNbinsX(); i++)
     {
-        h = fHistRad.ProjectionY(Form("ProjRad%d", i), i, i, "e");
+        h = fHistRad.ProjectionY(MString::Format("ProjRad%d", i), i, i, "e");
         h->SetDirectory(NULL);
         h->SetBit(kCanDelete);
@@ -241,5 +241,5 @@
         const TString hi = MMcEvt::GetEnergyStr(xhi);
 
-        leg->AddEntry(h, Form("%s - %s", lo.Data(), hi.Data()));
+        leg->AddEntry(h, MString::Format("%s - %s", lo.Data(), hi.Data()));
     }
 
@@ -257,5 +257,5 @@
     for (int i=1; i<=fHistSize.GetNbinsX(); i++)
     {
-        h = fHistSize.ProjectionY(Form("ProjSize%d", i), i, i, "e");
+        h = fHistSize.ProjectionY(MString::Format("ProjSize%d", i), i, i, "e");
         h->SetDirectory(NULL);
         h->SetBit(kCanDelete);
@@ -297,5 +297,5 @@
     for (int i=1; i<=fHistRad.GetNbinsX(); i++)
     {
-        const TString name = Form("ProjRad%d", i);
+        const TString name = MString::Format("ProjRad%d", i);
         if (!gPad->FindObject(name))
             continue;
@@ -312,5 +312,5 @@
     for (int i=1; i<=fHistRad.GetNbinsX(); i++)
     {
-        const TString name = Form("ProjSize%d", i);
+        const TString name = MString::Format("ProjSize%d", i);
         if (!gPad->FindObject(name))
             continue;
