Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7133)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7134)
@@ -21,4 +21,40 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/06/03 Thomas Bretz
+
+   * ganymed.cc:
+     - fixed the wrong printout of ganymed
+
+   * mars.cc:
+     - allow to open a file via commandline
+
+   * mars.rc:
+     - added some more comments
+
+   * mcalib/MCalibrateRelTimes.cc:
+     - removed obsolete comments
+
+   * mmain/MEventDisplay.cc:
+     - implemented muon analysis
+     - fixed a crash caused by the DF
+
+   * mmain/Makefile:
+     - added -I../mmuon
+
+   * mmuon/MMuonCalibPar.cc:
+     - updated Print output
+
+   * mmuon/MMuonSearchPar.[h,cc]:
+     - updated print output
+     - added Paint function
+
+   * mranforest/MRFEnergyEst.h:
+     - fixed thw wrong data types in setters
+
+   * msignal/MExtractTimeAndChargeDigitalFilter.cc:
+     - don't try to find automatic weights without template file name
+
+
+
  2005/06/03
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 7133)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 7134)
@@ -3,5 +3,9 @@
  *** Version <cvs>
 
-
+   - mars: show muon parameters graphically
+
+   - mars: now the file to open can be given as commandline
+     argument
+ 
 
  *** Version 0.9.3 (2005/06/03)
Index: /trunk/MagicSoft/Mars/ganymed.cc
===================================================================
--- /trunk/MagicSoft/Mars/ganymed.cc	(revision 7133)
+++ /trunk/MagicSoft/Mars/ganymed.cc	(revision 7134)
@@ -41,5 +41,5 @@
     gLog << all << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << " ganymed [-c] [-y] [options] sequences.txt" << endl << endl;
+    gLog << " ganymed [options] sequences.txt" << endl << endl;
     gLog << " Arguments:" << endl;
     gLog << "   dataset.txt:              Ascii file defining a collection of sequences" << endl;
Index: /trunk/MagicSoft/Mars/mars.cc
===================================================================
--- /trunk/MagicSoft/Mars/mars.cc	(revision 7133)
+++ /trunk/MagicSoft/Mars/mars.cc	(revision 7134)
@@ -6,5 +6,4 @@
 #include "MLogManip.h"
 
-#include "MCameraDisplay.h"
 #include "MArgs.h"
 #include "MArray.h"
@@ -14,4 +13,7 @@
 #include "MLogo.h"
 #endif
+
+#include "MCameraDisplay.h"
+#include "MEventDisplay.h"
 
 using namespace std;
@@ -43,5 +45,5 @@
     gLog << all << endl;
     gLog << "Sorry the usage is:" << endl;
-    gLog << " mars [options]" << endl << endl;
+    gLog << " mars [options] [filename]" << endl << endl;
     gLog << " Options:" << endl;
     gLog.Usage();
@@ -59,9 +61,14 @@
     StartUpMessage();
 
-    if (arg.HasOption("-?") || arg.HasOption("-h"))
+    if (arg.HasOption("-?") || arg.HasOption("-h") || arg.GetNumArguments()>1)
     {
         Usage();
         return 2;
     }
+
+    //
+    // This is to make argv[i] more readable insidethe code
+    //
+    const TString kFilename = arg.GetArgumentStr(0);
 
 #ifdef HAVE_XPM
@@ -86,12 +93,4 @@
     MParContainer::Class()->IgnoreTObjectStreamer();
 
-    /*
-    TGApplication app("Mars", &argc, argv);
-
-#if ROOT_VERSION_CODE < ROOT_VERSION(3,10,02)
-    InitGuiFactory();
-#endif
-    */
-
 #ifdef HAVE_XPM
     logo.Popdown();
@@ -101,5 +100,8 @@
     // start the main window
     //
-    new MCameraDisplay;
+    if (kFilename.IsNull())
+        new MCameraDisplay;
+    else
+        new MEventDisplay(kFilename);
 
     //
