Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 990)
+++ trunk/MagicSoft/Mars/Changelog	(revision 991)
@@ -1,3 +1,40 @@
                                                                   -*-*- END -*-*-
+
+ 2001/10/26: Thomas Bretz
+
+   * Makefile.rules:
+     - changed output
+
+   * readraw.cc:
+     - changed name and description in TROOT
+     - removed argument in MMcEvt::Print()
+
+   * manalysis/MCerPhotEvt.[h,cc], manalysis/MCerPhotPix.[h,cc],
+     manalysis/MHillas.[h,cc], mmc/MMcEvt.[hxx,cxx],
+     mmc/MMcFadcHeader.[hxx,cxx], mmc/MMcTrig.[hxx,cxx],
+     mmc/MMcTrigHeader.[hxx,cxx]:
+     - according to root 3.01 made Print const
+
+   * mbase/BaseLinkDef.h:
+     - added MPrint
+
+   * mbase/MPrint.[h,cc]:
+     - added
+
+   * mbase/MClone.[h,cc]:
+     - changed MParContainer to a more general TObject
+
+   * mbase/Makefile:
+     - MPrint.cc added
+
+   * meventdisp/MGCamDisplay.[h,cc], meventdisp/MGEvtDisplay.[h,cc],
+     meventdisp/MGFadcDisp.[h,cc]:
+     - introduced fInitOk for the case PreProcessing failed
+
+   * mmain/MMonteCarlo.cc:
+     - added correction for use of several trigger conditions
+     - speedup threshold calc by usage of UseLeaf
+
+
 
  2001/10/23: Thomas Bretz
Index: trunk/MagicSoft/Mars/Makefile.rules
===================================================================
--- trunk/MagicSoft/Mars/Makefile.rules	(revision 990)
+++ trunk/MagicSoft/Mars/Makefile.rules	(revision 991)
@@ -9,5 +9,4 @@
 
 $(CINT)Cint.cc: $(HEADERS) 
-	@echo 
 	@echo " - Generating dictionary $(CINT)Cint.cc ..."
 
@@ -16,13 +15,13 @@
 
 .cxx.o:	
-	@echo "Compiling " $<
+	@echo " - Compiling " $<
 	$(CXX) $(CXXFLAGS) -c $< -o $@
 
 .cc.o:	
-	@echo "Compiling " $<
+	@echo " - Compiling " $<
 	$(CXX) $(CXXFLAGS) -c $< -o $@
 
 .c.o:	
-	@echo "Compiling " $<
+	@echo " - Compiling " $<
 	$(CC) $(CFLAGS) -c $< -o $@
 #
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 990)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 991)
@@ -82,5 +82,5 @@
 {
     // TClonesArray -> 'operator new with placement' should be used
-    new ((*fPixels)[fNumPixels++]) MCerPhotPix( id, nph, err);
+    new ((*fPixels)[fNumPixels++]) MCerPhotPix(id, nph, err);
 }
 
@@ -91,6 +91,6 @@
 void MCerPhotEvt::Clear(Option_t *)
 {
-    fNumPixels = 0 ;
-    fPixels->Clear() ;
+    fNumPixels = 0;
+    fPixels->Clear();
 }
 
@@ -99,5 +99,5 @@
 //  Dump the cerenkov photon event to *fLog
 //
-void MCerPhotEvt::Print(Option_t *)
+void MCerPhotEvt::Print(Option_t *) const
 {
     const Int_t entries = fPixels->GetEntries();
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 990)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 991)
@@ -31,5 +31,5 @@
 
     void Clear(Option_t *opt=NULL);
-    void Print(Option_t *opt=NULL);
+    void Print(Option_t *opt=NULL) const;
 
     Bool_t  IsPixelExisting(Int_t id) const;
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 990)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 991)
@@ -56,5 +56,5 @@
 //  Print information to gLog.
 //
