Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 4576)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 4577)
@@ -20,7 +20,54 @@
                                                  -*-*- END OF LINE -*-*-
 
+  2004/08/10: Thomas Bretz
+
+   * mreport/MReportFileReadCC.[h,cc]:
+     - added
+
+   * mreport/Makefile, mreport/ReportsLinkDef.h:
+     - added MReportFileReadCC
+
+   * mreport/MReport*.[h,cc]:
+     - prpagate file version number to all Interpreters
+
+   * merpp.cc:
+     - added new commandline options to support different CC files
+     - changed help-output
+
+   * readraw.cc:
+     - a small fix (a '.' was missing)
+
+   * mraw/MRawEvtData.cc:
+     - fixed bug in Print
+
+   * manalysis/MGeomApply.cc:
+     - changed to Init all MCamEvents in the parlist
+
+   * mbase/MParList.[h,cc]:
+     - added a cast operator to TIterator*
+     - check whether a automatic created class inherits from MParConatiner
+
+   * mgui/MCamEvent.[h,cc]:
+     - added Init
+     - added InitSize
+
+   * mmc/MMcTrig.cxx:
+     - added a new option to Print()
+
+   * mraw/MRawEvtData.[h,cc], mraw/MRawEvtHeader.[h,cc],
+     mraw/MRawFileRead.cc, mraw/MRawSocketRead.cc
+     - changed Init() to InitRead()
+
+   * msignal/MArrivalTime.[h,cc]:
+     - changed argument of InitSize according to MCamEvent
+
+   * msql/MSQLServer.[h,cc]:
+     - small changes to interface
+
+
+
   2004/08/10: Robert Wagner
 
-   * mreports/MReportCamera.[h,cc]
+   * mreport/MReportCamera.[h,cc]
      - added function InterpreteHOT which interprete the HOT* part of 
        the report. The variable HVs_modified_by_HOT_Pixels is 
@@ -29,4 +76,5 @@
 
 
+
   2004/08/10: Markus Gaug
 
@@ -42,4 +90,5 @@
      - implemented different way to calculate error of signal 
        in method kFlatCharge (as discussed with Keiichi).
+
 
 
@@ -53,4 +102,6 @@
      - change format of "Format"
      - change default value for fgMaxHiGainVar to 40
+
+
 
   2004/08/10: Nadia Tonello
Index: /trunk/MagicSoft/Mars/manalysis/MGeomApply.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/manalysis/MGeomApply.cc	(revision 4577)
@@ -118,6 +118,6 @@
 Bool_t MGeomApply::ReInit(MParList *pList)
 {
-    MGeomCam *cam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
-    if (!cam)
+    MGeomCam *geom = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam"));
+    if (!geom)
     {
        *fLog << err << GetDescriptor() << ": No MGeomCam found... aborting." << endl;
@@ -128,33 +128,43 @@
     // the use of some camera files from the 0.7 beta version in which the 
     // array containing pixel ratios is not initialized.
-    cam->CalcPixRatio();
-
+    geom->CalcPixRatio();
+
+    TIter Next(*pList);
+    TObject *o = 0;
+
+    while ((o=Next()))
+    {
+        MCamEvent *cam = dynamic_cast<MCamEvent*>(o);
+        if (cam)
+            cam->Init(*geom);
+    }
+/*
     MPedestalCam *ped = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam"));
     if (ped)
-        ped->Init(*cam);
+        ped->Init(*geom);
 
     MCalibrationCam *cal = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam"));
     if (cal)
-        cal->Init(*cam);
+        cal->Init(*geom);
 
     MCalibrationCam *cat = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationRelTimeCam"));
     if (cat)
-        cat->Init(*cam);
+        cat->Init(*geom);
 
     MCalibrationCam *qe = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationQECam"));
     if (qe)
-        qe->Init(*cam);
+        qe->Init(*geom);
 
     MCalibrationCam *pcam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationPedCam"));
     if (pcam)
-        pcam->Init(*cam);
+        pcam->Init(*geom);
 
     MPedPhotCam *pedphot = (MPedPhotCam*)pList->FindObject(AddSerialNumber("MPedPhotCam"));
     if (pedphot)
-        pedphot->Init(*cam);
+        pedphot->Init(*geom);
 
     MExtractedSignalCam *ext = (MExtractedSignalCam*)pList->FindObject(AddSerialNumber("MExtractedSignalCam"));
     if (ext)
-        ext->InitSize(cam->GetNumPixels());
+        ext->Init(*cam);
 
     MArrivalTimeCam *tme = (MArrivalTimeCam*)pList->FindObject(AddSerialNumber("MArrivalTimeCam"));
@@ -168,5 +178,6 @@
     MBadPixelsCam *bad = (MBadPixelsCam*)pList->FindObject(AddSerialNumber("MBadPixelsCam"));
     if (bad)
-      bad->InitSize(cam->GetNumPixels());
+        bad->InitSize(cam->GetNumPixels());
+    */
 
     return kTRUE;
Index: /trunk/MagicSoft/Mars/mbase/MParList.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/mbase/MParList.cc	(revision 4577)
@@ -515,4 +515,10 @@
     }
 
+    if (!cls->InheritsFrom(MParContainer::Class()))
+    {
+        *fLog << " - Class doesn't inherit from MParContainer." << endl;
+        return NULL;
+    }
+
     //
     // create the parameter container of the the given class type
@@ -936,2 +942,18 @@
     return kTRUE;
 }