Index: /trunk/MagicSoft/Mars/mars.rc
===================================================================
--- /trunk/MagicSoft/Mars/mars.rc	(revision 7133)
+++ /trunk/MagicSoft/Mars/mars.rc	(revision 7134)
@@ -23,5 +23,6 @@
 # whole calibration chain
 # -------------------------------------------------------------------------
-ExtractSignal: MExtractTimeAndChargeDigitalFilter
+#ExtractSignal: MExtractTimeAndChargeDigitalFilter
+#ExtractSignal.WeightsFile: msignal/MC_weights46.dat
 # -------------------------------------------------------------------------
 # Define here an extractor which can be used for the December 04 data.
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc	(revision 7133)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc	(revision 7134)
@@ -84,9 +84,4 @@
 //  - MBadPixelsCam
 //
-// The following output containers are also searched and created if
-// they were not found:
-//
-//  - MArrivalTime
-//
 Int_t MCalibrateRelTimes::PreProcess(MParList *pList)
 {
@@ -127,16 +122,4 @@
 Int_t MCalibrateRelTimes::Process()
 {
-    /*
-     if (fCalibrations->GetNumPixels() != (UInt_t)fSignals->GetSize())
-     {
-     // FIXME: MArrivalTime must be of variable size -
-     //        like MSignalCam - because we must be able
-     //        to reduce size by zero supression
-     //        For the moment this check could be done in ReInit...
-     *fLog << err << "MArrivalTime and MCalibrationCam have different sizes... abort." << endl;
-     return kFALSE;
-     }
-     */
-
     const UInt_t npix = fSignals->GetSize();
 
Index: /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7133)
+++ /trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7134)
@@ -83,4 +83,6 @@
 #include "MMcCalibrationUpdate.h" // MMcCalibrationUpdate
 #include "MCalibrateData.h"       // MCalibrateData
+#include "MMuonSearchParCalc.h"   // MMuonSearchParCalc
+#include "MMuonCalibParCalc.h"    // MMuonCalibParCalc
 //#include "MMcTriggerLvl2Calc.h"   // MMcTriggerLvl2Calc
 
@@ -100,4 +102,5 @@
 #include "MPedPhotCam.h"           // MPedPhotCam
 #include "MCalibrationChargeCam.h" // MCalibrationChargeCam
+#include "MMuonSearchPar.h"        // MMuonCalibPar
 //#include "MMcTriggerLvl2.h"        // MMcTriggerLvl2
 
@@ -212,6 +215,6 @@
     //plist->AddToList(atime);
 
-    MHEvent *evt01 = new MHEvent(MHEvent::kEvtSignalRaw);
-    MHEvent *evt02 = new MHEvent(MHEvent::kEvtSignalRaw);
+    MHEvent *evt01 = new MHEvent(MHEvent::kEvtSignalDensity);
+    MHEvent *evt02 = new MHEvent(MHEvent::kEvtSignalDensity);
     MHEvent *evt03 = new MHEvent(type==1?MHEvent::kEvtPedPhot:MHEvent::kEvtPedestal);
     MHEvent *evt04 = new MHEvent(type==1?MHEvent::kEvtPedPhotRMS:MHEvent::kEvtPedestalRMS);
@@ -247,5 +250,5 @@
 
     MExtractTimeAndChargeDigitalFilter *digf = new MExtractTimeAndChargeDigitalFilter;
-    digf->ReadWeightsFile("msignal/MC_weights.dat");
+    digf->SetNameWeightsFile("msignal/cosmics_weights46.dat");
 
     MTaskEnv *taskenv1=new MTaskEnv("ExtractSignal");
@@ -253,19 +256,19 @@
     taskenv1->SetOwner();
 