-void MCerPhotPix::Print(Option_t *)
+void MCerPhotPix::Print(Option_t *) const
 { 
     gLog << "MCerPhotPix: Pixel: "<< fPixId ;
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h	(revision 990)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h	(revision 991)
@@ -24,5 +24,5 @@
     MCerPhotPix(Int_t pix = -1, Float_t phot=0., Float_t errphot=0.);
 
-    void Print(Option_t *opt = NULL) ;
+    void Print(Option_t *opt = NULL) const;
 
     Int_t   GetPixId() const      { return fPixId;   }
Index: trunk/MagicSoft/Mars/manalysis/MHillas.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 990)
+++ trunk/MagicSoft/Mars/manalysis/MHillas.cc	(revision 991)
@@ -92,5 +92,5 @@
 // Print the hillas Parameters to *fLog
 //
-void MHillas::Print(Option_t *)
+void MHillas::Print(Option_t *) const
 {
     *fLog << "Hillas Parameter:" << endl;
Index: trunk/MagicSoft/Mars/manalysis/MHillas.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MHillas.h	(revision 990)
+++ trunk/MagicSoft/Mars/manalysis/MHillas.h	(revision 991)
@@ -31,5 +31,5 @@
     Bool_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix);
 
-    void Print(Option_t *opt=NULL);
+    void Print(Option_t *opt=NULL) const;
     void Draw(Option_t *opt=NULL);
     void Paint(Option_t *opt=NULL);
Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 990)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 991)
@@ -32,4 +32,5 @@
 
 #pragma link C++ class MClone;
+#pragma link C++ class MPrint;
 
 #pragma link C++ class MReadTree;
Index: trunk/MagicSoft/Mars/mbase/MClone.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 990)
+++ trunk/MagicSoft/Mars/mbase/MClone.cc	(revision 991)
@@ -69,6 +69,6 @@
     *fTitle = title ? title : "Task to clone a parameter container for later usage";
 
-    fClone        = NULL;
-    fParContainer = NULL;
+    fClone  = NULL;
+    fObject = NULL;
 }
 
@@ -77,9 +77,9 @@
 //  Constructor. Remembers the name to search for in the parameter list.
 //
-MClone::MClone(const char *par, const char *name, const char *title)
+MClone::MClone(const char *obj, const char *name, const char *title)
 {
     Init(name, title);
 
-    fParContainerName = par;
+    fObjName = obj;
 }
 
@@ -88,9 +88,9 @@
 //  Constructor. Remember the pointer of the object which has to be cloned.
 //
-MClone::MClone(const MParContainer *par, const char *name, const char *title)
+MClone::MClone(const TObject *obj, const char *name, const char *title)
 {
     Init(name, title);
 
-    fParContainer = par;
+    fObject = obj;
 }
 
@@ -114,5 +114,5 @@
     // The pointer is already given by the user.
     //
-    if (fParContainer)
+    if (fObject)
         return kTRUE;
 
@@ -120,6 +120,6 @@
     // Try to find the parameter container with the given name in the list
     //
-    fParContainer = (MParContainer*)pList->FindObject(fParContainerName);
-    if (fParContainer)
+    fObject = pList->FindObject(fObjName);
+    if (fObject)
         return kTRUE;
 
@@ -127,5 +127,5 @@
     // If it couldn't get found stop Eventloop
     //
-    *fLog << dbginf << fParContainerName << " not found... aborting." << endl;
+    *fLog << dbginf << fObjName << " not found... aborting." << endl;
     return kFALSE;
 }
@@ -165,5 +165,5 @@
     // Clone the given parameter container
     //
-    fClone = fParContainer->Clone();
+    fClone = fObject->Clone();
 
     return kTRUE;