+
+// --------------------------------------------------------------------------
+//
+// Can be used to create an iterator over all containers, eg:
+//   MParList plist;
+//   TIter Next(plist); // Be aware: Use a object here rather than a pointer!
+//   TObject *o=0;
+//   while ((o=Next()))
+//   {
+//       [...]
+//   }
+//
+MParList::operator TIterator*() const
+{
+    return new TOrdCollectionIter(fContainer);
+}
Index: /trunk/MagicSoft/Mars/mbase/MParList.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParList.h	(revision 4576)
+++ /trunk/MagicSoft/Mars/mbase/MParList.h	(revision 4577)
@@ -94,4 +94,6 @@
     Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const;
 
+    operator TIterator*() const;
+
     ClassDef(MParList, 1) // list of parameter containers (MParContainer)
 };
Index: /trunk/MagicSoft/Mars/mgui/MCamEvent.cc
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/mgui/MCamEvent.cc	(revision 4577)
@@ -40,3 +40,17 @@
 #include "MCamEvent.h"
 
+#include "MGeomCam.h"
+
 ClassImp(MCamEvent);
+
+// --------------------------------------------------------------------------
+//
+// You can overwrite this function if you want the container to be
+// initialized by MGeomApply with the geometry. If it is not overloaded
+// it calls InitSize with the corresponding pixel number. If this information
+// is enough for you it is enough to overload InitSize.
+//
+void MCamEvent::Init(const MGeomCam &geom)
+{
+    InitSize(geom.GetNumPixels());
+}
Index: /trunk/MagicSoft/Mars/mgui/MCamEvent.h
===================================================================
--- /trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 4576)
+++ /trunk/MagicSoft/Mars/mgui/MCamEvent.h	(revision 4577)
@@ -14,4 +14,7 @@
     virtual void   DrawPixelContent(Int_t num) const = 0;
 
+    virtual void   Init(const MGeomCam &geom);
+    virtual void   InitSize(const UInt_t i) { } // Used by MGeomApply see Init()
+
     ClassDef(MCamEvent, 0) // A camera event
 };
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtData.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtData.h	(revision 4576)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtData.h	(revision 4577)
@@ -50,5 +50,5 @@
     ~MRawEvtData();
 