-    MSignalCalc        *nanal  = new MSignalCalc;
-    MFillH             *fill01 = new MFillH(evt01, "MSignalCam", "MFillH01");
-    MImgCleanStd       *clean  = new MImgCleanStd;
-    MFillH             *fill02 = new MFillH(evt02, "MSignalCam", "MFillH02");
-    MFillH             *fill03 = new MFillH(evt03, type==1?"MPedPhotFundamental":"MPedestalCam",       "MFillH03");
-    MFillH             *fill04 = new MFillH(evt04, type==1?"MPedPhotFromExtractorRndm":"MPedestalCam", "MFillH04");
-    MFillH             *fill06a= new MFillH(evt06a, "MCameraData", "MFillH06a");
-    MFillH             *fill06b= new MFillH(evt06b, "MCameraData", "MFillH06b");
-    MHillasCalc        *hcalc  = new MHillasCalc;
+    MSignalCalc     *nanal   = new MSignalCalc;
+    MFillH          *fill01  = new MFillH(evt01, "MSignalCam", "MFillH01");
+    MImgCleanStd    *clean   = new MImgCleanStd;
+    MFillH          *fill02  = new MFillH(evt02, "MSignalCam", "MFillH02");
+    MFillH          *fill03  = new MFillH(evt03, type==1?"MPedPhotFundamental":"MPedestalCam",       "MFillH03");
+    MFillH          *fill04  = new MFillH(evt04, type==1?"MPedPhotFromExtractorRndm":"MPedestalCam", "MFillH04");
+    MFillH          *fill06a = new MFillH(evt06a, "MCameraData", "MFillH06a");
+    MFillH          *fill06b = new MFillH(evt06b, "MCameraData", "MFillH06b");
+    MHillasCalc     *hcalc   = new MHillasCalc;
     //MMcTriggerLvl2Calc *trcal  = new MMcTriggerLvl2Calc;
     //MFillH             *fill09 = new MFillH(evt09, "MMcTriggerLvl2", "MFillH09");
-    MFillH             *fill10 = new MFillH(evt10, "MSignalCam",    "MFillH10");
-
-    MBadPixelsCalc     *bcalc  = new MBadPixelsCalc;
-    MBadPixelsTreat    *btreat = new MBadPixelsTreat;
+    MFillH          *fill10  = new MFillH(evt10, "MSignalCam",    "MFillH10");
+
+    MBadPixelsCalc  *bcalc   = new MBadPixelsCalc;
+    MBadPixelsTreat *btreat  = new MBadPixelsTreat;
     btreat->SetProcessTimes(kFALSE);
     if (type==1)
@@ -336,4 +339,12 @@
     }
     tlist->AddToList(hcalc);
+    // --------------------------------------------------
+    MMuonSearchParCalc *muscalc = new MMuonSearchParCalc;
+    MMuonCalibParCalc  *mcalc   = new MMuonCalibParCalc;
+    MFillH *fillmuon = new MFillH("MHSingleMuon", "", "FillMuon");
+    tlist->AddToList(muscalc);
+    tlist->AddToList(fillmuon);
+    tlist->AddToList(mcalc);
+    // --------------------------------------------------
 
     //
@@ -542,4 +553,6 @@
     plist->FindObject("MImagePar")->Print();
     ((MNewImagePar*)plist->FindObject("MNewImagePar"))->Print(*geom);
+    plist->FindObject("MMuonCalibPar")->Print();
+    ((MMuonSearchPar*)plist->FindObject("MMuonSearchPar"))->Print(*geom);
 
     //
@@ -589,8 +602,10 @@
     TObject *hillas1 = plist->FindObject("MHillas");
     TObject *hillas2 = plist->FindObject("MHillasSrc");