Index: trunk/MagicSoft/Mars/mbase/MClone.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MClone.h	(revision 990)
+++ trunk/MagicSoft/Mars/mbase/MClone.h	(revision 991)
@@ -15,14 +15,14 @@
 {
 private:
-    const MParContainer *fParContainer; // pointer to container which has to be cloned
-    TString fParContainerName;          // given name to search for in the parameterlist
+    const TObject *fObject; // pointer to container which has to be cloned
+    TString fObjName;       // given name to search for in the parameterlist
 
-    TObject* fClone;                    // pointer to the cloned object. deletion is handled by MClone
+    TObject* fClone;        // pointer to the cloned object. deletion is handled by MClone
 
     void Init(const char *name, const char *title);
 
 public:
-    MClone(const char *par,          const char *name=NULL, const char *title=NULL);
-    MClone(const MParContainer *par, const char *name=NULL, const char *title=NULL);
+    MClone(const char *obj,    const char *name=NULL, const char *title=NULL);
+    MClone(const TObject *obj, const char *name=NULL, const char *title=NULL);
     ~MClone();
 
Index: trunk/MagicSoft/Mars/mbase/MPrint.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MPrint.cc	(revision 991)
+++ trunk/MagicSoft/Mars/mbase/MPrint.cc	(revision 991)
@@ -0,0 +1,132 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  10/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MPrint                                                                  //
+//                                                                          //
+//  This task calls the Print() function of a parameter container, to       //
+//  print some information event by event.                                  //
+//  Overload TObject::Print()                                               //
+//                                                                          //
+//  Input Containers:                                                       //
+//   MParContainer                                                          //
+//                                                                          //
+//  Output Containers:                                                      //
+//   -/-                                                                    //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MPrint.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+ClassImp(MPrint);
+
+// --------------------------------------------------------------------------
+//
+// Initializes name and title of the object. It is called by all
+// constructors.
+//
+void MPrint::Init(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MPrint";
+    *fTitle = title ? title : "Task to print a parameter container";
+
+    fObject = NULL;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Constructor. Remembers the name to search for in the parameter list
+//  of the object to be printed. The object must be derived from TObject and
+//  TObject::Print(Option_t *) const
+//  must be overloaded. You can also set an option string to use
+//  when calling TObject::Print
+//
+MPrint::MPrint(const char *obj, const char *option,
+               const char *name, const char *title)
+{
+    Init(name, title);
+    SetOption(option);
+
+    fObjName = obj;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Constructor. Remember the pointer of the object which has to be
+//  printed. The object must be derived from TObject and
+//  TObject::Print(Option_t *) const
+//  must be overloaded. You can also set an option string to use
+//  when calling TObject::Print
+//
+MPrint::MPrint(const TObject *obj, const char *option,
+               const char* name, const char *title)
+{
+    Init(name, title);
+    SetOption(option);
+
+    fObject = obj;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Checks the parameter list for the existance of the parameter container. If
+//  the name of it was given in the constructor.
+//
+Bool_t MPrint::PreProcess(MParList *pList)
+{
+    //
+    // The pointer is already given by the user.
+    //
+    if (fObject)
+        return kTRUE;
+
+    //
+    // Try to find the parameter container with the given name in the list
+    //
+    fObject = pList->FindObject(fObjName);
+    if (fObject)
+        return kTRUE;
+
+    //
+    // If it couldn't get found stop Eventloop
+    //
+    *fLog << dbginf << fObjName << " not found... aborting." << endl;
+    return kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Calls overloaded TObject::Print
+//
+Bool_t MPrint::Process()
+{
+    fObject->Print(fOption);
+    return kTRUE;
+} 
+
Index: trunk/MagicSoft/Mars/mbase/MPrint.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MPrint.h	(revision 991)
+++ trunk/MagicSoft/Mars/mbase/MPrint.h	(revision 991)
@@ -0,0 +1,36 @@
+#ifndef MPRINT_H
+#define MPRINT_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+
+class MPrint : public MTask
+{
+private:
+    const TObject *fObject;  // pointer to container which has to be printed
+    TString fObjName;        // given name to search for in the parameterlist
+    TString fOption;         // Print option
+
+    void Init(const char *name, const char *title);
+
+public:
+    MPrint(const char *obj,    const char *option="", const char *name=NULL, const char *title=NULL);
+    MPrint(const TObject *obj, const char *option="", const char *name=NULL, const char *title=NULL);
+
+    void SetOption(Option_t *option) { fOption = option; }
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MPrint, 0) // Task to call Print() function
+};
+    
+#endif
+
Index: trunk/MagicSoft/Mars/mbase/MReadTree.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 990)
+++ trunk/MagicSoft/Mars/mbase/MReadTree.cc	(revision 991)
@@ -83,4 +83,5 @@
 
     fVetoList = new TArrayC;
+
     //
     // open the input stream
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 990)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 991)
@@ -47,7 +47,8 @@
 	   MArrayS.cc \
            MTime.cc \
-           MLog.cc \
            MHtml.cc \
            MClone.cc \
+           MPrint.cc \
+           MLog.cc \
            MLogManip.cc
 
Index: trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc	(revision 990)
+++ trunk/MagicSoft/Mars/meventdisp/MGCamDisplay.cc	(revision 991)
@@ -117,6 +117,8 @@
     plist->AddToList(pedest);
 
-    fEvtLoop->PreProcess();
-    GetTaskList()->Process();
+    fInitOk = fEvtLoop->PreProcess();
+
+    if (fInitOk)
+        GetTaskList()->Process();
 
     return geom;
@@ -177,5 +179,5 @@
 void MGCamDisplay::UpdateDisplay()
 {
-    if (!fDisplay)
+    if (!fInitOk)
         return;
 
Index: trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc	(revision 990)
+++ trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.cc	(revision 991)
@@ -333,5 +333,5 @@
                            const TGWindow *p, const TGWindow *main,
                            UInt_t w, UInt_t h)
-    : TGTransientFrame(p, main, w, h)
+    : TGTransientFrame(p, main, w, h), fInitOk(kFALSE)
 {
     //
@@ -398,4 +398,7 @@
 void MGEvtDisplay::ReadinEvent(UInt_t iEvt)
 {
+    if (!fInitOk)
+        return;
+
     Int_t buttons = 4;
     Int_t retval  = 0;
Index: trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.h	(revision 990)
+++ trunk/MagicSoft/Mars/meventdisp/MGEvtDisplay.h	(revision 991)
@@ -51,4 +51,6 @@
     TGVerticalFrame  *fMidFrame;
 
+    Bool_t fInitOk;
+
     MParList  *GetParList() const;
     MTaskList *GetTaskList() const;
Index: trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc
===================================================================
--- trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 990)
+++ trunk/MagicSoft/Mars/meventdisp/MGFadcDisp.cc	(revision 991)
@@ -125,6 +125,8 @@
     // preprocess eventloop and read in first event (process)
     //
-    fEvtLoop->PreProcess();
-    GetTaskList()->Process();
+    fInitOk = fEvtLoop->PreProcess();
+
+    if (fInitOk)
+        GetTaskList()->Process();
 
     //
@@ -168,4 +170,7 @@
 {
     MRawEvtData *data = GetEvent();
+
+    if (!data)
+        return;
 
     MRawEvtPixelIter pixel(data);
@@ -215,4 +220,7 @@
 void MGFadcDisp::UpdateDisplay()
 {
+    if (!fInitOk)
+        return;
+
     const Int_t lastsel = fPixelList->GetSelected();
 
Index: trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 990)
+++ trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 991)
@@ -290,5 +290,9 @@
     // macro yet)
     //
-    TObjArray hists(MParList::CreateObjList("MHMcRate", dim));
+    const UInt_t from = dim>0 ?   1 : -dim;
+    const UInt_t to   = dim>0 ? dim : -dim;
+    const Int_t  num  = to-from+1;
+
+    TObjArray hists(MParList::CreateObjList("MHMcRate", from, to));
     hists.SetOwner();
 
@@ -296,5 +300,5 @@
     // Check if the list really contains the right number of histograms
     //
-    if (hists.GetEntriesFast() != dim && dim)
+    if (hists.GetEntriesFast() != num)
         return;
 
@@ -367,5 +371,9 @@
     // and store the histograms in an TObjArray
     //
-    TObjArray hists(MParList::CreateObjList("MHMcEnergy", dim));
+    const UInt_t from = dim>0 ?   1 : -dim;
+    const UInt_t to   = dim>0 ? dim : -dim;
+    const Int_t  num  = to-from+1;
+
+    TObjArray hists(MParList::CreateObjList("MHMcEnergy", from, to));
     hists.SetOwner();
 
@@ -373,5 +381,5 @@
     // Check if the list really contains the right number of histograms
     //
-    if (hists.GetEntriesFast() != dim)
+    if (hists.GetEntriesFast() != num)
         return;
 
@@ -391,6 +399,6 @@
     //
     MReadTree read("Events", fInputFile);
-    read.VetoBranch("MRawEvtData");
-    read.VetoBranch("MRawEvtHeader");
+    read.UseLeaf("fEnergy");
+    read.UseLeaf("fNumFirstLevel");
 
     MMcThresholdCalc calc(dim);
Index: trunk/MagicSoft/Mars/readraw.cc
===================================================================
--- trunk/MagicSoft/Mars/readraw.cc	(revision 990)
+++ trunk/MagicSoft/Mars/readraw.cc	(revision 991)
@@ -48,5 +48,5 @@
     //     initialize ROOT  (this is obligatory here)
     //
-    TROOT simple("Readraw","Mars - Merging and Preprocessing Program");
+    TROOT simple("readraw","Mars - Read and print raw data file");
 
     //
@@ -152,5 +152,5 @@
         evttree->GetEvent(i);
 
-	evtmc->Print("") ; 
+	evtmc->Print();
 	
         evtheader->Print();
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 991)
@@ -1,4 +1,5 @@
+#include "MMcEvt.hxx"
+
 #include <iostream.h>
-#include "MMcEvt.hxx"
 
 
@@ -12,5 +13,5 @@
 
 
-ClassImp(MMcEvt)
+ClassImp(MMcEvt);
 
 
@@ -137,13 +138,13 @@
 
   fPartId = usPId  ;
-  fEnergy  = fEner  ;
+  fEnergy = fEner  ;
 
-  fTheta   = fThet ;
-  fPhi     = fPhii ;
+  fTheta  = fThet ;
+  fPhi    = fPhii ;
 
-  fCoreD   = fCorD ;
-  fCoreX   = fCorX ;
-  fCoreY   = fCorY ;
-  fImpact  = fImpa ;
+  fCoreD  = fCorD ;
+  fCoreX  = fCorX ;
+  fCoreY  = fCorY ;
+  fImpact = fImpa ;
 
   fPhotIni      = uiPin ;
@@ -157,13 +158,14 @@
 
 
-void MMcEvt::Print(Option_t *Option) {
+void MMcEvt::Print(Option_t *Option) const {
   //
   //  print out the data member on screen
   //
-  cout <<endl << "Monte Carlo output:" <<endl;
-  cout << " Particle Id    : " << fPartId ; 
-  cout << " Energy (GeV)   : " << fEnergy  ; 
-  cout << " Impactpar. (m) : " << fImpact  ; 
-  cout << " Photoelectrons : " << fPhotElfromShower ; 
-  cout << endl ; 
+  cout << endl;
+  cout << "Monte Carlo output:" << endl;
+  cout << " Particle Id:    " << fPartId; 
+  cout << " Energy (GeV):   " << fEnergy; 
+  cout << " Impactpar. (m): " << fImpact; 
+  cout << " Photoelectrons: " << fPhotElfromShower; 
+  cout << endl; 
 }
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 991)
@@ -2,34 +2,29 @@
 #define __MMcEvt__
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>  
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
 
-#include <iostream.h>
-#include "MParContainer.h"
+class MMcEvt : public MParContainer
+{
+ private:
+  UShort_t fPartId;         // Type of particle
+  Float_t  fEnergy;         // Energy in GeV
 
+  Float_t fTheta;           // Theta angle of event 
+  Float_t fPhi;             // Phi angle of event 
 
-class MMcEvt : public MParContainer{
- private:
-  UShort_t fPartId;     // Type of particle
-  Float_t fEnergy;       // Energy in GeV
+  Float_t fCoreD;           // Core d pos
+  Float_t fCoreX;           // Core x pos
+  Float_t fCoreY;           // Core y pos
+  Float_t fImpact;          // impact parameter
 
-  Float_t fTheta;        // Theta angle of event 
-  Float_t fPhi;          // Phi angle of event 
-
-  Float_t fCoreD;        // Core d pos
-  Float_t fCoreX;        // Core x pos
-  Float_t fCoreY;        // Core y pos
-  Float_t fImpact;       // impact parameter
-
-  UInt_t fPhotIni;      // Initial number of photons
-  UInt_t fPassPhotAtm;  // Passed atmosphere
-  UInt_t fPassPhotRef;  // Passed reflector(reflectivity + effective area)
-  UInt_t fPassPhotCone; // Passed glas
-  UInt_t fPhotElfromShower;   // Passed qe coming from the shower
-  UInt_t fPhotElinCamera;     // usPhotElfromShower + mean of phe
-                               // from NSB
+  UInt_t fPhotIni;          // Initial number of photons
+  UInt_t fPassPhotAtm;      // Passed atmosphere
+  UInt_t fPassPhotRef;      // Passed reflector(reflectivity + effective area)
+  UInt_t fPassPhotCone;     // Passed glas
+  UInt_t fPhotElfromShower; // Passed qe coming from the shower
+  UInt_t fPhotElinCamera;   // usPhotElfromShower + mean of phe
+                            // from NSB
 
  public:
@@ -49,5 +44,5 @@
 
 
-  void Print(Option_t *);
+  void Print(Option_t *opt=NULL) const;
 
   Short_t GetPartId() const { return fPartId; }       //Get Type of particle
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.cxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.cxx	(revision 991)
@@ -1,5 +1,5 @@
-#include <iostream.h>
 #include "MMcFadcHeader.hxx"
 
+#include <iostream.h>
 
 //==========
@@ -13,5 +13,5 @@
 
 
-ClassImp(MMcFadcHeader)
+ClassImp(MMcFadcHeader);
 
 
@@ -41,16 +41,16 @@
 
 
-void MMcFadcHeader::Print(Option_t *Option) {
+void MMcFadcHeader::Print(Option_t *Option) const {
   //
   //  print out the data member on screen
   //
-
-  cout <<endl << "Monte Carlo Fadc output:" <<endl;
-  cout << " Shape type of the signal : "<<fFadcShape<<endl;
-  cout << " Amplitude of the trigger in mV : "<<fAmplFadc<<endl;
-  cout << " Width of the signal in nsec : "<<fFwhmFadc<<endl;
-  cout << " Pedestals and ElecNoise in fadc counts : "<<endl;
+  cout << endl;
+  cout << "Monte Carlo Fadc output:" << endl;
+  cout << " Shape type of the signal: "       << fFadcShape << endl;
+  cout << " Amplitude of the trigger in mV: " << fAmplFadc << endl;
+  cout << " Width of the signal in nsec: "    << fFwhmFadc << endl;
+  cout << " Pedestals and ElecNoise in fadc counts: " << endl;
   for (int i=0;i<MFADC_CHANNELS;i++){
-    cout << " Pixel "<<i<<" : "<<fPedesMean[i]<<"  "<<fElecNoise[i]<<endl;
+    cout << " Pixel "<<i<<": "<<fPedesMean[i]<<"  "<<fElecNoise[i]<<endl;
   }
   cout << endl ; 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.hxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcFadcHeader.hxx	(revision 991)
@@ -2,14 +2,8 @@
 #define __MMcFadcHeader__
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>  
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
 
-#include <iostream.h>
-#include "MParContainer.h"
-
-#include "MTriggerDefine.h"
 #include "MFadcDefine.h"
 
@@ -33,5 +27,5 @@
   ~MMcFadcHeader(); 
 
-  void Print(Option_t *);
+  void Print(Option_t *opt=NULL) const;
   
   void SetShape(Float_t shape){
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.cxx	(revision 991)
@@ -1,4 +1,5 @@
+#include "MMcTrig.hxx"
+
 #include <iostream.h>
-#include "MMcTrig.hxx"
 
 
@@ -12,5 +13,5 @@
 
 
-ClassImp(MMcTrig)
+ClassImp(MMcTrig);
 
 
@@ -49,4 +50,15 @@
 }
 
+inline void MMcTrig::SetTime(Float_t t, Int_t i)
+{
+    if (i>TOTAL_TRIGGER_TIME/LEVEL1_DEAD_TIME+1  || i<1)
+    {
+        cout << "fNumFirstLevel out of range. Time will be -99" << endl;
+        return;
+    }
+
+    fTimeFirst[i-1]=t;
+}
+
 void MMcTrig::Clear(Option_t *opt) {
   //
@@ -71,5 +83,5 @@
 }
 
-void MMcTrig::Print(Option_t *Option) {
+void MMcTrig::Print(Option_t *Option) const {
   //
   //  print out the data member on screen
@@ -78,6 +90,6 @@
 
   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 : ";
+  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]<<"-";
@@ -91,5 +103,5 @@
   }
   cout<<endl;
-  cout << " Second Level Trigger in this Event : " << fNumSecondLevel << endl; 
+  cout << " Second Level Trigger in this Event: " << fNumSecondLevel << endl; 
   cout << endl ; 
 }
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.hxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrig.hxx	(revision 991)
@@ -2,12 +2,7 @@
 #define __MMcTrig__
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>  
-
-#include <iostream.h>
+#ifndef MPARCONTAINER_H
 #include "MParContainer.h"
+#endif
 
 #include "MTriggerDefine.h"
@@ -32,5 +27,5 @@
   void Clear(Option_t *opt=NULL);
   
-  void Print(Option_t *);
+  void Print(Option_t *opt=NULL) const;
 
   void SetFirstLevel  ( Short_t nTr ) {
@@ -41,12 +36,5 @@
   } 
 
-  void SetTime( Float_t t, Int_t i){
-    if (i>TOTAL_TRIGGER_TIME/LEVEL1_DEAD_TIME+1  || i<1){
-      cout<<"fNumFirstLevel out of range. Time will be -99"<<endl;
-    }
-    else{
-      fTimeFirst[i-1]=t;
-    }
-  }
+  void SetTime( Float_t t, Int_t i);
 
   void SetMapPixels(Byte_t *map,Int_t nfirst){
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.cxx	(revision 991)
@@ -1,4 +1,5 @@
+#include "MMcTrigHeader.hxx"
+
 #include <iostream.h>
-#include "MMcTrigHeader.hxx"
 
 
@@ -13,5 +14,5 @@
 
 
-ClassImp(MMcTrigHeader)
+ClassImp(MMcTrigHeader);
 
 
@@ -47,14 +48,14 @@
 
 
-void MMcTrigHeader::Print(Option_t *Option) {
+void MMcTrigHeader::Print(Option_t *opt) const {
   //
   //  print out the data member on screen
   //
-
-  cout <<endl << "Monte Carlo Trigger output:" <<endl;
-  cout << " XSTopology Trigger in this run : "<<fTopology<<endl;
-  cout << " Multiplicity Trigger in this run : "<<fMultiplicity<<endl;
-  cout << " Trigger Pattern in this run : "<<fTrigPattern[0]<<
-    fTrigPattern[1]<<endl;
-  cout << endl ; 
+  cout << endl;
+  cout << "Monte Carlo Trigger output:" << endl;
+  cout << " XSTopology Trigger in this run: "   << fTopology << endl;
+  cout << " Multiplicity Trigger in this run: " << fMultiplicity << endl;
+  cout << " Trigger Pattern in this run: ";
+  cout << fTrigPattern[0] << ", " << fTrigPattern[1] << endl;
+  cout << endl; 
 }
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.hxx	(revision 990)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcTrigHeader.hxx	(revision 991)
@@ -2,12 +2,7 @@
 #define __MMcTrigHeader__
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>  
-
-#include <iostream.h>
+#ifndef MPARCONTAINER_H
 #include "MParContainer.h"
+#endif
 
 #include "MTriggerDefine.h"
@@ -37,5 +32,5 @@
   ~MMcTrigHeader(); 
 
-  void Print(Option_t *);
+  void Print(Option_t *opt=NULL) const;
   
   void SetTopology(Short_t nTop) {