-    void Init(MRawRunHeader *rh, MRawCrateArray *arr)
+    void InitRead(MRawRunHeader *rh, MRawCrateArray *arr)
     {
         //
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc	(revision 4577)
@@ -140,5 +140,5 @@
 // a raw binary file
 //
-void MRawEvtHeader::Init(MRawRunHeader *rh, MTime *t)
+void MRawEvtHeader::InitRead(MRawRunHeader *rh, MTime *t)
 {
     //
Index: /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 4576)
+++ /trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h	(revision 4577)
@@ -53,5 +53,5 @@
     ~MRawEvtHeader();
 
-    void Init(MRawRunHeader *rh, MTime *t);
+    void InitRead(MRawRunHeader *rh, MTime *t);
 
     void Clear(Option_t * = NULL);
Index: /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/mraw/MRawFileRead.cc	(revision 4577)
@@ -206,6 +206,6 @@
     // Run header must be valid!
     //
-    fRawEvtHeader->Init(fRawRunHeader, fRawEvtTime);
-    fRawEvtData  ->Init(fRawRunHeader, fRawCrateArray);
+    fRawEvtHeader->InitRead(fRawRunHeader, fRawEvtTime);
+    fRawEvtData  ->InitRead(fRawRunHeader, fRawCrateArray);
 
     //
Index: /trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc
===================================================================
--- /trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc	(revision 4577)
@@ -262,6 +262,6 @@
     // Run header must be valid!
     //
-    fRawEvtHeader->Init(fRawRunHeader, fRawEvtTime);
-    fRawEvtData  ->Init(fRawRunHeader, fRawCrateArray);
+    fRawEvtHeader->InitRead(fRawRunHeader, fRawEvtTime);
+    fRawEvtData  ->InitRead(fRawRunHeader, fRawCrateArray);
 
     if (!ReadEvent(*fIn))
Index: /trunk/MagicSoft/Mars/mraw/RawLinkDef.h
===================================================================
--- /trunk/MagicSoft/Mars/mraw/RawLinkDef.h	(revision 4576)
+++ /trunk/MagicSoft/Mars/mraw/RawLinkDef.h	(revision 4577)
@@ -5,8 +5,8 @@
 #pragma link off all functions;
 
-#pragma link C++ class MRawRunHeader;
+#pragma link C++ class MRawRunHeader+;
 
-#pragma link C++ class MRawEvtHeader;
-#pragma link C++ class MRawEvtData;
+#pragma link C++ class MRawEvtHeader+;
+#pragma link C++ class MRawEvtData+;
 #pragma link C++ class MRawEvtPixelIter+;
 
Index: /trunk/MagicSoft/Mars/msignal/MArrivalTime.cc
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MArrivalTime.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/msignal/MArrivalTime.cc	(revision 4577)
@@ -67,5 +67,5 @@
 }
 
-void MArrivalTime::InitSize(Int_t i)
+void MArrivalTime::InitSize(const UInt_t i)
 {
   fData.Set(i);
Index: /trunk/MagicSoft/Mars/msignal/MArrivalTime.h
===================================================================
--- /trunk/MagicSoft/Mars/msignal/MArrivalTime.h	(revision 4576)
+++ /trunk/MagicSoft/Mars/msignal/MArrivalTime.h	(revision 4577)
@@ -30,5 +30,5 @@
 
     void   Reset();
-    void   InitSize(Int_t i);
+    void   InitSize(const UInt_t i);
 
     UInt_t GetSize() const { return fData.GetSize(); }
Index: /trunk/MagicSoft/Mars/msql/MSQLServer.cc
===================================================================
--- /trunk/MagicSoft/Mars/msql/MSQLServer.cc	(revision 4576)
+++ /trunk/MagicSoft/Mars/msql/MSQLServer.cc	(revision 4577)
@@ -221,5 +221,5 @@
 }
 
-void MSQLServer::PrintLine(const TArrayI &max) const /*FOLD00*/
+void MSQLServer::PrintLine(const TArrayI &max) /*FOLD00*/
 {
     cout << "+" << setfill('-');
@@ -229,17 +229,17 @@
 }
 