+    TObject *hmuon   = plist->FindObject("MMuonSearchPar");
     for (int i=1; i<7;i++)
     {
         TCanvas *c = GetCanvas(i);
         c->GetPad(1)->cd(1);
+        hmuon->Draw();
         hillas1->Draw();
         hillas2->Draw();
Index: /trunk/MagicSoft/Mars/mmain/Makefile
===================================================================
--- /trunk/MagicSoft/Mars/mmain/Makefile	(revision 7133)
+++ /trunk/MagicSoft/Mars/mmain/Makefile	(revision 7134)
@@ -23,5 +23,5 @@
            -I../mfileio -I../mimage -I../mhistmc -I../mgbase -I../mfbase  \
            -I../mdata -I../msignal -I../mcalib -I../mbadpixels            \
-           -I../mpointing -I../mpedestal
+           -I../mpointing -I../mpedestal -I../mmuon
 
 SRCFILES = MBrowser.cc \
Index: /trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc	(revision 7133)
+++ /trunk/MagicSoft/Mars/mmuon/MMuonCalibPar.cc	(revision 7134)
@@ -52,5 +52,5 @@
 {
     fName  = name  ? name  : "MMuonCalibPar";
-    fTitle = title ? title : "Muon calibration parameters";
+    fTitle = title ? title : "Parameters to calculate Muon calibration";
 
     Reset();
@@ -76,11 +76,11 @@
     *fLog << "Muon Parameters (" << GetName() << ")"       << endl;
 //    *fLog << " - Arc Length    [deg]   = " << fArcLength   << endl;
-    *fLog << " - Arc Phi       [deg]   = " << fArcPhi      << endl;
-    *fLog << " - Arc Width     [deg]   = " << fArcWidth    << endl;
-    *fLog << " - Chi Arc Phi   [x2/ndf]= " << fChiArcPhi   << endl;
-    *fLog << " - Chi Arc Width [x2/ndf]= " << fChiArcWidth << endl;
+    *fLog << " - Arc Phi      [deg]   = " << fArcPhi      << endl;
+    *fLog << " - Arc Width    [deg]   = " << fArcWidth    << endl;
+    *fLog << " - Chi Arc Phi  [x2/ndf]= " << fChiArcPhi   << endl;
+    *fLog << " - Chi Arc Width[x2/ndf]= " << fChiArcWidth << endl;
 //    *fLog << " - Est. I. P.    [m]     = " << fEstImpact   << endl;
-    *fLog << " - Size of muon  [phe]   = " << fMuonSize    << endl;
-    *fLog << " - Peak Phi      [deg]   = " << fPeakPhi     << endl;
+    *fLog << " - Size of muon [phe]   = " << fMuonSize    << endl;
+    *fLog << " - Peak Phi     [deg]   = " << fPeakPhi     << endl;
 }
 
Index: /trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc	(revision 7133)
+++ /trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.cc	(revision 7134)
@@ -54,4 +54,5 @@
 
 #include <TMinuit.h>
+#include <TEllipse.h>
 
 #include "MLog.h"
@@ -77,5 +78,5 @@
 {
     fName  = name  ? name  : "MMuonSearchPar";
-    fTitle = title ? title : "Muon search parameters";
+    fTitle = title ? title : "Parameters to find Muons";
 }
 
@@ -261,8 +262,8 @@
     *fLog << all;
     *fLog << "Muon Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Est. Radius   [mm]  = " << fRadius  << endl;
-    *fLog << " - Deviation     [mm]  = " << fDeviation  << endl;
-    *fLog << " - Center Pos. X [mm]  = " << fCenterX << endl;
-    *fLog << " - Center Pos. Y [mm]  = " << fCenterY << endl;
+    *fLog << " - Est. Radius     [mm] = " << fRadius  << endl;
+    *fLog << " - Deviation       [mm] = " << fDeviation  << endl;
+    *fLog << " - Center Pos. X   [mm] = " << fCenterX << endl;
+    *fLog << " - Center Pos. Y   [mm] = " << fCenterY << endl;
 }
 
@@ -271,7 +272,26 @@
     *fLog << all;
     *fLog << "Muon Parameters (" << GetName() << ")" << endl;