-void MSQLServer::PrintTable(TSQLResult *res) const /*FOLD00*/
-{
-    Int_t n = res->GetFieldCount();
+void MSQLServer::PrintTable(TSQLResult &res) /*FOLD00*/
+{
+    Int_t n = res.GetFieldCount();
 
     TArrayI max(n);
 
     for (int i=0; i<n; i++)
-        max[i] = strlen(res->GetFieldName(i));
+        max[i] = strlen(res.GetFieldName(i));
 
     TSQLRow *row;
 
     TList rows;
-    while ((row=res->Next()))
+    while ((row=res.Next()))
     {
         for (int i=0; i<n; i++)
@@ -254,5 +254,5 @@
     cout << "|" << setfill(' ');
     for (int i=0; i<n; i++)
-        cout << setw(max[i]+1) << res->GetFieldName(i) << " |";
+        cout << setw(max[i]+1) << res.GetFieldName(i) << " |";
     cout << endl;
 
@@ -305,5 +305,5 @@
     if (res)
     {
-        PrintTable(res);
+        PrintTable(*res);
         delete res;
     }
Index: /trunk/MagicSoft/Mars/msql/MSQLServer.h
===================================================================
--- /trunk/MagicSoft/Mars/msql/MSQLServer.h	(revision 4576)
+++ /trunk/MagicSoft/Mars/msql/MSQLServer.h	(revision 4577)
@@ -28,6 +28,4 @@
     Bool_t PrintError(const char *txt, const char *q) const;
 
-    void PrintLine(const TArrayI &max) const;
-    void PrintTable(TSQLResult *res) const;
     TString GetFields() const;
 
@@ -84,4 +82,7 @@
     ~MSQLServer();
 
+    static void PrintLine(const TArrayI &max);
+    static void PrintTable(TSQLResult &res);
+
     const char *GetName() const;
 
Index: /trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx
===================================================================
--- /trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 4576)
+++ /trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 4577)
@@ -93,26 +93,27 @@
 }
 
-void MMcTrig::Print(Option_t *Option) const {
-  //
-  //  print out the data member on screen
-  //
-  Int_t i,j;
+void MMcTrig::Print(Option_t *option) const
+{
+    //
+    //  print out the data member on screen
+    //
+    cout << "Monte Carlo Trigger output:" << endl;
+    cout << " First Level Trigger in this Event: " << fNumFirstLevel << endl;
+    if (!TString(option).Contains("short"))
+    {
+        cout << " Times of first Level Trigger in this Event: ";
+        for (int i=0; i<fNumFirstLevel; i++)
+            cout << fTimeFirst[i] << " ";
+        cout << endl;
 
-  cout <<endl << "Monte Carlo Trigger output:" <<endl;
-  cout << " First  Level Trigger in this Event: "<<fNumFirstLevel<<endl; 
-  cout << " Times of first  Level Trigger in this Event: ";
-  for (i=0;i<fNumFirstLevel;i++){
-    cout<< fTimeFirst[i]<<"-";
-  }
-  cout<<endl;
-  cout << " Pixels of first  Level Trigger in this Event : ";
-  for (i=0;i<fNumFirstLevel;i++){
-    for(j=0;j<CAMERA_PIXELS/8+1;j++){
-      cout<<fPixelsFirst[j][i]<<"-";
+        cout << " Pixels of first  Level Trigger in this Event: ";
+        for (int i=0; i<fNumFirstLevel; i++)
+            for(int j=0; j<CAMERA_PIXELS/8+1; j++)
+                cout << (int)fPixelsFirst[j][i] << " ";
+        cout << endl;
     }
-  }
-  cout<<endl;
-  cout << " Second Level Trigger in this Event: " << fNumSecondLevel << endl; 
-  cout << endl ; 
+
+    cout << " Second Level Trigger in this Event: " << fNumSecondLevel << endl;
+    cout << endl;
 }
 