-    *fLog << " - Est. Radius   [deg] = " << fRadius*geom.GetConvMm2Deg()   << endl;
-    *fLog << " - Deviation     [deg] = " << fDeviation*geom.GetConvMm2Deg()   << endl;
-    *fLog << " - Center Pos. X [deg] = " << fCenterX*geom.GetConvMm2Deg()  << endl;
-    *fLog << " - Center Pos. Y [deg] = " << fCenterY*geom.GetConvMm2Deg()  << endl;
-}
+    *fLog << " - Est. Radius    [deg] = " << fRadius*geom.GetConvMm2Deg()   << endl;
+    *fLog << " - Deviation      [deg] = " << fDeviation*geom.GetConvMm2Deg()   << endl;
+    *fLog << " - Center Pos. X  [deg] = " << fCenterX*geom.GetConvMm2Deg()  << endl;
+    *fLog << " - Center Pos. Y  [deg] = " << fCenterY*geom.GetConvMm2Deg()  << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Paint the ellipse corresponding to the parameters
+//
+void MMuonSearchPar::Paint(Option_t *opt)
+{
+    if (fRadius<180 || fRadius>400 || fDeviation>45)
+        return;
+
+    TEllipse e1(fCenterX, fCenterY, fRadius-fDeviation, fRadius-fDeviation);
+    TEllipse e2(fCenterX, fCenterY, fRadius+fDeviation, fRadius+fDeviation);
+    e1.SetLineWidth(1);
+    e2.SetLineWidth(1);
+    e1.SetLineColor(kYellow);
+    e2.SetLineColor(kYellow);
+    e1.Paint();
+    e2.Paint();
+}
Index: /trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.h
===================================================================
--- /trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.h	(revision 7133)
+++ /trunk/MagicSoft/Mars/mmuon/MMuonSearchPar.h	(revision 7134)
@@ -32,6 +32,8 @@
     MMuonSearchPar(const char *name=NULL, const char *title=NULL);
 
+    // MParContainer
     void Reset();
 
+    // Getter
     Float_t GetRadius()    const { return fRadius; }
     Float_t GetDeviation() const { return fDeviation; }
@@ -39,4 +41,5 @@
     Float_t GetCenterY()   const { return fCenterY; }
 
+    // MMuonSearchPar
     void   CalcMinimumDeviation(const MGeomCam &geom, const MSignalCam &evt,
                                 Double_t &x, Double_t &y, Double_t &sigma, Double_t &rad);
@@ -45,4 +48,6 @@
 		const MHillas &hillas);
 
+    // TObject
+    void   Paint(Option_t *opt="");
     void   Print(Option_t *opt=NULL) const;
     void   Print(const MGeomCam &geom, Option_t *opt=NULL) const;
Index: /trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.h
===================================================================
--- /trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.h	(revision 7133)
+++ /trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.h	(revision 7134)
@@ -41,7 +41,7 @@
     void  SetFileName(TString str)     { fFileName = str; }
 
-    void  SetNumTrees(UShort_t n=-1)   { fNumTrees = n; }
-    void  SetNdSize(UShort_t n=-1)     { fNdSize   = n; }
-    void  SetNumTry(UShort_t n=-1)     { fNumTry   = n; }
+    void  SetNumTrees(Int_t n=-1)   { fNumTrees = n; }
+    void  SetNdSize(Int_t n=-1)     { fNdSize   = n; }
+    void  SetNumTry(Int_t n=-1)     { fNumTry   = n; }
 
     void  SetTestMatrix(MHMatrix *m=0) { fTestMatrix=m; }
Index: /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7133)
+++ /trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7134)
@@ -846,4 +846,10 @@
         return kTRUE;
 
+    if (fNameWeightsFile.IsNull())
+    {
+        *fLog << err << "ERROR - Cannot get automatic weights without default filename." << endl;
+        return kFALSE;
+    }
+
     *fLog << dbg << endl;
     *fLog << underline << GetDescriptor() << endl;
