Index: /tags/Mars_V0-4/Mars/.rootrc
===================================================================
--- /tags/Mars_V0-4/Mars/.rootrc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/.rootrc	(revision 9634)
@@ -0,0 +1,42 @@
+#############################################################################
+#                                                                           #
+# This is the path where root seraches for macros                           #
+# to execute (eg. .x merpp.C)                                               #
+#                                                                           #
+#############################################################################
+
+Unix.*.Root.MacroPath:   .:./macros
+
+#############################################################################
+#                                                                           #
+# This is the path where the dynamic loader (eg. gSystem->Load("mars.so")   #
+# is searching for the shared objects                                       #
+#                                                                           #
+#############################################################################
+
+Unix.*.Root.DynamicPath: .:./lib
+
+#############################################################################
+#                                                                           #
+# This is the name of the logon macro (executed at root startup) and the    #
+# logoff macro (executed when quiting root)                                 #
+#                                                                           #
+#############################################################################
+
+Rint.Logon:              rootlogon.C
+Rint.Logoff:             rootlogoff.C
+
+#############################################################################
+#                                                                           #
+# This is used if you want to use the root documentation facility to        #
+# create the documentation of the code out of the code                      #
+#                                                                           #
+#############################################################################
+
+Root.Html.Author:        !   Author(s):
+Root.Html.Copyright:     !   Copyright
+Root.Html.Modified:      !   Modified:
+Root.Html.Description    // ----
+
+Root.Html.Root:          http://root.cern.ch/root/htmldoc/
+Root.Html.HomePage:      http://magic.uni-sw.gwdg.de/mars/
Index: /tags/Mars_V0-4/Mars/Changelog
===================================================================
--- /tags/Mars_V0-4/Mars/Changelog	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Changelog	(revision 9634)
@@ -0,0 +1,1304 @@
+                                                                  -*-*- END -*-*-
+
+ 2001/09/20: Thomas Bretz
+ 
+   * mevtdisp/MGFadcDisp.cc, mmain/MMars.cc:
+     - switched to root version >= 3.00
+     
+   * Makefile.conf.linux:
+     - added to support the new Linux distributions
+
+   * .rootrc:
+     - removed references to MARSSYS
+
+
+
+ 2001/09/13: Thomas Bretz
+ 
+   * Makefile.conf.linux-gnu:
+     - removed "-Woverloaded-virtual". it doesn't really help
+
+
+
+ 2001/08/02: Thomas Bretz
+
+   * macros/getRate.C:
+     - make use of new stylish lists of containers
+
+
+   * macros/CT1Hillas.C, macros/getCollArea.C:
+     - make use of return value of Eventloop
+
+   * macros/merpp.C:
+     - changed return type to void
+
+
+
+ 2001/07/23: Thomas Bretz
+ 
+   * mbase/MParList.cc:
+     - redifinition of default argument: fixed
+
+
+
+ 2001/07/23: Thomas Bretz
+ 
+   * mmontecarlo/MMcThresholdCalc.[cc,h]:
+     - changed PreProcess action to new stylish lists of containers
+
+   * mhist/Makefile:
+     - removed MEnergies.cc
+
+   * mhist/HistLinkDef.h:
+     - removed MEnergies.cc
+   
+   * mbase/MReadTree.cc:
+     - removed a bug which causes MReadTree to show strange behaviour.
+       We cannot use GetBranch()->SetAddress() we have to use
+       SetBranchAddress.
+       
+   * macros/MagicHillas.C:
+     - changed to new stylish histogram fillers.
+
+   * mhist/MHMcRate.cc:
+     - some simplifications to the constructors
+     - some accelerations of the rate calculation
+     
+   * mhist/MHHillas.C:
+     - added axis descriptions (thanks to Rudy)
+
+
+
+ 2001/07/20: Thomas Bretz
+ 
+   * mhist/MH.cc:
+     - added comments
+
+   * mhist/MFillH.cc:
+     - added comments
+
+   * mbase/MParList.[h,cc]:
+     - Added AddToList from a TObjArray
+     - Added GetClassName
+     - Added GetObjName
+     - Added FindObjectList
+     - Added FindCreateObjList
+     - Added CreateObjList
+
+   * mhist/MHMcEnergies.[h,cc]:
+     - deleted
+
+   * mhist/MHMcEnergy.[h,cc]:
+     - rewrote constructor in a way that MHMcEnergies isn't needed anymore
+     - added a SetName function which replaces the old constructor somehow
+
+   * macros/getThreshold.C:
+     - make use of some new features
+
+
+
+ 2001/07/19: Thomas Bretz
+ 
+   * mbase/MEvtLoop.cc:
+     - added comments
+     
+   * mbase/MTaskList.cc:
+     - changed the wrong 'break' for kCONTINUE into 'return kTRUE'
+     
+   * mhist/MH.[cc,h]
+     - added
+
+   * mhist/MFillH.[cc,h]
+     - added
+     - in principal MFillHHillas, MFillHFadc and MFillHStarMap
+       can be deleted now
+     
+   * mhist/HistLinkDef.h:
+     - added MH
+     - added MFillH
+     
+   * mhist/MFillHFadc.cc:
+     - moved source for filling to corresponding histogram class
+     
+   * mhist/MFillHHillas.cc:
+     - included MHillas.h
+     
+   * mhist/MHFadcCam.[cc, h]:
+     - added Fill
+     - made FillHi, FillLo private
+     
+   * mhist/MHHillas.[cc, h], mhist/MHStarMap.[h,cc]:
+     - changed Fill function to new style
+     - derived class from MH
+
+   * mhist/Makefile:
+     - added MH.cc
+     - added MFillH.cc
+
+
+
+ 2001/07/18: Oscar Blanch
+ 
+   * macros/getRate.C:
+     - Macro to compute the trigger rate from a MonteCarlo file
+
+   * mhist/MHMcRate.[h,cc]:
+     - Container to store trigger rate information
+     - Draw() functin member to be implemented
+
+   * mmontecarlo/MMcTriggerRateCalc.[h,cc]:
+     - Task to compute trigger rate
+
+
+
+ 2001/07/13: Thomas Bretz
+
+   * mbase/MEvtLoop.[h,cc]:
+     - Added a result value to Eventloop to be able to detect if the
+       execution was successfull
+     - changes postProcess to return the return value from 
+       MTaskList::PostProcess
+     
+   * mbase/MParList.cc:
+     - FindCreateObj removes now a 'dot' from the end of an indexed
+       object name like "Events;7."
+     
+   * mbase/MReadTree.cc:
+     - small changes to the output
+
+   * mbase/MTask.[h,cc]:
+     - added Preprocessed flag. This enables the tasklist to only postprocess
+       already preprocessed tasks
+
+   * mbase/MTaskList.cc:
+     - don't postprocess non preprocessed tasks
+   
+   * mhist/MHMcCollectionArea.cc:
+     - added descriptions to histrograms
+     - changed names of histograms
+     - added drawing of canvas to Draw-functions
+
+   * mhist/MHMcEnergy.[h,cc]:
+     - added variables to store the calculated result
+     - changed names and titles of histogram
+     - added axis titles to histogram
+     - moved result calculation into fit-function
+
+   * mmontecarlo/MMcCollectionAreaCalc.cc:
+     - added name of input container to be able to process another
+       container than "MMcTrig"
+
+   * mmontecarlo/MMcThresholdCalc.cc:
+     - removed trailing dot from container name creation
+   
+   * mhist/MMcThresholdCalc.cc:
+     - removed a wrong '.' behind the number when processing more than
+       one trigger condition
+
+   * mraw/MRawRunHeader.cc:
+     - added "Monte Carlo Data" as runtype
+
+
+
+ 2001/07/10: Thomas Bretz
+
+   * mhist/MHMcEnergy.h:
+     - renamed SetBins to SetNumBins
+     
+   * mmontecarlo/MMcThresholdCalc.cc:
+     - changed style of comments
+     - moved sqrt(2) from Postprocess to header.
+     
+   * mmontecarlo/MMcEnerHisto.[cc,h], mmontecarlo/MMcEnerThre.[cc,h], 
+     mmontecarlo/MMcEnerThreCalc.[cc,h]:
+     - removed
+
+   * mmontecarlo/MCollArea.[cc,h], mmontecarlo/MCollAreaTrigger.[cc,h]:
+     - removed
+
+
+
+ 2001/07/09: Thomas Bretz
+ 
+   * mbase/MParList.cc:
+     - made handling of already existing containers in AddToList a bit 
+       more convinient
+     
+   * mbase/MTaskList.[h,cc]:
+     - added come comments
+     - made handling of already existing tasks in AddToList a bit 
+       more convinient
+     - Added name-argument to constructor
+     
+   * mraw/MRawFileRead.[cc, h]:
+     - move file-open check from constructor to PreProcess
+     - added variable for filename
+     
+   * mraw/MRawFileWrite.[cc,h]:
+     - moved fOut->Write from PostProcess to destructor
+     - removed PostProcess
+
+
+
+ 2001/07/06: Thomas Bretz
+ 
+   * mfilter/FilterIncl.h, mfilter/FilterLinkDef.h, 
+     mfilter/MFTriggerLvl1.[h,cc], mfilter/mfilter/Makefile:
+     - added
+     
+   * Makefile
+     - mfilter added
+     
+   * Makefile.conf.linux-gnu:
+     - added some warning options
+     
+   * Makefile.conf.osf1:
+     - enhanced warnings
+     
+   * manalysis/MCerPhotEvt.cc:
+     - removed a small buf from the constructor
+     
+   * BaseLinkDef.h:
+     - added MFilter
+     - added MFilterList
+     
+   * mbase/MLog.[h,cc]:
+     - added a non-empty copy constructor to make cxx happy
+     
+   * mbase/MParList.[h,cc]:
+     - added second overload-function FindObject
+   
+   * mbase/MTask.h:
+     - added all Filter stuff
+     
+   * mbase/MTaskList.cc:
+     - changed debug output
+     - added filter-stuff to Process
+     
+   * mbase/MTaskList.h:
+     - changed Print default option from NULL to ""
+     
+   * mbase/Makefile:
+     - added MFilter
+     - added MFilterList
+   
+   * mhist/MFillHFadc.cc:
+     removed a small bug in the PreProcessing
+   
+   * manalysis/MCerPhotEvt.h, manalysis/MHillas.cc, manalysis/MHillas.h, 
+     manalysis/MImgCleanStd.cc, manalysis/MPedestalCam.h, mgui/MGeomCam.h,
+     mhist/MFillHHillas.h, manalysis/MHillasCalc.h, manalysis/MCerPhotCalc.h,
+     manalysis/MImgCleanStd.h, mhist/MFillHStarMap.h, mhist/MHHillas.cc,
+     mhist/MHHillas.h, mhist/MHStarMap.cc, mhist/MHStarMap.h,
+     mmc/MMcFadcHeader.hxx, mmc/MMcFadcHeader.hxx, mmc/MMcTrig.hxx,
+     mmontecarlo/MMcThresholdCalc.h:
+     - made more const-correct
+
+   * manalysis/MCT1ReadAscii.cc, manalysis/MCerPhotCalc.cc, 
+     manalysis/MHillasCalc.cc, manalysis/MImgCleanStd.cc,
+     manalysis/MMcPedestalCopy.cc, manalysis/MPedCalcPedRun.cc,
+     mhist/MFillHFadc.cc, mhist/MFillHHillas.cc, mhist/MFillHStarMap.cc,
+     mmontecarlo/MMcThresholdCalc.cc, mraw/MRawFileRead.cc,
+     mraw/MRawFileWrite.cc:
+     - added comments
+
+   * manalysis/MCT1ReadAscii.cc, manalysis/MCerPhotCalc.cc, 
+     manalysis/MCerPhotPix.cc, manalysis/MHillas.cc,
+     manalysis/MHillasCalc.cc, manalysis/MImgCleanStd.cc, 
+     manalysis/MMcPedestalCopy.cc, manalysis/MMcPedestalCopy.h,
+     manalysis/MPedCalcPedRun.cc, manalysis/MPedestalCam.cc, 
+     manalysis/MPedestalPix.cc,
+     mbase/MArray.cc, mbase/MArrayB.cc, mbase/MArrayS.cc, mbase/MEvtLoop.cc, 
+     mbase/MLog.cc, mbase/MParList.cc, mbase/MReadTree.cc, mbase/MTask.cc, 
+     mbase/MTime.cc, mbase/MWriteAsciiFile.cc, mbase/MWriteFile.cc, 
+     mbase/MWriteRootFile.cc,
+     mhist/MFillHFadc.cc, mhist/MFillHFadc.cc, mhist/MFillHHillas.cc,
+     mhist/MFillHStarMap.cc, mhist/MHFadcCam.cc, mhist/MHFadcPix.cc,
+     mhist/MHHillas.cc, mhist/MHMcCollectionArea.cc, mhist/MHMcEnergies.cc,
+     mhist/MHMcEnergy.cc, mhist/MHStarMap.cc, mraw/MRawCrateArray.cc,
+     mraw/MRawCrateData.cc, mraw/MRawEvtData.cc, mraw/MRawEvtHeader.cc,
+     mraw/MRawEvtPixelIter.cc, mraw/MRawFileRead.cc,
+     mraw/MRawFileWrite.cc, mraw/MRawRunHeader.cc:
+     - added semicolon after ClassImp to make my editor happy
+
+   * mmain/MEvtDisp.cc:
+     - removed a wrong comma in the enumerations
+     
+   * mmontecarlo/MMcThresholdCalc.cc:
+     - made compile on osf by removing brackets in new steatement (constructor)
+     
+
+
+ 2001/07/05: Thomas Bretz
+
+   * macros/CT1Hillas.C:
+     - changed the wrong pointers to dots.
+     
+   * macros/getThreshold.C:
+     - added some comments
+     - removed the canvas creation
+     - drawing replaced by a loop
+     - changed trigger conditions to 1 (should work with any MC file)
+     
+   * macros/readMagic.C:
+     - changed the event counter to the number of the event in the file
+     - removed icound
+     
+   * manalysis/MPedCalcPedRun.cc, manalysis/MCerPhotCalc.cc,
+     mbase/MParContainer.cc, mbase/MParContainer.h, mbase/MParList.cc,
+     mbase/MParList.h, mbase/MTaskList.cc, mbase/MWriteAsciiFile.cc,
+     mbase/MWriteRootFile.cc, mhist/MFillHFadc.cc, mhist/MFillHHillas.cc,
+     mhist/MFillHStarMap.cc,
+     - changed HasChanged to ReadyToSave
+     
+   * mbase/MReadTree.cc:
+     - added some comments
+     
+   * mhist/MHMcEnergies.h:
+     - fixed bug in []-operator
+     
+   * mhist/MHMcEnergy.cc:
+     - added canvas creation to draw function
+   
+   * mmontecarlo/MMcThresholdCalc.cc:
+     - fixed a bug in the constructor
+ 
+ 
+ 
+ 2001/06/20: Thomas Bretz
+ 
+   * macros/merpp.C:
+     - fixed type in comment
+     
+   * manalysis/MHillas.cc:
+     - fixed 'FIXME' comment
+   
+   * mbase/MWriteFile.[h,cc]:
+     - added
+  
+   * mbase/MWriteRootFile.[h,cc]:
+     - added
+   
+   * mbase/BaseLinkDef.h:
+     - Added MWriteFile
+     - Added MWriteRootFile
+   
+   * mbase/MEvtLoop.cc:
+     - fixed the counting in the eventloop
+     
+   * mbase/MWriteAsciiFile.[h,cc]:
+     - changed class that it is based on MWriteFile now
+   
+   * mbase/Makefile:
+     - added MWriteFile
+     - added MWriteRootFile
+   
+   * mhist/MFillHFadc.[h,cc]:
+     - added set for HasChanged (new PostProcess)
+   
+   * mhist/MFillHHillas.cc:
+     - added set for HasChanged (new PostProcess)
+   
+   * mhist/MFillHStarMap.cc:
+     - added set for HasChanged (new PostProcess)
+
+   * mhist/MHHillas.cc:
+     - Set kCanDelete to make sure, that the histograms are deleted
+       together with the canvas
+     
+   * mraw/MRawFileWrite.[h,cc]:
+     - changed the handling of opening, closing and checking file
+
+
+
+ 2001/06/13: Thomas Bretz
+
+   * ./.../*.h:
+     - added some comments and corrected some descriptions.
+     
+   * mbase/MParContainer.[h,cc]:
+     - added a 'dummy' function for AsciiRead, AsciiWrite
+
+   * mbase/MWriteAsciiFile.[h,cc]:
+     - added new constructor (specify directly the pointer to the class)
+
+   * mgui/MHexagon.cc:
+     - made Copy-function more readable
+
+   * mgui/MParContainer.cc:
+     - made Copy-function more readable
+
+   * mhist/MHMcEnergies.[h,cc]:
+     - files added as a container to make handling of several MHMcEnergy easier
+   
+   * mbase/MAGIC.h:
+     - encapsulated include of TROOT
+
+   * mbase/MTaskList.cc:
+     - added SetHasChange and Reset to PostProcess
+
+   * mhist/HistLinkDef.h
+     - added MHMcEnergies
+     
+   * mhist/MHMcEnergy.[h,cc]:
+     - added name and title to constructor
+     - added number to name of container
+   
+   * mmontecarlo/MMcThresholdCalc.cc:
+     - corrected typo in creation of the container names
+   
+   * mraw/MRawEvtData.cc:
+     - Set kCanDelete in Draw function
+
+
+
+ 2001/06/12: Thomas Bretz
+
+   * mmontecarlo/MMcEnerThreCalc.[cc,h] 
+     - copied to mmontecarlo/MMcThresholdCalc.[cc,h]
+
+   * mmontecarlo/MMcEnerThreHistos.[h,cc]
+     - copied to mmhist/MHMcEnergy.[h,cc]
+
+   * mbase/Makefile:
+     - added MWriteAsciiFile.cc
+   
+   * mhist/HistIncl.h:
+     - added TF1.h
+
+   * mhist/HistLinkDef.h:
+     - added MHMcEnergy
+ 
+   * mhist/Makefile
+     - added MHMcEnergy
+   
+   * mmontecarlo/MCollArea.h:
+     - fixed typo in ifndef
+   
+   * mmontecarlo/Makefile:
+     - added MMcThresholdCalc.cc
+     - removed MMcEnerHisto.cc
+     - removed MMcEnerThre.cc
+     - removed MMcEnerThreCalc.cc
+
+   * mmontecarlo/MonteCarloLinkDef.h:
+     - added MMcThresholdCalc.cc
+     - removed MMcEnerHisto.cc
+     - removed MMcEnerThre.cc
+     - removed MMcEnerThreCalc.cc
+ 
+   * mbase/MWriteAsciiFile.[h,cc]: 
+     - added
+
+   * manalysis/MCT1ReadAscii.h: 
+     - removed fFileName from class definition
+ 
+   * manalysis/MCerPhotCalc.cc: 
+     - use of SetHasChanged added
+ 
+   * manalysis/MHillas.[h,cc]: 
+     - Reset added
+     - AsciiRead added
+     - AsciiWrite added
+     - use of SetHasChanged added
+
+   * manalysis/MPedCalcPedRun.[h,cc]:
+     - made fNumHiGainSamples a class member
+     - renamed some member functions
+     - made the 'internal' member functions private
+     - added SetHasChanged
+     - made these functions const
+     
+   * mbase/BaseLinkDef.h
+     - MWriteAsciiFile added
+   
+   * mbase/MEvtLoop.cc:
+     - some small changes to the logging output
+   
+   * mbase/MParContainer.cc:
+     - fHasChanged added 
+   
+   * mbase/MParContainer.h:
+     - Reset prototype added
+     - HasChanged added
+     - SetHasChanged added
+   
+   * mbase/MParList.[cc,h]:
+     - SetHasChanged added
+     - Reset added
+   
+   * mbase/MTaskList.cc:
+     - Process: call SetHasChanged before looping
+     - Process: call Reset before looping
+   
+   * mbase/MTaskList.h:
+     - fParList added to class definition
+
+
+
+ 2001/04/27: Thomas Bretz
+
+   * macros/merpp.C:
+     - made the merpp-macro Mars 0.3 compatible
+
+
+
+ 2001/04/19: Thomas Bretz
+
+   * mbase/MParList.cc:
+     - added stripping of the string after last semicolon (classname)
+
+   * mbase/MReadTree.cc:
+     - added Veto funtionality to PreProcess
+     - added HasVeto
+     - added fVetoList
+     - added VetoBranch
+
+
+
+ 2001/04/18: Thomas Bretz
+
+   * mbase/MHtml.[cc.h]:
+     - Added
+     
+   * mbase/*.cc:
+     - changed comments of member functions to new MHtml-Style
+
+
+
+ 2001/04/09: Thomas Bretz
+
+   * mbase/MParList.cc:
+     - Added the possibility to specify a different object name in
+       FindCreateObj
+
+   * .rootrc:
+     - changed the style for the html documentation
+    
+   * macros/dohtml.C:
+     - added SetXwho
+    
+   * (*.cc):
+     - added the copyright comment block
+  
+   * mgui/MGeomCamMagic.cc:
+     - added some comments to all these numbers
+  
+   * mraw/MRawEvtPixelIter.h:
+     - added Jump member function which jumps directly to the pixel with a
+       given id
+      
+
+
+ 2001/04/09: Thomas Bretz
+
+   * mgui/MGeomPix.cc:
+     - fixed a small error in SetNeighbors (thanks to Oscar)
+     
+   * mgui/MGFadcDisp.[h,cc]:
+     - Fixed many small errors which caused the display to display nonsens
+       in some situations
+
+
+
+ 2001/04/04: Thomas Bretz
+
+   * mraw/MRawEvtData.[cc,h]:
+     - changed wrong return type of GetNumPixels to UShort_t
+
+   * mmain/MBrowser.[cc,h]:
+     - made the dialog somehow work like it should
+
+
+
+ 2001/04/03: Thomas Bretz
+
+   * manalysis/MCT1ReadAscii.cc:
+     - the pedestal values read from the file are now stored in MeanRms 
+       instead of Sigma
+   
+   * manalysis/MCerPhotCalc.cc:
+     - The pedestal mean Rms is used as the pixel error
+   
+   * MImgCleanStd.cc:
+     - CleanStep1: the '<' was replaced by a '<=' to clean also pixels 
+       with value=noise=0
+     
+   * MMcPedestalCopy.cc:
+     - All the pedestal values are now filled in (are they calculated correctly?)
+   
+   * mgui/MGeomCamMagic.cc:
+     - Forgot to initialize the Nextneighbors of the Magic Camera
+       (thanks to Oscar)
+     
+   * mhist/MHStarMap.cc:
+     - I changed the model of the display (colors and bin width) to
+       get a 'better' result
+
+
+
+ 2001/04/02: Thomas Bretz
+ 
+   * mraw/MRawEvtHeader.h, mraw/MRawFileWrite.cc:
+     - added constants (kTT*) for trigger type
+   
+   * manalysis/MImgCleanStd.[h,cc]:
+     - added changeable cleaning levels
+ 
+   * manalysis/MHillas.cc:
+     - added some more sanity checks to the calculation
+     
+   * manalysis/MCT1ReadAscii.[h,cc]:
+     - added some kind of chain feature (AddFile) to process more than one file
+ 
+   * mgui/MGeomPix.[h,c]:
+     - added interface to pixel neighbors
+ 
+   * mgui/MGeomCamCT1.[cc,h], mgui/MGeomCamMagic.[cc,h]:
+     - creates the neighbor geomtry now, too
+ 
+   * manalysis/MImgCleanStd.[cc,h]:
+     - switched to new stylish neighbors from MGeomCam
+
+
+
+ 2001/03/30: Thomas Bretz
+ 
+   * mdatacheck/MH*, mdatacheck/MFillH*:
+     - moved to mhist
+   
+   * mraw/MrawEvtPixelIter:
+     - IsLoGain -> HasLoGain
+   
+   * mgui/MG*:
+     - renamed
+     - moved to mmain
+     - move Browser functionality to MBrowser
+ 
+   * mmain/, mhist:
+     - new
+
+
+
+ 2001/03/21: Thomas Bretz
+                            
+   * manalysis/MHillas.[h,cc]:
+     - fixed some minor errors, added sanity check (N<2) to Calc
+
+   * manalysis/MFillHHillas.cc:
+     - skip event if Hillas calculations fails
+     
+   * macros/getCollArea.C, macros/readMagic.C, 
+     mdatacheck/MViewAdcSpectra.cc, meventdisp/MGFadcDisp.cc:
+     - changed order in MReadTree constructor
+
+   * manalysis/MCT1ReadAscii.[h,cc]:
+     - changed to use MPedestalCam
+     
+   * manalysis/MCT1Pedestals.[h,cc]:
+     - removed
+     
+   * manalysis/Makefile, manalysis/AnalysisLinkDef.h:
+     - removed MCT1Pedestals
+     
+   * mbase/BaseLinkDef.h:
+     - added const values from Magic.h
+     
+   * mbase/MLogManip.h:
+     - changed style of dbginf
+   
+   * mbase/MParList.cc:
+     - make use of dbginf
+     
+   * mbase/MReadTree.[h,cc]:
+     - switched from a TTree to a TChain object
+     - chnaged order of variables of the constructor
+
+
+
+ 2001/03/21: Thomas Bretz
+                                                                  
+   * macros/CT1Hillas.C, manalysis/MImgCleanStd.cc, manalysis/MImgCleanStd.h,
+     manalysis/MMcPedestalCopy.cc, manalysis/MMcPedestalCopy.h,
+     manalysis/MCerPhotCalc.h, manalysis/MCerPhotCalc.cc, mdatacheck/MHHillas.h,
+     mdatacheck/MHHillas.cc, mdatacheck/MFillHFadc.cc, mdatacheck/MFillHFadc.h,
+     mdatacheck/MHFadcCam.cc, mdatacheck/MHFadcCam.h, mdatacheck/MHFadcPix.cc,
+     mdatacheck/MHFadcPix.h, mdatacheck/MFillHHillas.cc, 
+     mdatacheck/MFillHHillas.h
+     - added
+
+   * mdatacheck/MHistosAdc.[h,cc]:
+     - replaced by MHFadc[Cam,Pix]
+
+   * mdatacheck/MFillAdcSpect.[h,cc]:
+     - replaced by MFillHFadc
+
+   * macros/readCT1.C:
+     - uses the new classes now
+     - calculates and displays hillas
+
+   * manalysis/AnalysisLinkDef.h:
+     - added MCerPhotCalc, MImgCleanStd, MMcPedestalCopy
+
+   * manalysis/MCT1ReadAscii.cc:
+     - PreProcess uses FindCreateObj now
+
+   * manalysis/MCerPhotEvt.cc, manalysis/MPedestalCam.cc:
+     - changed the new back to 'new with placement'
+
+   * manalysis/MCerPhotEvt.[h, cc]:
+     - removed cleaning from this class
+
+   * manalysis/MHillas.cc:
+     - some small changes in the naming inside Calc()
+
+   * manalysis/MHillas.h:
+     - added Get-functions
+     
+   * manalysis/MPedestalCam.h:
+     - added InitSize-function
+     
+   * manalysis/MPedestalPix.h:
+     - made Get-functions const
+     
+   * manalysis/Makefile:
+     - added MMcPedestalCopy, MImgCleanStd, MCerPhotCalc
+     
+   * mbase/MLogManip.h:
+     - "l." before line number
+     
+   * mbase/MParList.cc:
+     - added the autodelete feature for automatically created classes
+     
+   * mdatacheck/DataCheckLinkDef.h:
+     - added MHFadc[Cam,Pix], MHHillas
+     - removed MHistosAdc
+     - added MFillHFadc, MFillHHillas
+     
+   * mdatacheck/MGDisplayAdc.[h,cc], MShowSpect.[h,cc],
+     mdatacheck/MViewAdcSpectra.[h,cc], :
+     - changed from MHistaosAdc to MHFadcCam
+     
+   * mdatacheck/Makefile:
+     - added MFillHFadc.cc, MFillHHillas.cc
+     - removed MFillAdcSpect.cc
+
+   * manalysis/MCT1ReadAscii.h, mbase/MEvtLoop.h, mbase/MLog.h,
+     mbase/MParList.h, mbase/MReadTree.h, mbase/MTask.h,
+     mbase/MTaskList.h, mdatacheck/MDumpEvtHeader.h,
+     meventdisp/MGFadcDisp.h, mgui/MCamDisplay.h,
+     mgui/MCamNeighbor.h, mgui/MGDataCheckMain.h,
+     mgui/MGEventDispMain.h, mgui/MGMarsMain.h,
+     mgui/MGMonteCarloMain.h, mgui/MGPrototyp.h, mgui/MHexagon.h,
+     mmontecarlo/MCollAreaTrigger.h, mraw/MRawEvtPixelIter.h,
+     mraw/MRawFileRead.h, mraw/MRawFileWrite.h:
+     - set version number to '0' (no i/o for this class)
+
+   * mgui/MGeomCamCT1.cc:
+     - new claculation algorith for the CT1 camera. It is more
+       exact in the camera plain
+       
+   * mgui/MHexagon.cc:
+     - removed Draw-function (it is inherited from TObject)
+     
+   * mmc/MMcFadcHeader.hxx:
+     - Added get-functions
+     
+
+
+
+ 2001/03/20: Thomas Bretz
+                                                                  
+   * manalysis/MPedestalPix.[h,cc], manalysis/MPedestalCam.[h,cc],
+     manalysis/MHillas.[h,cc], manalysis/MHillasCalc.[h,cc],
+     mgui/MGeomCamCT1.[h,cc], mgui/MGeomCamMagic.[h,cc]
+     - added
+
+   * macros/readCT1.C:
+     - added calculation of Hillas parameters
+     - changed from pointers to objects
+
+   * manalysis/AnalysisLinkDef.h, manalysis/Makefile:
+     - added MPedestalPix/Cam, MHillas, MHillasCalc
+
+   * manalysis/MCerPhotEvt.[h,cc]:
+     - removed fType
+     - commented out Draw function - should be fixed soon
+     - renamed *Nb* to *Num*
+     - renamed Get[Min,Max]NumPhotons to GetNumPhontons[Min,Max]
+
+   * meventdisp/MGFadcDisp.[h,cc]:
+     - changed parameter of ReadinEvent to unsigned
+
+   * mgui/GuiLinkDef.h, mgui/Makefile:
+     - added MGeomCamCT1, MGeomCamMagic
+
+   * mgui/MCamDisplay.[h,cc]:
+     - changed constructor argument from int to MGeomCam
+     - renamed *Nb* to *Num*
+
+   * mgui/MGeomCam.[h,cc]:
+     - removed all camara specific stuff
+     - MGeomCam is now used as a base class for the classes
+       MGeomCam[Magic,CT1] which are containing the camera specific stuff
+
+   * mgui/MGeomPix.h:
+     - added Set function
+
+
+
+ 2001/03/02: Thomas Bretz
+   
+   * manalysis/Makefile, mdatacheck/Makefile, meventdisp/Makefile,
+     mgui/Makefile: 
+     - new
+   
+   * mbase/MParList.[cc,h]: 
+     - Added FindCreateObj member function
+     - added a name to the constructor
+ 
+   * mbase/MReadTree.cc: 
+     - changed to use FindCreateObj
+
+   * mdatacheck/MDumpEvtHeader.cc: 
+     - removed fPixelIter from member list
+     - changed cout to *fLog
+   
+   * mdatacheck/MViewAdcSpectra.cc:
+     - removed a HUGE memory leak. All the objects in the list (and the
+       lists itself were NEVER deleted)
+   
+   * mdatacheck/MFillAdcSpect.cc
+     - removed fPixelIter from member list
+     - changed cout to *fLog
+     - changed to use FindCreateObj
+     - changed high and low to hi and lo
+   
+   * mdatacheck/MShowSpect.cc
+     - changed cout to *fLog
+     - added a name to the constructor
+   
+   * mraw/MRawFileRead.cc:
+     - changed to use FindCreateObj
+   
+   * mdatacheck/MGDisplayAdc.[h,cc]: 
+     - added some new member functions to make code more clear
+     - removed fHists from the destructor
+   
+   * mdatacheck/MHistosAdc.h:
+     - changed high and low to hi and lo
+
+   * macros/dohtml.C:
+     - added manalysis
+
+
+
+ 2001/03/01: Thomas Bretz
+
+   * Makefile: 
+     - added headers to dependencies
+ 
+   * Makefile.rules: 
+     - added headers to dependencies
+ 
+   * merpp.cc: 
+     - changed from pointers to objects
+     - added compression level support
+ 
+   * readraw.cc: 
+     - removed unnecessary includes
+ 
+   * mbase/MArray*.*: 
+     - changed all Int_t to UInt_t
+ 
+   * mbase/MLogManip.h: 
+     - changed name of __DINF__ to dbginf
+ 
+   * mraw/MRawCrateData.[h,cc], mraw/MRawEvtHeader.[h,cc],
+     mraw/MRawRunHeader.[h,cc]: 
+     - changed ifstream to istream
+     
+   * mraw/MRawEvtData.cc: 
+     - changed the reading, which speeds up merpp by a factor of 10
+   
+   * mraw/MRawEvtData.h: 
+     - added flag to InitArrays and DeletePixels 
+       (not yet used)
+
+   * mraw/MRawFileRead.h: 
+     - removed pParList from parameter list
+ 
+   * manalysis/AnalysisLinkDef.h
+     - removed MReadCT1Ascii, added MCT1ReadAscii
+     - added MCT1Pedestals
+   
+   * manalysis/MCerPhotEvt.[h,cc]:
+     - changed the constructor a little bit
+     - rewrote Print() to make it a bit more readable
+     - moved MCerphotPix to new File
+     - added many lines of comments
+     - exchanged old stylish new call with new stylish(=) one
+     - replaced all accesses to fPixels with the [] operator to make this
+       lines more readable
+     - made all variable declarations const-correct,
+     - I changed the style of the cleaning method from if(a){if()b{if(c){}}}
+       to if(!a)continue; if(!b)continue if(!c) continue; to make it more
+       compact, readable and easier to understand
+     - renamed the Boolean-functions to Is* to get a stricter structure
+     - replaced mapping function to access the pixel list entries by the new 
+       operator to get rid of more than the necessary number of member 
+       functions without loosing speed or readability
+     - renamed GetMinimum/MaximumPhoton to GetMin/MaxNumPhotons to be 
+       more exact
+   
+   * mgui/MCamGeom.* splitted and changed to MGeomCam/Pix:
+     - added a new operator to access the TObjArray
+     - removed unnecessary code from CreateCT1
+ 
+   * mbase/MAGIC.h: 
+     - added kPI
+ 
+   * mbase/MReadTree.cc: 
+     - added some comments
+ 
+   * mgui/MCamDisplay.[h,cc]: 
+     - added some comments, reordered a bit the calls in the constructor 
+       to get a 'straight forward structure', MGeomCam is now only
+       locally used where it is needed, replaced access to the 
+       TClonesArrays by new member-function to get a more readable code,
+       replaced old stylish new call with new stylish one, made
+       variable decleration const-correct, introduced a new member function
+       to set the pixel color, renamed the overloaded Draw functions to
+       DrawPhotons, DrawPhotErr to prevent missunderstatements, changed
+       the 'layout' of GetColor to make it easier to understand the algorithm,
+   
+   * mgui/MCamNeighbor.[h, cc]:
+     - changed to new log-interface
+     - exchanged -9999 by -1
+     - skipped the exits
+     - you must check for -1 one in any case
+     - this means a warning should be enough
+   
+   * mgui/MHexagon.[h,cc]:
+     - added new constructor whcih uses a MGeomPix-object
+
+
+
+ 2001/02/28: Thomas Bretz
+
+   * mbase/MParList.[h,cc]: 
+      - changed return type of FindObject back to TObject
+      - it seems so, that some compilers don't like overriding the
+        return type of a virtual member function
+
+
+
+ 2001/02/23: Thomas Bretz
+
+   * mraw/MRawEvtPixelIter.h: 
+      - added GetSum* functions
+
+   * mbase/MParList.[h,cc]: 
+      - Removed unnecessary fNext-stuff
+
+
+
+ 2001/02/22: Thomas Bretz
+
+   * merpp.cc, readraw.cc, mbase/MParContainer.cc, mbase/MParList.cc,
+     mbase/MParList.h, mbase/MReadTree.cc, mbase/MTask.cc, mbase/MTask.h,
+     mbase/MTaskList.cc, mbase/MTime.cc, mdatacheck/MDumpEvtHeader.cc,
+     mdatacheck/MShowSpect.cc, meventdisp/MGFadcDisp.cc, mgui/MGPrototyp.h,
+     mmc/MHeaderTrig.cxx, mraw/MRawCrateArray.cc, mraw/MRawEvtData.cc,
+     mraw/MRawEvtHeader.cc, mraw/MRawFileRead.cc, mraw/MRawFileWrite.cc,
+     mraw/MRawRunHeader.cc:
+      - exchanged cout with the new logging style (gLog, *fLog)
+
+   * mraw/MRawEvtData.cc: 
+      - added 'dec' option to Print
+  
+   * mmc/MHeaderTrig.cxx, mmc/MMcEvt.cxx, mmc/MMcTrig.cxx:
+      - small changes to the Print funtions
+
+
+
+ 2001/02/21: Thomas Bretz
+
+   * MRawEvtData.cc: 
+      - Changed ReadEvt according to the new raw binary format 2001/02/20
+     
+   * Added MLog.[h,cc], MLogManip.[h,cc]
+   
+   * Adde SetStreamer and fLog to the MParContainer base class
+   
+   * Derived MEvtLoop from MParContainer
+
+   * Makefile: 
+      - added 'tar'
+
+   * mbase/BaseIncl.h: 
+      - added fstream.h, TGListBox.h
+ 
+   * mbase/BaseLinkDef.h: 
+      - added pragma for gLog and MLog
+ 
+   * mbase/MAGIC.h: 
+      - added forward definition for gLog
+ 
+   * mbase/MEvtLoop.cc: 
+      - exchanged cout with *fLog
+      - added statements to provide log-facility to all tasks als parameter 
+        containers
+    
+   * mbase/MEvtLoop.h: 
+      - Small changes
+  
+   * mbase/MParContainer.h: 
+      - Added definitions necessary for use of Log-Facility
+  
+   * mbase/MParList.[h,cc]: 
+      - Added SetLogStream
+  
+   * mbase/MTask.h: 
+      - added fLog
+  
+   * mbase/MTaskList.[h,cc]: 
+      - added SetLogStream
+  
+   * mbase/Makefile: 
+      - Added MLog.cc, MLogManip.cc
+
+
+
+ 2001/02/19: Harald Kornmayer	
+
+  *  implemented the Image Cleaning a la CT1 to the class MCerPhotEvt
+  
+  *  changed the readCT1.C file to show the effects of the image cleaning
+     a la CT1
+
+  *  changed 
+	mgui/MCamNeighbor.cc
+	mananlysis/MCerPhotEvt.cc  .h 
+	macros/readCT1.C
+
+
+
+ 2001/02/19: Thomas Bretz
+
+   * MParContainer.h added prototypes for AsciiRead/Write
+
+   * .rootrc added
+
+   * MEvtLoop.[h,cc]: 
+      - split eventloop in its three parts, this should be used for 
+        debugging only.
+
+
+
+ 2001/02/06: Harald Kornmayer
+
+   *  the first running version with a eventdisplay. Now we are able
+      to display an Event on the photo electron level. To do this, run
+      the macro "macros/readCT1.C" after changing the file name. 
+
+      changed: 
+	macros/readCT1.C
+	manalysis/MNphotEvent.cc, manalysis/MNphotEvent.h
+	analysis/MReadCT1Ascii.cc
+	mgui/MCamDisplay.cc, mgui/MCamDisplay.h
+
+
+
+ 2001/01/23: Harald Kornmayer
+
+   *  the integration of the class FadcDisp in the mars enviroment
+      and further developments in the display
+
+      changed: 
+	meventdisp/MGFadcDisp.h
+	meventdisp/MGFadcDisp.cc
+	mgui/GuiIncl.h
+	mgui/GuiLinkDef.h
+	mgui/MGMarsMain.cc
+	mgui/MGPrototyp.cc
+	mgui/MGPrototyp.h
+	mgui/Makefile
+
+      added: 
+	mgui/MGEventDispMain.h
+	mgui/MGEventDispMain.cc
+
+
+
+ 2001/01/22: Harald Kornmayer
+
+   *  started with the development of a EventDisplay Utitliy. 
+      Therefore I added the following files. 
+
+      meventdisp/EvtDispIncl.h
+      meventdisp/EvtDispLinkDef.h
+      meventdisp/MGFadcDisp.cc
+      meventdisp/MGFadcDisp.h
+      meventdisp/Makefile
+
+      Also a few of the older files where slightly changed. 
+      ./Makefile
+      ./Makefile.rules
+      mraw/MRawEvtData.
+      
+
+
+ 2001/01/19: Thomas Bretz
+
+    * mmc/*.hxx:
+       - changed include of MDefineTrigger.h back
+
+
+
+ 2001/01/19: Oscar Blanch
+
+    * mmc/MTriggerDefine.h:
+       - added
+
+
+
+ 2001/01/18: Thomas Bretz
+
+    * Makefile:
+       - mmc-library added
+
+    * Makefile.conf.general:
+       - Added definition of __MARS__
+
+    * Makefile.rules:
+       - Added definitions to rootcint
+
+    * Oscar added the McFormat subdir of the Monte Carlo as mmc
+
+    * mmc/MMcEvt.h:
+       - renamed to MMcEvt.hxx
+
+    * mmc/*.hxx:
+       - added necessary defintions from MDefineTrigger.h
+
+    * mmc/Makefile, mmc/McLinkDef.h, mmc/McIncl.h, mmc/readme.txt:
+       - added
+
+    * mmc/LinkDef.h:
+       - removed
+
+
+
+ 2001/01/17: Thomas Bretz
+
+    * Makefile:
+       - Exchanged explicit rules to make library by implicit ones
+       - The shared object works now. I exchanged the libraries with the object
+         files. But I don't know why the libraries don't work.
+
+    * Makefile.conf.linux-gnu:
+       - replaced CC with gcc (instead of g++)
+
+    * mdatacheck/DataCheckLinkDef.h:
+       - removed unused statements
+
+    * mraw/RawLinkDef.h:
+       - added globals
+
+    * mraw/MerppLinkDef.h:
+       - removed unused file
+
+
+
+ 2001/01/12: Thomas Bretz
+
+    * MLinkDef.h, MIncl.h, marslogo.xpm, magiclogo.xpm:
+       - added
+
+    * LinkDef.h:
+       - removed
+
+    * Makefile:
+       - Added CINT, mrproper
+
+    * mbase/Makefile, mraw/Makefile, mgui/Makefile, mdatacheck/Makefile:
+       - included makefile.general, Makefile.rules,
+       - removes corresponding lines
+
+    * mdatacheck/MDumpEvtHeader.[h,cc], mdatacheck/MFillAdcSpect.[cc,h],
+      mdatacheck/MFillAdcSpect.[h,cc], mdatacheck/MGDisplayAdc.[cc,h],
+      mdatacheck/MHistsosAdc.[h,cc], mdatacheck.MShowSpect.[cc,h]
+       - changed include statements
+
+    * mgui/MGDataCheckMain.[cc,h], mgui/MGMarsMain.[cc,h]
+       - changed include statements
+       - move enum from h to cc
+       - removed comma operator from delete statements (nonsense)
+
+
+
+ 2001/01/11: Harald Kornmayer
+
+    * ./
+      readraw.cc, Makefile, Makefile.rules, LinkDef.h, MParList.cc, MReadTree.cc,
+      MReadTree.h, mbase/Makefile, mraw/Makefile
+       - small changes in this files. Not really critical.
+
+    * mars.cc
+       - added the main file for the gui
+
+    * mgui/
+      GuiIncl.h, MGMarsMain.cc, GuiLinkDef.h, MGMarsMain.h, MGDataCheckMain.cc,
+      Makefile, MGDataCheckMain.h
+       - added the subdir mgui and this files
+
+    * mdatacheck/
+      DataCheckIncl.h, DataCheckLinkDef.h, MHistosAdc.cc, MHistosAdc.h,
+      MDumpEvtHeader.cc, MDumpEvtHeader.h, MShowSpect.cc, MShowSpect.h,
+      MFillAdcSpect.cc, MFillAdcSpect.h, MViewAdcSpectra.cc, MViewAdcSpectra.h,
+      MGDisplayAdc.cc, MGDisplayAdc.h, Makefile
+       - added the subdir mdatacheck and this files
+
+
+
+ 2000/12/28: Thomas Bretz
+
+    * merpp.cc, MArray.cc, MArray.h, MArrayB.cc, MArrayB.h, MArrayS.cc,
+      MArrayS.h, MEvtLoop.cc, MEvtLoop.h, MInputStreamID.cc, MInputStreamID.h,
+      MParContainer.cc, MParContainer.h, MParList.cc, MParList.h, MReadTree.cc,
+      MTask.cc, MTask.h, MTaskList.cc, MTaskList.h, MTime.cc, MTime.h:
+       - Added changes some comments.
+
+    * MLoopEvt.cc, MLoopEvt.h:
+       - Removed
+
+
+
+ 2000/12/22 - Thomas Bretz:
+
+    * readraw.cc:
+       - changed some comments and the Root-Name of the program
+       - added check for the existance of the file
+       - changed name of numbers of entries from iEnt to nent
+
+    * dohtml.C:
+       - changed title of converted macros
+
+    * MRawEvtData.cc:
+       - added a commet in Draw()
+
+    * MRawEvtPixelIter.[h,cc]:
+       - Added the comment header of the file
+       - removed inheritance from TIterator (not needed)
+       - some changes to get it work (the one in the repository was untested
+         and not working)
+       - changed calling style of iterator from do...while to while-loop
+       - changed some comments
+
+    * MRawRunHeader.cc:
+       - added some comments
+
+    * Changelog, News: added
+
+    * test.C: removed
Index: /tags/Mars_V0-4/Mars/MIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/MIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/MIncl.h	(revision 9634)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/MLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/MLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/MLinkDef.h	(revision 9634)
@@ -0,0 +1,7 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#endif
Index: /tags/Mars_V0-4/Mars/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Makefile	(revision 9634)
@@ -0,0 +1,136 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include Makefile.conf.$(OSTYPE)
+include Makefile.conf.general
+
+#
+
+PROGRAMS = merpp readraw mars
+SOLIB    = mars.so
+CINT     = M
+
+#
+#  connect the include files defined in the config.mk file
+#
+#    WARNING: the result (whether the linkage works or not) depends on the
+#             order of the libraries. It seems, that the most base library
+#             must be the last one
+#
+
+#
+#  ----->>>   mars libraries
+#
+SUBDIRS = mgui        \
+          mmain       \
+	  manalysis   \
+          meventdisp  \
+          mdatacheck  \
+          mmontecarlo \
+          mhist       \
+          mfilter     \
+          mbase       \
+          mraw        \
+          mmc
+
+LIBRARIES = $(SUBDIRS:=.a)
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .h .o 
+
+SRCFILES = 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: rmlib $(PROGRAMS) $(SOLIB)
+
+# Use $(CXX) -v ... for a more verbose output
+#
+# We could link mars.so instead of all libraries. This would need
+# some MBs less space on the HD. But this means, that the Shared
+# Library Path in your system must be set properly to be able to start
+# 'mars'
+#
+$(PROGRAMS): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o $(PROGRAMS:=.o) 
+	@echo " Linking $@ ..." 
+	$(CXX) $(CXXFLAGS) $@.o $(OBJS) $(MARS_LIB) MCint.o $(ROOTGLIBS) -o $@
+
+$(SOLIB): $(LIBRARIES) $(OBJS) $(HEADERS) MCint.o
+	@echo " Linking $(SOLIB) ..."
+	$(CXX) -shared $(CXXFLAGS) $(SUBDIRS:=/*.o) $(ROOTGLIBS) -o $@
+	mv mars.so lib
+
+$(LIBRARIES):
+	@echo " "  
+	@echo " Creating lib$@:"
+	(cd $*; make; cd ..; mv $*/$@ lib/lib$@) 
+
+dox:
+	@echo " Creating html documentation:"
+	root -b -q dohtml.C
+
+include Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+	@rm -f macros/*~
+	@rm -rf htmldoc
+	@echo "cd mbase"
+	@cd mbase; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mraw"
+	@cd mraw; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mhist"
+	@cd mhist; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mfilter"
+	@cd mfilter; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mgui"
+	@cd mgui; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mdatacheck"
+	@cd mdatacheck; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mmc"
+	@cd mmc; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd meventdisp"
+	@cd meventdisp; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd manalysis"
+	@cd manalysis; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mmontecarlo"
+	@cd mmontecarlo; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mmain"
+	@cd mmain; make mrproper; cd ..
+	@echo "cd .."
+
+tar:	mrproper
+	@echo "Making tar-file"
+	@tar -cvf ../mars.tar .rootrc *
+	@gzip -9 ../mars.tar
+
+# @endcode
Index: /tags/Mars_V0-4/Mars/Makefile.conf.general
===================================================================
--- /tags/Mars_V0-4/Mars/Makefile.conf.general	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Makefile.conf.general	(revision 9634)
@@ -0,0 +1,19 @@
+#
+#  ----->>>   root libraries
+#
+
+ROOTVER    =  `root-config --version`
+ROOTLIBS   =  `root-config --libs`
+ROOTGLIBS  =  `root-config --glibs`
+ROOTCFLAGS =  `root-config --cflags`
+
+#
+#  compiler flags
+#
+
+DEFINES	  = -D__MARS__ -DROOTVER=\"$(ROOTVER)\"
+
+CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG) $(DEFINES)
+CFLAGS    = $(CXXFLAGS)
+FFLAGS    = $(CXXFLAGS)
+
Index: /tags/Mars_V0-4/Mars/Makefile.conf.linux
===================================================================
--- /tags/Mars_V0-4/Mars/Makefile.conf.linux	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Makefile.conf.linux	(revision 9634)
@@ -0,0 +1,35 @@
+##################################################################
+#
+# config.mk
+#
+# @file        config.mk
+# 
+##################################################################
+# @maintitle
+
+# @code
+
+# compilers
+
+CC            = gcc
+CXX           = g++
+F77           = f77
+AR            = ar -rc
+#
+#  ----->>>   settings for compilation
+#
+
+OPTIM    = -O2 -Wall -fno-rtti -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs 
+DEBUG    = -g
+
+MARS_LIB  = -Llib $(SUBDIRS:%=-l%)
+INCLUDES  = -I. $(SUBDIRS:%=-I%)
+
+# uncomment this for quiet compilation
+
+.SILENT:
+
+# @endcode
+##EOF
+
+
Index: /tags/Mars_V0-4/Mars/Makefile.conf.linux-gnu
===================================================================
--- /tags/Mars_V0-4/Mars/Makefile.conf.linux-gnu	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Makefile.conf.linux-gnu	(revision 9634)
@@ -0,0 +1,35 @@
+##################################################################
+#
+# config.mk
+#
+# @file        config.mk
+# 
+##################################################################
+# @maintitle
+
+# @code
+
+# compilers
+
+CC            = gcc
+CXX           = g++
+F77           = f77
+AR            = ar -rc
+#
+#  ----->>>   settings for compilation
+#
+
+OPTIM    = -O2 -Wall -fno-rtti -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs 
+DEBUG    = -g
+
+MARS_LIB  = -Llib $(SUBDIRS:%=-l%)
+INCLUDES  = -I. $(SUBDIRS:%=-I%)
+
+# uncomment this for quiet compilation
+
+.SILENT:
+
+# @endcode
+##EOF
+
+
Index: /tags/Mars_V0-4/Mars/Makefile.conf.osf1
===================================================================
--- /tags/Mars_V0-4/Mars/Makefile.conf.osf1	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Makefile.conf.osf1	(revision 9634)
@@ -0,0 +1,38 @@
+##################################################################
+#
+# config.mk
+#
+# @file        config.mk
+# 
+##################################################################
+# @maintitle
+
+# @code
+
+#
+# compilers
+#
+
+CC  = cc
+CXX = cxx
+F77 = f77
+AR  = ar -c -r
+
+#
+#  ----->>>   settings for compilation
+#
+
+OPTIM = -O2 -ieee -arch host
+DEBUG = -g  -w0 -msg_display_tag -msg_disable castqualtyp,undpreid,unrfunprm,extrasemi
+
+MARS_LIB  = -Llib $(SUBDIRS/*/-l&)
+INCLUDES  = -I. $(SUBDIRS/*/-I&)
+
+# uncomment this for quiet compilation
+
+.SILENT:
+
+# @endcode
+##EOF
+
+
Index: /tags/Mars_V0-4/Mars/Makefile.depend
===================================================================
--- /tags/Mars_V0-4/Mars/Makefile.depend	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Makefile.depend	(revision 9634)
@@ -0,0 +1,43 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+
+# DO NOT DELETE
+
+MGFadcDisp.o: MGFadcDisp.h ../mbase/MAGIC.h /cern/root/include/TROOT.h
+MGFadcDisp.o: /cern/root/include/TDirectory.h /cern/root/include/TNamed.h
+MGFadcDisp.o: /cern/root/include/TObject.h /cern/root/include/Rtypes.h
+MGFadcDisp.o: /cern/root/include/RConfig.h /cern/root/include/RVersion.h
+MGFadcDisp.o: /usr/include/stdio.h /usr/include/features.h
+MGFadcDisp.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+MGFadcDisp.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+MGFadcDisp.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+MGFadcDisp.o: /usr/include/bits/types.h /usr/include/libio.h
+MGFadcDisp.o: /usr/include/_G_config.h /usr/include/bits/stdio_lim.h
+MGFadcDisp.o: /cern/root/include/DllImport.h /cern/root/include/Varargs.h
+MGFadcDisp.o: /cern/root/include/TStorage.h /cern/root/include/TBuffer.h
+MGFadcDisp.o: /cern/root/include/Bytes.h /usr/include/string.h
+MGFadcDisp.o: /cern/root/include/TList.h /cern/root/include/TSeqCollection.h
+MGFadcDisp.o: /cern/root/include/TCollection.h /cern/root/include/TIterator.h
+MGFadcDisp.o: /cern/root/include/TString.h /cern/root/include/TMath.h
+MGFadcDisp.o: /cern/root/include/TRefCnt.h /cern/root/include/TDatime.h
+MGFadcDisp.o: /cern/root/include/Htypes.h /cern/root/include/TGFrame.h
+MGFadcDisp.o: /cern/root/include/TGWindow.h /cern/root/include/TGObject.h
+MGFadcDisp.o: /cern/root/include/GuiTypes.h /cern/root/include/TGClient.h
+MGFadcDisp.o: /cern/root/include/TVirtualX.h /cern/root/include/TAttLine.h
+MGFadcDisp.o: /cern/root/include/Gtypes.h /cern/root/include/TAttFill.h
+MGFadcDisp.o: /cern/root/include/TAttText.h /cern/root/include/TAttMarker.h
+MGFadcDisp.o: /cern/root/include/TGDimension.h /cern/root/include/TGLayout.h
+MGFadcDisp.o: /cern/root/include/TGString.h /cern/root/include/TGButton.h
+MGFadcDisp.o: /cern/root/include/TGWidget.h
+MGFadcDisp.o: /cern/root/include/WidgetMessageTypes.h
+MGFadcDisp.o: /cern/root/include/TGLabel.h /cern/root/include/TGSplitter.h
+MGFadcDisp.o: /cern/root/include/TGTab.h /cern/root/include/TGListBox.h
+MGFadcDisp.o: /cern/root/include/TGCanvas.h /cern/root/include/TGSlider.h
+MGFadcDisp.o: /cern/root/include/TRootEmbeddedCanvas.h
+MGFadcDisp.o: /cern/root/include/TGTextEntry.h
+MGFadcDisp.o: /cern/root/include/TGTextBuffer.h
Index: /tags/Mars_V0-4/Mars/Makefile.rules
===================================================================
--- /tags/Mars_V0-4/Mars/Makefile.rules	(revision 9634)
+++ /tags/Mars_V0-4/Mars/Makefile.rules	(revision 9634)
@@ -0,0 +1,59 @@
+
+depend:
+	@makedepend $(SRCS) $(INCLUDES) -I$(INCLUDE_CPLUS) $(ROOTCFLAGS) \
+        -f Makefile.depend 2> kk.kk ; cat kk.kk
+
+$(LIB): $(OBJS) $(HEADERS) $(CINT)Cint.o
+	@echo " - Building Library lib$(LIB) ... "
+	$(AR) $(LIB) *.o
+
+$(CINT)Cint.cc: $(HEADERS) 
+	@echo 
+	@echo " - Generating dictionary $(CINT)Cint.cc ..."
+
+	$(ROOTSYS)/bin/rootcint -f $(CINT)Cint.cc \
+	-c $(INCLUDES) $(DEFINES) $(HEADERS) $(CINT)Incl.h $(CINT)LinkDef.h 
+
+.cxx.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.cc.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.c.o:	
+	@echo "Compiling " $<
+	$(CC) $(CFLAGS) -c $< -o $@
+#
+# The cleaning facility
+#
+
+rmcint:	
+	@echo "Removing cint-stuff..."
+	@rm -f *Cint.*
+
+rmlib:	
+	@echo "Removing libraries..."
+	@rm -f lib/lib*.a  lib*.a
+
+rmobjs:	
+	@echo "Removing object files..."
+	@rm -f *.o
+
+rmcore:	
+	@echo "Removing core files..."
+	@rm -f core*
+
+rmbin:	
+	@echo "Removing binary files..."
+	@rm -f $(PROGRAMS) lib/$(SOLIB) so_locations
+
+rmbak:
+	@echo "Removing backup files..."
+	@rm -f *~ kk.kk *.bak
+
+cflags: 
+	@echo $(INCLUDES) $(CXXFLAGS)
+
+
Index: /tags/Mars_V0-4/Mars/NEWS
===================================================================
--- /tags/Mars_V0-4/Mars/NEWS	(revision 9634)
+++ /tags/Mars_V0-4/Mars/NEWS	(revision 9634)
@@ -0,0 +1,61 @@
+                                                               -*-*- END -*-*-
+
+
+ *** Version 0.4
+
+    - This release is made to compile on a root version >= 3.00
+
+    - Fixed a bug which causes MReadTree to read the first file only
+
+    - Added a task to compute the trigger rate (MMcTriggerRateCalc)
+ 
+    - Added a task to write a container to an Ascii file (MWriteAsciiFile)
+
+    - Added a task to write several container to a root file (MWriteRootFile)
+    
+    - Added calculation of the Enegry Threshold (MMcThresholdCalc)
+    
+    - Added calculation of the collection area (MMcCollectionAreaCalc)
+    
+    - removed some bugs in the Hillas calculation
+    
+    - added filters to be able to control the task execution dependent on
+      a parameter (for example: the number of level 1 triggers in a MC-file)
+
+
+
+ *** Version 0.3 (2001/04/23)
+	
+    - Many demo macros added    
+  
+    - MCT1ReadAscii is now able to handle more than one file (s. ::AddFile)
+    
+    - Hillas Calculation added
+    
+    - Standard image cleaning available
+    
+    - MReadTree is now able to handle more than one file
+      (Remark: of the same structure)
+    
+    - Now we are able to display events in a first version of the
+      Camera event display. To do this we must run the macro 
+      "macros/readCT1.C" to read data from CT1. 
+
+
+
+ *** Version 0.2 (2001/01/24)
+ 
+    - First Implementation of a Gui to read the raw data. Start the
+      gui with the command mars. 
+
+
+
+ *** Version 0.1 (2000/12/20)
+ 
+    - First official release 0.1
+    
+    - Changes:
+    
+       + changed calling style of MRawPixelIterator from do...while to 
+         while-loop
+
Index: /tags/Mars_V0-4/Mars/macros/CT1Hillas.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/CT1Hillas.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/CT1Hillas.C	(revision 9634)
@@ -0,0 +1,73 @@
+void CT1Hillas()
+{
+    //
+    // This is a demonstration program which calculates the Hillas
+    // parameter out of a CT1 dataset.
+
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MParList  plist;
+
+    MTaskList tlist;
+    plist.AddToList(&tlist);
+
+    //
+    // The geometry container must be created by yourself to make sure
+    // that you don't choos a wrong geometry by chance
+    //
+    MGeomCamCT1 geomcam;
+    plist.AddToList(&geomcam);
+
+    //
+    // The Hillas histograms (MHHillas) could be created automatically
+    // but to make sure, that they are not deleted when the macro is
+    // finished you must create them yourself and add it to the list
+    //
+    MHHillas  *hists = new MHHillas;
+    plist.AddToList(hists);
+
+    MHStarMap *smap = new MHStarMap;
+    plist.AddToList(smap);
+
+    //
+    // Now setup the tasks and tasklist:
+    //
+    //  1) read in the data from a ct1 ascii file   MCTReadAscii
+    //  2) clean the image                          MImgCleanStd
+    //  3) calculate hillas                         MHillasCalc
+    //  4) fill the hillas into the histograms      MFillHHillas
+    //
+    MCT1ReadAscii read("data/MCCT1_97_ga45.dat");
+    // read.AddFile("data/MCCT1_97_ga20.dat");
+
+    MImgCleanStd  clean;
+    MHillasCalc   hcalc;
+    MFillHHillas  hfill;
+    MFillHStarMap sfill;
+
+    tlist.AddToList(&read);
+    tlist.AddToList(&clean);
+    tlist.AddToList(&hcalc);
+    tlist.AddToList(&hfill);
+    tlist.AddToList(&sfill);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    if (!evtloop.SetParList(&plist))
+        return;
+
+    //
+    // Execute your analysis
+    //
+    evtloop.Eventloop();
+
+    //
+    // After the analysis is finished we can display the histograms
+    //
+    hists->Draw();
+    smap->Draw();
+}
Index: /tags/Mars_V0-4/Mars/macros/MagicHillas.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/MagicHillas.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/MagicHillas.C	(revision 9634)
@@ -0,0 +1,92 @@
+void MagicHillas()
+{
+    //
+    // This is a demonstration program which calculates the Hillas
+    // parameter out of a Magic root file.
+
+    //
+    // Create a empty Parameter List and an empty Task List
+    // The tasklist is identified in the eventloop by its name
+    //
+    MParList  plist;
+
+    MTaskList tlist;
+    plist->AddToList(&tlist);
+
+    //
+    // The geometry container must be created by yourself to make sure
+    // that you don't choos a wrong geometry by chance
+    //
+    MGeomCamMagic geomcam;
+    plist->AddToList(&geomcam);
+
+    MPedestalCam pedest;
+    plist->AddToList(&pedest);
+
+    //
+    // The Hillas histograms (MHHillas) could be created automatically
+    // but to make sure, that they are not deleted when the macro is
+    // finished you must create them yourself and add it to the list
+    //
+    MHHillas *hists = new MHHillas;
+    plist->AddToList(hists);
+
+    MHStarMap *smap = new MHStarMap;
+    plist->AddToList(smap);
+
+    //
+    // Now setup the tasks and tasklist:
+    //
+    //  1) read in the data from a magic root file   MReadTree
+    //  2) calculate number of cerenkov photons      MCerPhotCalc
+    //  3) clean the image                           MImgCleanStd
+    //  4) calculate hillas                          MHillasCalc
+    //  5) fill the hillas into the histograms       MFillHHillas
+    //
+
+    //
+    // The first argument is the tree you want to read.
+    //   Events:     Cosmic ray events
+    //   PedEvents:  Pedestal Events
+    //   CalEvents:  Calibration Events
+    //
+    MReadTree read("Events", "data/cer000020.root");
+    // read.AddFile("data/cer000019.root");
+
+    MCerPhotCalc    ncalc;
+    MImgCleanStd    clean;
+    MHillasCalc     hcalc;
+    MFillH          hfill("MHillas", "MHHillas");
+    MFillHStarMap   sfill("MHillas", "MHStarMap");
+    MWriteRootFile write("hillas.root");
+    write.AddContainer("MHillas");
+    write.AddContainer("MHHillas");
+    write.AddContainer(smap);
+
+    tlist.AddToList(&read);
+    tlist.AddToList(&ncalc);
+    tlist.AddToList(&clean);
+    tlist.AddToList(&hcalc);
+    tlist.AddToList(&hfill);
+    tlist.AddToList(&sfill);
+    tlist.AddToList(&write);
+
+    //
+    // Create and setup the eventloop
+    //
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    //
+    // Execute your analysis
+    //
+    if (!evtloop.Eventloop())
+        return;
+
+    //
+    // After the analysis is finished we can display the histograms
+    //
+    hists->Draw();
+    smap->Draw();
+}
+
Index: /tags/Mars_V0-4/Mars/macros/Pedestals_Stability.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/Pedestals_Stability.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/Pedestals_Stability.C	(revision 9634)
@@ -0,0 +1,122 @@
+ void Pedestals_Stability()
+{
+    char *files[11] = {"ped_stab/stab1.root",
+                      "ped_stab/stab2.root",
+                      "ped_stab/stab3.root",
+                      "ped_stab/stab4.root",
+                      "ped_stab/stab5.root",
+                      "ped_stab/stab6.root",
+                      "ped_stab/stab7.root",
+                      "ped_stab/stab8.root",
+                      "ped_stab/stab9.root",
+                      "ped_stab/stab10.root",
+                      "ped_stab/stab11.root"};
+
+    for (Int_t stab_f=0; stab_f<11; stab_f++){
+
+      MParList plist;
+
+      MPedestalCam  pedest;
+      MTaskList     tlist;
+
+      plist->AddToList(&pedest);
+      plist->AddToList(&tlist);
+
+      MReadTree read("Events", files[stab_f] );
+      MPedCalcPedRun pedcalc;
+
+      tlist.AddToList(&read);
+      tlist.AddToList(&pedcalc);
+
+      MEvtLoop evtloop;
+      evtloop.SetParList(&plist);
+
+      if (!evtloop.PreProcess())
+        return;
+
+      const UInt_t NumEnt = read.GetEntries();
+
+      Float_t pedmeantohist[8][NumEnt];
+      Float_t pedMean[8][11];
+      Float_t pedRMS[8][11];
+
+      Int_t Ecount = 0;
+
+      while (read.Process())
+      {
+
+        pedcalc.Process();
+
+        for (Int_t i=0; i<8; i++){
+          pedmeantohist[i][Ecount] = pedest[i].GetMean();
+        }
+
+	Ecount++;
+
+      } 
+
+      evtloop.PostProcess();
+
+
+    // Create Histogram to get Mean & RMS per 100 pixel events
+ 
+      gROOT->Reset();
+
+      PixelHist = new TH1F("Pixel Hist","Pixel x - Ped hist",100,0,1000);
+
+      cout << files[stab_f] << endl;
+
+      for (Int_t pix=0; pix<8 ; pix++){
+         for (Int_t ev=0; ev<NumEnt; ev++){
+           PixelHist->Fill(pedmeantohist[pix][ev]);
+        }
+     
+	 pedMean[pix][stab_f] = PixelHist->GetMean();
+	 pedRMS[pix][stab_f] = PixelHist->GetRMS();
+
+	 //        cout << "Px" << pix << " - Ped = " 
+	 //	     << PixelHist->GetMean() << " +/- " << PixelHist->GetRMS() << endl;
+
+        PixelHist->Reset();     
+
+      }
+    }
+
+
+    // Plot the results
+
+    // Create the Canvas
+
+    c1 = new TCanvas("c1","Pedestals for all pixels",605,0,600,650);
+    c1->Divide(3,3);
+
+    for (Int_t pix=0; pix<8 ; pix++){
+
+      Float_t Time[11] = {0,51,117,170,229,341,409,475,533,585,643};
+      Float_t Err_Time[11];
+
+      Float_t PedestMeantoGraph[11];
+      Float_t PedestRMStoGraph[11];
+
+      char Title[40];
+
+       for (Int_t ev=0; ev<11; ev++){
+	 PedestMeantoGraph[ev] = pedMean[pix][ev];
+	 PedestRMStoGraph[ev] = pedRMS[pix][ev];
+       }
+       c1->cd(pix+1);
+       gr = new TGraphErrors(11,Time,PedestMeantoGraph,Err_Time,PedestRMStoGraph);
+
+       sprintf(Title,"Pedestal Stability - Pixel %d",pix+1);
+       gr->SetMarkerStyle(20);
+       gr->SetMarkerSize(0.7);
+       gr->SetTitle(Title);
+       gr->Draw("ALP");
+       gr->GetXaxis()->SetTitle("Time (min)");
+       gr->GetYaxis()->SetTitle("ADC Counts");
+       gr->Draw("ALP");
+    
+    }
+    c1->Update();
+
+}
Index: /tags/Mars_V0-4/Mars/macros/dohtml.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/dohtml.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/dohtml.C	(revision 9634)
@@ -0,0 +1,27 @@
+void dohtml()
+{
+  //
+  //  don't forget that the shared object must be loaded
+  //
+
+  //
+  //   create the html document class
+  //
+  MHtml html;
+
+  html.SetOutputDir("htmldoc");
+  html.SetSourceDir(".:mbase:mraw:mgui:manalysis:mdatacheck:mmain:meventdisp:mmc:mmontecarlo:mhist");
+  html.SetXwho("http://hegra1.mppmu.mpg.de/MAGICWeb/collaborators.html?");
+
+  html.MakeAll(kTRUE);
+
+  html.SetSourceDir("macros");
+  html.Convert("merpp.C",       "MARS - Merging and Preprocessing");
+  html.Convert("readraw.C",     "MARS - How To Read A Raw");
+  html.Convert("rootlogon.C",   "MARS - rootlogon.C");
+  html.Convert("readCT1.C",     "MARS - Read and display CT1 Events");
+  html.Convert("readMagic.C",   "MARS - Read and display Magic Events");
+  html.Convert("CT1Hillas.C",   "MARS - Calculate CT1 Hillas");
+  html.Convert("MagicHillas.C", "MARS - Calculate Magic Hillas");
+  html.Convert("getCollArea.C", "MARS - Calculate Collection Area from a MC root file");
+}
Index: /tags/Mars_V0-4/Mars/macros/getCollArea.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/getCollArea.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/getCollArea.C	(revision 9634)
@@ -0,0 +1,54 @@
+void getCollArea(char *filename = "data/gamma_15_on.root" )
+{ 
+    // FIXME: Harald, you should tell the people what the result of
+    // this macro really is.
+
+    //
+    // first we have to create our empty lists
+    //
+    MParList  parlist;
+    MTaskList tasklist;
+
+    //
+    // Setup the parameter list.
+    //  - we need to create MCollArea only. The other containers
+    //    are created automatically without loss - we don't have to
+    //    access them-
+    //  - MCollArea must be created by us because we need the pointer
+    //    to it and if it would get created automatically it would also be
+    //    deleted automatically
+    //
+    parlist.AddToList(&tasklist);
+
+    MHMcCollectionArea *collArea = new MHMcCollectionArea();
+    parlist.AddToList(collArea);
+
+    //
+    // Setup out tasks:
+    //  - First we have to read the events
+    //  - Then we can fill the efficiency histograms
+    //
+    MReadTree reader("Events", filename);
+    tasklist.AddToList(&reader);
+
+    MMcCollectionAreaCalc effi;
+    tasklist.AddToList(&effi);
+
+    //
+    // set up the loop for the processing
+    //
+    MEvtLoop magic;
+    magic.SetParList(&parlist);
+
+    //
+    // Start to loop over all events
+    //
+    if (!magic.Eventloop())
+        return;
+
+    //
+    // Now the histogram we wanted to get out of the data is
+    // filled and can be displayd
+    //
+    collArea->Draw();
+}
Index: /tags/Mars_V0-4/Mars/macros/getRate.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/getRate.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/getRate.C	(revision 9634)
@@ -0,0 +1,78 @@
+void getRate(int dim=0, char *filename = "/big0/Maggi/CamData/Gamma/gamma_15_on.root" )
+{
+    // This macro has two input parameter:
+    // dim : = 0 -> root file with 1 trigger condition.
+    //       > 0 -> number of trigger condition to be analised 
+    //              in multi conditon file.
+    //       < 0 -> selects the -dim trigger condition.
+    //
+    // first we have to create our empty lists
+    //
+    MParList  parlist;
+    MTaskList tasklist;
+
+    //
+    // Setup the parameter list.
+    //  - we do not need to create any other container. All of them
+    //    are created automatically without loss - we don't have to
+    //    access them-
+    //
+    //  - we need to create MHMcRate only. The other containers
+    //    are created automatically without loss - we don't have to
+    //    access them-
+    //  - MHMcRate must be created by us because we need the pointer
+    //    to it and if it would get created automatically it would also be
+    //    deleted automatically
+    //  - Actually, depending on using a single trigger option MonteCarlo
+    //    file or a multyple trigger option, a MHMcRate or an array of 
+    //    MHMcRate are needed.
+    //
+    parlist.AddToList(&tasklist);
+
+    //
+    // You don't have to add the MHMcRate container here by hand.
+    // But if you want to print or display these containers later on
+    // it is necessary (Rem: No printing or displaying is done in this
+    // macro yet)
+    //
+    TObjArray *hists = new TObjArray(MParList::CreateObjList("MHMcRate", dim));
+
+    //
+    // Check if the list really contains the right number of histograms
+    //
+    if (hists->GetEntriesFast() != dim)
+        return;
+
+    //
+    // Add the histograms to the paramater list.
+    //
+    parlist.AddToList(hists);
+
+    //
+    // Setup out tasks:
+    //  - First we have to read the events
+    //  - Then we can calculate rates, for what the number of
+    //    triggered showers from a empty reflector file for the
+    //    analised trigger conditions should be set (BgR[])
+    //
+    MReadTree reader("Events", filename);
+    tasklist.AddToList(&reader);
+
+    Float_t BgR[10]={660,4,0,0,0,0,0,0,0,0};
+    cout << "Number of Trigger conditions: " << dim << endl;
+
+    MMcTriggerRateCalc rate(dim, 14, BgR, 100000, 2.75, 10.91e-2);
+    tasklist.AddToList(&rate);
+
+    //
+    // set up the loop for the processing
+    //
+    MEvtLoop magic;
+    magic.SetParList(&parlist);
+
+    //
+    // Start to loop over all events
+    //
+    magic.Eventloop();
+
+}
Index: /tags/Mars_V0-4/Mars/macros/getThreshold.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/getThreshold.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/getThreshold.C	(revision 9634)
@@ -0,0 +1,69 @@
+void getThreshold(char* filename="data/CrabNebula_dnsb_09_loop.root")
+{
+    //
+    // This macro fill the container MHMcEnergies using the task
+    // MMcThresholdCalc and shows the results.
+    //
+    MParList  parlist;
+
+    MTaskList tasklist;
+    parlist.AddToList(&tasklist);
+
+    //
+    // Setup the parameter list
+    // - You need create the container MHMcEnergies.
+    //    + You need to put the number of trigger conditions when
+    //      you declarete the MHMcEnergies
+    //    + If you don't put any dimension to MHMcEnergies it works
+    //      taking only the trigger information from MMcTrig
+    //
+    const UInt_t numtriggerconditions = 4;
+
+    //
+    // Create numtriggerconditions histograms of type MHMcEnergy
+    // and store the histograms in an TObjArray
+    //
+    TObjArray *hists = new TObjArray(MParList::CreateObjList("MHMcEnergy", numtriggerconditions));
+
+    //
+    // Check if the list really contains the right number of histograms
+    //
+    if (hists->GetEntriesFast() != numtriggerconditions)
+        return;
+
+    //
+    // Add the histograms to the paramater list.
+    //
+    parlist.AddToList(hists);
+
+    //
+    // Setup the task list
+    // - You need the read and the MMcThresholdCalc tasks
+    // - You have to fill the histograms for the Energy threshold
+    //    + You need to put the number of trigger conditions when
+    //      you declarete the MMcThresholdCalc
+    //    + If you don't put any dimension to MMcThresholdCalc it works
+    //      like one dimension MMcThresholdCalc
+    //
+    MReadTree        read("Events;7", filename);
+    MMcThresholdCalc calc(numtriggerconditions);
+
+    tasklist.AddToList(&read);
+    tasklist.AddToList(&calc);
+
+    MEvtLoop evtloop;
+    evtloop.SetParList(&parlist);
+
+    //
+    // Begin the loop (if the loop wasn't succesfull
+    // don't try to draw the results
+    //
+    if (!evtloop.Eventloop())
+        return;
+
+    //
+    // Now you can display the results
+    //
+    for (UInt_t i=0; i<numtriggerconditions; i++)
+        ((*hists)[i])->Draw();
+}
Index: /tags/Mars_V0-4/Mars/macros/merpp.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/merpp.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/merpp.C	(revision 9634)
@@ -0,0 +1,60 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// This is an easy implementation of the Merging process (as root Macro)
+//
+// at the moment it reads a binary file ("rawtest.bin") which was written
+// in the DAQ raw format.
+//
+// The data are stored in root container objects (classes derived from
+// TObject like MRawRunHeader)
+//
+// This containers are written to a root file ("rawtest.root")
+//
+/////////////////////////////////////////////////////////////////////////////
+
+void merpp()
+{
+    //
+    // create a (empty) list of parameters which can be used by the tasks
+    // and an (empty) list of tasks which should be executed
+    //
+    MTaskList tasks;
+    MParList plist;
+
+    plist.AddToList(&tasks);
+
+    //
+    // create the tasks which should be executed and add them to the list
+    // in the case you don't need parameter containers, all of them can
+    // be created by MRawFileRead::PreProcess
+    //
+    // REMARK: Don't change the order of the two instantiations.
+    //         I don't have an idea why, but here it crashes the
+    //         Interpreter.
+    //         (Using root 2.25/03, with Cint 5.14.50 on OSF1)
+    //
+
+    MRawFileRead  reader("/home/tbretz/data/20010219-00020-d-octobertest-e");
+    MRawFileWrite writer("otest.root", "RECREATE");
+    tasks.AddToList(&reader);
+    tasks.AddToList(&writer);
+
+    //
+    // create the looping object and thell it about the parameters to use
+    // and the tasks to execute
+    //
+    MEvtLoop magic;
+
+    magic.SetParList(&plist);
+
+    //
+    // Start the eventloop which reads the raw file (MRawFileRead) and
+    // write all the information into a root file (MRawFileWrite)
+    //
+    // between reading and writing we can do, transformations, checks, etc.
+    // (I'm think of a task like MRawDataCheck)
+    //
+    magic.Eventloop();
+}
+
+
Index: /tags/Mars_V0-4/Mars/macros/readCT1.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/readCT1.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/readCT1.C	(revision 9634)
@@ -0,0 +1,64 @@
+void readCT1()
+{
+    MParList plist;
+
+    MGeomCamCT1 geomcam;
+    MHillas     hillas;
+    MTaskList   tlist;
+
+    plist->AddToList(&geomcam);
+    plist->AddToList(&hillas);
+    plist->AddToList(&tlist);
+
+    MCT1ReadAscii read("CT1_99_off1.dat") ;
+    MImgCleanStd  clean;
+    MHillasCalc   hcalc;
+
+    tlist.AddToList(&read);
+    tlist.AddToList(&clean);
+    tlist.AddToList(&hcalc);
+
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    if (!evtloop.PreProcess())
+        return;
+
+    MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
+
+    Int_t icount = 0 ;
+    MCamDisplay display(&geomcam) ;
+        display.DrawPhotNum(&phevt);
+
+
+    while (read.Process())
+    {
+        cout << "Event: " << icount++  << endl;
+
+        display.DrawPhotNum(&phevt);
+        gClient->HandleInput();
+        if(getchar()=='q')
+            break;
+
+        clean.Process();
+
+        if (hcalc.Process()==kCONTINUE)
+        {
+            cout << "skipped." << endl;
+            continue;
+        }
+
+        hillas.Print();
+        hillas.Draw();
+
+        display.DrawPhotNum(&phevt);
+
+        gClient->HandleInput();
+        if(getchar()=='q')
+            break;
+
+        hillas.Clear();
+    } 
+
+    evtloop.PostProcess();
+}
Index: /tags/Mars_V0-4/Mars/macros/readMagic.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/readMagic.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/readMagic.C	(revision 9634)
@@ -0,0 +1,62 @@
+void readMagic()
+{
+    MParList plist;
+
+    MGeomCamMagic geomcam;
+    MPedestalCam  pedest;
+    MHillas       hillas;
+    MTaskList     tlist;
+
+    plist->AddToList(&geomcam);
+    plist->AddToList(&pedest);
+    plist->AddToList(&hillas);
+    plist->AddToList(&tlist);
+
+    MReadTree    read("Events", "oscar_protons.root");
+    MCerPhotCalc ncalc;
+    MImgCleanStd clean;
+    MHillasCalc  hcalc;
+
+    tlist.AddToList(&read);
+    tlist.AddToList(&ncalc);
+    tlist.AddToList(&clean);
+    tlist.AddToList(&hcalc);
+
+    MEvtLoop evtloop;
+    evtloop.SetParList(&plist);
+
+    if (!evtloop.PreProcess())
+        return;
+
+    MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
+
+    MCamDisplay display(&geomcam) ;
+
+    while (read.Process())
+    {
+        cout << "Event #" << read.GetEventNum() ":" << endl;
+
+        ncalc.Process();
+
+        display.DrawPhotNum(&phevt);
+        gClient->HandleInput();
+        if(getchar()=='q')
+            break;
+
+        clean.Process();
+        hcalc.Process();
+
+        hillas.Print();
+        hillas.Draw();
+
+        display.DrawPhotNum(&phevt);
+
+        gClient->HandleInput();
+        if(getchar()=='q')
+            break;
+
+        hillas.Clear();
+    } 
+
+    evtloop.PostProcess();
+}
Index: /tags/Mars_V0-4/Mars/macros/readin.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/readin.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/readin.C	(revision 9634)
@@ -0,0 +1,62 @@
+{
+
+    //
+    // open the file
+    //
+    TFile input("test.root", "READ");
+
+    //
+    // open the Run Header tree
+    //
+    TTree *runtree = (TTree*) input.Get("RunHeaders") ;
+    cout << " Entries in Tree RunHeaders: " << runtree->GetEntries() << endl ;
+
+    //
+    // create an instance of MRawRunHeader, enable the branch and
+    // read the header, print it
+    //
+    MRawRunHeader *runheader = new MRawRunHeader();
+    runtree->GetBranch("MRawRunHeader")->SetAddress(&runheader);
+    runtree->GetEvent(0);
+    runheader->Print();
+
+    //
+    // open the Data Tree
+    //
+    TTree *evttree = (TTree*) input.Get("Data") ;
+
+    //
+    // create the instances of the data to read in
+    //
+    MRawEvtHeader  *evtheader = new MRawEvtHeader();
+    MTime          *evttime   = new MTime();
+    MRawEvtData    *evtdata   = new MRawEvtData();
+    MRawCrateArray *evtcrate  = new MRawCrateArray();
+
+    //
+    // enable the corresponding branches
+    //
+    evttree->GetBranch("MRawEvtHeader")->SetAddress(&evtheader);
+    evttree->GetBranch("MTime")->SetAddress(&evttime);
+    evttree->GetBranch("MRawEvtData")->SetAddress(&evtdata);
+    evttree->GetBranch("MRawCrateArray")->SetAddress(&evtcrate);
+
+    //
+    // loop over all events and print the information
+    //
+    Int_t iEnt = evttree->GetEntries();
+    cout << " Entries in Tree Data: " << iEnt << endl;
+
+    for (Int_t i = 0; i<iEnt; i++)
+    {
+      // readin event with the selected branches
+      evttree->GetEvent(i);
+
+      evtheader->Print();
+      evttime->Print();
+      evtcrate->Print();
+      evtdata->Print();
+    } 
+}
+
+
Index: /tags/Mars_V0-4/Mars/macros/readpix.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/readpix.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/readpix.C	(revision 9634)
@@ -0,0 +1,67 @@
+#include <iomanip>
+
+void readpix() {
+    //
+    // open the file
+    //
+    TFile input("delme.root", "READ");
+
+    //
+    // open the Run Header tree
+    //
+    TTree *runtree = (TTree*) input.Get("RunHeaders") ;
+    cout << " Entries in Tree RunHeaders: " << runtree->GetEntries() << endl ;
+
+    //
+    // create an instance of MRawRunHeader, enable the branch and
+    // read the header, print it
+    //
+    MRawRunHeader *runheader = new MRawRunHeader();
+    runtree->GetBranch("MRawRunHeader")->SetAddress(&runheader);
+    runtree->GetEvent(0);
+    runheader->Print();
+
+    //
+    // open the Data Tree
+    //
+    TTree *evttree = (TTree*) input.Get("Data") ;
+
+    //
+    // create the instances of the data to read in
+    //
+    MRawEvtData *evtdata = new MRawEvtData();
+
+    //
+    // enable the corresponding branches
+    //
+    evttree->GetBranch("MRawEvtData")->SetAddress(&evtdata);
+
+    evttree->GetEvent(0);
+
+    MRawEvtPixelIter pixel(evtdata);
+
+    while (pixel.Next())
+    {
+       
+       cout << "Pixel Nr: " << dec << pixel.GetPixelId() << " ";
+       cout << setfill('0') << endl;
+      
+       cout << "Hi Gains: ";
+       for (int i=0; i<evtdata->GetNumHiGainSamples(); i++)
+	  cout << setw(3) << (UInt_t)pixel.GetHiGainFadcSamples()[i];
+       cout << endl;
+      
+       cout << "Lo Gains: ";
+       if (pixel.IsLoGain())
+	  for (int i=0; i<evtdata->GetNumLoGainSamples(); i++)
+	     cout << setw(3) << (UInt_t)pixel.GetLoGainFadcSamples()[i];
+       cout << endl << endl;
+
+       if (pixel.GetPixelId() == 11)
+	 pixel.Draw();
+    };
+}
+
+
+
+
Index: /tags/Mars_V0-4/Mars/macros/readraw.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/readraw.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/readraw.C	(revision 9634)
@@ -0,0 +1,62 @@
+{
+
+    //
+    // open the file
+    //
+    TFile input("test.root", "READ");
+
+    //
+    // open the Run Header tree
+    //
+    TTree *runtree = (TTree*) input.Get("RunHeaders") ;
+    cout << " Entries in Tree RunHeaders: " << runtree->GetEntries() << endl ;
+
+    //
+    // create an instance of MRawRunHeader, enable the branch and
+    // read the header, print it
+    //
+    MRawRunHeader *runheader = new MRawRunHeader();
+    runtree->GetBranch("MRawRunHeader")->SetAddress(&runheader);
+    runtree->GetEvent(0);
+    runheader->Print();
+
+    //
+    // open the Data Tree
+    //
+    TTree *evttree = (TTree*) input.Get("Data") ;
+
+    //
+    // create the instances of the data to read in
+    //
+    MRawEvtHeader  *evtheader = new MRawEvtHeader();
+    MTime          *evttime   = new MTime();
+    MRawEvtData    *evtdata   = new MRawEvtData();
+    MRawCrateArray *evtcrate  = new MRawCrateArray();
+
+    //
+    // enable the corresponding branches
+    //
+    evttree->GetBranch("MRawEvtHeader")->SetAddress(&evtheader);
+    evttree->GetBranch("MTime")->SetAddress(&evttime);
+    evttree->GetBranch("MRawEvtData")->SetAddress(&evtdata);
+    evttree->GetBranch("MRawCrateArray")->SetAddress(&evtcrate);
+
+    //
+    // loop over all events and print the information
+    //
+    Int_t iEnt = evttree->GetEntries();
+    cout << " Entries in Tree Data: " << iEnt << endl;
+
+    for (Int_t i = 0; i<iEnt; i++)
+    {
+      // readin event with the selected branches
+      evttree->GetEvent(i);
+
+      evtheader->Print();
+      evttime->Print();
+      evtcrate->Print();
+      evtdata->Print();
+    } 
+}
+
+
Index: /tags/Mars_V0-4/Mars/macros/rootlogon.C
===================================================================
--- /tags/Mars_V0-4/Mars/macros/rootlogon.C	(revision 9634)
+++ /tags/Mars_V0-4/Mars/macros/rootlogon.C	(revision 9634)
@@ -0,0 +1,17 @@
+{
+    cout << endl;
+
+    cout << "Loading 'mars.so'... " << flush;
+
+    if (gSystem->Load("mars.so")!=0)
+        cout << "error." << endl;
+    else
+        cout << "done." << endl;
+
+    cout << endl;
+
+    cout << "Welcome to the Mars Root environment." << endl;
+
+    cout << endl;
+}
+
Index: /tags/Mars_V0-4/Mars/magiclogo.xpm
===================================================================
--- /tags/Mars_V0-4/Mars/magiclogo.xpm	(revision 9634)
+++ /tags/Mars_V0-4/Mars/magiclogo.xpm	(revision 9634)
@@ -0,0 +1,347 @@
+/* XPM */
+static char *mag2[] = {
+/* width height num_colors chars_per_pixel */
+"   188    91      248            2",
+/* colors */
+".. c #140f41",
+".# c #d9c70d",
+".a c #dcca8c",
+".b c #4f5064",
+".c c #8c8c99",
+".d c #2c2e50",
+".e c #f2e895",
+".f c #d8ad0d",
+".g c #ece23c",
+".h c #52507a",
+".i c #d8b54a",
+".j c #d2c74e",
+".k c #6c6f90",
+".l c #ababc3",
+".m c #e4e7f8",
+".n c #eeb107",
+".o c #242f77",
+".p c #f0c852",
+".q c #eacd87",
+".r c #dabc11",
+".s c #221d60",
+".t c #605f78",
+".u c #f4f8dc",
+".v c #908dbf",
+".w c #887e6c",
+".x c #bcb8d6",
+".y c #f2d85a",
+".z c #323f81",
+".A c #3c3f51",
+".B c #fcf894",
+".C c #e4e2e4",
+".D c #c4c7d9",
+".E c #d8bc2e",
+".F c #d8d8e7",
+".G c #443470",
+".H c #edc70a",
+".I c #e3d866",
+".J c #eade8b",
+".K c #343051",
+".L c #343178",
+".M c #342a67",
+".N c #d6c96b",
+".O c #cbb314",
+".P c #d9ad2f",
+".Q c #64619a",
+".R c #ecb644",
+".S c #f3e8b0",
+".T c #7372a0",
+".U c #f8e8d0",
+".V c #464471",
+".W c #5c587e",
+".X c #9b9bc1",
+".Y c #232466",
+".Z c #f4f7f9",
+".0 c #d6c06b",
+".1 c #242139",
+".2 c #ccc9df",
+".3 c #9b9baf",
+".4 c #abacd9",
+".5 c #f3e0a8",
+".6 c #efc968",
+".7 c #24297d",
+".8 c #edbe09",
+".9 c #343165",
+"#. c #bdb9e9",
+"## c #d8c04b",
+"#a c #f1d974",
+"#b c #d3c735",
+"#c c #e1c851",
+"#d c #454a91",
+"#e c #cbbc12",
+"#f c #e4be0a",
+"#g c #e4bd2d",
+"#h c #cdc9f1",
+"#i c #847ea5",
+"#j c #f8dd8d",
+"#k c #fcfdfb",
+"#l c #2c2864",
+"#m c #948eb1",
+"#n c #7c5604",
+"#o c #d9b512",
+"#p c #53508f",
+"#q c #f2da32",
+"#r c #a6a2c4",
+"#s c #2c367b",
+"#t c #34308d",
+"#u c #23204e",
+"#v c #edbf2d",
+"#w c #686888",
+"#x c #7c7ba7",
+"#y c #f5f1fa",
+"#z c #fcda72",
+"#A c #6c67a0",
+"#B c #e1d050",
+"#C c #f0ef98",
+"#D c #fbf0af",
+"#E c #d9b52e",
+"#F c #8883ba",
+"#G c #7a7b92",
+"#H c #eed050",
+"#I c #232f68",
+"#J c #eceff8",
+"#K c #dac20d",
+"#L c #d9c231",
+"#M c #dcdef5",
+"#N c #efc82f",
+"#O c #544a6c",
+"#P c #24264f",
+"#Q c #545983",
+"#R c #b4b7c6",
+"#S c #4b4a73",
+"#T c #b4b6da",
+"#U c #e8e468",
+"#V c #c0bfd7",
+"#W c #f4fef9",
+"#X c #383766",
+"#Y c #e4b50b",
+"#Z c #9494c1",
+"#0 c #35377c",
+"#1 c #dad070",
+"#2 c #5d5891",
+"#3 c #242a6c",
+"#4 c #fcc204",
+"#5 c #f9e28e",
+"#6 c #e4b42b",
+"#7 c #8c762c",
+"#8 c #a48a3c",
+"#9 c #6c5e44",
+"a. c #7c6e64",
+"a# c #947244",
+"aa c #b4a644",
+"ab c #c4a62c",
+"ac c #4c422c",
+"ad c #826b26",
+"ae c #c9bd49",
+"af c #998534",
+"ag c #fcf179",
+"ah c #6c584c",
+"ai c #341e4c",
+"aj c #7c7460",
+"ak c #59474f",
+"al c #848591",
+"am c #c4ac30",
+"an c #483454",
+"ao c #f5d586",
+"ap c #747074",
+"aq c #dec72f",
+"ar c #ecb630",
+"as c #fcfab5",
+"at c #ccbc2e",
+"au c #e4e1f9",
+"av c #a4a3b3",
+"aw c #70695e",
+"ax c #ac8e34",
+"ay c #a4864c",
+"az c #fae676",
+"aA c #3c4786",
+"aB c #af8e61",
+"aC c #453d7f",
+"aD c #464459",
+"aE c #ccc274",
+"aF c #1b194c",
+"aG c #443b3f",
+"aH c #f0d06c",
+"aI c #c2c0e9",
+"aJ c #f3d134",
+"aK c #7c76a7",
+"aL c #ccb244",
+"aM c #5c5864",
+"aN c #e8d58b",
+"aO c #64689d",
+"aP c #9ca3c6",
+"aQ c #23386b",
+"aR c #362a82",
+"aS c #8c8caf",
+"aT c #867c92",
+"aU c #3c3f67",
+"aV c #a7a3dc",
+"aW c #757290",
+"aX c #fce357",
+"aY c #ece9fa",
+"aZ c #2c327b",
+"a0 c #3c3f7d",
+"a1 c #9c95c6",
+"a2 c #948274",
+"a3 c #e4c70a",
+"a4 c #e4b94d",
+"a5 c #b4b1c7",
+"a6 c #fcfcd2",
+"a7 c #fcda4b",
+"a8 c #f4dacc",
+"a9 c #e4bf6c",
+"b. c #b4b0db",
+"b# c #fce0ae",
+"ba c #2c2a81",
+"bb c #fcdc38",
+"bc c #d4cf51",
+"bd c #393750",
+"be c #eec24e",
+"bf c #fbf1cd",
+"bg c #cfd0e0",
+"bh c #9594af",
+"bi c #35294c",
+"bj c #cab52c",
+"bk c #e1cf37",
+"bl c #c4c8e8",
+"bm c #2c1e64",
+"bn c #e0d978",
+"bo c #544a86",
+"bp c #6d67ad",
+"bq c #29283c",
+"br c #d2d0f3",
+"bs c #8684a7",
+"bt c #36398e",
+"bu c #443d5b",
+"bv c #fce891",
+"bw c #e4ae12",
+"bx c #e4c969",
+"by c #e4ab24",
+"bz c #fce8a9",
+"bA c #e4c04a",
+"bB c #fcd24c",
+"bC c #fcca2c",
+"bD c #e4d071",
+"bE c #fccf6f",
+"bF c #ccc2f4",
+"bG c #fcd22c",
+"bH c #3c2a34",
+"bI c #443d6c",
+"bJ c #242e90",
+"bK c #626089",
+"bL c #dad8f9",
+"bM c #9c9ad6",
+"bN c #2c378d",
+"bO c #2c2252",
+"bP c #fcef95",
+"bQ c #2c3068",
+"bR c #2c284f",
+"bS c #f7d5a1",
+"bT c #241a4e",
+"bU c #e4d6a4",
+"bV c #6466ad",
+"bW c #2c366a",
+"bX c #dcce14",
+"bY c #daba4a",
+"bZ c #acb2c8",
+"b0 c #edb60c",
+"b1 c #f2fed7",
+/* pixels */
+"#F#d#d#paA#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#d#S#k#k#k#k#k#k#k#W#k#k#H#qbGa7#z#k#W#k#k#k.Z#k.pa7.gbb.Z#k#k#k#W#k#k#k#k#k#k#k#kas.paX.pbE#k#W#k#k.Z#k#k#k#k#W#k#k.Z.ZasasbbbG.8#Y#NbCa7agas#k.Z#kb1b1#ka6.pa7aJasa6#k.Z#W#W#k.Z#k.Za6#DbBaJ#g#q#qaz",
+".Q#l.MaZ#3aZ.o.o.obQaZbQaZ.oaZ.oaZ.o.o.o.o.o.o.oaZ.oaZaZ.oaZ.o.o.o.oaZ.o.oaZ.oaZ.oaZ.o.o.oaZ.oaZ.oaZ.oaZ.o.o.o.o.oaZ.oaZ.oaZ.o.o.o.o.oaZ.oaZ.oaZaZ.o.o.o.o.o.oaZ.o.oaZ.obQbQ.obQbJbQbQ#k#k#k#k.Z#k#k#W#kbf#E.r.f#6.ia6#k#ka6#k#k#k#6#v.ra3#y#k#k#k#W#k#k#k#k#k#k#k.u#5.E#g#g#E#k#k#k#k.Z#ka6#k#k#k#k#k#k#k#5#c#o#o.8.8#Y#f#obAbz#y#k#kb1b1a6bfbA#g.EbP#k#k#W#k#k#k#k#k#kaHbA#g#g#o.r#e.E",
+"bVbQ#t#t.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZbQ#k.Z#k#k.Z#k#k#W#k#k.E#f#f.r#Ea6#k#k#k#k#Wa6#6.r.r.r#y.Z#k#W#k#k#k#k#k#k#k#k.U#H#E.r#v#Ea6#W#k#k#k#k#k#k#k#k#ka6asbP###o.r#f#Y#f#f.r#o#E.5.u#k#k#k#W#k#D.i.r#EbP#k#k#k#W#k#k#ka6as#E#o#f#f#fa3.#.r",
+"bVbQbQaZ#3aZaZ.o.oaZbQbaaZbQaZaZbQaZbQaZaZbQaZaZbQaZaZaZaZaZaZaZaZaZaZaZbQaZaZbQaZaZbQaZaZaZaZbQaZaZbQaZaZbQaZaZaZaZaZaZaZaZaZaZaZbQaZaZbQaZaZbQaZbQaZaZbQaZaZbQaZaZaZaZaZbQaZbaaZaZbQ#k#k#k#k#k#k#k#W#k.u#o.r.8#f.rbv#k#k#k#ka6as.8#Y#f.r.u#k#k#W#k#k#k#k#k#k.Z#k#j.rb0.f.8.8#5#k#k#k#k#k#k#k#k#k#kaz#o#K#K.r.E#EbYbY#E.O.Oaeasa6#k#k#k#W#kas.E.r.r#D#k#k#k#k#ka6a6#a.r#f#o#Y.r#g#g.r.E",
+"#A.L.L#0aZaZ#saZaZ#t#0#s#s#saZ#saZ#s#saZ#saZaZaZ#saZ#saZaZaZaZ#s#saZaZaZaZ#saZ#saZ#saZ#saZaZ#saZaZaZ#saZ#saZaZaZaZ#s#saZaZaZaZ#saZ#saZaZaZ#saZ#s#saZ#saZ#saZ#saZaZaZ#saZ#0aZaZ#saZ#sbQ#k#k#k#k#k#k#k#W#ka6.r.8.8.8#f#aa6#k#k#ka6#a#f#Y#f#fbfa6#k#W#k#k#k#k#k#k#k#k#H#o.8#Y#f.8#aa6#k#k#k#ka6#k#k#ka6#L#o#f.r#E#B#jasasbPbvaz#1b1#k#k#k#k#k.Z#D#K#K.r#D#k#k#k#k#k#k#5.i#f#o#E.yazbPbPbv#a",
+"bV#l.LaZ.oaZ.oaZ.obQaZbaaZ.oaZ.obaaZaZ.oaZ.oaZ.oba.oaZaZaZaZaZ.oaZ.oaZ.o.oaZaZbaaZaZaZ.oaZaZ.oba.oaZaZaZaZ.o.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZ.oaZ.obaaZaZ.oaZ.oaZ.oba.o.oaZaZbQaZaZbJaZ.o#X.Z#k#k#k#k#k#k#k#kas.r.8#f#f.r.Ebf#k#k#kas#c.8.8#4#fbf#k#k#k#k#k#k#k#k#k#k#kaqb0.8.8#Y#f#L#k#k#k#k#k#k#k#k.ubz.O.H.8.EaHa6a6#k#ka6a6asasb1#k#k.Z#k.Z#k#D#La3.##D#k#k#k#k#ka6#c.O#fbA#aa6a6a6a6a6a6",
+"bVbQ.L#0.oaZ.oaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#ka6bv#f#f#Y.ra3.r.q#k#ka6aN.r.8#Ybw#Y#ja6.Z#k#k#k#k#k#k#k#ka6#fb0.nazbb.f#oa6#k#y#k#k#k#k#kbz#c#f.H.f#D.u.Z#k#W#k.Z.Z#k#k#k#W#k#k#k#k.Zbf.E#K#KbP.Z#k#k#k.Zas.E#f#f#Da6#k.Z#k#k#k#k",
+"bp#laZ.L.oaZaZaZaZaZbQaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZbQaZaZaZaZbQ#k#k#k#k#k#k#k#k.u#5#f#f.H.ra3#6a9#k#ka6##.r#f#v#Y#f#aa6.Z#k#k#k#k#k#k#k#kas#f.8.nagaX#o#obf#k.Z#k#k#k#k#k#5#La3.8#obf.Z.Z#W#W#W#k#y#k#k#k#W#k#k#k#k#kas.r#f#KbP#k#k#k#k.u#D#f#f.ra6a6#W#W#W#k#k#k",
+"bpaZbQ#t.o#saZaZaZaZaZaZaZ#saZ#saZaZaZ#saZ#saZ#saZ#saZaZaZaZaZ#saZ#saZ#s#saZaZaZaZaZaZ#saZaZ#saZ#saZaZaZaZ#s#saZ#saZ#saZaZaZaZaZ#saZ#saZ#saZ#saZaZaZ#saZ#saZ#saZ#s#saZaZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#ka6#Ba3#oagbk.r#o#g#k#k#z.Pb0#Eag.Eb0#Bas#k#k#k#k#k#k#k#ka6#c#Y.8#6a6as#c#YbDa6#k#k#k#k#k#k#B.r#f.r.p.Z#y.Z#W#W#W#k#k#k.Z#k#k#k#k#k#k.Zas.E#f.rbP#k#k#k#k.u#z#Y.8#fa6#k#k#k#k#k#k#k",
+"#AbaaZaZaZaZaZaZaZaZbabQaZaZaZaZaZ.o.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZaZ.oaZaZaZaZ.oaZ.o.oaZ.oaZaZaZaZaZaZaZ.oaZ.oaZ.oaZaZaZaZ#s.oaZbQaZaZaZaZbQ#k#k#k#k#k#k#k#kbfat.r#oasag.E#f#fa6a6#g.nb0#Has.i#f.E#D#k#k#k#k#k#k#k#k#Uat#Y#6aH#k#k.S.8at#a#k#ka6#k#k#k.r#f#Y.E#a#k#y#k#k#k#kbzaNbD.q.S#k#k#k#k#k#kbf#o#f#g.B#k#W#k#ka6#B#f.8#Y.Z#k#k#k#k.Z.Z#k",
+"#AbabQ#0.oaZaZaZaZaZaZaZaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZbQaZaZaZaZbQ#k#k#k#k#k#k#k#k.S#E.r#oasa6.j.H.rasas.f#4b0asas.0#f.Eb#.u#k#k#k#k#k#ka6#e#e#g.Ras.Z#ka6#f.#at#D.ua6#k#k#k.O.Hbw.E.Ia6#k#k#k#k#k.J#L.r.E.Ja6#k#k#k#k#kas#E#Y.E.B#k#W#W#ka6#c.8#f.r#k#k#W#W#k#k#k#k",
+"bVbQ.L#0.oaZ.o#saZaZaZaZaZaZ#s.o#saZaZ.oaZ.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZ.o.oaZaZaZaZaZaZ.oaZaZ.oaZ.oaZaZaZaZ.o.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZ.oaZ.oaZaZaZ.oaZ.oaZ.oaZ.o.oaZaZaZaZaZaZaZaZbQ#k#k#k#k#kb1a6#k#j#E#f.rbfa6.e.H.r.Bbv#f.8#oa6.u.N.E#EaHa6#k#k#k#k#k#ka6#b.##E#zas#k#k#k.O#K#L.6#k.Z#k#W#kaq#fb0#e#B#k#y#k.Z#k.Zao.r.##Eaoa6#k#k#k#ka6as#E#f.r.B#k#W#W#ka6#c.8b0#oa6.Z#k#W#k#k.Z#k",
+"bV#l.L#saZaZ#saZaZaZaZaZaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ.o#sbQ#saZaZaZaZbQ#k#k#k#k#k#ka6#kbx#o#f#o#ka6a6#f#f#N#N#f#K.E.u.Z.J#e#o#cas#k#k#k#W#k#kaz#o#Y#Y#g#gat.E.E#o#f#f#ga6#k#k#W#k#a.rb0#f.ra6#k#k#W#k#kaH.O.r#oaoa6#k#k#k#ka6as#E#f.r#D#k#W#W#Wa6#jb0#fa3a6#k#k#W#k#k#k#k",
+"#A.LbQ.L.oaZaZaZaZaZaZaZaZaZaZaZaZ.o.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZ.oaZ.oaZaZaZaZaZ.oaZ.oaZaZ.oaZaZaZaZ.oaZ.o.oaZ.oaZaZaZaZaZaZaZ.oaZ.oaZ.oaZaZaZaZaZaZaZaZaZ.oaZaZbQ#k#k#k#k#k#k#k#k###o#f#6#k#ka6.r.r#Y#v#K.r#cbf#k.e.r#obA#D#k#k#W#Wa6#kbBb0.8.8.8#K#K#K.#.8.8#f#fa6#k#k#k.Zbv.i.8.8#Y#Da6#k#W.Z#k#a.E#f#oaoa6#k#k#k#ka6as.E#f#f#D#k#k#W#ka6bv#f#f.##Da6#k#W#k#k.Z#W",
+"bVbQ.L#0.oaZ.oaZaZaZbQaZaZ.oaZaZaZ#s#saZ#saZ#saZaZaZaZaZ#saZ#saZ#saZaZaZaZaZ#saZ#saZ#saZ#saZaZaZaZaZ#saZ#saZaZ#saZaZaZaZ#saZ#s#saZ#saZaZaZaZaZaZaZ#saZ#saZ#saZaZaZaZaZaZaZbQaZaZaZaZbQ#k#k#k#k#k#k#k#k#E#f.ra4.Z#ka6aq.rbw.8.r.r#1#k#kbP.r.r.Eb##y#k#W#k#Wa6#6.8b0b0#o.r.#.##K.8.8b0#f#Da6#k#k#k#D###f.8.n#z#Da6#k#k#kao#E#f#oaoa6#k#k#k#k#kas#o#f#f#D#k#W#k#Wa6#D.r.r#f#a#D#k#k#k#k#k#W",
+"#AbQ.LaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZbQ.oaZ#I.oaZ.oaZaZaZaZ.obQaZ#IaZ.oaZ.oaZaZaZ.obQ.oaZ#IaZ.oaZbQaZaZaZ.obQ.oaZ#IaZaZbQaZaZ#IaZ.obQ.o#IaZaZaZbQaZaZ#IaZaZaZ#sbQ#saZaZaZaZbQ.Z#k#k#k#k#k#k#y.r#f#f.6#k#ka6.J#e#4b0.r#Bas#k#kas#v#fatbD#y#k#W#k.Za6#o#f#f.B#Dasasa6asbvb0.n.8bxas#k#k#ka6bv.##fb0#oaq.Jbvas#D#H#g#f#oaoa6#k#k#k#k#k.B#E#f#fbz#k#k#k#k#ka6###K#f.f#g#zbzas.BbPbD",
+"#AbaaZ#t.oaZaZ.obaaZaZbQaZ.oaZaZaZaZaZaZaZaZaZaZ#saZ#s#saZ#saZaZaZaZ#saZaZ#saZ#saZ#saZaZaZ#saZ#saZ#saZ#saZaZaZaZaZ#saZ#saZ#saZaZaZaZaZ#saZ#saZ#s#saZaZaZaZaZaZ#saZaZaZaZaZbQaZaZaZaZbQ#k#k#k#k#W#k#k#k.r.H#g#z#k#k#k.e#b#4b0.r.Ia6#k#ka6be#f.rbD#k#k#k#k#y#D.r#o.Ea6a6#k#ka6#kas#6#Y.8#Easa6#k#k#ka6#b#o.8#f.r#E#ca9.i.r.r.H.EaNa6#W#k#k#ka6as.E#f#f#D#k#k#k#k#k#k.N#L#Y#Y#f.Pbe#v#g#gab",
+"bVbQ.L#0#3aZaZ#saZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ#saZ#s#saZ#saZaZaZaZ#saZaZ#saZ#saZ#saZaZaZ#saZ#saZ#saZ#saZaZaZaZaZ#saZ#saZ#saZaZaZaZaZ#saZ#saZ#s#saZaZaZaZaZaZ#saZaZaZ.oaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#kat.E.0.e#k#k#k#k#C#E#EaNa6#k#k#k#kb##Latae#k#k#k#k#k.0.E##.e#k#y#k#k#k#k#kaH#E#Eamae.5#k.Z#k#k#ka6as.Iaq#6arby#E.E#K#b#a.U#k#k#k#k#k#kbf.0ataebz#k#k#k#k#k#k#ka6asbcatatat.E.r#obA",
+"#A.LbQ.L.oaZ.oaZbaaZbQaZaZ.oaZaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ#sbQaZ.obaaZbQ#k#k#k#k#k#k.Z.Z.J.J.eas#ka6#k#ka6az#a.Ua6#k#k#k#kbfazaz.J#k#k.Z#k#k.J#z#5bf#k#y#k#k#k#k#kbP#a.J.J.Jbf.Z#k#k#k#ka6#kas#DbE.6.6bEazbvaga6a6#k#k#k#k#k#ka6bU.J#5a6.u#k#k#k#k.Z#k#k#k#C#Cbn#1#a.y.ybP",
+"bpbQaZ#0.7aZ.oaZaZbQaZaZaZaZaZ#saZaZaZ#saZ#saZ#saZ#saZaZaZaZaZ#saZ#saZ#s#saZaZaZaZaZaZ#saZaZ#saZ#saZaZaZaZ#s#saZ#saZ#saZaZaZaZaZ#saZ#saZ#saZ#saZaZaZ#saZ#saZ#saZ#saZaZaZ#sbQaZaZbJaZbQ#k#k#k#kb1#k#k#ka6#k#k#k#k#k#k#y#ka6#k#k#k#k#k#k#k.Za6a6#k.Z.Z#k#k#k.Z.Z#k#k#k#k#k#k#k.Z#k#k#k.Za6a6#k#k#k#k#k#k#k#k#k#k#ka6#ka6#k#k#k#k#k#W#k.Z#k#k#k#k#ka6#k#k#k#k#k#k#k#k#k.Z.Z#k#k#k#k#k.u#k#k",
+"#AbQ.LaZbQaZaZaZ#saZbQaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZbQaZaZaZaZaZaZaZaZaZaZbQ#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k.Z#k#k#k.Z#y#k#k#k#k#W#k#k#k#k#k#k#ka6#k.Z#k.Z#W#W#Wa6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#W#W#k#k#k#k#k#k#k#W#k.Z.Z#k#W#k#k.Z#k#k#k.Z#k#ka6#k#k#k#k#k#k#k#k#y#k#k#k",
+"bV.9.L.L.oaZaZaZaZaZaZaZbQaZaZaZaZaZaZaZaZ#saZaZaZaZaZaZaZaZaZaZbaaZbaaZaZaZ#s.o#s.o#s#s#s#saZ.o#saZaZaZaZaZbaaZaZ#saZaZaZaZaZ#3#s.o#I#3#0aZ#saZaZ#s#saQaZaZaZbQbQaZbQaZaZaZaZ.oaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#W#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bpbQbQ#0.oaZ.oaZaZaZbQaZaZaZaZaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZbabNbaaZaZaQ#saZ#s.o#saQ#saZaZ.7aZ.7baaZba#sbaaZ.7#t#sbaba.o#s.o#sbt.zba.o#taZbQ#s#saZ#saZaQaZaZaZaZ.LaZbQaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQ.L.L.oaZaZ#saZaZaZaZaZ.o#saZaZ#s#saZaZaZ#saZ.oaZ.o.o#s.o#saZaZaZaZ#s.oaZaZ.oaZ#s#s.oaZaZ#s#saZaZ#0aZ.LaZaZaZ.L#0#s.LaZaZ#0#0.oaZaZ.7.oba#saZaZaZaZ.o#saZaZaZbQaZ.9aZaZaZaZaZbJaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQ.LaZaZaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ.oaZaQbWaQ.oaZaZaZbNaZaZaZaZ#0#0#0#0#3.9.9.9bQbQbQ#X#X#XbQ#X.9#XbW#XbQ.9#0bWbQaZbaaZaZbJ#saZaZaZaZaZaZaZ.LaZaZaZaZ.oaZaZbQ.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#AbQ.L#0.oaZaZ.oaZaZaZbQaZaZaZaZaZaZaZaZaZaZaZ#saZaZaZaZaZaZaZaZaQbWaQ.obJaZbNba#s#sbQ#0aZ.9#S.h#rbr#y#k#k#y.Z.Z#k.Z.Z.Z#k#k#k#k#k#r.T#Q#3#XaZ#3aZbJaZbNbaaZaZaZaZaZaZbQaZ#saZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bV.9.L#t.oaZ#saZaZaZbQba#saZ.oaZaZaZ#I#s.o#s.oaZaZ#saZaZ#IaZ#saZ#3#s#sbJ#taZaZ#X#I#XaU.Tbr#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#J#Q#X#3#I#3aZ#3bNaZbaaZaZaZaZbQ#saZ.oaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#AbaaZ#sbQaZ.oaZaZbQaZaZaZ#saZ.oaZaZaZaZaZaZ#saZaZaZaZaZ#saZaZ#sbaaZbJbt#sbabQ#3#X.4.m.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#J#WaPaU#XaA.oaA.7bNaZaZaZ#s#IaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#A#l.LaZaZaZaZaZaZaZaZaZaZ.oaZaZ#s.o.oaZ.oaZ.oaZ#saZ#saZ.oaZ.oaZba#taZ.L#paS#T#k#k#k#k#k#k#k#k#k#k#k#k#ka6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#Jbg.k.dbQ.Y#0#3baaZaZ.o#s#sbQaZaZ.oaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQ.L#0#3aZaZaZaZaZaZbQaZaZaZbQaZaZaZaZaZ#saZaZaZaZaZaZaZaZaZaZ#3#0.LbQ.m#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#W#Z#uaQbQ#s.oba.o#saZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bpbQbQ#0.oaZ.oaZaZbaaZaZaZaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ#0#l#PbZ#k.Z#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#JaA#3#s#0.oaZ#s.o#saZbQaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#AbQbQ.L.oaZ.o#saZaZ.LaZaZaZ.oaZaZaZaZaZ#saZ#s.oaZaZaZaZaZaZ#XbQaP#M#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#Jbh#3#0bQaZbN.o#s#sbQaZaZ.oaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bV.9.L#t.oaZaZaZaZaZaZaZaZaZaZaZaZ.oaQaZ#I#s.o#I#s.o.o#l#0.d#X#F#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#W#W#k#k#k#k#W#W#W#k#k#ka6#y#k#k#J#k#PbW#sbN.oaZ#saZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k.Z#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQ.L.L.oaZaZaZaZaZaZaZbaaZaZaZaZaZ.oaZaZ#s.o#3aZaZbQ.Y#w#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#W#W#k#y.Z#k.Z#ka6#k#k.u.Naea6aY#y#k#W.X#IbWaZbaaZaZbQ#saZaZaZaZbQ.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k.u#k#k.Z#k#k#k#k#k#k#k#k#k#k.Z.Z#k#k#k#k#k#k#k#k#k#k#k.uaY#k#k#k#k#k#k#k#k.Z#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#ka6#ka6#k",
+"bVbQ.L#0#3aZaZaZaZaZaZaZaZaZ.oaZaZaZaZaZ.oaZ.7#t.z.Ya0#M#k#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ka6a6as#j#5#Dbf.Basasbfbz#KbX.u.Z#k#k.Z#W.4bWaZaZaZaZaZbQaZaZaZaZbQ#k#k#k#k#k.Z#k#k#y.2aY#k#k#k.FbL#k#k#k.Z#k#k#k.Fbs.C#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#kbl#h#k#k#kbL#y#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#y.3bI#y#k#k#k#k#k#k#k#k#k#k#k#k.Z#i.l#k#k#k#k",
+"bpba.L#sbQaZaZ#saZaZbaaZaZaZaZaZaZbababNaZ.Lbt#0#ub.#W#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#k#k#kas#U.E#E#o.r#K#K#K.E#6#6.r#Ka6a6#k.Z#k.Z#k.4aZbJbQaZaZbQaZ.o#saZbQ#k#k#k#k#k#k#k#k.l.9#Sau#k.x.9#XbL#k#k.Z#k#k#k.x.h#V#k#k#k#k#k#k#k#y#k#k#k#k#k#kaY.Y#l#x#k.hbi#r#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#y#k#k.Z#k#k#k#k#mbT#k.Z#k#k#k#k#k#k#k#k#k.Z.Z#kaD#i#k#k#k#y",
+"#AbQbQ.L.oba.oaZaZaZ#saZaZaZ.oaZbaaZbaaZ#tbQ#l#X.k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#k#k#k#k#C#b.O#v#g.##e#e.E.r.E#E.Eata6a6#k#k.Z#W.Z.Z#0babJaZaZaZaZaZaZaZbQ#k#k#k#k#k.Z#k.Z.cbObmaI.ZaK.9bR#h.F.x.la5.m#k#yb..ZaY.F.lbr#y.ZbgbF.2.Z#k#k#k.maI.L#taCaY#O.9#ibL#y.F#y.2au#yav.xaY#k#kbgav#y#k#k.Fb.a5.Z#kbF.X.xbL.Z.3bOau.xbg#k#kbga5#V#y.Zbg#..x#yb.bL#k.ZbL.l",
+"#AbaaZ#t.oaZ.oaZaZaZaZaZaZaZaZaZaZbtbt.Y#l#ua5#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#y#k#Cat.rbEasa6a6a6a6a6asasbf#k#ka6#k#k#k#k#k#W#XaZbaaZaZbQaZaZaZaZbQ#k#k#k#k#k#k#k#k.W.GaR.Vb.#Xbo.Ybs.k.T.v.V.A#JaI.9bL#Xbu#w.9.G#k.3.G#O.Z#ka6.Z#MbIbM#2.M.C.h.M#Ab.#k.bbO.TbObO.W.Yan.Z#i#Xap.G.4aM#XbK#r#J#k.K#i#Xai#k#m.MaCaKbmaYbo.9a1#O...Z.W.MaW.ZbmaKbF.K.9aW",
+"bVbQ.L#0#IaZaZ#saZaZbQaZaZaZaZaZaZ.Y#l#0.V#Q#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z.Z#kas###Lbeas.Z#k#ka6a6a6#k#k#k#W#W#k#k#k#k#k#k#QaZbabtaZaZaZaZbaaZbQ.Z#k#k#k#k#k#k.ZaD.9.LbmaK.Y#F.YbK.Z.Z.m.V.d#k#.bIau#uav#k.Q.M#kbs#lbL#k#k#k.Z.X.d.ZbM#t#kaWbR#Z#k#k.h.W#y#X.T#.bI.9br.9#r#k#lbp.1#Xa1#k#k#y.M.ZaK#P.Zbs.LaVaubi#ybmaCaV#2.9#y#A.KaY#k.MaK#i.KaU#k",
+"#A#l.LaZaZaZaZaZaZaZaZaZaZaZaZaZaZ#0bQ#X.h.m#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#ka6#B.r#obP#k.Z#k#k#k#k#k.Z#k#W#W#k#k#k#k#k#kaS#0.obtaZaZaZaZ.oaZbQ#k#k#k#k#k#k#k.Z.9.9aC#l.h#ubl.K.hbL#F.Vbm.d#kaI.L#M.GbL#k#F.M#k#i#l#k#k#k#k#kbK.daYb.#X#kaO#lbMaY#y.W.v#y.L#.aI.M#X#r.9#h.ZaR#AaW.M.9bM#k#kbO.Zbs.9#k#m.L.Z#k#X.Z.M.V.9#lbO.Z#w#l#k#k.K#A.k.K#i#y",
+"bpbQbQ.L.oaZ.oaZaZbaaZbNaZaZbaaZbabQ.d.k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ka6asa4.rbk#k#k#k#W#W#k#k#k#k.Z#k#k#k#k#k#k#k#kbQaZ#saZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#l#SaV.G#ubK#W#3#X#X#dbL#d#X#W#.#XbL#u.3aYbo#l#k#m#u#k#k#k#k.v#u.VaD#Q.hbF#A.s#i.Z#k.ha1.ZbRbLb.#X.9brbmaVbL.sa1#k.Zbr#uaW#kaRbL.W#u.Zbh.s#y#k.1#k#u#SaY#y#y#y#w.9.Z#kbRaKaT.9#Xau",
+"bpba.L#t.oaZaZ#saZaZaZaZbJbJaZaZaZa0.X.Z#k#k#k#k#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.ubE.r.E#k#k#k#W#W#k#k#k#k#k#k#k#k#k#k#k#k#kbQ.o#saZbQaZ.oaZaZbQ#k#k#k#k#ka6#k#k.KbKaY#d.9#r#W#X.AbQ.s.Gbaa0.ZaI#X#M.L.K.A.s#A#k.c#u#k#k#k#k.hbQ#i#W#kbr.T#A.LaC#i#kbK.3#kbd.F#R.9#l.Zbp#X#O.QbL.tbo#pa0av#kbm.V#u#p#k.3.s#y#k.1.Z#S.9#l.Q#u#k.Q#u#k#k#u.kaI#X.L.9",
+"bpbQbQ.L.oaZ.oaZaZaZ.o.Y.oaA.sbt.s#F#k#k#k.Z#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#k#k#k#k#k#k#k#ka6a6.E.Ea6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.9aZbQaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z.Z.Z.ZaYb..9.C#k.Z#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#y#k#k#k#k#k#k#k#ybO.Z#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#y",
+"bVbQ.L#0.oaZaZ#saZaZaZ.zaQbN#3aF.Tau#y#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ka6#W#k#k#k#k.Z#y.Z#k#k#k#ka6#E.ra6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kbWbQaZbQaZaZ.oaZaZbQ.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#Obi.t.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ybR#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQ.9#t#IaZaZaZaZaZaZ#3.z#0.Y#J.Z#yaR.9#P#X#X#SbKbhb.aY.Z.Z#k#k#k#k#W.Z#k.Z#k#k#k#k#k#k#k#k#k#k#k.Z.Za6#k.u#k#k#k#k#k#ka6#b.#as#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kbWbQ#saZbQaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kaY#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#AbQba.LaZaZ.o#saZaZaZ#0#0bQaC#k#kbl#l.s.d#X.9bQbQbQ#X#Q.TaP#.#M.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kasasbf.ua6a6a6#k.ua6bk.#bf#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kbQaZaZbQaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#y#y#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#AbaaZ#taZ#saZ#saZaZ.L.LaC.k#k#k.k#lbabaaZ#0aZbQ#3aZ.LaZbQbQaZbQ.9bWbWbQ.Q#xbhbL.Z#k#k#k#k#k#k#k#ka6.Sbj.O#E#6#f.r.r#o#o#g#4#obf#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#I#0.7aZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bV.9.L#s#IbabJbt#3.LaZaR#l#J#JaSbQbWbabNbaaZaZbaaZaZaZaZaZaZaZaZbQbQ.9bQbQbQ#X#P.t#k.Z.Z#k#k#k#k#ka6aE.#.f#f#6#f.r#K.r#o#f#oby#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.9#IbQaZaZaZaZaZaZbQ.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bp#lbQ#tbQaZ.o#saZ.o.L#0#l#y#WbWbW.LaZbababNaZaZaZbaaZaZaZaZaZaZ.LaZaZaZ.9bQbQbQbWbl#W#W#k#k#ka6#ka6aEa3.r#N.E.E.E#e.#.E.E.ia4#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#X#3aZaZbQaZaZ.oaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bp.MaZ.L.oaZbN.7aZaZ.L#lbF#Jbda0aZaZ.oaZbabNaZbJaZ.obaaZbNbaaZ.oaZaZbababa.LaZaZa0.Y#X.l#k#ka6#k#k#k.q#f#vaX.u#k#k#k#ka6a6a6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#0bQaZaZbQaZbJaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bpbQbQ.L.oaZaZ.o#3bt#Xbl#kbQbQ.s#s#s.obWaZaZ.oaZaZaZaZaZaZ.oaZaZ#s.o#saZaZ#3btbQ.7aZa0#Pbs#k.u#k#k#k#D.Eb0be#k.Z.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.9aZaZaZaZaZaZbJaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#A#laZ#t.oaZaZ.o#3#laI#k#kbmba.sbtaZbWaZ#sbQbQaZbQbQaZaZbQaZaZaZ#I#s.oaZaZ#taZ.L#3.z.7.Y.L#x#W.Z#ka6as#g.8.E#k#ka6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.daZaZbQaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQaZ#s.o#sbt.7aZ#u.Z#k.ZbQ#l.7bN.oaZ#IaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaQaZba#taZbQbWaQ.o#0.dbl#k#k#ka6at#f.ra6#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kbQ#0aZaZaZaZ.oaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQaZ#s.o#saZaZbQ.W#k#k#k.V.LbabNaZ#s.o.obNaZaZaZaZaZaZaZaZaZaZaZaZba#saZ#t.L.9aZ.oaZbNba.L.M.V#y#ka6#j.faqa6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ka6#k#k#kbQ#sbQaZaZaZaZ.oaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ka6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bpbQbQ#s.oaZbJbabQ#m#k#k#k.Q.LaZ#taZbW#saZbaaZaZ.oaZ.o.oaZaZaZaZaZbQbN#sbQaZaZ#0bababJaZ#t.LaCbm#m.Z#kbzbk#oa6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kbWbQ.o#sbQaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ka6#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQaZ#s.o#s#saZ.L#h#k#k#k#Z#lbabt.oaZ.oaZaZaZaZ#saZaZaZaZaZaZaZaZaZbaaZaZ.LbWbQ#taRba.o#IbQba#t.V.4.Zbf##.ras#k#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#0#IaZaZaZaZ.oaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#ka6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bpbQ.L#s.oaZaZaZ#0#k#k#k#k#y#p.L.oaZaZaZaZaZ.oaZaZ#saZaZaZ.o#saZaZaZaZaZaZ#sbQbQaR.9#X#l.K.d.L.s#XbOaia8bPat#j#k#k#k#k#k#ka6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#X.o#saZaZaZaZaZaZbQ.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbaaZ#0.oaZba.z.9.Z.Z#k#k#k#A#0.YaZaZ#saZaZaZaZaZaZaZaZ.oaZaZaZaZaZaZ.LaZaZ#s#lbaaGaca.a2ajawaw#9#9aha##a.rao.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#0#3aZaZbQaZaZbaaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bpba.LaZ.oaZaZbQaO#k#k.Z#k#k#k#XbQbQaZaZ.LaZaZaZaZaZaZaZaZ.o#saZaZaZaZ#XbNbN.7babIaebX#f#gaL#L#L.EbY.Ra4a4#E.U#yaY#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#.#sbQaZaZaZaZaZbaaZbQ#k#k#k#k#k#k#y#k#kaYbK#O#O.ha5#k#k#k#k#k#k#k#k.Z.Z#y.Z#k#k#W#k#k.Z#k#k.Z#k#y.Z#k#k#k#k.Z#k.Z#k#k#k#k#k#k#k#k#kaTaM#R#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k.l.d.1#k.Z#k.Z.Z#k.Z#k#k#k#k#k.Z",
+"bV.MbQ#0bQaZaZbQ.v#k#k#k#k#k#kbQ.LaZbaaZbQaZaZ.oaZbQaZaZaZaZaZaZ.oaZbQ.9babNbJba.9.j.##f#n#7ad#7af#8#8aBaBay.x#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kaS.L.oaZaZbQaZaZ.oaZbQ#k#k#k#ka6#k.Z#kbL#AbT.Mbi.Mbh#k#kaY#k#k.u#k#k#k#k#k.Z#y#k#k#k#k#k#k#k#k#k.Z#k#W#k#k.Z#k#k#k#k.Z#k#k#k#k#k#k#kaGbqbh#k#k#k.Z.Z#k#k#k#k#k.u#y#k#k#k#k#k#k#k#k#k#y#ka5.A#X#k#k#k#k#k#k#k#k#k#k#k#k.Z",
+".Qba.L#0bQaZ#sbQbr#k#ka6#k#k.ZaUbQ.LaZba.LaZaZaZaZaZaZaZaZaZaZaZ.oaZaZaRbJaQ.o#t.Mamaqaqak.L#0aZ#t.L.K.L#tba#t.T.m.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#S#taZaZaZaZaZ.oaZaZbQ#k#k#k#k#k#k#k#ybibu#y.Z#k#k#k#y#k.9.1aT.Z#kbhbO#2.9#r.W#XaM#y#k#M#S.WbO#Zbs.1.b.l#y.Z#w.d#G.F#k.Z#k#k#k#k#k#k.b.K.X.Z.X#X#w.W.XbWbR.W#k#k#k.Kbi#iaY#kaYbs.A.d#SbhbL#XbI#k#k.K#S.V.hbr.Z#y.t.Kbibd",
+"bpba.9.L.oaZbQ#0#y#k#k#k#k#k#k#A#lbQba#tbQaZaZaZaZ#saZaZaZaZ.oaZ#s.o.LaR.oaQaQ#saRax#L#eakbm.obJ#t.9.9.dbJbJbJ#3#G.m#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.9aZaZaZaZbQaZaZaZaZbQ#k#k#k#k#k#k#k#kbqaD.Z#k.Z#y#k#k#JaKaObdbg#kaSbRbm#2.9#l.W.d.X#k#k.VaUaAa0#laUbR.b#k.Z.t.k.1#r#k.Z#k#k#k#k#k#kbu.dbh#W#T#P#X.dbQ#2.d#X#y#k#y.bbTbI#.aY#rbIaW#w.9.Dbr.9#l#y#k#PbI.9#ua1#k#ybq#w#x#l",
+"bVba.LaZ.oaZ#s.Y.Z.Z#k#k#k#k#kbL#3bQ#0ba#0.oaZaZ.oaZaZaZaZaZaZaZaZaZaZaZ#saZaQ#saZaU.b#wbWaZaZaZ#saZbWaZaZ.oba.o#I#XbL#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ka0#t#s.obQaZaZaZaZaZbQ#k#k#k#k#k#k.Z#k#X#O.Z#yaKbibs.Z#kbpbo.9bh#kaSbRau#k#2#y#k#l#F.Z#y#X#.bF.9#..vbQ.b#k#k.Z.V#lbs#k.Z#k#k#k#k#k.ZaDbi#Z.ZaV.K#M.9bo#k.TbR.Z#k#ka1.G.K.X.ZaWbR#kaY#X#k#M.9.Y#k#k.Y#p#kbdap#k#..haY#k#l",
+"#AbQaZ#t.oaZ#X#P.Z.Z#k#k.Z#k#k.m.V.9aZba#s.oaZaZ#saZaZaZaZaZaZ#saZaZaZaZaZaZaZaZaZaZ.z#0.7aZaZ#saZaZaZaZaZaZ#sba.7aZbKb.#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#M.L#s#saZaZaZaZbaaZaZbQ#k#k#k#k#k#k#k#k.1.G.Z.Z.T#l#x#kbr.M#d#X.v.ZaS#X#y#y.Q.Z#k.M.v.Z#yaC#haI.9braS.d#S#k.m.Q#p.K#i.Z#k#k#k#k#k#k#yaD#X#Z.Z.4#X#J#X#p#k.T#X#k#kaubm#l#X.l#k#r.9#S.V#0.Zbg#X.L#J.Z.L.Q.ZbdaW.ZaY.Ya0#S#S",
+"bVbQ.L#saZaZaZbQ#k.Z#k#k#k#W#k.Z#A.9baaZaZaZaZaZaZ#I#saZ#IaZ.oaZaZaZaZaZaZaZaZ#saZ.obQ#3bQaZ.oaZ.oaZaZaZaZaZ.LaZba#3#P#w#k#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.XbQaZaZaZbQaZaZ.oaZaZbQ#k#k#k#k#k#k#k#k.MbibF.Z.TbO#Z#kaS#y#hbRbh#k.c#P#k#k#2.Z#kai#i#k#k.G.F#.bI#h#m.K.h#kb.#X#y.K#F#k#k#k#k#k#k#k#kbIbi.X#k.4#X#kbm.h#k#i#P#k#k#Z.T#XbRa1#kbF.V.h#A#.#k.F.d#l#k#k.9.Q#kbqaW.Z.Z.V#p.Q.X",
+"bVbQ.L#0.oaZbQbQ#k.Z#k#ka6#k#k#kbr.9aZba.7bNaZaZaZaZaZaZaZaZaZaZaZaZaZ.oaZaZaZaZ#s#saZaZbaaZaZ#saZaZ.oaZaZaZbababtaZaU.daP#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kbg#X.LaZaZaZaZaZaZaZ.oaZbQ#k#k#k#k#k#k.Z#kaYbhbq.K.KaD#r#k#V.Y.V.d.3#kalbq#y#k.W.Z#kbi#i#k#ybu.2#VaD#h.c.d.t#kbLaDaUbubh.Z#k#k#k#k#k#k#k.tbi#r#k.X.baYbR.W#k.cbq.Z.Zbg.daD.Aav#k#.bI.K.9.M.m.Fbd#X#k#kbd#2#k.1ap#k#y.Lbma0.Y",
+"bpbQaZ#t.oaZ.9#3.Z#k#k#k.Z#k#k#k.Z.h#taZ.o#saZaZaZaZ#saZ.oaZ.oaZ.oaZaZ#saZ#s#s.oaZ#saZ.oaZ#saZ#3aZaZ#saZaZaZaZaZaZ.LbQ#P#G#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z.X#PaZbabt#saZbQaZaZaZaZbQ#k#k#k#k#k#k#y#k#k#k#V.3#Vau#k#J#k.x.Zbg.m.Z#Mbg#k#kbL#k#k.2aY#k#kbF#k.Z.D.Z.m#Rbg.m.Z.Zau.xbL#k#k#k#k#k#k#k#k#R.2.m#k.Z.D#kbFbL#k.F.2#k#k#k#raY#R#M#k.v#X.Xb..Lau#W#Vbl#k#k#VbL#k#VaY#k#h.VbMa1a0",
+"bVbQ#t#0.oaZbQ#X#k#k#k#k#k#k#k#k#kaI.Y.L.z.oaZaZaZ.oaZ#saZ#saZ.oaZ.oaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZ.oaZaZaZaZaZaZaZbQ#X.d#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k.kbW#IaZaZaZaZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#yb.bKbibi#i#k.Z#k#k#k#k#k#k#k#k#k.Z.Z.V.K.d#Q",
+"#AbaaZ#t.7aZaZbQ#k#k#k#k#k#k#k#k#kaYa0a0bQaZ#s.obQaZaZaZaZaZaZaZaZ#saZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ#s#3#l#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#X#XbQaZaZaZbaaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.ZaY#Vbr#y#k#k#k#k#k#k#k#k#k#k#k#k.Z.F.xbl#k",
+"bpbaaZ#t.7aZ.9#I#k#k#k#k#k#k#k#k#k#k.9#3#0.oaZaZaZ#s.o.oaZ.oaZ#sbQaZ.oaZaZaZaZaZaZaZaZ.oaZaZ.oaZaZaZ#saZ#saZ#s#s.oaZaZbaa0aI#k#k#k#k#k#k#k#k#k#k#k#k#k.Z.Z#XaZ.o.oaZbaaZ#sbQaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQ.L#0.oaZaZ#3#J#k#k#k#k#k#k#k#k#k#Xa0bQ#0.oaZaZaZaZaZaZaZaZaZ#saZaZaZ#saZ.oaZ.oaZaZ#saZaZaZaZaZ.oaZaZaZaZaZ#saZaZ.7aZ#0.v#k#k#k#k#k#k#k#k#k#k#k#k#k#k#.bt.o#3#saZ#saZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k",
+"bpbaaZbt.7aZbQ#l#h#k#k#k#k#k#k#k#k#k.YbQ#0.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ#saZaZ#s.oaZaZaZaZaZaZ#saZaZaZaZaZaZ#s.oaZ#t#3#A#k#k#k#k#k#k#k#k#k#k#k#k#k#k#A.7aZbN.oaZbQaZaZbQaZaZ.oaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"#AbaaZ#tbQbaaZ#XaS#k#k#k#k#k#k#k#k#kaI#2#3aZaZ.oaZ.o#saZaZaZaZaZ#saZaZaZ.oaZaZaZ#saZaZaZaZaZaZaZaZaZ.oaZaZaZ#s#s#s.o.7btaZ#u#T#k#k#k#k#k#k#k#k#k#k#k#y#A#u#0.7.o#saZaZaZaZaZaZ.oaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQbQ#0.oaZaZba#S#k#k#k#k#k#k#k#k#k#kaY.1#X#3aZ#0aZaQ#saZaZ.L.LaZaZaZ.oaZaZaZaZaZ#saZaZaZaZaZaZaZaZaZaZaZ.o#s#s.o#saZ#0bQ#P.k#k#k#k#k#k#k#k#k#k#k#k#kaU#I#3#saZ#saZaZaZaZbQaZaZaZaZbQ.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"aObQaZ#0.oaZ#tbQ#X#y#k#k#k#k#k#k#k#k#k#kau#G#0bQ.o.o.7#saZaZaZ.LbaaZaZaZ#saZ.oaZ.oaZaZaZaZaZaZaZaZ.o#saZaZ.obN#s.oaZaZ#0bQa0bQ#k#k#k#k#k#k#k#k#k#k#kaV#3.zaZ#IaZaZaZaZbQbQaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"aObQaZ#0baaZ#0babQ.Z#k#k#k#k#k#k#k#k#k#k#k#k#ZaU#P#0aZbJaZbaaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ.oaZ.oaZaZaZaZaZ.o.o#s.o.o#0.7aZ#3#0#k#k#k#k#k#k#k#k.Z#y.v#PbWaQ.o#0aZaZaZaZaZbQ#saZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQaZ#0.oaZaZbabQ#r#k#k#k#k#k#k#k#k#k#k.Z#k#J#kbL.9#d.obNba#s.oaZaZ.oaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ#s.obN#s.o#sbJaZbaaZaZ#k#k#k#k#k#k#k#k#k#A.Y#X#3.oaZ#IaZaZaZaZaZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQaZ.LbQaZaZbabQaO#k#k#k#k#k#k#k#k.Z#k#k#k.Z.Z#kbKaFaZaZ#s.oaZ.oaZ#saZaZaZaZaZaZaZaZ.o#saZ.oaZ.oaZaZaZaZaZ#s#saZaZ.7btba#0.Y#k#k#k#k#k#k#k#k#k#l#X#sa0#saZbQ#saZaZaZaZbQaZbQbJaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bpbQaZ#0.oaZaZba#0bQ#k#k#k#y#k.Z#k#k#k#k#k#k#k#k#y#kbr.s#3.o.o.z.oaZaZaZaZ#saZaZaZaZ.oaZaZaZaZaZaZaZ#saZ.oaZaZbWaZaZaZaZbabaaZ#R#k#k#k#k#k#kaY#kbt.YaZaZaZbQaZaZaZaZaZaZ#sbQaZaZbJaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQ.LaZbQaZbJaZbtbQ#M#k#k#y#k.Z#k#k#k#k#k#k#k#k#k#k#k#X.Y#0#I.o#saZaZaZaZaZbQaZ.oaZaZaZaZ.oaZ.oaZbQaZaZ#saZ#saZbQaZaZbNbaaZaZ#G#k#k#k#k#k#k#k#..L.7aZaZaZaZ.obW#IaZaZaZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbaaZ#0.oaZ.obtaZ.z#F#k.Z#k#k#k#k#k#k#k#k#k#k#k#k.Z.Z.l#S#X#0.oaZaZaZaZ.oaZ#s#saZaZaZaZaZ#saZaZ#s.oaZ.oaZaZaZbWaZ#saZaZbaaZba#S#J#k#k#k#k#kbL.V.7#saZaZaZ#saZaZaZaZaZ.oaZbQaZaZbQaZbQ#k#k#k#k#k#k#k#k#k.Z#k#k#k#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#y#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#y#k#k#k#k#y#y#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVba.L#0.o#s#s.7aZ.Y#3aW#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#S.YbWaZaZ#saZaZaZaZaZaZaZaZaZaZaZ#IaZ.oaZaZaZaZaZaZaZaQbQaZaZaZaZaZba.v#k#k#k#k#yaFbt#3bNaZaZaZaZaZaZ.oaZbQaZaZbQaZaZbaaZbQ#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#y#k.Z.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#y#k#k#y.Z#k.Z#k#y#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVbQaZbWbQaZaZbJba.Y#X#X.x#y#k#k#k#k#k#k#k#k#k#k#k#k.u.Z#k.4#Q#saZ.oaZaZaZ.oaZ.oaZaZbQ.oaZaZaZ#saZaZ.oaZ.oaZaZbQaZaZ.oaZ.o.o#s.L#2#k#ka6#ka5.Gba#3#s.oaZaZaZaZ#IbQaZ.oaZaZaZaZaZaZaZbQ#k#k#k#k#k#k#k#k#k#k#y#kaY#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#kaM.Z#k#k#k.Z#k#k#k#k#k#k#k#k#k#k#k#kau#yauaY#y.Z#k#y#k#k#yaM.3#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k",
+"bVaZaZ#tbQaZbN.oaZaZaZ#la0.m#k#k#k#k#k#k.Z#k#k#k#k#k#k.Z#k#y#k#k#i.9a0.s.oaZ.oaZaQaQ#saZaZaZaZaZaZaZbaaZbaaZaZbQaZbWbQ#IbQaZaZ.A.1#k#y#k.Y.LaZaZbNaZaZbaaZaZbaaZbabaaZbaaZaZaZaZaZbabQ#k#k#k#k#k#k#k#kbKbia1.2av.C#kau#.#k#kbr#h#k.2#k#Jbl#W#k#k.F#k#T#Vbg#k#X#k#y#V#M#kaY.Da5#k.Fbg#k#k.C.D#k#kb.#.bm.V#Tbg#k#R#V#kaY.Ka1#k.Z.F.D#M#k#kbg.l.F#k#kbr.D#k#k.FaIbg.Z#k#yaI.2.F#k#k#kbLa5au",
+"bVbQaZ#sbQaZaZaZaZaZaZ#0bQaO#W#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.m.X#3a0aZbJaZbJ#s#s.oaZaZbQbQaZbQaZaZaZ#saZaZaZaZaZ#s#I#0#3#3#P#G#k.Z.TbQaZaZaZaZaZaZ#saZaZaZaZaZ#saZ#s#sbQaZbJaZ#t.9#k#k#ka6#k#k#k.ZbObI#y.Z#y#k#k.V.sa1#kbK.9#2#w#kbI.9aSaY#JbdaO.9aU#S#k#u#y#.#S.3#kbK#X#XaI#Xbub.#kbs.1#k#k#k.ZbmaC#k.Z.v#Xbq#k.Z.9.v#k#i.9bOaMauaK.K.K.c#Jb..V.Mbr#FbI.M.9#A#kaK.9#PbRaI#y#i#XbI#X",
+"bVbQaZ#sbQbQbWaZ#s#saZ#s#3bW#3#W.Z#W#k#k#k#k#k#k#k#k#k#k.Z#k#k#k#k#k#k.A.L.LaZbNbabNaZ.oaZbQaZbQaZaZaZaZaZaZbJaZbababa#t.YaCaZ#M#W.X.d#XbQaZ#sbQbW#saZaZbQbQaZbQbQaZ#sbQaZ.oaZbaaZaZbQ#k#k#k#ka6#k#k#k.9aD#y.Z#y#kap#2#hbR.xbo.9#SaYaS#paIbR.T#k.9#Q#y#2.9#y#lbobm#y#k.v.9br.Z.9#Fbmbob..9#O#k#k#k#k.MboaubK.KbLaub..Z.9#m#y.LaKbLaU#F#l#X#k#M#k.Y#2#k.ZbRaW#k#AbR.Zbh.M#y.T#XaY.V#xbL#2",
+"bVbQaZ#0#I#saZ#s#saZ.o.o#0#I.zbl#W#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#J#V.dbaaZba#tba#taZ.oaZaZaZaZaZ.oaZ.obaaZaZbabNaZ#tba.L#u#k#k#XbQ#3#0bQaZaZaZ#s#IaZaQaZaQbQ.o.obQ#saZaZaZaZaZaZbQ#k#k#k#k#k#k#k#kbi.W.Z.Z#k#k.W#XaC#PaS.h.Y.Q#kbK.9#l.KbK.Z.K.T.ZbI.K.Z.MaC#X.Z#kbK.T#k#y#ubr.MaR#2.9.T#k#k#k#kbRbo#k.K#l#l#l.l.Z.9a1aYbT#l#X.1#T.1#X.T.m.Z.K#m#kau#Xbg.Z.X.9.Zal.9.Z#Z#Xau.d.9bQ#u",
+"bVbaaZ#tbQ#tbaaZbaba.o#s#3#s#s#X#S#M#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z#kbKbIa0.9#l#lbQaZbaaZbNaZbNbaaZbNbaaZaZaZaZba.Lba.9.V.xblboa0.Y#3aZbabNbabNbabNbaaZaZaZaZaZaZaZbabQaZbQaZaZbWbQ#k#k#k#k#k#k#k#ybd.KbL#ybrau.kbK.Z.Z#k#Q#P.v#kaWbo#y#y.Z#k.K#m.ZbobR#y.9#F.daI#kaW.VbL#y.d.Z.v.M.G.GaY#k#k#k#kbR.W#yaM.M#y#y#yaY.M.3#y.Y#Z.Z#k#k.m#k#P.A#MbQbK.Zau#Xbs#k.Q.9aY.v#l#ybKbK.Z#P.v#y#k",
+"bVbQbm#l#3.LaZbQaZ.oaZ.oaZbQbQbQbQ#S#k#ka6#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#ybL.laS.W.V#X#3bQaZbQbQaZaZaZbQaZbQbQ.LbQ.L#l.9#V#k.9bQbQ.LbQbQ#tbaaZaZaZbaaZaZaZaZaZaZaZaZbQbQ.9bQbQbQbQ.d#W#k#k#k#k#k#k#kaTbibdbIbd#Va5.K#2aD.mbo#u.v#kbl#u.V#O#.#ybi#F.Zbobi#k#l#k.T.hbL#h.9.V#p#x#kaY.Kbqbs.Z#k#k#k#kbR.W#yav.Kbo#A.Z#kbR.3#ybm#X#2.hb.#p.T#P#w#J#ua0#p#M#u.9#daFa0#k.v.sbo#l#V#J.9#P#Q.h",
+".Q#XbQ.9.9.z.9bWbW#X.9bWbWbWbWbW#X.d#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k.Z.Zbr.XbK#X#3bQ#XbQ.9bQbWbd#X.9.9.VbR#X.Z#kbdbQ.9.9.9.9bQ.L.9.9bQ.9.9bQbQ.9aZbQaZ.9#s.9#XbQbW#Xbd.A.Z#k#k#k#k#k#k#y#Mal#PbHbu.2#y#S#l#S#M#S#X.v#k.Z#2.9bI#V.ZbO#maYbo#X#y#u#y#h#Pbs#J.WbRaFbr.Z#kaT#X#V#k#k#k#kaYbdaDaY#yaTbi.K#yaY.K.3#k#A#X#l#XbM#XbRbK#T#k#Z#X#l#MaW.M#l#2#r.ZaK#t.Y#Q#k#kaS#S#u#X",
+"#k#k#k.Z#W#k#W#k#W#W#W#k#W.Z#k#k#k#k#k#k#k.u#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W.Z#W#k#W#k#k#k#k#k#k#k#k#k.ZaY#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#k#W#W#k#k.Z#k#k#k#k#k#k.Z#k#k#k#k#y#k.Z#k#k#k#k#k#J.Z.Z#k#k#k#k#k.Z.Z.Z#k#k#k#y#y#k#k#y#k#k#k.Z#k.Z#k#k#k.Z#k#k#k#k#k.Z#k#k#k.Z.Z#k.Z.Z#k#k#k#k.Z#k#k#k.Z#k.Z.C#k#k.Z#k#k#k#k#k#k#yalbR.Z#k#k#k#k#k.Z#k"
+};
+SIMPLE  =                    T                                                  BITPIX  =                    8                                                  NAXIS   =                    2                                                  NAXIS1  =                  188                                                  NAXIS2  =                   91                                                  HISTORY Written by XV 3.10a                                                     END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             üüüöùüùüùùùüùöüüüüüüüòüüüüüüüüüüüüüüüüüüüüüüüüùöùüùüüüüüüüüüöìüüüüüüüüüüüüüüüüüüüüüüüüüüüùùüüöüüüüüüöüüüüóüöüüüüüïööüüüüüöööüüüóóüüóüüüöüöüüüöüüüüüöüüüööüööüüüüöüüüöüöãüüöüüüüüüó/öüüüüüöüj>7::D:::>::::::>2üüüüüüüüüüüüüüüüüüüüüüüööÖ g>27>7:7:;>::K/>öü;7::::7=::7::77:;7;:=:>7:>;@öüüüüüüóà+1DÍóP2PàP>üöb:FÃö,ìV>ó(óÐ+ï_/!Ööü>Ãüüüüì;Gìó26óì6üq>2>¤>/gºü>2àw62b¨ö?-]üüP(>p7-22=;7;6;6;7777PüüõüüüüüüüüüüüüüüüüóÝ®_K>27;77;;;7;77=7=2:Ãü:77=77?8;;;8;;;;;;;;77:77772ùüüüüüüü2;F;Ãµ6bGèV(üË(KRÁó2öV2ü2üyWÝÐ:KZüì6+öüüüü/_ó¥6Vqöü/ó->bW¸Zy+mï(GZà(:S!Gü)V2Ãï:+]Wp8;?7?8;886=2==>PàüüüüüüüüüüüüüüüüöügFG:227;8;@;@8;@8;;;;8=8:K¾ËVG-2;8@8@8@8;;;;;;;87;7;;:7üüüüüüüó;6ÝóÖåsgööü]+üwVóóöü6öV/ó:2ÇüwKÝó2ö6BBìüüüü/_ó[6óóóì6ó-öüüèü+@à7göå>üj:ì2óggö+óüp7;A3=;==;66A3DËùüüüüüüüüüüüüüüüüüïÃ28;8?8?;6;;;;;6;68;;8@;?8=(üü>72A7;;;=3;8;87667=;;;;;;7üüüüüüüü2_ööüü_>J+W-jüg:26gö6yöF6ö6J>öügyüó(Ö6;b:yüüüü/Vü6222®ö:ì%2>%º%>yèö6üå>Òö :ö:ö>å2:7(p7;=77:;==;=2:2ùöùüüüüüüüüüüöüüüüüü@==;@8@;6;7;7;;;;;;9;888?-J;àù 2>7;=7:=;;77;77;=7;6;8;;7üüüüõüüü:GóöóürbÐ/¾V:PìZÇ/yü:]ób:ó2V-óü:Öö:-V¸:Rüüüü6Våg6Ýå¸ö:ó=ÝD2>üàü-büö/wüq/ö6óy>ìKÝbp7;=7;;;;;;A7nùüüüüüüüüüüüüüüüüüè 2G;9;9==6;;77;7;;;=;;;;;=3A22+~üöy7;;;;;;=;;;;;=;==7;9;?:üüüõüüüö,FóöóüüK)üg:bmüF:ìï;n:DPü(óÁPüg>>Ç>D¸ü%üüüö-Jüö>+üö:ü:,[å66ï¸K6ÖF6:qü:+/Çó>F>p;;?7;@6;;;2Gèüüüüüüöüüüüüüöüóüü:G)6;6;88=;;;;;;;8;8;;7;:737;;@%üóü-=;;@;;8;;8;88;8;;;;;87üüüüüüüüg2Í¥ãüåÁüüÖÐüÍüïËùüüÚüºÃÒü>üóÃàüìÈµüÚÒüüãÈüü¸Á-KºÒü¸Ãüì6üöÚÈàüüÒ®ÚüüÖÈüüÚÇÒöüóÇÍÚüüüÝµåp7;:7;;98->>¾óüüüüüüüüüüüüòöü²]=;6;;;6;6;;76;;;=;;6;6;;7;;6;66==büüõüµB82=6;;;;37;6;;;;;;;7üüüüüüüüüüóüìüüüüüüüüüüüüüüüüüüüüüü[öüüüöüüüüüüüüüüüüåóåìóöüóüüó[üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp8=A6==4;-2wüüüüüüüüüüüüüüüüöP-:;;=;;;;;;;;;;;3;6;;;;;;;87;;;;;8üüüüó!E2@;;;;;;6;7;;7;;8;7üüüüüüüüüüüüüüöüüüüüüüüüüüüüüüüüüüüóüööüüüüüüüüüüüüüóüüóöüöüóüüüöüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp8;A6;6E;Düöüüüüüüüüüüüüöö®P>A6;;;;6;==;;;;;=;;=6;6;;;:;=;;8;8PïüüüüüÝK4=;;;=;;;;;6;7;;7;7üüüüüüüüüöüüüóüüüüüüüüüüüüüüüüüüüüüóóüüüüüüüüüüüüüüüüüüüüüüóüüüüóóüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp7=;7;9;E7àüüóüöüüüüüüüüüüü>-A36=;;;;;7;6;;;;6;6;7;;=;=;7;;@8;;~üüüüüüüÁ=4;;;;6:3;;;;;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöüüüüüóüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt7;A6;;8A7üüüóüöüüüüüüüüóüÖ)266D6;;;;=;;;;6;;;;;;;=;6;;:;;;;88;¸üüüüüüìüE-;;;7;;;;;;=7;;9;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp7;=7;;87nüüüüüüüüöüüüööüg!;;=6;6;=;;;;;;;;6=;6;6;;;;;==;;4E8A-üüüüüüüüü2>=G=;7=;;;;7;79;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp7;A6;;87¨üüüüüüüüüüöüïüÝ:S6@8=6;;6;;;;;;;;;;;;;;;;;=6@=6=9;8;;üüüüüüüüüq->26;3;;;;;;;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüün7;A8;A87öüüüüüüüüüüüüD+A;9;8;;;;;;;;;;;;;;;6;6;;;;;66=66A4;2Aüüüüüüüüöó+:86A;;;;;7=;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüün7;A6;?7>óüüüüüüüüüüå~A7664=;;;=8;;;=;6;6;;;;;;;;6=;;6@=6;;A7G7üüüüüüüüüüü­2D;3;;;;77;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp77A6;;8Püüüüüüüüüüì%>2;A;8=;;==;;;6;;;;;=;;;;;;;;;;;6==6=;A7+süüüüüüüüüüüüD32=;=;;;;7;;;;7öüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq8;?78;>üüüüüüüüüÇb2;;6;6=;;;;;=;;;6;;;=;;;;;;;;;6;;;===64E;(ºüüüüüüüüüüüóq(A46=;;;;;;6;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt8;E4;72Ðüüüüüüüüü-7A6;;;;;;;;;;;;;;;;=;;=6;;;;;;=;;;;;;=6;?2qüüüüüüüüüüüüüüq4;@6;7;;7;;6;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöüüüüüüüüüüüüüüüüüüüp7=A6;;2ïüüüüüüüüü>G7A6;;;;;;;;;=;;;=;6;6;;=;;;;;6;;;;;=;;4;AüüüüüüüüüüüüüüÁE62=;=;;;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöüüt8;?4;:3üüüüüüüüüü:2A6;;;=66;6;=7;6;;;;;;;;6;;6;;;=;=;==6;;8GÇüüüüüüüüüüüüüöö>;66;8;=7;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöüüóüüüüüüüüüüüüüüüüüq8;?4;;7üüüüüüüüüìGG7;=67;;;;;;;;=;;;;;;;;;;;;;;;;;;;;;;;;=22üüüüüüüüüüüüüüüü>>7;;;8;;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöìÃÖóüüüüüüüüüüüüöÚ¾Ëüp7?A6;7>üüüüüüüüüÇ-=D6;;;6;=;=;6;6;;6;;;;;;;;;;;;;6;;;;;;;7>2üüüüüüüüüüüüüüöüs:3;;;;;;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüó¸g22üöüüüüüüüüüööK62]t7;?6;:2öüüüöüüüöW?;6=;;;;=;6;6;6;;=;==6;=;6;=;2;;=;;;;;;=7+~üüüüüüüüüüüüüüüüö +;8E=;7;;;;7üüüüüüóüüüÃÃåüïü¾öÒèöàÒüüÝüüÍìüüÍüöÈöè¸Òèööå¾Ýüüüüüüüü¸ÍèüöÈüÍÝüÚÍüüü¨ì¸àü> ¸=åùÃËüüÃÝüÃìüÐK¤Gp7=A6;77üöüüõüüüÖ:;84@;;;;;;;;;;;;;6;;;;==;;8;;=;;6;;;88E;D2¦üüüüüüüüüüüüüüüüüÒ>=;;;;;;;6;7üüüüüüöüì+66G¨üÃ-K2ü+óü_öü2üóDÍÃGÐ2cüÝGDDöüüüüüüüc2¨ü Rì/_ü+ööÒ2G@¥üÁF6:6èÚ;>üü;bü%rüó=-G-p7==;;;7üöüüüùüöq:8;;;;;;3=;3;6;;;;;;;;=;6727;6;6;;;;;=;82+müüóüüüüüüüüüüüüüüüü 7;;;7;;6;;7üüüüüüüü62Íöy,üóÐ/ü+üüböü,üüBÚÁFÐ6Wü¸>ó6üüüüüüüüF2 ü²>ü-Wü+üüy>/üÍKWqÁüÚ22üü:jü+wööKZj q7;?6;>+ööüüöüüèK:;8=6;;=;;;;;;=;;;;;;;;;;DA4;;=;;;;;;=84;g¸üüüüüüüüüüüüüüüüüüüà===;;;;8;;7üüüüüüüü%Bööy2üÖ6S>ö>óójöü6öóJÐÇ:Ö2PüèjZ6öüüüüüüóG>ö²>ï>Züy>üüå-2>®ü¨:PKAöÒ>=ïö=jö;wöì-GPPp8=;6;=-ööüüüüüÝ27A8A6;;6;;;;;;;;;;;=;8=;DRm:;;;=;:;;6863>ÝüüüüüüüüüüüüüüüüüüüüüG?=67;;;;;7üüüüüüöü>Röó2öütV:ü/åübóü2öó>ÁÍ:Á7RüüöK2üöüüüüüöG2ö­6à:Vüy/öüüB6 öw/üì>üà:-üü-Zü;rüÁWìü2t8:=6;7Aóüüüüüüq278?7;;;;=;;;;6;=6=;688=;³¦N-69?::29992~èüüüüüüüüüüüüüüüüüüüüüü:;;;;7;;;;7üüüüüüüü+Göüöóüüïn;Òü/-b:2_2 üüKDMG2D/Rüöcs%¨üöüüüüüüD2ùº+>27b2>óüóR%FÁì¨Fwm:ÈÖ:2óü+F:(üó+m2j8=A7;=7ÖüüõüüöD7=;8=;;;;;;;;;;;6;;;986?6 ··N=A;?=6=?8?yèöüüüüüüüüüüüüüüüüüüüüüüP?;;;;;6;;7üüüüüüüó2Dóöüüüóü:%öü,b:¨_>[óüàP_,%R®óöm2~ÚüöüüüüüüR6 ö >m_ :/_üüü62ìüì@2PÝ>Füü6PKWÖöóc62;p67A7;;7üüüüüü7=;8;7;;6;7;;;;;;6;7:8@98:·°®Vrhr¾üüöüüüüüüüüüüüüüüüüüüüüüü=6;;7;;6;7üüüüõüöüÝq%626üüìüüòüüüüüöóüüüüüüüüüöüùüüöüüüüöüüüüüüü>+üüüööüüüüüòóüüüüüüüüüóüµ@>üüüüüüüüüüüüöt8=;6;;7nüüöüüü>77;;=;;;;;;;;6=;;;;>@@48F¯µ®³©³³¯³¶¶¶¬éóìüüüüüüüüüüüüüüüüüüüüüüüÁ=7;;;;;8;7üüüüüüóüüìgRRWµüüüüüüüüööóöüüùüüöüüöüóöüüüüöüöüüüüüüüüü[¸üüüüüüüüüüüüüüüüüüüüöüü®2%üöüööüöüüüüüöp8;A6;8D:ööüüüqA-;;=;;;;;;;;6;;;;;;=;;=28>Bqsii^^]vÑ«ÓöüüüüüüüüüüüüüüüüüüüüüüüüüA2;;7;;8;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt7==6;;;AüüüüóZ=6;;;;;6;;=;;;6=;;;;;;=77;:>262=)>,,àå«Ùüüüüüüõüüüüüüüüüüüüüüüüüüü>6=;;;;;;7öüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp7;=6==;=Ðüüü28E6;6;;;;=;;;;;;;;;8;;=:7?;86378?K²öîµ«ïüüóüüüüüüüüüüüüüüüüüüüüüüüA3;;;;6;;7üüüüüüüüüüüüõüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt77=6;987üüüj=;?;:=;8;;6;66;;;;;7@=7;;A889;?=J-öüå½§õüüüüüüüüüüüüüüüüüüüüüüüüüü:76=7;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüõüüüüüüüüüüüüüp7;=6=;;7_üüüK=8@;=66@;;;;;;;;;;;;8=;?=:;6;@8=6KóüõÙ¢·õüüüüüüüüüüüüüüüüüüüüüüõüüü7=7;;;;6;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüõüüüüüüüüüüüüüüüüüp7;=6=E4;(öüö724@6;3;;;;;;;;;;;;;;;8;8?;7:86A2Ëüüüõ«®«õüöüüüüüüüüüüüüüüüüüüüüüüüü7A;;;;6;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq2;?6;;622Çüü-8)E;:;=77;77;;7;;;3=6;;?;=2D4-=ùöüõï³±¯üüõüüüüüüüüüüüüüüüüüüüüüüüü2;;7;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt77=6;;62E>Ëü77)==6:;;6;;;;;;6;;=6=;;2E74;G+üòüüüé¯®¿üööüüüüüüüüüüüüüüüüüüüüüüüü:;;;;;;9;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt6;=6;@4;;=2Íï;G;;6;8@;9;68;@8;6;;888=;;G->®üüõüüüÌ®¸ÕòüüüüõõõüüüüüüüüüüüüüüüüüüüA7;;7;9;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt27?7;6=;6=A2óù::=;88@;;;8;;;;;;=;;;:777:Ëùùüüüõüõ¹³«½¯¯¯¦°¯¯°¶üüüüüüüüüüüüüüüüüü>2;;7;;6;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp:==389E2=;;2ïï7:8@8;;8;;;;;;;;77:777>+cüööüüüüüõ¹°¢®¯®«­«§®§©üüüüüüüüüüüüüüüüüü:37;;;;;;7öüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq8;?;=;=;;==Jsüüs288;A;72;=;77;7:::7jÝöüüüüüüüüõã¦¢¬¯®««§§³¸§îüüüüüüüüüüüüüüüüü3A4;;;;;;7üüüüüüüüüüüüüüüüüüüüüöüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq78=;;6=;;;AA7JüüË2)2>:777>]y¦Áàöüüüüüüüüüüüüüüüüüüïïîòõõõüòõ½°îüüüüüüüüüüüüüüüüü7;;7;;;;;7üüüüüüüüüüüüüüüüüüüüüóóüóüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöüüüüüüüüüüüüüüüüüüüüüüüüüüp7:?3;;;;;;2DA-ïöó;:+>>Pg¸ìööüüüüùöüöüüüüüüüüüüüööõüòüüüüüüõ´°ïüüüüüüüüüüüüüüüüü:7=;7;;;;7üüüüüüüüüüüüüüüüüüüüüüìüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöüóüüüüüüüüüüüüüüüüüüüüüüüüüüp7=A6;;=;;;D8@2!yåóüüöüüüüüüüüüüüüüüüüüüüüüüüüüõùüüüüöóöüüüüõ¬«õüüüüüüüüüüüüüüüüü:7;7;;6;;7öüüüüüüüüüüüüüüüüüüüüöR2cöüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüó/üüüüüüüüüüüüüüüüüüüüüüüüüüt77=6;6;;;6-6M)E)üüüöüüöüüüüüüüüüüüüüüüüüüüüüüüüüùüüüüüüüüõõ¯¯õüüüüüüüüüüüüüüüüü:;7;;;;;;7üüüüüüüüüüüüüüüüüüööööì¸:ãüöóüüüüüüüüüüüüüüüüüüöüüüüüüüüüüüüüóüüüüüüüó,öüüüüüüüüüüüüöüüüüüüüüüüüót8=?6;;=;;;;99;;;G öüüüüüóüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüòÏ«¯üüüùùüüüüüüüüüüüüü76=;7;6;;7üüüüüõüü6gìS:¨ù>@7)B8GöÇ>à=6@)qü(üüüüW7ùüÖyq=Jügü;Ú¸:2öt>RjÝcVZG¥ü-K(Zü)óü%öP:2j(üj(üü(sÇ>=:t77=6;6;;8;@;;8;872süöüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüõï¶«½üüüùùüüüüöüüüüüüüü7;=;;;;;;7üüüüüüüü2P­B(gù2>>SÝS>ùÁ>Ý(ìV2ü(üüüü(KG]WÍq)öüWö/Ý¸>:Ö-­Ý)üöÖ(wü;Ý_(ö)óü%ü(Pìóóóm:öü/:>åq2=;;;;;;;;;;;;;;A7>WèüöüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöüüõÁ«§åüöüüüüüöüùùüüüüüüA6E;;;;6;7üüüüüüüö::J2W(Ë6WÝK-2üÇ=àBÝü6ü2üüüüüg2ì¸>ün2¤ìó_ó=ÁÇ6>¨:Ðö;qw6:¤üü,ö:ü=öü>ö6K:2,öm2üü6qs6óp7=A3;;=;;7;;;;;;-2AK]óüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüööüïµ³¿ïöüüõõõüüüùùüüüüüü];8E;;;;8;7öüüüüüüöG:=---gööèK2üÁFå(¥üj6ü2Ýüüüö 2ö¤?üw/üüW_ó>yÁF:Ö:¨ü2t%>üüó6ö+ö=­å2ó-J­b:óq6ìü66Düq8;?6;6;;;;;;;;;;EE-2(µüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöóüá««Ïïõõõõõïïîüüõüüüüüù>;8;;7;;;;7üüüüüüüü_B;K¸>V-syK@ïÇ:Ý>Dm:BüBRöüõöàF¤b6ãW6q¸üR,y,,_-?ö>rB²[>g¨ïü6>,ü6J-ìV:Rö_6wö-Í6:wq77=686;;;=;;;6;8;8;?72>süüüüüüüüüüüüüüüüüüüüüüüüüüüüùüüüüá´¢¸³°¦¦¯«¯¬¯«õõüüöùööA89;;;;;;;7üüüüüöüö,-Çö:/ÐÚ¾®µèüó¸öìÚ®ÖóöÒÍÍöüüüèÇ=?JìR:ÝóÚóÍåó¥¾ìüüÒ¥óüüÚ¸µöüÍ ¾Ýö,å¾ÒüüÒµÃóöÒÁ¾ó¸ÝüöÝ®t8==7;;=;;8;;;;;;88@;=EA(¸ùüüüüüüüüüüüüüüüüüüüüüüüüüüüùüüüïÒ¯¬§«­­­¯¯¯«­õõüöüöü²;97;;7;6=;7üüüüüüüü®:Påü¾:>Ýüüöüüü¾WÃüüüüüüüóüüüüüüì-2üW2¨üüüüüüüüüüüüüüüüüüüóüüöüüüü%üöüüüüüüüüüööüGüüüóp7=A2;;;;;;;;;6;;;;;6;4?D-GàüüóüüüüüüüüüüüüüüüüüüüüüüüüüüüõõïÙÜéîéïïîå­µòöüüöù²:;;;;;7;;;;7üüüüüöüüóÍìüüüÚÝüüüöüüüÚãüüüöüüüüüüüüüüüËÐüüüÝóóüüüüüüüüüüüüüüüüüöüüüüüüüóFóüüüüüüüüüüüüö®üüüüp7==6;;;;;;;8;;;;;6;;=62;;7-müüöüüüüüüüüüüüüüüüüüüüüüüüöüüùùüóöüöüõüüò¾¯õìóüù 3:;8;;7=;;;;7öüüüüüüüüüüüüüüöüüüüüüòüüöüüüüüüüüüüööüüüüüüüüüüüòìüüüüüüüüöüüüüöüüüüüüüüüüüüüüüöüüüüüüüüüüüüõüõüp:=?6;;;;;;;;;;;;68;3=63=662A2>üüüüüüüüüüüüüüüüüüüüüüüüüüùùùüüüüùùùüüüõóüüïü+:=@6;=;;;;;;7üüüüüüüüüöüüüöüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq77=6;6=;;=;;;6;;;;;=;=6;;;;;;>7¦àüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüï2A7;@6==7;;6;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt77A6;6;;8;;;;;6;;;;;;;;;;;;;;;;A2+³üöüüüüüöüüüüüüüüüüüüüüüüüüüüüüüüüüüüüöïM2=A6;=6=;7;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp7=A2;;;;;;7;;;7;;;;;=;;;;;;;;;;2A=7èüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüùù(87=686=;;;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq2=;;;;;;;;;;6;;=66;6;6;=;=;6;6;8?;=ZºüüüüüüüüüüüüüõüüüüüüüüüüüüüüüüöüïÒs27-A28;;6==7;;6;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq8;=7;6;;7;;;=;6;;;;;;=;;;;;=;;=8;9E=872>²èöüüüüüüüüüüüüüüüüüüüüüüüüüïù¦D>M6M4@;;;=3;;;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp:=?6;=;;;78=;6;;;3=6=6;;=;;3;=;2==9?;;>3>DyÖüüüüüüüüüüüüüüüüüüüüüüüüï]>232;2@;8;;;;7=;6;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq7=A6;;6;;;7;;;;;;;;;;;=;;;;;;;;8:869;@8==7A;:PW¨Öóüüóööüöööüüüüü¨y]2>;2;9;@8;;;;;;7;=;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp7=;;;;6;;;;;;;;;;;;;;;;;;;;;;6;8:86;;;@;;;;AAAA2:::777>>>7>:>:>7:A:7;8;;9=;;;;;;;=;;;;6;;7öüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp7==6;;=;;;;;6=;;==;;;=;6;66=6=;;;;=6;;6;==6;;==;;A;=;;;=A==;;AA6;;468=;;;;6=;;;7;:;;;;;9;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüt77A6;6;;;7;;;;;;6;;;;;;;;;;;;;;;8@8;;8=;=6=8=;;4;48;8=8;4?=886=6=ED86?;7==;=;8;;;;=;7;;;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüp:==6;;;;;;;7;;;;;;;;=;;;;;;;;;;8;8;;;=6=6====;6=;;;;;8;;=;;;;;2=632A;=;;==8;;;77;7;;;;6;;7üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüùùüüüüüüüüüüüüüüüüüüüüüùüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüq7=;7;;;=;7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7;;;;;;;;;;7üüüüöüüüüüüüüüüöüüüöóüüüüùüüüüüüüõüöüöùùùõüüüüüüüüüüüüüüüüöüùùüüüüüüüùüööüùüüöüüüöüüõüüüüüüüüóüüüt7;A4;6;;7;;;;;=;;;=;=;=;=;;;;;=;=;==;;;;;;=;;=;=;;;;==;=;=;;;;;=;=;=;=;;;=;=;=;=;;;=7;;9;7üüüüóüüüõüüüüüüóüõüüüüüüüöõõüööüüüööüüüüüüüöüüüöõõüüüüüüüüüüüõüõüüüüüùüöüüüüüõüüüüüüüüüööüüüüüòüüq=7=6;6;8;7;;6;;;6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=7;68;7üüüüüüööÕÕÞïüõüüõÛÑéõüüüüîÛÛÕüüöüüÕÕÜîüóüüüüüåÑÕÕÕîöüüüüõüïéÏÆÆÏÛáâõõüüüüüüõÓÕÜõòüüüüöüüüááÌÄÑÍÍåp7=A2;;=;;;;;;;;;;;;;;;;=;==;=;;;;=;;=;=;=;;;=;=;=;=;;;;;=;=;=;;;;;=;=;==;;;;;;=;;;6;;;;;;7üüüüüüüü«¯ºÞüüüüá¬¬Ïõüüüüá³«¯üüüüüº¯µÞüóüüüüüË¬¬ ¯ÝüöüüüõïÉ·¯³©¬¯­´Ñéüüüüüüîº«¯åüüüüüüüõï½«««¯«§¹q8;?6;;68;;7;6;;;;;;;;;;=;==;=;;;;=;;=;=;=;;;=;=;=;=;;;;;=;=;=;;;;;=;=;==;;;;;;=;;;;;7;;;;7üüüüùüüü«¶³ÕüüüÞ´¸®«Éõüüõ¿®«Èüüüüóé«§¯õõüüõüï¯ª±¬ïõüüüõ´§±®«¬¾¾°««¶¯Ïõùüüüõï¯®®éüüüüüü¾³ªª®¨¿¸³³q7=;;;;;;;;;;;;;;;;;;;;76;36;6;;;;67;3;6;6;;;676;3;6;7;;;676;3;;7;;3;6763;;;7;;3;;;=7=;;;;7öüüüüüüó«®®ÆüüõÕ¦¸®«Áïüüï¸®«Èóüùüöõ§®®ééïïõïá®«±Ãïüüüõá°®®§·ÕáïéÆ³®§Óõüüüüüé¬®®åüüüüüõµ­®¢³ÕåïéåÈp7=A6;6;;;7;;6;;;==;=;=;;;;;=;=;=;;;;;=;=;=;=;;;;;=;=;;=;;;;=;==;=;;;;;;;=;=;=;;;;;;;7;;;;7üüüüüüüü¬®«¶öüõ·«¨±««Äüüå««¯áóüùüùõ¯±®®§«°°­±±®®éõüüüéµ®±«ÕéõüüüÓ¬®§Óõüüüüüï§®®éüùüùõé««®Ñéüüüüüùq=7=6;;;;;;;;;;;;66;6;6;;;;;6;6;6;;;;;6;6;6;6;;;;;6;6;;6;;;;6;66;6;;;;;;;6;6;6;;;;;;;;;6;;7üüüüüüüüµ§®¯üüõ««ª¸­«¾îüÞ«§¹éüüùùõüË®±±±­­­°±±®®õüüüöá°±±ªéõüùöüÑ¯®§Óõüüüüõï¯®®éüüùüõá®®°éõüùüüöùp2==;;=;;;;;;;6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6=7=;;;;7üüüüüüõüÃ§®§üõõ®®½½®­¯òöÕ¦§¾ïüüüùüüÛ§ªª³³«¯¯§®®³õüüùüÑ«®®«õüüùüüË¢«§Óõüüüüõï¬®«éüùùùõÙ®®³õüüùüüüüp7=A6;6=;;;;;;=6=;;6;6;6;6;;;;;6;6;66;;;;;;6;;6;6;;;;66;6;6;;;;;6;6;6;6;;;6;6;6;66;;;;;;;;7üüüüüóõüÙ¬®«îõÞ¶«éá®±§õò¾¯¬Ëõüüüüüüõ´°¬Õïüüü¢­³Æüöüùü·®®¦ÁüóüöüöÓ«°¬Óõüüüüõï¬®«éüùùüõ¾±®§õöüùüüöüq87A6;;;;;;;;;6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7;;;;7üüüüüüüüã¬«§ïõ·¶«ïï¢¸®ïïº®¯áòüüüüüüõ¦¦³¶ïöüõ®°«éòõüüü¢¶¨¯ÉõüüüüüÕ³«¯Õõüüüüüï¬ª¯éüùùüõ¾±®«üüùùüüüüq8;;;;;;;;87;;;;;66;6;6;;;;;6;6;6;;;;;6;6;6;6;;;;;6;6;;6;;;;6;66;6;;;;;;;6;6;6;;;;=6;7;;;;7üüüüüüüüî««§ïâ¯®®õõ³«®Æï°®¯éüüüüüüüüÒ«ª¯Ëüüã±«Ñüüõüüü«®ª¯ÑüóüüüüåÏÈÌãüüüüüüî§®³éüùüüõÁ®±ªöüüüüööüt;7?6=;;;;;;;=;=;;;=;=;=;=;;;;;=;=;==;;;;;;=;;=;=;;;;==;=;=;;;;;=;=;=;=;;;=;=;=;==;;;;;;;;7üüüüüüüüõÁ³§â½«§³üüÕ¨®¬â¯®Áïüüüüüüüüõ¾ª±¯õï¾ªÈõüüüüüüÁ«®«Ãöóöùùùüüüöüüüüüüöï¯®«åüüüüòÕª±®õüüüüüüüt2;=6;;;;;7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7;;;;7üüüüüüüüòÜ®®¶«³¯¾üüõµ«®¸ª®Ñõöüüüüüüüüï®±«âÕ§§îüöüüüüüÜ³³±§îööùùùüóüüüùüüüüüï«®­åüüüüòé®®«õõùùùüüüp7=A6;6;6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7üüüüüüüüõá®®ª«³«ÌüüõÏ«±ª¨ªÙõöüüüüüüüüõ®®«ÛÍ¢§õüóüüüüüå¾®¶¢éòöüùüööüüüùüüüüöî¯­­åöüüüöï¯®®éõüöüüüüp2=;6;6;67;8;6;68;;6;6;686;;;;;6;6;66;;8;;;6;;686;;;;66;6;6;;;;;6;6;6;68;;6;6;6866;;7;;9;6>öüüüüüüüüï«±®®«¯îüüüï¾±±¸®îüüüüüüüüüüü·®±±ª®³üüüüüüüüòå¢¶±¯Ëõõüüõõïïóüüöüöüé³³°éüüüüüõ¾¢®¹Ñõõõõõõq==A;;=;;?A===;=;==;=;;;=;=;;;;==;;;;=;=;=;=;;=;;;=;=;;;;==;;;;=;=;;;=;==;=;=;=;;;=;A;;=;=7üüüüüüüùüõ«±±±®ÑõüüüõÑ®ª®®îõüùüüüüüüüüÆ§±ª®±Ñõüüüüõüüüõ³§®«¬ÁÙïïåáÛÄóüüüüüöé­­«éüüüüüüÜ°®§¬ÍÛååáÑp77;2;;66;78;7;;7;7;;7;;7;;;;;;;;;;;7;;7;;7;;;;7;;7;;7;;;;;;;;;;;7;;7;;7;7;;7;;7;;;;;7;8;;7üüüüüüüùüò§«±®«áüüüüõï±ª®«òüüùüüüüüüöüÙ«®¢±±ÜüüüüüüüüüüÛ§­­«¯¬³³¬¢¢¯ïõüüüùüï¯««éüüüüüõõÑ«®§ª«³³«¯p7??6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7üöüüöüüùüü¯®®«¬õüüüüùõ¯«««óöüùüüüüüüüüéÆ¬«¸¬õùüüüüüüüüüõïåµ§«®ª®®«§¬Ýòüüüùüé°«¬åüüüùüüüõï¬§®®®³°«j26;2;6667;7;6;6;6666666;6;;6;6666;66;6;6;666;6;6;6;66666;6;6;66666;6;6;;666666;66;67767977üüüüöüüùüî¬«¢¯°õüüõüüü¯¸«³óüüüùüüüüüüüòÜ¯³³¬üüüüöüõüüüüüüüÜ¾§§±±ª®§¹åóüüóóõî¹³¯åüüùüüüüüüË¹³³§«¦¯SSZMSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSPüüüüüüüùüüÆÈÆÏÕüùüüüöüÃÏËÍöüüüùüüüüüüüüïÃÕÃÏüùüüöüüüüùüüööïïÍÆ±ª½ÂÏâïüöüóóüõÃÏÄïõüöùùüöüöõéËÄ³ÈÈÛ                                                                                                                                                                            
Index: /tags/Mars_V0-4/Mars/manalysis/AnalysisIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/AnalysisIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/AnalysisIncl.h	(revision 9634)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/manalysis/AnalysisLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/AnalysisLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/AnalysisLinkDef.h	(revision 9634)
@@ -0,0 +1,24 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MCerPhotPix;
+#pragma link C++ class MCerPhotEvt; 
+#pragma link C++ class MCerPhotCalc;
+
+#pragma link C++ class MImgCleanStd;
+
+#pragma link C++ class MCT1ReadAscii;
+
+#pragma link C++ class MPedestalPix;
+#pragma link C++ class MPedestalCam;
+#pragma link C++ class MMcPedestalCopy;
+
+#pragma link C++ class MHillas;
+#pragma link C++ class MHillasCalc;
+
+#pragma link C++ class MPedCalcPedRun;
+
+#endif
Index: /tags/Mars_V0-4/Mars/manalysis/MCT1ReadAscii.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCT1ReadAscii.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCT1ReadAscii.cc	(revision 9634)
@@ -0,0 +1,305 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MCT1ReadAscii                                                           //
+//                                                                         //
+// Reads a ascii file with CT1 data. The file description and some example //
+// files can be found on the Magic homepage.                               //
+//                                                                         //
+//  Input Containers:                                                      //
+//   -/-                                                                   //
+//                                                                         //
+//  Output Containers:                                                     //
+//   MCerPhotEvt                                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MCT1ReadAscii.h"
+
+#include <fstream.h>
+
+#include <TArrayC.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+#include "MCerPhotEvt.h"
+#include "MPedestalCam.h"
+
+ClassImp(MCT1ReadAscii);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. Creates an array which stores the file names of
+// the files which should be read. If a filename is given it is added
+// to the list.
+//
+MCT1ReadAscii::MCT1ReadAscii(const char *fname,
+			     const char *name, 
+			     const char *title)
+{
+    *fName  = name  ? name  : "MCT1ReadAscii";
+    *fTitle = title ? title : "Task to loop over events in CT1 ascii file";
+
+    //
+    // remember file name for opening the file in the preprocessor
+    //
+    fFileNames = new TArrayC;
+    if (fname)
+        AddFile(fname);
+}
+
+// --------------------------------------------------------------------------
+//
+// Delete the filename list and the input stream if one exists.
+//
+MCT1ReadAscii::~MCT1ReadAscii()
+{
+    delete fFileNames;
+    if (fIn)
+        delete fIn;
+}
+
+// --------------------------------------------------------------------------
+//
+// Add this file as the last entry in the chain
+//
+void MCT1ReadAscii::AddFile(const char *txt)
+{
+    const int sz  = fFileNames->GetSize();
+    const int tsz = strlen(txt)+1;
+
+    fFileNames->Set(sz+tsz);
+
+    memcpy(fFileNames->GetArray()+sz, txt, tsz);
+}
+
+// --------------------------------------------------------------------------
+//
+// This opens the next file in the list and deletes its name from the list.
+//
+Bool_t MCT1ReadAscii::OpenNextFile()
+{
+    //
+    // open the input stream and check if it is really open (file exists?)
+    //
+    if (fIn)
+        delete fIn;
+    fIn = NULL;
+
+    const int arrsz = fFileNames->GetSize();
+
+    if (arrsz<1)
+        return kFALSE;
+
+    //
+    // open the file which is the first one in the chain
+    //
+    const char *name = fFileNames->GetArray();
+
+    fIn = new ifstream(name);
+    if (!(*fIn))
+    {
+        *fLog << dbginf << "Cannot open file '" << name << "'" << endl;
+        return kFALSE;
+    }
+
+    //
+    // remove the first entry from the chain
+    //
+    *fLog << "Open file: '" << name << "'" << endl;
+
+    //
+    // create the new char array containing the filenames to process
+    //
+    const int sz  = strlen(name)+1;
+
+    char *dummy = new char[arrsz-sz];
+    memcpy(dummy, name+sz, arrsz-sz);
+
+    //
+    // dummy will be deleted by the destructor of fFileNames
+    //
+    fFileNames->Adopt(arrsz-sz, dummy);
+
+    return kTRUE;
+
+}
+
+// --------------------------------------------------------------------------
+//
+// Open the first file in the list. Check for the output containers or create
+// them if they don't exist.
+//
+// Initialize the size of the MPedestalCam container to 127 pixels (CT1 camera)
+//
+Bool_t MCT1ReadAscii::PreProcess(MParList *pList)
+{
+    //
+    // Preprocessing
+    //
+
+    //
+    // Try to open at least one (the first) file
+    //
+    if (!OpenNextFile())
+        return kFALSE;
+
+    //
+    //  look for the MCerPhotEvt class in the plist
+    //
+    fNphot = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
+    if (!fNphot)
+        return kFALSE;
+
+    //
+    //  look for the pedestal class in the plist
+    //
+    fPedest = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
+    if (!fPedest)
+        return kFALSE;
+
+    fPedest->InitSize(127);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Read apedestal entry (line) from the file
+//
+void MCT1ReadAscii::ReadPedestals()
+{
+    *fLog << "MCT1Pedestals::AsciiRead: Reading Pedestals..." << endl;
+
+    //
+    // skip the next 4 values
+    //
+    Float_t val;
+
+    *fIn >> val;
+    *fIn >> val;
+    *fIn >> val;
+    *fIn >> val;
+
+    //
+    //    read in the next 127 numbers as the pedestals
+    //
+    for (Int_t i = 0; i<127; i++)
+    {
+        *fIn >> val;
+
+        if (val > 0.0)
+            (*fPedest)[i].SetMeanRms(val);
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// Read a data entry (line) from the file
+//
+void MCT1ReadAscii::ReadData()
+{
+    //
+    // clear the list of cerphot-events
+    //
+    fNphot->Clear();
+
+    //
+    // five unsused numbers
+    //
+    Int_t val;
+
+    *fIn >> val;   // ener
+    *fIn >> val;   // zenang
+    *fIn >> val;   // sec1
+    *fIn >> val;   // sec2
+
+    //
+    // read in the number of cerenkov photons and add the 'new' pixel
+    // too the list with it's id, number of photons and error
+    //
+    for (Int_t i = 0; i<127; i++ )
+    {
+        Float_t nphot;
+
+        *fIn >> nphot;
+
+        if (nphot > 0.0)
+            fNphot->AddPixel(i, nphot, (*fPedest)[i].GetMeanRms());
+    }
+
+}
+
+// --------------------------------------------------------------------------
+//
+// Check for the event number and depending on this number decide if
+// pedestals or event data has to be read.
+//
+// If the end of the file is reached try to open the next in the list. If
+// there is now next file stop the eventloop.
+//
+Bool_t MCT1ReadAscii::Process()
+{
+    //
+    // FIXME. This function should switch between reading pedestals and
+    // reading event data by the 'switch entry'.
+    // After reading it should set the InputStreamID correctly.
+    // ( should use MPedestalCam )
+    //
+ 
+    //
+    // read in the event nr
+    //
+    Int_t evtnr;
+    *fIn >> evtnr;
+
+    //
+    // check if we are done. Try to open the next file in chain.
+    // If it was possible start reading. If not break the event loop
+    //
+    if (fIn->eof())
+        return OpenNextFile() ? kCONTINUE : kFALSE;
+
+    //
+    // if the first number is negativ this is a pedestal line:
+    // read in pedestals
+    //
+    // FIXME! Set InputStreamID
+
+    if (evtnr < 0)
+    {
+        ReadPedestals();
+        return kCONTINUE;
+    }
+
+    ReadData();
+
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MCT1ReadAscii.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCT1ReadAscii.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCT1ReadAscii.h	(revision 9634)
@@ -0,0 +1,41 @@
+#ifndef MCT1READASCII_H
+#define MCT1READASCII_H
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class TArrayC;
+class MCerPhotEvt;
+class MPedestalCam;
+
+class MCT1ReadAscii : public MTask
+{
+private:
+    ifstream     *fIn;          // the inputfile
+    MCerPhotEvt  *fNphot;       // the data container for all data.
+    MPedestalCam *fPedest;      // ct1 pedestals
+    TArrayC      *fFileNames;   // Array which stores the \0-terminated filenames
+
+    Bool_t OpenNextFile();
+
+    void ReadPedestals();
+    void ReadData();
+
+public:
+    MCT1ReadAscii(const char *filename=NULL,
+                  const char *name=NULL,
+                  const char *title=NULL);
+
+    ~MCT1ReadAscii();
+
+    void AddFile(const char *fname);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MCT1ReadAscii, 0)	// Reads the CT1 data file
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/manalysis/MCerPhotCalc.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCerPhotCalc.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCerPhotCalc.cc	(revision 9634)
@@ -0,0 +1,125 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//   MCerPhotCalc                                                           //
+//                                                                          //
+//   This is a task which calculates the number of photons from the FADC    //
+//   time slices. At the moment it integrates simply the FADC values.       //
+//                                                                          //
+//  Input Containers:                                                       //
+//   MRawEvtData, MPedesdtalCam                                             //
+//                                                                          //
+//  Output Containers:                                                      //
+//   MCerPhotEvt                                                            //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MCerPhotCalc.h"
+
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MRawEvtPixelIter.h"
+#include "MCerPhotEvt.h"
+#include "MPedestalPix.h"
+#include "MPedestalCam.h"
+
+ClassImp(MCerPhotCalc);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MCerPhotCalc::MCerPhotCalc(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MCerPhotCalc";
+    *fTitle = title ? title : "Task to calculate Cerenkov photons from raw data";
+}
+
+// --------------------------------------------------------------------------
+//
+// The PreProcess searches for the following input containers:
+//  - MRawEvtData
+//  - MPedestalCam
+//
+// The following output containers are also searched and created if
+// they were not found:
+//  - MCerPhotEvt
+//
+Bool_t MCerPhotCalc::PreProcess( MParList *pList )
+{
+    fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
+    if (!fRawEvt)
+    {
+        *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fPedestals = (MPedestalCam*)pList->FindObject("MPedestalCam");
+    if (!fPedestals)
+    {
+        *fLog << dbginf << "MPedestalCam not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
+    if (!fCerPhotEvt)
+        return kFALSE;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Calculate the integral of the FADC time slaices and store them as a new
+// pixel in the MCerPhotEvt container.
+//
+Bool_t MCerPhotCalc::Process()
+{
+    fCerPhotEvt->Clear();
+
+    MRawEvtPixelIter pixel(fRawEvt);
+
+    while (pixel.Next())
+    {
+        const UInt_t pixid = pixel.GetPixelId();
+
+        const MPedestalPix &ped = (*fPedestals)[pixid];
+
+        const Float_t nphot = (Float_t)pixel.GetSumHiGainFadcSamples() - ped.GetMean();
+
+        fCerPhotEvt->AddPixel(pixid, nphot, ped.GetMeanRms());
+
+        // FIXME! Handling of Lo Gains is missing!
+    }
+
+    fCerPhotEvt->SetReadyToSave();
+
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MCerPhotCalc.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCerPhotCalc.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCerPhotCalc.h	(revision 9634)
@@ -0,0 +1,36 @@
+#ifndef MCERPHOTCALC_H
+#define MCERPHOTCALC_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MCerPhotCalc                                                            //
+//                                                                         //
+// Integrates the time slices of one pixel and substracts the pedestal     //
+// (offset) value                                                          //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MRawEvtData;
+class MPedestalCam;
+class MCerPhotEvt;
+
+class MCerPhotCalc : public MTask
+{
+    const MPedestalCam *fPedestals;  // Pedestals of all pixels in the camera
+          MRawEvtData  *fRawEvt;     // raw event data (time slices)
+          MCerPhotEvt  *fCerPhotEvt; // Cerenkov Photon Event used for calculation
+
+public:
+    MCerPhotCalc(const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MCerPhotCalc, 0)   // Task to calculate cerenkov photons from raw data
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/manalysis/MCerPhotEvt.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCerPhotEvt.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCerPhotEvt.cc	(revision 9634)
@@ -0,0 +1,213 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MCerPhotEvt.h"
+
+#include <math.h>
+#include <fstream.h>
+
+#include <TCanvas.h>
+#include <TClonesArray.h>
+
+#include "MLog.h"
+#include "MHexagon.h"
+#include "MCerPhotPix.h"
+
+ClassImp(MCerPhotEvt);
+
+// --------------------------------------------------------------------------
+//
+// Creates a MCerPhotPix object for each pixel in the event
+//
+MCerPhotEvt::MCerPhotEvt(const char *name, const char *title) : fNumPixels(0)
+{
+
+  *fName  = name  ? name  : "MCerPhotEvt";
+  *fTitle = title ? title : "(Number of Photon)-Event Information";
+  
+  fPixels = new TClonesArray ("MCerPhotPix", 577) ;
+
+  //
+  // FIXME: is this really necessary?
+  //
+  fPixels->Clear();
+}
+
+// --------------------------------------------------------------------------
+//
+// This is not yet implemented like it should.
+//
+void MCerPhotEvt::Draw(Option_t* option) 
+{
+    //
+    //   FIXME!!! Here the Draw function of the CamDisplay
+    //   should be called to add the CamDisplay to the Pad.
+    //   The drawing should be done in MCamDisplay::Paint
+    //
+
+    //    MGeomCam *geom = fType ? new MGeomCamMagic : new MGeomCamCT1;
+    //    MCamDisplay *disp = new MCamDisplay(geom);
+    //    delete geom;
+    //    disp->DrawPhotNum(this);
+}
+
+// --------------------------------------------------------------------------
+//
+// add a new pixel to the list and increase the number
+// of valid pixels in the list by one
+//
+void MCerPhotEvt::AddPixel(Int_t id, Float_t nph, Float_t err)
+{
+    // TClonesArray -> 'operator new with placement' should be used
+    new ((*fPixels)[fNumPixels++]) MCerPhotPix( id, nph, err);
+}
+
+// --------------------------------------------------------------------------
+//
+// reset counter and delete netries in list.
+//
+void MCerPhotEvt::Clear(Option_t *)
+{
+    fNumPixels = 0 ;
+    fPixels->Clear() ;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Dump the cerenkov photon event to *fLog
+//
+void MCerPhotEvt::Print(Option_t *)
+{
+    const Int_t entries = fPixels->GetEntries();
+
+    *fLog << "MCerPhotEvt::Print()" << endl
+        << "Number of Pixels: " << fNumPixels
+        << "(" << entries << ")"
+        << endl ;
+
+    for (Int_t il=0; il<entries; il++ )
+        (*this)[il].Print();
+}
+
+// --------------------------------------------------------------------------
+//
+// Checks if in the pixel list is an entry with pixel id
+//
+Bool_t MCerPhotEvt::IsPixelExisting(Int_t id)
+{
+    const Int_t entries = fPixels->GetEntries();
+
+    for (Int_t il=0; il<entries; il++)
+    {
+        if (id == (*this)[il].GetPixId())
+            return kTRUE ;
+    }
+
+    return kFALSE ;
+} 
+
+// --------------------------------------------------------------------------
+//
+//   Checks if in the pixel list is an entry with pixel id
+//
+Bool_t MCerPhotEvt::IsPixelUsed(Int_t id)
+{
+    const Int_t entries = fPixels->GetEntries();
+
+    for (Int_t il=0; il<entries; il++ )
+    {
+        MCerPhotPix &pix = (*this)[il];
+
+        if (id == pix.GetPixId() && pix.IsPixelUsed())
+            return kTRUE ;
+    }
+
+    return kFALSE ;
+} 
+
+// --------------------------------------------------------------------------
+//
+//   Checks if in the pixel list is an entry with pixel id
+//
+Bool_t MCerPhotEvt::IsPixelCore(Int_t id)
+{
+    const Int_t entries = fPixels->GetEntries();
+
+    for (Int_t il=0; il<entries; il++ )
+    {
+        MCerPhotPix &pix = (*this)[il];
+
+        if ( id == pix.GetPixId() && pix.IsCorePixel())
+            return kTRUE ;
+    } 
+
+    return kFALSE ;
+} 
+
+// --------------------------------------------------------------------------
+//
+// get the minimum number of photons of all valid pixels in the list
+//
+Float_t MCerPhotEvt::GetNumPhotonsMin()
+{
+    if (fNumPixels <= 0)
+        return -5. ;
+
+    Float_t minval = (*this)[0].GetNumPhotons();
+
+    Float_t testval;
+    for (UInt_t i=1 ; i<fNumPixels; i++ )
+    {
+        testval = (*this)[i].GetNumPhotons();
+
+        if (testval < minval)
+            minval = testval;
+    }
+
+    return minval;
+}
+
+// --------------------------------------------------------------------------
+//
+// get the maximum number of photons of all valid pixels in the list
+//
+Float_t MCerPhotEvt::GetNumPhotonsMax()
+{
+    if (fNumPixels <= 0)
+        return 50.;
+
+    Float_t maxval = (*this)[0].GetNumPhotons();
+
+    Float_t testval;
+    for (UInt_t i=1; i<fNumPixels; i++)
+    {
+        testval = (*this)[i].GetNumPhotons();
+
+        if (testval > maxval)
+            maxval = testval;
+    }
+    return maxval;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MCerPhotEvt.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCerPhotEvt.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCerPhotEvt.h	(revision 9634)
@@ -0,0 +1,49 @@
+#ifndef MCERPHOTEVT_H
+#define MCERPHOTEVT_H
+
+#ifndef MAGIC_h
+#include "MAGIC.h"
+#endif
+#ifndef ROOT_TClonesArray
+#include <TClonesArray.h>
+#endif
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class MCerPhotPix;
+
+class MCerPhotEvt : public MParContainer
+{
+private:
+    UInt_t        fNumPixels;
+    TClonesArray *fPixels;
+
+public:
+    MCerPhotEvt(const char *name=NULL, const char *title=NULL);
+    ~MCerPhotEvt() { delete fPixels; }
+
+    void Draw(Option_t* option = "");
+
+    UInt_t GetNumPixels() const { return fNumPixels; }
+
+    void AddPixel(Int_t id, Float_t nph, Float_t err);
+
+    void Clear(Option_t *opt=NULL);
+    void Print(Option_t *opt=NULL);
+
+    Bool_t  IsPixelExisting( Int_t id );
+    Bool_t  IsPixelUsed    ( Int_t id );
+    Bool_t  IsPixelCore    ( Int_t id );
+
+    Float_t GetNumPhotonsMin();
+    Float_t GetNumPhotonsMax();
+
+    MCerPhotPix &operator[](int i)       { return *(MCerPhotPix*)(fPixels->At(i)); }
+    MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->At(i)); }
+
+    ClassDef(MCerPhotEvt, 1)    // class for an event containing cerenkov photons
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/manalysis/MCerPhotPix.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCerPhotPix.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCerPhotPix.cc	(revision 9634)
@@ -0,0 +1,70 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MCerPhotPix.h"
+
+#include "MLog.h"
+
+ClassImp(MCerPhotPix);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. The pixel is assumed as used and not a core pixel.
+//
+MCerPhotPix::MCerPhotPix(Int_t pix, Float_t phot, Float_t errphot) :
+    fPixId(pix), fIsUsed(kTRUE), fIsCore(kFALSE), fPhot(phot), fErrPhot(errphot)
+{
+} 
+
+// --------------------------------------------------------------------------
+//
+// Sets the information of one pixel.  The pixel is assumed as used and
+// not a core pixel.
+//
+void MCerPhotPix::SetPixelContent(Int_t pix, Float_t phot, Float_t errphot)
+{
+    fPixId   = pix;
+    fIsUsed  = kTRUE;
+    fPhot    = phot;
+    fErrPhot = errphot;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Print information to gLog.
+//
+void MCerPhotPix::Print(Option_t *)
+{ 
+    gLog << "MCerPhotPix: Pixel: "<< fPixId ;
+
+    gLog << (fIsUsed?"    Used ":"  Unused ");
+
+    gLog << (fIsCore?"  Core  ":"        ");
+
+    gLog << "  Nphot= " << fPhot
+        << "  Error(Nphot) = " << fErrPhot
+        << endl ;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MCerPhotPix.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MCerPhotPix.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MCerPhotPix.h	(revision 9634)
@@ -0,0 +1,45 @@
+#ifndef MCERPHOTPIX_H
+#define MCERPHOTPIX_H
+
+#ifndef ROOT_TROOT
+#include <TROOT.h>
+#endif
+
+class MCerPhotPix : public TObject
+{
+ private:
+  
+  Int_t    fPixId     ;  // the pixel Id
+  Bool_t   fIsUsed    ;  // the pixel is used for calculations --> kTRUE
+  Bool_t   fIsCore    ;  // the pixel is a Core pixel          --> kTRUE
+  Float_t  fPhot      ;  // The number of Cerenkov photons
+  Float_t  fErrPhot   ;  // the error of fPhot
+ 
+ public:
+  
+  MCerPhotPix(Int_t pix = -1, Float_t phot=0. , Float_t errphot=0.) ;
+
+  void Print(Option_t *opt = NULL) ;
+             
+  Int_t   GetPixId() const      { return fPixId ;    }
+  Float_t GetNumPhotons() const { return fPhot ;     }
+  Float_t GetErrorPhot() const  { return fErrPhot ;  }
+
+  void SetPixelContent(Int_t pix, Float_t phot, Float_t errphot);
+
+  Bool_t IsPixelUsed() const    { return fIsUsed ;   }
+  void   SetPixelUnused()       { fIsUsed = kFALSE ; }
+  void   SetPixelUsed()         { fIsUsed = kTRUE ;  }
+
+  void   SetCorePixel()         { fIsCore = kTRUE ;  }
+  Bool_t IsCorePixel() const    { return fIsCore ;   }
+
+  void SetNumPhotons(Float_t f) { fPhot    = f; }
+  void SetErrorPhot(Float_t f)  { fErrPhot = f; }
+  
+  ClassDef(MCerPhotPix, 1)  // class containing information about the Cerenkov Photons in a pixel
+} ; 
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/manalysis/MHillas.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MHillas.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MHillas.cc	(revision 9634)
@@ -0,0 +1,309 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MHillas                                                                 //
+//                                                                         //
+// Storage Container for the Hillas parameter                              //
+//                                                                         //
+// FIXME: Here everybody should find an explanation of the parameters      //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MHillas.h"
+
+#include <math.h>
+#include <fstream.h>
+
+#include <TEllipse.h>
+
+#include "MCerPhotEvt.h"
+#include "MCerPhotPix.h"
+#include "MGeomCam.h"
+
+#include "MLog.h"
+
+ClassImp(MHillas);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MHillas::MHillas(const char *name, const char *title) : fEllipse(NULL)
+{
+    *fName  = name  ? name  : "MHillas";
+    *fTitle = title ? title : "Storage container for Hillas parameter of one event";
+
+    Reset();
+    // FIXME: (intelligent) initialization of values missing
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor. Deletes the TEllipse if one exists.
+//
+MHillas::~MHillas()
+{
+    Clear();
+}
+
+void MHillas::Reset()
+{
+    fAlpha  = 0;
+    fTheta  = 0;
+    fWidth  = 0;
+    fLength = 0;
+    fSize   = 0;
+    fDist   = 0;
+
+    Clear();
+}
+
+// --------------------------------------------------------------------------
+//
+// Print the hillas Parameters to *fLog
+//
+void MHillas::Print(Option_t *)
+{
+    *fLog << "Hillas Parameter:" << endl;
+    *fLog << " - Alpha  = " << fabs(fAlpha)  << endl;
+    *fLog << " - Width  = " << fWidth  << endl;
+    *fLog << " - Length = " << fLength << endl;
+    *fLog << " - Size   = " << fSize   << endl;
+    *fLog << " - Dist   = " << fDist   << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// call the Paint function of the Ellipse if a TEllipse exists
+//
+void MHillas::Paint(Option_t *)
+{
+    if (!fEllipse)
+        return;
+
+    fEllipse->Paint();
+}
+
+// --------------------------------------------------------------------------
+//
+// Instead of adding MHillas itself to the Pad
+// (s. AppendPad in TObject) we create an ellipse,
+// which is added to the Pad by it's Draw function
+// You can remove it by deleting the Ellipse Object
+// (s. Clear() )
+//
+void MHillas::Draw(Option_t *)
+{
+    Clear();
+
+    fEllipse = new TEllipse(cos(fTheta)*fDist, sin(fTheta)*fDist,
+                            fLength, fWidth,
+                            0, 360, fTheta*kRad2Deg+fAlpha-180);
+
+    fEllipse->SetLineWidth(2);
+    fEllipse->Draw();
+
+    /*
+     This is from TH1
+     TString opt = option;
+   opt.ToLower();
+   if (gPad && !opt.Contains("same")) {
+      //the following statement is necessary in case one attempts to draw
+      //a temporary histogram already in the current pad
+      if (TestBit(kCanDelete)) gPad->GetListOfPrimitives()->Remove(this);
+      gPad->Clear();
+   }
+   AppendPad(opt.Data());
+   */
+}
+
+// --------------------------------------------------------------------------
+//
+// If a TEllipse object exists it is deleted
+//
+void MHillas::Clear(Option_t *)
+{
+    if (!fEllipse)
+        return;
+
+    delete fEllipse;
+
+    fEllipse = NULL;
+}
+
+// --------------------------------------------------------------------------
+//
+// Calculate the Hillas parameters from a cerenkov photon event
+// (The calcualtion is some kind of two dimentional statistics)
+//
+Bool_t MHillas::Calc(const MGeomCam &geom, const MCerPhotEvt &evt)
+{
+    const UInt_t nevt = evt.GetNumPixels();
+
+    //
+    // sanity check
+    //
+    if (nevt <= 2)
+        return kFALSE;
+
+    //
+    // calculate mean valu of pixels
+    //
+    float xmean =0;
+    float ymean =0;
+
+    fSize = 0;
+
+    //
+    // FIXME! npix should be retrieved from MCerPhotEvt
+    //
+    UShort_t npix=0;
+    for (UInt_t i=0; i<nevt; i++)
+    {
+        const MCerPhotPix &pix = evt[i];
+
+        if (!pix.IsPixelUsed())
+            continue;
+
+        const MGeomPix &gpix = geom[pix.GetPixId()];
+
+        const float nphot = pix.GetNumPhotons();
+
+        fSize += nphot;
+        xmean += nphot * gpix.GetX(); // [mm]
+        ymean += nphot * gpix.GetY(); // [mm]
+
+        npix++;
+    }
+
+    //
+    // sanity check
+    //
+    if (fSize==0 || npix<=2)
+        return kFALSE;
+
+    xmean /= fSize; // [mm]
+    ymean /= fSize; // [mm]
+
+    //
+    // calculate sdev
+    //
+    float sigmaxx=0;
+    float sigmaxy=0;
+    float sigmayy=0;
+
+    for (UInt_t i=0; i<nevt; i++)
+    {
+        const MCerPhotPix &pix = evt[i];
+
+        if (!pix.IsPixelUsed())
+            continue;
+
+        const MGeomPix &gpix = geom[pix.GetPixId()];
+
+        const float dx = gpix.GetX() - xmean;
+        const float dy = gpix.GetY() - ymean;
+
+        const float nphot = pix.GetNumPhotons();
+
+        sigmaxx += nphot * dx*dx; // [mm^2]
+        sigmaxy += nphot * dx*dy; // [mm^2]
+        sigmayy += nphot * dy*dy; // [mm^2]
+    }
+
+    //
+    // check for orientation
+    //
+    const float theta = atan(sigmaxy/(sigmaxx-sigmayy)*2)/2;
+
+    float c = cos(theta); // [1]
+    float s = sin(theta); // [1]
+
+    //
+    // calculate the length of the two axis
+    //
+    float axis1 =  2.0*c*s*sigmaxy + c*c*sigmaxx + s*s*sigmayy; // [mm^2]
+    float axis2 = -2.0*c*s*sigmaxy + s*s*sigmaxx + c*c*sigmayy; // [mm^2]
+
+    axis1 /= fSize; // [mm^2]
+    axis2 /= fSize; // [mm^2]
+
+    //
+    // check for numerical negatives
+    // (very small number can get negative by chance)
+    //
+    if (axis1 < 0) axis1=0;
+    if (axis2 < 0) axis2=0;
+
+    //
+    // calculate the main Hillas parameters
+    //
+    // fLength, fWidth describes the two axis of the ellipse
+    // fAlpha is the angle between the length-axis and the center
+    //    of the camera
+    // fDist is the distance between the center of the camera and the
+    //    denter of the ellipse
+    //
+    const int rotation = axis1<axis2;
+
+    fLength = rotation ? sqrt(axis2) : sqrt(axis1);  // [mm]
+    fWidth  = rotation ? sqrt(axis1) : sqrt(axis2);  // [mm]
+
+    const float a = c*xmean + s*ymean;
+    const float b = c*ymean - s*xmean;
+
+    fAlpha  = rotation ? atan(a/b) : atan(-b/a);     // [rad]
+    fAlpha *= kRad2Deg;                              // [deg]
+
+    fDist   = sqrt(xmean*xmean + ymean*ymean);       // [mm]
+
+    fTheta  = atan(ymean/xmean);                     // [rad]
+    if (xmean<0) fTheta += kPI;                      // [rad]
+
+    SetReadyToSave();
+
+    return kTRUE;
+}
+
+void MHillas::AsciiRead(ifstream &fin)
+{
+    fin >> fAlpha;
+    fin >> fTheta;
+    fin >> fWidth;
+    fin >> fLength;
+    fin >> fSize;
+    fin >> fDist;
+}
+
+void MHillas::AsciiWrite(ofstream &fout) const
+{
+    fout << fAlpha << " ";
+    fout << fTheta << " ";
+    fout << fWidth << " ";
+    fout << fLength << " ";
+    fout << fSize << " ";
+    fout << fDist << endl;
+}
Index: /tags/Mars_V0-4/Mars/manalysis/MHillas.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MHillas.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MHillas.h	(revision 9634)
@@ -0,0 +1,53 @@
+#ifndef MHILLAS_H
+#define MHILLAS_H
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class TEllipse;
+
+class MGeomCam;
+class MCerPhotEvt;
+
+class MHillas : public MParContainer
+{
+private:
+    Float_t fAlpha;     // [deg] Angle between the length axis of the ellipse and the camera center
+    Float_t fTheta;     // [rad] Angle between the x axis and the center of the ellipse
+    Float_t fWidth;     // Width of the ellipse
+    Float_t fLength;    // Length of the ellipse
+    Float_t fSize;      // Size of the ellipse
+    Float_t fDist;      // Distance of the ellipse COM from the camera center
+
+    TEllipse *fEllipse; //! Graphical Object to Display Ellipse
+
+public:
+    MHillas(const char *name=NULL, const char *title=NULL);
+    ~MHillas();
+
+    void Reset();
+
+    Bool_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix);
+
+    void Print(Option_t *opt=NULL);
+    void Draw(Option_t *opt=NULL);
+    void Paint(Option_t *opt=NULL);
+
+    void Clear(Option_t *opt=NULL);
+
+    Float_t GetAlpha() const  { return fAlpha; }
+    Float_t GetWidth() const  { return fWidth; }
+    Float_t GetLength() const { return fLength; }
+    Float_t GetDist() const   { return fDist; }
+    Float_t GetSize() const   { return fSize; }
+    Float_t GetTheta() const  { return fTheta; }
+
+    void AsciiRead(ifstream &fin);
+    void AsciiWrite(ofstream &fout) const;
+
+    ClassDef(MHillas, 1) // Storage Container for Hillas Parameter
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/manalysis/MHillasCalc.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MHillasCalc.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MHillasCalc.cc	(revision 9634)
@@ -0,0 +1,102 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//  MHillasCalc                                                            //
+//                                                                         //
+//  This is a task to calculate the Hillas parameters from each event      //
+//                                                                         //
+//  Input Containers:                                                      //
+//   MCerPhotEvt, MGeomCam                                                 //
+//                                                                         //
+//  Output Containers:                                                     //
+//   MHillas                                                               //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MHillasCalc.h"
+
+#include "MParList.h"
+
+#include "MHillas.h"
+#include "MCerPhotEvt.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MHillasCalc);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+MHillasCalc::MHillasCalc(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MHillasCalc";
+    *fTitle = title ? title : "Task to calculate Hillas parameters";
+}
+
+// --------------------------------------------------------------------------
+//
+// Check for a MCerPhotEvt object from which the Hillas are calculated.
+// Try to find the Geometry conatiner. And try to find the output
+// (Hillas) container or create one.
+//
+Bool_t MHillasCalc::PreProcess(MParList *pList)
+{
+    fCerPhotEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
+    if (!fCerPhotEvt)
+    {
+        *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fGeomCam = (MGeomCam*)pList->FindObject("MGeomCam");
+    if (!fGeomCam)
+    {
+        *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
+        return kFALSE;
+    }
+
+    fHillas = (MHillas*)pList->FindCreateObj("MHillas");
+    if (!fHillas)
+        return kFALSE;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// If you want do complex descisions inside the calculations
+// we must move the calculation code inside this function
+//
+// If the calculation wasn't sucessfull skip this event
+//
+Bool_t MHillasCalc::Process()
+{
+    return fHillas->Calc(*fGeomCam, *fCerPhotEvt) ? kTRUE : kCONTINUE;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MHillasCalc.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MHillasCalc.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MHillasCalc.h	(revision 9634)
@@ -0,0 +1,35 @@
+#ifndef MHILLASCALC_H
+#define MHILLASCALC_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MHillasCalkc                                                            //
+//                                                                         //
+// Task to calculate Hillas Parameters                                     //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MGeomCam;
+class MCerPhotEvt;
+class MHillas;
+
+class MHillasCalc : public MTask
+{
+    const MGeomCam    *fGeomCam;    // Camera Geometry used to calculate Hillas
+    const MCerPhotEvt *fCerPhotEvt; // Cerenkov Photon Event used for calculation
+          MHillas     *fHillas;     // ouput container to store result
+
+public:
+    MHillasCalc(const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MHillasCalc, 0)   // Task to calculate Hillas parameters
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/manalysis/MImgCleanStd.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MImgCleanStd.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MImgCleanStd.cc	(revision 9634)
@@ -0,0 +1,258 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//  MImgCleanStd                                                           //
+//                                                                         //
+//  This is the standard image cleaning. If you want to know how it works  //
+//  Please look at the three CleanSteps and Process                        //
+//                                                                         //
+//  Input Containers:                                                      //
+//   MGeomCam, MCerPhotEvt                                                 //
+//                                                                         //
+//  Output Containers:                                                     //
+//   -/-                                                                   //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MImgCleanStd.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+#include "MGeomCam.h"
+#include "MCerPhotPix.h"
+#include "MCerPhotEvt.h"
+
+ClassImp(MImgCleanStd);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. Here you can specify the cleaning levels. If you
+// don't specify them the 'common standard' values 2.5 and 3.0 (sigma
+// above mean) are used
+//
+MImgCleanStd::MImgCleanStd(const Float_t lvl1, const Float_t lvl2,
+                           const char *name, const char *title)
+    : fCleanLvl1(lvl1), fCleanLvl2(lvl2)
+{
+    *fName  = name  ? name  : "MImgCleanStd";
+    *fTitle = title ? title : "Task which does a standard image cleaning";
+
+    *fLog << "Cleaning initialized. Using noise level " << lvl1 << " and " << lvl2 << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+//  This method looks for all pixels with an entry (photons)
+//  that is three times bigger than the noise of the pixel
+//  (std: 3 sigma, clean level 1)
+//
+void MImgCleanStd::CleanStep1()
+{
+    const Int_t entries = fEvt->GetNumPixels();
+
+    //
+    // check the number of all pixels against the noise level and
+    // set them to 'unused' state if necessary
+    //
+    for (Int_t i=0; i<entries; i++ )
+    {
+        MCerPhotPix &pix = (*fEvt)[i];
+
+        const Float_t entry = pix.GetNumPhotons();
+        const Float_t noise = pix.GetErrorPhot();
+
+        // COBB: '<=' to skip entry=noise=0
+        if (entry <= fCleanLvl1 * noise )
+            pix.SetPixelUnused();
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+//  check if the survived pixel have a neighbor, that also
+//  survived
+//
+void MImgCleanStd::CleanStep2()
+{
+    const Int_t entries = fEvt->GetNumPixels();
+
+    for (Int_t i=0; i<entries; i++)
+    {
+        //
+        // get entry i from list
+        //
+        MCerPhotPix &pix = (*fEvt)[i];
+
+        //
+        // check if pixel is in use, if not goto next pixel in list
+        //
+        if (!pix.IsPixelUsed())
+            continue;
+
+        //
+        // get pixel id of this entry
+        //
+        const Int_t id = pix.GetPixId();
+
+        //
+        // count number of next neighbors of this pixel which
+        // state is 'used'
+        //
+        const MGeomPix &gpix  = (*fCam)[id];
+        const Int_t     nnmax = gpix.GetNumNeighbors();
+
+        Int_t cnt = 0;
+        for (Int_t j=0; j<nnmax; j++)
+        {
+            const Int_t id2 = gpix.GetNeighbor(j); //GetNN(id, in) ;
+
+            if (id2 < 0)
+                continue;
+
+            if (fEvt->IsPixelUsed(id2))
+                cnt++;
+        }
+
+        //
+        // check if no next neighbor has the state 'used'
+        // set this pixel to 'unused', too.
+        //
+        if (cnt==0)
+            pix.SetPixelUnused();
+    }
+
+    //
+    // now we declare all pixels that survive as CorePixels
+    //
+    for (Int_t i=0; i<entries; i++)
+    {
+        MCerPhotPix &pix = (*fEvt)[i];
+
+        if (pix.IsPixelUsed())
+            pix.SetCorePixel();
+    }
+} 
+
+// --------------------------------------------------------------------------
+//
+//   Look for the boundary pixels around the core pixels
+//   if a pixel has more than 2.5 (clean level 2) sigma, and
+//   a core neigbor it is declared as used.
+//
+void MImgCleanStd::CleanStep3()
+{
+    const Int_t entries = fEvt->GetNumPixels();
+
+    for (Int_t i=0; i<entries; i++)
+    {
+        //
+        // get pixel as entry il from list
+        //
+        MCerPhotPix &pix = (*fEvt)[i];
+
+        //
+        // if pixel is a core pixel go to the next pixel
+        //
+        if (pix.IsCorePixel())
+            continue;
+
+        //
+        // check the num of photons against the noise level
+        //
+        const Float_t entry = pix.GetNumPhotons();
+        const Float_t noise = pix.GetErrorPhot();
+
+        if (entry <= fCleanLvl2 * noise )
+            continue;
+
+        //
+        // get pixel id of this entry
+        //
+        const Int_t id = pix.GetPixId();
+
+        //
+        // check if the pixel's next neighbor is a core pixel.
+        // if it is a core pixel set pixel state to: used.
+        //
+        MGeomPix   &gpix  = (*fCam)[id];
+        const Int_t nnmax = gpix.GetNumNeighbors();
+
+        for (Int_t j=0; j<nnmax; j++)
+        {
+            const Int_t id2 = gpix.GetNeighbor(j);
+
+            if (id2 <0)
+                continue;
+
+            if (!fEvt->IsPixelCore(id2))
+                continue;
+
+            pix.SetPixelUsed();
+
+            break ;
+        }
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+//  check if MEvtHeader exists in the Parameter list already.
+//  if not create one and add them to the list
+//
+Bool_t MImgCleanStd::PreProcess (MParList *pList)
+{
+    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
+    if (!fCam)
+    {
+        *fLog << dbginf << "MGeomCam not found (no geometry information available)... aborting." << endl;
+        return kFALSE;
+    }
+
+    fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
+    if (!fEvt)
+    {
+        *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    return kTRUE;
+}
+    
+// --------------------------------------------------------------------------
+//
+// Cleans the image.
+//
+Bool_t MImgCleanStd::Process()
+{
+    CleanStep1();
+    CleanStep2();
+    CleanStep3();
+
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MImgCleanStd.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MImgCleanStd.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MImgCleanStd.h	(revision 9634)
@@ -0,0 +1,38 @@
+#ifndef MIMGCLEANSTD_H
+#define MIMGCLEANSTD_H
+
+#ifndef MAGIC_h
+#include "MAGIC.h"
+#endif
+#ifndef MPARCONTAINER_H
+#include "MTask.h"
+#endif
+
+class MGeomCam;
+class MCerPhotEvt;
+
+class MImgCleanStd : public MTask
+{
+private:
+    const MGeomCam *fCam;
+          MCerPhotEvt *fEvt;
+
+    Float_t fCleanLvl1;
+    Float_t fCleanLvl2;
+
+public:
+    MImgCleanStd(const Float_t lvl1=3.0, const Float_t lvl2=2.5,
+                 const char *name=NULL, const char *title=NULL);
+
+    void CleanStep1();
+    void CleanStep2();
+    void CleanStep3();
+
+    Bool_t PreProcess (MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MImgCleanStd, 0)    // task doing a standard image cleaning
+}; 
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/manalysis/MMcPedestalCopy.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MMcPedestalCopy.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MMcPedestalCopy.cc	(revision 9634)
@@ -0,0 +1,95 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//  MMcPedestalCopy                                                        //
+//                                                                         //
+//  Input Containers:                                                      //
+//   MMcFadcHeader                                                         //
+//                                                                         //
+//  Output Containers:                                                     //
+//   MPedestalCam                                                          //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MMcPedestalCopy.h"
+
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MPedestalCam.h"
+#include "MMcFadcHeader.hxx"
+
+ClassImp(MMcPedestalCopy);
+
+MMcPedestalCopy::MMcPedestalCopy(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MMcPedestalCopy";
+    *fTitle = title ? title : "Task to copy monte carlo pedestals into MPedestal Container";
+}
+
+Bool_t MMcPedestalCopy::PreProcess( MParList *pList )
+{
+    fMcPedestals = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader");
+    if (!fMcPedestals)
+    {
+        *fLog << dbginf << "MMcFadcHeader not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
+    if (!fPedestals)
+        return kFALSE;
+
+    return kTRUE;
+}
+
+Bool_t MMcPedestalCopy::Process()
+{
+    const int num = fMcPedestals->GetNumPixel();
+
+    fPedestals->InitSize(num);
+
+    for (int i=0; i<num; i++)
+    {
+        MPedestalPix &pix = (*fPedestals)[i];
+
+        const Float_t pedest = fMcPedestals->GetPedestal(i);
+        const Float_t pedrms = fMcPedestals->GetPedestalRms(i);
+
+        const Float_t sigma  = pedest*sqrt(num);
+        const Float_t sigrms = sigma/sqrt(2*num);
+
+        pix.SetPedestal(pedest, sigma);
+        pix.SetPedestalRms(pedrms, sigrms);
+
+        *fLog << pedest << " " << sigma << " " << pedrms << " " << sigrms << endl;
+    }
+
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MMcPedestalCopy.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MMcPedestalCopy.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MMcPedestalCopy.h	(revision 9634)
@@ -0,0 +1,39 @@
+#ifndef MMCPEDESTALCOPY_H
+#define MMCPEDESTALCOPY_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MMcPedestalCopy                                                         //
+//                                                                         //
+// This task copies the pedestals from the MC data into the corresponding  //
+// MARS Container (MPedestals). This seems to be overdone, but at this     //
+// point you have a standard interface to access the pedestals             //
+// (MPedestals), which makes it possible that from now on all pedestals    //
+// can be treated in the same way                                          //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MMcFadcHeader;
+class MPedestalCam;
+
+class MMcPedestalCopy : public MTask
+{
+    const MMcFadcHeader *fMcPedestals;  //
+          MPedestalCam  *fPedestals;    //
+
+          TString       *fSrc;
+
+public:
+    MMcPedestalCopy(const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MMcPedestalCopy, 0)   // Task which copies the pedestals from the MC into the standard container
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/manalysis/MPedCalcPedRun.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MPedCalcPedRun.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MPedCalcPedRun.cc	(revision 9634)
@@ -0,0 +1,139 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Josep Flix 04/2001 (jflix@ifae.es)
+!              Thomas Bretz 05/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//   MPedCalcPedRun                                                        //
+//                                                                         //
+//  Input Containers:                                                      //
+//   MRawEvtData                                                           //
+//                                                                         //
+//  Output Containers:                                                     //
+//   MPedestalCam                                                          //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MPedCalcPedRun.h"
+
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MRawEvtPixelIter.h"
+#include "MRawEvtData.h"
+
+#include "MPedestalPix.h"
+#include "MPedestalCam.h"
+
+ClassImp(MPedCalcPedRun);
+
+MPedCalcPedRun::MPedCalcPedRun(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MPedCalcPedRun";
+    *fTitle = title ? title : "Task to calculate pedestals from pedestal runs raw data";
+}
+
+Bool_t MPedCalcPedRun::PreProcess( MParList *pList )
+{
+    fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
+    if (!fRawEvt)
+    {
+        *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
+    if (!fPedestals)
+        return kFALSE;
+
+    fNumHiGainSamples = fRawEvt->GetNumHiGainSamples();
+
+    return kTRUE;
+}
+
+
+Bool_t MPedCalcPedRun::Process()
+{
+    MRawEvtPixelIter pixel(fRawEvt);
+
+    while (pixel.Next())
+    {
+              Byte_t *ptr = pixel.GetHiGainFadcSamples();
+        const Byte_t *end = ptr + fRawEvt->GetNumHiGainSamples();
+
+        const Float_t higainped = CalcHiGainMean(ptr, end);
+        const Float_t higainrms = CalcHiGainRms(ptr, end, higainped);
+
+        const Float_t higainpederr = CalcHiGainMeanErr(higainrms);
+        const Float_t higainrmserr = CalcHiGainRmsErr(higainrms);
+
+        const UInt_t pixid = pixel.GetPixelId();
+        MPedestalPix &pix = (*fPedestals)[pixid];
+
+        pix.SetPedestal(higainped, higainrms);
+        pix.SetPedestalRms(higainpederr, higainrmserr);
+    }
+
+    fPedestals->SetReadyToSave();
+
+    return kTRUE;
+}
+
+Float_t MPedCalcPedRun::CalcHiGainMean(Byte_t *ptr, const Byte_t *end) const
+{
+    Int_t sum=0;
+
+    do sum += *ptr;
+    while (++ptr != end);
+
+    return (Float_t)sum/fNumHiGainSamples;
+}
+
+
+Float_t MPedCalcPedRun::CalcHiGainRms(Byte_t *ptr, const Byte_t *end, Float_t higainped) const
+{
+    Float_t rms = 0;
+
+    do
+    {
+        const Float_t diff = (Float_t)(*ptr)-higainped;
+
+        rms += diff*diff;
+    } while (++ptr != end);
+
+    return sqrt(rms/(fNumHiGainSamples-1));
+}
+
+Float_t MPedCalcPedRun::CalcHiGainMeanErr(Float_t higainrms) const
+{
+    return higainrms/sqrt(fNumHiGainSamples);
+}
+
+Float_t MPedCalcPedRun::CalcHiGainRmsErr(Float_t higainrms) const
+{
+    return higainrms/sqrt(2.*fNumHiGainSamples);
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MPedCalcPedRun.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MPedCalcPedRun.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MPedCalcPedRun.h	(revision 9634)
@@ -0,0 +1,41 @@
+#ifndef MPEDCALCPEDRUN_H
+#define MPEDCALCPEDRUN_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MPedCalcPedRun                                                          //
+//                                                                         //
+// Evaluate the pedestals from pedestal runs                               //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MRawEvtData;
+class MPedestalCam;
+
+class MPedCalcPedRun : public MTask
+{
+    Byte_t fNumHiGainSamples;
+
+    MRawEvtData  *fRawEvt;     // raw event data (time slices)
+    MPedestalCam *fPedestals;  // Pedestals of all pixels in the camera
+
+    Float_t CalcHiGainMean(Byte_t *ptr, const Byte_t *end) const;
+    Float_t CalcHiGainRms(Byte_t *ptr, const Byte_t *end, Float_t higainped) const;
+    Float_t CalcHiGainMeanErr(Float_t higainrms) const;
+    Float_t CalcHiGainRmsErr(Float_t higainrms) const;
+
+public:
+
+    MPedCalcPedRun(const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MPedCalcPedRun, 0)   // Task to calculate pedestals from pedestal runs raw data
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/manalysis/MPedestalCam.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MPedestalCam.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MPedestalCam.cc	(revision 9634)
@@ -0,0 +1,65 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MPedestalCam                                                            //
+//                                                                         //
+// Hold the Pedestal information for all pixels in the camera              //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MPedestalCam.h"
+
+#include "MLog.h"
+
+ClassImp(MPedestalCam);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. Creates a MPedestalPix object for each pixel
+//
+MPedestalCam::MPedestalCam(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MPedestalCam";
+    *fTitle = title ? title : "Storage container for all Pedestal Information in the camera";
+
+    fArray = new TClonesArray("MPedestalPix", 577);
+
+    //
+    // TClonesArray: The 'new operator with placement' must be used
+    //
+    for (int i=0; i<577; i++)
+        new ((*fArray)[i]) MPedestalPix;
+}
+
+// --------------------------------------------------------------------------
+//
+// Delete the array conatining the pixel pedest information
+//
+MPedestalCam::~MPedestalCam()
+{
+    // FIXME: Do we have to delete the objects itself?
+    delete fArray;
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MPedestalCam.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MPedestalCam.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MPedestalCam.h	(revision 9634)
@@ -0,0 +1,34 @@
+#ifndef MPEDESTALCAM_H
+#define MPEDESTALCAM_H
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+#ifndef MPEDESTALPIX_H
+#include "MPedestalPix.h"
+#endif
+
+#ifndef ROOT_TClonesArray
+#include <TClonesArray.h>
+#endif
+
+class MPedestalCam : public MParContainer
+{
+private:
+    TClonesArray *fArray;
+
+public:
+    MPedestalCam(const char *name=NULL, const char *title=NULL);
+    ~MPedestalCam();
+
+    void InitSize(const UInt_t i) { fArray->ExpandCreateFast(i); }
+
+    MPedestalPix &operator[](Int_t i)       { return *(MPedestalPix*)fArray->At(i); }
+    MPedestalPix &operator[](Int_t i) const { return *(MPedestalPix*)fArray->At(i); }
+
+    ClassDef(MPedestalCam, 1)	// Storage Container for all pedestal information of the camera
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/manalysis/MPedestalPix.cc
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MPedestalPix.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MPedestalPix.cc	(revision 9634)
@@ -0,0 +1,43 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MPedestalPix                                                            //
+//                                                                         //
+// This is the storage container to hold informations about the pedestal   //
+// (offset) value of one Pixel (PMT).                                      //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MPedestalPix.h"
+
+#include "MLog.h"
+
+ClassImp(MPedestalPix);
+
+MPedestalPix::MPedestalPix()
+    : fMean(0.0), fSigma(0.0), fMeanRms(0.0), fSigmaRms(0.0)
+{
+}
+
Index: /tags/Mars_V0-4/Mars/manalysis/MPedestalPix.h
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/MPedestalPix.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/MPedestalPix.h	(revision 9634)
@@ -0,0 +1,36 @@
+#ifndef MPEDESTALPIX_H
+#define MPEDESTALPIX_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+class MPedestalPix : public TObject
+{
+private:
+    Float_t fMean;     // mean value of pedestal (PMT offset)
+    Float_t fSigma;    // sigma (standard deviation) of pedestal
+    Float_t fMeanRms;  // root mean square of pedestal
+    Float_t fSigmaRms; // root mean sqare of sigma of the pedestal
+
+public:
+    MPedestalPix();
+
+    Float_t GetMean() const     { return fMean;     }
+    Float_t GetSigma() const    { return fSigma;    }
+    Float_t GetMeanRms() const  { return fMeanRms;  }
+    Float_t GetSigmaRms() const { return fSigmaRms; }
+
+    void SetMean(Float_t f)     { fMean = f;     }
+    void SetSigma(Float_t f)    { fSigma = f;    }
+    void SetMeanRms(Float_t f)  { fMeanRms = f;  }
+    void SetSigmaRms(Float_t f) { fSigmaRms = f; }
+
+    void SetPedestal(Float_t m, Float_t s) { fMean = m; fSigma = s; }
+    void SetPedestalRms(Float_t m, Float_t s) { fMeanRms = m; fSigmaRms = s; }
+
+    ClassDef(MPedestalPix, 1)	// Storage Container for Pedestal information of one pixel
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/manalysis/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/manalysis/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/manalysis/Makefile	(revision 9634)
@@ -0,0 +1,57 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Analysis
+
+#
+# Library name to creatre
+#
+LIB   = manalysis.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../mgui -I../mmc -I../mraw
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MCT1ReadAscii.cc \
+           MPedestalCam.cc \
+           MPedestalPix.cc \
+           MMcPedestalCopy.cc \
+           MImgCleanStd.cc \
+           MHillas.cc \
+           MHillasCalc.cc \
+           MCerPhotCalc.cc \
+	   MCerPhotEvt.cc \
+	   MCerPhotPix.cc \
+	   MPedCalcPedRun.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mars.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mars.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mars.cc	(revision 9634)
@@ -0,0 +1,37 @@
+#include <TROOT.h>
+#include <TApplication.h>
+
+#include "MMars.h"
+
+// **********************************************************************
+//
+//    MARS main program  
+//
+//    The only job of the main program is the initialisation of ROOT and 
+//    the start of the guiinterface for the mars program
+//
+//    started by  h. kornmayer      january, 3rd  2001 
+
+int main(int argc, char **argv )
+{
+    //
+    // initialise ROOT
+    //
+    TROOT simple("Mars", "MARS - MAGIC analysis and reconstruction software");
+
+    TApplication app("MarsApp", &argc, argv);
+
+    //
+    // start the main window
+    //
+    new MMars;
+
+    //
+    // run the application
+    //
+    app.Run();
+
+    return 0;
+}
+ 
+
Index: /tags/Mars_V0-4/Mars/marslogo.xpm
===================================================================
--- /tags/Mars_V0-4/Mars/marslogo.xpm	(revision 9634)
+++ /tags/Mars_V0-4/Mars/marslogo.xpm	(revision 9634)
@@ -0,0 +1,582 @@
+/* XPM */
+static char * marslogo_xpm[] = {
+"124 108 471 2",
+"  	c None",
+". 	c #212121",
+"+ 	c #313131",
+"@ 	c #292929",
+"# 	c #181829",
+"$ 	c #101010",
+"% 	c #080808",
+"& 	c #393942",
+"* 	c #000000",
+"= 	c #000008",
+"- 	c #000808",
+"; 	c #000810",
+"> 	c #080818",
+", 	c #081021",
+"' 	c #081829",
+") 	c #082131",
+"! 	c #103942",
+"~ 	c #102939",
+"{ 	c #001029",
+"] 	c #001021",
+"^ 	c #102131",
+"/ 	c #294A4A",
+"( 	c #213942",
+"_ 	c #31424A",
+": 	c #425252",
+"< 	c #182939",
+"[ 	c #18394A",
+"} 	c #29394A",
+"| 	c #313942",
+"1 	c #314A42",
+"2 	c #294242",
+"3 	c #525A4A",
+"4 	c #636B5A",
+"5 	c #737B7B",
+"6 	c #7B948C",
+"7 	c #849494",
+"8 	c #6B7363",
+"9 	c #4A5A52",
+"0 	c #394A42",
+"a 	c #39424A",
+"b 	c #083142",
+"c 	c #313139",
+"d 	c #736B52",
+"e 	c #948473",
+"f 	c #9C9C94",
+"g 	c #A5AD94",
+"h 	c #84846B",
+"i 	c #5A524A",
+"j 	c #424A42",
+"k 	c #002939",
+"l 	c #293139",
+"m 	c #7B6B6B",
+"n 	c #BDBDB5",
+"o 	c #B5BDAD",
+"p 	c #A5A594",
+"q 	c #AD9C8C",
+"r 	c #A5947B",
+"s 	c #84735A",
+"t 	c #5A5A52",
+"u 	c #4A4A42",
+"v 	c #081029",
+"w 	c #314A52",
+"x 	c #394242",
+"y 	c #7B635A",
+"z 	c #BD9C94",
+"A 	c #C6ADA5",
+"B 	c #BD9C8C",
+"C 	c #A5846B",
+"D 	c #9C6B5A",
+"E 	c #8C6352",
+"F 	c #846352",
+"G 	c #84634A",
+"H 	c #635242",
+"I 	c #5A5242",
+"J 	c #001839",
+"K 	c #4A4A4A",
+"L 	c #424242",
+"M 	c #5A4A42",
+"N 	c #735242",
+"O 	c #6B4A42",
+"P 	c #6B5242",
+"Q 	c #736352",
+"R 	c #6B5A52",
+"S 	c #52524A",
+"T 	c #524A42",
+"U 	c #000010",
+"V 	c #21425A",
+"W 	c #7B5A42",
+"X 	c #8C5A42",
+"Y 	c #9C6342",
+"Z 	c #735A52",
+"` 	c #735A42",
+" .	c #080821",
+"..	c #294A63",
+"+.	c #9C5A42",
+"@.	c #A56342",
+"#.	c #94634A",
+"$.	c #946B4A",
+"%.	c #8C634A",
+"&.	c #213142",
+"*.	c #294A5A",
+"=.	c #8C5A4A",
+"-.	c #001831",
+";.	c #183152",
+">.	c #395263",
+",.	c #6B4A4A",
+"'.	c #9C634A",
+").	c #A56B4A",
+"!.	c #21394A",
+"~.	c #4A6373",
+"{.	c #39525A",
+"].	c #524A4A",
+"^.	c #081031",
+"/.	c #4A525A",
+"(.	c #52525A",
+"_.	c #5A5A5A",
+":.	c #AD634A",
+"<.	c #B56342",
+"[.	c #08294A",
+"}.	c #AD6B4A",
+"|.	c #214252",
+"1.	c #B56B4A",
+"2.	c #B5634A",
+"3.	c #101829",
+"4.	c #524242",
+"5.	c #BD6B4A",
+"6.	c #002952",
+"7.	c #C6734A",
+"8.	c #083152",
+"9.	c #00214A",
+"0.	c #18314A",
+"a.	c #425A6B",
+"b.	c #BD7352",
+"c.	c #CE7B52",
+"d.	c #104263",
+"e.	c #39526B",
+"f.	c #B56B52",
+"g.	c #D66B4A",
+"h.	c #D6734A",
+"i.	c #424A52",
+"j.	c #293952",
+"k.	c #185284",
+"l.	c #9C6B52",
+"m.	c #AD6352",
+"n.	c #294A52",
+"o.	c #31638C",
+"p.	c #525A63",
+"q.	c #31526B",
+"r.	c #39638C",
+"s.	c #182131",
+"t.	c #4A637B",
+"u.	c #946B52",
+"v.	c #DE734A",
+"w.	c #396384",
+"x.	c #08426B",
+"y.	c #526373",
+"z.	c #42637B",
+"A.	c #342E01",
+"B.	c #9F8D04",
+"C.	c #ADA622",
+"D.	c #BAAE2B",
+"E.	c #BAA822",
+"F.	c #B8AB20",
+"G.	c #CBAE20",
+"H.	c #AE7B3B",
+"I.	c #D39D30",
+"J.	c #DBAE1D",
+"K.	c #DBB120",
+"L.	c #DEB11D",
+"M.	c #DBAE1A",
+"N.	c #CF883B",
+"O.	c #E1B31D",
+"P.	c #D9AE1D",
+"Q.	c #E9B31D",
+"R.	c #E6B31D",
+"S.	c #BB823B",
+"T.	c #CEAB1D",
+"U.	c #C0A81A",
+"V.	c #BDA81D",
+"W.	c #CBAE1D",
+"X.	c #D3AE1D",
+"Y.	c #D6AE1A",
+"Z.	c #D6B11D",
+"`.	c #BC952C",
+" +	c #898B3A",
+".+	c #B5AE2D",
+"++	c #B2AE33",
+"@+	c #A7A830",
+"#+	c #9F9517",
+"$+	c #4F4602",
+"%+	c #EFD407",
+"&+	c #B78E39",
+"*+	c #DE9333",
+"=+	c #A78833",
+"-+	c #E5C70E",
+";+	c #B2A822",
+">+	c #DAC510",
+",+	c #BBA607",
+"'+	c #85791E",
+")+	c #847503",
+"!+	c #C38839",
+"~+	c #D99839",
+"{+	c #E7C017",
+"]+	c #EF7B4A",
+"^+	c #E77B52",
+"/+	c #EF8E3B",
+"(+	c #EBAC28",
+"_+	c #D39333",
+":+	c #9D6F42",
+"<+	c #A77B3B",
+"[+	c #C6A124",
+"}+	c #B7882E",
+"|+	c #73635A",
+"1+	c #9C883E",
+"2+	c #AF9D15",
+"3+	c #C9A528",
+"4+	c #A57649",
+"5+	c #EDC80E",
+"6+	c #DE7B52",
+"7+	c #ECB620",
+"8+	c #AD8233",
+"9+	c #806F50",
+"0+	c #D3BB06",
+"a+	c #9F9007",
+"b+	c #C88E39",
+"c+	c #C88E33",
+"d+	c #395A7B",
+"e+	c #A2900C",
+"f+	c #EFB61D",
+"g+	c #EF7B52",
+"h+	c #E39333",
+"i+	c #CBBA1B",
+"j+	c #81884F",
+"k+	c #295A84",
+"l+	c #A49515",
+"m+	c #C8933E",
+"n+	c #BD735A",
+"o+	c #D58E41",
+"p+	c #8C6B5A",
+"q+	c #B39935",
+"r+	c #E2C810",
+"s+	c #08395A",
+"t+	c #BDA910",
+"u+	c #EEC90F",
+"v+	c #E3A824",
+"w+	c #D87D42",
+"x+	c #E5BE15",
+"y+	c #E3BC15",
+"z+	c #D3992C",
+"A+	c #CBB122",
+"B+	c #D67B5A",
+"C+	c #E3983E",
+"D+	c #E9B620",
+"E+	c #E4B620",
+"F+	c #8C6B63",
+"G+	c #CEB122",
+"H+	c #395A84",
+"I+	c #AD8E44",
+"J+	c #CEB125",
+"K+	c #C6735A",
+"L+	c #EF8452",
+"M+	c #E99839",
+"N+	c #CD9339",
+"O+	c #946B63",
+"P+	c #5A637B",
+"Q+	c #315A7B",
+"R+	c #A1883E",
+"S+	c #C8AE22",
+"T+	c #E6B622",
+"U+	c #EF9E39",
+"V+	c #DEB320",
+"W+	c #D6B122",
+"X+	c #A56B5A",
+"Y+	c #A57363",
+"Z+	c #E39839",
+"`+	c #EBC017",
+" @	c #E9C80F",
+".@	c #B8AE2D",
+"+@	c #607461",
+"@@	c #8B8844",
+"#@	c #8F7658",
+"$@	c #CBB125",
+"%@	c #E2BE19",
+"&@	c #D39D35",
+"*@	c #C67B5A",
+"=@	c #E4B622",
+"-@	c #EBC910",
+";@	c #DE845A",
+">@	c #E9B922",
+",@	c #EF845A",
+"'@	c #EFA230",
+")@	c #EFC217",
+"!@	c #EFAC28",
+"~@	c #EF8E41",
+"{@	c #DE7B5A",
+"]@	c #CE7B5A",
+"^@	c #E3BE19",
+"/@	c #DEB322",
+"(@	c #D9AE20",
+"_@	c #DEBC19",
+":@	c #B58247",
+"<@	c #9C7363",
+"[@	c #8C736B",
+"}@	c #A18855",
+"|@	c #BFA533",
+"1@	c #C4B61D",
+"2@	c #7C823E",
+"3@	c #554C07",
+"4@	c #B9A407",
+"5@	c #846B63",
+"6@	c #E77B5A",
+"7@	c #ECB622",
+"8@	c #EFB620",
+"9@	c #EF9839",
+"0@	c #E3AC2C",
+"a@	c #DB8E47",
+"b@	c #DBB322",
+"c@	c #C59935",
+"d@	c #CBB128",
+"e@	c #BBB31D",
+"f@	c #4F5623",
+"g@	c #5A6363",
+"h@	c #EF9833",
+"i@	c #B5735A",
+"j@	c #846B6B",
+"k@	c #E9B622",
+"l@	c #E9983E",
+"m@	c #636363",
+"n@	c #947363",
+"o@	c #C5B12B",
+"p@	c #6B6363",
+"q@	c #D0B125",
+"r@	c #E8C810",
+"s@	c #E9C019",
+"t@	c #E19547",
+"u@	c #EFB922",
+"v@	c #EDC90F",
+"w@	c #6B5252",
+"x@	c #AC9D2C",
+"y@	c #B7A12C",
+"z@	c #7B7373",
+"A@	c #8E825B",
+"B@	c #9C8E4F",
+"C@	c #B3A533",
+"D@	c #8B823E",
+"E@	c #736B73",
+"F@	c #797660",
+"G@	c #8B8249",
+"H@	c #45422C",
+"I@	c #706723",
+"J@	c #BAAB25",
+"K@	c #7B6B5A",
+"L@	c #AE9935",
+"M@	c #DCBC19",
+"N@	c #E3BE17",
+"O@	c #DCA235",
+"P@	c #E78450",
+"Q@	c #E5BE19",
+"R@	c #AE8241",
+"S@	c #545949",
+"T@	c #757233",
+"U@	c #8B8239",
+"V@	c #6B6B6B",
+"W@	c #6B621D",
+"X@	c #B79344",
+"Y@	c #D3933E",
+"Z@	c #E39E3E",
+"`@	c #D3B120",
+" #	c #977D39",
+".#	c #736B6B",
+"+#	c #AD8E3E",
+"@#	c #D0B120",
+"##	c #75783E",
+"$#	c #846B5A",
+"%#	c #BD8E3E",
+"&#	c #AD8839",
+"*#	c #EBAC2C",
+"=#	c #EF9547",
+"-#	c #4A4A5A",
+";#	c #A7884E",
+">#	c #D0B325",
+",#	c #A1824E",
+"'#	c #817B4E",
+")#	c #1A1700",
+"!#	c #978239",
+"~#	c #EBC219",
+"{#	c #D3B122",
+"]#	c #C2A530",
+"^#	c #A78E44",
+"/#	c #978844",
+"(#	c #ACA130",
+"_#	c #3E3B25",
+":#	c #968716",
+"<#	c #D3BB07",
+"[#	c #A7A01D",
+"}#	c #817833",
+"|#	c #E2C70F",
+"1#	c #E18E41",
+"2#	c #E2BC17",
+"3#	c #9D962C",
+"4#	c #BDA61D",
+"5#	c #E5C810",
+"6#	c #967650",
+"7#	c #C6A530",
+"8#	c #D3BE0B",
+"9#	c #9F8D07",
+"0#	c #7B7839",
+"a#	c #5A4A4A",
+"b#	c #9F9515",
+"c#	c #425263",
+"d#	c #556739",
+"e#	c #000821",
+"f#	c #4A424A",
+"g#	c #817233",
+"h#	c #394A5A",
+"i#	c #18395A",
+"j#	c #5A510D",
+"k#	c #C27D49",
+"l#	c #D88450",
+"m#	c #A78839",
+"n#	c #9C8239",
+"o#	c #707233",
+"p#	c #6B6C33",
+"q#	c #6B6C39",
+"r#	c #707839",
+"s#	c #A18247",
+"t#	c #B78E3E",
+"u#	c #A78E3E",
+"v#	c #867D3E",
+"w#	c #657239",
+"x#	c #081839",
+"y#	c #000829",
+"z#	c #29314A",
+"A#	c #293942",
+"B#	c #293142",
+"C#	c #292139",
+"D#	c #101021",
+"E#	c #002131",
+"F#	c #5A5A6B",
+"G#	c #636B73",
+"H#	c #5A6373",
+"I#	c #4A5A73",
+"J#	c #425A73",
+"K#	c #394A63",
+"L#	c #31425A",
+"M#	c #080829",
+"N#	c #5A6B84",
+"O#	c #637384",
+"P#	c #6B7B84",
+"Q#	c #6B6B7B",
+"R#	c #636B7B",
+"S#	c #5A6B73",
+"T#	c #637B94",
+"U#	c #738494",
+"V#	c #6B7B8C",
+"W#	c #7B7B84",
+"X#	c #7B737B",
+"Y#	c #6B6B73",
+"Z#	c #4A5A6B",
+"`#	c #314A73",
+" $	c #21395A",
+".$	c #526B8C",
+"+$	c #6B8494",
+"@$	c #29527B",
+"#$	c #101831",
+"$$	c #6B738C",
+"%$	c #21426B",
+"&$	c #294A6B",
+"*$	c #18315A",
+"=$	c #29294A",
+"-$	c #103152",
+". . . + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ + ",
+". . . + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ + ",
+"+ + + # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ % & ",
+"+ + + % * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + ",
+"+ + + % * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + ",
+"+ + + % * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * = - - - = = = = * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + ",
+"@ @ @ % * * * % % * * * % * * * % % * * * % % * * % % * * * % * * * * % * * * * % * * * * * * * * = ; ; > > , , ' ' ) ) ) ! ! ! ! ~ ) ) ) ) ) { ] ] ; - - * * * * * * % % * * % % * * * % * * * * % * * * * % * * * % % * * * % * * * * % * * * * * * + ",
+"+ + + % * % % * * * * * * * * % * * * * * * * * % * * * * * * * * * % * * * * * * * * * ; ; , ^ ^ ! ! ! / / ( / / / _ _ : : : : : : _ ( ( ( ( ( ! ! ! ~ ~ ) ] ] ; * * * * * * * * * * % * * * * * * * * % % * * * * * * * % % * * * * * * * % % * * * + ",
+"+ + + % * % % * * * * * * * * % * * * * * * * * % * * * * * * * * * % * * * * * * * * * ; ; , ^ ^ ! ! ! / / ( / / / _ _ : : : : : : _ ( ( ( ( ( ! ! ! ~ ~ ) ] ] ; * * * * * * * * * * % * * * * * * * * % % * * * * * * * % % * * * * * * * % % * * * + ",
+"@ @ @ $ * * * * * * * * % * * * * * * * * % % * * * * * * * % * * * * * * * * * = , , < [ [ } / / | 1 1 2 2 1 3 3 3 4 4 5 6 7 7 7 5 8 9 9 0 0 1 0 0 a / / ( ! ! b ) ) ] ] % * * * * * * * * * * * % * * * * * * * * % % * * * * * * * * % * * * * * * + ",
+"+ + + % * * * * * % * * * % % * * * % * * * * % * * * % % * * * * * * * - - ' ' ! / / / 2 2 2 ( ( ( c c : : 8 8 d d 8 8 e f g g g g h d d i i 0 3 3 9 9 9 j 1 1 2 ! ! ! ! k { ; ; * * * * % % % * * % % * * * % % * * * % * * * % % * * * % * * * * * + ",
+"@ @ @ $ * % % * * * * * * * * * % % * * * * * * * % % * * * * * * * % ' [ [ _ _ : a a _ _ _ | l l ( c c m m n o g g p p q q r r r e s d d d d 3 t t t 4 4 i u u j 0 0 2 2 ( ! k k v v = * * * * * * * * * * % * * * * * * * * % * * * * * * * * % % * + ",
+"@ @ @ $ * % % * * * * * * * * * % % * * * * * * * % % * * * * * * * % ' [ [ _ _ : a a _ _ _ | l l ( c c m m n o g g p p q q r r r e s d d d d 3 t t t 4 4 i u u j 0 0 2 2 ( ! k k v v = * * * * * * * * * * % * * * * * * * * % * * * * * * * * % % * + ",
+"+ + + % * * * * * % * * * % % * * * * * * % % * * * * * * * * , , , ! w a a a a a a a 0 x x c c c + c c y y z A B B C C C D E E E F G H H I I i 4 4 H d d 4 I I 3 u u 0 0 0 2 ! ! b b J , = = = * * % % * * * * * * % % * * * * * * * * % * * * * * * + ",
+"@ @ @ $ * * * * * * % % * * * * * * % * * * * * % * * * * ; ~ / / / 0 a u u K K : j j L u u H u u L L L L L M N O O H H H P Q Q Q R S 3 3 I I 3 i i d P P H H H I T T u u u x | | ( ( ! k ' ' ' U * * * * * * % % * * * * % % * % % * * * * % % * * * + ",
+"+ + + % * % % * * * * * * * * % * * * * * % % * * * * ' ' V : | | | | j u u 3 3 H P P N W W X Y Y X W W P P M M M M T T M i P P P H H Z Z ` ` ` s s G ` ` ` P P H H H I I T j c c 2 2 2 ! b b b J  .* * % % * * * * % % * * * * * * * * % * * * * * * + ",
+"+ + + % * % % * * * * * * * * % * * * * * % % * * * * ' ' V : | | | | j u u 3 3 H P P N W W X Y Y X W W P P M M M M T T M i P P P H H Z Z ` ` ` s s G ` ` ` P P H H H I I T j c c 2 2 2 ! b b b J  .* * % % * * * * % % * * * * * * * * % * * * * * * + ",
+"@ @ @ $ * * * * * % * * % * * * * * % * * * * * * ~ ~ ....: _ | | | 0 j I I N N W Y Y Y +.+.+.Y Y +.Y Y @.@.Y @.Y Y Y Y X Y #.#.#.$.#.%.%.%.%.G W W W W W ` ` ` P P P H H I u 0 0 0 0 | 2 ! ! ! b k ] ] = = * * * % * * * * * % * * * * * * % % * * * + ",
+"+ + + % * * * % % * * * * * * % * * * * * * * = &.*.*._ _ _ | x x x L u I I W W =.X X +.Y Y Y Y Y Y @.@.@.@.@.+.X X Y Y Y Y X X X X Y X X X X G G G W W W ` ` ` P P P P P I T j j j j j x 2 2 2 ( ! k k -.-.% * * * * * * % % * * * % % * * * * * * * + ",
+"@ @ @ $ * * * * * * % % * * * * % % * * * - - ;.>._ _ _ _ a K j j j T H ,.,.G G X '.'.'.'.'.Y '.'.@.).).@.@.@.@.Y Y @.@.Y Y Y Y Y $.X X X X X W G G W W W W ` ` ` P P R R H T u u u u u j | | | 2 2 ! ! b b J = = * % % * * * * * * * * * % * * * * * + ",
+"@ @ @ $ * * * * * * % % * * * * % % * * * - - ;.>._ _ _ _ a K j j j T H ,.,.G G X '.'.'.'.'.Y '.'.@.).).@.@.@.@.Y Y @.@.Y Y Y Y Y $.X X X X X W G G W W W W ` ` ` P P R R H T u u u u u j | | | 2 2 ! ! b b J = = * % % * * * * * * * * * % * * * * * + ",
+"+ + + % * % % * * * * * % * * * * * * = = !.!.~.{.: : : : : : ].].].H ` G G X X +.'.'.'.'.'.).@.@.@.@.@.).).@.'.Y Y ).).Y @.Y Y Y Y Y X X X X =.X X W ` ` ,.R R P R R H H H I u u u u u j 0 0 0 1 | 2 2 < < b ^.^.= * * * % % * * * % % * * * * * * * + ",
+"@ @ @ $ * * * * * % * * * * * % * * = < < >.>.w : /./.9 9 K S I I I ` =.'.'.@.@.'.X X W X X X '.'.@.'.'.X X X =.X X X X W =.W W W W W W W W W W ` ` ,.R R I H H H H H H H i T 3 3 u u u u L L L x j 0 0 | | ! b b -.* * * * * * % % * * * * % % * * * + ",
+"+ + + % * * * % % * * * * % % * * * ~ w w a a : 9 (.(.(.(._.S i i i E '.@.@.@.@.'.W W N N N W X X X X X G G W W ,.,.P P ,.H i i i H ,.i i H H i H H I I I M T T i H H i i I 3 T T T T K u j j j u u u u 0 0 | ! ! b { { * % % * * * * * * % * * * * * + ",
+"+ + + % * * * % % * * * * % % * * * ~ w w a a : 9 (.(.(.(._.S i i i E '.@.@.@.@.'.W W N N N W X X X X X G G W W ,.,.P P ,.H i i i H ,.i i H H i H H I I I M T T i H H i i I 3 T T T T K u j j j u u u u 0 0 | ! ! b { { * % % * * * * * * % * * * * * + ",
+"@ @ @ $ * * * * * * * * * * * * ' ' *.a a K K /.S 9 9 _._.t t ,.,.,.#.@.:.:.<.<.).W W N G G G =.=.%.W W G G G W ` ` ` ` P R P P P i P H H i i I T T u u u x u u T I I I I 3 i S S S S u u j j j j T T T u u j | | ! [.[.] * * * * * % % * * * * * * * + ",
+"+ + + % * % % * * * % % * * * > *.*.: a a K K 9 S t t t t i i H H H X @.<.<.}.}.:.X X X X X W Y Y Y =.=.G G W ` ` ` ` ` ` P ` ` ` G W i i I I i T T u x x x j j j j j S S i I i i K K S u u u u u T I I T T u 0 0 2 ! ! [.U U % * * * * * % * * * * * + ",
+"@ @ @ $ * * * * * % * * * = = |.{.{.K j j L L T t ].].].].i M H H H W 1.2.2.<.<.@.<.<.).Y Y '.Y Y Y '.'.Y Y W ` R R R R H i ` ` ` N H H H i i I u u j x x | a a K K K K K S S T T K K 3 T 3 3 3 T I i i H H S K K a } } [.J J * * * % % * * * * % % * + ",
+"@ @ @ $ * * * * * % * * * = = |.{.{.K j j L L T t ].].].].i M H H H W 1.2.2.<.<.@.<.<.).Y Y '.Y Y Y '.'.Y Y W ` R R R R H i ` ` ` N H H H i i I u u j x x | a a K K K K K S S T T K K 3 T 3 3 3 T I i i H H S K K a } } [.J J * * * % % * * * * % % * + ",
+"+ + + % * * * % % * * * * 3.3.>.: : L u u u u u 4.i i i i H P N N N Y @.5.5.1.1.5.1.1.2.:.:.<.}.}.<.1.1.:.:.'.#.X X W W P i I I I i T i i T T S K K K j j 0 0 0 j K K K K S K S S S S T T T T T i ` R R H H H S S K w w |.6.6.] * * * * * % * * * * * + ",
+"@ @ @ $ * * * * * * * * ; ....: K K u u u 4.4.T M H H H H P W X X X @.:.1.1.5.5.5.1.1.5.1.1.:.1.1.<.5.5.5.5.7.5.5.5.1.1.'.%.%.%.%.W R ` ` i i T u u u K K j K K : K K S S K K u u u u u S H H H ` ` ` ` R R P i i 9 : : |.8.8.9.% % * * * * * * * * * + ",
+"@ @ @ $ * * * * * * * * ; ....: K K u u u 4.4.T M H H H H P W X X X @.:.1.1.5.5.5.1.1.5.1.1.:.1.1.<.5.5.5.5.7.5.5.5.1.1.'.%.%.%.%.W R ` ` i i T u u u K K j K K : K K S S K K u u u u u S H H H ` ` ` ` R R P i i 9 : : |.8.8.9.% % * * * * * * * * * + ",
+"+ + + % * % % * * * * * 0.a.a.9 9 9 K ].].H H R P I I ,.,.W =.#.#.#.).1.1.1.5.5.b.7.7.7.}.}.#.1.1.5.7.7.7.7.7.7.7.7.7.7.7.c.5.5.5.1.}.1.1.}.}.$.R R R i i : K K u S S j j S S S S u u 3 P G G G G W W W ` ` ` i i i {.{.!.|.|.d.{ { * * % * % % * * * + ",
+"@ @ @ $ * * * * * * > > e././.K S S ].R R %.%.=.W W W E E '.#.'.'.'.}.f.5.5.b.b.7.c.c.g.7.7.7.5.5.5.7.7.7.7.7.h.7.7.7.7.7.1.1.1.1.7.1.}.}.1.1.5.1.1.}.G G ` i i u K K 0 0 S T T T i i W G G G G G G W W Z Z R P P t i.i.j.....k.6.6.= = * * * * * * * + ",
+"+ + + % * * * % % * !.!.~.9 9 S S S ` #.#.l.l.l.l.m.m.}.}.}.}.f.f.f.5.b.5.5.5.5.:.5.5.b.h.h.c.h.h.7.h.h.h.h.h.7.1.1.1.1.7.}.#.#.#.:.'.N N %.%.}.1.1.5.5.5.}.G G i S S T T K T R R X X X #.#.#.#.=.=.G G W W ` R R i : : n.>.>.o.k.k.{ { * * * * * * * + ",
+"+ + + % * * * % % * !.!.~.9 9 S S S ` #.#.l.l.l.l.m.m.}.}.}.}.f.f.f.5.b.5.5.5.5.:.5.5.b.h.h.c.h.h.7.h.h.h.h.h.7.1.1.1.1.7.}.#.#.#.:.'.N N %.%.}.1.1.5.5.5.}.G G i S S T T K T R R X X X #.#.#.#.=.=.G G W W ` R R i : : n.>.>.o.k.k.{ { * * * * * * * + ",
+"@ @ @ $ * * * * * ; e.e.p.K K i Z Z l.}.}.}.}.1.m.5.5.b.b.b.5.7.7.7.b.7.7.7.'.'.G @.@.).5.5.5.1.1.7.h.h.h.h.7.h.7.7.7.7.h.7.'.'.'.W ` ` ` }.}.%.#.#.1.1.1.).G G ,.T T T T S ` $.$.'.'.#.#.#.#.#.#.=.G G Z Z W ` ` i 9 9 w q.q.r.o.o.6.6.% * % % * * * + ",
+"+ + + % * * * * * s.t.t.{.: : R u.u.).).).2.2.l.l.b.b.b.b.7.5.5.5.5.7.7.5.5.).).X X X ).1.1.).:.:.7.7.7.7.7.h.v.h.h.h.h.h.7.'.'.'.G R ,.,.'.'.1.).).).).).1.).).H T T S S H #.@.@.Y Y '.#.#.#.#.#.%.=.=.F F W Z Z R t t i.e.e.w.o.o.x.x.> * * * * * * + ",
+"@ @ @ $ * * * * * *.y.y.(.9 9 F '.'.).).).:.:.}.1.1.1.b.b.2.f.5.5.5.5.<.5.5.@.@.1.1.1.7.h.h.7.7.7.7.h.h.7.7.:.v.h.h.h.h.7.:.).).).#.$.G G W W '.1.1.1.}.}.2.=.=.H i i G G G '.@.@.'.'.).'.#.#.#.#.X %.%.G G Z W W R t t /.>.>.z.r.r.k.k.J * * * * * * + ",
+"@ @ @ $ * * A.B.B.C.D.D.E.F.F.G.H.'.).).).:.:.}.1.1.1.b.I.J.K.L.L.L.L.M.L.L.@.@.1.1.1.7.h.h.7.7.7.7.h.h.N.O.P.Q.R.R.R.R.O.:.).).).#.$.G G W W '.1.1.1.}.S.J.T.T.U.V.V.W.W.W.X.Y.Y.X.X.Z.X.`.#.#.#.X %.%.G G Z W W R t t /.>. +.+++++@+@+#+B.B.B.B.A.* + ",
+"+ + + % * * $+%+%+%+%+%+%+%+%+%+&+l.).:.:.:.:.2.2.2.2.5.L.%+%+%+%+%+%+%+%+%+).).7.7.7.7.h.h.h.v.v.h.v.v.*+%+%+%+%+%+%+%+%+7.'.'.'.).5.5.5.'.'.G G G #.G =+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+-+X.X.'.#.=.=.E E F Z Z Z R R E.;+>+%+%+%+%+%+%+%+%+%+%+,+B.'+",
+"@ @ @ $ * A.)+%+%+%+%+%+%+%+%+%+!+m.m.:.:.:.:.}.5.5.5.~+{+%+%+%+%+%+%+%+%+%+7.7.g.h.h.h.h.h.v.]+]+^+]+/+(+%+%+%+%+%+%+%+%+_+:+#.#.5.7.7.7.7.7.5.1.1.}.<+[+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+}+#.%.%.E E F F F |+|+1+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+2+",
+"+ + + % * B.%+%+%+%+%+%+%+%+%+%+3+4+}.1.1.f.f.5.7.g.g.%+%+%+%+%+%+%+%+%+5+Q.6+6+v.v.v.6+]+]+]+v.v.]+^+7+%+%+%+%+%+%+%+%+%+%+8+=.=.G 5.h.h.h.h.7.g.g.7.O.%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+#.#.#.E E E y y 9+1+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+0+'+",
+"+ + + % * B.%+%+%+%+%+%+%+%+%+%+%+&+}.1.1.f.f.5.7.g.g.%+%+%+%+%+%+%+%+%+Q.v.6+6+v.v.v.6+]+]+]+v.v.]+^+7+%+%+%+%+%+%+%+%+%+%+8+=.=.G 5.h.h.h.h.7.g.g.7.O.%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+#.#.#.E E E y y 1+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+B.+ ",
+"@ @ @ % * a+%+%+%+%+%+%+%+%+%+%+%+b+f.b.b.b.b.7.c.c.%+%+%+%+%+%+%+%+%+%+Q.v.v.v.v.]+]+]+]+]+6+]+]+^+%+%+%+%+%+%+%+%+%+%+%+%+c+1.1.).7.g.g.7.7.g.7.7.7.O.%+%+%+%+%+%+L.1.1.1.1.1.c+%+%+%+%+%+%+%+%+#.#.#.E E F F G.%+%+%+%+%+%+%+%+~.d+d+k.9.* * %+%+B.+ ",
+"+ + + % * e+%+%+%+%+%+%+%+%+%+%+%+b+b.b.b.b.b.b.h.h.%+%+%+%+%+%+%+%+%+%+f+]+v.v.^+]+]+6+]+]+]+g+g+]+%+%+%+%+%+%+%+%+%+%+%+%+h+v.v.7.7.g.g.5.5.7.g.g.g.O.%+%+%+%+%+%+L.5.5.5.f.1.c+%+%+%+%+%+%+%+%+l.u.u.E E E F G.%+%+%+%+%+%+i+j+~.z.z.k+6.= = $+$+A.+ ",
+"@ @ @ $ * l+%+%+%+%+%+%+%+%+%+%+%+m+n+b.b.b.b.h.o+R.%+%+%+%+%+%+%+%+%+%+7+^+]+]+]+]+]+g+^+^+^+]+]+7+%+%+%+%+%+%+%+%+%+%+%+%+*+h.h.h.7.7.7.h.h.7.7.7.c.O.%+%+%+%+%+%+L.5.5.1.1.m.!+%+%+%+%+%+%+%+%+l.u.u.u.u.p+q+r+%+%+%+%+%+%+D.y.y.t.t.k+s+; ; * * * + ",
+"@ @ @ $ A.t+%+%+%+%+%+%+%+%+%+%+%+m+n+b.b.b.b.h.~+%+%+%+%+%+%+%+%+%+%+%+7+^+]+]+]+]+]+g+^+^+^+]+]+%+%+%+%+u+Q.%+%+%+%+%+%+%+v+w+h.h.7.7.7.h.h.7.7.7.o+x+%+%+%+%+%+y+z+5.5.1.1.m.!+%+%+%+%+%+%+%+%+l.u.u.u.u.p+A+%+%+%+%+%+%+%+D.y.y.t.t.k+s+; ; * * * + ",
+"+ + + % B.%+%+%+%+%+%+%+%+%+%+%+%+m+b.b.b.b.b.B+C+%+%+%+%+%+%+%+%+%+%+%+f+]+v.v.^+^+^+g+^+^+^+^+^+%+%+%+%+D+h.%+%+%+%+%+%+%+%+*+h.c.c.c.c.g.g.c.c.c.E+%+%+%+%+%+%+c+1.b.b.5.f.1.c+%+%+%+%+%+%+%+%+l.D D p+p+F+G+%+%+%+%+%+%+%+D.y.y.t.t.H+x.> > * * * + ",
+"@ @ @ % B.%+%+%+%+%+I+J+%+%+%+%+%+m+b.K+K+c.c.~+%+%+%+%+%+%+%+%+%+%+%+Q.]+]+^+^+]+^+^+g+L+L+^+M+%+%+%+%+%+R.h.%+%+%+%+%+%+%+%+~+c.c.c.c.c.c.c.c.c.c.E+%+%+%+%+%+%+N+b.5.5.b.b.f.b+%+%+%+%+%+%+%+D D D D O+O+O+J+%+%+%+%+%+%+%+%+%+P+t.t.Q+x.{ { * * * + ",
+"+ + + % B.%+%+%+%+%+R+S+%+%+%+%+%+m+b.b.b.B+T+%+%+%+%+%+%+%+%+%+%+%+%+7+]+]+^+^+^+g+g+^+g+g+U+%+%+%+%+%+Q.v.v.6+%+%+%+%+%+%+%+~+c.g.B+c.c.b.b.g.c.c.E+%+%+%+%+%+%+N+b.b.b.f.b.V+%+%+%+%+%+%+W+X+X+Y+O+O+O+O+O+F+J+%+%+%+%+%+%+%+%+%+t.t.d+x.v v * * * + ",
+"+ + + % B.%+%+%+%+%+R+S+%+%+%+%+%+m+b.b.b.B+T+%+%+%+%+Z+`+%+%+%+%+%+%+7+]+]+^+^+^+g+g+^+g+g+U+%+%+%+%+%+Q.v.v.6+%+%+%+%+%+%+%+~+c.g.B+c.c.b.b.g.c.c.E+%+%+%+%+%+%+N+b.b.b.f.I. @%+%+%+%+%+%+W+X+X+Y+O+O+O+O+O+F+J+%+%+%+%+%+%+%+%+%+.@.@+@x.v v * * * + ",
+"+ + + % B.%+%+%+%+@@#@$@%+%+%+%+%+%@&@*@*@=@-@%+%+%+%+;@>@%+%+%+%+%+%+7+^+^+^+^+,@,@,@^+g+'@)@%+%+%+%+!@~@g+^+6+%+%+%+%+%+%+%+*+h.{@h.b.b.c.c.]@b.b.V+%+%+%+%+%+%+^@/@(@(@K. @%+%+%+%+%+%+_@:@X+X+<@<@<@<@<@[@[@}@|@%+%+%+%+%+%+%+%+%+%+1@2@-.-.* * * + ",
+"+ + + 3@4@%+%+%+%+p.5@$@%+%+%+%+%+%+/@*@*@%+%+%+%+%+>@6@7@%+%+%+%+%+%+7@^+^+^+^+g+g+g+L+g+8@%+%+%+%+%+9@^+^+g+^+%+%+%+%+%+%+%+0@a@h.]@h.h.b.b.m.m.!+^@%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+b@W+c@X+X+X+Y+<@<@<@<@O+F+F+}@d@%+%+%+%+%+%+%+%+%+%+e@f@-.* * * + ",
+"@ @ @ %+%+%+%+%+%+g@F+J+%+%+%+%+%+%+/@*@*@%+%+%+%+%+{@;@>@%+%+%+%+%+%+7@L+L+,@,@^+g+g+6@g+8@%+%+%+%+%+h@^+^+g+^+%+%+%+%+%+%+%+%+E+c.f.i@i@E E Z p+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+i@Y+X+X+X+Y+Y+<@<@[@[@[@O+O+F+j@%+%+%+%+%+%+%+%+%+%+%+%+J * * * + ",
+"@ @ @ %+%+%+%+%+%+g@F+J+%+%+%+%+%+%+/@*@%+%+%+%+k@{@{@%+%+%+%+%+%+%+l@6@L+L+,@,@^+g+g+6@%+%+%+%+%+%+]+]+^+^+g+^+%+%+%+%+%+%+%+%+E+c.f.i@i@E E Z p+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+i@i@Y+X+X+X+Y+Y+<@<@[@[@[@O+O+F+j@j@%+%+%+%+%+%+%+%+%+%+%+%+* * * + ",
+"+ + + %+%+%+%+%+%+m@p+G+%+%+%+%+%+%+V+]@%+%+%+%+T+;@;@%+%+%+%+%+%+%+C+6@6@6@g+g+^+^+^+^+%+%+%+%+%+%+g+g+g+g+^+g+{@k@%+%+%+%+%+%+T+]@l.F F Z Z Z Q %+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+i@X+i@Y+Y+Y+X+Y+<@<@<@<@[@n@n@F+j@j@m o@%+%+%+%+%+%+%+%+%+%+%+$+* + ",
+"+ + + %+%+%+%+%+%+p@O+q@%+%+%+%+%+%+r@/@%+%+%+s@t@B+B+%+%+%+%+%+%+%+l@6@^+^+6@6@^+6@6@7+%+%+%+%+%+%+8@8@u@u@8@u@D+v@%+%+%+%+%+%+T+n+l.R R w@w@w@|+%+%+%+%+%+%+%+x@1+y@%+%+%+%+%+%+%+b@Y+Y+X+X+X+Y+Y+<@<@<@<@<@[@[@[@j@j@z@A@B@C@%+%+%+%+%+%+%+%+%+$+* + ",
+"+ + + %+%+%+%+%+%+p@O+q@%+%+%+%+%+%+%+%+%+%+%+T+;@B+B+%+%+%+%+%+%+%+l@6@^+^+6@6@^+6@6@%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+T+n+l.R R w@w@w@|+%+%+%+%+%+%+%+D@|+9+m+%+%+%+%+%+%+%+Y+Y+X+X+X+Y+Y+<@<@<@<@<@[@[@[@j@j@z@E@E@F@G@%+%+%+%+%+%+%+%+$+* + ",
+"+ H@I@%+%+%+%+%+J@|+K@L@M@%+%+%+%+%+%+%+%+%+N@O@B+{@{@%+%+%+%+%+%+%+l@6@6@6@g+g+L+P@l@%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+Q@R@p+Z Z t t S@T@%+%+%+%+%+%+%+U@Q Q i@%+%+%+%+%+%+%+Y+Y+X+X+X+Y+<@Y+Y+<@<@[@O+O+[@j@j@z@E@E@V@g@%+%+%+%+%+%+%+%+$+* + ",
+"@ W@%+%+%+%+%+%+{.|+K@K@X@%+%+%+%+%+%+%+%+%+Y@K+]@B+B+%+%+%+%+%+%+%+Z@;@6@6@6@6@6@l@%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+`@F w@w@].].T@%+%+%+%+%+%+%+%+ #|+|+l.%+%+%+%+%+%+%+i@X+X+X+X+<@<@<@<@<@<@<@[@[@[@[@[@z@.#.#m@p.%+%+%+%+%+%+%+%+$+* + ",
+"+ I@%+%+%+%+%+%+{.R |+|++#%+%+%+%+%+%+%+%+%+N+n+c.B+%+%+%+%+%+%+%+{@6@{@6@6@6@6@6@M+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+@#w@_._././.##%+%+%+%+%+%+%+(.S t t $#%+%+%+%+%+%+%+%+%#X+X+X+D <@<@<@<@<@O+O+O+F+j@j@m .#.#m@g@%+%+%+%+%+%+%+%+$+* + ",
+"+ I@%+%+%+%+%+%+{.R |+|++#%+%+%+%+%+%+%+%+b.b.n+c.B+%+%+%+%+%+%+%+{@6@{@6@6@6@6@7@%+%+%+%+%+7+,@,@6@,@,@,@,@,@,@{@{@C+%+%+%+%+%+%+@#w@_._././.##%+%+%+%+%+%+%+(.S t t $#$#%+%+%+%+%+%+%+%#X+X+X+D <@<@<@<@<@O+O+O+F+j@j@m .#.#m@g@%+%+%+%+%+%+%+%+$+* + ",
+"+ I@%+%+%+%+%+%+w t R R &#%+%+%+%+%+%+%+%+f.f.b.]@c.%+%+%+%+%+%+%+{@{@;@6@6@6@6@7@%+%+%+%+*#=#6@6@6@,@,@6@6@,@6@6@6@C+%+%+%+%+%+%+G+Z w@w@i.i.##%+%+%+%+%+%+%+: -#S S Z Z %+%+%+%+%+%+%+_@c@X+X+D <@<@<@;#>#J+,#F+5@5@5@5@p@p@'#J@%+%+%+%+%+%+%+$+)#* + ",
+"+ I@%+%+%+%+%+%+j.t ` ` !#%+%+%+%+%+%+%+(@f.f.b.b.c.%+%+%+%+%+%+%+B+B+{@6+6+;@t@~#%+%+%+%+l@6@6@6@6@,@,@6@6@^+{@6@6@C+%+%+%+%+%+%+G+y t t i.i.##%+%+%+%+%+%+%+{.: i.i.t t %+%+%+%+%+%+%+%+{#D D D D D D +#%+%+]#I+^#^#^#/#/#/#(#%+%+%+%+%+%+%+%+* * * + ",
+"_#:#%+%+%+%+<#[#[ S R R }#%+%+%+%+%+|#`@l.f.f.b.c.h.%+%+%+%+%+%+%+B+c.c.{@{@Z+`+%+%+%+%+D+1#;@6@6@6@6@6@6@6@6@6@6@6@Z@%+%+%+%+%+%+2#&#t t i.S@3#%+%+%+%+%+%+%+/.{.i.i.i.i.4#5#%+%+%+%+%+%+{#D D D n@p+6#7#%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+8#B.B.* * * + ",
+"W@%+%+%+%+%+9#[ [ S R R }#%+%+%+%+%+G.l.l.f.f.b.c.h.%+%+%+%+%+%+%+B+c.c.{@{@%+%+%+%+%+%+6+6+;@6@6@6@6@6@6@6@6@6@6@6@Z@%+%+%+%+%+%+%+%+t t i.0#%+%+%+%+%+%+%+%+/.{.i.i.i.i.a#{#%+%+%+%+%+%+{#D D D n@p++#%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+b#* * * * * + ",
+"I@%+%+%+%+%+B.~ ~ : i i K : : i ,.,.i N N m.m.b.N+%+%+%+%+%+%+%+c.c.h.B+h.h.%+%+%+%+%+%+6@6@^+6+6+6@,@,@6@6@6@6@;@;@C+%+%+%+%+%+%+%+%+w@w@a T@%+%+%+%+%+%+%+c#c#_.(.(.: : {.G+%+%+%+%+%+%+%+{#D D l.p++#%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+%+d#e#* * * * * + ",
+"I@%+%+%+%+%+B., , w i i K x x K S S K L L =.=.b.~+%+%+%+%+%+%+%+B+B+c.c.h.%+%+%+%+%+%+6+6+6+6@6@6@6@6@6@^+^+6@6@6@6@h.*+%+%+%+%+%+%+%+t t f#g#%+%+%+%+%+%+%+/./._.4 4 t t R G.%+%+%+%+%+%+%+{#D D p+p++#%+%+%+%+%+%+%+%+%+%+%+%+%+h#i#i#9.; * * * * * + ",
+"_#W@W@j#$+$+A.U U ( K K : | | L u u j x x ,.,.f.k#N+N+~+~+~+N+~+c.c.c.6+c.~+*+*+*+Z+Z+6+6+6+6+6+6+{@;@;@;@;@6+6+{@{@B+l#~+N+!+!+!+m#n#].].i.S@o#p#p#q#r#r#T@9 9 (.R R y y $#s#1+1+m#m#t#t#+#s#p+u.p+p+6#u#u#R+1+1+D@v#v#0#r#r#r#w#|.8.8.J % * * * * * + ",
+"@ @ @ $ * * * U U ( K K : | | L u u j x x ,.,.f.b.b.b.c.c.c.b.c.c.c.c.6+c.c.h.h.h.6+6+6+6+6+6+6+6+{@;@;@;@;@6+6+{@{@B+B+c.b.m.m.m.F Z ].].i.i._ } } j.w w a 9 9 (.R R y y $#p+|+|+F F D D p+p+p+u.p+p+p+$#$#y |+|+_.(.(.i.w w w |.|.8.8.J % * * * * * + ",
+"+ + + % * * * * * ^ K K u j j x L L L L L R R '.b.b.b.b.b.c.b.c.c.c.c.c.h.h.h.h.B+6+6+6+6+6+6+6+6+6+6+6+6+6+c.{@]@]@c.c.K+n+D D D Z w@f#f#a a } } } } w w a a a /.t t $#$#u.u.E E p+p+l.u.p+p+p+p+y |+|+|+|+R R R _.9 9 w j.j.;.[.[.k k e#* * * * * * + ",
+"@ @ @ $ * % % * * ] _ _ S j j j L L x L L P P G }.f.f.f.f.f.b.c.c.c.b.b.b.b.h.h.c.c.c.h.h.h.h.h.h.c.h.h.{@{@6+B+]@]@K+K+l.p+F F F w@t i.i.a a } !.!.j.j.j.w a a /.R R F F p+p+$#$#p+p+p+p+$#$#$#|+_._._.(.(.g@p@p@_.9 9 w |.|.[ 9.9.x#x#U * * * % % * + ",
+"+ + + % * * * * * = < < T T T L L L u x x 4.4.,.W ).).#.#.=.'.b.b.b.b.c.b.b.]@]@c.c.c.]@c.c.c.b.b.c.c.c.h.h.c.c.b.b.b.b.p+Z Z Z Z a#a#].].i.i._ w w } j.j.j.h#h#9 t t y y Z Z |+|+$#$#$#|+_._._.R _././.{.{.(._._._.i.i.w [ [ [ J J y#y#* * * * * * * + ",
+"+ + + % * * * * * = < < T T T L L L u x x 4.4.,.W ).).#.#.=.'.b.b.b.b.c.b.b.]@]@c.c.c.]@c.c.c.b.b.c.c.c.h.h.c.c.b.b.b.b.p+Z Z Z Z a#a#].].i.i._ w w } j.j.j.h#h#9 t t y y Z Z |+|+$#$#$#|+_._._.R _././.{.{.(._._._.i.i.w [ [ [ J J y#y#* * * * * * * + ",
+"@ @ @ $ * % % * * * , , _ T T T T T u & & u u u 4.a#a#,.,.N W G G G f.b.f.f.b.b.b.c.c.c.c.c.b.b.b.7.c.c.c.c.b.7.b.b.f.f.W a#w@w@w@i f#f#f#a a a i.i.a w w a i.i.i.w@w@w@w@w@_.a#a#_._._._.S S S -#S h#h#w w i.t t t w w } [ [ k J J ; ; * % * * * * * + ",
+"+ + + % * * * * * * ; ; < j j i I I I T T 4.4.4.T u u u u a#a#a#a#a#a##.m.m.b.b.b.c.c.b.7.7.7.7.7.5.b.b.5.5.b.5.b.b.}.}.,.].a#a#a#,.f#a a a a a ].].a a a i.i.i.a ].].K K a f#i.i.-#-#].(.i.i.i.w i.w w a a w S S i._ _ !.b b J y#y#% % * * * * % % * + ",
+"@ @ @ $ * * * % % * * * , | | T H H H H H H H M M a#a#H H M u u u u 4.].W W #.#.'.2.2.7.b.b.5.2.2.5.5.5.5.5.5.f.}.}.l.l.G N ,.,.,.i ].].].a a a i.i.].a a a a a a K K f#f#a _ a a _ _ a a a a a _ _ } } } } a i.i._ !.!.! 9.9.-.U U * * * * % % * * * + ",
+"@ @ @ $ * * * % % * * * , | | T H H H H H H H M M a#a#H H M u u u u 4.].W W #.#.'.2.2.7.b.b.5.2.2.5.5.5.5.5.5.f.}.}.l.l.G N ,.,.,.i ].].].a a a i.i.].a a a a a a K K f#f#a _ a a _ _ a a a a a _ _ } } } } a i.i._ !.!.! 9.9.-.U U * * * * % % * * * + ",
+"+ + + % * * * * * * * * = < < j M M R ` ` P P P H P P ,.,.P 4.4.4.4.u u L L M M H =.=.1.5.5.1.5.5.1.1.1.5.5.1.}.'.'.G G ,.i i i i a#i T T u u K f#f#a & & _ L L a a a & & a _ a a _ _ } } } } } z#!.} } } } _ | | ( &.&.k J J  .* * * * % * * * * * * + ",
+"@ @ @ $ * % % * * % * * *  . .| T T H ` ` W W W W ` ` ` ` ` H H H H H M 4.4.4.4.M a#a#W N N m.5.5.1.1.1.1.1.1.'.G G N N M 4.4.4.4.M a#a#a#].].K a a L & & _ | | a L L | | | a _ _ A#A#B#A#B#B#B#&.( ( ( ( ( ( &.&.! b b J v v U * * * * * % * * * * * + ",
+"+ + + % * * * * * * * * % * * # x x I ,.,.` ` W G G G G G G ` ` ` ` ,.P H H H H M H H M a#a#%.}.}.1.}.}.}.}.'.%.%.%.%.%.G ,.I I I T T u u L L & L L L x x & | | a & & a a x a | | | | B#&.&.&.&.&.< &.&.~ ~ ! ! ! b J J -.> > * * * % % * * * * % % * + ",
+"+ + + % * * * * * * * * % * * # x x I ,.,.` ` W G G G G G G ` ` ` ` ,.P H H H H M H H M a#a#%.}.}.1.}.}.}.}.'.%.%.%.%.%.G ,.I I I T T u u L L & L L L x x & | | a & & a a x a | | | | B#&.&.&.&.&.< &.&.~ ~ ! ! ! b J J -.> > * * * % % * * * * % % * + ",
+"@ @ @ $ * * * % % * * * * * * = C#C#j I I i i ` ` G G W W X W G G G W W ` ` ` ` ,.i i i H H P W W #.).).}.}.).#.#.#.G G ` M u u u a#T u u a a L L L L | | x x x K x x & & a x | | A#A#l &.< < < &.~ ~ ~ ~ ~ ~ ~ ~ k x#x#e#* * * * * * * * % * * * * * + ",
+"+ + + % * * * * * * * * % * * * ; ; c u u H H i ,.W W W W G G W W W ` W W W W W W ` ` ` P P R R R ,.W W G G %.#.%.%.N N M L x x x ].u u u u u j K K j & & x a a K x x | | x x x x A#A#l &.! ! ! ~ &.~ ~ b b ~ k k J e#e#= * * * * * % % * * * * * * * + ",
+"+ + + % * * * * * * * * % * * * ; ; c u u H H i ,.W W W W G G W W W ` W W W W W W ` ` ` P P R R R ,.W W G G %.#.%.%.N N M L x x x ].u u u u u j K K j & & x a a K x x | | x x x x A#A#l &.! ! ! ~ &.~ ~ b b ~ k k J e#e#= * * * * * % % * * * * * * * + ",
+"@ @ @ $ * % % * * % * * * * * * * * D#L L u u I P ` ` ` ` W W W W W ` W W W ` ` P R R ,.R R P H H H R R ` ` ` W W W R R T u ].].].I I S S i i T L L x x x x x x x | | x x x x & & A#A#( ( l l l < ~ ~ ~ ~ ~ k -.-. .; ; * * * % * * * * * * % % * * * + ",
+"+ + + % * * * * * * * * % * * * * * * # # L L T i i i ,.,.R ` R R R P W ` ` ,.,.P P P P H H H i i i H H i i ,.R R R H H i R H H H R i i i I I S K K T u u j K K L j j x x x x x x A#A#A#l < < < < < k k k k ^.{ { U * * * * * * * * % % * * * * * * * + ",
+"@ @ @ $ * * * % % * * * * * * % * * * * * # # u T T T i i H H P P P R R P P H H P R R P H H i P P H i i H H I I H H i i P i H H H H I T T S S T u u S ].].u u u u L L x x x x | | A#A#l ( < < < < ~ ) ) E#E#{ U U * * * % * * * % % * * * % * * * * * + ",
+"@ @ @ $ * * * % % * * * * * * % * * * * * # # u T T T i i H H P P P R R P P H H P R R P H H i P P H i i H H I I H H i i P i H H H H I T T S S T u u S ].].u u u u L L x x x x | | A#A#l ( < < < < ~ ) ) E#E#{ U U * * * % * * * % % * * * % * * * * * + ",
+"+ + + % * * * * * * * * % * * * * * * * * % % s.u u u T T ].S i i i I H i i i i I H H i H H I I I T T T S S I I I I I I I I i i i i i i i T T S S S i K K K ].].K j j L L L x x x A#A#( ( < < < ~ ~ ) ) { { > * * % * * * % % * * * * * * * * * * * * + ",
+"@ @ @ $ * % % * * % * * * * * * % % * * * * * * # & & u u L K K K K ].i i i i i i S S T I I I ].].T u u L L T T T T I I I I S S S S S i i i i i i i S i.i.(.S S i.K K ].].i.a _ _ } } ( &.~ ~ ~ ~ ^ v v ; ; * * * * * * * * * * * * % % * * % % * * * + ",
+"+ + + % * * * * * * * * % * * * * * * % % * * * * D#D#L L u a i.i.i.S (.S S t t S S S 9 u u ].u u u L L u u ].T I I i i i t t t t t t _._.(.(.(.(.(./.c#c#h#h#h#i.h#h#i.i.a a w w } } &.~ < < < ^ v U U * * * * * % * * * % % * * * * * * % * * * * * + ",
+"+ + + % * * * * * * * * % * * * * * * % % * * * * D#D#L L u a i.i.i.S (.S S t t S S S 9 u u ].u u u L L u u ].T I I i i i t t t t t t _._.(.(.(.(.(./.c#c#h#h#h#i.h#h#i.i.a a w w } } &.~ < < < ^ v U U * * * * * % * * * % % * * * * * * % * * * * * + ",
+"@ @ @ $ * * * % % * * * * * * % * * * * * * * % * * * U U C#u u u u i.S (.(.(.(.(.(.(.t ].].K K K S t t w@w@i i ,.,._._.m@g@F#F#F#G#H#y.y.y.y.I#J#J#a.e.e.e.>.>.K#>.>.L#L#L#w z#z#!.!.< ~ x#x#x#] = * * % % * * * * * * % * * * % % * * * * * * * * * + ",
+"+ + + % * * * * * * * * % * * * * * * % % * * * * * * * * = M#| | | L a ].].(.(.(.g@g@m@g@g@(._._._._._.R R Z R g@g@N#N#O#O#P#P#P#P#P#Q#Q#R#R#G#P+P+H#~.~.J#d+d+J#q.q.....*.|.|.|.[.[.b -.> > > * % * * * * * * * % * * * * * * * * * * * % * * * * * + ",
+"@ @ @ $ * % % * * % * * * * * * % % * * * * * * % * * * * * * U U U s.| L L f#f#]._._._.g@g@p.F#F#p@V@V@m@m@S#O#T#T#U#U#V#6 W#W#W#X#z@E@E@Y#Y#Y#Y#Y#G#H#H#Z#e.e.J#`#`#`#`#`# $[.[.x#x#e#U * * * * * * * * * % * * * * * * % % * * * % % * * * * * * * + ",
+"@ @ @ $ * % % * * % * * * * * * % % * * * * * * % * * * * * * U U U s.| L L f#f#]._._._.g@g@p.F#F#p@V@V@m@m@S#O#T#T#U#U#V#6 W#W#W#X#z@E@E@Y#Y#Y#Y#Y#G#H#H#Z#e.e.J#`#`#`#`#`# $[.[.x#x#e#U * * * * * * * * * % * * * * * * % % * * * % % * * * * * * * + ",
+"+ + + % * * * * * * * * % * * * * * * % % * * * * * * % % * * * * * = > s.s.B#B#& L L 4.].].].i.i.(.p.p.c#c#.$+$+$+$U#U#6 W#z@z@z@.#p@p@p@m@m@F#F#F#y.t.t.H+w.w.r.w.w.@$@$i#[.v v > > * * * * * * % * * * * * * * % * * * * * * % % * * * * % % * * * + ",
+"@ @ @ $ * * * % % * * * * * * % * * * * * * * % * * * * * * % * * * * * = = > > #$< < z#z#z#L & & x i.i.-#-#a..$$$$$U#U#$$$$$$$$$$O#H#y.y.t.t.I#z.z.H+H+H+r.r.r.H+%$%$[.[.v U = = * * * * * * * % * * * % % * * * * * * % * * * * * * * * % * * * * * + ",
+"+ + + % * * * * * * * * % * * * * * * % % * * * * % % * * * * % % % * * * * * * = U U M#x#x#< z#z#z#j.j.i.i.-#(.F#F#P+P+P+H+t.t.t.t.J#`#`#`#`#`#`#`#Q+`#`#&$*$*$x# . .U U * * * * * * * % * * * * * * * * * * * * % * * * * * % * * % % * * * * * * * + ",
+"+ + + % * * * * * * * * % * * * * * * % % * * * * % % * * * * % % % * * * * * * = U U M#x#x#< z#z#z#j.j.i.i.-#(.F#F#P+P+P+H+t.t.t.t.J#`#`#`#`#`#`#`#Q+`#`#&$*$*$x# . .U U * * * * * * * % * * * * * * * * * * * * % * * * * * % * * % % * * * * * * * + ",
+"@ @ @ $ * % % * * % * * * * * * % % * * * % % * * * * % % * * * * * % * * * * * * * * * % % U e#e#v x#x#< < &.=$j.j.j.j.h#L# $ $ $ $ $ $ $;.;.-$[.[.b ^.^.e#U U = * * % % * * * * % % * * * * * * % * * * * % * * * * * % * * * * * * * * % * * * * * + ",
+"+ + + % * * * * * * * * % * * * * * * * * * * * % * * * * * % * * * * * % % * * * % % * * * * * * * = = = = U > > > M#M#M#M#v v v M#M#y#y#e#e#> U U = * * * * * * * * * * * % * * * * * % * * * * * * * % % * * * * % % * * * * % % * * * * * * % % * + ",
+"@ @ @ % * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * = * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + ",
+"@ @ @ % * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * = * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + ",
+"+ + + $ % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % * + ",
+"@ @ @ & + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + & "};
Index: /tags/Mars_V0-4/Mars/mbase/BaseIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/BaseIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/BaseIncl.h	(revision 9634)
@@ -0,0 +1,10 @@
+#ifndef __CINT__
+
+#include <fstream.h>
+
+#include <TFile.h>
+#include <TTree.h>
+
+#include <TGListBox.h>
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mbase/BaseLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/BaseLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/BaseLinkDef.h	(revision 9634)
@@ -0,0 +1,47 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ global kCONTINUE;
+#pragma link C++ global kGAMMA;
+#pragma link C++ global kPROTON;
+#pragma link C++ global kHELIUM;
+#pragma link C++ global kOXIGEN;
+#pragma link C++ global kIRON;
+#pragma link C++ global kPI;
+#pragma link C++ global kRad2Deg;
+
+#pragma link C++ global gLog;
+
+#pragma link C++ class MLog;
+
+#pragma link C++ class MTask;
+#pragma link C++ class MTaskList;
+
+#pragma link C++ class MParContainer;
+#pragma link C++ class MParList;
+
+#pragma link C++ class MFilter;
+#pragma link C++ class MFilterList;
+
+#pragma link C++ class MEvtLoop;
+
+#pragma link C++ class MInputStreamID;
+
+#pragma link C++ class MReadTree;
+#pragma link C++ class MWriteFile;
+#pragma link C++ class MWriteAsciiFile;
+#pragma link C++ class MWriteRootFile;
+
+#pragma link C++ class MArray;
+#pragma link C++ class MArrayB;
+#pragma link C++ class MArrayS;
+
+#pragma link C++ class MTime;
+
+#pragma link C++ class MHtml;
+
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MAGIC.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MAGIC.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MAGIC.h	(revision 9634)
@@ -0,0 +1,43 @@
+#ifndef MAGIC_H
+#define MAGIC_H
+///////////////////////////////////////////////////////////////////////////////
+//
+//     Magic.h
+//
+//     defines MAGIC base informations
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TROOT
+#include <TROOT.h>
+#endif
+
+//
+// Values for the eventloop control
+//
+const Int_t kCONTINUE = 2;
+
+//
+//     ParticleId for Monte Carlo simulation
+//
+const Int_t kGAMMA  =    0;
+const Int_t kPROTON =   14;
+const Int_t kHELIUM =  402;
+const Int_t kOXIGEN = 1608;
+const Int_t kIRON   = 5626;
+
+const Double_t kPI      = 3.1415926535897932384626433832795028841971693993751;
+const Double_t kRad2Deg = 180.0/kPI;
+
+//
+// This is the definition of a global output stream, which by
+// default pipes all output to the stdout
+//
+
+//This will be fixed soon. It doesn't work with Alphas at the moment
+class MLog;
+#ifndef __CINT__
+extern MLog gLog;
+#endif
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MArray.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MArray.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MArray.cc	(revision 9634)
@@ -0,0 +1,41 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MArray                                                                   //
+//                                                                          //
+// This is an abstract base class for TObject derived Arrays. In principal  //
+// it is almost the same than TArray. The difference is that this array     //
+// base classed is derived from TObject which makes storage of variable     //
+// sized arrays possible with splitlevel=1.                                 //
+//                                                                          //
+// This should not be needed anymore for root >3.00                         //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MArray.h"
+
+ClassImp(MArray);
+
Index: /tags/Mars_V0-4/Mars/mbase/MArray.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MArray.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MArray.h	(revision 9634)
@@ -0,0 +1,39 @@
+#ifndef MARRAY_H
+#define MARRAY_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MArray                                                                  //
+//                                                                         //
+// Abstract array base class for TObject derived Arrays                    //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TObject
+#include <TObject.h>
+#endif
+
+class MArray : public TObject
+{
+protected:
+    UInt_t fN; // Number of array elements
+
+public:
+   MArray()                              { fN = 0; }
+   MArray(UInt_t n)                      { fN = n; }
+   MArray(const MArray &a)               { fN = a.fN; }
+   virtual ~MArray()                     { fN = 0; }
+
+   MArray &operator=(const MArray &rhs)  { fN = rhs.fN; return *this; }
+
+   UInt_t       GetSize() const          { return fN; }
+   virtual void Set(UInt_t n) = 0;
+
+   ClassDef(MArray, 1)  //Abstract array base class for TObject derived Arrays
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MArrayB.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MArrayB.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MArrayB.cc	(revision 9634)
@@ -0,0 +1,22 @@
+/* ======================================================================== *\
+!
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MArrayB                                                                  //
+//                                                                          //
+// Array of Byte_t. It is almost the same than TArrayC, but it containes    //
+// Byte_t instead of Char_t and it can be stored with splitlevel=1 to a     //
+// a root-file because of it's derivement from MArray (TObject)             //                                                                       //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MArrayB.h"
+
+ClassImp(MArrayB);
+
Index: /tags/Mars_V0-4/Mars/mbase/MArrayB.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MArrayB.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MArrayB.h	(revision 9634)
@@ -0,0 +1,175 @@
+#ifndef MARRAYB_H
+#define MARRAYB_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MArrayB                                                                 //
+//                                                                         //
+// Array of Byte_t                                                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MARRAY_H
+#include "MArray.h"
+#endif
+
+#include <string.h>
+
+
+class MArrayB : public MArray
+{
+private:
+    Byte_t *fArray; //[fN] Array of fN chars
+
+public:
+
+    MArrayB()
+    {
+        fN     = 0;
+        fArray = NULL;
+    }
+
+    MArrayB(UInt_t n)
+    {
+        fN     = 0;
+        fArray = NULL;
+
+        Set(n);
+    }
+
+    MArrayB(UInt_t n, Byte_t *array)
+    {
+        // Create TArrayC object and initialize it with values of array.
+        fN     = 0;
+        fArray = NULL;
+
+        Set(n, array);
+    }
+
+    MArrayB(const MArrayB &array)
+    {
+        // Copy constructor.
+        fArray = NULL;
+        Set(array.fN, array.fArray);
+    }
+
+    UInt_t GetSize() const
+    {
+        return fN;
+    }
+
+    MArrayB &operator=(const MArrayB &rhs)
+    {
+        // TArrayC assignment operator.
+        if (this != &rhs)
+            Set(rhs.fN, rhs.fArray);
+        return *this;
+    }
+
+    virtual ~MArrayB()
+    {
+        // Delete TArrayC object.
+        delete [] fArray;
+        fArray = NULL;
+    }
+
+    void Adopt(UInt_t n, Byte_t *array)
+    {
+        // Adopt array arr into TArrayC, i.e. don't copy arr but use it directly
+        // in TArrayC. User may not delete arr, TArrayC dtor will do it.
+        if (fArray)
+            delete [] fArray;
+
+        fN     = n;
+        fArray = array;
+    }
+
+    void AddAt(Byte_t c, UInt_t i)
+    {
+        // Add char c at position i. Check for out of bounds.
+        fArray[i] = c;
+    }
+
+    void AddAt(Byte_t *array, UInt_t i, UInt_t n)
+    {
+        // Add char c at position i. Check for out of bounds.
+        memcpy(fArray+i, array, n*sizeof(Byte_t));
+    }
+
+    Byte_t     At(UInt_t i)
+    {
+        return fArray[i];
+    }
+
+    Byte_t    *GetArray() const
+    {
+        return fArray;
+    }
+
+    void Reset()
+    {
+        memset(fArray, 0, fN*sizeof(Byte_t));
+    }
+
+    void Set(UInt_t n)
+    {
+        // Set size of this array to n chars.
+        // A new array is created, the old contents copied to the new array,
+        // then the old array is deleted.
+
+        if (n==fN)
+            return;
+
+        Byte_t *temp = fArray;
+        if (n == 0)
+            fArray = 0;
+        else
+        {
+            fArray = new Byte_t[n];
+            if (n < fN)
+                memcpy(fArray,temp, n*sizeof(Byte_t));
+            else
+            {
+                memcpy(fArray,temp,fN*sizeof(Byte_t));
+                memset(&fArray[fN],0,(n-fN)*sizeof(Byte_t));
+            }
+        }
+
+        if (fN)
+            delete [] temp;
+
+        fN = n;
+    }
+
+    void Set(UInt_t n, Byte_t *array)
+    {
+        // Set size of this array to n chars and set the contents.
+        if (!array)
+            return;
+
+        if (fArray && fN != n)
+        {
+            delete [] fArray;
+            fArray = 0;
+        }
+
+        fN = n;
+
+        if (fN == 0)
+            return;
+
+        if (!fArray)
+            fArray = new Byte_t[fN];
+
+        memcpy(fArray,array, n*sizeof(Byte_t));
+    }
+
+    Byte_t &operator[](UInt_t i)
+    {
+        return fArray[i];
+    }
+
+    ClassDef(MArrayB, 1)  //Array of Byte_t
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MArrayS.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MArrayS.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MArrayS.cc	(revision 9634)
@@ -0,0 +1,38 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MArrayS                                                                  //
+//                                                                          //
+// Array of UShort_t. It is almost the same than TArrayS, but it containes  //
+// UShort_t instead of Short_t and it can be stored with splitlevel=1 to a  //
+// a root-file because of it's derivement from MArray (TObject)             //                                                                       //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MArrayS.h"
+
+ClassImp(MArrayS);
+
Index: /tags/Mars_V0-4/Mars/mbase/MArrayS.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MArrayS.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MArrayS.h	(revision 9634)
@@ -0,0 +1,165 @@
+#ifndef MARRAYS_H
+#define MARRAYS_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MArrayS                                                                 //
+//                                                                         //
+// Array of UShort_t                                                       //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MARRAY_H
+#include "MArray.h"
+#endif
+
+#include <string.h>
+
+class MArrayS : public MArray
+{
+private:
+    UShort_t *fArray; //[fN] Array of fN chars
+
+public:
+
+    MArrayS()
+    {
+        fN     = 0;
+        fArray = NULL;
+    }
+
+    MArrayS(UInt_t n)
+    {
+        fN     = 0;
+        fArray = NULL;
+        Set(n);
+    }
+
+    MArrayS(UInt_t n, UShort_t *array)
+    {
+        // Create TArrayC object and initialize it with values of array.
+        fN     = 0;
+        fArray = NULL;
+        Set(n, array);
+    }
+
+    MArrayS(const MArrayS &array)
+    {
+        // Copy constructor.
+        fArray = NULL;
+        Set(array.fN, array.fArray);
+    }
+
+    UInt_t GetSize() const
+    {
+        return fN;
+    }
+
+    MArrayS &operator=(const MArrayS &rhs)
+    {
+        // TArrayC assignment operator.
+        if (this != &rhs)
+            Set(rhs.fN, rhs.fArray);
+        return *this;
+    }
+
+    virtual ~MArrayS()
+    {
+        // Delete TArrayC object.
+        delete [] fArray;
+        fArray = NULL;
+    }
+
+    void Adopt(UInt_t n, UShort_t *array)
+    {
+        // Adopt array arr into TArrayC, i.e. don't copy arr but use it directly
+        // in TArrayC. User may not delete arr, TArrayC dtor will do it.
+        if (fArray)
+            delete [] fArray;
+
+        fN     = n;
+        fArray = array;
+    }
+
+    void AddAt(UShort_t c, UInt_t i)
+    {
+        // Add char c at position i. Check for out of bounds.
+        fArray[i] = c;
+    }
+
+    UShort_t     At(UInt_t i)
+    {
+        return fArray[i];
+    }
+
+    UShort_t    *GetArray() const
+    {
+        return fArray;
+    }
+
+    void Reset()
+    {
+        memset(fArray, 0, fN*sizeof(UShort_t));
+    }
+
+    void Set(UInt_t n)
+    {
+        // Set size of this array to n chars.
+        // A new array is created, the old contents copied to the new array,
+        // then the old array is deleted.
+
+        if (n==fN)
+            return;
+
+        UShort_t *temp = fArray;
+        if (n == 0)
+            fArray = NULL;
+        else
+        {
+            fArray = new UShort_t[n];
+            if (n < fN)
+                memcpy(fArray, temp, n*sizeof(UShort_t));
+            else
+            {
+                memcpy(fArray, temp, fN*sizeof(UShort_t));
+                memset(&fArray[fN], 0, (n-fN)*sizeof(UShort_t));
+            }
+        }
+
+        if (fN)
+            delete [] temp;
+
+        fN = n;
+    }
+
+    void Set(UInt_t n, UShort_t *array)
+    {
+        // Set size of this array to n chars and set the contents.
+        if (!array)
+            return;
+
+        if (fArray && fN != n)
+        {
+            delete [] fArray;
+            fArray = 0;
+        }
+        fN = n;
+
+        if (fN == 0)
+            return;
+
+        if (!fArray)
+            fArray = new UShort_t[fN];
+
+        memcpy(fArray, array, n*sizeof(UShort_t));
+    }
+
+    UShort_t &operator[](UInt_t i)
+    {
+        return fArray[i];
+    }
+
+    ClassDef(MArrayS, 1)  //Array of UShort_t
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MEvtLoop.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MEvtLoop.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MEvtLoop.cc	(revision 9634)
@@ -0,0 +1,216 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MEvtLoop                                                                 //
+//                                                                          //
+// This class is the core of each event processing.                         //
+// First you must set the parameter list to use. The parameter list         //
+// must contain the task list (MTaskList) to use. The name of the task      //
+// list can be specified if you call Eventloop. The standard name is        //
+// "MTaskList". The name you specify must match the name of the MTaskList   //
+// object.                                                                  //
+//                                                                          //
+// If you call Eventloop first all PreProcess functions - with the          //
+// parameter list as an argument - of the tasks in the task list are        //
+// executed. If one of them returns kFALSE then the execution is stopped.   //
+// If the preprocessing was ok. The Process funtion of the tasks are        //
+// as long as one function returns kSTOP. Only the tasks which are marked   //
+// marked as "All" or with a string which matches the MInputStreamID of     //
+// MTaskList are executed. If one tasks returns kCONTINUE the pending       //
+// tasks in the list are skipped and the execution in continued with        //
+// the first one in the list.                                               //
+// Afterwards the PostProcess functions are executed.                       //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MEvtLoop.h"
+
+#include <iostream.h>
+
+#include <TStopwatch.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+#include "MTaskList.h"
+
+ClassImp(MEvtLoop);
+
+
+//!
+//! Maybe we can add a static parameter list to MEvtLoop
+//! Also we can derive MEvtLoop from MTaskList to have a static tasklist, too
+//!
+
+// --------------------------------------------------------------------------
+//
+// default constructor - emty
+//
+MEvtLoop::MEvtLoop() : fParList(NULL)
+{
+}
+
+// --------------------------------------------------------------------------
+//
+// default destructor - emty
+//
+MEvtLoop::~MEvtLoop()
+{
+}
+
+// --------------------------------------------------------------------------
+//
+// The proprocessing part of the eventloop. Be careful, this is
+// for developers use only!
+//
+Bool_t MEvtLoop::PreProcess(const char *tlist)
+{
+    //
+    // check if the needed parameter list is set.
+    //
+    if (!fParList)
+    {
+        *fLog << dbginf << "Parlist not initialized." << endl;
+        return kFALSE;
+    }
+
+    //
+    //  check for the existance of the specified task list
+    //  the default name is "MTaskList"
+    //
+    fTaskList = (MTaskList*)fParList->FindObject(tlist);
+    if (!fTaskList)
+    {
+        *fLog << dbginf << "Cannot find tasklist '" << tlist << "' in parameter list." << endl;
+        return kFALSE;
+    }
+
+    if (fLog != &gLog)
+        fParList ->SetLogStream(fLog);
+
+    //
+    //  execute the preprocess of all tasks
+    //  connect the different tasks with the right containers in
+    //  the parameter list
+    //
+    if (!fTaskList->PreProcess(fParList))
+    {
+        *fLog << "Error detected while PreProcessing" << endl;
+        return kFALSE;
+    }
+
+    *fLog << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// The processing part of the eventloop. Be careful, this is
+// for developers use only!
+//
+void MEvtLoop::Process(Int_t maxcnt) const
+{
+    //
+    //   loop over all events and process all tasks for
+    //   each event
+    //
+    *fLog << "Eventloop running (";
+
+    if (maxcnt<0)
+        *fLog << "all";
+    else
+        *fLog << dec << maxcnt;
+
+    *fLog << " events)..." << flush;
+
+    Int_t dummy = maxcnt<0 ? 0 : maxcnt;
+
+    //
+    // start a stopwatch
+    //
+    TStopwatch clock;
+    clock.Start();
+
+    //
+    // This is the MAIN EVENTLOOP which processes the data
+    // if maxcnt<0 the number of processed events is counted
+    // else only maxcnt events are processed
+    //
+    if (maxcnt<0)
+        // process first and increment if sucessfull
+        while (fTaskList->Process()) dummy++;
+    else
+        // check for number and break if unsuccessfull
+        while (dummy-- && fTaskList->Process());
+
+    //
+    // stop stop-watch, print results
+    //
+    clock.Stop();
+
+    *fLog << "Ready!" << endl << endl;
+
+    clock.Print();
+
+    *fLog << dec << endl
+        << "Time: " << clock.CpuTime() << "s"
+        << " for " << (maxcnt<0?dummy:maxcnt) << " Events"
+        << " --> " << (maxcnt<0?dummy:maxcnt)/clock.CpuTime() << " Events/s"
+        << endl << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+//  The postprocessing part of the eventloop. Be careful, this is
+//  for developers use only!
+//
+Bool_t MEvtLoop::PostProcess() const
+{
+    //
+    //  execute the post process of all tasks
+    //
+    return fTaskList->PostProcess();
+}
+
+// --------------------------------------------------------------------------
+//
+//  See class description above.
+//
+Bool_t MEvtLoop::Eventloop(Int_t maxcnt, const char *tlist)
+{
+    Bool_t rc = PreProcess();
+
+    if (rc)
+        Process(maxcnt);
+
+    if (!PostProcess())
+        return kFALSE;
+
+    return rc;
+}
+
Index: /tags/Mars_V0-4/Mars/mbase/MEvtLoop.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MEvtLoop.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MEvtLoop.h	(revision 9634)
@@ -0,0 +1,44 @@
+#ifndef MEVTLOOP_H
+#define MEVTLOOP_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MEvtLoop                                                                //
+//                                                                         //
+// Class to execute the tasks in a tasklist                                //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class MParList;
+class MTaskList;
+
+class MEvtLoop : public MParContainer
+{
+private:
+    MParList  *fParList;
+    MTaskList *fTaskList;
+
+public:
+    MEvtLoop();
+    virtual ~MEvtLoop();
+
+    void SetParList(MParList *p)  { fParList = p; }
+
+    Bool_t PreProcess(const char *tlist="MTaskList");
+    void   Process(Int_t maxcnt) const;
+    Bool_t PostProcess() const;
+
+    Bool_t Eventloop(Int_t maxcnt=-1, const char *tlist="MTaskList");
+
+    ClassDef(MEvtLoop, 0) // Class to execute the tasks in a tasklist
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MFilter.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MFilter.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MFilter.cc	(revision 9634)
@@ -0,0 +1,100 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  07/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//   MFilter                                                               //
+//                                                                         //
+//   This is a base class which defines an interface to create your own    //
+//   filters. To do it derive a class from MFilter.                        //
+//                                                                         //
+//   You can create two types of Filters:                                  //
+//    - static Filters and                                                 //
+//    - dynamic Filters                                                    //
+//                                                                         //
+//   Static Filters:                                                       //
+//    A static filter is a filter which value doesn't change dynamically,  //
+//    which mean only once while running through your tasklist. To create  //
+//    a static filter override the Process-function of MFilter (this is    //
+//    the function in which the filer-value should be updated). If         //
+//    necessary you can also overwrite Pre-/PostProcess. The process       //
+//    function should calculate the return value of IsExpressionTrue.      //
+//    IsExpressionTrue should simply return this value. This kind of       //
+//    filter must be added to the tasklist at a point which is forseen to  //
+//    update the value of the filter (eg. after the reading task).         //
+//                                                                         //
+//   Dynamic Filters:                                                      //
+//    A dynamic filter is a filter which returns a value which must be     //
+//    calculated at the time the filter is called. To create such a        //
+//    filter you have to overwrite IsExpressionTrue only. If there is      //
+//    no need for a 'one-point' update this filter must not be added to    //
+//    the tasklist.                                                        //
+//                                                                         //
+//   Usage:                                                                //
+//    A Filter is connected to a task by calling MTask::SetFilter. The     //
+//    task is now executed when IsExpressionTrue returns a value           //
+//    (different from kFALSE) only.                                        //
+//                                                                         //
+//   Remarks:                                                              //
+//    - Make sure, that all tasks which depends on this filter are either  //
+//      collected in a MTaskList-object or are conected to the same        //
+//      filter.                                                            //
+//    - If you want to use different filters for one task please look for  //
+//      the MFilterList class.                                             //
+//    - Be careful, the return value of IsExpressionTrue is NOT a real     //
+//      boolean. You can return other values, too.                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MFilter.h"
+
+ClassImp(MFilter);
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFilter::IsExpressionTrue() const
+{
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFilter::PreProcess(MParList *pList)
+{
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFilter::Process()
+{
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFilter::PostProcess()
+{
+    return kTRUE;
+}
Index: /tags/Mars_V0-4/Mars/mbase/MFilter.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MFilter.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MFilter.h	(revision 9634)
@@ -0,0 +1,35 @@
+#ifndef MFILTER_H
+#define MFILTER_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MFilter                                                                 //
+//                                                                         //
+// Abstract base class for the filters                                     //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+
+class MFilter : public MTask
+{
+public:
+    MFilter() {}
+    ~MFilter()
+    {
+    }
+
+    virtual Bool_t IsExpressionTrue() const;
+
+    virtual Bool_t PreProcess(MParList *pList);
+    virtual Bool_t Process();
+    virtual Bool_t PostProcess();
+
+    ClassDef(MFilter, 0)		// Abstract base class for the filters
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MFilterList.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MFilterList.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MFilterList.cc	(revision 9634)
@@ -0,0 +1,283 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  07/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//   MFilterList                                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MFilterList.h"
+
+#include <TString.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MFilterList);
+
+// --------------------------------------------------------------------------
+//
+//   Constructor.
+//
+//   Specify the boolean operation which is used to evaluate the
+//   result of this list. If no operation is specified "land" is
+//   used.
+//
+//   Options:
+//      and, &   : is a bitwise and
+//      or, |    : is a bitwise or
+//      xor, ^   : is a bitwise exclusive or
+//      land, && : is a logical and
+//      lor, ||  : is a logical or
+//
+MFilterList::MFilterList(const char *type)
+{
+    fFilterType = kEAnd;
+
+    TString str(type);
+
+    if (str.CompareTo("OR", TString::kIgnoreCase)  || str.CompareTo("|"))
+        fFilterType = kEOr;
+    if (str.CompareTo("XOR", TString::kIgnoreCase) || str.CompareTo("^"))
+        fFilterType = kEXor;
+    if (str.CompareTo("LAND", TString::kIgnoreCase) || str.CompareTo("&&"))
+        fFilterType = kELAnd;
+    if (str.CompareTo("LOR", TString::kIgnoreCase) || str.CompareTo("||"))
+        fFilterType = kELOr;
+}
+
+// --------------------------------------------------------------------------
+//
+//   CopyConstructor
+//
+MFilterList::MFilterList(MFilterList &ts)
+{
+    fFilters.AddAll(&ts.fFilters);
+    fFilterType = ts.fFilterType;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Evaluates and returns the result of the filter list.
+//  The expression is evaluated step by step, eg:
+//  ((filter[0] # filter[1]) # filter[3]) # filter[4])
+//  The '#' stands for the boolean operation which is specified in
+//  the constructor.
+//
+Bool_t MFilterList::IsExpressionTrue() const
+{
+    TIter Next(&fFilters);
+
+    MFilter *filter=(MFilter*)Next();
+
+    if (!filter)
+        return kTRUE;
+
+    Bool_t rc = filter->IsExpressionTrue();
+
+    //
+    // loop over all filters
+    //
+    switch (fFilterType)
+    {
+    case kEAnd:
+        while ((filter=(MFilter*)Next()))
+            rc &= filter->IsExpressionTrue();
+        break;
+
+    case kEOr:
+        while ((filter=(MFilter*)Next()))
+            rc |= filter->IsExpressionTrue();
+        break;
+
+    case kEXor:
+        while ((filter=(MFilter*)Next()))
+            rc ^= filter->IsExpressionTrue();
+        break;
+
+    case kELAnd:
+        while ((filter=(MFilter*)Next()))
+            rc = (rc && filter->IsExpressionTrue());
+        break;
+
+    case kELOr:
+        while ((filter=(MFilter*)Next()))
+            rc = (rc || filter->IsExpressionTrue());
+        break;
+    }
+    return rc;
+}
+
+// --------------------------------------------------------------------------
+//
+// If you want to add a new filter to the list call this function with the
+// pointer to the filter to be added. 
+//
+Bool_t MFilterList::AddToList(MFilter *filter)
+{
+    if (!filter)
+        return kTRUE;
+
+    const char *name = filter->GetName();
+
+    // FIXME: We agreed to put the task into list in an ordered way.
+
+    if (fFilters.FindObject(filter))
+    {
+        *fLog << dbginf << "Filter already existing." << endl;
+        return kTRUE;
+    }
+
+    if (fFilters.FindObject(name))
+    {
+        *fLog << dbginf << "'" << name << "' exists in List already." << endl;
+        return kTRUE;
+    }
+
+    *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
+
+    fFilters.Add(filter);
+
+    *fLog << "Done." << endl;
+
+    return kTRUE;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// PreProcesses all filters in the list
+//
+Bool_t MFilterList::PreProcess(MParList *pList)
+{
+    TIter Next(&fFilters);
+
+    MFilter *filter=NULL;
+
+    //
+    // loop over all filters
+    //
+    while ((filter=(MFilter*)Next()))
+        if (!filter->PreProcess(pList))
+            return kFALSE;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Processes (updates) all filters in the list.
+//
+Bool_t MFilterList::Process()
+{
+    TIter Next(&fFilters);
+
+    MFilter *filter=NULL;
+
+    //
+    // loop over all filters
+    //
+    while ((filter=(MFilter*)Next()))
+        if (!filter->Process())
+            return kFALSE;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// PostProcesses all filters in the list.
+//
+Bool_t MFilterList::PostProcess()
+{
+    TIter Next(&fFilters);
+
+    MFilter *filter=NULL;
+
+    //
+    // loop over all filters
+    //
+    while ((filter=(MFilter*)Next()))
+        if (!filter->PostProcess())
+            return kFALSE;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// If you want to use a verbose output ("and") instead of a symbolic ("&")
+// one the option string must conatin a "v"
+//
+void MFilterList::Print(Option_t *opt)
+{
+    TString str(opt);
+    const Bool_t verbose = str.Contains("V", TString::kIgnoreCase);
+
+    *fLog << "(";
+
+    TIter Next(&fFilters);
+
+    MFilter *filter=(MFilter*)Next();
+
+    //
+    // loop over all filters
+    //
+    if (!filter)
+    {
+        *fLog << "<empty>)" << flush;
+        return;
+    }
+
+    do
+    {
+        switch (fFilterType)
+        {
+        case kEAnd:
+            *fLog << (verbose?" and ":"&");
+            break;
+
+        case kEOr:
+            *fLog << (verbose?" or ":"|");
+            break;
+
+        case kEXor:
+            *fLog << (verbose?" xor ":"^");
+            break;
+
+        case kELAnd:
+            *fLog << (verbose?" land ":"&&");
+            break;
+
+        case kELOr:
+            *fLog << (verbose?" lor ":"||");
+            break;
+        }
+
+        filter->Print();
+    } while ((filter=(MFilter*)Next()));
+
+    *fLog << ")" << flush;
+}
Index: /tags/Mars_V0-4/Mars/mbase/MFilterList.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MFilterList.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MFilterList.h	(revision 9634)
@@ -0,0 +1,49 @@
+#ifndef MFILTERLIST_H
+#define MFILTERLIST_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//  MFilterList                                                            //
+//                                                                         //
+//  List of several filters                                                //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TOrdCollection
+#include <TOrdCollection.h>
+#endif
+#ifndef MFILTER_H
+#include "MFilter.h"
+#endif
+
+class MParList;
+
+class MFilterList : public MFilter
+{
+private:
+    TOrdCollection fFilters;	// Container for the filters
+
+    typedef enum { kEAnd, kEOr, kEXor, kELAnd, kELOr } FilterType_t;
+    FilterType_t fFilterType;
+
+public:
+    MFilterList(const char *type="&&");
+    ~MFilterList()
+    {
+    }
+    MFilterList(MFilterList &ts);
+
+    Bool_t AddToList(MFilter *filter);
+
+    Bool_t IsExpressionTrue() const;
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    void Print(Option_t *opt = "");
+
+    ClassDef(MFilterList, 0)		// List of several filters
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MHtml.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MHtml.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MHtml.cc	(revision 9634)
@@ -0,0 +1,2902 @@
+// @(#)root/html:$Name: not supported by cvs2svn $:$Id: MHtml.cc,v 1.2 2001-04-18 15:26:04 tbretz Exp $
+// Author: Nenad Buncic   18/10/95
+
+/*************************************************************************
+ * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
+ * All rights reserved.                                                  *
+ *                                                                       *
+ * For the licensing terms see $ROOTSYS/LICENSE.                         *
+ * For the list of contributors see $ROOTSYS/README/CREDITS.             *
+ *************************************************************************/
+
+#include "TROOT.h"
+#include "TBaseClass.h"
+#include "TVirtualPad.h"
+#include "TClass.h"
+#include "TClassTable.h"
+#include "TDataMember.h"
+#include "TDataType.h"
+#include "TDatime.h"
+#include "TEnv.h"
+#include "TError.h"
+#include "MHtml.h"
+#include "TMethod.h"
+#include "TSystem.h"
+#include "TString.h"
+#include "TInterpreter.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <fstream.h>
+
+MHtml *gHtml = 0;
+
+const Int_t   kSpaceNum      = 1;
+const char   *formatStr      = "%12s %5s %s";
+
+enum ESortType {kCaseInsensitive, kCaseSensitive};
+enum EFileType {kSource, kInclude, kTree};
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// This is some kind of clone of the Root THtml class. I didn't change
+// anything, but enhanced the functionality a little bit.
+//
+//   The HyperText Markup Language (HTML) is a simple data format used to
+// create hypertext documents that are portable from one platform to another.
+// HTML documents are SGML documents with generic semantics that are
+// appropriate for representing information from a wide range of domains.
+//
+//   The MHtml class is designed to provide an easy way for converting ROOT
+// classes, and files as well, into HTML documents. Here is the few rules
+// and suggestions for a configuration, coding and usage.
+//
+//
+// Configuration:
+// -------------
+//
+//   The output directory could be specified using the Root.Html.OutputDir
+// environment variable ( default value: "html/" ). Also it is necessary to
+// define Root.Html.SourceDir to point to directories containing .cxx and .h
+// files ( see: TEnv ).
+//
+//       Examples:
+//                Root.Html.OutputDir: html
+//                Root.Html.SourceDir: src:include:.:/usr/user/source
+//                Root.Html.Root:      http://root.cern.ch/root/html
+//
+//
+//   During the conversion, MHtml will look for the certain number of
+// user defined strings, i.e. author's name, copyright note, etc.
+// This could be defined with following environment variables:
+//
+//       Root.Html.Author     ( default: // Author:)
+//       Root.Html.LastUpdate ( default: // @(#))
+//       Root.Html.Copyright  ( default:  * Copyright)
+//
+//
+//
+// Coding rules:
+// ------------
+//
+//   A class description block, which must be placed before the first
+// member function, has a following form:
+//
+//       ////////////////////////////////////////////////////////////////
+//       //                                                            //
+//       // TMyClass                                                   //
+//       //                                                            //
+//       // This is the description block.                             //
+//       //                                                            //
+//       ////////////////////////////////////////////////////////////////
+//
+//   The environment variable Root.Html.Description ( see: TEnv ) contents
+// the delimiter string ( default value: //_________________ ). It means
+// that you can also write your class description block like this:
+//
+//       //_____________________________________________________________
+//       // A description of the class starts with the line above, and
+//       // will take place here !
+//       //
+//
+//   Note that EVERYTHING until the first non-commented line is considered
+// as a valid class description block.
+//
+//   A member function description block starts immediately after '{'
+// and looks like this:
+//
+//       void TWorld::HelloWorldFunc( string *text )
+//       {
+//       // This is an example of description for the
+//       // TWorld member function
+//
+//          helloWorld.Print( text );
+//       }
+//
+//   Like in a class description block, EVERYTHING until the first
+// non-commented line is considered as a valid member function
+// description block.
+//
+//   ==> The "Begin_Html" and "End_Html" special keywords <=========
+//       --------------------------------------------
+// You can insert pure html code in your comment lines. During the
+// generation of the documentation, this code will be inserted as is
+// in the html file.
+// Pure html code must be inserted between the keywords "Begin_Html"
+// and "End_Html" starting/finishing anywhere in the comment lines.
+// Examples of pure html code are given in many Root classes.
+// See for example the classes TDataMember and TMinuit.
+//
+//   ==> The escape character
+//       --------------------
+// Outside blocks starting with "Begin_Html" and finishing with "End_Html"
+// one can prevent the automatic translation of symbols like "<" and ">"
+// to "&lt;" and "&gt;" by using the escape character in front.
+// The default escape character is backslash and can be changed
+// via the member function SetEscape.
+//
+// Usage:
+// -----
+//
+//     Root> gHtml.MakeAll               // invoke a make for all classes
+//     Root> gHtml.MakeClass( TMyClass ) // create a HTML files for that class only
+//     Root> gHtml.MakeIndex()           // creates an index files only
+//     Root> gHtml.MakeTree( TMyClass )  // creates an inheritance tree for a class
+//
+//     Root> gHtml.Convert( hist1.mac, "Histogram example" )
+//
+//
+// Environment variables:
+// ---------------------
+//
+//   Root.Html.OutputDir    ( default: htmldoc/)
+//   Root.Html.SourceDir    ( default: .:src/:include/)
+//   Root.Html.Author       ( default: // Author:)
+//   Root.Html.LastUpdate   ( default: // @(#))
+//   Root.Html.Copyright    ( default:  * Copyright)
+//   Root.Html.Description  ( default: //____________________ )
+//   Root.Html.HomePage     ( URL to the user defined home page )
+//   Root.Html.SearchEngine ( link to the search engine )
+//
+////////////////////////////////////////////////////////////////////////////////
+
+ClassImp( MHtml )
+
+//______________________________________________________________________________
+MHtml::MHtml()
+{
+   // Create a MHtml object. Use object directly or via the global
+   // pointer gHtml. In case output directory does not exist an error
+   // will be printed and gHtml stays 0 also zombie bit will be set.
+
+   fLen       = 1024;
+   fLine      = new char [fLen];
+   fCounter   = new char [6];
+   fEscFlag   = kFALSE;
+   SetEscape();
+
+   // get prefix for source directory
+   fSourcePrefix = gEnv->GetValue( "Root.Html.SourcePrefix", "");
+
+   // check for source directory
+   fSourceDir = gEnv->GetValue( "Root.Html.SourceDir", "./:src/:include/" );
+
+   // check for output directory
+   fOutputDir = gEnv->GetValue( "Root.Html.OutputDir", "htmldoc/" );
+
+   fXwho      = "http://consult.cern.ch/xwho/people?";
+
+   Int_t  st;
+   Long_t sId, sSize, sFlags, sModtime;
+   if ((st = gSystem->GetPathInfo(fOutputDir, &sId, &sSize, &sFlags, &sModtime)) ||
+       !(sFlags & 2)) {
+      if (st == 0) {
+         Error("MHtml", "output directory %s is an existing file", fOutputDir);
+         MakeZombie();
+         return;
+      }
+      // Try creating directory
+      if (gSystem->MakeDirectory(fOutputDir) == -1) {
+         Error("MHtml", "output directory %s does not exist", fOutputDir);
+         MakeZombie();
+         return;
+      }
+   }
+
+   // insert html object in the list of special ROOT objects
+   gHtml = this;
+   gROOT->GetListOfSpecials()->Add(gHtml);
+}
+
+
+//______________________________________________________________________________
+MHtml::~MHtml()
+{
+// Default destructor
+
+    if( fLine    ) delete [] fLine;
+    if( fCounter ) delete [] fCounter;
+
+    fSourceDir = 0;
+    fLen       = 0;
+}
+
+
+//______________________________________________________________________________
+int CaseSensitiveSort( const void *name1, const void *name2 )
+{
+// Friend function for sorting strings, case sensitive
+//
+//
+// Input: name1 - pointer to the first string
+//        name2 - pointer to the second string
+//
+//  NOTE: This function compares its arguments and returns an integer less
+//        than, equal to, or greater than zero, depending on whether name1
+//        is lexicographically less than, equal to, or greater than name2.
+//
+//
+
+    return( strcmp( *( (char **) name1 ), *( (char **) name2 )) );
+}
+
+
+//______________________________________________________________________________
+int CaseInsensitiveSort( const void *name1, const void *name2 )
+{
+// Friend function for sorting strings, case insensitive
+//
+//
+// Input: name1 - pointer to the first string
+//        name2 - pointer to the second string
+//
+//  NOTE: This function compares its arguments and returns an integer less
+//        than, equal to, or greater than zero, depending on whether name1
+//        is lexicographically less than, equal to, or greater than name2,
+//        but characters are forced to lower-case prior to comparison.
+//
+//
+
+    return( strcasecmp( *( (char **) name1 ), *( (char **) name2 )) );
+}
+
+
+//______________________________________________________________________________
+void MHtml::Class2Html( TClass *classPtr, Bool_t force )
+{
+// It creates HTML file for a single class
+//
+//
+// Input: classPtr - pointer to the class
+
+
+    const char *tab = "<!--TAB-->";
+    const char *tab2 = "<!--TAB2-->  ";
+    const char *tab4 = "<!--TAB4-->    ";
+    const char *tab6 = "<!--TAB6-->      ";
+
+    gROOT->GetListOfGlobals( kTRUE );
+
+    // create a filename
+    char *tmp1 = gSystem->ExpandPathName( fOutputDir );
+    char *tmp2 = gSystem->ConcatFileName( tmp1, classPtr->GetName() );
+
+    char *filename = StrDup( tmp2, 6 );
+    strcat( filename, ".html" );
+
+    if( tmp1 ) delete [] tmp1;
+    if( tmp2 ) delete [] tmp2;
+    tmp1 = tmp2 = 0;
+
+    if( IsModified( classPtr, kSource ) || force ) {
+
+        // open class file
+        ofstream classFile;
+        classFile.open( filename, ios::out );
+
+        Bool_t classFlag = kFALSE;
+
+
+        if( classFile.good() ) {
+
+            Printf( formatStr, "", fCounter, filename );
+
+            // write a HTML header for the classFile file
+            WriteHtmlHeader( classFile, classPtr->GetName() );
+
+            // make a link to the description
+            classFile << "<!--BEGIN-->" << endl;
+            classFile << "<center>" << endl;
+            classFile << "<h1>" << classPtr->GetName() << "</h1>" << endl;
+            classFile << "<hr width=300>" << endl;
+            classFile << "<!--SDL--><em><a href=#" << classPtr->GetName()
+                      << ":description>class description</a>";
+
+            // make a link to the '.cxx' file
+            classFile << " - <a href=\"src/" << classPtr->GetName() << ".cxx.html\"";
+            classFile << ">source file</a>";
+
+            // make a link to the inheritance tree
+            classFile << " - <a href=\"" << classPtr->GetName() << "_Tree.ps\"";
+            classFile << ">inheritance tree</a>";
+
+
+            classFile << "</em>" << endl;
+            classFile << "<hr width=300>" << endl;
+            classFile << "</center>" << endl;
+
+
+            // make a link to the '.h' file
+            classFile << "<h2>" << "class <a name=\"" << classPtr->GetName() << "\" href=\"";
+            classFile << GetFileName( (const char * ) classPtr->GetDeclFileName() ) << "\"";
+            classFile << ">" << classPtr->GetName() << "</a> ";
+
+            // copy .h file to the Html output directory
+            char *declf = GetSourceFileName(classPtr->GetDeclFileName());
+            CopyHtmlFile(declf);
+            delete [] declf;
+
+            // make a loop on base classes
+            Bool_t first = kTRUE;
+            TBaseClass *inheritFrom;
+            TIter nextBase( classPtr->GetListOfBases() );
+
+            while (( inheritFrom = ( TBaseClass * ) nextBase() )) {
+                if( first ) {
+                    classFile << ": ";
+                    first = kFALSE;
+                }
+                else classFile << ", ";
+                classFile << "public ";
+
+                // get a class
+                TClass *classInh = GetClass( (const char * ) inheritFrom->GetName() );
+
+                char *htmlFile = GetHtmlFileName( classInh );
+
+                if( htmlFile ) {
+                    classFile << "<a href=\"";
+
+                    // make a link to the base class
+                    classFile << htmlFile;
+                    classFile << "\">" << inheritFrom->GetName() << "</a>";
+                    delete [] htmlFile;
+                    htmlFile = 0;
+                }
+                else classFile << inheritFrom->GetName();
+            }
+
+            classFile << "</h2>" << endl;
+            classFile << "<pre>" << endl;
+
+
+            // make a loop on member functions
+            TMethod *method;
+            TIter nextMethod( classPtr->GetListOfMethods() );
+
+            Int_t len, maxLen[3];
+            len = maxLen[0] = maxLen[1] = maxLen[2] = 0;
+
+            // loop to get a pointers to a method names
+            const Int_t nMethods = classPtr->GetNmethods();
+            const char **methodNames = new const char*[3*2*nMethods];
+
+            Int_t mtype, num[3];
+            mtype = num[0] = num[1] = num[2] = 0;
+
+            while (( method = ( TMethod * ) nextMethod() )) {
+
+                if(
+                    !strcmp( method->GetName(), "Dictionary"    ) ||
+                    !strcmp( method->GetName(), "Class_Version" ) ||
+                    !strcmp( method->GetName(), "Class_Name"    ) ||
+                    !strcmp( method->GetName(), "DeclFileName"  ) ||
+                    !strcmp( method->GetName(), "DeclFileLine"  ) ||
+                    !strcmp( method->GetName(), "ImplFileName"  ) ||
+                    !strcmp( method->GetName(), "ImplFileLine"  )
+                ) continue;
+
+
+                if( kIsPrivate & method->Property() )
+                    mtype = 0;
+                else if( kIsProtected & method->Property() )
+                    mtype = 1;
+                else if( kIsPublic & method->Property() )
+                    mtype = 2;
+
+                methodNames[mtype*2*nMethods+2*num[mtype]] = method->GetName();
+
+                if (method->GetReturnTypeName() ) len = strlen( method->GetReturnTypeName() );
+                else len = 0;
+
+                if( kIsVirtual & method->Property() ) len += 8;
+                if( kIsStatic & method->Property() ) len += 7;
+
+                maxLen[mtype] = maxLen[mtype] > len ? maxLen[mtype] : len;
+
+                const char* type = strrchr( method->GetReturnTypeName(), ' ' );
+                if( ! type ) type = method->GetReturnTypeName();
+                else type++;
+
+                if( classPtr && !strcmp( type, classPtr->GetName() ))
+                    methodNames[mtype*2*nMethods+2*num[mtype]] = "A00000000";
+
+                // if this is the destructor
+                while( '~' == *methodNames[mtype*2*nMethods+2*num[mtype]] )
+                    methodNames[mtype*2*nMethods+2*num[mtype]] = "A00000001";
+
+                methodNames[mtype*2*nMethods+2*num[mtype]+1] = (char *) method;
+
+                num[mtype]++;
+            }
+
+            Int_t i, j;
+
+            for( j = 0; j < 3; j ++ ) {
+                if( *( methodNames+j*2*nMethods ) ) {
+                    qsort( methodNames+j*2*nMethods, num[j], 2*sizeof( methodNames ), CaseInsensitiveSort );
+
+                    const char *ftitle = 0;
+                    switch( j ) {
+                        case 0: ftitle = "private:";
+                                break;
+                        case 1: ftitle = "protected:";
+                                break;
+                        case 2: ftitle = "public:";
+                                break;
+                    }
+                    if( j ) classFile << endl;
+                    classFile << tab4 << "<b>" << ftitle << "</b><br>" << endl;
+
+                    for( i = 0; i < num[j]; i++ ) {
+                        method = (TMethod *) methodNames[j*2*nMethods+2*i+1];
+
+                        if( method ) {
+                            Int_t w = 0;
+                            if( method->GetReturnTypeName() ) len = strlen( method->GetReturnTypeName() );
+                            else len = 0;
+
+                            if( kIsVirtual & method->Property() ) len += 8;
+                            if( kIsStatic & method->Property() ) len += 7;
+
+                            classFile << tab6;
+                            for( w = 0; w < ( maxLen[j]-len ); w++ )
+                                classFile << " ";
+
+                            if( kIsVirtual & method->Property() )
+                                classFile << "virtual ";
+
+                            if( kIsStatic & method->Property() )
+                                classFile << "static ";
+
+                            strcpy( fLine, method->GetReturnTypeName() );
+                            ExpandKeywords( classFile, fLine, classPtr, classFlag );
+
+                            classFile << " " << tab << "<!--BOLD-->";
+                            classFile << "<a href=\"#" << classPtr->GetName();
+                            classFile << ":";
+                            ReplaceSpecialChars( classFile, method->GetName() );
+                            classFile << "\">";
+                            ReplaceSpecialChars( classFile, method->GetName() );
+                            classFile << "</a><!--PLAIN-->";
+
+                            strcpy( fLine, method->GetSignature() );
+                            ExpandKeywords( classFile, fLine, classPtr, classFlag );
+                            classFile << endl;
+                        }
+                    }
+                }
+            }
+
+            delete [] methodNames;
+
+            // make a loop on data members
+            first = kFALSE;
+            TDataMember *member;
+            TIter nextMember( classPtr->GetListOfDataMembers() );
+
+
+            Int_t len1, len2, maxLen1[3], maxLen2[3];
+            len1 = len2 = maxLen1[0] = maxLen1[1] = maxLen1[2] = 0;
+            maxLen2[0] = maxLen2[1] = maxLen2[2] = 0;
+            mtype = num[0] = num[1] = num[2] = 0;
+
+            Int_t ndata = classPtr->GetNdata();
+
+            // if data member exist
+            if( ndata ) {
+                TDataMember **memberArray = new TDataMember*[3*ndata];
+
+                if( memberArray ) {
+                    while (( member = ( TDataMember * ) nextMember() )) {
+
+                        if(
+                            !strcmp( member->GetName(), "fgIsA" )
+                        ) continue;
+
+                        if( kIsPrivate & member->Property() )
+                            mtype = 0;
+                        else if( kIsProtected & member->Property() )
+                            mtype = 1;
+                        else if( kIsPublic & member->Property() )
+                            mtype = 2;
+
+                        memberArray[mtype*ndata+num[mtype]] = member;
+                        num[mtype]++;
+
+                        if( member->GetFullTypeName() )
+                             len1 = strlen( (char * ) member->GetFullTypeName() );
+                        else len1 = 0;
+                        if( member->GetName() )
+                             len2 = strlen( member->GetName() );
+                        else len2 = 0;
+
+                        if( kIsStatic & member->Property() ) len1 += 7;
+
+                       // Take in account the room the array index will occupy
+
+                        Int_t dim = member->GetArrayDim();
+                        Int_t indx = 0;
+                        while (indx < dim ){
+                              indx++;
+                              len2 += Int_t(TMath::Log10(member->GetMaxIndex(indx))) + 3;
+                         }
+
+                        maxLen1[mtype] = maxLen1[mtype] > len1 ? maxLen1[mtype] : len1;
+                        maxLen2[mtype] = maxLen2[mtype] > len2 ? maxLen2[mtype] : len2;
+                    }
+
+                    classFile << endl;
+                    classFile << "<h3>" << tab2 << "<a name=\"";
+                    classFile << classPtr->GetName();
+                    classFile << ":Data Members\">Data Members</a></h3>" << endl;
+
+                    for( j = 0; j < 3; j++ ) {
+                        if( memberArray[j*ndata] ) {
+                            const char *ftitle = 0;
+                            switch( j ) {
+                                case 0: ftitle = "private:";
+                                        break;
+                                case 1: ftitle = "protected:";
+                                        break;
+                                case 2: ftitle = "public:";
+                                        break;
+                            }
+                            if( j ) classFile << endl;
+                            classFile << tab4 << "<b>" << ftitle << "</b><br>" << endl;
+
+                            for( i = 0; i < num[j]; i++ ) {
+                                Int_t w = 0;
+                                member = memberArray[j*ndata+i];
+
+                                classFile << tab6;
+                                if ( member->GetFullTypeName() ) len1 = strlen( member->GetFullTypeName() );
+                                else len1 = 0;
+
+                                if( kIsStatic & member->Property() ) len1 += 7;
+
+                                for( w = 0; w < ( maxLen1[j]-len1 ); w++ )
+                                    classFile << " ";
+
+                                if( kIsStatic & member->Property() )
+                                    classFile << "static ";
+
+                                strcpy( fLine, member->GetFullTypeName() );
+                                ExpandKeywords( classFile, fLine, classPtr, classFlag );
+
+                                classFile << " " << tab << "<!--BOLD-->";
+                                classFile << "<a name=\"" << classPtr->GetName() << ":";
+                                classFile << member->GetName();
+                                classFile << "\">" << member->GetName();
+
+                                // Add the dimensions to "array" members
+
+                                Int_t dim = member->GetArrayDim();
+                                Int_t indx = 0;
+                                Int_t indxlen = 0;
+                                while (indx < dim ){
+                                     classFile <<  "[" << member->GetMaxIndex(indx)<<"]";
+                                     // Take in account the room this index will occupy
+                                     indxlen += Int_t(TMath::Log10(member->GetMaxIndex(indx))) + 3;
+                                     indx++;
+                                }
+
+                                classFile << "</a><!--PLAIN--> ";
+
+                                len2 = 0;
+                                if( member->GetName() )
+                                      len2 = strlen( member->GetName() ) + indxlen;
+
+                                for( w = 0; w < ( maxLen2[j]-len2 ); w++ )
+                                    classFile << " ";
+                                classFile << " " << tab;
+
+                                classFile << "<i><a name=\"Title:";
+                                classFile << member->GetName();
+
+                                classFile << "\">";
+
+                                strcpy( fLine, member->GetTitle() );
+                                ReplaceSpecialChars( classFile, fLine );
+                                classFile << "</a></i>" << endl;
+                            }
+                        }
+                    }
+                    classFile << "</pre>" << endl;
+                    delete [] memberArray;
+                }
+            }
+
+            classFile << "<!--END-->" << endl;
+
+            // create a 'See also' part
+            DerivedClasses( classFile, classPtr );
+
+            // process a '.cxx' file
+            ClassDescription( classFile, classPtr, classFlag );
+
+
+            // close a file
+            classFile.close();
+
+        }
+        else Error( "Make", "Can't open file '%s' !", filename );
+    }
+    else Printf( formatStr, "-no change-", fCounter, filename );
+
+    if( filename ) delete [] filename;
+    filename = 0;
+}
+
+
+//______________________________________________________________________________
+void MHtml::ClassDescription( ofstream &out, TClass *classPtr, Bool_t &flag )
+{
+// This function builds the description of the class
+//
+//
+// Input: out      - output file stream
+//        classPtr - pointer to the class
+//        flag     - this is a 'begin_html/end_html' flag
+//
+
+    char  *ptr, *key;
+    Bool_t tempFlag = kFALSE;
+    char  *filename = 0;
+
+
+    // allocate memory
+    char *nextLine    = new char [256];
+    char *pattern     = new char [80];
+
+    char *lastUpdate  = new char [256];
+    char *author      = new char [80];
+    char *copyright   = new char [80];
+
+
+    char *funcName   = new char [64];
+
+    const char *lastUpdateStr;
+    const char *authorStr;
+    const char *copyrightStr;
+    const char *descriptionStr;
+
+
+    // just in case
+    *lastUpdate = *author = *copyright = 0;
+
+
+    // define pattern
+    strcpy( pattern, classPtr->GetName() );
+    strcat( pattern, "::" );
+    Int_t len = strlen( pattern );
+
+
+    // get environment variables
+    lastUpdateStr  = gEnv->GetValue( "Root.Html.LastUpdate", "// @(#)" );
+    authorStr      = gEnv->GetValue( "Root.Html.Author", "// Author:" );
+    copyrightStr   = gEnv->GetValue( "Root.Html.Copyright", " * Copyright" );
+    descriptionStr = gEnv->GetValue( "Root.Html.Description", "//____________________" );
+
+
+    // find a .cxx file
+    char *tmp1 = GetSourceFileName(classPtr->GetImplFileName());
+    char *realFilename = StrDup( tmp1, 16 );
+    if( !realFilename ) Error( "Make", "Can't find file '%s' !", tmp1 );
+
+    if( tmp1 ) delete [] tmp1;
+    tmp1 = 0;
+
+    Bool_t classDescription    = kTRUE;
+
+    Bool_t foundLastUpdate     = kFALSE;
+    Bool_t foundAuthor         = kFALSE;
+    Bool_t foundCopyright      = kFALSE;
+
+    Bool_t firstCommentLine    = kTRUE;
+    Bool_t extractComments     = kFALSE;
+    Bool_t thisLineIsCommented = kFALSE;
+    Bool_t thisLineIsPpLine    = kFALSE;
+    Bool_t postponeMemberDescr = kFALSE;
+    Bool_t skipMemberName      = kFALSE;
+    Bool_t writeBracket        = kFALSE;
+    streampos postponedpos = 0;
+
+    // Class Description Title
+    out << "<hr>" << endl;
+    out << "<!--DESCRIPTION-->";
+    out << "<h2><a name=\"" << classPtr->GetName();
+    out << ":description\">Class Description</a></h2>" << endl;
+
+
+    // open source file
+    ifstream sourceFile;
+    sourceFile.open( realFilename, ios::in );
+
+
+    if( sourceFile.good() ) {
+        // open a .cxx.html file
+        tmp1 = gSystem->ExpandPathName( fOutputDir );
+        char *tmp2 = gSystem->ConcatFileName( tmp1, "src" );
+        char *dirname = StrDup( tmp2 );
+
+        if( tmp1 ) delete [] tmp1;
+        if( tmp2 ) delete [] tmp2;
+        tmp1 = tmp2 = 0;
+
+        // create directory if necessary
+        if( gSystem->AccessPathName( dirname ))
+            gSystem->MakeDirectory( dirname );
+
+        tmp1 = gSystem->ConcatFileName( dirname, classPtr->GetName() );
+        filename = StrDup( tmp1, 16 );
+        strcat( filename, ".cxx.html" );
+
+        ofstream tempFile;
+        tempFile.open( filename, ios::out );
+
+        if( dirname ) delete [] dirname;
+
+        if( tmp1 ) delete [] tmp1;
+        tmp1 = 0;
+
+        if( tempFile.good() ) {
+
+
+            // create an array of method names
+            Int_t i = 0;
+            TMethod *method;
+            TIter nextMethod( classPtr->GetListOfMethods() );
+            Int_t numberOfMethods = classPtr->GetNmethods();
+            const char **methodNames = new const char* [2*numberOfMethods];
+            while (( method = ( TMethod * ) nextMethod() )) {
+                methodNames[2*i]   = method->GetName();
+                methodNames[2*i+1] = ( const char * ) method;
+                i++;
+            }
+
+
+            // write a HTML header
+            char *sourceTitle = StrDup( classPtr->GetName(), 16 );
+            strcat( sourceTitle, " - source file" );
+            WriteHtmlHeader( tempFile, sourceTitle );
+            if( sourceTitle ) delete [] sourceTitle;
+
+
+            tempFile << "<pre>" << endl;
+
+            while( !sourceFile.eof() ) {
+
+                sourceFile.getline( fLine, fLen-1 );
+                if( sourceFile.eof() ) break;
+
+
+                // set start & end of the line
+                if (!fLine) {
+                   fLine = (char *) " ";
+                   Warning("ClassDescription", "found an empty line");
+                }
+                char *startOfLine = fLine;
+                char *endOfLine   = fLine + strlen( fLine ) - 1;
+
+
+                // remove leading spaces
+                while( isspace( *startOfLine )) startOfLine++;
+
+                // remove trailing spaces
+                while( isspace( *endOfLine )) endOfLine--;
+                if( *startOfLine == '#' && !tempFlag )
+                    thisLineIsPpLine = kTRUE;
+
+                // if this line is a comment line
+                else if( !strncmp( startOfLine, "//", 2 )) {
+
+                    thisLineIsCommented = kTRUE;
+                    thisLineIsPpLine    = kFALSE;
+
+                    // remove a repeating characters from the end of the line
+                    while( (*endOfLine == *startOfLine ) &&
+                            ( endOfLine >= startOfLine )) endOfLine--;
+                    endOfLine++;
+                    char tempChar = *endOfLine;
+                    *endOfLine = 0;
+
+
+                    if( extractComments) {
+                        if( firstCommentLine ) {
+                            out << "<pre>";
+                            firstCommentLine = kFALSE;
+                        }
+                        if( endOfLine >= startOfLine+2 )
+                            ExpandKeywords( out, startOfLine+2, classPtr, flag );
+                        out << endl;
+                    }
+
+                    *endOfLine = tempChar;
+
+                    // if line is composed of the same characters
+                    if( (endOfLine == startOfLine ) && *( startOfLine+2 ) && classDescription ) {
+                        extractComments  = kTRUE;
+                        classDescription = kFALSE;
+                    }
+                }
+                else {
+                    thisLineIsCommented = kFALSE;
+                    if( flag ) {
+                        out << fLine << endl;
+                    }
+                    else {
+                        extractComments = kFALSE;
+                        if( !firstCommentLine ) {
+                            out << "</pre>";
+                            firstCommentLine = kTRUE;
+                        }
+                    }
+                }
+
+
+                // if NOT member function
+                key = strstr( fLine, pattern );
+                if( !key ) {
+                    // check for a lastUpdate string
+                    if( !foundLastUpdate && lastUpdateStr) {
+                        if( !strncmp( fLine, lastUpdateStr, strlen( lastUpdateStr )) ) {
+                            strcpy( lastUpdate, fLine+strlen( lastUpdateStr ));
+                            foundLastUpdate = kTRUE;
+                        }
+                    }
+
+                    // check for an author string
+                    if( !foundAuthor && authorStr) {
+                        if( !strncmp( fLine, authorStr, strlen( authorStr )) ) {
+                            strcpy( author, fLine+strlen( authorStr ));
+                            foundAuthor = kTRUE;
+                        }
+                    }
+
+                    // check for a copyright string
+                    if( !foundCopyright && copyrightStr) {
+                        if( !strncmp( fLine, copyrightStr, strlen( copyrightStr )) ) {
+                            strcpy( copyright, fLine+strlen( copyrightStr ));
+                            foundCopyright = kTRUE;
+                        }
+                    }
+
+                    // check for a description comments
+                    if( descriptionStr && !strncmp( fLine, descriptionStr, strlen( descriptionStr )) ) {
+                        if( classDescription ) {
+                            // write description out
+                            classDescription = kFALSE;
+                            extractComments = kTRUE;
+                        }
+                        else
+                        {
+                            postponeMemberDescr = kTRUE;
+                            postponedpos = sourceFile.tellg();
+                        }
+                    }
+                }
+                else {
+                    Bool_t found = kFALSE;
+                    // find method name
+                    char *funcName = key + len;
+
+                    while( *funcName && isspace( *funcName ) )
+                        funcName++;
+                    char *nameEndPtr = funcName;
+
+                    // In case of destructor
+                    if( *nameEndPtr == '~' ) nameEndPtr++;
+
+                    while( *nameEndPtr && IsName( *nameEndPtr ) )
+                        nameEndPtr++;
+
+                    char c1 = *nameEndPtr;
+                    char pe = 0;
+
+                    char *params, *paramsEnd;
+                    params = nameEndPtr;
+                    paramsEnd = NULL;
+
+                    while( *params  && isspace( *params ) ) params++;
+                    if( *params != '(') params = NULL;
+                    else params++;
+                    paramsEnd = params;
+
+                    // if signature exist, try to find the ending character
+                    if( paramsEnd ) {
+                        Int_t count = 1;
+                        while( *paramsEnd ) {
+                            if( *paramsEnd == '(') count++;
+                            if( *paramsEnd == ')')
+                                if( !--count ) break;
+                            paramsEnd++;
+                        }
+                        pe = *paramsEnd;
+                        *paramsEnd = 0;
+                    }
+                    *nameEndPtr = 0;
+
+                    // get method
+                    TMethod *method;
+                    method = classPtr->GetMethodAny( funcName );
+
+                    // restore characters
+                    if( paramsEnd )  *paramsEnd = pe;
+                    if( nameEndPtr ) *nameEndPtr = c1;
+
+                    if( method ) {
+
+                        if (skipMemberName)
+                        {
+                            skipMemberName = kFALSE;
+                            writeBracket = kTRUE;
+                            sourceFile.seekg(postponedpos);
+                        }
+                        else
+                        {
+                        char *typeEnd = NULL;
+                        char c2 = 0;
+
+                        found = kFALSE;
+
+                        // try to get type
+                        typeEnd = key-1;
+                        while( ( typeEnd > fLine ) && (isspace( *typeEnd ) || *typeEnd == '*') )
+                            typeEnd--;
+                        typeEnd++;
+                        c2 = *typeEnd;
+                        *typeEnd = 0;
+                        char *type = typeEnd - 1;
+                        while( IsName( *type ) && ( type > fLine ))
+                            type--;
+                        if( !IsWord( *type )) type++;
+
+                        while( (type > fLine ) && isspace( *( type-1 )) )
+                            type--;
+                        if( type > fLine ) {
+                            if( !strncmp( type-5, "const", 5 ))
+                                found = kTRUE;
+                            else found = kFALSE;
+                        }
+                        else if( type == fLine )
+                            found = kTRUE;
+
+                        if( !strcmp( type, "void" ) && ( *funcName == '~' ) )
+                            found = kTRUE;
+
+                        *typeEnd = c2;
+
+                        if( found ) {
+                            ptr = strchr( nameEndPtr, '{');
+                            char *semicolon = strchr( nameEndPtr, ';');
+                            if( semicolon )
+                                if( !ptr || ( semicolon < ptr )) found = kFALSE;
+
+                            if( !ptr && found ) {
+                                found = kFALSE;
+                                while( sourceFile.getline( nextLine, 255 ) && fLine && nextLine &&
+                                ( strlen( fLine ) < ( fLen-strlen( nextLine )) )) {
+                                    strcat( fLine, "\n" );
+                                    strcat( fLine, nextLine );
+                                    if (( ptr = strchr( fLine, '{') )) {
+                                        found = kTRUE;
+                                        *ptr = 0;
+                                        break;
+                                    }
+                                }
+                            }
+                            else if( ptr ) *ptr = 0;
+
+                            if( found ) {
+                                char *colonPtr = strrchr( fLine, ':');
+                                if( colonPtr > funcName ) *colonPtr = 0;
+                                if( found ) {
+                                    out << "<hr>" << endl;
+                                    out << "<!--FUNCTION-->";
+                                    if( typeEnd ) {
+                                        c2 = *typeEnd;
+                                        *typeEnd = 0;
+                                        ExpandKeywords( out, fLine, classPtr, flag );
+                                        *typeEnd = c2;
+                                        while( typeEnd < key ) {
+                                            if( *typeEnd == '*')
+                                                out << *typeEnd;
+                                            typeEnd++;
+                                        }
+                                    }
+                                    *nameEndPtr = 0;
+
+                                    out << " <a name=\"" << classPtr->GetName() << ":";
+                                    out << funcName << "\" href=\"src/";
+                                    out << classPtr->GetName() << ".cxx.html#" << classPtr->GetName() << ":";
+                                    ReplaceSpecialChars( out, funcName );
+                                    out << "\">";
+                                    ReplaceSpecialChars( out, funcName );
+                                    out << "</a>";
+
+                                    tempFile << "<a name=\"" << classPtr->GetName() << ":";
+                                    ReplaceSpecialChars( tempFile, funcName );
+                                    tempFile << "\"> </a>";
+
+                                    // remove this method name from the list of methods
+                                    i = 0;
+                                    while( i < numberOfMethods ) {
+                                        const char *mptr = methodNames[2*i];
+                                        if( mptr ) {
+                                           while( *mptr == '*') mptr++;
+                                           if( !strcmp( mptr, funcName )) {
+                                               methodNames[2*i] = NULL;
+                                               break;
+                                           }
+                                        }
+                                        i++;
+                                    }
+
+                                    *nameEndPtr = c1;
+                                    if( colonPtr ) *colonPtr = ':';
+                                    ExpandKeywords( out, nameEndPtr, classPtr, flag );
+                                    out << "<br>" << endl;
+
+                                    if (postponeMemberDescr)
+                                    {
+                                        streampos pos = sourceFile.tellg();
+                                        sourceFile.seekg(postponedpos);
+                                        postponedpos = pos;
+                                        skipMemberName = kTRUE;
+                                        postponeMemberDescr = kFALSE;
+                                    }
+                                    extractComments = kTRUE;
+                                }
+                            }
+                            if( ptr ) *ptr = '{';
+                        }
+                    }
+                }
+                }
+
+                // write to '.cxx.html' file
+                if (!skipMemberName)
+                {
+                    if( thisLineIsPpLine )
+                        ExpandPpLine( tempFile, fLine );
+                    else {
+                        if( thisLineIsCommented) tempFile << "<b>";
+                        ExpandKeywords( tempFile, fLine, classPtr, tempFlag, "../" );
+                        if( thisLineIsCommented ) tempFile << "</b>";
+                    }
+                    tempFile << endl;
+
+                    if (writeBracket)
+                    {
+                        writeBracket = kFALSE;
+                        tempFile << "{" << endl;
+                    }
+                }
+
+            }
+            tempFile << "</pre>" << endl;
+
+            // do some checking
+            Bool_t inlineFunc = kFALSE;
+            i = 0;
+            while( i++ < numberOfMethods ) {
+                if( methodNames[2*i] ) {
+                    inlineFunc = kTRUE;
+                    break;
+                }
+            }
+
+
+            if( inlineFunc ) {
+                out << "<br><br><br>" << endl;
+                out << "<h3>Inline Functions</h3>" << endl;
+                out << "<hr>" << endl;
+                out << "<pre>" << endl;
+
+                Int_t maxlen = 0, len = 0;
+                for( i = 0; i < numberOfMethods; i++ ) {
+                    if( methodNames[2*i] ) {
+                        method = ( TMethod * ) methodNames[2*i+1];
+                        if ( method->GetReturnTypeName() ) len = strlen( method->GetReturnTypeName() );
+                        else len = 0;
+                        maxlen = len > maxlen ? len : maxlen;
+                    }
+                }
+
+
+                // write out an inline functions
+                for( i = 0; i < numberOfMethods; i++ ) {
+                    if( methodNames[2*i] ) {
+
+                        method = ( TMethod * ) methodNames[2*i+1];
+
+                        if( method ) {
+
+                            if(
+                                !strcmp( method->GetName(), "Dictionary"    ) ||
+                                !strcmp( method->GetName(), "Class_Version" ) ||
+                                !strcmp( method->GetName(), "Class_Name"    ) ||
+                                !strcmp( method->GetName(), "DeclFileName"  ) ||
+                                !strcmp( method->GetName(), "DeclFileLine"  ) ||
+                                !strcmp( method->GetName(), "ImplFileName"  ) ||
+                                !strcmp( method->GetName(), "ImplFileLine"  )
+                            ) continue;
+
+                            out << "<!--INLINE FUNCTION-->";
+                            if(method->GetReturnTypeName() ) len = strlen( method->GetReturnTypeName() );
+                            else len = 0;
+
+                            out << "<!--TAB6-->      ";
+                            while( len++ < maxlen+2 ) out << " ";
+
+                            char *tmpstr = StrDup( method->GetReturnTypeName() );
+                            if( tmpstr ) {
+                                ExpandKeywords( out, tmpstr, classPtr, flag );
+                                delete [] tmpstr;
+                            }
+
+                            out << " <a name=\"" << classPtr->GetName();
+                            out << ":" << method->GetName() << "\" href=\"";
+                            out << GetFileName( classPtr->GetDeclFileName() ) << "\">";
+                            out << method->GetName() << "</a>";
+
+                            strcpy( fLine, method->GetSignature() );
+                            ExpandKeywords( out, fLine, classPtr, flag );
+                            out << endl;
+                        }
+                    }
+                }
+                out << "</pre>" << endl;
+            }
+
+
+            // write tempFile footer
+            WriteHtmlFooter( tempFile, "../" );
+
+            // close a temp file
+            tempFile.close();
+
+            delete [] methodNames;
+        }
+        else Error( "MakeClass", "Can't open file '%s' !", filename );
+
+        // close a source file
+        sourceFile.close();
+
+    }
+    else Error( "Make", "Can't open file '%s' !", realFilename );
+
+
+    // write classFile footer
+    WriteHtmlFooter( out, "",  lastUpdate, author, copyright );
+
+    // free memory
+    if( nextLine )     delete [] nextLine;
+    if( pattern )      delete [] pattern;
+
+    if( lastUpdate )   delete [] lastUpdate;
+    if( author )       delete [] author;
+    if( copyright )    delete [] copyright;
+    if( funcName )     delete [] funcName;
+
+    if( realFilename ) delete [] realFilename;
+    if( filename )     delete [] filename;
+}
+
+
+//______________________________________________________________________________
+void MHtml::ClassTree( TVirtualPad *psCanvas, TClass *classPtr, Bool_t force )
+{
+// It makes a class tree
+//
+//
+// Input: psCanvas - pointer to the current canvas
+//        classPtr - pointer to the class
+//
+
+    if( psCanvas && classPtr ) {
+        char *tmp1 = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), classPtr->GetName() );
+        char *filename = StrDup( tmp1 , 16 );
+
+        strcat( filename, "_Tree.ps" );
+
+        if( tmp1 ) delete [] tmp1;
+        tmp1 = 0;
+
+        if( IsModified( classPtr, kTree ) || force ) {
+            Printf( formatStr, "", "", filename );
+            classPtr->Draw( "same" );
+            psCanvas->SaveAs(filename);
+        }
+        else Printf( formatStr, "-no change-", "", filename );
+
+        if( filename ) delete [] filename;
+    }
+}
+
+
+//______________________________________________________________________________
+void MHtml::Convert( const char *filename, const char *title, const char *dirname )
+{
+// It converts a single text file to HTML
+//
+//
+// Input: filename - name of the file to convert
+//        title    - title which will be placed at the top of the HTML file
+//        dirname  - optional parameter, if it's not specified, output will
+//                   be placed in html/examples directory.
+//
+//  NOTE: Output file name is the same as filename, but with extension .html
+//
+
+    const char *dir;
+    char *ptr;
+
+    Bool_t isCommentedLine = kFALSE;
+    Bool_t tempFlag = kFALSE;
+
+    // if it's not defined, make the "examples" as a default directory
+    if( !*dirname ) {
+        dir = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), "examples" );
+
+        // create directory if necessary
+        if( gSystem->AccessPathName( dir ))
+            gSystem->MakeDirectory( dir );
+    }
+    else dir = dirname;
+
+
+    // find a file
+    char *realFilename = gSystem->Which( fSourceDir, filename, kReadPermission );
+
+    if( realFilename ) {
+
+        // open source file
+        ifstream sourceFile;
+        sourceFile.open( realFilename, ios::in );
+
+        delete [] realFilename;
+        realFilename = 0;
+
+        if( sourceFile.good() ) {
+
+            // open temp file with extension '.html'
+            if( !gSystem->AccessPathName( dir )) {
+                char *tmp1 = gSystem->ConcatFileName( dir, GetFileName( filename ));
+                char *htmlFilename = StrDup( tmp1, 16 );
+                strcat( htmlFilename, ".html" );
+
+                if( tmp1 ) delete [] tmp1;
+                tmp1 = 0;
+
+                ofstream tempFile;
+                tempFile.open( htmlFilename, ios::out );
+
+                if( tempFile.good() ) {
+
+                    Printf( "Convert: %s", htmlFilename );
+
+                    // write a HTML header
+                    WriteHtmlHeader( tempFile, title );
+
+                    tempFile << "<h1>" << title << "</h1>" << endl;
+                    tempFile << "<pre>" << endl;
+
+                    while( !sourceFile.eof() ) {
+                        sourceFile.getline( fLine, fLen-1 );
+                        if( sourceFile.eof() ) break;
+
+
+                        // remove leading spaces
+                        ptr = fLine;
+                        while( isspace( *ptr )) ptr++;
+
+
+                        // check for a commented line
+                        if( !strncmp( ptr, "//", 2 )) isCommentedLine = kTRUE;
+                        else isCommentedLine = kFALSE;
+
+
+                        // write to a '.html' file
+                        if( isCommentedLine ) tempFile << "<b>";
+                        gROOT->GetListOfGlobals(kTRUE); // force update of this list
+                        ExpandKeywords( tempFile, fLine, NULL, tempFlag, "../" );
+                        if( isCommentedLine ) tempFile << "</b>";
+                        tempFile << endl;
+                    }
+                    tempFile << "</pre>" << endl;
+
+
+                    // write a HTML footer
+                    WriteHtmlFooter( tempFile, "../" );
+
+
+                    // close a temp file
+                    tempFile.close();
+
+                }
+                else Error( "Convert", "Can't open file '%s' !", htmlFilename );
+
+                // close a source file
+                sourceFile.close();
+                if( htmlFilename ) delete [] htmlFilename;
+                htmlFilename = 0;
+            }
+            else Error( "Convert", "Directory '%s' doesn't exist, or it's write protected !", dir );
+        }
+        else Error( "Convert", "Can't open file '%s' !", realFilename );
+    }
+    else Error( "Convert", "Can't find file '%s' !", filename );
+}
+
+
+//______________________________________________________________________________
+Bool_t MHtml::CopyHtmlFile( const char *sourceName, const char *destName )
+{
+// Copy file to HTML directory
+//
+//
+//  Input: sourceName - source file name
+//         destName   - optional destination name, if not
+//                      specified it would be the same
+//                      as the source file name
+//
+// Output: TRUE if file is successfully copied, or
+//         FALSE if it's not
+//
+//
+//   NOTE: The destination directory is always fOutputDir
+//
+
+    Bool_t ret = kFALSE;
+    Int_t check = 0;
+
+    // source file name
+    char *tmp1 = gSystem->Which( fSourceDir, sourceName, kReadPermission );
+    char *sourceFile = StrDup( tmp1, 16 );
+
+    if( tmp1 ) delete [] tmp1;
+    tmp1 = 0;
+
+    if( sourceFile ) {
+
+        // destination file name
+        char *tmpstr = 0;
+        if( !*destName ) tmpstr = StrDup( GetFileName( sourceFile ), 16 );
+        else tmpstr = StrDup( GetFileName( destName ), 16 );
+        destName = tmpstr;
+
+        tmp1 = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), destName );
+        char *filename = StrDup( tmp1, 16 );
+
+        if( tmp1 ) delete [] tmp1;
+        tmp1 = 0;
+
+        // Get info about a file
+        Long_t sId, sSize, sFlags, sModtime;
+        Long_t dId, dSize, dFlags, dModtime;
+        if( !( check = gSystem->GetPathInfo( sourceFile, &sId, &sSize, &sFlags, &sModtime )) )
+            check = gSystem->GetPathInfo( filename, &dId, &dSize, &dFlags, &dModtime );
+
+
+        if( (sModtime != dModtime ) || check ) {
+
+            char *cmd = new char[256];
+
+#ifdef R__UNIX
+            strcpy( cmd, "/bin/cp " );
+            strcat( cmd, sourceFile );
+            strcat( cmd, " " );
+            strcat( cmd, filename );
+#endif
+
+#ifdef WIN32
+            strcpy( cmd, "copy \"" );
+            strcat( cmd, sourceFile );
+            strcat( cmd, "\" \"" );
+            strcat( cmd, filename );
+            strcat( cmd, "\"");
+            char *bptr = 0;
+            while( bptr = strchr( cmd, '/') )
+                *bptr = '\\';
+#endif
+
+            ret = !gSystem->Exec( cmd );
+
+            delete [] cmd;
+            delete [] filename;
+            delete [] tmpstr;
+            delete [] sourceFile;
+        }
+    }
+    else Error( "Copy", "Can't copy file '%s' to '%s' directory !", sourceName, fOutputDir );
+
+    return( ret );
+}
+
+
+
+//______________________________________________________________________________
+void MHtml::CreateIndex( const char **classNames, Int_t numberOfClasses )
+{
+// Create an index
+//
+//
+// Input: classNames      - pointer to an array of class names
+//        numberOfClasses - number of elements
+//
+
+    Int_t i, len, maxLen = 0;
+
+    char *tmp1 = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), "ClassIndex.html" );
+    char *filename = StrDup( tmp1 );
+
+    if( tmp1 ) delete [] tmp1;
+    tmp1 = 0;
+
+    // open indexFile file
+    ofstream indexFile;
+    indexFile.open( filename, ios::out );
+
+    for( i = 0; i < numberOfClasses; i++ ) {
+        len    = strlen( classNames[i] );
+        maxLen = maxLen > len ? maxLen : len;
+    }
+
+    if( indexFile.good() ) {
+
+        Printf( formatStr, "", fCounter, filename );
+
+        // write indexFile header
+        WriteHtmlHeader( indexFile, "Class Index" );
+        indexFile << "<h1>Index</h1>" << endl;
+
+        // check for a search engine
+        const char *searchEngine = gEnv->GetValue( "Root.Html.SearchEngine", "" );
+
+        // if exists ...
+        if( *searchEngine ) {
+
+            // create link to search engine page
+            indexFile << "<h2><a href=\"" << searchEngine
+                      << "\">Search the Class Reference Guide</a></h2>" << endl;
+
+        }
+
+        indexFile << "<hr>" << endl;
+        indexFile << "<pre>" << endl;
+        indexFile << "<ul>" << endl;
+
+        // loop on all classes
+        for( i = 0; i < numberOfClasses; i++ ) {
+
+            // get class
+            TClass *classPtr = GetClass( (const char * ) classNames[i] );
+
+            indexFile << "<li>";
+            char *htmlFile = GetHtmlFileName( classPtr );
+            if( htmlFile ) {
+                indexFile << "<a name=\"";
+                indexFile << classNames[i];
+                indexFile << "\" href=\"";
+                indexFile << htmlFile;
+                indexFile << "\">";
+                indexFile << classNames[i];
+                indexFile << "</a> ";
+                delete [] htmlFile;
+                htmlFile = 0;
+            }
+            else indexFile << classNames[i];
+
+
+            // write title
+            len = strlen( classNames[i] );
+            for( Int_t w = 0; w < ( maxLen-len+2 ); w++ )
+                indexFile << ".";
+            indexFile << " ";
+
+            indexFile << "<a name=\"Title:";
+            indexFile << classPtr->GetName();
+            indexFile << "\">";
+            ReplaceSpecialChars( indexFile, classPtr->GetTitle() );
+            indexFile << "</a>" << endl;
+        }
+
+        indexFile << "</ul>" << endl;
+        indexFile << "</pre>" << endl;
+
+
+        // write indexFile footer
+        TDatime date;
+        WriteHtmlFooter( indexFile, "", date.AsString() );
+
+
+        // close file
+        indexFile.close();
+
+    }
+    else Error( "MakeIndex", "Can't open file '%s' !", filename );
+
+    if( filename ) delete [] filename;
+}
+
+
+//______________________________________________________________________________
+void MHtml::CreateIndexByTopic( char **fileNames, Int_t numberOfNames, Int_t maxLen )
+{
+// It creates several index files
+//
+//
+// Input: fileNames     - pointer to an array of file names
+//        numberOfNames - number of elements in the fileNames array
+//        maxLen        - maximum length of a single name
+//
+
+    ofstream outputFile;
+    char *filename = NULL;
+    Int_t i;
+
+    for( i = 0; i < numberOfNames; i++ ) {
+        if( !filename ) {
+
+            // create a filename
+            char *tmp1 = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), fileNames[i] );
+            filename = StrDup( tmp1, 16);
+
+            if( tmp1 ) delete [] tmp1;
+            tmp1 = 0;
+
+            char *underlinePtr = strrchr( filename, '_');
+            *underlinePtr = 0;
+
+            strcat( filename, "_Index.html" );
+
+            // open a file
+            outputFile.open( filename, ios::out );
+
+            // check if it's OK
+            if( outputFile.good() ) {
+
+                Printf( formatStr, "", fCounter, filename );
+
+                // write outputFile header
+                WriteHtmlHeader( outputFile, "Index" );
+                outputFile << "<h2>" << "Index" << "</h2><hr>" << endl;
+                outputFile << "<pre>" << endl;
+                outputFile << "<ul>" << endl;
+            }
+            else Error( "MakeIndex", "Can't open file '%s' !", filename );
+            delete [] filename;
+        }
+
+        // get a class
+        TClass *classPtr = GetClass( (const char * ) strrchr( fileNames[i], '_')+1 );
+        if( classPtr ) {
+
+            // write a classname to an index file
+            outputFile << "<li>";
+
+            char *htmlFile = GetHtmlFileName( classPtr );
+
+            if( htmlFile ) {
+                outputFile << "<a name=\"";
+                outputFile << classPtr->GetName();
+                outputFile << "\" href=\"";
+                outputFile << htmlFile;
+                outputFile << "\">";
+                outputFile << classPtr->GetName();
+                outputFile << "</a> ";
+                delete [] htmlFile;
+                htmlFile = 0;
+            }
+            else outputFile << classPtr->GetName();
+
+
+            // write title
+            Int_t len = strlen( classPtr->GetName() );
+            for( Int_t w = 0; w < maxLen-len; w++ )
+                outputFile << ".";
+            outputFile << " ";
+
+            outputFile << "<a name=\"Title:";
+            outputFile << classPtr->GetName();
+            outputFile << "\">";
+            ReplaceSpecialChars( outputFile, classPtr->GetTitle() );
+            outputFile << "</a>" << endl;
+        }
+        else Error( "MakeIndex", "Unknown class '%s' !", strchr( fileNames[i], '_')+1 );
+
+
+        // first base name
+        char *first  = strrchr( fileNames[i], '_');
+        if( first ) *first = 0;
+
+        // second base name
+        char *second = NULL;
+        if( i < ( numberOfNames - 1 )) {
+            second = strrchr( fileNames[i+1], '_');
+            if( second ) *second = 0;
+        }
+
+        // check and close the file if necessary
+        if( !first || !second || strcmp( fileNames[i], fileNames[i+1] )) {
+
+            if( outputFile.good() ) {
+
+                outputFile << "</ul>" << endl;
+                outputFile << "</pre>" << endl;
+
+                // write outputFile footer
+                TDatime date;
+                WriteHtmlFooter( outputFile, "", date.AsString() );
+
+                // close file
+                outputFile.close();
+
+                filename = NULL;
+            }
+            else Error( "MakeIndex", "Corrupted file '%s' !", filename );
+        }
+
+        if( first )  *first  = '_';
+        if( second ) *second = '_';
+    }
+
+    // free memory
+    for( i = 0; i < numberOfNames; i++ )
+        if( *fileNames[i] ) delete [] fileNames[i];
+}
+
+
+//______________________________________________________________________________
+void MHtml::CreateListOfTypes()
+{
+// Create list of all data types
+
+    Int_t maxLen = 0;
+    Int_t len;
+
+    // open file
+    ofstream typesList;
+
+    char *outFile = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), "ListOfTypes.html" );
+    typesList.open( outFile, ios::out );
+
+
+    if( typesList.good() ) {
+        Printf( formatStr, "", "", outFile );
+
+        // write typesList header
+        WriteHtmlHeader( typesList, "List of data types" );
+        typesList << "<h2> List of data types </h2><hr>" << endl;
+
+        typesList << "<dl><dd>" << endl;
+        typesList << "<pre>" << endl;
+
+        // make loop on data types
+        TDataType *type;
+        TIter nextType( gROOT->GetListOfTypes() );
+
+        while (( type = ( TDataType * ) nextType() )) {
+            if( *type->GetTitle() && !strchr( type->GetName(), '(' ) ) {
+                if( type->GetName() ) len = strlen( type->GetName() );
+                else len = 0;
+                maxLen = maxLen > len ? maxLen : len;
+            }
+        }
+        nextType.Reset();
+
+        maxLen += kSpaceNum;
+
+        while (( type = ( TDataType * ) nextType() )) {
+            if( *type->GetTitle() && !strchr( type->GetName(), '(' ) ) {
+                typesList << "<b><a name=\"";
+                typesList << type->GetName();
+                typesList << "\">" << type->GetName();
+                typesList << "</a></b>";
+
+                if( type->GetName() ) len = strlen( type->GetName() );
+                else len = 0;
+                typesList << " ";
+                for( Int_t j = 0; j < ( maxLen-len ); j++ )
+                    typesList << ".";
+                typesList << " ";
+
+                typesList << "<a name=\"Title:";
+                typesList << type->GetTitle();
+                typesList << "\">";
+                char *tempstr = StrDup( type->GetTitle() );
+                ReplaceSpecialChars( typesList, tempstr );
+                typesList << "</a>" << endl;
+
+                if( tempstr ) delete [] tempstr;
+            }
+        }
+
+        typesList << "</pre>" << endl;
+        typesList << "</dl>" << endl;
+
+        // write typesList footer
+        TDatime date;
+        WriteHtmlFooter( typesList, "", date.AsString() );
+
+        // close file
+        typesList.close();
+
+    }
+    else Error( "Make", "Can't open file '%s' !", outFile );
+
+    if (outFile) delete [] outFile;
+}
+
+
+//______________________________________________________________________________
+void MHtml::DerivedClasses( ofstream &out, TClass *classPtr )
+{
+// It creates a list of derived classes
+//
+//
+// Input: out      - output file stream
+//        classPtr - pointer to the class
+//
+
+    Bool_t first = kTRUE;
+    Bool_t found = kFALSE;
+
+
+    // get total number of classes
+    Int_t numberOfClasses = gClassTable->Classes();
+
+    // start from begining
+    gClassTable->Init();
+
+    // get class names
+    TClass *derivedClassPtr;
+    const char *derivedClassName;
+    for( Int_t i = 0; i < numberOfClasses; i++ ) {
+
+        // get class name
+        derivedClassName = gClassTable->Next();
+
+        // get class pointer
+        derivedClassPtr = GetClass( derivedClassName );
+
+        if ( !derivedClassPtr ) {
+           Warning("DerivedClasses","Can not find a definition for class <%s>",derivedClassName);
+           continue;
+        }
+        // make a loop on base classes
+        TBaseClass *inheritFrom;
+        TIter nextBase( derivedClassPtr->GetListOfBases() );
+
+        while (( inheritFrom = ( TBaseClass * ) nextBase() )) {
+            if( !strcmp( inheritFrom->GetName(), classPtr->GetName() )) {
+                if( first ) {
+                    out << "<br><hr>" << endl;
+                    out << "<!--SEE ALSO-->";
+                    out << "<h2>See also</h2><dl><dd>" << endl;
+                }
+                if( !first ) out << ", ";
+
+                char *htmlFile = GetHtmlFileName( derivedClassPtr );
+
+                if( htmlFile ) {
+                    out << "<a href=\"";
+                    out << htmlFile;
+                    out << "\">";
+                    out << derivedClassPtr->GetName() << "</a>";
+                    delete [] htmlFile;
+                    htmlFile = 0;
+                }
+                else out << derivedClassPtr->GetName();
+
+                if( first ) {
+                    first = kFALSE;
+                    found = kTRUE;
+                }
+            }
+        }
+    }
+    if( found ) out << "</dl>" << endl;
+}
+
+
+//______________________________________________________________________________
+void MHtml::ExpandKeywords( ofstream &out, char *text, TClass *ptr2class,
+                            Bool_t &flag, const char *dir )
+{
+// Find keywords in text & create URLs
+//
+//
+// Input: out       - output file stream
+//        text      - pointer to the array of the characters to process
+//        ptr2class - pointer to the class
+//        flag      - this is a 'html_begin/html_end' flag
+//        dir       - usually "" or "../", depends of current file
+//                    directory position
+//
+
+    char *keyword = text;
+    char *end;
+    char *funcName;
+    char *funcNameEnd;
+    char *funcSig;
+    char *funcSigEnd;
+    char c, c2, c3;
+    char *tempEndPtr;
+    c2 = c3 = 0;
+
+    Bool_t hide;
+    Bool_t mmf = 0;
+
+    do {
+        tempEndPtr = end = funcName = funcNameEnd = funcSig = funcSigEnd = NULL;
+
+        hide = kFALSE;
+
+        // skip until start of the word
+        while( !IsWord( *keyword ) && *keyword ) {
+            if( !flag ) ReplaceSpecialChars( out, *keyword );
+            else out << *keyword;
+            keyword++;
+        }
+
+        // get end of the word
+        end = keyword;
+        while( IsName( *end ) && *end ) end++;
+
+        // put '\0' at the end of the keyword
+        c = *end;
+        *end = 0;
+
+        if( strlen( keyword ) > 50 ) {
+            out << keyword;
+            *end = c;
+            keyword = end;
+            continue;
+        }
+
+        // check if this is a HTML block
+        if( flag ) {
+            if( !strcasecmp( keyword, "end_html" ) && *( keyword-1 ) != '\"') {
+                flag = kFALSE;
+                hide = kTRUE;
+            }
+        }
+        else {
+            if( !strcasecmp( keyword, "begin_html" ) && *( keyword-1 ) != '\"') {
+                flag = kTRUE;
+                hide  = kTRUE;
+            }
+            else {
+                *end = c;
+                tempEndPtr = end;
+
+                // skip leading spaces
+                while( *tempEndPtr && isspace( *tempEndPtr ) ) tempEndPtr++;
+
+
+                // check if we have a something like a 'name[arg].name'
+                Int_t count = 0;
+                if( *tempEndPtr == '[') {
+                    count++;
+                    tempEndPtr++;
+                }
+
+                // wait until the last ']'
+                while( count && *tempEndPtr ) {
+                    switch( *tempEndPtr ) {
+                        case '[': count++;
+                                  break;
+                        case ']': count--;
+                                  break;
+                    }
+                    tempEndPtr++;
+                }
+
+                if( !strncmp( tempEndPtr, "::", 2 ) || !strncmp( tempEndPtr, "->", 2 ) || ( *tempEndPtr == '.') ) {
+                    funcName = tempEndPtr;
+
+                    // skip leading spaces
+                    while( isspace( *funcName )) funcName++;
+
+                    // check if we have a '.' or '->'
+                    if( *tempEndPtr == '.') funcName++;
+                    else funcName += 2;
+
+                    if( !strncmp( tempEndPtr, "::", 2 )) mmf = kTRUE;
+                    else mmf = kFALSE;
+
+                    // skip leading spaces
+                    while( *funcName && isspace( *funcName )) funcName++;
+
+                    // get the end of the word
+                    if( !IsWord( *funcName )) funcName = NULL;
+
+                    if( funcName ) {
+                        funcNameEnd = funcName;
+
+                        // find the end of the function name part
+                        while( IsName( *funcNameEnd ) && *funcNameEnd )
+                            funcNameEnd++;
+                        c2 = *funcNameEnd;
+                        if( !mmf ) {
+
+                            // try to find a signature
+                            funcSig = funcNameEnd;
+
+                            // skip leading spaces
+                            while( *funcSig && isspace( *funcSig )) funcSig++;
+                            if( *funcSig != '(') funcSig = NULL;
+                            else funcSig++;
+                            funcSigEnd = funcSig;
+
+                            // if signature exist, try to find the ending character
+                            if( funcSigEnd ) {
+                                Int_t count = 1;
+                                while( *funcSigEnd ) {
+                                    if( *funcSigEnd == '(') count++;
+                                    if( *funcSigEnd == ')')
+                                        if( !--count ) break;
+                                    funcSigEnd++;
+                                }
+                                c3 = *funcSigEnd;
+                                *funcSigEnd = 0;
+                            }
+                        }
+                        *funcNameEnd = 0;
+                    }
+                }
+                *end = 0;
+            }
+        }
+
+        if( !flag && !hide && *keyword ) {
+
+            // get class
+            TClass *classPtr = GetClass( (const char * ) keyword );
+
+            if( classPtr ) {
+
+                char *htmlFile = GetHtmlFileName( classPtr );
+
+                if( htmlFile ) {
+                    out << "<a href=\"";
+                    if( *dir && strncmp( htmlFile, "http://", 7 )) out << dir;
+                    out << htmlFile;
+
+                    if( funcName && mmf ) {
+
+                        // make a link to the member function
+                        out << "#" << classPtr->GetName() << ":";
+                        out << funcName;
+                        out << "\">";
+                        out << classPtr->GetName() << "::";
+                        out << funcName;
+                        out << "</a>";
+
+                        *funcNameEnd = c2;
+                        keyword = funcNameEnd;
+                    }
+                    else {
+                        // make a link to the class
+                        out << "\">";
+                        out << classPtr->GetName();
+                        out << "</a>";
+
+                        keyword = end;
+                    }
+                    delete [] htmlFile;
+                    htmlFile = 0;
+
+                }
+                else {
+                    out << keyword;
+                    keyword = end;
+                }
+                *end = c;
+                if( funcName ) *funcNameEnd = c2;
+                if( funcSig )  *funcSigEnd  = c3;
+            }
+            else {
+                // get data type
+                TDataType *type = gROOT->GetType( (const char *) keyword );
+
+                if( type ) {
+
+                    // make a link to the data type
+                    out << "<a href=\"";
+                    if( *dir ) out << dir;
+                    out << "ListOfTypes.html#";
+                    out << keyword << "\">";
+                    out << keyword << "</a>";
+
+                    *end = c;
+                    keyword = end;
+                }
+                else {
+                    // look for '('
+                    Bool_t isfunc = ( (*tempEndPtr == '(') || c == '(')? kTRUE: kFALSE;
+                    if( !isfunc ) {
+                        char *bptr = tempEndPtr + 1;
+                        while( *bptr && isspace( *bptr ) ) bptr++;
+                        if( *bptr == '(') isfunc = kTRUE;
+                    }
+
+                    if( isfunc && ptr2class && ( ptr2class->GetMethodAny( keyword )) ) {
+                        out << "<a href=\"#";
+                        out << ptr2class->GetName();
+                        out << ":" << keyword << "\">";
+                        out << keyword << "</a>";
+                        *end = c;
+                        keyword = end;
+                    }
+                    else {
+                        const char *anyname = gROOT->FindObjectClassName( keyword );
+
+                        const char *namePtr = NULL;
+                        TClass *cl  = 0;
+                        TClass *cdl = 0;
+
+                        if( anyname ) {
+                            cl = GetClass( anyname );
+                            namePtr = ( const char * ) anyname;
+                            cdl = cl;
+                        }
+                        else if( ptr2class ) {
+                            cl = ptr2class->GetBaseDataMember( keyword );
+                            if( cl ) {
+                                namePtr = cl->GetName();
+                                TDataMember *member = cl->GetDataMember( keyword );
+                                if( member )
+                                    cdl = GetClass( member->GetTypeName() );
+                            }
+                        }
+
+                        if( cl ) {
+                            char *htmlFile = GetHtmlFileName( cl );
+
+                            if( htmlFile ) {
+                                out << "<a href=\"";
+                                if( *dir  && strncmp( htmlFile, "http://", 7 )) out << dir;
+                                out << htmlFile;
+                                if( cl->GetDataMember( keyword ) ) {
+                                    out << "#" << namePtr << ":";
+                                    out << keyword;
+                                }
+                                out << "\">";
+                                out << keyword;
+                                out << "</a>";
+                                delete [] htmlFile;
+                                htmlFile = 0;
+                            }
+                            else out << keyword;
+
+                            if( funcName ) {
+                                char *ptr = end;
+                                ptr++;
+                                ReplaceSpecialChars( out, c );
+                                while( ptr < funcName )
+                                    ReplaceSpecialChars( out, *ptr++ );
+
+                                TMethod *method = NULL;
+                                if( cdl ) method = cdl->GetMethodAny( funcName );
+                                if( method ) {
+                                    TClass *cm = method->GetClass();
+                                    if( cm ) {
+                                        char *htmlFile2 = GetHtmlFileName( cm );
+                                        if( htmlFile2 ) {
+                                            out << "<a href=\"";
+                                            if( *dir  && strncmp( htmlFile2, "http://", 7 )) out << dir;
+                                            out << htmlFile2;
+                                            out << "#" << cm->GetName() << ":";
+                                            out << funcName;
+                                            out << "\">";
+                                            out << funcName;
+                                            out << "</a>";
+                                            delete [] htmlFile2;
+                                            htmlFile2 = 0;
+                                        }
+                                        else out << funcName;
+
+                                        keyword = funcNameEnd;
+                                    }
+                                    else keyword = funcName;
+                                }
+                                else keyword = funcName;
+
+                                *funcNameEnd = c2;
+                                if( funcSig ) *funcSigEnd = c3;
+                            }
+                            else keyword = end;
+                            *end = c;
+                        }
+                        else {
+                            if( funcName ) *funcNameEnd = c2;
+                            if( funcSig )  *funcSigEnd  = c3;
+                            out << keyword;
+                            *end = c;
+                            keyword = end;
+                        }
+                    }
+                }
+            }
+        }
+        else {
+            if( !hide && *keyword )
+                out << keyword;
+            *end = c;
+            keyword = end;
+        }
+    } while( *keyword );
+}
+
+
+//______________________________________________________________________________
+void MHtml::ExpandPpLine( ofstream &out, char *line )
+{
+// Expand preprocessor statements
+//
+//
+// Input: out  - output file stream
+//        line - pointer to the array of characters,
+//               usually one line from the source file
+//
+//  NOTE: Looks for the #include statements and
+//        creates link to the corresponding file
+//        if such file exists
+//
+
+    const char *ptr;
+    const char *ptrStart;
+    const char *ptrEnd;
+    char *fileName;
+
+    Bool_t linkExist = kFALSE;
+
+    ptrEnd = strstr( line, "include" );
+    if( ptrEnd ) {
+        ptrEnd += 7;
+        if (( ptrStart = strpbrk( ptrEnd, "<\"" ))) {
+            ptrStart++;
+            ptrEnd = strpbrk( ptrStart, ">\"" );
+            if( ptrEnd ) {
+                Int_t len = ptrEnd - ptrStart;
+                fileName = new char [len + 1];
+                strncpy( fileName, ptrStart, len );
+
+                char *tmpstr = gSystem->Which( fSourceDir, fileName, kReadPermission );
+                if( tmpstr ) {
+                    char *realFileName = StrDup( tmpstr );
+
+                    if( realFileName ) {
+                        CopyHtmlFile( realFileName );
+
+                        ptr = line;
+                        while( ptr < ptrStart )
+                            ReplaceSpecialChars( out, *ptr++ );
+                        out << "<a href=\"../" << GetFileName( realFileName ) << "\">";
+                        out << fileName << "</a>";
+                        out << ptrEnd;
+
+                        linkExist = kTRUE;
+                    }
+                    if( realFileName ) delete [] realFileName;
+                    if( fileName )     delete [] fileName;
+                    delete [] tmpstr;
+                }
+            }
+        }
+    }
+
+    if( !linkExist ) ReplaceSpecialChars( out, line );
+}
+
+//______________________________________________________________________________
+const char *MHtml::GetFileName( const char *filename )
+{
+// It discards any directory information inside filename
+//
+//
+//  Input: filename - pointer to the file name
+//
+// Output: pointer to the string containing just a file name
+//         without any other directory information, i.e.
+//         '/usr/root/test.dat' will return 'test.dat'
+//
+
+    return( gSystem->BaseName( gSystem->UnixPathName( filename )) );
+}
+
+//______________________________________________________________________________
+char *MHtml::GetSourceFileName(const char *filename)
+{
+   // Find the source file. If filename contains a path it will be used
+   // together with the possible source prefix. If not found we try
+   // old algorithm, by stripping off the path and trying to find it in the
+   // specified source search path. Returned string must be deleted by the
+   // user. In case filename is not found 0 is returned.
+
+   char *tmp1;
+#ifdef WIN32
+   if (strchr(filename, '/') || strchr(filename, '\\')) {
+#else
+   if (strchr(filename, '/')) {
+#endif
+      char *tmp;
+      if (strlen(fSourcePrefix) > 0)
+         tmp = gSystem->ConcatFileName(fSourcePrefix, filename);
+      else
+         tmp = StrDup(filename);
+      if ((tmp1 = gSystem->Which(fSourceDir, tmp, kReadPermission))) {
+         delete [] tmp;
+         return tmp1;
+      }
+      delete [] tmp;
+   }
+
+   if ((tmp1 = gSystem->Which(fSourceDir, GetFileName(filename), kReadPermission)))
+      return tmp1;
+
+   return 0;
+}
+
+//______________________________________________________________________________
+char *MHtml::GetHtmlFileName( TClass *classPtr )
+{
+// Return real HTML filename
+//
+//
+//  Input: classPtr - pointer to a class
+//
+// Output: pointer to the string containing a full name
+//         of the corresponding HTML file. The string must be deleted by the user.
+//
+
+    char htmlFileName [128];
+
+    char *ret  = 0;
+    Bool_t found = kFALSE;
+
+    if( classPtr ) {
+
+        const char *filename = classPtr->GetImplFileName();
+
+        char varName[80];
+        const char *colon = strchr( filename, ':');
+
+
+        // this should be a prefix
+        strcpy( varName, "Root.Html." );
+
+
+        if( colon )
+            strncat( varName, filename, colon-filename );
+        else strcat( varName, "Root" );
+
+        char *tmp;
+        if( !(tmp = gSystem->Which( fSourceDir, filename, kReadPermission ))) {
+            strcpy( htmlFileName, gEnv->GetValue( varName, "" ));
+            if( !*htmlFileName ) found = kFALSE;
+            else found = kTRUE;
+        }
+        else {
+            strcpy( htmlFileName, "." );
+            found = kTRUE;
+        }
+        delete [] tmp;
+
+        if( found ) {
+            char *tmp1 = gSystem->ConcatFileName( htmlFileName, classPtr->GetName() );
+            ret = StrDup( tmp1, 16 );
+            strcat( ret, ".html" );
+
+            if( tmp1 ) delete [] tmp1;
+            tmp1 = 0;
+        }
+        else ret = 0;
+
+    }
+
+    return ret;
+}
+
+//______________________________________________________________________________
+TClass *MHtml::GetClass(const char *name1, Bool_t load)
+{
+//*-*-*-*-*Return pointer to class with name*-*-*-*-*-*-*-*-*-*-*-*-*
+//*-*      =================================
+   Int_t n = strlen(name1);
+   char *name = new char[n+1];
+   strcpy(name, name1);
+   char *t = name+n-1;
+   while(*t == ' ') {
+      *t = 0;
+      if (t == name) break;
+      t--;
+   }
+   t = name;
+   while(*t == ' ') t++;
+
+   TClass *cl = gROOT->GetClass(t,load);
+   delete [] name;
+   return cl;
+}
+
+
+//______________________________________________________________________________
+Bool_t MHtml::IsModified( TClass *classPtr, const Int_t type )
+{
+// Check if file is modified
+//
+//
+//  Input: classPtr - pointer to the class
+//         type     - file type to compare with
+//                    values: kSource, kInclude, kTree
+//
+// Output: TRUE     - if file is modified since last time
+//         FALSE    - if file is up to date
+//
+
+    Bool_t ret = kTRUE;
+
+    char  sourceFile[1024], filename[1024];
+    char *strPtr, *strPtr2;
+
+    switch( type ) {
+       case kSource:
+          strPtr2 = GetSourceFileName(classPtr->GetImplFileName());
+          if (strPtr2) strcpy( sourceFile, strPtr2 );
+          strPtr = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), "src" );
+          strcpy( filename, strPtr );
+          delete [] strPtr;
+          delete [] strPtr2;
+#ifdef WIN32
+          strcat( filename, "\\" );
+#else
+          strcat( filename, "/" );
+#endif
+          strcat( filename, classPtr->GetName() );
+          strcat( filename, ".cxx.html" );
+          break;
+
+       case kInclude:
+          strPtr2 = GetSourceFileName(classPtr->GetDeclFileName());
+          if (strPtr2) strcpy( sourceFile, strPtr2 );
+          strPtr = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), GetFileName( classPtr->GetDeclFileName() ));
+          strcpy( filename,strPtr );
+          delete [] strPtr;
+          delete [] strPtr2;
+          break;
+
+       case kTree:
+          strPtr2 = GetSourceFileName(classPtr->GetDeclFileName());
+          if (strPtr2) strcpy( sourceFile, strPtr2 );
+          strPtr = gSystem->ConcatFileName( gSystem->ExpandPathName( fOutputDir ), GetFileName( classPtr->GetName() ));
+          strcpy( filename, strPtr);
+          delete [] strPtr;
+          delete [] strPtr2;
+          strcat( filename, "_Tree.ps" );
+          break;
+
+       default:
+          Error( "IsModified", "Unknown file type !" );
+    }
+
+    // Get info about a file
+    Long_t sId, sSize, sFlags, sModtime;
+    Long_t dId, dSize, dFlags, dModtime;
+
+    if( !( gSystem->GetPathInfo( sourceFile, &sId, &sSize, &sFlags, &sModtime )) )
+       if( !( gSystem->GetPathInfo( filename, &dId, &dSize, &dFlags, &dModtime )) )
+          ret = ( sModtime > dModtime ) ? kTRUE : kFALSE;
+
+    return( ret );
+}
+
+
+//______________________________________________________________________________
+Bool_t MHtml::IsName( Int_t c )
+{
+// Check if c is a valid C++ name character
+//
+//
+//  Input: c - a single character
+//
+// Output: TRUE if c is a valid C++ name character
+//         and FALSE if it's not.
+//
+//   NOTE: Valid name characters are [a..zA..Z0..9_],
+//
+
+    Bool_t ret = kFALSE;
+
+    if( isalnum( c ) || c == '_') ret = kTRUE;
+
+    return ret;
+}
+
+
+//______________________________________________________________________________
+Bool_t MHtml::IsWord( Int_t c )
+{
+// Check if c is a valid first character for C++ name
+//
+//
+//  Input: c - a single character
+//
+// Output: TRUE if c is a valid first character for C++ name,
+//         and FALSE if it's not.
+//
+//   NOTE: Valid first characters are [a..zA..Z_]
+//
+
+    Bool_t ret = kFALSE;
+
+    if( isalpha( c ) || c == '_') ret = kTRUE;
+
+    return ret;
+}
+
+
+//______________________________________________________________________________
+void MHtml::MakeAll( Bool_t force )
+{
+// It makes everything
+//
+
+    Int_t i;
+
+    MakeIndex();
+
+    Int_t numberOfClasses    = gClassTable->Classes();
+    const char **className = new const char* [numberOfClasses];
+
+    // start from begining
+    gClassTable->Init();
+
+
+    for( i = 0; i < numberOfClasses; i++ )
+        className[i] = gClassTable->Next();
+
+    for( i = 0; i < numberOfClasses; i++ ) {
+        sprintf( fCounter, "%5d", numberOfClasses - i );
+        MakeClass( (char * ) className[i], force );
+    }
+
+    *fCounter = 0;
+
+    delete [] className;
+}
+
+
+//______________________________________________________________________________
+void MHtml::MakeClass(const char *className, Bool_t force )
+{
+// Make HTML files for a single class
+//
+//
+// Input: className - name of the class to process
+//
+
+    TClass *classPtr = GetClass( className );
+
+    if( classPtr ) {
+        char *htmlFile = GetHtmlFileName( classPtr );
+        if( htmlFile && !strncmp( htmlFile, "http://", 7 )) {
+           delete [] htmlFile;
+           htmlFile = 0;
+        }
+        if( htmlFile ) {
+            Class2Html( classPtr, force );
+            MakeTree( className, force );
+            delete [] htmlFile;
+            htmlFile = 0;
+        }
+        else Printf( formatStr, "-skipped-", fCounter, className );
+    }
+    else Error( "MakeClass", "Unknown class '%s' !", className );
+
+}
+
+
+//______________________________________________________________________________
+void MHtml::MakeIndex()
+{
+   // It makes an index files
+
+   CreateListOfTypes();
+
+   // get total number of classes
+   Int_t numberOfClasses = gClassTable->Classes();
+
+
+   // allocate memory
+   const char **classNames = new const char *[numberOfClasses];
+   char       **fileNames  = new       char *[numberOfClasses];
+
+   // start from begining
+   gClassTable->Init();
+
+   // get class names
+   Int_t len = 0;
+   Int_t maxLen = 0;
+   Int_t numberOfImpFiles = 0;
+
+   for( Int_t i = 0; i < numberOfClasses; i++ ) {
+
+      // get class name
+      classNames[i] = gClassTable->Next();
+      len    = strlen( classNames[i] );
+      maxLen = maxLen > len ? maxLen : len;
+
+      // get class & filename
+      TClass *classPtr = GetClass( (const char * ) classNames[i] );
+      const char *impname = classPtr->GetImplFileName();
+
+      if( impname ) {
+         fileNames[numberOfImpFiles] = StrDup( impname, 64 );
+
+         char *underline = strchr( fileNames[numberOfImpFiles], '_');
+         if( underline )
+            strcpy( underline + 1, classNames[i] );
+         else {
+            // for new ROOT install the impl file name has the form: base/src/TROOT.cxx
+            char *srcdir = strstr(fileNames[numberOfImpFiles], "/src/");
+            if (srcdir) {
+               strcpy(srcdir, "_");
+               for (char *t = fileNames[numberOfImpFiles]; (t[0] = toupper(t[0])); t++) ;
+               strcat(srcdir, classNames[i]);
+            } else {
+               strcpy( fileNames[i], "USER_" );
+               strcat( fileNames[i], classNames[i] );
+            }
+         }
+         numberOfImpFiles++;
+      }
+      else cout << "WARNING class:" << classNames[i] << " has no implementation file name !" << endl;
+   }
+   maxLen += kSpaceNum;
+
+   // quick sort
+   SortNames( classNames, numberOfClasses );
+   SortNames( (const char ** ) fileNames,  numberOfImpFiles );
+
+   // create an index
+   CreateIndex( classNames, numberOfClasses );
+   CreateIndexByTopic( fileNames, numberOfClasses, maxLen );
+
+   // free allocated memory
+   delete [] classNames;
+   delete [] fileNames;
+}
+
+
+//______________________________________________________________________________
+void MHtml::MakeTree(const char *className, Bool_t force )
+{
+// Make an inheritance tree
+//
+//
+// Input: className - name of the class to process
+//
+
+    // create canvas & set fill color
+    TVirtualPad *psCanvas = 0;
+    gROOT->ProcessLineFast("new TCanvas(\"\",\"psCanvas\",0,0,1000,750);");
+    psCanvas = gPad->GetVirtCanvas();
+
+    TClass *classPtr = GetClass( className );
+
+    if( classPtr ) {
+
+        char *htmlFile = GetHtmlFileName( classPtr );
+        if( htmlFile && !strncmp( htmlFile, "http://", 7 )) {
+           delete [] htmlFile;
+           htmlFile = 0;
+        }
+        if( htmlFile ) {
+
+            // make a class tree
+            ClassTree( psCanvas, classPtr, force );
+            delete [] htmlFile;
+            htmlFile = 0;
+        }
+        else Printf( formatStr, "-skipped-", "", className );
+
+    }
+    else Error( "MakeTree", "Unknown class '%s' !", className );
+
+    // close canvas
+    psCanvas->Close();
+    delete psCanvas;
+
+}
+
+
+//______________________________________________________________________________
+void MHtml::ReplaceSpecialChars( ofstream &out, const char c )
+{
+// Replace ampersand, less-than and greater-than character
+//
+//
+// Input: out - output file stream
+//        c   - single character
+//
+
+    if (fEscFlag) {
+      out << c;
+      fEscFlag = kFALSE;
+    }
+    else if (c == fEsc)
+      fEscFlag = kTRUE;
+    else
+    {
+      switch( c ) {
+          case '<':
+              out << "&lt;";
+              break;
+          case '&':
+              out << "&amp;";
+              break;
+          case '>':
+              out << "&gt;";
+              break;
+          default:
+             out << c;
+       }
+    }
+}
+
+
+//______________________________________________________________________________
+void MHtml::ReplaceSpecialChars( ofstream &out, const char *string )
+{
+// Replace ampersand, less-than and greater-than characters
+//
+//
+// Input: out    - output file stream
+//        string - pointer to an array of characters
+//
+
+    if( string ) {
+        char *data  = StrDup( string );
+        if( data ) {
+            char *ptr   = NULL;
+            char *start = data;
+
+            while (( ptr = strpbrk( start, "<&>" ))) {
+               char c = *ptr;
+               *ptr = 0;
+               out << start;
+               ReplaceSpecialChars( out, c );
+               start = ptr+1;
+            }
+            out << start;
+            delete [] data;
+        }
+    }
+}
+
+//______________________________________________________________________________
+void MHtml::SortNames( const char **strings, Int_t num, Bool_t type )
+{
+// Sort strings
+//
+//
+// Input: strings - pointer to an array of strings
+//        type    - sort type
+//                  values : kCaseInsensitive, kCaseSensitive
+//                  default: kCaseInsensitive
+//
+
+    if( type == kCaseSensitive )
+        qsort( strings, num, sizeof( strings ), CaseSensitiveSort );
+    else
+        qsort( strings, num, sizeof( strings ), CaseInsensitiveSort );
+}
+
+
+//______________________________________________________________________________
+char *MHtml::StrDup( const char *s1, Int_t n )
+{
+// Returns a pointer to a new string which is a duplicate
+// of the string to which 's1' points.  The space for the
+// new string is obtained using the 'new' operator. The new
+// string has the length of 'strlen(s1) + n'.
+
+
+   char *str = 0;
+
+   if( s1 ) {
+       if( n < 0 ) n = 0;
+       str = new char[ strlen( s1 ) + n + 1 ];
+       if( str ) strcpy( str, s1 );
+   }
+
+   return( str );
+}
+
+//______________________________________________________________________________
+void MHtml::WriteHtmlHeader( ofstream &out, const char *title )
+{
+// Write HTML header
+//
+//
+// Input: out   - output file stream
+//        title - title for the HTML page
+//
+
+    TDatime date;
+
+    out << "<!DOCTYPE HTML PUBLIC \"-// IETF/DTD HTML 2.0// EN\">" << endl;
+    out << "<html>" << endl;
+    out << "<!--                                             -->" << endl;
+    out << "<!-- Author: ROOT team (rootdev@hpsalo.cern.ch)  -->" << endl;
+    out << "<!--                                             -->" << endl;
+    out << "<!--   Date: "<< date.AsString() << "            -->" << endl;
+    out << "<!--                                             -->" << endl;
+    out << "<head>" << endl;
+    out << "<title>";
+    ReplaceSpecialChars( out, title );
+    out << "</title>" << endl;
+    out << "<link rev=made href=\"mailto:rootdev@root.cern.ch\">" << endl;
+    out << "<meta name=\"rating\" content=\"General\">" << endl;
+    out << "<meta name=\"objecttype\" content=\"Manual\">" << endl;
+    out << "<meta name=\"keywords\" content=\"software development, oo, object oriented, ";
+    out << "unix, x11, windows, c++, html, rene brun, fons rademakers\">" << endl;
+    out << "<meta name=\"description\" content=\"ROOT - An Object Oriented Framework For Large Scale Data Analysis.\">" << endl;
+    out << "</head>" << endl;
+
+    out << "<body BGCOLOR=\"#ffffff\" LINK=\"#0000ff\" VLINK=\"#551a8b\" ALINK=\"#ff0000\" TEXT=\"#000000\">" << endl;
+    out << "<a name=\"TopOfPage\"></a>" << endl;
+}
+
+
+//______________________________________________________________________________
+void MHtml::WriteHtmlFooter( ofstream &out, const char *dir, const char *lastUpdate,
+                             const char *author, const char *copyright )
+{
+// Write HTML footer
+//
+//
+// Input: out        - output file stream
+//        dir        - usually equal to "" or "../", depends of
+//                     current file directory position, i.e. if
+//                     file is in the fOutputDir, then dir will be ""
+//        lastUpdate - last update string
+//        author     - author's name
+//        copyright  - copyright note
+//
+
+    out << endl;
+
+    if( *author || *lastUpdate || *copyright ) out << "<hr><br>" << endl;
+
+    out << "<!--SIGNATURE-->" << endl;
+
+    // get the author( s )
+    if( *author )  {
+
+        out << "<em>Author: ";
+
+        char *auth = StrDup(author);
+
+        char *name = strtok( auth, "," );
+
+        Bool_t firstAuthor = kTRUE;
+
+        do {
+            char *ptr = name;
+            char c;
+
+            // remove leading spaces
+            while( *ptr && isspace( *ptr ) ) ptr++;
+
+            if( !firstAuthor ) out << ", ";
+
+            if( !strncmp( ptr, "Nicolas", 7 ) ) {
+                out << "<a href=http://pcbrun.cern.ch/nicolas/index.html";
+                ptr += 12;
+            } else {
+                out << "<a href="<<GetXwho();
+            }
+            while( *ptr ) {
+                // Valery's specific case
+                if( !strncmp( ptr, "Valery", 6 ) ) {
+                    out << "Valeri";
+                    ptr += 6;
+                }
+                else if( !strncmp( ptr, "Fine", 4 ) ) {
+                    out << "Faine";
+                    ptr += 4;
+                }
+                while( *ptr && !isspace( *ptr ) )
+                    out << *ptr++;
+
+                if( isspace( *ptr ) ) {
+                    while( *ptr && isspace( *ptr ) ) ptr++;
+                    if( isalpha( *ptr) ) out << '+';
+                    else break;
+                }
+                else break;
+            }
+            c = *ptr;
+            *ptr = 0;
+            out << ">" << name << "</a>";
+            *ptr = c;
+            out << ptr;
+
+            firstAuthor = kFALSE;
+
+        } while (( name = strtok( NULL, "," )));
+        out << "</em><br>" << endl;
+        delete [] auth;
+    }
+
+    if( *lastUpdate ) out << "<em>Last update: " << lastUpdate << "</em><br>" << endl;
+    if( *copyright )  out << "<em>Copyright " << copyright << "</em><br>" << endl;
+
+
+    // this is a menu
+    out << "<br>" << endl;
+    out << "<address>" << endl;
+    out << "<hr>" << endl;
+    out << "<center>" << endl;
+
+    // link to the ROOT home page
+    out << "<a href=\"http://root.cern.ch/root/Welcome.html\">ROOT page</a> - ";
+
+    // link to the user home page( if exist )
+    const char *userHomePage = gEnv->GetValue( "Root.Html.HomePage", "" );
+    if( *userHomePage ) {
+        out << "<a href=\"";
+        if( *dir ) {
+            if( strncmp( userHomePage, "http://", 7 ))
+                out << dir;
+        }
+        out << userHomePage;
+        out << "\">Home page</a> - ";
+    }
+
+    // link to the index file
+    out << "<a href=\"";
+    if( *dir ) out << dir;
+    out << "ClassIndex.html\">Class index</a> - ";
+
+    // link to the top of the page
+    out << "<a href=\"#TopOfPage\">Top of the page</a><br>" << endl;
+
+    out << "</center>" << endl;
+
+    out << "<hr>This page has been automatically generated. If you have any comments or suggestions ";
+    out << "about the page layout send a mail to <a href=\"mailto:rootdev@root.cern.ch\">ROOT support</a>, or ";
+    out << "contact <a href=\"mailto:rootdev@root.cern.ch\">the developers</a> with any questions or problems regarding ROOT." << endl;
+    out << "</address>" << endl;
+    out << "</body>" << endl;
+    out << "</html>" << endl;
+}
+
Index: /tags/Mars_V0-4/Mars/mbase/MHtml.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MHtml.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MHtml.h	(revision 9634)
@@ -0,0 +1,95 @@
+// @(#)root/html:$Name: not supported by cvs2svn $:$Id: MHtml.h,v 1.1 2001-04-18 13:34:30 tbretz Exp $
+// Author: Nenad Buncic   18/10/95
+
+/*************************************************************************
+ * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
+ * All rights reserved.                                                  *
+ *                                                                       *
+ * For the licensing terms see $ROOTSYS/LICENSE.                         *
+ * For the list of contributors see $ROOTSYS/README/CREDITS.             *
+ *************************************************************************/
+
+#ifndef ROOT_MHtml
+#define ROOT_MHtml
+
+
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+// THtml                                                                  //
+//                                                                        //
+// Html makes a documentation for all ROOT classes                        //
+// using Hypertext Markup Language 2.0                                    //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TNamed
+#include "TNamed.h"
+#endif
+
+
+class TClass;
+class TVirtualPad;
+
+
+class MHtml : public TObject {
+
+private:
+    TString      fXwho;            // by default http://xwho.cern.ch/WHO/people?
+  const char    *fSourcePrefix;    // prefix to relative source path
+  const char    *fSourceDir;       // source path
+  const char    *fOutputDir;       // output directory
+        char    *fLine;            // current line
+        Int_t    fLen;             // maximum line length
+        char    *fCounter;         // counter string
+        Bool_t   fEscFlag;         // Flag to mark the symbol must be written "as is"
+        char     fEsc;             // The special symbol ("backslash" by default) to mark "the next symbol should not be converted
+
+        void    Class2Html(TClass *classPtr, Bool_t force=kFALSE);
+        void    ClassDescription(ofstream &out, TClass *classPtr, Bool_t &flag);
+        void    ClassTree(TVirtualPad *canvas, TClass *classPtr, Bool_t force=kFALSE);
+        Bool_t  CopyHtmlFile(const char *sourceName, const char *destName="");
+        void    CreateIndex(const char **classNames, Int_t numberOfClasses);
+        void    CreateIndexByTopic(char **filenames, Int_t numberOfNames, Int_t maxLen);
+        void    CreateListOfTypes();
+        void    DerivedClasses(ofstream &out, TClass *classPtr);
+        void    ExpandKeywords(ofstream &out, char *text, TClass *ptr2class, Bool_t &flag, const char *dir="");
+        void    ExpandPpLine(ofstream &out, char *line);
+   TClass      *GetClass(const char *name, Bool_t load=kTRUE);
+  const char   *GetFileName(const char *filename);
+        char   *GetSourceFileName(const char *filename);
+        char   *GetHtmlFileName(TClass *classPtr);
+        Bool_t  IsModified(TClass *classPtr, const Int_t type);
+        Bool_t  IsName(Int_t c);
+        Bool_t  IsWord(Int_t c);
+        void    ReplaceSpecialChars(ofstream &out, const char c);
+        void    ReplaceSpecialChars(ofstream &out, const char *string);
+        void    SortNames(const char **strings, Int_t num, Bool_t type=0);
+        char   *StrDup(const char *s1, Int_t n = 1);
+
+   friend Int_t CaseSensitiveSort(const void *name1, const void *name2);
+   friend Int_t CaseInsensitiveSort(const void *name1, const void *name2);
+
+public:
+                 MHtml();
+       virtual   ~MHtml();
+          void   Convert(const char *filename, const char *title, const char *dirname = "");
+    const char  *GetSourceDir()  { return fSourceDir; }
+    const char  *GetOutputDir()  { return fOutputDir; }
+    const char  *GetXwho() const { return fXwho.Data(); }
+          void   MakeAll(Bool_t force=kFALSE);
+          void   MakeClass(const char *className, Bool_t force=kFALSE);
+          void   MakeIndex();
+          void   MakeTree(const char *className, Bool_t force=kFALSE);
+          void   SetEscape(char esc='\\') { fEsc = esc; }
+          void   SetSourcePrefix(const char *prefix) { fSourcePrefix = prefix; }
+          void   SetSourceDir(const char *dir) { fSourceDir = dir; }
+          void   SetOutputDir(const char *dir) { fOutputDir = dir; }
+          void   SetXwho(const char *xwho) { fXwho = xwho; }
+   virtual void  WriteHtmlHeader(ofstream &out, const char *title);
+   virtual void  WriteHtmlFooter(ofstream &out, const char *dir="", const char *lastUpdate="",
+                                 const char *author="", const char *copyright="");
+
+   ClassDef(MHtml,0)  //Convert class(es) into HTML file(s)
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MInputStreamID.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MInputStreamID.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MInputStreamID.cc	(revision 9634)
@@ -0,0 +1,52 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MInpuStreamID                                                            //
+//                                                                          //
+// This is a ID which is assigned to tasks and to a task list.              //
+// It depends on this ID whether a task is executed by the                  //
+// MTaskList::Process member funtion or not.                                //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MInputStreamID.h"
+
+ClassImp(MInputStreamID);
+
+// --------------------------------------------------------------------------
+//
+// (default) constructor
+//
+MInputStreamID::MInputStreamID(const char *name, const char *title)
+{
+    *fName = name ? name : ClassName();
+    *fTitle = title;
+
+    fStreamId = new char[4];
+    strcpy(fStreamId, "All");
+}
+
Index: /tags/Mars_V0-4/Mars/mbase/MInputStreamID.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MInputStreamID.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MInputStreamID.h	(revision 9634)
@@ -0,0 +1,42 @@
+#ifndef MINPUTSTREAMID_H
+#define MINPUTSTREAMID_H
+
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+// MInpuStreamID                                                     //
+//                                                                   //
+// Assigns an ID to tasks or a task list                             //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+// -----------------------------------------------------------------------
+
+class MInputStreamID : public MParContainer
+{
+private:
+    char *fStreamId;		//! which type of task should be processed?
+
+public:
+    MInputStreamID(const char *name=NULL, const char *title=NULL);
+
+    const char *GetStreamId()
+    {
+	return (const char *)fStreamId;
+    }
+    void SetStreamId(const char *t)
+    {
+        delete fStreamId;
+        fStreamId = new char[strlen(t)+1];
+        strcpy(fStreamId, t);
+    }
+
+    ClassDef(MInputStreamID, 1)	//Assigns an ID to tasks or a task list
+};
+
+// ---------------------------------------------------------------------
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MLog.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MLog.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MLog.cc	(revision 9634)
@@ -0,0 +1,240 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MLog                                                                     //
+//                                                                          //
+// This is what we call the logging-system.                                 //
+//                                                                          //
+// It is derived from the C++ streaming classes and can handle our          //
+// logging. The log output can be redirected to stdout, stderr, any other   //
+// stream or a root window.                                                 //
+//                                                                          //
+// There is a global log-instance which you can use like cout, id is gLog.  //
+// A log-instance of your choice (gLog by default) is destributed to all    //
+// Task which are used in an eventloop, so that you can redirect the output //
+// of one eventloop to where you want..                                     //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MLog.h"
+
+#include <fstream.h>
+#include <TGListBox.h>
+
+#include "MLogManip.h"
+
+ClassImp(MLog);
+
+//
+// This is the definition of the global log facility
+//
+MLog gLog;
+
+// --------------------------------------------------------------------------
+//
+// this strange usage of an unbufferd buffer is a workaround
+// to make it work on Alpha and Linux!
+//
+void MLog::Init()
+{
+    setp(&fBuffer, &fBuffer+1);
+    *this << '\0';
+}
+
+// --------------------------------------------------------------------------
+//
+// default constructor which initializes the streamer and sets the device
+// which is used for the output (i)
+//
+MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fout(NULL), fOutAllocated(kFALSE), fgui(NULL)
+{
+    Init();
+}
+
+// --------------------------------------------------------------------------
+//
+// default constructor which initializes the streamer and sets the given
+// ofstream as the default output device
+//
+MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fout(&out), fOutAllocated(kFALSE), fgui(NULL)
+{
+    Init();
+}
+
+// --------------------------------------------------------------------------
+//
+// default constructor which initializes the streamer and sets the given
+// TGListBox as the default output device
+//
+MLog::MLog(TGListBox &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fout(NULL), fOutAllocated(kFALSE), fgui(&out)
+{
+    Init();
+}
+
+// --------------------------------------------------------------------------
+//
+// default constructor which initializes the streamer and opens a file with
+// the given name. Dependend on the flag the file is set as output device
+// or not.
+//
+MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fgui(NULL)
+{
+    Init();
+
+    AllocateFile(fname);
+    CheckFlag(eFile, flag);
+}
+
+// --------------------------------------------------------------------------
+//
+// copyt constructor
+//
+MLog::MLog(MLog &log)
+{
+    fOutputLevel  = log.fOutputLevel;
+    fDebugLevel   = log.fDebugLevel;
+    fDevice       = log.fDevice;
+}
+
+// --------------------------------------------------------------------------
+//
+// This is the function which writes the stream physically to a device.
+// If you want to add a new device this must be done here.
+//
+void MLog::WriteBuffer()
+{
+    const int len = fPPtr - fBase;
+
+    if (fDevice&eStdout)
+        cout.write(fBase, len);
+
+    if (fDevice&eStderr)
+        cerr.write(fBase, len);
+
+    if (fDevice&eFile && fout)
+        fout->write(fBase, len);
+
+    if (fDevice&eGui && fgui)
+    {
+        char dummy[bsz+1];
+        memcpy(dummy, fBase, bsz);
+        *(dummy+bsz)='\0';
+        fgui->AddEntry(dummy, -1);
+    }
+
+    //
+    // restart writing to the buffer at its first char
+    //
+    fPPtr = fBase;
+}
+
+// --------------------------------------------------------------------------
+//
+// This is called to flush the buffer of the streaming devices
+//
+int MLog::sync()
+{
+    WriteBuffer();
+
+    if (fDevice&eStdout)
+        cout.flush();
+
+    if (fDevice&eStderr)
+        cerr.flush();
+
+    if (fDevice&eFile && fout)
+        fout->flush();
+
+    return 0;
+}
+
+// --------------------------------------------------------------------------
+//
+// This function comes from streambuf and should
+// output the buffer to the device (flush, endl)
+// or handle a buffer overflow (too many chars)
+// If a real overflow happens i contains the next
+// chars which doesn't fit into the buffer anymore.
+// If the buffer is not really filled i is EOF(-1).
+//
+int MLog::overflow(int i) // i=EOF means not a real overflow
+{
+    if (fOutputLevel >= fDebugLevel)
+        return 0;
+
+    *fPPtr++ = (char)i;
+
+    if (fPPtr == fEPtr)
+        WriteBuffer();
+
+    return 0;
+}
+
+// --------------------------------------------------------------------------
+//
+// Create a new instance of an file output stream
+// an set the corresponding flag
+//
+void MLog::AllocateFile(const char *fname)
+{
+    fout = new ofstream(fname);
+    fOutAllocated = kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// if fout was allocated by this instance of MLooging
+// delete it.
+//
+void MLog::DeallocateFile()
+{
+    if (fOutAllocated)
+        delete fout;
+}
+
+// --------------------------------------------------------------------------
+//
+// if necessary delete the old in stance of the file
+// output stream and create a new one
+//
+void MLog::ReallocateFile(const char *fname)
+{
+    DeallocateFile();
+    AllocateFile(fname);
+}
+
+// --------------------------------------------------------------------------
+//
+// This function checks if a device should get enabled or disabled.
+//
+void MLog::CheckFlag(Flags_t chk, int flag)
+{
+    if (flag==-1)
+        return;
+
+    flag ? EnableOutputDevice(chk) : DisableOutputDevice(chk);
+}
Index: /tags/Mars_V0-4/Mars/mbase/MLog.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MLog.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MLog.h	(revision 9634)
@@ -0,0 +1,121 @@
+#ifndef MLOG_H
+#define MLOG_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#include <TObject.h>
+
+#include <stdio.h>     // tmpname
+#include <iostream.h>  // base classes for MLog
+
+#define bsz    160 // two standard lines
+
+class TGListBox;
+
+class MLog : public streambuf, public ostream, public TObject
+{
+public:
+    typedef enum _flags { eStdout = 0x1, eStderr = 0x2, eFile = 0x4, eGui = 0x8 } Flags_t;
+
+private:
+    char        fBuffer;     //!
+    char        fBase[bsz];  //! Buffer to store the data in
+    char       *fPPtr;       //! Pointer to present position in buffer
+    const char *fEPtr;       //! Pointer to end of buffer
+
+    UInt_t fOutputLevel;     //! Present output level of the stream
+    UInt_t fDebugLevel;      //! Present global debug level
+    UInt_t fDevice;          //! Flag to indicate the present streams
+
+    ofstream  *fout;          //! possible file output stream
+    Bool_t     fOutAllocated; //! flag if fout is created by MLogging
+    TGListBox *fgui;          //! Listbox output
+
+    void Init();
+
+    void WriteBuffer();
+    int sync();
+    int overflow(int i); // i=EOF means not a real overflow
+
+    void AllocateFile(const char *f);
+    void DeallocateFile();
+    void ReallocateFile(const char *f);
+    void CheckFlag(Flags_t chk, int flag);
+
+public:
+    MLog(int i=eStdout);
+    MLog(ofstream &out);
+    MLog(TGListBox &out);
+    MLog(const char *fname, int flag=-1);
+
+    MLog(MLog &log);
+
+    ~MLog()
+    {
+        DeallocateFile();
+    }
+
+    void SetDebugLevel(int i)           { fDebugLevel  =  i;  }
+    void SetOutputLevel(int i)          { fOutputLevel =  i;  }
+    void SetOutputDevice(int i)         { fDevice      =  i;  }
+    void EnableOutputDevice(Flags_t f)  { fDevice     |=  f;  }
+    void DisableOutputDevice(Flags_t f) { fDevice     &= ~f;  }
+    void operator=(ofstream &out)       { SetOutputFile(out); }
+    void operator=(TGListBox *out)      { SetOutputGui(out);  }
+
+    void SetOutputGui(TGListBox *out, int flag=-1)
+    {
+        fgui = out;
+        CheckFlag(eGui, flag);
+    }
+
+    void SetOutputFile(ofstream &out, int flag=-1)
+    {
+        //
+        // Set new output file by a given stream. The new output
+        // file is not deleted automatically. If no flag is specified
+        // the state of the file-device stream is unchanged.
+        // if the a flag is specified the state is changed
+        // in correspondance to the flag
+        //
+        DeallocateFile();
+        fout = &out;
+        CheckFlag(eFile, flag);
+    }
+
+    void SetOutputFile(const char *f=tmpnam(NULL), int flag=-1)
+    {
+        //
+        // Set new output file by name. The new output file must
+        // not be deleted by the user. If no flag is specified
+        // the state of the file-device stream is unchanged.
+        // if the a flag is specified the state is changed
+        // in correspondance to the flag
+        //
+        ReallocateFile(f);
+        CheckFlag(eFile, flag);
+    }
+
+    ofstream &GetOutputFile()
+    {
+        //
+        // Get the file output stream from MLogging
+        // if no file output stream is existing yet it will be created.
+        // For the creating a C-Temporary file name is used.
+        // if the stream is created here the user must not delete it
+        //
+        // What a pitty, but it seems, that there is now way to ask
+        // an ofstream for the corresponding file name. Elsewhise
+        // I would implement a GetFileName-function, too.
+        //
+        if (!fout)
+            ReallocateFile(tmpnam(NULL));
+        return *fout;
+    }
+
+    ClassDef(MLog, 0) // This is what we call 'The logging system'
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MLogManip.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MLogManip.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MLogManip.cc	(revision 9634)
@@ -0,0 +1,109 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+// ----------------------------------------------------------------
+//            Definitions of the manipulator functions
+// ----------------------------------------------------------------
+
+ostream& __omanip_debug(ostream& lout, int i)
+{
+    //
+    // get the streambuf of the stream
+    // get the pointer to the parent class by casting
+    // set the output level of the logging stream
+    //
+    // Be careful: This manipulator can only be used in MLogging
+    // streams - in other streams SetOutputLevel is a call
+    // of a non existing function
+    //
+    // Be careful 2: The change is valid for everything which is
+    // in the present buffer. This means it can also affect a
+    // part of the stream which is already in the stream but not flushed
+    // to the output device. A flush occures either if you tell a stream
+    // to flush (flush, endl) or if an buffer overflow occures, the
+    // last behaviour could be changed if someone want to have a dynamic
+    // buffer.
+    //
+    MLog *log=(MLog*)lout.rdbuf();
+//    cout << " -" << i << "- ";
+    log->SetOutputLevel(i);
+    return lout;
+}
+
+ostream& __omanip_device(ostream& lout, int i)
+{
+    //
+    // get the streambuf of the stream
+    // get the pointer to the parent class by casting
+    // set the output device of the logging stream, more than
+    // one output device can be ored together
+    //
+    // Be careful: This manipulator can only be used in MLogging
+    // streams - in other streams SetOutputLevel is a call
+    // of a non existing function
+    //
+    MLog *log=(MLog*)lout.rdbuf();
+    log->SetOutputDevice(i);
+    return lout;
+}
+
+ostream& __omanip_edev(ostream& lout, int i)
+{
+    //
+    // get the streambuf of the stream
+    // get the pointer to the parent class by casting
+    // Enable an output device of the logging stream, it should
+    // be possible to enable more than one output device at the
+    // same time by oring them together
+    //
+    // Be careful: This manipulator can only be used in MLogging
+    // streams - in other streams SetOutputLevel is a call
+    // of a non existing function
+    //
+    MLog *log=(MLog*)lout.rdbuf();
+    log->EnableOutputDevice((MLog::_flags)i);
+    return lout;
+}
+
+ostream& __omanip_ddev(ostream& lout, int i)
+{
+    //
+    // get the streambuf of the stream
+    // get the pointer to the parent class by casting
+    // Disable an output device of the logging stream, it should
+    // be possible to disable more than one output device at the
+    // same time by oring them together
+    //
+    // Be careful: This manipulator can only be used in MLogging
+    // streams - in other streams SetOutputLevel is a call
+    // of a non existing function
+    //
+    MLog *log=(MLog*)lout.rdbuf();
+    log->DisableOutputDevice((MLog::_flags)i);
+    return lout;
+}
+
Index: /tags/Mars_V0-4/Mars/mbase/MLogManip.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MLogManip.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MLogManip.h	(revision 9634)
@@ -0,0 +1,88 @@
+#ifndef MLOGMANIP_H
+#define MLOGMANIP_H
+
+#include <iomanip.h>
+
+// ----------------------------------------------------------------
+//                 Definitions of the manipulators
+// ----------------------------------------------------------------
+
+//
+// define a general simple macro for manipulator definitions (int)
+//
+#ifndef OMANIP
+
+#define MANIPULATOR(name) \
+    extern ostream& __omanip_##name(ostream& lout, int i); \
+    inline omanip<int> ##name(int i)                \
+    {                                               \
+        return omanip<int>(__omanip_##name, i);    \
+    }
+
+#else
+
+#define MANIPULATOR(name) \
+    extern ostream& __omanip_##name(ostream& lout, int i); \
+    inline OMANIP(int) ##name(int i)                \
+    {                                               \
+        return OMANIP(int)(__omanip_##name, i);    \
+    }
+
+#endif
+//
+// definitions
+//
+MANIPULATOR(debug);    // set debug level
+MANIPULATOR(device);   // set ouput devices
+MANIPULATOR(edev);     // enable additional output devices
+MANIPULATOR(ddev);     // disable given output
+//#ifndef __CINT__
+//__DEFINE_IOMANIP_FN1(smanip, int, debug);    // set debug level
+//__DEFINE_IOMANIP_FN1(smanip, int, device);   // set ouput devices
+//__DEFINE_IOMANIP_FN1(smanip, int, edev);     // enable additional output devices
+//__DEFINE_IOMANIP_FN1(smanip, int, ddev);     // disable given output
+//#endif
+
+// ----------------------------------------------------------------
+//                         Debug helper macros
+// ----------------------------------------------------------------
+
+//
+// Output debug information into the stream
+//  - this can only be done by a macro
+//
+#ifndef __CINT__
+#define dbginf      __FILE__ << " l." << __LINE__ << ": "
+#endif
+//
+// flush the old buffer, set a new debug level
+// and output the debug information code
+//
+// Be careful: Only use them with a MLogging stream facility.
+// Remark:     All this is compiled into the code.
+//
+#ifndef __CINT__
+#define DEBUG(lvl)  flush << debug(lvl) << dbginf
+#endif
+
+/*
+class SMANIP(T) {
+    ios& (*fct)(ios&,T) ;
+    T arg ;
+public:
+    SMANIP(T)(ios& (*f)(ios&, T), T a) :
+        fct(f), arg(a) { }
+        friend istream& operator>>(istream& i, const SMANIP(T)& m)
+        {
+            ios* s = &i ;
+            (*m.fct)(*s,m.arg) ; return i ;
+        }
+        friend ostream& operator<<(ostream& o, const SMANIP(T)& m)
+        {
+            ios* s = &o ;
+            (*m.fct)(*s,m.arg) ; return o ;
+        }
+} ;
+*/
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MParContainer.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MParContainer.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MParContainer.cc	(revision 9634)
@@ -0,0 +1,195 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// MParContainer                                                            //
+//                                                                          //
+// The MParContainer class is the base class for all MARS parameter         //
+// containers. At the moment it is almost the same than ROOT's TNamed.      //
+// A TNamed contains the essential elements (name, title)                   //
+// to identify a derived object in lists like our MParList or MTaskList.    //
+// The main difference is that the name and title isn't stored and read     //
+// to and from root files ("//!")                                           //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MParContainer.h"
+
+#include <TClass.h>      // IsA
+#include <TROOT.h>       // TROOT::Identlevel
+#include <TVirtualPad.h> // gPad
+
+#include "MLog.h"
+
+ClassImp(MParContainer);
+
+// --------------------------------------------------------------------------
+//
+//  MParContainer copy ctor
+//
+MParContainer::MParContainer(const MParContainer &named)
+{
+    *fName  = *(named.fName);
+    *fTitle = *(named.fTitle);
+
+    fLog = named.fLog;
+
+    fReadyToSave = named.fReadyToSave;
+}
+
+// --------------------------------------------------------------------------
+//
+//  MParContainer assignment operator.
+//
+MParContainer& MParContainer::operator=(const MParContainer& rhs)
+{
+    if (this == &rhs)
+        return *this;
+
+    TObject::operator=(rhs);
+
+    *fName  = *(rhs.fName);
+    *fTitle = *(rhs.fTitle);
+
+    fLog         = rhs.fLog;
+    fReadyToSave = rhs.fReadyToSave;
+
+    return *this;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Compare two MParContainer objects. Returns 0 when equal, -1 when this is
+//  smaller and +1 when bigger (like strcmp).
+//
+Int_t MParContainer::Compare(TObject *obj)
+{
+    if (this == obj) return 0;
+    return fName->CompareTo(obj->GetName());
+}
+
+// --------------------------------------------------------------------------
+//
+//  Copy this to obj.
+//
+void MParContainer::Copy(TObject &obj)
+{
+    MParContainer &cont = (MParContainer&)obj;
+
+    TObject::Copy(obj);
+
+    *cont.fName  = *fName;
+    *cont.fTitle = *fTitle;
+
+    cont.fLog         = fLog;
+    cont.fReadyToSave = fReadyToSave;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Encode MParContainer into output buffer.
+//
+void MParContainer::FillBuffer(char *&buffer)
+{
+    fName->FillBuffer(buffer);
+    fTitle->FillBuffer(buffer);
+}
+
+// --------------------------------------------------------------------------
+//
+//  List MParContainer name and title.
+//
+void MParContainer::ls(Option_t *)
+{
+    TROOT::IndentLevel();
+    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
+        << Int_t(TestBit(kCanDelete)) << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Print MParContainer name and title.
+//
+void MParContainer::Print(Option_t *)
+{
+    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Change (i.e. set) the name of the MParContainer.
+//  WARNING !!
+//  If the object is a member of a THashTable, THashList container
+//  The HashTable must be Rehashed after SetName
+//  For example the list of objects in the current directory is a THashList
+//
+void MParContainer::SetName(const char *name)
+{
+    *fName = name;
+    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
+}
+
+// --------------------------------------------------------------------------
+//
+//  Change (i.e. set) all the MParContainer parameters (name and title).
+//  See also WARNING in SetName
+//
+void MParContainer::SetObject(const char *name, const char *title)
+{
+    *fName  = name;
+    *fTitle = title;
+    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
+}
+
+// --------------------------------------------------------------------------
+//
+//  Change (i.e. set) the title of the MParContainer.
+//
+void MParContainer::SetTitle(const char *title)
+{
+    *fTitle = title;
+    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
+}
+
+// --------------------------------------------------------------------------
+//
+//  Return size of the MParContainer part of the TObject.
+//
+Int_t MParContainer::Sizeof() const
+{
+    Int_t nbytes = fName->Sizeof() + fTitle->Sizeof();
+    return nbytes;
+}
+
+void MParContainer::AsciiRead(ifstream &fin)
+{
+    *fLog << "To use the the ascii input of " << GetName();
+    *fLog << " you have to overload " << GetName() << "::AsciiRead." << endl;
+}
+
+void MParContainer::AsciiWrite(ofstream &fout) const
+{
+    *fLog << "To use the the ascii output of " << GetName();
+    *fLog << " you have to overload " << GetName() << "::AsciiWrite." << endl;
+}
Index: /tags/Mars_V0-4/Mars/mbase/MParContainer.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MParContainer.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MParContainer.h	(revision 9634)
@@ -0,0 +1,82 @@
+#ifndef MPARCONTAINER_H
+#define MPARCONTAINER_H
+
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// MParContainer                                                        //
+//                                                                      //
+// The basis for all parameter containers                               //
+//                                                                      //
+//////////////////////////////////////////////////////////////////////////
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TObject
+#include <TObject.h>
+#endif
+#ifndef ROOT_TString
+#include <TString.h>
+#endif
+
+class ofstream;
+class ifstream;
+
+class MParContainer : public TObject
+{
+private:
+    void Init(const char *name, const char *title)
+    {
+        fName = new TString;
+        (*fName) = name;
+        fTitle = new TString;
+        (*fTitle) = title;
+    }
+
+protected:
+    MLog    *fLog;         //! The general log facility for this object, initialized with the global object
+
+    TString *fName;        //! parameter container identifier (name)
+    TString *fTitle;       //! parameter container title
+
+    Bool_t   fReadyToSave; //! should be set to true if the contents of the container is changed somehow
+
+public:
+    MParContainer(const char *name="", const char *title="") : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }
+    MParContainer(const TString &name, const TString &title) : fLog(&gLog), fReadyToSave(kFALSE) { Init(name, title); }
+    MParContainer(const MParContainer &named);
+    MParContainer& operator=(const MParContainer& rhs);
+
+    void SetLogStream(MLog *lg) { fLog = lg; }
+
+    virtual ~MParContainer() { 
+      //delete fName; delete fTitle;
+    }
+    virtual Int_t    Compare(TObject *obj);
+    virtual void     Copy(TObject &named);
+    virtual void     FillBuffer(char *&buffer);
+    virtual const char  *GetName() const {return fName->Data();}
+    virtual const char  *GetTitle() const {return fTitle->Data();}
+    virtual ULong_t  Hash() { return fName->Hash(); }
+    virtual Bool_t   IsSortable() const { return kTRUE; }
+    virtual void     SetName(const char *name); // *MENU*
+    virtual void     SetObject(const char *name, const char *title);
+    virtual void     SetTitle(const char *title=""); // *MENU*
+    virtual void     ls(Option_t *option="");
+    virtual void     Print(Option_t *option="");
+    virtual Int_t    Sizeof() const;
+
+    virtual void     Reset() {};
+
+    virtual Bool_t IsReadyToSave() { return fReadyToSave; }
+    virtual void   SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
+
+    virtual void AsciiRead(ifstream &fin);
+    virtual void AsciiWrite(ofstream &fout) const;
+
+    ClassDef(MParContainer, 1)  //The basis for all parameter containers
+};
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mbase/MParList.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MParList.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MParList.cc	(revision 9634)
@@ -0,0 +1,593 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MParList                                                                //
+//                                                                         //
+// This class contains a list of different parameter containers.           //
+//                                                                         //
+// A parameter container is an object which is derived from                //
+// MParContainer.                                                          //
+//                                                                         //
+// Normally a parameter container is used for data exchange between two    //
+// tasks at runtime.                                                       //
+//                                                                         //
+// You can add every parameter container (Named object) to the             //
+// instance and access it from somewhere else via its Name.                //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+#include "MParList.h"
+
+#include <TNamed.h>
+#include <TClass.h>
+#include <TObjArray.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MParList);
+
+// --------------------------------------------------------------------------
+//
+//  default constructor
+//  creates an empty list
+//
+MParList::MParList(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MParList";
+    *fTitle = title ? title : "A list of Parameter Containers";
+
+    //
+    // This sets a flag that the list is the owner, which means
+    // that the destructor of the list deletes all it's objects
+    //
+    fAutodelete.SetOwner();
+}
+
+// --------------------------------------------------------------------------
+//
+//  Copy constructor. It copies all entries of the parameter list, but it
+//  takes care of, that the automatically created entries are only deleted
+//  once. (doesn't copy the list which holds the automatically created
+//  entries)
+//
+MParList::MParList(MParList &ts)
+{
+    fContainer.AddAll(&ts.fContainer);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Set the logging streamer of the parameter list and all contained
+//  parameter containers
+//
+void MParList::SetLogStream(MLog *log)
+{
+    TIter Next(&fContainer);
+
+    MParContainer *cont=NULL;
+
+    //
+    // loop over all tasks for preproccesing
+    //
+    while ( (cont=(MParContainer*)Next()) )
+        cont->SetLogStream(log);
+
+    MParContainer::SetLogStream(log);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Add a single container to the list.
+//
+//  If 'where' is given, the object will be added after this.
+//
+Bool_t MParList::AddToList(MParContainer *cont, MParContainer *where)
+{
+    //
+    //  check if the object (you want to add) exists
+    //
+
+    if (!cont)
+        return kFALSE;
+
+    //
+    // Get Name of new container
+    //
+    const char *name = cont->GetName();
+
+    //
+    // Check if the new container is already existing in the list
+    //
+    const TObject *objn = fContainer.FindObject(name);
+    const TObject *objt = fContainer.FindObject(cont);
+
+    if (objn || objt)
+    {
+        //
+        // If the container is already in the list ignore it.
+        //
+        if (objt || objn==cont)
+        {
+            *fLog << dbginf << "Warning: Container '" << cont->GetName() << ", 0x" << (void*)cont;
+            *fLog << "' already existing in '" << GetName() << "'... ignoring." << endl;
+            return kTRUE;
+        }
+
+        //
+        // Otherwise add it to the list, but print a warning message
+        //
+        *fLog << dbginf << "Warning: Container with the same name '" << cont->GetName();
+        *fLog << "' already existing in '" << GetName() << "'." << endl;
+        *fLog << "You may not be able to get a pointer to container task by name." << endl;
+    }
+
+    //
+    //  check if you want to add the new parameter container somewhere
+    //  special (in that case you specify "where")
+    //
+    if (where)
+    {
+        if (!fContainer.FindObject(where))
+        {
+            *fLog << dbginf << "Error: Cannot find parameter container after which the new one should be added!" << endl;
+            return kFALSE;
+        }
+    }
+
+    *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
+
+    fContainer.Add(cont);
+    *fLog << "Done." << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Add all entries of the TObjArray to the list.
+//
+void MParList::AddToList(TObjArray *list)
+{
+    //
+    //  check if the object (you want to add) exists
+    //
+    if (!list)
+        return;
+
+    TObjArrayIter Next(list);
+
+    MParContainer *cont = NULL;
+    while ((cont=(MParContainer*)Next()))
+    {
+        //
+        // Get Name of new container
+        //
+        const char *name = cont->GetName();
+
+        //
+        // Check if the new container is already existing in the list
+        //
+        const TObject *objn = fContainer.FindObject(name);
+        const TObject *objt = fContainer.FindObject(cont);
+
+        if (objn || objt)
+        {
+            //
+            // If the container is already in the list ignore it.
+            //
+            if (objt || objn==cont)
+            {
+                *fLog << dbginf << "Warning: Container '" << cont->GetName() << ", 0x" << (void*)cont;
+                *fLog << "' already existing in '" << GetName() << "'... ignoring." << endl;
+                continue;
+            }
+
+            //
+            // Otherwise add it to the list, but print a warning message
+            //
+            *fLog << dbginf << "Warning: Container with the same name '" << cont->GetName();
+            *fLog << "' already existing in '" << GetName() << "'." << endl;
+            *fLog << "You may not be able to get a pointer to container task by name." << endl;
+        }
+
+        *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
+
+        fContainer.Add(cont);
+
+        *fLog << "Done." << endl;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+//  Find an object in the list.
+//  'name' is the name of the object you are searching for.
+//
+TObject *MParList::FindObject(const char *name) const
+{
+    return fContainer.FindObject(name);
+}
+
+// --------------------------------------------------------------------------
+//
+//  check if the object is in the list or not
+//
+TObject *MParList::FindObject(TObject *obj) const
+{
+    return fContainer.FindObject(obj);
+}
+
+// --------------------------------------------------------------------------
+//
+//  returns the ClassName without anything which is behind that last ';' in
+//  string.
+//
+TString MParList::GetClassName(const char *classname)
+{
+    TString cname(classname);
+    const char *semicolon = strrchr(cname, ';');
+
+    if (semicolon)
+        cname.Remove(semicolon-cname);
+
+    return cname;
+}
+
+// --------------------------------------------------------------------------
+//
+//  returns the ObjectName. It is created from a class and object name.
+//  If no object name is given the objectname is the same than the
+//  class name. Leading dots are removed from the object name
+//
+TString MParList::GetObjectName(const char *classname, const char *objname)
+{
+    TString cname(classname);
+    const char *semicolon = strrchr(cname, ';');
+
+    TString oname(objname ? objname : classname);
+
+    if (semicolon)
+    {
+        //
+        // Remove leading dots from objectname (eg. "MMcTrig;5.")
+        //
+        Int_t sz = oname.Sizeof()-2;
+
+        while (sz>=0 && oname[sz]=='.')
+            oname.Remove(sz--);
+    }
+    return oname;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Find an object in the list.
+//  'name' is the name of the object you are searching for.
+//  If the object doesn't exist we try to create one from the
+//  dictionary. If this isn't possible NULL is returned.
+//
+//  An object which was created automatically is deleted automatically in
+//  the destructor of the parameter list, too. This means, that if an
+//  object should survive (eg. Histograms) you MUST create it by yourself
+//  and add it to the parameter list.
+//
+//  By default (you don't specify an object name) the object name is
+//  the same as the classname
+//
+//  If the classname (default classname) is of the structure
+//  "Name;something" - containing a semicolon - evarything which is
+//  after the last appearance of a semicolon is stripped to get the
+//  Name of the Class. Normally this is used to number your objects.
+//  "Name;1", "Name;2", ... If a semicolon is detected leading dots
+//  are stripped from the object-name (eg. "name;5.")
+//
+MParContainer *MParList::FindCreateObj(const char *classname, const char *objname)
+{
+    //
+    // If now object name (name of the object to identify it in the
+    // List) is given use it's classname as the objectname
+    //
+
+    //
+    // Check if the classname is a 'numbered' name (like: "MTime;2")
+    // if so strip the number from the classname.
+    //
+    // Becareful: We check for the last occurance of a ';' only and we
+    // also don't check if a number follows or something else.
+    //
+    // Rem: I use a TString to make the code more readyble and to get
+    // the new object deleted automatically
+    //
+    TString cname = GetClassName(classname);
+    TString oname = GetObjectName(classname, objname);
+
+    //
+    // Try to find a object with this object name which is already
+    // in the List. If we can find one we are done.
+    //
+    MParContainer *pcont = (MParContainer*)FindObject(oname);
+
+    if (pcont)
+        return pcont;
+
+    //
+    // if object is not existing in the list try to create one
+    //
+    *fLog << dbginf << "Object '" << oname << "' of type '" << cname << "' not found... creating." << endl;
+
+    //
+    // try to get class from root environment
+    //
+    TClass *cls = gROOT->GetClass(cname);
+
+    if (!cls)
+    {
+        //
+        // if class is not existing in the root environment
+        //
+        *fLog << dbginf << "Class '" << cname << "' not existing in dictionary." << endl;
+        return NULL;
+    }
+
+    //
+    // create the parameter container of the the given class type
+    //
+    pcont = (MParContainer*)cls->New();
+
+    //
+    // Set the name of the container
+    //
+    pcont->SetName(oname);
+
+    //
+    // Now add the object to the parameter list
+    //
+    AddToList(pcont);
+
+    //
+    // The object was automatically created. This makes sure, that such an
+    // object is deleted together with the list
+    //
+    fAutodelete.Add(pcont);
+
+    //
+    //  Find an object in the list.
+    //  'name' is the name of the object you are searching for.
+    //
+    return pcont;
+}
+
+// --------------------------------------------------------------------------
+//
+//   print some information about the current status of MParList
+//
+void MParList::Print(Option_t *t)
+{
+    *fLog << dbginf << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
+    *fLog << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+//   Sets the flags off all containers in the list (and the list
+//   itself) to unchanged
+//
+void MParList::SetReadyToSave(Bool_t flag)
+{
+    TIter Next(&fContainer);
+
+    MParContainer *cont=NULL;
+
+    //
+    // loop over all tasks for preproccesing
+    //
+    while ( (cont=(MParContainer*)Next()) )
+        cont->SetReadyToSave(flag);
+
+    MParContainer::SetReadyToSave(flag);
+}
+
+// --------------------------------------------------------------------------
+//
+//   Reset all containers in the list
+//
+void MParList::Reset()
+{
+    TIter Next(&fContainer);
+
+    MParContainer *cont=NULL;
+
+    //
+    // loop over all tasks for preproccesing
+    //
+    while ((cont=(MParContainer*)Next()))
+        cont->Reset();
+}
+
+// --------------------------------------------------------------------------
+//
+//  This finds numbered objects. The objects are returned in a copy of a
+//  TObjArray.
+//
+//  If from only is given (or to=0) object are assumed numbered
+//  from 1 to from.
+//
+TObjArray MParList::FindObjectList(const char *name, const UInt_t from, const UInt_t to) const
+{
+    TObjArray list;
+
+    if (to>0 && to<=from)
+    {
+        *fLog << dbginf << "Cannot create entries backwards (to<from)...skipped." << endl;
+        return list;
+    }
+
+    const UInt_t len = strlen(name);
+
+    char *auxname = new char[len+7];
+    strcpy(auxname, name);
+
+    //
+    // If only 'from' is specified the number of entries are ment
+    //
+    const Bool_t exc = from>0 && to==0;
+
+    const UInt_t first = exc ?    0 : from;
+    const UInt_t last  = exc ? from : to;
+
+    for (UInt_t num=first; num<last; num++)
+    {
+        if (from!=0 || to!=0)
+            sprintf(auxname+len, ";%d", num+1);
+
+        TObject *obj = FindObject(auxname);
+        if (!obj)
+            continue;
+
+        list.AddLast(obj);
+    }
+    delete auxname;
+
+    return list;
+}
+
+// --------------------------------------------------------------------------
+//
+//  This finds numbered objects. The objects are returned in a copy of a
+//  TObjArray. If one of the objects doesn't exist it is created from the
+//  meaning of cname and oname (s. FindCreateObj)
+//
+//  If from only is given (or to=0) object are assumed numbered
+//  from 1 to from.
+//
+TObjArray MParList::FindCreateObjList(const char *cname, const UInt_t from, const UInt_t to, const char *oname)
+{
+    TObjArray list;
+
+    if (to>0 && to<=from)
+    {
+        *fLog << dbginf << "Cannot create entries backwards (to<from)...skipped." << endl;
+        return list;
+    }
+
+    const UInt_t len = strlen(cname);
+
+    char *auxname = new char[len+7];
+    strcpy(auxname, cname);
+
+    //
+    // If only 'from' is specified the number of entries are ment
+    //
+    const Bool_t exc = from>0 && to==0;
+
+    const UInt_t first = exc ?    0 : from;
+    const UInt_t last  = exc ? from : to;
+
+    for (UInt_t num=first; num<last; num++)
+    {
+        if (from!=0 || to!=0)
+            sprintf(auxname+len, ";%d", num+1);
+
+        TObject *obj = FindCreateObj(auxname, oname);
+        if (!obj)
+            break;
+
+        list.AddLast(obj);
+    }
+    delete auxname;
+
+    return list;
+}
+
+// --------------------------------------------------------------------------
+//
+//  This finds numbered objects. The objects are returned in a copy of a
+//  TObjArray. If one of the objects doesn't exist it is created from the
+//  meaning of cname and oname (s. FindCreateObj)
+//
+//  If from only is given (or to=0) object are assumed numbered
+//  from 1 to from.
+//
+//  Remark: Because it is static the object are only created and not added to
+//  the parameter list. You must also take care of deleting these objects!
+//  This function is mainly made for use in root macros. Don't use it in
+//  compiled programs if you are not 100% sure what you are doing.
+//
+TObjArray MParList::CreateObjList(const char *cname, const UInt_t from, const UInt_t to, const char *oname)
+{
+    TObjArray list;
+
+    //
+    // try to get class from root environment
+    //
+    TClass *cls = gROOT->GetClass(cname);
+
+    if (!cls)
+    {
+        //
+        // if class is not existing in the root environment
+        //
+        gLog << dbginf << "Class '" << cname << "' not existing in dictionary." << endl;
+        return list;
+    }
+
+    const UInt_t len = strlen(cname);
+
+    char *auxname = new char[len+7];
+    strcpy(auxname, cname);
+
+    //
+    // If only 'from' is specified the number of entries are ment
+    //
+    const Bool_t exc = from>0 && to==0;
+
+    const UInt_t first = exc ?    0 : from;
+    const UInt_t last  = exc ? from : to;
+
+    for (UInt_t num=first; num<last; num++)
+    {
+        if (from!=0 || to!=0)
+            sprintf(auxname+len, ";%d", num+1);
+
+        //
+        // create the parameter container of the the given class type
+        //
+        MParContainer *pcont = (MParContainer*)cls->New();
+
+        //
+        // Set the name of the container
+        //
+        pcont->SetName(auxname);
+
+        //
+        // Add new object to the return list
+        //
+        list.AddLast(pcont);
+    }
+    delete auxname;
+
+    return list;
+}
Index: /tags/Mars_V0-4/Mars/mbase/MParList.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MParList.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MParList.h	(revision 9634)
@@ -0,0 +1,64 @@
+#ifndef MPARLIST_H
+#define MPARLIST_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MParList                                                                //
+//                                                                         //
+// List of parameter containers (MParContainer)                            //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TOrdCollection
+#include "TOrdCollection.h"
+#endif
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class MLog;
+
+class MParList : public MParContainer
+{
+private:
+    TOrdCollection fContainer;	// Collection of Parameter and Data Containers
+    TOrdCollection fAutodelete; // All what this list contains is deleted in the destructor
+
+    static TString GetClassName(const char *classname);
+    static TString GetObjectName(const char *classname, const char *objname);
+
+public:
+    MParList(const char *name=NULL, const char *title=NULL);
+    MParList(MParList &ts);
+
+    ~MParList()
+    {
+    }
+
+    Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL);
+    void   AddToList(TObjArray *list);
+
+    void SetLogStream(MLog *log);
+
+    TObject       *FindObject(const char *name) const;
+    TObject       *FindObject(TObject *obj) const;
+    MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
+
+    TObjArray FindObjectList(const char *name, const UInt_t from, const UInt_t to=0) const;
+    TObjArray FindCreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL);
+
+    static TObjArray CreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL);
+
+    void Reset();
+    void SetReadyToSave(Bool_t flag=kTRUE);
+
+    void Print(Option_t *t = NULL);
+
+    ClassDef(MParList, 0) // list of parameter containers (MParContainer)
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MReadTree.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MReadTree.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MReadTree.cc	(revision 9634)
@@ -0,0 +1,407 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MReadTree                                                               //
+//                                                                         //
+// This tasks opens all branches in a specified tree and creates the       //
+// corresponding parameter containers if not already existing in the       //
+// parameter list.                                                         //
+//                                                                         //
+// The Process function reads one events from the tree. To go through the  //
+// events of one tree make sure that the event number is increased from    //
+// outside. It makes also possible to go back by decreasing the number.    //
+//                                                                         //
+// If you don't want to start reading the first event you have to call     //
+// MReadTree::SetEventNum after instantiating your MReadTree-object.       //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MReadTree.h"
+
+#include <fstream.h>
+
+#include <TFile.h>
+#include <TChain.h>
+#include <TArrayC.h>
+#include <TObjArray.h>
+#include <TChainElement.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MTime.h"
+#include "MParList.h"
+
+ClassImp(MReadTree);
+
+// --------------------------------------------------------------------------
+//
+//  Default constructor. It creates an TChain instance which represents the
+//  the Tree you want to read and adds the given file (if you gave one).
+//  More files can be added using MReadTree::AddFile.
+//  Also an empty veto list is created. This list is used if you want to
+//  veto (disable or "don't enable") a branch in the tree.
+//
+MReadTree::MReadTree(const char *tname, const char *fname,
+                     const char *name, const char *title) : fNumEntry(0)
+{
+    *fName  = name  ? name  : "MReadTree";
+    *fTitle = title ? title : "Task to loop over all events in one single tree";
+
+    fVetoList = new TArrayC;
+    //
+    // open the input stream
+    //
+    fChain = new TChain(tname);
+
+    if (fname)
+        fChain->Add(fname);
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor. It deletes the TChain and veto list object
+//
+MReadTree::~MReadTree()
+{
+    //
+    // Delete all the pointers to pointers to the objects where the
+    // branche data gets stored.
+    //
+    TIter Next(fChain->GetStatus());
+
+    TChainElement *element = NULL;
+    while ((element=(TChainElement*)Next()))
+        delete (MParContainer**)element->GetBaddress();
+
+    //
+    // Delete the chain and the veto list
+    //
+    delete fChain;
+    delete fVetoList;
+}
+
+// --------------------------------------------------------------------------
+//
+//  If you want to read the given tree over several files you must add
+//  the files here before PreProcess is called. Be careful: If the tree
+//  doesn't have the same contents (branches) it may confuse your
+//  program (trees which are are not existing in later files are not read
+//  anymore, tree wich are not existing in the first file are never read)
+//
+/*Int_t*/ void MReadTree::AddFile(const char *fname)
+{
+    //
+    // FIXME! A check is missing whether the file already exists or not.
+    //
+    //
+    // returns the number of file which were added
+    //
+    /*return  root >3.0*/ fChain->Add(fname);
+}
+
+// --------------------------------------------------------------------------
+//
+//  The PreProcess loops (till now) over the branches in the given tree.
+//  It checks if the corresponding containers (containers with the same
+//  name than the branch name) are existing in the Parameter Container List.
+//  If not, a container of objec type 'branch-name' is created (everything
+//  after the last semicolon in the branch name is stripped). Only
+//  branches which don't have a veto (see VetoBranch) are enabled If the
+//  object isn't found in the root dictionary (a list of classes known by the
+//  root environment) the branch is skipped and an error message is printed
+//  out.
+//
+Bool_t MReadTree::PreProcess (MParList *pList)
+{
+    //
+    // get number of events in this tree
+    //
+    fNumEntries = (UInt_t)fChain->GetEntries();
+
+    if (!fNumEntries)
+    {
+        *fLog << dbginf << "No Entries found in chain (file/s)." << endl;
+        return kFALSE;
+    }
+
+    //
+    // output logging information
+    //
+    *fLog << fNumEntries << " Entries found in file(s)." << endl;
+
+    //
+    // Get all branches of this tree and
+    // create the Iterator to loop over all branches
+    //
+    TIter Next(fChain->GetListOfBranches());
+    TBranch *branch=NULL;
+    
+    //
+    // loop over all tasks for processing
+    //
+    while ( (branch=(TBranch*)Next()) )
+    {
+        //
+        // Get Name of Branch
+        //
+        const char *name  = branch->GetName();
+
+        //
+        // Check if enabeling the branch is allowed
+        //
+        if (HasVeto(name))
+            continue;
+
+        //
+        // Create a pointer to the pointer to the object in which the
+        // branch data is stored. The pointers are stored in the TChain
+        // object and we get the pointers from there to delete it.
+        //
+        MParContainer **pcont = new MParContainer*;
+
+        //
+        // check if object is existing in the list
+        //
+        *pcont=pList->FindCreateObj(name);
+
+        if (!*pcont)
+        {
+            //
+            // if class is not existing in the (root) environment
+            // we cannot proceed reading this branch
+            //
+            *fLog << dbginf << "Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl;
+            continue;
+        }
+
+        //
+        // here pcont is a pointer the to container in which the data from
+        // the actual branch should be stored - enable branch.
+        //
+        fChain->SetBranchAddress(name, pcont);
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  The Process-function reads one event from the tree (this contains all
+//  enabled branches) and increases the position in the file by one event.
+//  (Remark: The position can also be set by some member functions
+//  If the end of the file is reached the Eventloop is stopped.
+//
+Bool_t MReadTree::Process()
+{
+    //
+    // check for end of file
+    //
+    if (fNumEntry>=fNumEntries)
+        return kFALSE;
+
+    //
+    // get entry
+    //
+    fChain->GetEntry(fNumEntry);
+    cout << " " << fChain->LoadTree(fNumEntry) << " "<<flush;
+
+    fNumEntry++;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Get the Event with the current EventNumber fNumEntry
+//
+Bool_t MReadTree::GetEvent() 
+{
+    fChain->GetEntry(fNumEntry);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Decrease the number of the event which is read by Process() next
+// by one or more
+//
+Bool_t MReadTree::DecEventNum(UInt_t dec)
+{
+    //!
+    //! this function makes Process() read the event one (or more) before
+    //! the actual position (event) in the tree
+    //!
+    if (fNumEntry < dec/*+1*/)
+    {
+        *fLog << "MReadTree::SetPrevEvent: WARNING: " << fNumEntry/*-1*/ << "-" << dec << " out of Range." << endl;
+        return kFALSE;
+    }
+
+    fNumEntry -= dec/*+1*/;
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Increase the number of the event which is read by Process() next
+// by one or more
+//
+Bool_t MReadTree::IncEventNum(UInt_t inc)
+{
+    //!
+    //! this function makes Process() read the next (or more) after
+    //! the actual position (event) in the tree
+    //! (Be careful: IncEventNum() or IncEventNum(1) does not chenge anything
+    //!  in the standard behaviour of the task)
+    //!
+    if (fNumEntry+inc/*-1*/ >= fNumEntries)
+    {
+        *fLog << "MReadTree::SkipEvents: WARNING: " << fNumEntry/*-1*/ << "+" << inc << " out of Range." << endl;
+        return kFALSE;
+    }
+
+    fNumEntry += inc/*-1*/;
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// this function makes Process() read event number nr next
+//
+// Remark: You can use this function after instatiating you MReadTree-object
+//         to set the event number from which you want to start reading.
+//
+Bool_t MReadTree::SetEventNum(UInt_t nr)
+{
+    if (nr>=fNumEntries)
+    {
+        *fLog << "MReadTree::SetEventNum: WARNING: " << nr << " out of Range." << endl;
+        return kFALSE;
+    }
+
+    fNumEntry = nr;
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// This function checks if the Branch Name is part of the Veto List.
+// This means, that the preprocess doesn't enable the branch.
+//
+Bool_t MReadTree::HasVeto(const char *name) const
+{
+    const size_t nlen = strlen(name)+1;
+
+    char  *pos = fVetoList->GetArray();
+    size_t len = fVetoList->GetSize();
+
+    //
+    // now we compare the 'strings' in the list word by word
+    // (string or word in this context means a zero terminated
+    // array of chars
+    //
+
+    for (;;)
+    {
+        //
+        // Search for the first byte of the name
+        //
+        char *c = (char*)memchr(pos, name[0], len);
+
+        //
+        // if we don't find the first byte, the list cannot contain 'name'
+        //
+        if (!c)
+            return kFALSE;
+
+        //
+        // calculate and check how many bytes remains in the list
+        //
+        len -= c-pos;
+
+        //
+        // if there are not enough bytes to match the query we are done
+        //
+        if (len<nlen)
+            return kFALSE;
+
+        //
+        // check if the next 'nlen' byte (including the trailing '\0'
+        // are matching
+        //
+        if (!memcmp(c, name, nlen))
+            return kTRUE;
+
+        //
+        // we didn't find the string, goto the next 'string'
+        //
+        pos = (char*)memchr(c, '\0', len);
+
+        //
+        // check if there is a 'next' string really
+        //
+        if (!pos)
+            return kFALSE;
+
+        //
+        // calculate the remaining length
+        //
+        len -= pos-c;
+
+        //
+        // if there are not enough bytes to match the query we are done
+        //
+        if (len<nlen)
+            return kFALSE;
+    }
+}
+
+
+// --------------------------------------------------------------------------
+//
+// If you don't want that a branch is enabled within the PreProcess you
+// can set a veto for enabeling the branch. (This means also the
+// corresponding object won't be created automatically)
+//
+// This functionality is for experienced users which don't want to
+// read in branches which are not processed in the program (for
+// speed reasons)
+//
+void MReadTree::VetoBranch(const char *name)
+{
+    //
+    // Add this file as the last entry of the list
+    // (including the trailing '\0')
+    //
+    const int sz  = fVetoList->GetSize();
+    const int tsz = strlen(name)+1;
+
+    fVetoList->Set(sz+tsz);
+
+    memcpy(fVetoList->GetArray()+sz, name, tsz);
+}
Index: /tags/Mars_V0-4/Mars/mbase/MReadTree.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MReadTree.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MReadTree.h	(revision 9634)
@@ -0,0 +1,47 @@
+#ifndef MREADTREE_H
+#define MREADTREE_H
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class TFile;
+class TChain;
+class TArrayC;
+
+class MReadTree : public MTask
+{
+private:
+    TFile   *fFile;       // Pointer to file
+    TChain  *fChain;      // Pointer to tree
+
+    TArrayC *fVetoList;   // List of Branches which are not allowed to get enabled
+
+    UInt_t   fNumEntry;   // Number of actual entry
+    UInt_t   fNumEntries; // Number of Events in Tree
+
+    Bool_t HasVeto(const char *name) const;
+
+public:
+    MReadTree(const char *treename, const char *filename=NULL, const char *name=NULL, const char *title=NULL);
+    ~MReadTree();
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    void AddFile(const char *fname);
+    void VetoBranch(const char *name);
+
+    Bool_t GetEvent();
+
+    Bool_t DecEventNum(UInt_t dec=1); // decrease number of event (position in tree)
+    Bool_t IncEventNum(UInt_t inc=1); // increase number of event (position in tree)
+    Bool_t SetEventNum(UInt_t nr);    // set number of event (position in tree)
+
+    UInt_t GetEventNum() const { return fNumEntry;   }
+    UInt_t GetEntries() const  { return fNumEntries; }
+
+    ClassDef(MReadTree, 0)	// Reads one tree
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MTask.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MTask.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MTask.cc	(revision 9634)
@@ -0,0 +1,101 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//   MTask                                                                 //
+//                                                                         //
+//   Base class for all tasks which can perfomed in a tasklist             //
+//   For each event processed in the eventloop all the different           //
+//   tasks in the tasklist will be processed.                              //
+//                                                                         //
+//   So all tasks must inherit from this baseclass.                        //
+//                                                                         //
+//   The inheritance from MInputStreamID is used to indicate the           //
+//   type of event that this task is for. If it is "All" it is executed    //
+//   independantly of the actual ID of the task list.                      //
+//                                                                         //
+//   Inside this abstract class, there are three fundamental function:     //
+//                                                                         //
+//   - PreProcess():   executed before the eventloop starts. Here you      //
+//                     can initiate different things, open files, etc.     //
+//                     As an argument this function gets a pointer to the  //
+//                     parameter list. You can stop the execution by       //
+//                     kFALSE instread of kTRUE.                           //
+//                                                                         //
+//   - Process():      executed for each event in the eventloop. Do in     //
+//                     one task after the other (as the occur in the       //
+//                     tasklist) the action of one task. Only the tasks    //
+//                     with a Stream ID which matches the actual ID of the //
+//                     task list are executed. A task can return kFALSE    //
+//                     to stop the execuition of the pending taks in a     //
+//                     list or kCONTINUE to skip the pending tasks.        //
+//                                                                         //
+//   - PostProcess():  executed after the eventloop. Here you can close    //
+//                     output files, start display of the run parameter,   //
+//                     etc.                                                //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MTask.h"
+
+ClassImp(MTask);
+
+// --------------------------------------------------------------------------
+//
+// This is processed before the eventloop starts
+//
+// It is the job of the PreProcess to connect the tasks
+// with the right container in the parameter list.
+//
+// the virtual implementation returns kTRUE
+//
+Bool_t MTask::PreProcess( MParList *pList )
+{
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// This is processed for every event in the eventloop
+//
+// the virtual implementation returns kTRUE
+//
+Bool_t MTask::Process()
+{
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// This is processed after the eventloop starts
+//
+// the virtual implementation returns kTRUE
+//
+Bool_t MTask::PostProcess()
+{
+    return kTRUE;
+}
+
+
Index: /tags/Mars_V0-4/Mars/mbase/MTask.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MTask.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MTask.h	(revision 9634)
@@ -0,0 +1,45 @@
+#ifndef MTASK_H
+#define MTASK_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MTask                                                                   //
+//                                                                         //
+// Abstract base class for a task                                          //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MINPUTSTREAMID_H
+#include "MInputStreamID.h"
+#endif
+
+class MFilter;
+class MParList;
+
+class MTask : public MInputStreamID
+{
+private:
+    const MFilter *fFilter;
+
+    Bool_t fIsPreprocessed; // Indicates the success of the PreProcessing (set by MTaskList)
+
+public:
+    MTask() : fFilter(NULL), fIsPreprocessed(kFALSE) {}
+    ~MTask()
+    {
+    }
+
+    const MFilter *GetFilter() const { return fFilter; }
+    void SetFilter(const MFilter *filter) { fFilter=filter; }
+
+    Bool_t IsPreprocessed() const { return fIsPreprocessed; }
+    void SetIsPreprocessed(Bool_t state=kTRUE) { fIsPreprocessed = state; }
+
+    virtual Bool_t PreProcess(MParList *pList);
+    virtual Bool_t Process();
+    virtual Bool_t PostProcess();
+
+    ClassDef(MTask, 0)		//Abstract base class for a task
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MTaskList.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MTaskList.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MTaskList.cc	(revision 9634)
@@ -0,0 +1,334 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MTaskList                                                               //
+//                                                                         //
+// Collection of tasks.                                                    //
+//                                                                         //
+// A tasklist is necessary to run the eventloop. It contains the scheduled //
+// tasks, which should be executed in your program.                        //
+//                                                                         //
+// To add a task use AddToList.                                            //
+//                                                                         //
+// The tasklist itself is a task, too. You can add a tasklist to another   //
+// tasklist. This makes sense, if you want to filter the execution of      //
+// more than one task of your tasklist using the same filter.              //
+//                                                                         //
+// The tasks in the list are idetified by their names. If more than one    //
+// task has the same name, the tasklist will still work correctly, but     //
+// you might run into trouble trying to get a pointer to a task by name    //
+// from the list.                                                          //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MTaskList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MFilter.h"
+#include "MParList.h"
+#include "MInputStreamID.h"
+
+ClassImp(MTaskList);
+
+// --------------------------------------------------------------------------
+//
+// the name for the task list must be the same for all task lists
+// because the task list (at the moment) is identified by exactly
+// this name in the parameter list (by MEvtLoop::SetParList)
+//
+MTaskList::MTaskList(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MTaskList";
+    *fTitle = title ? title : "A list for tasks to be executed";
+}
+
+// --------------------------------------------------------------------------
+//
+//   CopyConstructor
+//   creates a new TaskList and put the contents of an existing
+//   TaskList in the new TaskList.
+//
+MTaskList::MTaskList(MTaskList &ts)
+{
+    fTasks.AddAll(&ts.fTasks);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Set the logging stream for the all tasks in the list and the tasklist
+//  itself.
+//
+void MTaskList::SetLogStream(MLog *log)
+{
+    //
+    // create the Iterator over the tasklist
+    //
+    TIter Next(&fTasks);
+
+    MTask *task=NULL;
+
+    //
+    // loop over all tasks for preproccesing
+    //
+    while ((task=(MTask*)Next()))
+        task->SetLogStream(log);
+
+    MParContainer::SetLogStream(log);
+}
+
+
+// --------------------------------------------------------------------------
+//
+// schedule task for execution, whether as first task, or after
+// 'where'. 'tType' is the event type which should be processed
+//
+Bool_t MTaskList::AddToList(MTask *task, const char *type, MTask *where)
+{
+    // FIXME: We agreed to put the task into list in an ordered way.
+
+    //
+    // Sanity check
+    //
+    if (!task)
+        return kFALSE;
+
+    //
+    // Get Name of new task
+    //
+    const char *name = task->GetName();
+
+    //
+    // Check if the new task is already existing in the list
+    //
+    const TObject *objn = fTasks.FindObject(name);
+    const TObject *objt = fTasks.FindObject(task);
+
+    if (objn || objt)
+    {
+        //
+        // If the task is already in the list ignore it.
+        //
+        if (objt || objn==task)
+        {
+            *fLog << dbginf << "Warning: Task '" << task->GetName() << ", 0x" << (void*)task;
+            *fLog << "' already existing in '" << GetName() << "'... ignoring." << endl;
+            return kTRUE;
+        }
+
+        //
+        // Otherwise add it to the list, but print a warning message
+        //
+        *fLog << dbginf << "Warning: Task with the same name '" << task->GetName();
+        *fLog << "' already existing in '" << GetName() << "'." << endl;
+        *fLog << "You may not be able to get a pointer to this task by name." << endl;
+    }
+
+    if (where)
+    {
+        if (!fTasks.FindObject(where))
+        {
+            *fLog << dbginf << "Error: Cannot find task after which the new task should be scheduled!" << endl;
+            return kFALSE;
+        }
+    }
+
+    *fLog << "Adding " << name << " to " << GetName() << " for " << type << "... " << flush;
+
+    task->SetStreamId(type);
+    fTasks.Add(task);
+
+    *fLog << "Done." << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// do pre processing (before eventloop) of all tasks in the task-list
+//
+Bool_t MTaskList::PreProcess(MParList *pList)
+{ 
+    *fLog << "Preprocessing... " << flush;
+
+    fParList = pList;
+
+    //
+    //  create the Iterator over the tasklist
+    //
+    TIter Next(&fTasks);
+
+    MTask *task=NULL;
+
+    //
+    // loop over all tasks for preproccesing
+    //
+    while ( (task=(MTask*)Next()) )
+    {
+        *fLog << task->GetName() << "... " << flush;
+
+        if (!task->PreProcess(fParList))
+            return kFALSE;
+
+        task->SetIsPreprocessed();
+    }
+
+    *fLog << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// do the event execution of all tasks in the task-list
+//
+Bool_t MTaskList::Process()
+{
+    //
+    // Reset the ReadyToSave flag.
+    // Reset all containers.
+    //
+    // FIXME: To run a tasklist as a single task in another tasklist we
+    //        have to make sure, that the Parameter list isn't reset.
+    //
+    fParList->SetReadyToSave(kFALSE);
+    fParList->Reset();
+
+    //
+    //  create the Iterator for the TaskList
+    //
+    TIter Next(&fTasks);
+    MTask *task=NULL;
+
+    //
+    // loop over all tasks for processing
+    //
+    while ( (task=(MTask*)Next()) )
+    {
+        //
+        // if the task has the wrong stream id skip it.
+        //
+        if (strcmp(GetStreamId(), task->GetStreamId()) &&
+            strcmp(task->GetStreamId(), "All"))
+            continue;
+
+        //
+        // Check for the existance of a filter. If a filter is existing
+        // check for its value. If the value is kFALSE don't execute
+        // this task.
+        //
+        const MFilter *filter = task->GetFilter();
+
+        const Bool_t rc = filter ? filter->IsExpressionTrue() : kTRUE;
+
+        if (!rc)
+            continue;
+
+        //
+        // if it has the right stream id execute the Process() function
+        // and check what the result of it is.
+        //
+        switch (task->Process())
+        {
+        case kTRUE:
+            //
+            // everything was OK: go on
+            //
+            continue;
+
+        case kFALSE:
+            //
+            // an error occured: stop eventloop
+            //
+            return kFALSE;
+
+        case kCONTINUE:
+            //
+            // something occured: skip the rest of the tasks for this event
+            //
+            return kTRUE;
+        }
+    }
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// do post processing (before eventloop) of all tasks in the task-list
+//
+Bool_t MTaskList::PostProcess()
+{
+    *fLog << "Postprocessing... " << flush;
+
+    // FIXME: At the moment all tasks are post processed independ of
+    // whether it was preprocessed or not.
+
+    //
+    // Reset the ReadyToSave flag.
+    // Reset all containers.
+    //
+    // FIXME: To run a tasklist as a single task in another tasklist we
+    //        have to make sure, that the Parameter list isn't reset.
+    //
+    fParList->SetReadyToSave(kFALSE);
+    fParList->Reset();
+
+    //
+    //  create the Iterator for the TaskList
+    //
+    TIter Next(&fTasks);
+
+    MTask *task=NULL;
+
+    //
+    //  loop over all tasks for postprocessing
+    //
+    while ( (task=(MTask*)Next()) )
+    {
+        if (!task->IsPreprocessed())
+            continue;
+
+        *fLog << task->GetName() << "... " << flush;
+
+        if (!task->PostProcess())
+            return kFALSE;
+    }
+
+    *fLog << endl;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+void MTaskList::Print(Option_t *t)
+{
+    *fLog << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
+
+    fTasks.Print();
+
+    *fLog << endl;
+}
+
Index: /tags/Mars_V0-4/Mars/mbase/MTaskList.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MTaskList.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MTaskList.h	(revision 9634)
@@ -0,0 +1,47 @@
+#ifndef MTASKLIST_H
+#define MTASKLIST_H
+
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+// MTaskList                                                         //
+//                                                                   //
+// Collection of tasks to be processed in the eventloop              //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TOrdCollection
+#include <TOrdCollection.h>
+#endif
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MLog;
+class MParList;
+class MInputStreamID;
+
+class MTaskList : public MTask
+{
+private:
+    TOrdCollection fTasks;	// Container for the ordered list of different tasks
+    MParList      *fParList;
+
+public:
+    MTaskList(const char *name=NULL, const char *title=NULL);
+
+    MTaskList(MTaskList &ts);
+
+    void SetLogStream(MLog *log);
+
+    Bool_t AddToList(MTask *task, const char *tType="All", MTask *where = NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    void Print(Option_t *opt = "");
+
+    ClassDef(MTaskList, 0)	//collection of tasks to be performed in the eventloop
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MTime.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MTime.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MTime.cc	(revision 9634)
@@ -0,0 +1,48 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MTime                                                                   //
+//                                                                         //
+// A generalized MARS time stamp                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MTime.h"
+
+#include <iomanip.h>
+
+#include "MLog.h"
+
+ClassImp(MTime);
+
+void MTime::Print(Option_t *)
+{
+    fLog->setf(ios::showbase);
+    *fLog << "MTime Information:  " << hex 
+        << " " <<setfill('0') << setw(2) << fTimeStamp[0]
+        << " " <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl;
+} 
+
Index: /tags/Mars_V0-4/Mars/mbase/MTime.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MTime.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MTime.h	(revision 9634)
@@ -0,0 +1,113 @@
+#ifndef MTIME_H
+#define MTIME_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MTime                                                                   //
+//                                                                         //
+// A generalized MARS time stamp                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class MTime : public MParContainer
+{
+private:
+    UInt_t fTimeStamp[2]; // type of raw event which should be processed by this task
+    UInt_t fDuration;     // time of validity
+
+public:
+
+    MTime(const char *name=NULL, const char *title=NULL)
+    {
+        *fName = name ? name : ClassName();
+        *fTitle = title;
+
+        SetTime(0,0);
+    }
+
+    MTime(UInt_t t1, UInt_t t0) 
+    {
+        SetTime(t1, t0);
+    }
+
+    MTime(MTime& t)
+    {
+        fTimeStamp[0] = t.fTimeStamp[0];
+        fTimeStamp[1] = t.fTimeStamp[1];
+        fDuration = t.fDuration;
+    }
+
+    void operator=(MTime &t)
+    {
+        fTimeStamp[0] = t.fTimeStamp[0];
+        fTimeStamp[1] = t.fTimeStamp[1];
+        fDuration = t.fDuration;
+    }
+
+    ~MTime() {}
+
+    void Print(Option_t *t=NULL);
+
+    void SetTime(UInt_t t1, UInt_t t0)
+    {
+	fTimeStamp[0] = t1;
+	fTimeStamp[1] = t0;
+    }
+
+    void SetDuration(UInt_t t)
+    {
+	fDuration = t;
+    }
+
+    MTime *GetTime()
+    {
+        return this;
+    }
+
+    UInt_t GetTimeLo()
+    {
+	return fTimeStamp[0];
+    }
+    UInt_t GetTimeHi()
+    {
+	return fTimeStamp[1];
+    }
+
+    UInt_t GetDuration()
+    {
+	return fDuration;
+    }
+
+    ClassDef(MTime, 1)	//A generalized MARS time stamp
+};
+
+inline Bool_t operator<(MTime &t1, MTime &t2)
+{
+    return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<t2.GetTimeLo());
+}
+
+inline Bool_t operator>(MTime &t1, MTime &t2)
+{
+    return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>t2.GetTimeLo());
+}
+
+inline Bool_t operator<=(MTime &t1, MTime &t2)
+{
+    return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<=t2.GetTimeLo());
+}
+
+inline Bool_t operator>=(MTime &t1, MTime &t2)
+{
+    return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>=t2.GetTimeLo());
+}
+
+inline Bool_t operator==(MTime &t1, MTime &t2)
+{
+    return (t1.GetTimeLo()==t2.GetTimeLo()) && (t1.GetTimeHi()==t2.GetTimeHi());
+}
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MWriteAsciiFile.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MWriteAsciiFile.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MWriteAsciiFile.cc	(revision 9634)
@@ -0,0 +1,136 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  06/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MWriteAsciiFile                                                         //
+//                                                                         //
+// If you want to store a single container into an Ascii file you have     //
+// to use this class. You must know the name of the file you wanne write   //
+// (you should know it) and the name of the container you want to write.   //
+// This can be the name of the class or a given name, which identifies     //
+// the container in a parameter container list (MParList).                 //
+// The container is writte to the ascii file if its ReadyToSave flag is     //
+// set (MParContainer)                                                     //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MWriteAsciiFile.h"
+
+#include <fstream.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+ClassImp(MWriteAsciiFile);
+
+// --------------------------------------------------------------------------
+//
+// Specify the name of the ascii output file 'filename' and the name
+// of the container you want to write. (Normally this is the name
+// of the class (eg. MHillas) but it can also be a different name which
+// identifies the container in the parameter list.
+//
+MWriteAsciiFile::MWriteAsciiFile(const char *filename, const char *contname,
+                                 const char *name, const char *title)
+    : fOut(NULL), fContainer(NULL)
+{
+    *fName  = name  ? name  : "MWriteAsciiFile";
+    *fTitle = title ? title : "Task to write one container to an ascii file";
+
+    fNameFile      = filename;
+    fNameContainer = contname;
+
+    fOut = new ofstream(fNameFile);
+}
+
+// --------------------------------------------------------------------------
+//
+// Specify a the name of the ascii output file 'filename' and a pointer to
+// the container you want to write. 
+//
+MWriteAsciiFile::MWriteAsciiFile(const char *filename, MParContainer *cont,
+                                 const char *name, const char *title)
+    : fOut(NULL), fContainer(cont)
+{
+    *fName  = name  ? name  : "MWriteAsciiFile";
+    *fTitle = title ? title : "Task to write one container to an ascii file";
+
+    fNameFile      = filename;
+    fNameContainer = cont->GetName();
+
+    fOut = new ofstream(fNameFile);
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor. Delete the output file if necessary (it is closed
+// automatically by its destructor.
+//
+MWriteAsciiFile::~MWriteAsciiFile()
+{
+    delete fOut;
+}
+
+// --------------------------------------------------------------------------
+//
+// Check if our container is ready for writing. If so write it.
+//
+void MWriteAsciiFile::CheckAndWrite() const
+{
+    if (fContainer->IsReadyToSave())
+        fContainer->AsciiWrite(*fOut);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return open state of the file
+//
+Bool_t MWriteAsciiFile::IsFileOpen() const
+{
+    return (bool)(*fOut);
+}
+
+// --------------------------------------------------------------------------
+//
+// If the container is yet unknown and the name of it is known only, try
+// to get the container from the parameter list.
+//
+Bool_t MWriteAsciiFile::GetContainer(MParList *pList)
+{
+    //
+    // Try to find the container which should be stored.
+    //
+    if (fContainer)
+        return kTRUE;
+
+    fContainer = (MParContainer*)pList->FindObject(fNameContainer);
+    if (fContainer)
+        return kTRUE;
+
+    *fLog << dbginf << "Cannot find parameter container '" << fContainer << "'." << endl;
+    return kFALSE;
+}
Index: /tags/Mars_V0-4/Mars/mbase/MWriteAsciiFile.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MWriteAsciiFile.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MWriteAsciiFile.h	(revision 9634)
@@ -0,0 +1,34 @@
+#ifndef MWRITEASCIIFILE_H
+#define MWRITEASCIIFILE_H
+
+#ifndef MWRITEFILE_H
+#include "MWriteFile.h"
+#endif
+
+class MWriteAsciiFile : public MWriteFile //MTask
+{
+private:
+    ofstream *fOut;
+
+    TString fNameFile;
+    TString fNameContainer;
+
+    MParContainer *fContainer;
+
+    virtual void   CheckAndWrite() const;
+    virtual Bool_t IsFileOpen() const;
+    virtual Bool_t GetContainer(MParList *pList);
+    virtual const char *GetFileName() const { return fNameFile; }
+
+
+public:
+    MWriteAsciiFile(const char *filename, const char *contname,
+                    const char *name=NULL, const char *title=NULL);
+    MWriteAsciiFile(const char *filename, MParContainer *cont,
+                    const char *name=NULL, const char *title=NULL);
+    ~MWriteAsciiFile();
+
+    ClassDef(MWriteAsciiFile, 0)	// Class to write one container to an ascii file
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MWriteFile.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MWriteFile.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MWriteFile.cc	(revision 9634)
@@ -0,0 +1,110 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  06/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MWriteFile                                                              //
+//                                                                         //
+// This is a base class for writing tasks. If you want to implement        //
+// writing out parameter containers in a new file format, this is a good   //
+// starting point.                                                         //
+// The class defines a generalized interface between writing out data in   //
+// an eventloop and your file format.                                      //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MWriteFile.h"
+
+#include <fstream.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+ClassImp(MWriteFile);
+
+// --------------------------------------------------------------------------
+//
+// Tries to open the given output file.
+// The derived class should retrieve needed containers from the parameter
+// list.
+// instance of the container which should be written.
+// If the container has already the HasChanged flag it is immediatly written
+// to the output file.
+//
+Bool_t MWriteFile::PreProcess(MParList *pList)
+{
+    //
+    // test whether file is now open or not
+    //
+    if (!IsFileOpen())
+    {
+        *fLog << dbginf << "Cannot open file '" << GetFileName() << "'" << endl;
+        return kFALSE;
+    }
+
+    *fLog << "File '" << GetFileName() << "' open for writing." << endl;
+
+    //
+    // Get the containers (pointers) from the parameter list you want to write
+    //
+    if (!GetContainer(pList))
+        return kFALSE;
+
+    //
+    // write the container if it is already in changed state
+    //
+    CheckAndWrite();
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Checks if the HasChanged flag of the output container is set. If it is set
+// the container should be written to the output.
+//
+Bool_t MWriteFile::Process()
+{
+    CheckAndWrite();
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Checks if the HasChanged flag of the output container is set. If it is set
+// the container should be written to the output.
+//
+Bool_t MWriteFile::PostProcess()
+{
+    //
+    // check if the container changed state is set
+    //
+    CheckAndWrite();
+
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/mbase/MWriteFile.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MWriteFile.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MWriteFile.h	(revision 9634)
@@ -0,0 +1,27 @@
+#ifndef MWRITEFILE_H
+#define MWRITEFILE_H
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class TFile;
+
+class MWriteFile : public MTask
+{
+private:
+    virtual Bool_t IsFileOpen() const = 0;
+    virtual void CheckAndWrite() const = 0;
+    virtual Bool_t GetContainer(MParList *pList) = 0;
+    virtual const char *GetFileName() const = 0;
+
+public:
+
+    virtual Bool_t PreProcess(MParList *pList);
+    virtual Bool_t Process();
+    virtual Bool_t PostProcess();
+
+    ClassDef(MWriteFile, 0)	// Class to write one container to an ascii file
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/MWriteRootFile.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MWriteRootFile.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MWriteRootFile.cc	(revision 9634)
@@ -0,0 +1,376 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  06/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MWriteRootFile                                                          //
+//                                                                         //
+// This is a writer to store several containers to a root file.            //
+// The containers are added with AddContainer.                             //
+// To understand how it works, see base class MWriteFile                   //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MWriteRootFile.h"
+
+#include <TFile.h>
+#include <TTree.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+
+ClassImp(MWriteRootFile);
+
+// --------------------------------------------------------------------------
+//
+// Specify the name of the root file. You can also give an option ("UPDATE"
+// and "RECREATE" would make sense only) as well as the file title and
+// compression factor. To a more detaild description of the options see
+// TFile.
+//
+MWriteRootFile::MWriteRootFile(const char *fname,
+                               const Option_t *opt,
+                               const char *ftitle,
+                               const Int_t comp,
+                               const char *name,
+                               const char *title)
+{
+    *fName  = name  ? name  : "MWriteRootFile";
+    *fTitle = title ? title : "Task which writes a root-output file";
+
+    //
+    // Set the Arrays the owner of its entries. This means, that the
+    // destructor of the arrays will delete all its entries.
+    //
+    fBranches.SetOwner();
+    fTrees.SetOwner();
+
+    //
+    // Open the rootfile
+    //
+    fOut = new TFile(fname, opt, ftitle, comp);
+}
+
+// --------------------------------------------------------------------------
+//
+// Prints some statistics about the file to the screen. And closes the file
+// properly.
+//
+MWriteRootFile::~MWriteRootFile()
+{
+    //
+    // Print some statistics to the looging out.
+    //
+    Print();
+
+    //
+    // If the file is still open (no error) write the keys. This is necessary
+    // for appearance of the all trees and branches.
+    //
+    if (IsFileOpen())
+        fOut->Write();
+
+    //
+    // Delete the file. This'll also close the file (if open)
+    //
+    delete fOut; 
+}
+
+// --------------------------------------------------------------------------
+//
+// Prints all trees with the actually number of written entries to log-out.
+//
+void MWriteRootFile::Print(Option_t *)
+{
+    *fLog << "File: " << GetFileName() << endl;
+    *fLog << "--------------------------------------------------" << endl;
+
+    MRootFileTree *entry;
+
+    //
+    // Loop over all tree entries
+    //
+    TObjArrayIter Next(&fTrees);
+    while ((entry=(MRootFileTree*)Next()))
+    {
+        //
+        // Print out the name and the number of actually written entries.
+        //
+        *fLog << entry->GetTree()->GetName() << ": \t";
+        *fLog << entry->GetNumEntries() << " entries." << endl;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// Add a new Container to list of containers which should be written to the
+// file. Give the name of the container which will identify the container
+// in the parameterlist. tname is the name of the tree to which the
+// container should be written (Remark: one tree can hold more than one
+// container). The default is the same name as the container name.
+// You can slso specify a title for the tree. This is only
+// used the first time this tree in 'mentioned'. As default the title
+// is the name of the tree.
+//
+void MWriteRootFile::AddContainer(const char *cname, const char *tname, const char *ttitle)
+{
+    //
+    // create a new entry in the list of branches to write and
+    // add the entry to the list.
+    //
+    MRootFileBranch *entry = new MRootFileBranch(cname, tname, ttitle);
+    fBranches.AddLast(entry);
+}
+
+// --------------------------------------------------------------------------
+//
+// Add a new Container to list of containers which should be written to the
+// file. Give the pointer to the container. tname is the name of the tree to
+// which the container should be written (Remark: one tree can hold more than
+// one container). The default is the same name as the container name.
+// You can slso specify a title for the tree. This is only
+// used the first time this tree in 'mentioned'. As default the title
+// is the name of the tree.
+//
+void MWriteRootFile::AddContainer(MParContainer *cont, const char *tname,
+                                  const char *ttitle)
+{
+    //
+    // create a new entry in the list of branches to write and
+    // add the entry to the list.
+    //
+    MRootFileBranch *entry = new MRootFileBranch(cont, tname, ttitle);
+    fBranches.AddLast(entry);
+}
+
+// --------------------------------------------------------------------------
+//
+// Add a new Container to list of containers which should be written to the
+// file. Give the pointer to the container. tname is the name of the tree to
+// which the container should be written (Remark: one tree can hold more than
+// one container). The default is the same name as the container name.
+// You can slso specify a title for the tree. This is only
+// used the first time this tree in 'mentioned'. As default the title
+// is the name of the tree.
+//
+Bool_t MWriteRootFile::GetContainer(MParList *pList)
+{
+    MRootFileBranch *entry;
+
+    //
+    //
+    // loop over all branches which are 'marked' as branches to get written.
+    TObjArrayIter Next(&fBranches);
+    while ((entry=(MRootFileBranch*)Next()))
+    {
+        //
+        // Get the pointer to the container. If the pointer is NULL it seems,
+        // that the user identified the container by name.
+        //
+        MParContainer *cont = entry->GetContainer();
+        if (!cont)
+        {
+            //
+            // Get the name and try to find a container with this name
+            // in the parameter list.
+            //
+            const char *cname = entry->GetContName();
+            cont = (MParContainer*)pList->FindObject(cname);
+            if (!cont)
+            {
+                //
+                // No corresponding container is found
+                //
+                *fLog << dbginf << "Cannot find parameter container '" << cname << "'." << endl;
+                return kFALSE;
+            }
+            //
+            // The container is found. Put the pointer into the entry.
+            //
+            entry->SetContainer(cont);
+        }
+
+        //
+        // Get container name, tree name and tree title of this entry.
+        //
+        const char *cname  = cont->GetName();
+        const char *tname  = entry->GetTreeName();
+        const char *ttitle = entry->GetTreeTitle();
+
+        //
+        // if the tree name is NULL this idetifies it to use the default:
+        // the container name.
+        //
+        if (!tname)
+            tname = cname;
+
+        //
+        // Check if the tree is already existing (part of the file)
+        //
+        TTree *tree = (TTree*)fOut->Get(tname);
+        if (!tree)
+        {
+            //
+            // if the tree doesn't exist create a new tree. Use the tree
+            // name as title if title is NULL
+            //
+            tree = new TTree(tname, ttitle ? ttitle : tname);
+
+            //
+            // Create a new entry in the list of trees, which are stored to
+            // the file. Add it to the list.
+            //
+            MRootFileTree *entry = new MRootFileTree(tree);
+            fTrees.AddLast(entry);
+
+            *fLog << "Created Tree " << tname << "." << endl;
+        }
+
+        //
+        // Now we have a valid tree. Search the list of trees for this tree
+        // (either it is already there, or we created and add it previously)
+        // Add a pointer to the entry in the tree list to this branch-entry
+        //
+        MRootFileTree *loop;
+        TObjArrayIter NextTree(&fTrees);
+        while ((loop=(MRootFileTree*)NextTree()))
+        {
+            if (loop->GetTree() == tree)
+                entry->SetTree(loop);
+        }
+
+        //
+        // Try to get the branch from the file. 
+        // If the branch already exists the user specified one branch twice.
+        //
+        TBranch *branch = tree->GetBranch(cname);
+        if (branch)
+        {
+            *fLog << dbginf << "Branch '" << cname << "' is already existing." << endl;
+            return kFALSE;
+        }
+
+        //
+        // Create a new branch in the actual tree. The branch has the name
+        // container name. The type of the container is given by the
+        // ClassName entry in the container. The Address is the address of a
+        // pointer to the container (gotten from the branch entry). As
+        // Basket size we specify a (more or less) common default value.
+        // The containers should be written in Splitlevel=1
+        //
+        branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress(), 32000, 1);
+
+        *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;
+
+        //
+        // If the branch couldn't be created we have a problem.
+        //
+        if (!branch)
+        {
+            *fLog << dbginf << "Unable to create branch '" << cname << "'." << endl;
+            return kFALSE;
+        }
+    }
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Checks all given containers (branch entries) for the write flag.
+// If the write flag is set the corresponding Tree is marked to get filled.
+// All Trees which are marked to be filled are filled with the corresponding
+// branches.
+// Be carefull: If only one container (corresponding to a branch) of a tree
+// has the write flag, all containers in this tree are filled!
+//
+void MWriteRootFile::CheckAndWrite() const
+{
+    TObject *obj;
+
+    //
+    // Loop over all branch entries
+    //
+    TObjArrayIter NextBranch(&fBranches);
+    while ((obj=NextBranch()))
+    {
+        MRootFileBranch *entry = (MRootFileBranch*)obj;
+
+        //
+        // Check for the Write flag
+        //
+        if (!entry->GetContainer()->IsReadyToSave())
+            continue;
+
+        //
+        // If the write flag of the branch entry is set, set the write flag of
+        // the corresponding tree entry.
+        //
+        entry->GetTree()->SetWriteFlag();
+    }
+
+    //
+    // Loop over all tree entries
+    //
+    TObjArrayIter NextTree(&fTrees);
+    while ((obj=NextTree()))
+    {
+        MRootFileTree *entry = (MRootFileTree*)obj;
+
+        //
+        // Check the write flag of the tree
+        //
+        if (!entry->HasWriteFlag())
+            continue;
+
+        //
+        // If the write flag is set, fill the tree (with the corrasponding
+        // branches/containers), delete the write flag and increase the number
+        // of written/filled entries.
+        //
+        entry->GetTree()->Fill();
+        entry->DelWriteFlag();
+        (*entry)++;
+    }
+}
+
+// --------------------------------------------------------------------------
+//
+// return open state of the root file.
+//
+Bool_t MWriteRootFile::IsFileOpen() const
+{
+    return fOut->IsOpen();
+}
+
+// --------------------------------------------------------------------------
+//
+// return name of the root-file
+//
+const char *MWriteRootFile::GetFileName() const
+{
+    return fOut->GetName();
+}
+
Index: /tags/Mars_V0-4/Mars/mbase/MWriteRootFile.h
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/MWriteRootFile.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/MWriteRootFile.h	(revision 9634)
@@ -0,0 +1,104 @@
+#ifndef MWRITEROOTFILE_H
+#define MWRITEROOTFILE_H
+
+#ifndef MWriteFile_H
+#include "MWriteFile.h"
+#endif
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+
+class TFile;
+class TTree;
+class TBranch;
+
+class MRootFileTree : public TObject
+{
+private:
+    TTree         *fTree;
+    Bool_t         fWriteFlag;
+    ULong_t        fNumEntries;
+
+public:
+    MRootFileTree(TTree *tree) : fTree(tree), fWriteFlag(kFALSE), fNumEntries(0) {}
+    TTree *GetTree() const { return fTree; }
+    Bool_t HasWriteFlag() const { return fWriteFlag; }
+    ULong_t GetNumEntries() const { return fNumEntries; }
+    void operator++(int) { fNumEntries++; }
+    void SetWriteFlag() { fWriteFlag = kTRUE; }
+    void DelWriteFlag() { fWriteFlag = kFALSE; }
+};
+
+class MRootFileBranch : public TObject
+{
+private:
+    MRootFileTree *fTree;
+    TBranch       *fBranch;
+    MParContainer *fContainer;
+    TString       *fContName;
+    TString       *fTreeName;
+    TString       *fTreeTitle;
+
+public:
+    MRootFileBranch(const char *cname, const char *tname=NULL, const char *ttitle=NULL)
+        : fTree(NULL), fBranch(NULL), fContainer(NULL)
+    {
+        fContName  = new TString(cname);
+        fTreeName  = tname ? new TString(tname) : NULL;
+        fTreeTitle = ttitle ? new TString(ttitle) : NULL;
+    }
+
+    MRootFileBranch(MParContainer *cont, const char *tname=NULL, const char *ttitle=NULL)
+        : fTree(NULL), fBranch(NULL), fContName(NULL)
+    {
+        fContainer = cont;
+        fTreeName  = tname ? new TString(tname) : NULL;
+        fTreeTitle = ttitle ? new TString(ttitle) : NULL;
+    }
+
+        MRootFileTree *GetTree() const { return fTree; }
+    MParContainer *GetContainer() const { return fContainer; }
+    void *GetAddress() { return &fContainer; }
+    TBranch *GetBranch() const          { return fBranch; }
+    const char *GetContName() const     { return fContName  ? (const char*)(*fContName)  : NULL; }
+    const char *GetTreeName() const     { return fTreeName  ? (const char*)(*fTreeName)  : NULL; }
+    const char *GetTreeTitle() const    { return fTreeTitle ? (const char*)(*fTreeTitle) : NULL; }
+
+    void SetContainer(MParContainer *cont) { fContainer = cont; }
+    void SetTree(MRootFileTree *tree) { fTree = tree; }
+
+};
+
+class MWriteRootFile : public MWriteFile
+{
+private:
+    TFile *fOut;
+
+    TObjArray fBranches;
+    TObjArray fTrees;
+
+    void        CheckAndWrite() const;
+    Bool_t      IsFileOpen() const;
+    Bool_t      GetContainer(MParList *pList);
+    const char *GetFileName() const;
+
+public:
+    MWriteRootFile(const char *fname,
+                   const Option_t *opt="RECREATE",
+                   const char *ftitle="Unnamed",
+                   const Int_t comp=9,
+                   const char *name=NULL,
+                   const char *title=NULL);
+    ~MWriteRootFile();
+
+    void Print(Option_t *t=NULL);
+
+    void AddContainer(const char *cname,
+                      const char *tname=NULL, const char *ttitle=NULL);
+    void AddContainer(MParContainer *cont,
+                      const char *tname=NULL, const char *ttitle=NULL);
+
+    ClassDef(MWriteRootFile, 0)	// Class to write one container to an ascii file
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mbase/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mbase/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mbase/Makefile	(revision 9634)
@@ -0,0 +1,68 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+# @endcode 
+
+INCLUDES = -I.
+
+# @code 
+
+CINT     = Base
+LIB      = mbase.a
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MTask.cc \
+	   MTaskList.cc \
+           MParContainer.cc \
+	   MParList.cc \
+           MFilter.cc \
+           MFilterList.cc \
+	   MInputStreamID.cc \
+           MEvtLoop.cc \
+           MReadTree.cc \
+           MWriteFile.cc \
+           MWriteAsciiFile.cc \
+           MWriteRootFile.cc \
+	   MArray.cc \
+	   MArrayB.cc \
+	   MArrayS.cc \
+           MTime.cc \
+           MLog.cc \
+           MHtml.cc \
+           MLogManip.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mdatacheck/DataCheckIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/DataCheckIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/DataCheckIncl.h	(revision 9634)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mdatacheck/DataCheckLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/DataCheckLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/DataCheckLinkDef.h	(revision 9634)
@@ -0,0 +1,10 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MShowSpect;
+#pragma link C++ class MDumpEvtHeader;
+
+#endif
Index: /tags/Mars_V0-4/Mars/mdatacheck/MDumpEvtHeader.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MDumpEvtHeader.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MDumpEvtHeader.cc	(revision 9634)
@@ -0,0 +1,69 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MDumpEvtHeader.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MParList.h"
+#include "MRawEvtHeader.h"
+#include "MRawEvtPixelIter.h"
+
+ClassImp(MDumpEvtHeader)
+
+Bool_t MDumpEvtHeader::PreProcess (MParList *pList)
+{
+    fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
+    if (!fRawEvtHeader)
+    {
+        *fLog << dbginf << " Error: MRawEvtHeader not found... exit." << endl;
+        return kFALSE ;
+    }
+
+    fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData");
+    if (!fRawEvtData)
+    {
+        *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
+        return kFALSE ;
+    }
+
+    return kTRUE ;
+} 
+
+Bool_t MDumpEvtHeader::Process()
+{
+  fRawEvtHeader->Print() ; 
+
+  MRawEvtPixelIter pixel( fRawEvtData );
+
+  while ( pixel.Next() )
+  {
+      *fLog << " " << pixel.GetPixelId() ;
+  }
+
+  *fLog << endl ;
+  
+  return kTRUE;
+} 
Index: /tags/Mars_V0-4/Mars/mdatacheck/MDumpEvtHeader.h
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MDumpEvtHeader.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MDumpEvtHeader.h	(revision 9634)
@@ -0,0 +1,32 @@
+#ifndef MDUMPEVTHEADER_H
+#define MDUMPEVTHEADER_H
+
+#ifndef MAGIC_h
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MRawEvtHeader;
+class MRawEvtData;
+class MParList;
+
+class MDumpEvtHeader : public MTask {
+ private:
+  MRawEvtHeader    *fRawEvtHeader;
+
+  MRawEvtData      *fRawEvtData;
+
+ public:
+  MDumpEvtHeader () : fRawEvtHeader(NULL) { } ;
+
+  Bool_t PreProcess(MParList *pList);
+  Bool_t Process() ;
+  
+  ClassDef(MDumpEvtHeader, 0)	// Class to dump the pixel ids of a raw evt to the screen
+
+};
+    
+#endif
Index: /tags/Mars_V0-4/Mars/mdatacheck/MGDisplayAdc.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MGDisplayAdc.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MGDisplayAdc.cc	(revision 9634)
@@ -0,0 +1,486 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MGDisplayAdc.h"
+
+#include <TGButton.h>            // TGTextButton
+#include <TCanvas.h>             // TCanvas.h
+#include <TGMsgBox.h>            // TGMsgBox
+#include <TRootEmbeddedCanvas.h> // TRootEmbeddedCanvas
+
+enum ComIdentDisplayAdc {
+	M_BUTTON_SAVE,
+		M_BUTTON_PRINT,
+		M_BUTTON_PRINTALL,
+		M_BUTTON_CLOSE , 
+		
+		M_BUTTON_PREV, 
+		M_BUTTON_NEXT,
+
+		M_LIST_HISTO,
+		M_RADIO_HIGH,
+		M_RADIO_LOW,
+		M_RADIO_LH,
+		M_BUTTON_RESET,
+		M_VSId1
+} ; 
+
+MGDisplayAdc::MGDisplayAdc ( MHFadcCam *histos,
+			    const TGWindow *p, const TGWindow *main, 
+			    UInt_t w, UInt_t h, 
+			    UInt_t options) 
+	: TGTransientFrame(p, main, w, h, options ) 
+{
+    //
+    //   default constructor
+    //
+
+    //
+    // NEVER try to delete them in the destructor!
+    //
+    fHists = histos ;
+
+    //
+    //   the top frame for the list and some buttons and the Canvas
+    //
+    fFrameTop = new TGHorizontalFrame (this, 60,20,  kFitWidth ) ;
+
+    //
+    //    left part of top frame
+    //
+    fFT1 =  new TGVerticalFrame (fFrameTop, 80,300,  kFitWidth ) ;
+
+    fHistoList = new TGListBox ( fFT1, M_LIST_HISTO ) ;
+    fHistoList->Associate( this ) ;
+    fFT1->AddFrame ( fHistoList, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 10 ) )  ;
+	
+    fHistoList->Resize(80, 405 ) ;
+
+    fFrameTop->AddFrame (fFT1, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ;
+
+    //
+    //    middle part of top frame
+    //
+    fFT2 =  new TGVerticalFrame (fFrameTop, 80,20,  kFitWidth ) ;
+
+    fButtonPrev = new TGTextButton ( fFT2, "Prev Histo", M_BUTTON_PREV ) ;
+    fButtonPrev->Associate (this) ;
+    fFT2->AddFrame ( fButtonPrev, new TGLayoutHints (kLHintsLeft | kLHintsTop,10, 10, 0, 10 ) )  ;
+
+
+    fVslider1 = new TGVSlider (fFT2, 250, kSlider1 | kScaleBoth, M_VSId1);
+
+    fVslider1->Associate(this);
+    fVslider1->SetRange(0, 576);
+    fFT2->AddFrame(fVslider1);
+
+    fButtonNext = new TGTextButton ( fFT2, "Next Histo", M_BUTTON_NEXT ) ;
+    fButtonNext->Associate (this) ;
+    fFT2->AddFrame ( fButtonNext, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) )  ;
+
+    fFrameTop->AddFrame (fFT2, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ;
+
+    //
+    // Radio buttons, used to select the high, low anh high/low display
+    //
+    fRadio[0] = new  TGRadioButton(fFT2, "&High Gain", M_RADIO_HIGH);
+    fFT2->AddFrame ( fRadio[0], new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) )  ;
+    fRadio[0]->Associate(this);
+    fRadio[0]->SetState(kButtonDown);
+    fHistoLock = kFALSE;
+    fHistoType=1;
+
+    fRadio[1] = new  TGRadioButton(fFT2, "&Low Gain", M_RADIO_LOW);
+    fFT2->AddFrame ( fRadio[1], new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) )  ;
+    fRadio[1]->Associate(this);
+
+    fRadio[2] = new  TGRadioButton(fFT2, "H&igh/Low Gain", M_RADIO_LH);
+    fFT2->AddFrame ( fRadio[2], new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) )  ;
+    fRadio[2]->Associate(this);
+
+    //
+    //    right part of top frame
+    //
+    fFT3 =  new TGVerticalFrame (fFrameTop, 60, 60,  kFitWidth ) ;
+
+    fECanv = new TRootEmbeddedCanvas("fECanv", fFT3, 400, 400 ) ;
+
+    fFT3->AddFrame( fECanv, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ;
+
+    //
+    //the button for reseting the histogram
+    //
+    fButtonReset = new TGTextButton ( fFT3, "Reset histo", M_BUTTON_RESET ) ;
+    fButtonReset->Associate (this) ;
+    fFT3->AddFrame ( fButtonReset, new TGLayoutHints (kLHintsCenterX | kLHintsTop,10, 10, 0, 10 ) )  ;
+	
+    fCanv = fECanv->GetCanvas() ;
+
+    fFrameTop->AddFrame (fFT3, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ;
+
+    AddFrame ( fFrameTop, new TGLayoutHints ( kLHintsTop | kLHintsExpandX , 10, 10, 10, 10 ) ) ;
+
+    //
+    //   the low frame for the control buttons
+    //
+    fFrameLow = new TGHorizontalFrame (this, 60,20, kFixedWidth ) ;
+
+    fButtonSave = new TGTextButton ( fFrameLow, "Save", M_BUTTON_SAVE ) ;
+    fButtonSave->Associate (this) ;
+    fFrameLow->AddFrame ( fButtonSave, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
+
+    fButtonPrint = new TGTextButton ( fFrameLow, "Print", M_BUTTON_PRINT ) ;
+    fButtonPrint->Associate (this) ;
+    fFrameLow->AddFrame ( fButtonPrint, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
+
+    fButtonPrintAll = new TGTextButton ( fFrameLow, "PrintAll", M_BUTTON_PRINTALL ) ;
+    fButtonPrintAll->Associate (this) ;
+    fFrameLow->AddFrame ( fButtonPrintAll, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
+  
+    fButtonClose = new TGTextButton ( fFrameLow, "Close", M_BUTTON_CLOSE ) ;
+    fButtonClose->Associate (this) ;
+    fFrameLow->AddFrame ( fButtonClose, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ;
+    AddFrame ( fFrameLow, new TGLayoutHints ( kLHintsBottom | kLHintsExpandX , 10, 10, 10, 10 ) ) ;
+	
+    //
+    //
+    //
+    BuildHistoList() ;
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("ADC Spectra");
+    SetIconName("ADC Spectra");
+
+    //
+    // Here the initial display is set to hitogram 0
+    //
+    fHistoList->Select(1, kTRUE);
+    DrawSelectedHi() ;
+    SetSelectedTopEntry();
+    fCanv->Modified() ;
+    fCanv->Update() ;
+    SetSelectedPos();
+
+    MapWindow();
+    SetWMSizeHints(550, 550, 1000, 1000, 1, 1);
+}  
+
+MGDisplayAdc::~MGDisplayAdc ()
+{ 
+    delete fButtonSave ;
+    delete fButtonPrint ; 
+    delete fButtonPrintAll ; 
+    delete fButtonClose ; 
+    
+    delete fButtonPrev; 
+    delete fButtonNext ; 
+    delete fButtonReset ;
+    
+    delete fVslider1; 
+    delete fECanv ;
+    
+    delete fHistoList ;
+    delete fRadio[2];
+    delete fRadio[1];
+    delete fRadio[0]; 
+    delete fFT1 ; 
+    delete fFT2 ; 
+    delete fFT3 ; 
+    delete fFrameLow ; 
+    delete fFrameTop ; 
+}  
+
+// ======================================================================
+// ======================================================================
+
+void MGDisplayAdc::CloseWindow()
+{
+  // Got close message for this MainFrame. Calls parent CloseWindow()
+  // (which destroys the window) and terminate the application.
+  // The close message is generated by the window manager when its close
+  // window menu item is selected.
+  // 
+  delete this ; 
+  //  TGTransientFrame::CloseWindow();
+  //  TGMainFrame::CloseWindow();
+  //   gROOT->GetApplication()->Terminate(0)  ; 
+}
+
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGDisplayAdc::BuildHistoList(Int_t type ) 
+{
+    //
+    //   looks in the container of the AdcSpectra and reads in the
+    //   Histogramms in there.
+    //
+    //   In the class MHFadcCam are in fact two lists. One for the high and
+    //   one for the low gain. Here we will use only the high gain list!!!
+    //   With some special options (settings in the gui) we will also be able
+    //   to plot the low gain
+    //
+
+    const Int_t nhi = fHists->GetEntries();
+    for ( Int_t i=0 ; i < nhi; i++ ) {
+        fHistoList->AddEntry(fHists->GetHistHi(i)->GetName(), i+1) ;
+    }
+
+    fHistoList->MapSubwindows() ;
+    fHistoList->Layout() ;
+    return kTRUE ;
+} 
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGDisplayAdc::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{     
+    //
+    // Process events generated by the buttons in the frame.
+    //
+    Int_t   buttons = 4, retval = 0 ;
+    //Char_t  wort[100] ;
+    //Char_t  extens[5] ;
+    //Char_t  command[110] ;
+
+    //TGFileItem *item ;     // to process items in the file view container
+    //void *np = NULL ;      // null pointer
+
+    switch (GET_MSG(msg))
+    {
+    case kC_COMMAND:
+        switch (GET_SUBMSG(msg))
+        {
+        case kCM_BUTTON:
+
+            switch (parm1)
+            {
+            case M_BUTTON_SAVE:
+                new TGMsgBox(fClient->GetRoot(), this,
+                             "WARNING!",
+                             "Not implemented yet.",
+                             kMBIconExclamation, buttons, &retval);
+                break ;
+
+            case M_BUTTON_PRINT:
+                break;
+
+            case M_BUTTON_RESET:
+                new TGMsgBox(fClient->GetRoot(), this,
+                             "WARNING!",
+                             "Not implemented yet.",
+                             kMBIconExclamation, buttons, &retval);
+                break;
+
+            case M_BUTTON_CLOSE:
+                CloseWindow() ;
+                break ;
+
+                // The selection for "Next Histogram".
+                // There is also a link for the sicronisation with the slider
+                //
+            case M_BUTTON_PREV:
+            case M_BUTTON_NEXT:
+                if ((parm1==M_BUTTON_PREV && GetSelected()-1 > 0) ||
+                    (parm2==M_BUTTON_NEXT && GetSelected()-1 < 576))
+                {
+                    if (fHistoLock == kTRUE )
+                    {
+                        fCanvas->cd(1);
+                        SelectSelected();
+                        DrawSelectedHi() ;
+                        fCanvas->cd(2);
+                        DrawSelectedLo() ;
+                    }
+                    else
+                    {
+                        fCanv->cd();
+                        SelectSelected();
+                        DrawSelectedHi() ;
+
+                    }
+                    SetSelectedTopEntry();
+                    fCanv->Modified() ;
+                    fCanv->Update() ;
+                    SetSelectedPos();
+
+                }
+                if (fRadio[1]->GetState() != kButtonDown)
+                    break;
+
+                fRadio[0]->SetState(kButtonDown);
+                fRadio[1]->SetState(kButtonUp);
+                break;
+
+            default:
+                break ;
+            }
+            break;
+
+        case kCM_RADIOBUTTON:
+
+            switch(parm1)
+            {
+            case M_RADIO_HIGH:
+            case M_RADIO_LOW:
+                if (parm1 == M_RADIO_HIGH)
+                {
+                    fRadio[1]->SetState(kButtonUp);
+                    fRadio[2]->SetState(kButtonUp);
+                    fHistoType=1;
+                }
+                else
+                {
+                    fRadio[0]->SetState(kButtonUp);
+                    fRadio[2]->SetState(kButtonUp);
+                    fHistoType = 2;
+                }
+                fHistoLock = kFALSE;
+
+                fCanv->cd();
+                SelectSelected();
+                parm1 == M_RADIO_HIGH ? DrawSelectedHi() : DrawSelectedLo();
+
+                SetSelectedTopEntry();
+                fCanv->Modified() ;
+                fCanv->Update() ;
+                SetSelectedPos();
+                break;
+				
+            case M_RADIO_LH:
+                fRadio[0]->SetState(kButtonUp);
+                fRadio[1]->SetState(kButtonUp);
+
+                if (fHistoLock == kFALSE)
+                {
+                    fCanvas = fECanv->GetCanvas();
+                    fCanvas->Divide(1,2, 0, 0 ,0);
+
+                    fCanv->Modified() ;
+                    fCanv->Update() ;
+                    fHistoLock = kTRUE;
+                    fHistoType = 3;
+                }
+
+                fCanvas->cd(1);
+
+                SelectSelected();
+                DrawSelectedHi() ;
+                SetSelectedTopEntry();
+
+                fCanvas->cd(2);
+                SelectSelected();
+                DrawSelectedLo() ;
+                SetSelectedTopEntry();
+
+                fCanv->Modified() ;
+                fCanv->Update();
+
+            default:
+                break;
+            }
+            break;
+        }
+		
+    case kCM_LISTBOX:
+        if (GET_SUBMSG(msg) != M_LIST_HISTO)
+            break;
+
+        if (fHistoLock == kTRUE )
+        {
+            fCanvas->cd(1);
+            DrawSelectedHi() ;
+            fCanvas->cd(2);
+            DrawSelectedLo() ;
+        }
+        else
+        {
+            fCanv->cd() ;
+            DrawSelectedHi() ;
+        }
+        fCanv->Modified() ;
+        fCanv->Update() ;
+        SetSelectedPos();
+        break ;
+
+/*
+    case kC_CONTAINER:
+        switch (GET_SUBMSG(msg))
+        {
+
+        case kCT_ITEMDBLCLICK:
+            break;
+
+        default:
+            break ;
+        }
+*/
+
+    case kC_VSLIDER:
+        if (GET_SUBMSG(msg)!=kSL_POS || parm1!=M_VSId1)
+            break;
+
+        // Check for the slider movement and sicronise with TGListBox
+        if (parm2<0 || parm2>576)
+            break;
+
+        if (fHistoLock==kTRUE)
+        {
+            fCanvas->cd(1) ;
+            DrawHi(parm2) ;
+            fHistoList->Select(parm2+1, kTRUE);
+
+            fCanvas->cd(2) ;
+            DrawLo(parm2) ;
+        }
+        else
+        {
+            fCanv->cd() ;
+            DrawHi(parm2) ;
+        }
+
+        fHistoList->Select(parm2+1, kTRUE);
+        SetSelectedTopEntry();
+
+        fCanv->Modified() ;
+        fCanv->Update() ;
+
+        if (fRadio[1]->GetState() != kButtonDown)
+            break;
+
+        fRadio[0]->SetState(kButtonDown);
+        fRadio[1]->SetState(kButtonUp);
+
+        break;
+
+    }
+    return kTRUE;
+}
Index: /tags/Mars_V0-4/Mars/mdatacheck/MGDisplayAdc.h
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MGDisplayAdc.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MGDisplayAdc.h	(revision 9634)
@@ -0,0 +1,91 @@
+#ifndef MGDISPLAYADC_H
+#define MGDISPLAYADC_H
+
+#ifndef ROOT_TFrame
+#include <TGFrame.h>    // TGTransientFrame
+#endif
+#ifndef ROOT_TGListBox
+#include <TGListBox.h>  // TGListBox
+#endif
+#ifndef ROOT_TGSlider
+#include <TGSlider.h>  // TGVSlider
+#endif
+
+#ifndef MHFADCCAM_H
+#include "MHFadcCam.h"
+#endif
+
+class TGTextButton;
+class TRootEmbeddedCanvas;
+class TCanvas;
+class TGRadioButton;
+
+class MGDisplayAdc : public TGTransientFrame {
+    private:
+	
+	MHFadcCam *fHists;		// Pointer to Container with the histograms
+	
+	// Create a main frame with a number of different buttons.
+	//   
+	TGCompositeFrame  *fFrameTop ;   // top part of the main window
+	TGCompositeFrame  *fFrameLow ;   // low part of the main window
+  
+	TGVerticalFrame   *fFT1, *fFT2, *fFT3 ;
+	
+	TGListBox         *fHistoList ;
+	TGTextButton      *fButtonPrev, *fButtonNext , *fButtonReset ;
+	
+	TRootEmbeddedCanvas  *fECanv , *fECanvLow;
+
+	TGTextButton   *fButtonSave, *fButtonPrint, *fButtonPrintAll, *fButtonClose ; 
+	
+	TCanvas            *fCanv ;	
+	
+	
+	//for sliders
+	
+	TGVSlider       *fVslider1;
+	
+        void  DrawHi(Int_t i)       { fHists->DrawHi(i); }
+        void  DrawLo(Int_t i)       { fHists->DrawLo(i); }
+        void  DrawSelectedHi()      { DrawHi( GetSelected()-1) ; }
+        void  DrawSelectedLo()      { DrawLo( GetSelected()-1) ; }
+        Int_t GetSelected()         { return fHistoList->GetSelected(); }
+        void  SelectSelected()      { fHistoList->Select(GetSelected()-1, kTRUE); }
+        void  SetSelectedTopEntry() { fHistoList->SetTopEntry(GetSelected()); }
+        void  SetSelectedPos()      { fVslider1->SetPosition( GetSelected()-1); }
+  
+    public:
+	
+	//for radio buttons
+
+	TGRadioButton *fRadio[3];
+
+	
+        Int_t    fHistoType;
+        Bool_t    fHistoLock; 
+	//
+			
+	
+	TGPicture *fPicture;  
+	TCanvas *fCanvas;
+	
+	MGDisplayAdc(MHFadcCam *fHists ,
+		     const TGWindow *p, const TGWindow *main, 
+		     UInt_t w, UInt_t h, 
+		     UInt_t options = kMainFrame | kVerticalFrame ) ;
+	
+	~MGDisplayAdc(); 
+  
+	void  CloseWindow()  ;
+       
+	
+	Bool_t BuildHistoList(Int_t type=1) ;
+	
+	Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+  
+} ; 
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mdatacheck/MShowSpect.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MShowSpect.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MShowSpect.cc	(revision 9634)
@@ -0,0 +1,84 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MShowSpect.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MParList.h"      // MParList
+#include "MGDisplayAdc.h"  // MGDisplayAdc
+
+
+////////////////////////////////////////////////////////////////////////
+//
+//  MGShowSpect.h
+//
+//  A Gui Task to show the raw ADC values in the histograms
+//
+
+ClassImp(MShowSpect)
+
+MShowSpect::MShowSpect(const char *nameHist, const char *name, const char *title)
+{
+    //
+    // default constructor
+    //
+
+    *fName  = name ? name : ClassName();
+    *fTitle = title ? title : "Task to ??? (Harald?)";
+
+    strcpy( fHistName, nameHist ) ;
+} 
+
+
+Bool_t MShowSpect::PreProcess(MParList *pList)
+{
+  //
+  //   Do the preprocessing for MShowSpect
+  // 
+  //   Connects Histogramms in the MHFadcCam container as the input
+  //
+
+  fHists = (MHFadcCam*) pList->FindObject( fHistName );
+  
+  if (!fHists)
+    {
+        *fLog << dbginf << " Error: MHFadcCam '" << fHistName << "' not found!" << endl;
+        return kFALSE;
+    }
+  
+  return kTRUE;
+} 
+
+
+Bool_t MShowSpect::PostProcess()
+{
+  //   just start the gui for displaying the adc spectra
+
+  new MGDisplayAdc(fHists, gClient->GetRoot(), gClient->GetRoot(), 600, 600);
+
+  return kTRUE;
+} 
+
Index: /tags/Mars_V0-4/Mars/mdatacheck/MShowSpect.h
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MShowSpect.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MShowSpect.h	(revision 9634)
@@ -0,0 +1,37 @@
+#ifndef MSHOWSPECT_H
+#define MSHOWSPECT_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MGDisplayAdc;
+class MHFadcCam;
+class MParList ;
+
+class MShowSpect : public MTask 
+{
+private:
+    char       fHistName[256] ;
+
+    MHFadcCam *fHists;		// Pointer to Container with the histograms
+  
+ public:
+  
+     MShowSpect(const char* histName,
+                const char *name=NULL, const char *title=NULL);
+  
+     Bool_t PreProcess(MParList * pList);
+     Bool_t PostProcess();
+
+     ClassDef(MShowSpect, 0)	// Fill the raw ADC in the histograms
+};
+
+#endif
+
+
+
Index: /tags/Mars_V0-4/Mars/mdatacheck/MViewAdcSpectra.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MViewAdcSpectra.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MViewAdcSpectra.cc	(revision 9634)
@@ -0,0 +1,124 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MViewAdcSpectra.h" 
+
+#include <iostream.h>
+
+#include "MParList.h"
+#include "MTaskList.h"
+#include "MEvtLoop.h"
+
+#include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
+#include "MRawEvtData.h"
+#include "MRawCrateArray.h"
+#include "MTime.h"
+
+#include "MReadTree.h" 
+#include "MDumpEvtHeader.h" 
+#include "MFillHFadc.h"
+#include "MShowSpect.h" 
+#include "MHFadcCam.h"
+
+MViewAdcSpectra::MViewAdcSpectra() 
+{
+  // default constructor  
+} 
+
+MViewAdcSpectra::~MViewAdcSpectra() 
+{
+    // default destructor
+    delete fHistosAdc;
+} 
+
+
+// ================================================================================
+Bool_t MViewAdcSpectra::AdcSpectra ( Char_t *inputfile, Char_t *treeName ) 
+{
+  //   This job reads in the FADC data from all events and fills
+  //   the spectrum for each pmt pixel.
+  //
+
+  cout << "PedAdcSpectra:: Analyse the tree " << treeName 
+       << "in the file  " << inputfile << endl ;
+  
+  // create a (empty) list of parameters which can be used by the tasks
+  // and an (empty) list of tasks which should be executed
+  // connect them in the required way. 
+ 
+  //
+  //   create the data containers for the raw data
+  //
+  MParList plist;
+  
+  MRawRunHeader runheader;
+  plist.AddToList(&runheader);
+
+  MRawEvtHeader evtheader;
+  plist.AddToList(&evtheader);
+  
+  MRawEvtData evtdata;
+  plist.AddToList(&evtdata);
+  
+  MRawCrateArray cratearray;
+  plist.AddToList(&cratearray);
+  
+  MTime evttime("MTime");
+  plist.AddToList(&evttime);
+
+  fHistosAdc= new MHFadcCam;
+  plist.AddToList( fHistosAdc ) ;
+
+  //
+  //    set up the tasks for this job
+  //
+  MTaskList tasks;
+  plist.AddToList(&tasks);
+
+  MReadTree readin ( treeName, inputfile ) ;
+  tasks.AddToList( &readin ) ;
+
+  //  MDumpEvtHeader *dumpheader = new MDumpEvtHeader() ; 
+  //  tasks->AddToList( dumpheader ) ; 
+ 
+  MFillHFadc fillspect;
+  tasks.AddToList( &fillspect ) ;
+
+  MShowSpect showspect( "MHFadcCam" ) ;
+  tasks.AddToList( &showspect ) ;
+
+  //    set up the loop for the processing 
+  
+  MEvtLoop magic;
+  magic.SetParList(&plist);
+
+  //    start the loop running 
+
+  magic.Eventloop() ; 
+  
+  return kTRUE ;
+
+} 
Index: /tags/Mars_V0-4/Mars/mdatacheck/MViewAdcSpectra.h
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/MViewAdcSpectra.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/MViewAdcSpectra.h	(revision 9634)
@@ -0,0 +1,31 @@
+#ifndef MVIEWADCSPECTRA_H
+#define MVIEWADCSPECTRA_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+class MHFadcCam;
+
+class MViewAdcSpectra {
+
+ private:
+
+     MHFadcCam *fHistosAdc;
+
+ public:
+  
+     MViewAdcSpectra() ;
+  
+     ~MViewAdcSpectra() ;
+  
+     Bool_t AdcSpectra( Char_t *inputFile , Char_t *treeName ) ;
+
+  //  Bool_t CrAdcSpectra ( Char_t *inputFile ) ; 
+
+  //  Bool_t PedTdcSpectra( Char_t *inputFile ) ; 
+  //  Bool_t CrTdcSpectra ( Char_t *inputFile ) ; 
+
+} ;
+
+#endif 
Index: /tags/Mars_V0-4/Mars/mdatacheck/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mdatacheck/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mdatacheck/Makefile	(revision 9634)
@@ -0,0 +1,50 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = DataCheck
+
+#
+# Library name to creatre
+#
+LIB   = mdatacheck.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../mraw -I../mhist
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MDumpEvtHeader.cc \
+	   MGDisplayAdc.cc \
+	   MShowSpect.cc \
+	   MViewAdcSpectra.cc 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/merpp.cc
===================================================================
--- /tags/Mars_V0-4/Mars/merpp.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/merpp.cc	(revision 9634)
@@ -0,0 +1,138 @@
+#include <TSystem.h>
+
+#include "MParList.h"
+#include "MTaskList.h"
+#include "MEvtLoop.h"
+
+#include "MRawFileRead.h"
+#include "MRawFileWrite.h"
+
+#include "MLog.h"
+#include "MTime.h"
+#include "MRawEvtData.h"
+#include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
+#include "MRawCrateArray.h"
+#include "MInputStreamID.h"
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+// This is an easy implementation of the Merging process                    //
+// (as compilable prog)                                                     //
+//                                                                          //
+// at the moment it reads a binary file ("rawtest.bin") which was written   //
+// in the DAQ raw format.                                                   //
+//                                                                          //
+// The data are stored in root container objects (classes derived from      //
+// TObject like MRawRunHeader)                                              //
+//                                                                          //
+// This containers are written to a root file ("rawtest.root")              //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+int main(const int argc, const char **argv)
+{
+    gLog << "==================================================" << endl ;
+    gLog << "                   MERPP v0.1" << endl;
+    gLog << "      MARS Merging and Preprocessing Program" << endl ;
+    gLog << "            Compiled on <" << __DATE__ << ">" << endl ;
+    gLog << "               Using ROOT v" << ROOTVER << endl ;
+    gLog << "==================================================" << endl ;
+    gLog << endl;
+
+    //
+    // check for the right usage of the program
+    //
+    if (argc<3 || argc>4)
+    {
+        gLog << "Sorry the usage is:" << endl;
+        gLog << "   merpp inputfile outputfile [compression level]" << endl << endl;
+        return -1;
+    }
+
+    //
+    // This is to make argv[i] more readable insidethe code
+    //
+    const char *kNamein   = argv[1];
+    const char *kNameout  = argv[2];
+    const int   kComprlvl = argc==4 ? atoi(argv[3]) : 9;
+
+    //
+    //     initialize ROOT  (this is obligatory here)
+    //
+    TROOT simple("Merpp","Mars - Merging and Preprocessing Program");
+
+    //
+    // check whether the given files are OK.
+    //
+    if (gSystem->AccessPathName(kNamein, kFileExists))
+    {
+        gLog << "Sorry, the file '" << kNamein << "' doesn't exist." << endl;
+        return -1;
+    }
+
+    if (!gSystem->AccessPathName(kNameout, kFileExists))
+        gLog << "Warning: The file '" << kNameout << "' exists." << endl;
+    else
+        if (!gSystem->AccessPathName(kNameout, kWritePermission))
+        {
+            gLog << "Sorry, you don't have write permission for '" << kNameout << "'." << endl;
+            return -1;
+        }
+
+    //
+    // create a (empty) list of parameters which can be used by the tasks
+    // and an (empty) list of tasks which should be executed
+    //
+    MParList plist;
+
+    MTaskList tasks;
+    plist.AddToList(&tasks);
+
+    MRawRunHeader runheader;
+    plist.AddToList(&runheader);
+
+    MRawEvtHeader evtheader;
+    plist.AddToList(&evtheader);
+
+    MRawEvtData evtdata;
+    plist.AddToList(&evtdata);
+
+    MRawCrateArray cratearray;
+    plist.AddToList(&cratearray);
+
+    MTime evttime("MRawEvtTime");
+    plist.AddToList(&evttime);
+
+    //
+    // create the tasks which should be executed and add them to the list
+    // in the case you don't need parameter containers, all of them can
+    // be created by MRawFileRead::PreProcess
+    //
+    MRawFileRead  reader(kNamein);
+    MRawFileWrite writer(kNameout, "RECREATE", "Title", kComprlvl);
+    tasks.AddToList(&reader);
+    tasks.AddToList(&writer);
+
+    //
+    // create the looping object and thell it about the parameters to use
+    // and the tasks to execute
+    //
+
+    MEvtLoop magic;
+
+    magic.SetParList(&plist);
+
+    //
+    // Start the eventloop which reads the raw file (MRawFileRead) and
+    // write all the information into a root file (MRawFileWrite)
+    //
+    // between reading and writing we can do, transformations, checks, etc.
+    // (I'm think of a task like MRawDataCheck)
+    //
+    magic.Eventloop();
+
+    return 0;
+}
+
+
Index: /tags/Mars_V0-4/Mars/meventdisp/EvtDispIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/meventdisp/EvtDispIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/meventdisp/EvtDispIncl.h	(revision 9634)
@@ -0,0 +1,25 @@
+#ifndef __CINT__
+#include "MParList.h"
+#include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
+#include "MTime.h"
+#include "MRawEvtData.h"
+#include "MRawCrateArray.h"
+#include "MReadTree.h"
+
+
+#include <TGButton.h>       // TGPictureButton
+#include <TGTab.h>          // TGTab
+#include <TGMenu.h>         // TGPopupMenu
+#include <TGMsgBox.h>       // TGMsgBox
+#include <TGListBox.h>      // TGListBox
+#include <TGListView.h>     // TGListBox
+#include <TGSplitter.h>     // TGHorizontal3DLine
+#include <TGSlider.h>       // TGVSlider
+#include <TGLabel.h>        // TGLabel
+#include <TRootEmbeddedCanvas.h>        // TGRootEmbeddedCanvas
+#include <TCanvas.h>        // TCanvas
+#include <TGTextEntry.h>
+
+#endif // __CINT__
+
Index: /tags/Mars_V0-4/Mars/meventdisp/EvtDispLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/meventdisp/EvtDispLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/meventdisp/EvtDispLinkDef.h	(revision 9634)
@@ -0,0 +1,9 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MGFadcDisp ;
+
+#endif
Index: /tags/Mars_V0-4/Mars/meventdisp/MGFadcDisp.cc
===================================================================
--- /tags/Mars_V0-4/Mars/meventdisp/MGFadcDisp.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/meventdisp/MGFadcDisp.cc	(revision 9634)
@@ -0,0 +1,473 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MGFadcDisp.h"
+
+#include <stdlib.h>
+#include <iostream.h>
+
+#include <TGButton.h>      // TGPictureButton
+#include <TGLabel.h>       // TGLabel
+#include <TGTab.h>         // TGTab
+#include <TGListBox.h>     // TGListBox
+#include <TGSlider.h>      // TGVSlider
+#include <TRootEmbeddedCanvas.h>      // TRootEmbeddedCanvas
+#include <TCanvas.h>
+#include <TGTextEntry.h>   
+#include <TGMsgBox.h>
+#include <TG3DLine.h>      // TGHorizontal3DLine
+                           // use TGSplitter instead for root<3.00
+
+
+#include "MParList.h"
+#include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
+#include "MTime.h"
+#include "MRawEvtData.h"
+#include "MRawCrateArray.h"
+#include "MReadTree.h"
+#include "MRawEvtPixelIter.h"
+
+ClassImp(MGFadcDisp)
+
+
+MGFadcDisp::MGFadcDisp(char *filename, char *treename, 
+		       const TGWindow *p, const TGWindow *main, 
+		       UInt_t w, UInt_t h ) 
+        : TGTransientFrame(p, main, w, h )  
+{
+  //   default constructor 
+
+  //   first connect the file with this Object
+
+    pList = new MParList();
+
+  fRunHeader = new MRawRunHeader();
+  pList->AddToList(fRunHeader);
+
+  fEvtHeader = new MRawEvtHeader();
+  pList->AddToList(fEvtHeader);
+  fEvtTime   = new MTime();
+  pList->AddToList(fEvtTime);
+  fEvtData   = new MRawEvtData();
+  pList->AddToList(fEvtData);
+  fEvtCrate  = new MRawCrateArray();
+  pList->AddToList(fEvtCrate);
+
+  
+  fReadTree  =  new MReadTree ( treename, filename ) ;
+  fReadTree->PreProcess( pList ) ; 
+
+  //
+  //   the top part of the window
+  //
+  fFrameTop = new TGVerticalFrame (this, 300, 100 ) ; 
+
+  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+  
+  fLabelFile = new TGLabel(fTop1, new TGString("File:") );
+  fTop1->AddFrame( fLabelFile, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fNameFile = new TGLabel(fTop1, new TGString( filename ) );
+  fTop1->AddFrame( fNameFile, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fLabelTree = new TGLabel(fTop1, new TGString("Tree:") );
+  fTop1->AddFrame( fLabelTree, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fNameTree = new TGLabel(fTop1, new TGString( treename ) );
+  fTop1->AddFrame( fNameTree, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ;
+
+  fFrameTop->AddFrame(fTop1,new TGLayoutHints (kLHintsTop ) ) ; 
+
+  fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+  
+  fButtonPrevEvt = new TGTextButton (fTop2, "<< Previous Event", M_PREVEVT ) ;
+  fButtonPrevEvt->Associate(this) ; 
+  fTop2->AddFrame (fButtonPrevEvt, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10  ) ) ; 
+  
+  fLabelEvtNr = new TGLabel(fTop2, new TGString("Event: ") );
+  fTop2->AddFrame( fLabelEvtNr, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fTxtEvtNr = new TGTextEntry(fTop2, fTxtBufEvtNr = new TGTextBuffer(100), M_EVTNUMBER);
+  fTxtEvtNr->Resize(60, fTxtEvtNr->GetDefaultHeight());
+  fTxtEvtNr->Associate(this) ; 
+  fTop2->AddFrame(fTxtEvtNr, new TGLayoutHints(kLHintsTop | kLHintsLeft,
+                                                       5, 5, 5, 5)); 
+
+  char wortdummy[100] ; 
+  sprintf (wortdummy, "out of %d Events", fReadTree->GetEntries() ) ; 
+  fLabelTotNr = new TGLabel(fTop2, new TGString( wortdummy ) );
+  fTop2->AddFrame( fLabelTotNr, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+  
+  fButtonNextEvt = new TGTextButton (fTop2, "Next Event >>", M_NEXTEVT ) ; 
+  fButtonNextEvt->Associate(this) ; 
+  fTop2->AddFrame (fButtonNextEvt, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10  ) ) ; 
+
+  
+  fFrameTop->AddFrame(fTop2,new TGLayoutHints ( kLHintsCenterX ) ) ; 
+
+  
+
+  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop | kLHintsCenterX ) ) ;   
+  
+  //   a line between top and mid frame
+
+  fLineSep1 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+  //
+  //   the middle part of the window
+  //
+  
+  fFrameMid = new TGHorizontalFrame (this, 300, 100 ) ; 
+  
+  //   the left part is the control tab enviroment
+  
+  fTabControl = new TGTab(fFrameMid, 300, 300);
+  TGCompositeFrame *tControl = fTabControl->AddTab("PixelList");     
+  tControl->ChangeOptions ( kHorizontalFrame ) ; 
+
+
+  fPixelList = new TGListBox(tControl, M_PIXELLIST ) ; 
+  fPixelList->Associate(this) ; 
+  tControl->AddFrame(fPixelList, new TGLayoutHints(kLHintsExpandY | kLHintsLeft, 5, 5, 5, 5 ) ) ; 
+  fPixelList->Resize(80, 230 ) ;
+
+  fMid1 = new TGVerticalFrame (tControl, 300, 100 ) ; 
+  
+  
+  fButtonPrevPix = new TGTextButton (fMid1, "<< Prev Pixel", 9999 ) ; 
+  fMid1->AddFrame(fButtonPrevPix, new TGLayoutHints(kLHintsRight) ) ; 
+
+  fPixSlider = new TGVSlider (fMid1, 200, kSlider1 | kScaleBoth, 9999 );
+  fPixSlider->Associate(this);
+  fPixSlider->SetRange(0, 576);
+  fMid1->AddFrame(fPixSlider, new TGLayoutHints(kLHintsCenterX | kLHintsExpandY));
+  
+  fButtonNextPix = new TGTextButton (fMid1, "Next Pixel >>", 9999 ) ; 
+  fMid1->AddFrame(fButtonNextPix, new TGLayoutHints(kLHintsRight) ) ; 
+
+  tControl->AddFrame(fMid1, new TGLayoutHints(kLHintsRight | kLHintsExpandY, 5, 5, 5, 5)) ; 
+  
+  fFrameMid-> AddFrame(fTabControl, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY, 10, 10, 10 ,10 ) );  
+
+  //   the right part is the display tab enviroment
+  
+  fTabDisplay = new TGTab(fFrameMid, 300, 300);
+  TGCompositeFrame *tDisplay = fTabDisplay->AddTab("Digital Scope");     
+
+  fECanDigScope = new TRootEmbeddedCanvas("fECanDigScope", tDisplay, 400, 400 ) ;
+  tDisplay->AddFrame( fECanDigScope, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY ) ) ; 
+
+  fCan = fECanDigScope->GetCanvas() ;
+        
+
+  fFrameMid-> AddFrame(fTabDisplay, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY | kLHintsExpandX  , 10, 10, 10 ,10 ) );  
+  
+  
+  AddFrame(fFrameMid, new TGLayoutHints (kLHintsExpandY | kLHintsExpandX ) ) ;   
+
+  //   a line between mid and low frame
+  
+  fLineSep2 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+   //   the low part of the window
+  //
+  fFrameLow = new TGHorizontalFrame (this, 300, 100 ) ; 
+ 
+  
+  fButtonPrint = new TGTextButton(fFrameLow, "Print", M_PRINT) ; 
+  fButtonPrint->Associate(this) ; 
+  fFrameLow->AddFrame( fButtonPrint, new TGLayoutHints(kLHintsLeft , 10, 10, 10, 10 ) )  ; 
+
+  fButtonClose = new TGTextButton(fFrameLow, "Close", M_CLOSE) ; 
+  fButtonClose->Associate(this) ; 
+  fFrameLow->AddFrame( fButtonClose, new TGLayoutHints(kLHintsLeft, 10, 10, 10, 10 ) )  ; 
+
+ 
+  AddFrame(fFrameLow, new TGLayoutHints (kLHintsTop ) ) ;   
+
+  //
+  //   Map the window, set up the layout, etc. 
+  //
+  SetWMSizeHints(450, 400, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
+
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("FadcDisplay");
+  SetIconName("FadcDisp");
+  
+  MapWindow();
+
+  //
+  //   fReadTree the first event and update the window
+  //
+  fReadTree->GetEvent() ; 
+  CreatePixelList() ; 
+  UpdateEventCounter() ; 
+
+}
+
+
+MGFadcDisp::~MGFadcDisp()
+{
+  // close the file 
+
+  fReadTree->PostProcess() ; 
+
+  delete  fRunHeader ; 
+  delete  fEvtHeader ;
+  delete  fEvtTime   ;
+  delete  fEvtData ; 
+  delete  fEvtCrate  ; 
+
+  delete  pList ;
+
+  delete  fReadTree ; 
+
+  //   destruct the graphical members  
+
+  delete  fButtonPrint ; 
+  delete  fButtonClose ; 
+ 
+  //  delete  fCan ; 
+  delete  fECanDigScope ; 
+  delete  fTabDisplay ; 
+ 
+  delete  fPixSlider ; 
+  delete  fButtonPrevPix ; 
+  delete  fButtonNextPix ; 
+  delete  fMid1 ; 
+  delete  fPixelList; 
+  delete  fTabControl  ; 
+ 
+  delete  fLabelEvtNr ; 
+  delete  fLabelTotNr ; 
+  //delete  fTxtBufEvtNr ; 
+  delete  fTxtEvtNr ; 
+  delete  fButtonNextEvt ; 
+  delete  fButtonPrevEvt ; 
+  delete  fLabelTree ; 
+  delete  fNameTree ; 
+  delete  fNameFile ; 
+  delete  fLabelFile ; 
+  delete  fTop2 ; 
+  delete  fTop1 ; 
+  
+  delete  fFrameLow ; 
+  delete  fLineSep2 ; 
+  delete  fFrameMid ; 
+  delete  fLineSep1 ; 
+  delete  fFrameTop ; 
+}
+
+
+void MGFadcDisp::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+    delete this ;
+}
+       
+
+void MGFadcDisp::CreatePixelList(Int_t lastsel)
+{
+    //
+    //   after a new event is read in one has to update
+    //   the list of pixels in the fPixelList (TGListBox)
+    //
+
+    //
+    //   put the selection of the last event in memory
+    //
+    MRawEvtPixelIter pixel(fEvtData);
+    while (pixel.Next())
+    {
+        char wortdummy[100] ;
+        sprintf(wortdummy, "%d", pixel.GetPixelId());
+        fPixelList->AddEntry(wortdummy, pixel.GetPixelId());
+    }
+
+    fPixelList->MapSubwindows();
+    fPixelList->Layout();
+
+    //
+    // check if the pixel from last event also occurs in this event
+    //
+    fCan->Clear() ;
+    fCan->cd() ;
+
+    if (lastsel<0 || !pixel.Jump(lastsel))
+    {
+        pixel.Reset();
+        lastsel=pixel.GetPixelId();
+
+    }
+
+    char wortdummy[100] ;
+    sprintf(wortdummy, "GRAPH%d", lastsel);
+    fEvtData->Draw(wortdummy);
+    fPixelList->Select(lastsel, kTRUE);
+
+    fCan->Modified();
+    fCan->Update();
+}
+
+void MGFadcDisp::UpdateEventCounter() 
+{
+  //     Update the event counter 
+  
+  char wortdummy[256] ; 
+    
+  sprintf (wortdummy, "%d", fReadTree->GetEventNum() )  ; 
+  
+  fTxtEvtNr->SetText(wortdummy) ; 
+}
+
+void MGFadcDisp::ReadinEvent(UInt_t iEvt)
+{
+    Int_t buttons = 4;
+    Int_t retval = 0 ;
+
+    //  first check if the new event is in the range of possible events
+  
+    if ( iEvt >= fReadTree->GetEntries() )
+    {
+        new TGMsgBox(fClient->GetRoot(), this,
+                     "WARNING!",
+                     "The event number is out of range!!!",
+                     kMBIconExclamation, buttons, &retval);
+    }
+    else
+    {
+        const Int_t lastsel = fPixelList->GetSelected();
+
+        fPixelList->RemoveEntries(0, fEvtData->GetNumPixels());
+
+        fReadTree->SetEventNum(iEvt);
+        fReadTree->GetEvent();
+
+        CreatePixelList(lastsel);
+    }
+
+    UpdateEventCounter();
+}
+
+Bool_t MGFadcDisp::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2) 
+{
+  //------------------------------------------------------------------
+  //
+  //    ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+  //
+  // Processes information from all GUI items.
+  // Selecting an item usually generates an event with 4 parameters.
+  // The first two are packed into msg (first and second bytes).
+  // The other two are parm1 and parm2.
+  //
+  //------------------------------------------------------------------
+  char wortdummy[256] ; 
+  Int_t   buttons = 4, retval = 0 ;
+
+  switch(GET_MSG(msg)) 
+    {
+    case kC_COMMAND:
+    
+      switch(GET_SUBMSG(msg)) 
+	{
+	  
+	case kCM_BUTTON:
+	  
+	  switch (parm1)
+	    {
+	    case M_PREVEVT:
+	      ReadinEvent(fReadTree->GetEventNum()-1 ) ; 
+	      break; 
+	      
+	    case M_NEXTEVT:
+	      ReadinEvent(fReadTree->GetEventNum()+1 ) ; 
+	      break; 
+
+
+	    case M_PRINT:
+	      new TGMsgBox(fClient->GetRoot(), this,
+			   "INFORMATION!",
+			   "Your are invited to program that!!",
+			   kMBIconExclamation, buttons, &retval); 
+	      
+              break ;
+
+	    case M_CLOSE:
+	      CloseWindow() ; 
+	      break; 
+
+	    }
+	  
+	case kCM_LISTBOX:
+	  switch (parm1) 
+	    {
+	    case M_PIXELLIST:
+	      sprintf(wortdummy, "GRAPH%d", fPixelList->GetSelected());
+
+	      fCan->Clear() ;
+	      fCan->cd() ; 
+
+	      fEvtData->Draw(wortdummy) ; 
+	      
+	      fCan->Modified() ; 
+	      fCan->Update() ; 
+	      break; 
+	    }
+	  break; 
+	  
+	}
+    
+    case kC_TEXTENTRY:
+      
+      switch(GET_SUBMSG(msg)) 
+	{
+	case kTE_TEXTCHANGED:
+            break ;
+
+        case kTE_ENTER:
+            {
+                const char *txt = fTxtEvtNr->GetText();
+                ReadinEvent(atoi(txt));
+            }
+	  break; 
+	}
+      break; 
+      
+    default:
+      break;     
+    }
+
+  return kTRUE ; 
+}
Index: /tags/Mars_V0-4/Mars/meventdisp/MGFadcDisp.h
===================================================================
--- /tags/Mars_V0-4/Mars/meventdisp/MGFadcDisp.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/meventdisp/MGFadcDisp.h	(revision 9634)
@@ -0,0 +1,125 @@
+#ifndef MGFADCDISP_H
+#define MGFADCDISP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+class MParList ; 
+class MRawRunHeader ; 
+class MRawEvtHeader ; 
+class MTime ; 
+class MRawEvtData ; 
+class MRawCrateArray ; 
+
+class MReadTree ; 
+
+class TGHorizontal3DLine;
+class TGLabel ; 
+class TGTextButton ; 
+class TGTab ; 
+class TGListBox ; 
+class TGVSlider; 
+class TRootEmbeddedCanvas ; 
+class TCanvas ; 
+class TGTextEntry ; 
+class TGTextBuffer ; 
+
+enum MGFadcDispCommand {
+  
+  M_PIXELLIST = 4201 , 
+  M_PREVEVT, 
+  M_NEXTEVT,
+  M_EVTNUMBER, 
+
+  M_PREVPIXEL, 
+  M_NEXTPIXEL, 
+
+  M_PRINT, 
+  M_CLOSE 
+  
+
+}; 
+
+//
+//
+
+class MGFadcDisp : public TGTransientFrame {
+
+ private: 
+
+  //
+  //     members to read in the file
+  //
+
+  MParList       *pList ;
+  MRawRunHeader  *fRunHeader ;
+  MRawEvtHeader  *fEvtHeader ;
+  MTime          *fEvtTime   ;
+  MRawEvtData    *fEvtData    ;
+  MRawCrateArray *fEvtCrate  ;
+
+  MReadTree *fReadTree ;
+  
+  //
+  //     members for the gui 
+  // 
+  
+  //    divide the whole frame in three subframes
+  
+  TGVerticalFrame    *fFrameTop ; 
+  TGHorizontalFrame  *fFrameMid, *fFrameLow ; 
+  TGHorizontal3DLine *fLineSep1, *fLineSep2 ;
+
+  //    members in the top frame
+
+  TGHorizontalFrame  *fTop1, *fTop2 ; 
+  TGLabel       *fLabelFile, *fNameFile,  *fLabelTree, *fNameTree ; 
+  TGTextButton  *fButtonPrevEvt, *fButtonNextEvt ; 
+  TGLabel       *fLabelEvtNr, *fLabelTotNr ; 
+  TGTextEntry          *fTxtEvtNr ;
+  TGTextBuffer         *fTxtBufEvtNr ; //!  no output for this member  
+                                       //   neccessary to compile  H.K.
+
+  //    members in the mid frame
+  
+  TGTab            *fTabControl ; 
+  TGListBox        *fPixelList  ; 
+  TGVerticalFrame  *fMid1 ; 
+  TGTextButton     *fButtonPrevPix, *fButtonNextPix ; 
+  TGVSlider        *fPixSlider ; 
+  
+  TGTab   *fTabDisplay ; 
+  TRootEmbeddedCanvas  *fECanDigScope ; 
+
+  TCanvas               *fCan ;
+  
+  //    members in the low frame
+
+  TGTextButton  *fButtonPrint, *fButtonClose ; 
+
+ public:
+  
+  MGFadcDisp(char *filename, char *treename, 
+	     const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h ) ; 
+
+  ~MGFadcDisp()  ; 
+
+  void CloseWindow() ; 
+
+  void CreatePixelList(Int_t lastsel=-1) ;
+  void UpdateEventCounter() ; 
+  void ReadinEvent(UInt_t iEvt) ;
+
+  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+ 
+  ClassDef(MGFadcDisp, 0)
+}; 
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/meventdisp/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/meventdisp/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/meventdisp/Makefile	(revision 9634)
@@ -0,0 +1,47 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = EvtDisp
+
+#
+# Library name to creatre
+#
+LIB   = meventdisp.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../mraw
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MGFadcDisp.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mfilter/FilterIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mfilter/FilterIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mfilter/FilterIncl.h	(revision 9634)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mfilter/FilterLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mfilter/FilterLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mfilter/FilterLinkDef.h	(revision 9634)
@@ -0,0 +1,9 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MFTriggerLvl1;
+
+#endif
Index: /tags/Mars_V0-4/Mars/mfilter/MFTriggerLvl1.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mfilter/MFTriggerLvl1.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mfilter/MFTriggerLvl1.cc	(revision 9634)
@@ -0,0 +1,107 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  07/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+//   MFTriggerLvl1                                                         //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MFTriggerLvl1.h"
+
+#include "MParList.h"
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MMcTrig.hxx"
+
+ClassImp(MFTriggerLvl1);
+
+
+// --------------------------------------------------------------------------
+//
+MFTriggerLvl1::MFTriggerLvl1(const char *cname, const char type, const Int_t val) : fMcTrig(NULL)
+{
+    fContName = cname;
+}
+
+// --------------------------------------------------------------------------
+//
+MFTriggerLvl1::MFTriggerLvl1(const MMcTrig *mctrig, const char type, const Int_t val) : fMcTrig(mctrig)
+{
+}
+
+// --------------------------------------------------------------------------
+//
+void MFTriggerLvl1::Init(const char type, const Int_t val)
+{
+    fFilterType = (type=='<' ? kELowerThan : kEGreaterThan);
+
+    if (type!='<' && type!='>')
+        *fLog << dbginf << "Warning: Neither '<' nor '>' specified... using '>'." << endl;
+
+    fValue = val;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFTriggerLvl1::IsExpressionTrue() const
+{
+    return fResult;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFTriggerLvl1::PreProcess(MParList *pList)
+{
+    if (fMcTrig)
+        return kTRUE;
+
+    fMcTrig = (MMcTrig*)pList->FindObject(fContName);
+    if (fMcTrig)
+        return kTRUE;
+
+    *fLog << dbginf << fContName << " [MMcTrig] not found... aborting." << endl;
+        return kFALSE;
+}
+
+// --------------------------------------------------------------------------
+//
+Bool_t MFTriggerLvl1::Process()
+{
+    const Int_t lvl1 = fMcTrig->GetFirstLevel();
+
+    switch (fFilterType)
+    {
+    case kELowerThan:
+        fResult = (lvl1 < fValue);
+        break;
+    case kEGreaterThan:
+        fResult = (lvl1 > fValue);
+        break;
+    }
+
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/mfilter/MFTriggerLvl1.h
===================================================================
--- /tags/Mars_V0-4/Mars/mfilter/MFTriggerLvl1.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mfilter/MFTriggerLvl1.h	(revision 9634)
@@ -0,0 +1,42 @@
+#ifndef MFTRIGGERLVL1_H
+#define MFTRIGGERLVL1_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MFTriggerLvl1                                                           //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MFILTER_H
+#include "MFilter.h"
+#endif
+
+class MMcTrig;
+class MParList;
+
+class MFTriggerLvl1 : public MFilter
+{
+private:
+    const MMcTrig *fMcTrig;
+    TString fContName;
+
+    typedef enum { kELowerThan, kEGreaterThan } FilterType_t;
+    FilterType_t fFilterType;
+
+    Bool_t fResult;
+    Int_t  fValue;
+
+    void Init(const char type, const Int_t val);
+
+public:
+    MFTriggerLvl1(const char *cname="MMcTrig", const char type='>', const Int_t val=0);
+    MFTriggerLvl1(const MMcTrig *mctrig,       const char type='>', const Int_t val=0);
+
+    Bool_t IsExpressionTrue() const;
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MFTriggerLvl1, 0)		// 
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mfilter/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mfilter/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mfilter/Makefile	(revision 9634)
@@ -0,0 +1,50 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+# @endcode 
+
+INCLUDES = -I. -I../mbase -I../mmc
+
+# @code 
+
+CINT     = Filter
+LIB      = mfilter.a
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MFTriggerLvl1.cc 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mgui/GuiIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/GuiIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/GuiIncl.h	(revision 9634)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mgui/GuiLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/GuiLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/GuiLinkDef.h	(revision 9634)
@@ -0,0 +1,16 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MHexagon;
+
+#pragma link C++ class MGeomPix;
+#pragma link C++ class MGeomCam;
+#pragma link C++ class MGeomCamCT1;
+#pragma link C++ class MGeomCamMagic;
+
+#pragma link C++ class MCamDisplay;
+
+#endif
Index: /tags/Mars_V0-4/Mars/mgui/MCamDisplay.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MCamDisplay.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MCamDisplay.cc	(revision 9634)
@@ -0,0 +1,262 @@
+#include "MCamDisplay.h"
+
+#include <math.h>
+
+#include <TClonesArray.h>
+#include <TCanvas.h>
+#include <TStyle.h>
+#include <TBox.h>
+#include <TText.h>
+
+#include "MHexagon.h"
+#include "MGeomCam.h"
+
+#include "MCerPhotEvt.h" 
+
+#define kITEMS_LEGEND 25
+
+ClassImp(MCamDisplay)
+
+MCamDisplay::MCamDisplay (MGeomCam *geom) : fAutoScale(kTRUE)
+{ 
+    // default constructor
+
+    //
+    //    set the color palette
+    //
+    gStyle->SetPalette(1,0) ;
+
+    //
+    //  create the hexagons of the display
+    //
+    fNumPixels = geom->GetNumPixels() ;
+    fPixels    = new TClonesArray("MHexagon", fNumPixels ) ;
+
+    for (UInt_t i=0; i< fNumPixels; i++ )
+        (*fPixels)[i] = new MHexagon((*geom)[i]) ;
+
+    //
+    // set the range to default
+    //
+    fMinPhe  = -2.  ;
+    fMaxPhe  = 50. ;
+
+    //
+    // set up the Legend
+    //
+    fLegend  = new TClonesArray("TBox",  kITEMS_LEGEND ) ;
+    fLegText = new TClonesArray("TText", kITEMS_LEGEND ) ;
+
+    char text[10] ;
+    for ( Int_t il = 0 ; il < kITEMS_LEGEND ; il++ )
+    {
+        const Int_t y = il*40;
+
+        TBox  *newbox = new TBox (650, y-500, 700, y-460 );
+        TText *newtxt = new TText(720, y-480, text );
+
+        const Float_t lvl = 50. / kITEMS_LEGEND * il;
+
+        newbox->SetFillColor( GetColor(lvl) );
+
+        sprintf ( text, "%5.1f", lvl ) ;
+
+        newtxt->SetTextSize (0.025) ;
+        newtxt->SetTextAlign(12) ;
+
+        (*fLegend) [il] = newbox;
+        (*fLegText)[il] = newtxt;
+    }
+}
+
+MCamDisplay::~MCamDisplay() 
+{ 
+    delete fPixels ;
+}
+
+
+void MCamDisplay::Init() 
+{ 
+    //
+    // Set the right colors
+    //
+    gStyle->SetPalette(1, 0) ;
+
+    //
+    // if no canvas is yet existing to draw into, create a new one
+    //
+    if (!gPad) new TCanvas("display", "MAGIC display", 0, 0, 650, 500);
+
+    //
+    // draw all pixels of the camera
+    //
+    for (UInt_t i=0; i<fNumPixels; i++)
+        (*this)[i].Draw();
+
+    //
+    // draw legend
+    //
+    for (Int_t i=0; i<kITEMS_LEGEND; i++)
+    {
+        GetBox(i)->Draw();
+        GetText(i)->Draw();
+    }
+} 
+
+
+void MCamDisplay::Draw(Option_t *option  ) 
+{
+  // 
+
+    //
+    //  check if there a pad exists, if not create one
+    //
+    if ( !gPad ) Init() ;
+
+    //
+    // set init values
+    //
+    gPad->Range (-600, -600, 900, 600) ;
+    gPad->SetFillColor(22) ;
+
+    //
+    // mark pad as modified and update screen
+    //
+    gPad->Modified() ;
+    gPad->Update() ;
+}  
+
+void MCamDisplay::DrawPhotNum( MCerPhotEvt *event)
+{
+
+    //
+    // loop over all pixels in the MCerPhotEvt and
+    // determine the Pixel Id and the content
+    //
+    Reset() ;
+
+    //
+    //  if the autoscale is true, set the values for the range for
+    //  each event
+    //
+    if ( fAutoScale )
+    {
+        fMinPhe = event->GetNumPhotonsMin() ;
+        fMaxPhe = event->GetNumPhotonsMax() ;
+
+        if (fMaxPhe < 20.)
+            fMaxPhe = 20. ;
+
+        UpdateLegend() ;
+    }
+
+    //
+    //   update the colors in the picture
+    //
+    const Int_t entries = event->GetNumPixels();
+
+    for (Int_t i=0 ; i<entries; i++ )
+    {
+        MCerPhotPix &pix = (*event)[i];
+
+        if (!pix.IsPixelUsed())
+            continue;
+
+        SetPixColor(pix);
+    }
+
+    //
+    // update the picture
+    //
+    Draw() ;
+}  
+
+void MCamDisplay::DrawPhotErr( MCerPhotEvt *event)
+{
+    //
+    // reset the all pixel colors to a default value
+    //
+    Reset() ;
+
+    //
+    // loop over all pixels in the MCerPhotEvt and
+    // determine the Pixel Id and the content
+    //
+    const Int_t entries = event->GetNumPixels() ;
+
+    for (Int_t i=0 ; i<entries; i++ )
+    {
+        MCerPhotPix &pix = (*event)[i];
+
+        SetPixColor(pix);
+    }
+
+    //
+    // update display
+    //
+    Draw() ;
+}  
+
+
+void MCamDisplay::Reset() 
+{
+    //
+    // reset the all pixel colors to a default value
+    //
+    for ( UInt_t i=0 ; i< fNumPixels ; i++ )
+        (*this)[i].SetFillColor(10) ;
+} 
+
+Int_t MCamDisplay::GetColor(Float_t val)
+{
+    //
+    //   Here we calculate the color index for the current value.
+    //   The color index is defined with the class TStyle and the
+    //   Color palette inside. We use the command gStyle->SetPalette(1,0)
+    //   for the display. So we have to convert the value "wert" into
+    //   a color index that fits the color palette.
+    //   The range of the color palette is defined by the values fMinPhe
+    //   and fMaxRange. Between this values we have 50 color index, starting
+    //   with 0 up to 49.
+    //
+
+    //
+    //   first treat the over- and under-flows
+    //
+    const Float_t maxcolidx = 49.0;
+
+    if (val >= fMaxPhe )
+        return gStyle->GetColorPalette(maxcolidx);
+
+    if (val <= fMinPhe )
+        return gStyle->GetColorPalette( 0 );
+
+    //
+    // calculate the color index
+    //
+    const Float_t ratio  = (val-fMinPhe) / (fMaxPhe-fMinPhe);
+    const Int_t   colidx = (Int_t)(maxcolidx*ratio + .5) ;
+
+    return gStyle->GetColorPalette(colidx) ;
+}
+
+void MCamDisplay::UpdateLegend() 
+{
+    //
+    //    change the text on the legend according to the range of the
+    //    Display
+    //
+
+    char text[10] ;
+
+    for (Int_t il=0; il < kITEMS_LEGEND; il++)
+    {
+        const Float_t val = fMinPhe + (Float_t)il/kITEMS_LEGEND * (fMaxPhe-fMinPhe) ;
+
+        sprintf(text, "%5.1f", val);
+
+        TText &txt = *GetText(il);
+
+        txt.SetText(txt.GetX(), txt.GetY(), text) ;
+    }
+}
Index: /tags/Mars_V0-4/Mars/mgui/MCamDisplay.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MCamDisplay.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MCamDisplay.h	(revision 9634)
@@ -0,0 +1,78 @@
+#ifndef MCAMDISPLAY_H
+#define MCAMDISPLAY_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef MHEXAGON_H
+#include "MHexagon.h"
+#endif
+#ifndef MCERPHOTPIX_H
+#include "MCerPhotPix.h"
+#endif
+#ifndef MCERPHOTEVT_H
+#include "MCerPhotEvt.h"
+#endif
+#ifndef ROOT_TClonesArray
+#include <TClonesArray.h>
+#endif
+
+class TBox;
+class TText;
+class TClonesArray;
+
+class MCerPhotEvt;
+class MGeomCam;
+
+class MCamDisplay : public TObject
+{
+ private: 
+     Bool_t         fAutoScale;   //  indicating the autoscale function
+
+     UInt_t         fNumPixels;
+     TClonesArray  *fPixels ;
+
+     Float_t        fMinPhe;      //  The minimal number of Phe
+     Float_t        fMaxPhe;      //  The maximum number of Phe
+
+     TClonesArray  *fLegend;
+     TClonesArray  *fLegText;
+
+     TBox *GetBox(Int_t i)   { return (TBox*) fLegend->At(i); }
+     TText *GetText(Int_t i) { return (TText*)fLegText->At(i); }
+
+     void SetPixColor(MCerPhotPix &pix)
+     {
+         (*this)[pix.GetPixId()].SetFillColor( GetColor(pix.GetNumPhotons()));
+     }
+
+public:
+
+    MCamDisplay (MGeomCam *geom);
+
+    ~MCamDisplay ();
+
+    void Init();
+
+    void Draw(Option_t *option = "" );
+
+    void DrawPhotNum( MCerPhotEvt *event);
+    void DrawPhotErr( MCerPhotEvt *event);
+
+    void Reset();
+
+    MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
+
+    Int_t GetColor( Float_t wert );
+
+    void UpdateLegend();
+
+    void SetAutoScale (Bool_t input = kTRUE )
+    {
+        fAutoScale = input;
+    }
+
+    ClassDef(MCamDisplay, 0) // Display the magic camera
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mgui/MGeomCam.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomCam.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomCam.cc	(revision 9634)
@@ -0,0 +1,75 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MGeomCam.h"
+
+#include "MLog.h"
+#include "MHexagon.h"
+
+ClassImp(MGeomCam)
+
+MGeomCam::MGeomCam(UInt_t npix, const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MGeomCam";
+    *fTitle = title ? title : "Storage container for  a camera geometry";
+
+    fNumPixels = npix;
+    fPixels    = new TObjArray(npix);
+
+    //
+    // make sure that the destructor delete all contained objects
+    //
+    fPixels->SetOwner();
+
+    for (UInt_t i=0; i<npix; i++)
+        (*fPixels)[i] = new MGeomPix;
+}
+
+void MGeomCam::Draw( Option_t * )
+{
+    //
+    // Draw the Camera
+    //
+    for (UInt_t i=0; i<fNumPixels; i++)
+    {
+        MHexagon *el = new MHexagon((*this)[i]);
+        el->Draw();
+    }
+}
+
+void MGeomCam::Print(Option_t *)
+{
+    //
+    //   Print Information about the Geometry of the camera
+    //
+    *fLog << " Number of Pixels: " << fNumPixels << endl ;
+
+    for (UInt_t i=0; i<fNumPixels; i++ )
+    {
+        *fLog << " Pixel: " << i << "  ";
+        (*this)[i].Print() ;
+    }
+} 
+
Index: /tags/Mars_V0-4/Mars/mgui/MGeomCam.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomCam.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomCam.h	(revision 9634)
@@ -0,0 +1,42 @@
+#ifndef MGEOMCAM_H
+#define MGEOMCAM_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+#ifndef MGEOMPIX_H
+#include "MGeomPix.h"
+#endif
+
+class MGeomCam : public MParContainer
+{
+private:
+    UInt_t     fNumPixels;  // Number of pixels in this camera
+    TObjArray *fPixels;     // Array of singel pixels storing the geometry
+
+public:
+
+    MGeomCam(UInt_t npix, const char *name=NULL, const char *title=NULL);
+
+    virtual ~MGeomCam() { delete fPixels; }
+
+    virtual void Draw(Option_t *option = "" );
+
+    UInt_t GetNumPixels() const { return fNumPixels; }
+
+    MGeomPix &operator[](Int_t i)       { return *(MGeomPix*)fPixels->At(i); }
+    MGeomPix &operator[](Int_t i) const { return *(MGeomPix*)fPixels->At(i); }
+
+    virtual void Print(Option_t *opt=NULL);
+
+    ClassDef(MGeomCam, 1)		// Geometry base class for the camera
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mgui/MGeomCamCT1.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomCamCT1.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomCamCT1.cc	(revision 9634)
@@ -0,0 +1,246 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MGeomCamCT1.h"
+
+
+#include <math.h>     // floor
+#include "TCanvas.h"
+
+#include "MLog.h"
+
+ClassImp(MGeomCamCT1)
+
+MGeomCamCT1::MGeomCamCT1(const char *name) : MGeomCam(127, name, "Geometry information of CT1 camera")
+{
+    CreateCam();
+    CreateNN();
+} 
+
+void MGeomCamCT1::Draw( Option_t * )
+{ 
+    TCanvas *can = new TCanvas("cam", "Camera Geometry", 4 ) ;
+
+    can->Range(-175, -175, 175, 175 ) ;
+
+    MGeomCam::Draw();
+} 
+
+
+void MGeomCamCT1::CreateNN()
+{ 
+    const Short_t nn[127][6] = {       // Neighbors of #
+      {  1,   2,   3,   4,   5,   6},  // 0
+      {  0,   2,   6,   7,   8,  18},
+      {  0,   1,   3,   8,   9,  10},
+      {  0,   2,   4,  10,  11,  12},
+      {  0,   3,   5,  12,  13,  14},
+      {  0,   4,   6,  14,  15,  16},
+      {  0,   1,   5,  16,  17,  18},
+      {  1,   8,  18,  19,  20,  36},
+      {  1,   2,   7,   9,  20,  21},
+      {  2,   8,  10,  21,  22,  23},  // 10
+      {  2,   3,   9,  11,  23,  24},
+      {  3,  10,  12,  24,  25,  26},
+      {  3,   4,  11,  13,  26,  27},
+      {  4,  12,  14,  27,  28,  29},
+      {  4,   5,  13,  15,  29,  30},
+      {  5,  14,  16,  30,  31,  32},
+      {  5,   6,  15,  17,  32,  33},
+      {  6,  16,  18,  33,  34,  35},
+      {  1,   6,   7,  17,  35,  36},
+      {  7,  20,  36,  37,  38,  60},  // 20
+      {  7,   8,  19,  21,  38,  39},
+      {  8,   9,  20,  22,  39,  40},
+      {  9,  21,  23,  40,  41,  42},
+      {  9,  10,  22,  24,  42,  43},
+      { 10,  11,  23,  25,  43,  44},
+      { 11,  24,  26,  44,  45,  46},
+      { 11,  12,  25,  27,  46,  47},
+      { 12,  13,  26,  28,  47,  48},
+      { 13,  27,  29,  48,  49,  50},
+      { 13,  14,  28,  30,  50,  51},  // 30
+      { 14,  15,  29,  31,  51,  52},
+      { 15,  30,  32,  52,  53,  54},
+      { 15,  16,  31,  33,  54,  55},
+      { 16,  17,  32,  34,  55,  56},
+      { 17,  33,  35,  56,  57,  58},
+      { 17,  18,  34,  36,  58,  59},
+      {  7,  18,  19,  35,  59,  60},
+      { 19,  38,  60,  61,  62,  90},
+      { 19,  20,  37,  39,  62,  63},
+      { 20,  21,  38,  40,  63,  64},  // 40
+      { 21,  22,  39,  41,  64,  65},
+      { 22,  40,  42,  65,  66,  67},
+      { 22,  23,  41,  43,  67,  68},
+      { 23,  24,  42,  44,  68,  69},
+      { 24,  25,  43,  45,  69,  70},
+      { 25,  44,  46,  70,  71,  72},
+      { 25,  26,  45,  47,  72,  73},
+      { 26,  27,  46,  48,  73,  74},
+      { 27,  28,  47,  49,  74,  75},
+      { 28,  48,  50,  75,  76,  77},  // 50
+      { 28,  29,  49,  51,  77,  78},
+      { 29,  30,  50,  52,  78,  79},
+      { 30,  31,  51,  53,  79,  80},
+      { 31,  52,  54,  80,  81,  82},
+      { 31,  32,  53,  55,  82,  83},
+      { 32,  33,  54,  56,  83,  84},
+      { 33,  34,  55,  57,  84,  85},
+      { 34,  56,  58,  85,  86,  87},
+      { 34,  35,  57,  59,  87,  88},
+      { 35,  36,  58,  60,  88,  89},  // 60
+      { 19,  36,  37,  59,  89,  90},
+      { 37,  62,  90,  91,  92, 126},
+      { 37,  38,  61,  63,  92,  93},
+      { 38,  39,  62,  64,  93,  94},
+      { 39,  40,  63,  65,  94,  95},
+      { 40,  41,  64,  66,  95,  96},
+      { 41,  65,  67,  96,  97,  98},
+      { 41,  42,  66,  68,  98,  99},
+      { 42,  43,  67,  69,  99, 100},
+      { 43,  44,  68,  70, 100, 101},  // 70
+      { 44,  45,  69,  71, 101, 102},
+      { 45,  70,  72, 102, 103, 104},
+      { 45,  46,  71,  73, 104, 105},
+      { 46,  47,  72,  74, 105, 106},
+      { 47,  48,  73,  75, 106, 107},
+      { 48,  49,  74,  76, 107, 108},
+      { 49,  75,  77, 108, 109, 110},
+      { 49,  50,  76,  78, 110, 111},
+      { 50,  51,  77,  79, 111, 112},
+      { 51,  52,  78,  80, 112, 113},  // 80
+      { 52,  53,  79,  81, 113, 114},
+      { 53,  80,  82, 114, 115, 116},
+      { 53,  54,  81,  83, 116, 117},
+      { 54,  55,  82,  84, 117, 118},
+      { 55,  56,  83,  85, 118, 119},
+      { 56,  57,  84,  86, 119, 120},
+      { 57,  85,  87, 120, 121, 122},
+      { 57,  58,  86,  88, 122, 123},
+      { 58,  59,  87,  89, 123, 124},
+      { 59,  60,  88,  90, 124, 125},  // 90
+      { 37,  60,  61,  89, 125, 126},
+      { 61,  92, 126, 127,  -1,  -1},
+      { 61,  62,  91,  93,  -1,  -1},
+      { 62,  63,  92,  94,  -1,  -1},
+      { 63,  64,  93,  95,  -1,  -1},
+      { 64,  65,  94,  96,  -1,  -1},
+      { 65,  66,  95,  97,  -1,  -1},
+      { 66,  96,  98,  -1,  -1,  -1},
+      { 66,  67,  97,  99,  -1,  -1},
+      { 67,  68,  98, 100,  -1,  -1},  // 100
+      { 68,  69,  99, 101,  -1,  -1},
+      { 69,  70, 100, 102,  -1,  -1},
+      { 70,  71, 101, 103,  -1,  -1},
+      { 71, 102, 104,  -1,  -1,  -1},
+      { 71,  72, 103, 105,  -1,  -1},
+      { 72,  73, 104, 106,  -1,  -1},
+      { 73,  74, 105, 107,  -1,  -1},
+      { 74,  75, 106, 108,  -1,  -1},
+      { 75,  76, 107, 109,  -1,  -1},
+      { 76, 108, 110,  -1,  -1,  -1},  // 110
+      { 76,  77, 109, 111,  -1,  -1},
+      { 77,  78, 110, 112,  -1,  -1},
+      { 78,  79, 111, 113,  -1,  -1},
+      { 79,  80, 112, 114,  -1,  -1},
+      { 80,  81, 113, 115,  -1,  -1},
+      { 81, 114, 116,  -1,  -1,  -1},
+      { 81,  82, 115, 117,  -1,  -1},
+      { 82,  83, 116, 118,  -1,  -1},
+      { 83,  84, 117, 119,  -1,  -1},
+      { 84,  85, 118, 120,  -1,  -1},  // 120
+      { 85,  86, 119, 121,  -1,  -1},
+      { 86, 120, 122,  -1,  -1,  -1},
+      { 86,  87, 121, 123,  -1,  -1},
+      { 87,  88, 122, 124,  -1,  -1},
+      { 88,  89, 123, 125,  -1,  -1},
+      { 89,  90, 124, 126,  -1,  -1}   // 126
+  } ;
+
+  for (Int_t i=0; i<127; i++)
+      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
+                              nn[i][3], nn[i][4], nn[i][5]);
+}
+
+void MGeomCamCT1::CreateCam()
+{
+    //
+    // fill the geometry class with the coordinates of the CT1 camera
+    //
+    *fLog << " Create CT1 geometry " << endl;
+
+    //
+    // this algorithm is from Martin Kestel originally
+    // it was punt into a root/C++ context by Harald Kornmayer and Thomas Bretz
+   
+    const Float_t diameter = 21 ;    // units are mm
+    const Float_t kS32  = sqrt(3)/2;
+
+    //
+    //  add the first pixel to the list
+    //
+    Int_t pixnum = 0;
+
+    (*this)[pixnum++].Set(0, 0, diameter);
+
+    for (Int_t ring=1; ring<7; ring++)
+    {
+        //
+        // calc. coords for this ring counting from the
+        // starting number to the ending number
+        //
+        for (int i=0; i<ring; i++)
+            (*this)[pixnum++].Set((-ring+i*0.5)*diameter,
+                                  i*kS32*diameter,
+                                  diameter);
+
+        for (int i=0; i<ring; i++)
+            (*this)[pixnum++].Set((-ring*0.5+i)*diameter,
+                                  ring*kS32 * diameter,
+                                  diameter);
+
+        for (int i=0; i<ring; i++)
+            (*this)[pixnum++].Set((ring+i)*0.5*diameter,
+                                  (ring-i)*kS32*diameter,
+                                  diameter);
+
+        for (int i=0; i<ring; i++)
+            (*this)[pixnum++].Set((ring-0.5*i)*diameter,
+                                  -i*kS32*diameter,
+                                  diameter);
+
+        for (int i=0; i<ring; i++)
+            (*this)[pixnum++].Set((ring*0.5-i)*diameter,
+                                  -ring*kS32 * diameter,
+                                  diameter);
+
+        for (int i=0; i<ring; i++)
+            (*this)[pixnum++].Set((-ring-i)*0.5*diameter,
+                                  (-ring+i)*kS32*diameter,
+                                  diameter);
+    }
+}
+
Index: /tags/Mars_V0-4/Mars/mgui/MGeomCamCT1.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomCamCT1.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomCamCT1.h	(revision 9634)
@@ -0,0 +1,28 @@
+#ifndef MGEOMCAMCT1_H
+#define MGEOMCAMCT1_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef MGEOMCAM_H
+#include "MGeomCam.h"
+#endif
+
+class MGeomCamCT1 : public MGeomCam
+{
+private:
+
+    void CreateCam();
+    void CreateNN();
+
+public:
+
+    MGeomCamCT1(const char *name=NULL);
+
+    void Draw(Option_t *option = "" ) ;
+
+    ClassDef(MGeomCamCT1, 1)		// Geometry class for the CT1 camera
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mgui/MGeomCamMagic.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomCamMagic.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomCamMagic.cc	(revision 9634)
@@ -0,0 +1,879 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MGeomCamMagic.h"
+
+#include "TCanvas.h"
+
+#include "MLog.h"
+
+ClassImp(MGeomCamMagic)
+
+MGeomCamMagic::MGeomCamMagic(const char *name) : MGeomCam(577, name, "Geometry information of Magic Camera")
+{
+    CreateCam();
+    CreateNN();
+}
+
+void MGeomCamMagic::Draw(Option_t *)
+{ 
+    TCanvas *can = new TCanvas("can", "Camera Geometry", 4 ) ;
+
+    can->Range(-600, -600, 600, 600 ) ;
+
+    MGeomCam::Draw();
+}
+
+void MGeomCamMagic::CreateCam()
+{
+    //
+    //   fill the geometry class with the coordinates of the MAGIC camera
+    //
+    *fLog << " Creating Magic geometry " << endl ;
+
+    //
+    //   here define the hardwire things of the magic telescope
+    //
+    const Float_t xtemp[577] = {
+        +000.000,   30.000,   15.000,  -15.000,  -30.000,  -15.000,   15.000,   60.000,  //   0
+        +045.000,   30.000,    0.000,  -30.000,  -45.000,  -60.000,  -45.000,  -30.000,  //   8
+        +000.000,   30.000,   45.000,   90.000,   75.000,   60.000,   45.000,   15.000,  //  16
+        -015.000,  -45.000,  -60.000,  -75.000,  -90.000,  -75.000,  -60.000,  -45.000,  //  24
+        -015.000,   15.000,   45.000,   60.000,   75.000,  120.000,  105.000,   90.000,  //  32
+        +075.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,  -75.000,  -90.000,  //  40
+        -105.000, -120.000, -105.000,  -90.000,  -75.000,  -60.000,  -30.000,    0.000,  //  48
+        +030.000,   60.000,   75.000,   90.000,  105.000,  150.000,  135.000,  120.000,  //  56
+        +105.000,   90.000,   75.000,   45.000,   15.000,  -15.000,  -45.000,  -75.000,  //  64
+        -090.000, -105.000, -120.000, -135.000, -150.000, -135.000, -120.000, -105.000,  //  72
+        -090.000,  -75.000,  -45.000,  -15.000,   15.000,   45.000,   75.000,   90.000,  //  80
+        +105.000,  120.000,  135.000,  180.000,  165.000,  150.000,  135.000,  120.000,  //  88
+        +105.000,   90.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,  -90.000,  //  96
+        -105.000, -120.000, -135.000, -150.000, -165.000, -180.000, -165.000, -150.000,  // 104
+        -135.000, -120.000, -105.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,  // 112
+        +060.000,   90.000,  105.000,  120.000,  135.000,  150.000,  165.000,  210.000,  // 120
+        +195.000,  180.000,  165.000,  150.000,  135.000,  120.000,  105.000,   75.000,  // 128
+        +045.000,   15.000,  -15.000,  -45.000,  -75.000, -105.000, -120.000, -135.000,  // 136
+        -150.000, -165.000, -180.000, -195.000, -210.000, -195.000, -180.000, -165.000,  // 144
+        -150.000, -135.000, -120.000, -105.000,  -75.000,  -45.000,  -15.000,   15.000,  // 152
+        +045.000,   75.000,  105.000,  120.000,  135.000,  150.000,  165.000,  180.000,  // 160
+        +195.000,  240.000,  225.000,  210.000,  195.000,  180.000,  165.000,  150.000,  // 168
+        +135.000,  120.000,   90.000,   60.000,   30.000,    0.000,  -30.000,  -60.000,  // 176
+        -090.000, -120.000, -135.000, -150.000, -165.000, -180.000, -195.000, -210.000,  // 184
+        -225.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,  // 192
+        -135.000, -120.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,   60.000,  // 200
+        +090.000,  120.000,  135.000,  150.000,  165.000,  180.000,  195.000,  210.000,  // 208
+        +225.000,  270.000,  255.000,  240.000,  225.000,  210.000,  195.000,  180.000,  // 216
+        +165.000,  150.000,  135.000,  105.000,   75.000,   45.000,   15.000,  -15.000,  // 224
+        -045.000,  -75.000, -105.000, -135.000, -150.000, -165.000, -180.000, -195.000,  // 232
+        -210.000, -225.000, -240.000, -255.000, -270.000, -255.000, -240.000, -225.000,  // 240
+        -210.000, -195.000, -180.000, -165.000, -150.000, -135.000, -105.000,  -75.000,  // 248
+        -045.000,  -15.000,   15.000,   45.000,   75.000,  105.000,  135.000,  150.000,  // 256
+        +165.000,  180.000,  195.000,  210.000,  225.000,  240.000,  255.000,  300.000,  // 264
+        +285.000,  270.000,  255.000,  240.000,  225.000,  210.000,  195.000,  180.000,  // 272
+        +165.000,  150.000,  120.000,   90.000,   60.000,   30.000,    0.000,  -30.000,  // 280
+        -060.000,  -90.000, -120.000, -150.000, -165.000, -180.000, -195.000, -210.000,  // 288
+        -225.000, -240.000, -255.000, -270.000, -285.000, -300.000, -285.000, -270.000,  // 296
+        -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000, -150.000,  // 304
+        -120.000,  -90.000,  -60.000,  -30.000,    0.000,   30.000,   60.000,   90.000,  // 312
+        +120.000,  150.000,  165.000,  180.000,  195.000,  210.000,  225.000,  240.000,  // 320
+        +255.000,  270.000,  285.000,  330.000,  315.000,  300.000,  285.000,  270.000,  // 328
+        +255.000,  240.000,  225.000,  210.000,  195.000,  180.000,  165.000,  135.000,  // 336
+        +105.000,   75.000,   45.000,   15.000,  -15.000,  -45.000,  -75.000, -105.000,  // 344
+        -135.000, -165.000, -180.000, -195.000, -210.000, -225.000, -240.000, -255.000,  // 352
+        -270.000, -285.000, -300.000, -315.000, -330.000, -315.000, -300.000, -285.000,  // 360
+        -270.000, -255.000, -240.000, -225.000, -210.000, -195.000, -180.000, -165.000,  // 368
+        -135.000, -105.000,  -75.000,  -45.000,  -15.000,   15.000,   45.000,   75.000,  // 376
+        +105.000,  135.000,  165.000,  180.000,  195.000,  210.000,  225.000,  240.000,  // 384
+        +255.000,  270.000,  285.000,  300.000,  315.000,  360.000,  330.000,  300.000,  // 392
+        +270.000,  240.000,  210.000,  150.000,   90.000,   30.000,  -30.000,  -90.000,  // 400
+        -150.000, -210.000, -240.000, -270.000, -300.000, -330.000, -360.000, -360.000,  // 408
+        -330.000, -300.000, -270.000, -240.000, -210.000, -150.000,  -90.000,  -30.000,  // 416
+        +030.000,   90.000,  150.000,  210.000,  240.000,  270.000,  300.000,  330.000,  // 424
+        +360.000,  420.000,  390.000,  360.000,  330.000,  300.000,  270.000,  240.000,  // 432
+        +180.000,  120.000,   60.000,    0.000,  -60.000, -120.000, -180.000, -240.000,  // 440
+        -270.000, -300.000, -330.000, -360.000, -390.000, -420.000, -420.000, -390.000,  // 448
+        -360.000, -330.000, -300.000, -270.000, -240.000, -180.000, -120.000,  -60.000,  // 456
+        +000.000,   60.000,  120.000,  180.000,  240.000,  270.000,  300.000,  330.000,  // 464
+        +360.000,  390.000,  420.000,  480.000,  450.000,  420.000,  390.000,  360.000,  // 472
+        +330.000,  300.000,  270.000,  210.000,  150.000,   90.000,   30.000,  -30.000,  // 480
+        -090.000, -150.000, -210.000, -270.000, -300.000, -330.000, -360.000, -390.000,  // 488
+        -420.000, -450.000, -480.000, -480.000, -450.000, -420.000, -390.000, -360.000,  // 496
+        -330.000, -300.000, -270.000, -210.000, -150.000,  -90.000,  -30.000,   30.000,  // 504
+        +090.000,  150.000,  210.000,  270.000,  300.000,  330.000,  360.000,  390.000,  // 512
+        +420.000,  450.000,  480.000,  540.000,  510.000,  480.000,  450.000,  420.000,  // 520
+        +390.000,  360.000,  330.000,  300.000,  240.000,  180.000,  120.000,   60.000,  // 528
+        +000.000,  -60.000, -120.000, -180.000, -240.000, -300.000, -330.000, -360.000,  // 536
+        -390.000, -420.000, -450.000, -480.000, -510.000, -540.000, -540.000, -510.000,  // 544
+        -480.000, -450.000, -420.000, -390.000, -360.000, -330.000, -300.000, -240.000,  // 552
+        -180.000, -120.000,  -60.000,    0.000,   60.000,  120.000,  180.000,  240.000,  // 560
+        +300.000,  330.000,  360.000,  390.000,  420.000,  450.000,  480.000,  510.000,  // 568
+        +540.000                                                                         // 576
+    };
+
+    const Float_t ytemp[577] = {
+        +000.000,    0.000,   25.981,   25.981,    0.000,  -25.981,  -25.981,    0.000,  //   0
+        +025.981,   51.961,   51.961,   51.961,   25.981,    0.000,  -25.981,  -51.961,  //   8
+        -051.961,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,   77.942,  //  16
+        +077.942,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,  //  24
+        -077.942,  -77.942,  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,  //  32
+        +077.942,  103.923,  103.923,  103.923,  103.923,  103.923,   77.942,   51.961,  //  40
+        +025.981,    0.000,  -25.981,  -51.961,  -77.942, -103.923, -103.923, -103.923,  //  48
+        -103.923, -103.923,  -77.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,  //  56
+        +077.942,  103.923,  129.904,  129.904,  129.904,  129.904,  129.904,  129.904,  //  64
+        +103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,  //  72
+        -103.923, -129.904, -129.904, -129.904, -129.904, -129.904, -129.904, -103.923,  //  80
+        -077.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,  //  88
+        +129.904,  155.885,  155.885,  155.885,  155.885,  155.885,  155.885,  155.885,  //  96
+        +129.904,  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  // 104
+        -077.942, -103.923, -129.904, -155.885, -155.885, -155.885, -155.885, -155.885,  // 112
+        -155.885, -155.885, -129.904, -103.923,  -77.942,  -51.961,  -25.981,    0.000,  // 120
+        +025.981,   51.961,   77.942,  103.923,  129.904,  155.885,  181.865,  181.865,  // 128
+        +181.865,  181.865,  181.865,  181.865,  181.865,  181.865,  155.885,  129.904,  // 136
+        +103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,  // 144
+        -103.923, -129.904, -155.885, -181.865, -181.865, -181.865, -181.865, -181.865,  // 152
+        -181.865, -181.865, -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,  // 160
+        -025.981,    0.000,   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,  // 168
+        +181.865,  207.846,  207.846,  207.846,  207.846,  207.846,  207.846,  207.846,  // 176
+        +207.846,  207.846,  181.865,  155.885,  129.904,  103.923,   77.942,   51.961,  // 184
+        +025.981,    0.000,  -25.981,  -51.961,  -77.942, -103.923, -129.904, -155.885,  // 192
+        -181.865, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846, -207.846,  // 200
+        -207.846, -207.846, -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,  // 208
+        -025.981,    0.000,   25.981,   51.961,   77.942,  103.923,  129.904,  155.885,  // 216
+        +181.865,  207.846,  233.827,  233.827,  233.827,  233.827,  233.827,  233.827,  // 224
+        +233.827,  233.827,  233.827,  233.827,  207.846,  181.865,  155.885,  129.904,  // 232
+        +103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,  // 240
+        -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -233.827, -233.827,  // 248
+        -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -233.827, -207.846,  // 256
+        -181.865, -155.885, -129.904, -103.923,  -77.942,  -51.961,  -25.981,    0.000,  // 264
+        +025.981,   51.961,   77.942,  103.923,  129.904,  155.885,  181.865,  207.846,  // 272
+        +233.827,  259.808,  259.808,  259.808,  259.808,  259.808,  259.808,  259.808,  // 280
+        +259.808,  259.808,  259.808,  259.808,  233.827,  207.846,  181.865,  155.885,  // 288
+        +129.904,  103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  // 296
+        -077.942, -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808,  // 304
+        -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808, -259.808,  // 312
+        -259.808, -259.808, -233.827, -207.846, -181.865, -155.885, -129.904, -103.923,  // 320
+        -077.942,  -51.961,  -25.981,    0.000,   25.981,   51.961,   77.942,  103.923,  // 328
+        +129.904,  155.885,  181.865,  207.846,  233.827,  259.808,  285.788,  285.788,  // 336
+        +285.788,  285.788,  285.788,  285.788,  285.788,  285.788,  285.788,  285.788,  // 344
+        +285.788,  285.788,  259.808,  233.827,  207.846,  181.865,  155.885,  129.904,  // 352
+        +103.923,   77.942,   51.961,   25.981,    0.000,  -25.981,  -51.961,  -77.942,  // 360
+        -103.923, -129.904, -155.885, -181.865, -207.846, -233.827, -259.808, -285.788,  // 368
+        -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788, -285.788,  // 376
+        -285.788, -285.788, -285.788, -259.808, -233.827, -207.846, -181.865, -155.885,  // 384
+        -129.904, -103.923,  -77.942,  -51.961,  -25.981,   34.641,   86.603,  138.564,  // 392
+        +190.526,  242.487,  294.449,  329.090,  329.090,  329.090,  329.090,  329.090,  // 400
+        +329.090,  294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,  // 408
+        -086.603, -138.564, -190.526, -242.487, -294.449, -329.090, -329.090, -329.090,  // 416
+        -329.090, -329.090, -329.090, -294.449, -242.487, -190.526, -138.564,  -86.603,  // 424
+        -034.641,   34.641,   86.603,  138.564,  190.526,  242.487,  294.449,  346.410,  // 432
+        +381.051,  381.051,  381.051,  381.051,  381.051,  381.051,  381.051,  346.410,  // 440
+        +294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,  -86.603,  // 448
+        -138.564, -190.526, -242.487, -294.449, -346.410, -381.051, -381.051, -381.051,  // 456
+        -381.051, -381.051, -381.051, -381.051, -346.410, -294.449, -242.487, -190.526,  // 464
+        -138.564,  -86.603,  -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,  // 472
+        +294.449,  346.410,  398.372,  433.013,  433.013,  433.013,  433.013,  433.013,  // 480
+        +433.013,  433.013,  433.013,  398.372,  346.410,  294.449,  242.487,  190.526,  // 488
+        +138.564,   86.603,   34.641,  -34.641,  -86.603, -138.564, -190.526, -242.487,  // 496
+        -294.449, -346.410, -398.372, -433.013, -433.013, -433.013, -433.013, -433.013,  // 504
+        -433.013, -433.013, -433.013, -398.372, -346.410, -294.449, -242.487, -190.526,  // 512
+        -138.564,  -86.603,  -34.641,   34.641,   86.603,  138.564,  190.526,  242.487,  // 520
+        +294.449,  346.410,  398.372,  450.333,  484.974,  484.974,  484.974,  484.974,  // 528
+        +484.974,  484.974,  484.974,  484.974,  484.974,  450.333,  398.372,  346.410,  // 536
+        +294.449,  242.487,  190.526,  138.564,   86.603,   34.641,  -34.641,  -86.603,  // 544
+        -138.564, -190.526, -242.487, -294.449, -346.410, -398.372, -450.333, -484.974,  // 552
+        -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974, -484.974,  // 560
+        -450.333, -398.372, -346.410, -294.449, -242.487, -190.526, -138.564,  -86.603,  // 568
+        -034.641                                                                         // 576
+    };
+
+    const Float_t rtemp[577] = {
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //   0
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //   8
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  16
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  24
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  32
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  40
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  48
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  56
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  64
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  72
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  80
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  88
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  //  96
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 104
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 112
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 120
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 128
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 136
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 144
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 152
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 160
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 168
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 176
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 184
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 192
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 200
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 208
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 216
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 224
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 232
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 240
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 248
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 256
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 264
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 272
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 280
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 288
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 296
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 304
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 312
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 320
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 328
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 336
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 344
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 352
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 360
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 368
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 376
+        30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00, 30.00,  // 384
+        30.00, 30.00, 30.00, 30.00, 30.00, 60.00, 60.00, 60.00,  // 392
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 400
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 408
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 416
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 424
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 432
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 440
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 448
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 456
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 464
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 472
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 480
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 488
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 496
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 504
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 512
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 520
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 528
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 536
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 544
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 552
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 560
+        60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00, 60.00,  // 568
+        60.00  };                                                // 576
+
+    //
+    //   fill the pixels list with this data
+    //
+
+    for (UInt_t i=0; i<GetNumPixels(); i++)
+        (*this)[i].Set(xtemp[i], ytemp[i], rtemp[i]) ;
+}
+
+void MGeomCamMagic::CreateNN()
+{
+    const Short_t nn[577][6] = {         // Neighbors of #
+        {   1,   2,   3,   4,   5,   6}, // 0
+        {   0,   2,   6,   7,   8,  18},
+        {   0,   1,   3,   8,   9,  10},
+        {   0,   2,   4,  10,  11,  12},
+        {   0,   3,   5,  12,  13,  14},
+        {   0,   4,   6,  14,  15,  16},
+        {   0,   1,   5,  16,  17,  18},
+        {   1,   8,  18,  19,  20,  36},
+        {   1,   2,   7,   9,  20,  21},
+        {   2,   8,  10,  21,  22,  23},
+        {   2,   3,   9,  11,  23,  24},
+        {   3,  10,  12,  24,  25,  26},
+        {   3,   4,  11,  13,  26,  27},
+        {   4,  12,  14,  27,  28,  29},
+        {   4,   5,  13,  15,  29,  30},
+        {   5,  14,  16,  30,  31,  32},
+        {   5,   6,  15,  17,  32,  33},
+        {   6,  16,  18,  33,  34,  35},
+        {   1,   6,   7,  17,  35,  36},
+        {   7,  20,  36,  37,  38,  60},
+        {   7,   8,  19,  21,  38,  39}, // 20
+        {   8,   9,  20,  22,  39,  40},
+        {   9,  21,  23,  40,  41,  42},
+        {   9,  10,  22,  24,  42,  43},
+        {  10,  11,  23,  25,  43,  44},
+        {  11,  24,  26,  44,  45,  46},
+        {  11,  12,  25,  27,  46,  47},
+        {  12,  13,  26,  28,  47,  48},
+        {  13,  27,  29,  48,  49,  50},
+        {  13,  14,  28,  30,  50,  51},
+        {  14,  15,  29,  31,  51,  52},
+        {  15,  30,  32,  52,  53,  54},
+        {  15,  16,  31,  33,  54,  55},
+        {  16,  17,  32,  34,  55,  56},
+        {  17,  33,  35,  56,  57,  58},
+        {  17,  18,  34,  36,  58,  59},
+        {   7,  18,  19,  35,  59,  60},
+        {  19,  38,  60,  61,  62,  90},
+        {  19,  20,  37,  39,  62,  63},
+        {  20,  21,  38,  40,  63,  64},
+        {  21,  22,  39,  41,  64,  65}, // 40
+        {  22,  40,  42,  65,  66,  67},
+        {  22,  23,  41,  43,  67,  68},
+        {  23,  24,  42,  44,  68,  69},
+        {  24,  25,  43,  45,  69,  70},
+        {  25,  44,  46,  70,  71,  72},
+        {  25,  26,  45,  47,  72,  73},
+        {  26,  27,  46,  48,  73,  74},
+        {  27,  28,  47,  49,  74,  75},
+        {  28,  48,  50,  75,  76,  77},
+        {  28,  29,  49,  51,  77,  78},
+        {  29,  30,  50,  52,  78,  79},
+        {  30,  31,  51,  53,  79,  80},
+        {  31,  52,  54,  80,  81,  82},
+        {  31,  32,  53,  55,  82,  83},
+        {  32,  33,  54,  56,  83,  84},
+        {  33,  34,  55,  57,  84,  85},
+        {  34,  56,  58,  85,  86,  87},
+        {  34,  35,  57,  59,  87,  88},
+        {  35,  36,  58,  60,  88,  89},
+        {  19,  36,  37,  59,  89,  90}, // 60
+        {  37,  62,  90,  91,  92, 126},
+        {  37,  38,  61,  63,  92,  93},
+        {  38,  39,  62,  64,  93,  94},
+        {  39,  40,  63,  65,  94,  95},
+        {  40,  41,  64,  66,  95,  96},
+        {  41,  65,  67,  96,  97,  98},
+        {  41,  42,  66,  68,  98,  99},
+        {  42,  43,  67,  69,  99, 100},
+        {  43,  44,  68,  70, 100, 101},
+        {  44,  45,  69,  71, 101, 102},
+        {  45,  70,  72, 102, 103, 104},
+        {  45,  46,  71,  73, 104, 105},
+        {  46,  47,  72,  74, 105, 106},
+        {  47,  48,  73,  75, 106, 107},
+        {  48,  49,  74,  76, 107, 108},
+        {  49,  75,  77, 108, 109, 110},
+        {  49,  50,  76,  78, 110, 111},
+        {  50,  51,  77,  79, 111, 112},
+        {  51,  52,  78,  80, 112, 113},
+        {  52,  53,  79,  81, 113, 114}, // 80
+        {  53,  80,  82, 114, 115, 116},
+        {  53,  54,  81,  83, 116, 117},
+        {  54,  55,  82,  84, 117, 118},
+        {  55,  56,  83,  85, 118, 119},
+        {  56,  57,  84,  86, 119, 120},
+        {  57,  85,  87, 120, 121, 122},
+        {  57,  58,  86,  88, 122, 123},
+        {  58,  59,  87,  89, 123, 124},
+        {  59,  60,  88,  90, 124, 125},
+        {  37,  60,  61,  89, 125, 126},
+        {  61,  92, 126, 127, 128, 168},
+        {  61,  62,  91,  93, 128, 129},
+        {  62,  63,  92,  94, 129, 130},
+        {  63,  64,  93,  95, 130, 131},
+        {  64,  65,  94,  96, 131, 132},
+        {  65,  66,  95,  97, 132, 133},
+        {  66,  96,  98, 133, 134, 135},
+        {  66,  67,  97,  99, 135, 136},
+        {  67,  68,  98, 100, 136, 137},
+        {  68,  69,  99, 101, 137, 138}, // 100
+        {  69,  70, 100, 102, 138, 139},
+        {  70,  71, 101, 103, 139, 140},
+        {  71, 102, 104, 140, 141, 142},
+        {  71,  72, 103, 105, 142, 143},
+        {  72,  73, 104, 106, 143, 144},
+        {  73,  74, 105, 107, 144, 145},
+        {  74,  75, 106, 108, 145, 146},
+        {  75,  76, 107, 109, 146, 147},
+        {  76, 108, 110, 147, 148, 149},
+        {  76,  77, 109, 111, 149, 150},
+        {  77,  78, 110, 112, 150, 151},
+        {  78,  79, 111, 113, 151, 152},
+        {  79,  80, 112, 114, 152, 153},
+        {  80,  81, 113, 115, 153, 154},
+        {  81, 114, 116, 154, 155, 156},
+        {  81,  82, 115, 117, 156, 157},
+        {  82,  83, 116, 118, 157, 158},
+        {  83,  84, 117, 119, 158, 159},
+        {  84,  85, 118, 120, 159, 160},
+        {  85,  86, 119, 121, 160, 161}, // 120
+        {  86, 120, 122, 161, 162, 163},
+        {  86,  87, 121, 123, 163, 164},
+        {  87,  88, 122, 124, 164, 165},
+        {  88,  89, 123, 125, 165, 166},
+        {  89,  90, 124, 126, 166, 167},
+        {  61,  90,  91, 125, 167, 168},
+        {  91, 128, 168, 169, 170, 216},
+        {  91,  92, 127, 129, 170, 171},
+        {  92,  93, 128, 130, 171, 172},
+        {  93,  94, 129, 131, 172, 173},
+        {  94,  95, 130, 132, 173, 174},
+        {  95,  96, 131, 133, 174, 175},
+        {  96,  97, 132, 134, 175, 176},
+        {  97, 133, 135, 176, 177, 178},
+        {  97,  98, 134, 136, 178, 179},
+        {  98,  99, 135, 137, 179, 180},
+        {  99, 100, 136, 138, 180, 181},
+        { 100, 101, 137, 139, 181, 182},
+        { 101, 102, 138, 140, 182, 183},
+        { 102, 103, 139, 141, 183, 184}, // 140
+        { 103, 140, 142, 184, 185, 186},
+        { 103, 104, 141, 143, 186, 187},
+        { 104, 105, 142, 144, 187, 188},
+        { 105, 106, 143, 145, 188, 189},
+        { 106, 107, 144, 146, 189, 190},
+        { 107, 108, 145, 147, 190, 191},
+        { 108, 109, 146, 148, 191, 192},
+        { 109, 147, 149, 192, 193, 194},
+        { 109, 110, 148, 150, 194, 195},
+        { 110, 111, 149, 151, 195, 196},
+        { 111, 112, 150, 152, 196, 197},
+        { 112, 113, 151, 153, 197, 198},
+        { 113, 114, 152, 154, 198, 199},
+        { 114, 115, 153, 155, 199, 200},
+        { 115, 154, 156, 200, 201, 202},
+        { 115, 116, 155, 157, 202, 203},
+        { 116, 117, 156, 158, 203, 204},
+        { 117, 118, 157, 159, 204, 205},
+        { 118, 119, 158, 160, 205, 206},
+        { 119, 120, 159, 161, 206, 207}, // 160
+        { 120, 121, 160, 162, 207, 208},
+        { 121, 161, 163, 208, 209, 210},
+        { 121, 122, 162, 164, 210, 211},
+        { 122, 123, 163, 165, 211, 212},
+        { 123, 124, 164, 166, 212, 213},
+        { 124, 125, 165, 167, 213, 214},
+        { 125, 126, 166, 168, 214, 215},
+        {  91, 126, 127, 167, 215, 216},
+        { 127, 170, 216, 217, 218, 270},
+        { 127, 128, 169, 171, 218, 219},
+        { 128, 129, 170, 172, 219, 220},
+        { 129, 130, 171, 173, 220, 221},
+        { 130, 131, 172, 174, 221, 222},
+        { 131, 132, 173, 175, 222, 223},
+        { 132, 133, 174, 176, 223, 224},
+        { 133, 134, 175, 177, 224, 225},
+        { 134, 176, 178, 225, 226, 227},
+        { 134, 135, 177, 179, 227, 228},
+        { 135, 136, 178, 180, 228, 229},
+        { 136, 137, 179, 181, 229, 230}, // 180
+        { 137, 138, 180, 182, 230, 231},
+        { 138, 139, 181, 183, 231, 232},
+        { 139, 140, 182, 184, 232, 233},
+        { 140, 141, 183, 185, 233, 234},
+        { 141, 184, 186, 234, 235, 236},
+        { 141, 142, 185, 187, 236, 237},
+        { 142, 143, 186, 188, 237, 238},
+        { 143, 144, 187, 189, 238, 239},
+        { 144, 145, 188, 190, 239, 240},
+        { 145, 146, 189, 191, 240, 241},
+        { 146, 147, 190, 192, 241, 242},
+        { 147, 148, 191, 193, 242, 243},
+        { 148, 192, 194, 243, 244, 245},
+        { 148, 149, 193, 195, 245, 246},
+        { 149, 150, 194, 196, 246, 247},
+        { 150, 151, 195, 197, 247, 248},
+        { 151, 152, 196, 198, 248, 249},
+        { 152, 153, 197, 199, 249, 250},
+        { 153, 154, 198, 200, 250, 251},
+        { 154, 155, 199, 201, 251, 252}, // 200
+        { 155, 200, 202, 252, 253, 254},
+        { 155, 156, 201, 203, 254, 255},
+        { 156, 157, 202, 204, 255, 256},
+        { 157, 158, 203, 205, 256, 257},
+        { 158, 159, 204, 206, 257, 258},
+        { 159, 160, 205, 207, 258, 259},
+        { 160, 161, 206, 208, 259, 260},
+        { 161, 162, 207, 209, 260, 261},
+        { 162, 208, 210, 261, 262, 263},
+        { 162, 163, 209, 211, 263, 264},
+        { 163, 164, 210, 212, 264, 265},
+        { 164, 165, 211, 213, 265, 266},
+        { 165, 166, 212, 214, 266, 267},
+        { 166, 167, 213, 215, 267, 268},
+        { 167, 168, 214, 216, 268, 269},
+        { 127, 168, 169, 215, 269, 270},
+        { 169, 218, 270, 271, 272, 330},
+        { 169, 170, 217, 219, 272, 273},
+        { 170, 171, 218, 220, 273, 274},
+        { 171, 172, 219, 221, 274, 275}, // 220
+        { 172, 173, 220, 222, 275, 276},
+        { 173, 174, 221, 223, 276, 277},
+        { 174, 175, 222, 224, 277, 278},
+        { 175, 176, 223, 225, 278, 279},
+        { 176, 177, 224, 226, 279, 280},
+        { 177, 225, 227, 280, 281, 282},
+        { 177, 178, 226, 228, 282, 283},
+        { 178, 179, 227, 229, 283, 284},
+        { 179, 180, 228, 230, 284, 285},
+        { 180, 181, 229, 231, 285, 286},
+        { 181, 182, 230, 232, 286, 287},
+        { 182, 183, 231, 233, 287, 288},
+        { 183, 184, 232, 234, 288, 289},
+        { 184, 185, 233, 235, 289, 290},
+        { 185, 234, 236, 290, 291, 292},
+        { 185, 186, 235, 237, 292, 293},
+        { 186, 187, 236, 238, 293, 294},
+        { 187, 188, 237, 239, 294, 295},
+        { 188, 189, 238, 240, 295, 296},
+        { 189, 190, 239, 241, 296, 297}, // 240
+        { 190, 191, 240, 242, 297, 298},
+        { 191, 192, 241, 243, 298, 299},
+        { 192, 193, 242, 244, 299, 300},
+        { 193, 243, 245, 300, 301, 302},
+        { 193, 194, 244, 246, 302, 303},
+        { 194, 195, 245, 247, 303, 304},
+        { 195, 196, 246, 248, 304, 305},
+        { 196, 197, 247, 249, 305, 306},
+        { 197, 198, 248, 250, 306, 307},
+        { 198, 199, 249, 251, 307, 308},
+        { 199, 200, 250, 252, 308, 309},
+        { 200, 201, 251, 253, 309, 310},
+        { 201, 252, 254, 310, 311, 312},
+        { 201, 202, 253, 255, 312, 313},
+        { 202, 203, 254, 256, 313, 314},
+        { 203, 204, 255, 257, 314, 315},
+        { 204, 205, 256, 258, 315, 316},
+        { 205, 206, 257, 259, 316, 317},
+        { 206, 207, 258, 260, 317, 318},
+        { 207, 208, 259, 261, 318, 319}, // 260
+        { 208, 209, 260, 262, 319, 320},
+        { 209, 261, 263, 320, 321, 322},
+        { 209, 210, 262, 264, 322, 323},
+        { 210, 211, 263, 265, 323, 324},
+        { 211, 212, 264, 266, 324, 325},
+        { 212, 213, 265, 267, 325, 326},
+        { 213, 214, 266, 268, 326, 327},
+        { 214, 215, 267, 269, 327, 328},
+        { 215, 216, 268, 270, 328, 329},
+        { 169, 216, 217, 269, 329, 330},
+        { 217, 272, 330, 331, 332, 396},
+        { 217, 218, 271, 273, 332, 333},
+        { 218, 219, 272, 274, 333, 334},
+        { 219, 220, 273, 275, 334, 335},
+        { 220, 221, 274, 276, 335, 336},
+        { 221, 222, 275, 277, 336, 337},
+        { 222, 223, 276, 278, 337, 338},
+        { 223, 224, 277, 279, 338, 339},
+        { 224, 225, 278, 280, 339, 340},
+        { 225, 226, 279, 281, 340, 341}, // 280
+        { 226, 280, 282, 341, 342, 343},
+        { 226, 227, 281, 283, 343, 344},
+        { 227, 228, 282, 284, 344, 345},
+        { 228, 229, 283, 285, 345, 346},
+        { 229, 230, 284, 286, 346, 347},
+        { 230, 231, 285, 287, 347, 348},
+        { 231, 232, 286, 288, 348, 349},
+        { 232, 233, 287, 289, 349, 350},
+        { 233, 234, 288, 290, 350, 351},
+        { 234, 235, 289, 291, 351, 352},
+        { 235, 290, 292, 352, 353, 354},
+        { 235, 236, 291, 293, 354, 355},
+        { 236, 237, 292, 294, 355, 356},
+        { 237, 238, 293, 295, 356, 357},
+        { 238, 239, 294, 296, 357, 358},
+        { 239, 240, 295, 297, 358, 359},
+        { 240, 241, 296, 298, 359, 360},
+        { 241, 242, 297, 299, 360, 361},
+        { 242, 243, 298, 300, 361, 362},
+        { 243, 244, 299, 301, 362, 363}, // 300
+        { 244, 300, 302, 363, 364, 365},
+        { 244, 245, 301, 303, 365, 366},
+        { 245, 246, 302, 304, 366, 367},
+        { 246, 247, 303, 305, 367, 368},
+        { 247, 248, 304, 306, 368, 369},
+        { 248, 249, 305, 307, 369, 370},
+        { 249, 250, 306, 308, 370, 371},
+        { 250, 251, 307, 309, 371, 372},
+        { 251, 252, 308, 310, 372, 373},
+        { 252, 253, 309, 311, 373, 374},
+        { 253, 310, 312, 374, 375, 376},
+        { 253, 254, 311, 313, 376, 377},
+        { 254, 255, 312, 314, 377, 378},
+        { 255, 256, 313, 315, 378, 379},
+        { 256, 257, 314, 316, 379, 380},
+        { 257, 258, 315, 317, 380, 381},
+        { 258, 259, 316, 318, 381, 382},
+        { 259, 260, 317, 319, 382, 383},
+        { 260, 261, 318, 320, 383, 384},
+        { 261, 262, 319, 321, 384, 385}, // 320
+        { 262, 320, 322, 385, 386, 387},
+        { 262, 263, 321, 323, 387, 388},
+        { 263, 264, 322, 324, 388, 389},
+        { 264, 265, 323, 325, 389, 390},
+        { 265, 266, 324, 326, 390, 391},
+        { 266, 267, 325, 327, 391, 392},
+        { 267, 268, 326, 328, 392, 393},
+        { 268, 269, 327, 329, 393, 394},
+        { 269, 270, 328, 330, 394, 395},
+        { 217, 270, 271, 329, 395, 396},
+        { 271, 332, 396, 397, 432,  -1},
+        { 271, 272, 331, 333, 397,  -1},
+        { 272, 273, 332, 334, 398,  -1},
+        { 273, 274, 333, 335, 398,  -1},
+        { 274, 275, 334, 336, 399,  -1},
+        { 275, 276, 335, 337, 399,  -1},
+        { 276, 277, 336, 338, 400,  -1},
+        { 277, 278, 337, 339, 400,  -1},
+        { 278, 279, 338, 340, 401,  -1},
+        { 279, 280, 339, 341, 401,  -1}, // 340
+        { 280, 281, 340, 342, 402,  -1},
+        { 281, 341, 343, 402, 403,  -1},
+        { 281, 282, 342, 344, 403,  -1},
+        { 282, 283, 343, 345, 404,  -1},
+        { 283, 284, 344, 346, 404,  -1},
+        { 284, 285, 345, 347, 405,  -1},
+        { 285, 286, 346, 348, 405,  -1},
+        { 286, 287, 347, 349, 406,  -1},
+        { 287, 288, 348, 350, 406,  -1},
+        { 288, 289, 349, 351, 407,  -1},
+        { 289, 290, 350, 352, 407,  -1},
+        { 290, 291, 351, 353, 408,  -1},
+        { 291, 352, 354, 408, 409,  -1},
+        { 291, 292, 353, 355, 409,  -1},
+        { 292, 293, 354, 356, 410,  -1},
+        { 293, 294, 355, 357, 410,  -1},
+        { 294, 295, 356, 358, 411,  -1},
+        { 295, 296, 357, 359, 411,  -1},
+        { 296, 297, 358, 360, 412,  -1},
+        { 297, 298, 359, 361, 412,  -1}, // 360
+        { 298, 299, 360, 362, 413,  -1},
+        { 299, 300, 361, 363, 413,  -1},
+        { 300, 301, 362, 364, 414,  -1},
+        { 301, 363, 365, 414, 415,  -1},
+        { 301, 302, 364, 366, 415,  -1},
+        { 302, 303, 365, 367, 416,  -1},
+        { 303, 304, 366, 368, 416,  -1},
+        { 304, 305, 367, 369, 417,  -1},
+        { 305, 306, 368, 370, 417,  -1},
+        { 306, 307, 369, 371, 418,  -1},
+        { 307, 308, 370, 372, 418,  -1},
+        { 308, 309, 371, 373, 419,  -1},
+        { 309, 310, 372, 374, 419,  -1},
+        { 310, 311, 373, 375, 420,  -1},
+        { 311, 374, 376, 420, 421,  -1},
+        { 311, 312, 375, 377, 421,  -1},
+        { 312, 313, 376, 378, 422,  -1},
+        { 313, 314, 377, 379, 422,  -1},
+        { 314, 315, 378, 380, 423,  -1},
+        { 315, 316, 379, 381, 423,  -1}, // 380
+        { 316, 317, 380, 382, 424,  -1},
+        { 317, 318, 381, 383, 424,  -1},
+        { 318, 319, 382, 384, 425,  -1},
+        { 319, 320, 383, 385, 425,  -1},
+        { 320, 321, 384, 386, 426,  -1},
+        { 321, 385, 387, 426, 427,  -1},
+        { 321, 322, 386, 388, 427,  -1},
+        { 322, 323, 387, 389, 428,  -1},
+        { 323, 324, 388, 390, 428,  -1},
+        { 324, 325, 389, 391, 429,  -1},
+        { 325, 326, 390, 392, 429,  -1},
+        { 326, 327, 391, 393, 430,  -1},
+        { 327, 328, 392, 394, 430,  -1},
+        { 328, 329, 393, 395, 431,  -1},
+        { 329, 330, 394, 396, 431,  -1},
+        { 271, 330, 331, 395, 432,  -1},
+        { 331, 332, 398, 432, 433, 434},
+        { 333, 334, 397, 399, 434,  -1},
+        { 335, 336, 400, 435, 436,  -1},
+        { 337, 338, 399, 401, 437,  -1}, // 400
+        { 339, 340, 400, 402, 438,  -1},
+        { 341, 342, 401, 403, 438, 439},
+        { 342, 343, 402, 404, 440, 441},
+        { 344, 345, 403, 441, 442,  -1},
+        { 346, 347, 404, 442, 443,  -1},
+        { 348, 349, 405, 443, 444,  -1},
+        { 350, 351, 406, 444, 445,  -1},
+        { 352, 353, 407, 409, 445, 446},
+        { 353, 354, 408, 410, 447, 448},
+        { 355, 356, 409, 411, 448,  -1},
+        { 357, 358, 410, 412, 449,  -1},
+        { 359, 360, 411, 450, 451,  -1},
+        { 361, 362, 412, 414, 452,  -1},
+        { 363, 364, 413, 415, 452, 453},
+        { 364, 365, 414, 416, 454, 455},
+        { 366, 367, 415, 417, 455,  -1},
+        { 368, 369, 418, 456, 457,  -1},
+        { 370, 371, 417, 419, 458,  -1},
+        { 372, 373, 418, 420, 459,  -1},
+        { 374, 375, 419, 421, 459, 460}, // 420
+        { 375, 376, 420, 422, 461, 462},
+        { 377, 378, 421, 462, 463,  -1},
+        { 379, 380, 422, 463, 464,  -1},
+        { 381, 382, 423, 464, 465,  -1},
+        { 383, 384, 424, 465, 466,  -1},
+        { 385, 386, 425, 427, 466, 467},
+        { 386, 387, 426, 428, 468, 469},
+        { 388, 389, 427, 429, 469,  -1},
+        { 390, 391, 428, 430, 470,  -1},
+        { 392, 393, 429, 471, 472,  -1},
+        { 394, 395, 430, 432, 473,  -1},
+        { 331, 396, 397, 431, 473, 474},
+        { 397, 434, 474, 475, 476,  -1},
+        { 397, 398, 433, 435, 476, 477},
+        { 398, 399, 434, 436, 477, 478},
+        { 399, 400, 435, 437, 478, 479},
+        { 400, 401, 436, 438, 479, 480},
+        { 401, 402, 437, 439, 480, 481},
+        { 402, 438, 440, 481, 482,  -1},
+        { 403, 439, 441, 483, 484,  -1}, // 440
+        { 403, 404, 440, 442, 484, 485},
+        { 404, 405, 441, 443, 485, 486},
+        { 405, 406, 442, 444, 486, 487},
+        { 406, 407, 443, 445, 487, 488},
+        { 407, 408, 444, 446, 488, 489},
+        { 408, 445, 447, 489, 490,  -1},
+        { 409, 446, 448, 491, 492,  -1},
+        { 409, 410, 447, 449, 492, 493},
+        { 410, 411, 448, 450, 493, 494},
+        { 411, 412, 449, 451, 494, 495},
+        { 412, 413, 450, 452, 495, 496},
+        { 413, 414, 451, 453, 496, 497},
+        { 414, 452, 454, 497, 498,  -1},
+        { 415, 453, 455, 499, 500,  -1},
+        { 415, 416, 454, 456, 500, 501},
+        { 416, 417, 455, 457, 501, 502},
+        { 417, 418, 456, 458, 502, 503},
+        { 418, 419, 457, 459, 503, 504},
+        { 419, 420, 458, 460, 504, 505},
+        { 420, 459, 461, 505, 506,  -1}, // 460
+        { 421, 460, 462, 507, 508,  -1},
+        { 421, 422, 461, 463, 508, 509},
+        { 422, 423, 462, 464, 509, 510},
+        { 423, 424, 463, 465, 510, 511},
+        { 424, 425, 464, 466, 511, 512},
+        { 425, 426, 465, 467, 512, 513},
+        { 426, 466, 468, 513, 514,  -1},
+        { 427, 467, 469, 515, 516,  -1},
+        { 427, 428, 468, 470, 516, 517},
+        { 428, 429, 469, 471, 517, 518},
+        { 429, 430, 470, 472, 518, 519},
+        { 430, 431, 471, 473, 519, 520},
+        { 431, 432, 472, 474, 520, 521},
+        { 432, 433, 473, 521, 522,  -1},
+        { 433, 476, 522, 523, 524,  -1},
+        { 433, 434, 475, 477, 524, 525},
+        { 434, 435, 476, 478, 525, 526},
+        { 435, 436, 477, 479, 526, 527},
+        { 436, 437, 478, 480, 527, 528},
+        { 437, 438, 479, 481, 528, 529}, // 480
+        { 438, 439, 480, 482, 529, 530},
+        { 439, 481, 483, 530, 531,  -1},
+        { 440, 482, 484, 532, 533,  -1},
+        { 440, 441, 483, 485, 533, 534},
+        { 441, 442, 484, 486, 534, 535},
+        { 442, 443, 485, 487, 535, 536},
+        { 443, 444, 486, 488, 536, 537},
+        { 444, 445, 487, 489, 537, 538},
+        { 445, 446, 488, 490, 538, 539},
+        { 446, 489, 491, 539, 540,  -1},
+        { 447, 490, 492, 541, 542,  -1},
+        { 447, 448, 491, 493, 542, 543},
+        { 448, 449, 492, 494, 543, 544},
+        { 449, 450, 493, 495, 544, 545},
+        { 450, 451, 494, 496, 545, 546},
+        { 451, 452, 495, 497, 546, 547},
+        { 452, 453, 496, 498, 547, 548},
+        { 453, 497, 499, 548, 549,  -1},
+        { 454, 498, 500, 550, 551,  -1},
+        { 454, 455, 499, 501, 551, 552}, // 500
+        { 455, 456, 500, 502, 552, 553},
+        { 456, 457, 501, 503, 553, 554},
+        { 457, 458, 502, 504, 554, 555},
+        { 458, 459, 503, 505, 555, 556},
+        { 459, 460, 504, 506, 556, 557},
+        { 460, 505, 507, 557, 558,  -1},
+        { 461, 506, 508, 559, 560,  -1},
+        { 461, 462, 507, 509, 560, 561},
+        { 462, 463, 508, 510, 561, 562},
+        { 463, 464, 509, 511, 562, 563},
+        { 464, 465, 510, 512, 563, 564},
+        { 465, 466, 511, 513, 564, 565},
+        { 466, 467, 512, 514, 565, 566},
+        { 467, 513, 515, 566, 567,  -1},
+        { 468, 514, 516, 568, 569,  -1},
+        { 468, 469, 515, 517, 569, 570},
+        { 469, 470, 516, 518, 570, 571},
+        { 470, 471, 517, 519, 571, 572},
+        { 471, 472, 518, 520, 572, 573},
+        { 472, 473, 519, 521, 573, 574}, // 520
+        { 473, 474, 520, 522, 574, 575},
+        { 474, 475, 521, 575, 576,  -1},
+        { 475, 524, 576,  -1,  -1,  -1},
+        { 475, 476, 523, 525,  -1,  -1},
+        { 476, 477, 524, 526,  -1,  -1},
+        { 477, 478, 525, 527,  -1,  -1},
+        { 478, 479, 526, 528,  -1,  -1},
+        { 479, 480, 527, 529,  -1,  -1},
+        { 480, 481, 528, 530,  -1,  -1},
+        { 481, 482, 529, 531,  -1,  -1},
+        { 482, 530, 532,  -1,  -1,  -1},
+        { 483, 531, 533,  -1,  -1,  -1},
+        { 483, 484, 532, 534,  -1,  -1},
+        { 484, 485, 533, 535,  -1,  -1},
+        { 485, 486, 534, 536,  -1,  -1},
+        { 486, 487, 535, 537,  -1,  -1},
+        { 487, 488, 536, 538,  -1,  -1},
+        { 488, 489, 537, 539,  -1,  -1},
+        { 489, 490, 538, 540,  -1,  -1},
+        { 490, 539, 541,  -1,  -1,  -1}, // 540
+        { 491, 540, 542,  -1,  -1,  -1},
+        { 491, 492, 541, 543,  -1,  -1},
+        { 492, 493, 542, 544,  -1,  -1},
+        { 493, 494, 543, 545,  -1,  -1},
+        { 494, 495, 544, 546,  -1,  -1},
+        { 495, 496, 545, 547,  -1,  -1},
+        { 496, 497, 546, 548,  -1,  -1},
+        { 497, 498, 547, 549,  -1,  -1},
+        { 498, 548, 550,  -1,  -1,  -1},
+        { 499, 549, 551,  -1,  -1,  -1},
+        { 499, 500, 550, 552,  -1,  -1},
+        { 500, 501, 551, 553,  -1,  -1},
+        { 501, 502, 552, 554,  -1,  -1},
+        { 502, 503, 553, 555,  -1,  -1},
+        { 503, 504, 554, 556,  -1,  -1},
+        { 504, 505, 555, 557,  -1,  -1},
+        { 505, 506, 556, 558,  -1,  -1},
+        { 506, 557, 559,  -1,  -1,  -1},
+        { 507, 558, 560,  -1,  -1,  -1},
+        { 507, 508, 559, 561,  -1,  -1}, // 560
+        { 508, 509, 560, 562,  -1,  -1},
+        { 509, 510, 561, 563,  -1,  -1},
+        { 510, 511, 562, 564,  -1,  -1},
+        { 511, 512, 563, 565,  -1,  -1},
+        { 512, 513, 564, 566,  -1,  -1},
+        { 513, 514, 565, 567,  -1,  -1},
+        { 514, 566, 568,  -1,  -1,  -1},
+        { 515, 567, 569,  -1,  -1,  -1},
+        { 515, 516, 568, 570,  -1,  -1},
+        { 516, 517, 569, 571,  -1,  -1}, // 570
+        { 517, 518, 570, 572,  -1,  -1},
+        { 518, 519, 571, 573,  -1,  -1},
+        { 519, 520, 572, 574,  -1,  -1},
+        { 520, 521, 573, 575,  -1,  -1},
+        { 521, 522, 574, 576,  -1,  -1},
+        { 522, 523, 575,  -1,  -1,  -1}  // 576
+    };
+
+  for (Int_t i=0; i<577; i++)
+      (*this)[i].SetNeighbors(nn[i][0], nn[i][1], nn[i][2],
+                              nn[i][3], nn[i][4], nn[i][5]);
+}
Index: /tags/Mars_V0-4/Mars/mgui/MGeomCamMagic.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomCamMagic.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomCamMagic.h	(revision 9634)
@@ -0,0 +1,27 @@
+#ifndef MGEOMCAMMAGIC_H
+#define MGEOMCAMMAGIC_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef MGEOMCAM_H
+#include "MGeomCam.h"
+#endif
+
+class MGeomCamMagic : public MGeomCam
+{
+private:
+    void CreateCam();
+    void CreateNN();
+
+public:
+
+    MGeomCamMagic(const char *name=NULL);
+
+    void Draw(Option_t *option = "");
+
+    ClassDef(MGeomCamMagic, 1)		// Geometry class for the Magic camera
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mgui/MGeomPix.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomPix.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomPix.cc	(revision 9634)
@@ -0,0 +1,64 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MGeomPix.h"
+
+#include "MLog.h"
+
+ClassImp(MGeomPix)
+
+MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r) : fX(x), fY(y), fR(r)
+{
+    //  default constructor
+}
+
+void MGeomPix::SetNeighbors(Short_t i0, Short_t i1, Short_t i2,
+                            Short_t i3, Short_t i4, Short_t i5)
+{
+    fNeighbors[0] = i0;
+    fNeighbors[1] = i1;
+    fNeighbors[2] = i2;
+    fNeighbors[3] = i3;
+    fNeighbors[4] = i4;
+    fNeighbors[5] = i5;
+
+    int i;
+    for (i=0; i<6; i++)
+        if (fNeighbors[i]<0)
+            break;
+
+    fNumNeighbors = i;
+}
+
+
+void MGeomPix::Print(Option_t *opt)
+{ 
+    //   information about a pixel
+    gLog << "MPixGeom:  x= " << fX
+        << "  y= " << fY
+        << "  r= " << fR
+        << endl ;
+}
+
Index: /tags/Mars_V0-4/Mars/mgui/MGeomPix.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MGeomPix.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MGeomPix.h	(revision 9634)
@@ -0,0 +1,44 @@
+#ifndef MGEOMPIX_H
+#define MGEOMPIX_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+class MGeomPix : public TObject
+{ 
+private:
+  Float_t fX;  // the x coordinate
+  Float_t fY;  // the y coordinate
+  Float_t fR;  // the r coordinate
+
+  Byte_t  fNumNeighbors; // number of valid neighbors
+  Short_t fNeighbors[6]; // the IDs of the pixel next to it
+                         // we are assuming an hexagonal geometry
+
+public:
+  MGeomPix(Float_t x=0. , Float_t y=0., Float_t r=0.) ;
+  
+  void Print(Option_t *opt=NULL) ;
+
+  void Set (Float_t x, Float_t y, Float_t r) { fX=x; fY=y; fR=r; }
+
+  void SetNeighbors(Short_t i0=-1, Short_t i1=-1, Short_t i2=-1,
+                    Short_t i3=-1, Short_t i4=-1, Short_t i5=-1);
+  
+  void SetX (Float_t x) { fX = x; }
+  void SetY (Float_t y) { fY = y; }
+  void SetR (Float_t r) { fR = r; }
+
+  Float_t GetX() const  { return fX; }
+  Float_t GetY() const  { return fY; }
+  Float_t GetR() const  { return fR; }
+
+  Byte_t GetNumNeighbors() const { return fNumNeighbors; }
+  Short_t GetNeighbor(Byte_t i) const { return fNeighbors[i]; }
+
+  ClassDef(MGeomPix, 1)		// Geometric class for one pixel
+} ; 
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mgui/MHexagon.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MHexagon.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MHexagon.cc	(revision 9634)
@@ -0,0 +1,220 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//
+//  The class MHexagon is needed for the Event Display of
+//  MAGIC.
+//
+#include "MHexagon.h"
+
+#include <TVirtualPad.h>  // gPad
+
+#include "MGeomPix.h"     // GetX
+
+ClassImp(MHexagon) 
+
+MHexagon::MHexagon() 
+{
+  //   default constructor for MHexagon 
+
+} 
+
+MHexagon::MHexagon(Float_t x, Float_t y, Float_t d )
+ : TAttFill(0, 1001), fX(x), fY(y), fD(d)
+{ 
+  //    normal constructor for MHexagon
+}
+
+MHexagon::MHexagon(MGeomPix &pix)
+ : TAttFill(0, 1001)
+{
+  //    normal constructor for MHexagon
+   fX = pix.GetX();
+   fY = pix.GetY();
+   fD = pix.GetR();
+}
+
+MHexagon::MHexagon( const MHexagon &hexagon)
+{
+  //    copy constructor for MHexagon 
+  ((MHexagon&) hexagon).Copy(*this) ; 
+} 
+
+MHexagon::~MHexagon()
+{ 
+  //     default destructor for MHexagon
+}  
+
+void MHexagon::Copy( TObject &obj ) 
+{ 
+    //     copy this hexagon to hexagon
+    MHexagon &hex = (MHexagon&) obj;
+
+    TObject::Copy(obj);
+    TAttLine::Copy(hex);
+    TAttFill::Copy(hex);
+
+    hex.fX = fX ;
+    hex.fY = fY ;
+    hex.fD = fD ;
+}
+Int_t MHexagon::DistancetoPrimitive( Int_t px, Int_t py )
+{
+    //   compute the distance of a point (px,py) to the Hexagon
+    //   this functions needed for graphical primitives, that
+    //   means without this function you are not able to interact
+    //   with the graphical primitive with the mouse!!!
+    //
+    //   All calcutations are running in pixel coordinates
+
+    //       compute the distance of the Point to the center of the Hexagon
+
+  const Int_t  pxhex = gPad->XtoAbsPixel( fX ) ;
+  const Int_t  pyhex = gPad->YtoAbsPixel( fY ) ; 
+
+  const Double_t DistPointHexagon = TMath::Sqrt( Double_t ((pxhex-px)*(pxhex-px) + (pyhex-py)*(pyhex-py))) ; 
+  const Double_t cosa = TMath::Abs(px-pxhex) / DistPointHexagon ; 
+  const Double_t sina = TMath::Abs(py-pyhex) / DistPointHexagon ; 
+
+  //       comput the distance to pixel border 
+  
+  const Double_t   dx = fD * cosa / 2 ; 
+  const Double_t   dy = fD * sina / 2 ; 
+  
+  const Double_t   xborder = fX + dx ; 
+  const Double_t   yborder = fY + dy ; 
+
+  const Int_t  pxborder = gPad->XtoAbsPixel( xborder ) ; 
+  const Int_t  pyborder = gPad->YtoAbsPixel( yborder ) ; 
+  
+  const Double_t DistBorderHexagon = TMath::Sqrt( Double_t ((pxborder-pxhex)*(pxborder-pxhex)+(pyborder-pyhex)*(pyborder-pyhex))) ;  
+  
+ 
+  //       compute the distance from the border of Pixel  
+  //       here in the first implementation is just circle inside
+
+  return DistBorderHexagon <  DistPointHexagon ? 999999 : 0;
+} 
+
+void MHexagon::DrawHexagon( Float_t x, Float_t y, Float_t d )
+{ 
+  //   Draw this ellipse with new coordinate
+  
+  MHexagon *newhexagon = new MHexagon(x, y, d ) ; 
+  TAttLine::Copy(*newhexagon) ; 
+  TAttFill::Copy(*newhexagon) ; 
+
+  newhexagon->SetBit (kCanDelete) ; 
+  newhexagon->AppendPad() ; 
+} 
+
+void MHexagon::ExecuteEvent(Int_t event, Int_t px, Int_t py ) { 
+  //    This is the first test of implementing a clickable interface
+  //    for one pixel
+
+  switch ( event ) { 
+
+  case kButton1Down: 
+    
+    printf ("\n kButton1Down \n" ) ; 
+    SetFillColor(2) ;
+    gPad->Modified() ; 
+    break;     
+
+  case kButton1Double: 
+    SetFillColor(0) ;
+    gPad->Modified() ; 
+    break;     
+    //  case kMouseEnter:  
+    //     printf ("\n Mouse inside object \n" ) ; 
+    //     break; 
+  } 
+
+} 
+
+
+
+void MHexagon::ls( Option_t *)
+{
+  //     list this hexagon with its attributes
+  TROOT::IndentLevel() ; 
+  printf ("%s:  X= %f  Y= %f R= %f \n", GetName(), fX, fY, fD ) ;
+} 
+
+void MHexagon::Paint(Option_t * ) 
+{
+  //     paint this hexagon with its attribute
+
+  PaintHexagon(fX, fY, fD ) ; 
+} 
+
+
+void MHexagon::PaintHexagon (Float_t inX, Float_t inY, Float_t inD ) 
+{ 
+  //      draw this hexagon with the coordinates
+
+  const Int_t np =  6 ; 
+  
+  const Float_t dx[np+1] = { .5   , 0.    , -.5   , -.5   , 0.    ,  .5   , .5    } ;
+  const Float_t dy[np+1] = { .2886,  .5772,  .2886, -.2886, -.5772, -.2886, .2886 } ;
+
+  static Float_t x[np+1], y[np+1] ; 
+  
+  TAttLine::Modify() ;    // Change line attributes only if neccessary
+  TAttFill::Modify() ;    // Change fill attributes only if neccessary
+    
+  //  calculate the positions of the pixel corners
+
+  for ( Int_t i=0; i<=np; i++ ) { 
+    x[i] = inX + dx[i]* inD ; 
+    y[i] = inY + dy[i]* inD ; 
+  } 
+
+  //   paint the pixel (hopefully) 
+  
+  if ( GetFillColor() ) gPad->PaintFillArea(np, x, y) ; 
+  if ( GetLineStyle() ) gPad->PaintPolyLine(np+1, x, y) ; 
+  
+} 
+
+void MHexagon::Print( Option_t * )
+{
+  //     print/dump this hexagon with its attributes
+  printf ("Ellipse:  X= %f  Y= %f R= %f ", fX, fY, fD ) ;
+  
+  if ( GetLineColor() != 1 ) printf (" Color=%d", GetLineColor() ) ; 
+  if ( GetLineStyle() != 1 ) printf (" Color=%d", GetLineStyle() ) ; 
+  if ( GetLineWidth() != 1 ) printf (" Color=%d", GetLineWidth() ) ;
+
+  if ( GetFillColor() != 0 ) printf (" FillColor=%d", GetFillColor() ) ; 
+
+  printf ("\n") ; 
+} 
+
+
+
+
+
+
Index: /tags/Mars_V0-4/Mars/mgui/MHexagon.h
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/MHexagon.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/MHexagon.h	(revision 9634)
@@ -0,0 +1,59 @@
+#ifndef MHEXAGON_H
+#define MHEXAGON_H
+
+//////////////////////////////////////////////////////////////
+//
+//   MHexagon
+//
+//   A Hexagon for the MAGIC event display
+//
+//////////////////////////////////////////////////////////////
+
+#ifndef ROOT_TObject
+#include <TObject.h>
+#endif 
+
+#ifndef ROOT_TAttLine
+#include <TAttLine.h>
+#endif 
+
+#ifndef ROOT_TAttFill
+#include <TAttFill.h>
+#endif 
+
+class MGeomPix;
+
+class MHexagon : public TObject, public TAttLine, public TAttFill 
+{ 
+ protected: 
+  
+  Float_t      fX ;  // X coordinate  of center
+  Float_t      fY ;  // Y coordinate  of center
+  Float_t      fD ;  // diameter D or better distance between opposite sides
+  
+ public: 
+  
+  MHexagon() ; 
+  MHexagon(Float_t x, Float_t y, Float_t d ) ;
+  MHexagon(MGeomPix &pix);
+  MHexagon( const MHexagon &hexagon) ; 
+  virtual ~MHexagon() ; 
+
+  void Copy ( TObject &hexagon ) ; 
+
+  virtual Int_t  DistancetoPrimitive(Int_t px, Int_t py ) ; 
+  virtual void   DrawHexagon( Float_t x, Float_t y, Float_t d ) ; 
+  
+  virtual void   ExecuteEvent(Int_t event, Int_t px, Int_t py ) ;  
+  
+  virtual void   ls (Option_t *Option="") ; 
+  virtual void   Paint(Option_t *Option="") ; 
+  virtual void   PaintHexagon(Float_t x, Float_t y, Float_t d) ; 
+  virtual void   Print(Option_t *Option="") ;
+
+  ClassDef ( MHexagon, 0 )    //  a hexagon for MAGIC
+
+} ; 
+
+#endif  
+
Index: /tags/Mars_V0-4/Mars/mgui/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mgui/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mgui/Makefile	(revision 9634)
@@ -0,0 +1,52 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Gui
+
+#
+# Library name to creatre
+#
+LIB   = mgui.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../manalysis -I../mdatacheck -I../meventdisp
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MCamDisplay.cc \
+           MGeomCamCT1.cc \
+           MGeomCamMagic.cc \
+           MGeomCam.cc \
+           MGeomPix.cc \
+           MHexagon.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mhist/HistIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/HistIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/HistIncl.h	(revision 9634)
@@ -0,0 +1,5 @@
+#ifndef __CINT__
+
+#include <TF1.h>
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mhist/HistLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/HistLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/HistLinkDef.h	(revision 9634)
@@ -0,0 +1,22 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MH;
+#pragma link C++ class MHFadcCam;
+#pragma link C++ class MHFadcPix;
+#pragma link C++ class MHHillas;
+#pragma link C++ class MHStarMap;
+#pragma link C++ class MHMcEnergy;
+#pragma link C++ class MHMcCollectionArea;
+
+#pragma link C++ class MHMcRate;
+
+#pragma link C++ class MFillH;
+#pragma link C++ class MFillHFadc;
+#pragma link C++ class MFillHHillas;
+#pragma link C++ class MFillHStarMap;
+
+#endif
Index: /tags/Mars_V0-4/Mars/mhist/MFillH.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillH.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillH.cc	(revision 9634)
@@ -0,0 +1,184 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  07/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MFill                                                                   //
+//                                                                          //
+//  This is a common interface (task) to fill mars histograms. Every mars   //
+//  histogram which is derived from MH can be filled with this task.        //
+//                                                                          //
+//  You must specifiy the parameter container with which data the histogram //
+//  container should be filled, and the histogram container which has       //
+//  to be filled. This can be done by either specifing the name of the      //
+//  objects in the parameter list or by specifiing a pointer to the object. //
+//  (s. Constructor)                                                        //
+//                                                                          //
+//  Input Containers:                                                       //
+//   A parameter container                                                  //
+//                                                                          //
+//  Output Containers:                                                      //
+//   A histogram container                                                  //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MFillH.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MH.h"
+#include "MParList.h"
+
+ClassImp(MFillH);
+
+// --------------------------------------------------------------------------
+//
+// Initializes name and title of the object. It is called by all
+// constructors.
+//
+void MFillH::Init(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MFillH";
+    *fTitle = title ? title : "Task to fill Mars histograms";
+}
+
+// --------------------------------------------------------------------------
+//
+// Constructor.
+//
+// - par is the name of the parameter container which should be filled into
+//   the histogram
+// - hist is the name of the histogram container (which must have been
+//   derived from MH)
+//
+MFillH::MFillH(const char *par, const char *hist, const char *name, const char *title)
+{
+    Init(name, title);
+
+    fParContainerName = par;
+    fHName = hist;
+}
+
+// --------------------------------------------------------------------------
+//
+// Constructor.
+//
+// - par is a pointer to the instance of your parameter container from which
+//   the data should be used to fill the histogram.
+// - hist is the name of the histogram container (which must have been
+//   derived from MH)
+//
+MFillH::MFillH(const MParContainer *par, const char *hist, const char *name, const char *title)
+{
+    Init(name, title);
+
+    fParContainer = par;
+    fHName = hist;
+}
+
+// --------------------------------------------------------------------------
+//
+// Constructor.
+//
+// - par is a pointer to the instance of your parameter container from which
+//   the data should be used to fill the histogram.
+// - hist is a pointer to the instance of your histogram container (which must
+//   have been derived from MH) into which the data should flow
+//
+MFillH::MFillH(const char *par, MH *hist, const char *name, const char *title)
+{
+    Init(name, title);
+
+    fParContainerName = par;
+    fH = hist;
+}
+
+// --------------------------------------------------------------------------
+//
+// Constructor.
+//
+// - par is a pointer to the instance of your parameter container from which
+//   the data should be used to fill the histogram.
+// - hist is the name of the histogram container (which must have been
+//   derived from MH)
+//
+MFillH::MFillH(const MParContainer *par, MH *hist, const char *name, const char *title)
+{
+    Init(name, title);
+
+    fParContainer = par;
+    fH = hist;
+}
+
+// --------------------------------------------------------------------------
+//
+// Checks the parameter list for the existance of the parameter container. If
+// the name of it was given in the constructor. It checks also for the
+// existance of the histogram container in the parameter list if a name was
+// given. If it is not available it tried to create a histogram container
+// with the same type as the given object name.
+//
+Bool_t MFillH::PreProcess(MParList *pList)
+{
+    if (!fParContainer)
+    {
+        fParContainer = (MParContainer*)pList->FindObject(fParContainerName);
+        if (!fParContainer)
+        {
+            *fLog << dbginf << fParContainerName << " not found... aborting." << endl;
+            return kFALSE;
+        }
+    }
+
+    if (!fH)
+    {
+        fH = (MH*)pList->FindCreateObj(fHName);
+        if (!fH)
+            return kFALSE;
+    }
+
+    return kTRUE;
+} 
+
+// --------------------------------------------------------------------------
+//
+// Fills the data from the parameter conatiner into the histogram container
+//
+Bool_t MFillH::Process()
+{
+    fH->Fill(fParContainer);
+
+    return kTRUE;
+} 
+
+// --------------------------------------------------------------------------
+//
+// Set the ReadyToSave flag of the histogram container, because now all data
+// has been filled into the histogram.
+//
+Bool_t MFillH::PostProcess()
+{
+    fH->SetReadyToSave();
+    return kTRUE;
+}
Index: /tags/Mars_V0-4/Mars/mhist/MFillH.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillH.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillH.h	(revision 9634)
@@ -0,0 +1,40 @@
+#ifndef MFILLH_H
+#define MFILLH_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MH;
+class MParList;
+
+class MFillH : public MTask
+{
+private:
+    const MParContainer *fParContainer;
+    TString fParContainerName;
+
+    MH* fH;
+    TString fHName;
+
+    void Init(const char *name, const char *title);
+
+public:
+    MFillH(const char *par,          const char *hist, const char *name=NULL, const char *title=NULL);
+    MFillH(const MParContainer *par, const char *hist, const char *name=NULL, const char *title=NULL);
+    MFillH(const char *par,          MH *hist,         const char *name=NULL, const char *title=NULL);
+    MFillH(const MParContainer *par, MH *hist,         const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MFillH, 0) // Task to fill the Hillas parameters into histograms
+};
+    
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MFillHFadc.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillHFadc.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillHFadc.cc	(revision 9634)
@@ -0,0 +1,103 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MFillHFadc                                                              //
+//                                                                          //
+//  This task fill the n time slices from all pixels                        //
+//  (stored in a MRawEvtData container) into histograms.                    //
+//  This histograms (one per pixel) are stored in MHFadcCam, MHFadcPix      //
+//                                                                          //
+//  Input Containers:                                                       //
+//   MRawEvtData                                                            //
+//                                                                          //
+//  Output Containers:                                                      //
+//   MHFadcCam                                                              //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MFillHFadc.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MParList.h"
+#include "MHFadcCam.h"
+#include "MRawEvtData.h"
+#include "MRawEvtPixelIter.h"
+
+ClassImp(MFillHFadc);
+
+// --------------------------------------------------------------------------
+MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL)
+{
+  *fName  = name  ? name  : "MFillHFadc";
+  *fTitle = title ? title : "Task to fill the adc spectra with  raw data";
+}
+
+// --------------------------------------------------------------------------
+//
+// The PrProcess function checks for the existance of all necessary
+// parameter containers
+//
+Bool_t MFillHFadc::PreProcess (MParList *pList)
+{
+    //
+    // check if all necessary input containers are existing
+    //
+    fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData");
+    if (!fRawEvtData)
+    {
+        *fLog << dbginf << "MRawEvtData not found... exit." << endl;
+        return kFALSE;
+    }
+
+    //
+    // check if the output containers are existing, if not craete them
+    //
+    fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam");
+    if (!fHistos)
+        return kFALSE;
+
+    return kTRUE;
+} 
+
+// --------------------------------------------------------------------------
+//
+// This process function loops over all pixels in an MRawEvtData
+// event and fills the values into histograms
+//
+Bool_t MFillHFadc::Process()
+{
+    //  loop over the pixels and fill the values in the histograms
+    fHistos->Fill(fRawEvtData);
+    return kTRUE;
+}
+
+Bool_t MFillHFadc::PostProcess()
+{
+    fHistos->SetReadyToSave();
+    return kTRUE;
+}
Index: /tags/Mars_V0-4/Mars/mhist/MFillHFadc.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillHFadc.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillHFadc.h	(revision 9634)
@@ -0,0 +1,33 @@
+#ifndef MFILLHFADC_H
+#define MFILLHFADC_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MHFadcCam;
+class MRawEvtData;
+
+class MFillHFadc : public MTask
+{
+private:
+    MRawEvtData *fRawEvtData; // The raw event data from which the spektrum is created
+    MHFadcCam   *fHistos ;    // The histogram container into which holds the spektrum
+
+public:
+    MFillHFadc (const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MFillHFadc, 0)  // Task to fill the fadc data into histograms
+};
+    
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MFillHHillas.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillHHillas.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillHHillas.cc	(revision 9634)
@@ -0,0 +1,87 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MFillHHillas                                                            //
+//                                                                          //
+//  This task fills the hillas parameter from MHillas into                  //
+//  histograms (MHHillas)                                                   //
+//                                                                          //
+//  Input Containers:                                                       //
+//   MHillas                                                                //
+//                                                                          //
+//  Output Containers:                                                      //
+//   MHHillas                                                               //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MFillHHillas.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MHillas.h"
+#include "MHHillas.h"
+#include "MParList.h"
+
+ClassImp(MFillHHillas);
+
+// --------------------------------------------------------------------------
+MFillHHillas::MFillHHillas (const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MFillHHillas";
+    *fTitle = title ? title : "Task to fill Hillas histograms";
+}
+
+// --------------------------------------------------------------------------
+Bool_t MFillHHillas::PreProcess (MParList *pList)
+{
+    fEvt = (MHillas*)pList->FindObject("MHillas");
+    if (!fEvt)
+    {
+        *fLog << dbginf << "MHillas not found... aborting." << endl;
+        return kFALSE ;
+    }
+
+    fHistos = (MHHillas*)pList->FindCreateObj("MHHillas");
+    if (!fHistos)
+        return kFALSE;
+
+    return kTRUE ;
+} 
+
+// --------------------------------------------------------------------------
+Bool_t MFillHHillas::Process()
+{
+    fHistos->Fill(fEvt);
+
+    return kTRUE;
+} 
+
+Bool_t MFillHHillas::PostProcess()
+{
+    fHistos->SetReadyToSave();
+    return kTRUE;
+}
Index: /tags/Mars_V0-4/Mars/mhist/MFillHHillas.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillHHillas.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillHHillas.h	(revision 9634)
@@ -0,0 +1,32 @@
+#ifndef MFILLHHILLAS_H
+#define MFILLHHILLAS_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MHHillas;
+class MHillas;
+
+class MFillHHillas : public MTask {
+ private:
+  const MHillas *fEvt;
+  MHHillas *fHistos ;
+
+ public:   
+  MFillHHillas (const char *name=NULL, const char *title=NULL); 
+
+  Bool_t PreProcess(MParList *pList);
+  Bool_t Process();
+  Bool_t PostProcess();
+  
+  ClassDef(MFillHHillas, 0) // Task to fill the Hillas parameters into histograms
+};
+    
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MFillHStarMap.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillHStarMap.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillHStarMap.cc	(revision 9634)
@@ -0,0 +1,86 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MFillHStarMap                                                           //
+//                                                                          //
+//  This task fills a star map (a 2D histogram, MHStarMap)                  //
+//  from the calculated hillas parameter (MHillas).                         //
+//  The algorithm for this can be found in MHStarMap::Fill                  //
+//                                                                          //
+//  Input Containers:                                                       //
+//   MHillas                                                                //
+//                                                                          //
+//  Output Containers:                                                      //
+//   MHStarMap                                                              //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+#include "MFillHStarMap.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MHStarMap.h"
+#include "MHillas.h"
+#include "MParList.h"
+
+ClassImp(MFillHStarMap);
+
+// --------------------------------------------------------------------------
+MFillHStarMap::MFillHStarMap (const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MFillHStarMap";
+    *fTitle = title ? title : "Task to fill a StarMap";
+}
+
+// --------------------------------------------------------------------------
+Bool_t MFillHStarMap::PreProcess (MParList *pList)
+{
+    fEvt = (MHillas*)pList->FindObject("MHillas");
+    if (!fEvt)
+    {
+        *fLog << dbginf << "MHillas not found... aborting." << endl;
+        return kFALSE ;
+    }
+
+    fHistos = (MHStarMap*)pList->FindCreateObj("MHStarMap");
+    if (!fHistos)
+        return kFALSE;
+
+    return kTRUE ;
+} 
+
+// --------------------------------------------------------------------------
+Bool_t MFillHStarMap::Process()
+{
+    fHistos->Fill(fEvt);
+
+    return kTRUE;
+} 
+
+Bool_t MFillHStarMap::PostProcess()
+{
+    fHistos->SetReadyToSave();
+    return kTRUE;
+} 
Index: /tags/Mars_V0-4/Mars/mhist/MFillHStarMap.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MFillHStarMap.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MFillHStarMap.h	(revision 9634)
@@ -0,0 +1,33 @@
+#ifndef MFILLHSTARMAP_H
+#define MFILLHSTARMAP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MHStarMap;
+class MHillas;
+
+class MFillHStarMap : public MTask
+{
+private:
+    const MHillas   *fEvt;
+    MHStarMap *fHistos ;
+
+public:
+    MFillHStarMap(const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MFillHStarMap, 0) // Task to fill a 2-dim histogram by the Hillas parameters
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MH.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MH.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MH.cc	(revision 9634)
@@ -0,0 +1,57 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  07/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//                                                                          //
+//  MH                                                                      //
+//                                                                          //
+//  This is a base tasks for mars histograms. It defines a common interface //
+//  for filling the histograms with data (MH::Fill) which is used by a      //
+//  common 'filler' (s. MFillH)                                             //
+//                                                                          //
+//  If you want to create your own histogram class the new class must be    //
+//  derived from MH (instead of the base MParContainer) and you must        //
+//  the fill function of MH. This is the function which is called to fill   //
+//  the histogram(s) by the data of a corresponding parameter container.    //
+//                                                                          //
+//////////////////////////////////////////////////////////////////////////////
+
+#include "MH.h"
+
+ClassImp(MH);
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor. It sets name and title only. Typically you won't
+// need to change this.
+//
+MH::MH(const char *name, const char *title)
+{
+    //
+    //   set the name and title of this object
+    //
+    *fName  = name  ? name  : "MH" ;
+    *fTitle = title ? title : "Base class for Mars histograms" ;
+}
+
Index: /tags/Mars_V0-4/Mars/mhist/MH.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MH.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MH.h	(revision 9634)
@@ -0,0 +1,23 @@
+#ifndef MH_H
+#define MH_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class MH : public MParContainer
+{
+public:
+     MH(const char *name=NULL, const char *title=NULL);
+
+    virtual void Fill(const MParContainer *par) = 0;
+
+    ClassDef(MH, 1) // Container which holds hostograms for the Hillas parameters
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MHFadcCam.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHFadcCam.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHFadcCam.cc	(revision 9634)
@@ -0,0 +1,119 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////
+//
+// MHFadcCam
+//
+// This class contains a list of MHFadcPix.
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHFadcCam.h"
+
+#include <TH1.h>
+
+#include "MRawEvtData.h"
+#include "MRawEvtPixelIter.h"
+
+ClassImp(MHFadcCam);
+
+// --------------------------------------------------------------------------
+//
+//  default constructor
+//  creates an a list of histograms for all pixels and both gain channels
+//
+MHFadcCam::MHFadcCam (const char *name, const char *title)
+{
+    //
+    //   set the name and title of this object
+    //
+    
+    *fName  = name  ? name  : "MHFadcCam" ;
+    *fTitle = title ? title : "Container for ADC spectra histograms" ;
+
+    //
+    //   loop over all Pixels and create two histograms
+    //   one for the Low and one for the High gain
+    //   connect all the histogram with the container fHist
+    //
+    fArray = new TObjArray(577);
+
+    for (Int_t i=0; i<577; i++)
+        (*fArray)[i] = new MHFadcPix(i);
+}
+
+// --------------------------------------------------------------------------
+MHFadcCam::~MHFadcCam ()
+{
+    delete fArray;
+}
+
+void MHFadcCam::Fill(const MParContainer *par)
+{
+    MRawEvtData *evt = (MRawEvtData*)par;
+
+    MRawEvtPixelIter pixel(evt);
+
+    const Int_t nhisamples = evt->GetNumHiGainSamples();
+    const Int_t nlosamples = evt->GetNumLoGainSamples();
+
+    while (pixel.Next())
+    {
+        const UInt_t id = pixel.GetPixelId();
+
+        for (Int_t i=0;  i<nhisamples; i++)
+            FillHi(id, pixel.GetHiGainFadcSamples()[i]);
+
+        if (!pixel.HasLoGain())
+            continue;
+
+        for (Int_t i=0; i<nlosamples; i++)
+            FillLo(id, pixel.GetLoGainFadcSamples()[i]);
+    }
+
+}
+/*void MHFadcCam::SaveHist(char *name)
+{
+    //
+    //   save all histogram in this class to a root file
+    //
+
+    //
+    // FIXME: Don't open a file and write to this file!
+    // just Fill the current container (or the two histograms
+    // to an open file. The user must choose a file before.
+    //
+    TFile out( name, "recreate") ;
+
+    //
+    //  loop over all pixels and write the files out
+    //
+
+    fHistLo->Write() ;
+    fHistHi->Write() ;
+}
+
+  */
Index: /tags/Mars_V0-4/Mars/mhist/MHFadcCam.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHFadcCam.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHFadcCam.h	(revision 9634)
@@ -0,0 +1,56 @@
+#ifndef MHFADCCAM_H
+#define MHFADCCAM_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+
+#ifndef MH_H
+#include "MH.h"
+#endif
+#ifndef MHFADCPIX_H
+#include "MHFadcPix.h"
+#endif
+
+class TH1F;
+
+class MHFadcCam : public MH
+{
+private:
+    TObjArray *fArray;	// List of Lo/Hi gain Histograms
+
+    void FillHi(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillHi(data); }
+    void FillLo(UInt_t ipix, Byte_t data) { (*this)[ipix]->FillLo(data); }
+
+public:
+     MHFadcCam(const char *name=NULL, const char *title=NULL);
+    ~MHFadcCam();
+
+    //    void SaveHist(char *name);
+
+    MHFadcPix *operator[](UInt_t i) { return (MHFadcPix*)(fArray->At(i)); }
+
+    TH1F *GetHistHi(UInt_t i)  { return (*this)[i]->GetHistHi(); }
+    TH1F *GetHistLo(UInt_t i)  { return (*this)[i]->GetHistLo(); }
+
+    void Fill(const MParContainer *par);
+
+    //
+    // FIXME! This should be replaced by a Draw(Option_t)-function
+    //
+    void DrawHi(UInt_t i)      { GetHistHi(i)->Draw(); }
+    void DrawLo(UInt_t i)      { GetHistLo(i)->Draw(); }
+
+    void DrawPix(UInt_t i)     { (*this)[i]->Draw(); }
+
+    Int_t GetEntries()         { return fArray->GetEntries(); }
+
+    ClassDef(MHFadcCam, 1) // A list of histograms storing the Fadc spektrum of one pixel
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MHFadcPix.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHFadcPix.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHFadcPix.cc	(revision 9634)
@@ -0,0 +1,94 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////
+//
+// MHFadcPix
+//
+// This container stores a hostogram to display an Fadc Spekrtum.
+// The spektrum of all the values measured by the Fadcs.
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHFadcPix.h"
+
+#include <TPad.h>
+
+ClassImp(MHFadcPix);
+
+// --------------------------------------------------------------------------
+//
+// Creates the histograms for lo and hi gain of one pixel
+//
+MHFadcPix::MHFadcPix(UInt_t pixid)
+{
+    // FIXME! Set the right axis titles and ... and ...
+    Char_t tmp1[40]="hi";
+    Char_t tmp2[40]="hi gain Pixel";
+
+    if (pixid)
+    {
+        sprintf(tmp1, "%s%d",  tmp1, pixid);
+        sprintf(tmp2, "%s %d", tmp2, pixid);
+    }
+    fHistHi =  new TH1F(tmp1, tmp2, 256, 0, 255);
+
+
+    Char_t tmp3[40]="lo";
+    Char_t tmp4[40]="lo gain Pixel";
+
+    if (pixid)
+    {
+        sprintf(tmp3, "%s%d",  tmp3, pixid);
+        sprintf(tmp4, "%s %d", tmp4, pixid);
+    }
+    fHistLo =  new TH1F(tmp3, tmp4, 256, 0, 255);
+}
+
+// --------------------------------------------------------------------------
+MHFadcPix::~MHFadcPix()
+{
+    delete fHistHi;
+    delete fHistLo;
+}
+
+// --------------------------------------------------------------------------
+void MHFadcPix::Draw(Option_t *)
+{
+    if (!gPad)
+    {
+        if (!gROOT->GetMakeDefCanvas())
+            return;
+        (gROOT->GetMakeDefCanvas())();
+    }
+
+    gPad->Divide(1, 2);
+
+    gPad->cd(0);
+    fHistHi->Draw();
+
+    gPad->cd(1);
+    fHistLo->Draw();
+}
Index: /tags/Mars_V0-4/Mars/mhist/MHFadcPix.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHFadcPix.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHFadcPix.h	(revision 9634)
@@ -0,0 +1,37 @@
+#ifndef MHFADCPIX_H
+#define MHFADCPIX_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+
+class MHFadcPix : public TObject
+{
+private:
+    TH1F *fHistHi;
+    TH1F *fHistLo;
+
+public:
+    MHFadcPix(UInt_t pixid=0);
+    ~MHFadcPix();
+
+    TH1F *GetHistHi() { return fHistHi; }
+    TH1F *GetHistLo() { return fHistLo; }
+
+    void FillHi(Byte_t i) { fHistHi->Fill(i); }
+    void FillLo(Byte_t i) { fHistLo->Fill(i); }
+
+    void DrawHi() { fHistHi->Draw(); }
+    void DrawLo() { fHistLo->Draw(); }
+
+    void Draw(Option_t *opt=NULL);
+
+    ClassDef(MHFadcPix, 1) // Conatiner to hold two histograms container spektrums for the lo-/hi gain of one pixel
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MHHillas.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHHillas.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHHillas.cc	(revision 9634)
@@ -0,0 +1,102 @@
+///////////////////////////////////////////////////////////////////////
+//
+// MHHillas
+//
+// This class contains histograms for every Hillas parameter
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHHillas.h"
+
+#include <math.h>
+
+#include <TH1.h>
+#include <TPad.h>
+#include <TCanvas.h>
+
+#include "MHillas.h"
+
+ClassImp(MHHillas);
+
+MHHillas::MHHillas (const char *name, const char *title)
+{
+    //
+    //  default constructor
+    //  creates an a list of histograms for all pixels and both gain channels
+    //
+
+    //
+    //   set the name and title of this object
+    //
+    
+    *fName  = name  ? name  : "MHHillas" ;
+    *fTitle = title ? title : "Container for Hillas histograms" ;
+
+    //
+    // loop over all Pixels and create two histograms
+    // one for the Low and one for the High gain
+    // connect all the histogram with the container fHist
+    //
+    // FIXME! Make the histograms looking that they can be used for
+    //        presentations (axis title, ...)
+    //
+    fAlpha  = new TH1F("Alpha [deg]", "Alpha of Hillas",   90, 0,  90);
+    fWidth  = new TH1F("Width [mm]",  "Width of Hillas",  100, 0, 300);
+    fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
+    fDist   = new TH1F("Dist [mm]",   "Dist of Hillas",   100, 0, 300);
+
+    fAlpha->GetXaxis()->SetTitle("Alpha [deg]");
+    fLength->GetXaxis()->SetTitle("Length [mm]");
+    fDist->GetXaxis()->SetTitle("Dist [mm]");
+    fWidth->GetXaxis()->SetTitle("Width [mm]");
+
+    fAlpha->GetYaxis()->SetTitle("Counts");
+    fLength->GetYaxis()->SetTitle("Counts");
+    fDist->GetYaxis()->SetTitle("Counts");
+    fWidth->GetYaxis()->SetTitle("Counts");
+}
+
+MHHillas::~MHHillas()
+{
+    delete fAlpha;
+    delete fWidth;
+    delete fLength;
+    delete fDist;
+}
+
+void MHHillas::Fill(const MParContainer *par)
+{
+    MHillas &h = *(MHillas*)par;
+
+    fAlpha ->Fill(fabs(h.GetAlpha()));
+    fWidth ->Fill(h.GetWidth());
+    fLength->Fill(h.GetLength());
+    fDist  ->Fill(h.GetDist());
+}
+
+void MHHillas::Draw(Option_t *)
+{
+
+    //
+    // Fixme! Check for an existing canvas.
+    // And create one if no canvas exists only!
+    //
+    TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
+    c->Divide(2,2);
+
+    c->cd(1);
+    fAlpha->SetBit(kCanDelete);
+    fAlpha->Draw();
+    c->cd(2);
+    fLength->SetBit(kCanDelete);
+    fLength->Draw();
+    c->cd(3);
+    fDist->SetBit(kCanDelete);
+    fDist->Draw();
+    c->cd(4);
+    fWidth->SetBit(kCanDelete);
+    fWidth->Draw();
+
+    c->Modified();
+    c->Update();
+}
Index: /tags/Mars_V0-4/Mars/mhist/MHHillas.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHHillas.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHHillas.h	(revision 9634)
@@ -0,0 +1,40 @@
+#ifndef MHHILLAS_H
+#define MHHILLAS_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MH_H
+#include "MH.h"
+#endif
+
+class TH1F;
+class MHillas;
+
+class MHHillas : public MH
+{
+private:
+    TH1F *fAlpha;
+    TH1F *fWidth;
+    TH1F *fLength;
+    TH1F *fDist;
+
+public:
+     MHHillas(const char *name=NULL, const char *title=NULL);
+    ~MHHillas();
+
+    void Fill(const MParContainer *par);
+
+    TH1F *GetHistAlpha()  { return fAlpha; }
+    TH1F *GetHistWidth()  { return fWidth; }
+    TH1F *GetHistLength() { return fLength; }
+    TH1F *GetHistDist()   { return fDist; }
+
+    void Draw(Option_t *opt=NULL);
+
+    ClassDef(MHHillas, 1) // Container which holds hostograms for the Hillas parameters
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/MHMcCollectionArea.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHMcCollectionArea.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHMcCollectionArea.cc	(revision 9634)
@@ -0,0 +1,176 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!              Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MHMcCollectionArea.h" 
+
+#include <TH2.h>
+#include <TCanvas.h>
+
+ClassImp(MHMcCollectionArea);
+
+MHMcCollectionArea::MHMcCollectionArea(const char *name, const char *title)
+{ 
+    //
+    //   default constructor
+    //
+
+    //   initialize the histogram for the distribution r vs E
+    //
+    //   we set the energy range from 1 Gev to 10000 GeV (in log 5 orders
+    //   of magnitude) and for each order we take 10 subdivision --> 50 xbins
+    //
+    //   we set the radius range from 0 m to 500 m with 10 m bin --> 50 ybins
+
+  
+    *fName  = name  ? name  : "MHMcCollectionArea";
+    *fTitle = title ? title : "Data to Calculate Coll-Area";
+
+
+    fHistAll = new TH2D("All Events", "All showers - Radius vs log(E) distribution",
+                        50, 0., 5.,
+                        50, 0., 500.);
+
+    fHistAll->SetXTitle("log(E/GeV)");
+    fHistAll->SetYTitle("r/m");
+    fHistAll->SetZTitle("N");
+
+    fHistSel = new TH2D("Selected Events", "Selected showers - Radius vs log(E) distribution",
+                        50, 0., 5.,
+                        50, 0., 500.);
+
+    fHistSel->SetXTitle("log(E/GeV)");
+    fHistSel->SetYTitle("r/m");
+    fHistSel->SetYTitle("N");
+
+    fHistCol = new TH1D("Area", "Collection Area vs. log(E)",
+                        50, 0., 5.);
+
+    fHistCol->SetXTitle("log(E/GeV)");
+    fHistCol->SetYTitle("A/m^2");
+}
+
+MHMcCollectionArea::~MHMcCollectionArea()
+{
+    delete fHistAll;
+    delete fHistSel;
+    delete fHistCol;
+}
+
+void MHMcCollectionArea::FillAll(Float_t log10E, Float_t radius)
+{
+    fHistAll->Fill(log10E, radius);
+}
+
+void MHMcCollectionArea::FillSel(Float_t log10E, Float_t radius)
+{
+    fHistSel->Fill(log10E, radius);
+}
+
+void MHMcCollectionArea::DrawAll(Option_t* option)
+{
+    TCanvas *c=new TCanvas(fHistAll->GetName(), fHistAll->GetTitle());
+
+    fHistSel->Draw(option);
+
+    c->Modified();
+    c->Update();
+}
+
+void MHMcCollectionArea::DrawSel(Option_t* option)
+{
+    TCanvas *c=new TCanvas(fHistSel->GetName(), fHistSel->GetTitle());
+
+    fHistSel->Draw(option);
+
+    c->Modified();
+    c->Update();
+}
+
+void MHMcCollectionArea::Draw(Option_t* option)
+{
+    TCanvas *c=new TCanvas(fHistCol->GetName(), fHistCol->GetTitle());
+
+    fHistCol->Draw(option);
+
+    c->Modified();
+    c->Update();
+}
+
+void MHMcCollectionArea::CalcEfficiency()
+{
+    // Description!
+
+    //
+    //  first of all calculate the efficency
+    //  do it here by hand to get the right error of efficency
+    //
+    const Int_t nbinx = fHistSel->GetXaxis()->GetNbins();
+    const Int_t nbiny = fHistSel->GetYaxis()->GetNbins();
+
+    for (Int_t ix=1; ix<=nbinx; ix++)
+    {
+        for (Int_t iy=1; iy<=nbiny; iy++)
+        {
+            const Float_t Ns = fHistSel->GetCellContent(ix, iy);
+            const Float_t Na = fHistAll->GetCellContent(ix, iy);
+
+            if (Na <= 0)
+                continue;
+
+            const Double_t eff = Ns/Na;
+            const Double_t err = sqrt(Na + Na*Ns - Ns*Ns - Ns) / (Na*Na);
+
+            fHistSel->SetCellContent(ix, iy, eff);
+            fHistSel->SetCellError(ix, iy, err);
+        }
+    }
+
+    //
+    //  now calculate the Collection area for different
+    //  energies
+    //
+    for (Int_t ix=1; ix<=nbinx; ix++)
+    {
+        Double_t errA = 0;
+        Double_t colA = 0;
+
+        for (Int_t iy=1; iy<=nbiny; iy++)
+        {
+            const Double_t r1  = fHistSel->GetYaxis()->GetBinLowEdge(iy);
+            const Double_t r2  = fHistSel->GetYaxis()->GetBinLowEdge(iy+1);
+
+            const Double_t A   = TMath::Pi() * (r2*r2 - r1*r1);
+
+            const Double_t eff = fHistSel->GetCellContent(ix, iy);
+            const Double_t err = fHistSel->GetCellError(ix, iy);
+
+            colA += eff*A;
+            errA += A*A * err*err;
+        }
+
+        fHistCol->SetBinContent(ix, colA);
+        fHistCol->SetBinError(ix, sqrt(errA));
+    }
+}
Index: /tags/Mars_V0-4/Mars/mhist/MHMcCollectionArea.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHMcCollectionArea.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHMcCollectionArea.h	(revision 9634)
@@ -0,0 +1,45 @@
+#ifndef MHMCCOLLECTIONAREA_H
+#define MHMCCOLLECTIONAREA_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+//
+// because of some strange reason this cannot be put into MonteCarloIncl
+//
+#ifndef ROOT_TH1
+#include <TH1.h>
+#endif
+
+class TH2D;
+
+class MHMcCollectionArea : public MParContainer
+{
+private:
+    TH2D *fHistAll; //! all simulated showers
+    TH2D *fHistSel; //! the selected showers
+
+    TH1D *fHistCol; //  the collection area
+
+public:
+
+    MHMcCollectionArea(const char *name=NULL, const char *title=NULL);
+    ~MHMcCollectionArea();
+
+    void FillAll(Float_t log10E, Float_t radius);
+    void FillSel(Float_t log10E, Float_t radius);
+
+    void DrawAll(Option_t *option = "");
+    void DrawSel(Option_t *option = "");
+    void Draw   (Option_t *option = "");
+
+    void CalcEfficiency();
+
+    ClassDef(MHMcCollectionArea, 1)  //  Data Container to calculate Collection Area
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mhist/MHMcEnergy.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHMcEnergy.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHMcEnergy.cc	(revision 9634)
@@ -0,0 +1,223 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Javier Lopez 05/2001 (jlopez@ifae.es)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MHMcEnergy
+//
+// This class holds the information (histogram and fit function)
+// about the energy threshold for a particular trigger condition.
+//
+////////////////////////////////////////////////////////////////////////////
+#include "MHMcEnergy.h" 
+
+#include <stdlib.h>
+#include <iostream.h>
+
+#include <TH1.h> 
+#include <TF1.h> 
+#include <TCanvas.h>
+#include <TPaveLabel.h> 
+
+ClassImp(MHMcEnergy);
+
+// -------------------------------------------------------------------------
+//
+//  Default Constructor.
+//
+MHMcEnergy::MHMcEnergy(const char *name, const char *title)
+{ 
+    *fTitle = title ? title : "Container for an energy distribution histogram";
+
+    //  - we initialize the histogram
+    //  - we have to give diferent names for the diferent histograms because
+    //    root don't allow us to have diferent histograms with the same name
+
+    fHist = new TH1F("", "", 40, 0.5, 4.5);
+    fHist->SetXTitle("log(E/GeV)");
+    fHist->SetYTitle("dN/dE");
+
+    SetName(name ? name : "MHMcEnergy");
+}
+
+// -------------------------------------------------------------------------
+//
+//  This doesn't only set the name. It tries to get the number from the
+//  name and creates also name and title of the histogram.
+//
+//  This is necessary for example if a list of such MHMcEnergy histograms
+//  is created (s. MParList::CreateObjList)
+//
+void MHMcEnergy::SetName(const char *name)
+{
+    TString cname(name);
+    const char *semicolon = strrchr(cname, ';');
+
+    UInt_t idx = semicolon ? atoi(semicolon+1) : 0;
+
+    *fName = cname;
+
+    char text[256];
+    if (idx>0)
+        sprintf(text, "Energy Distribution for trigger condition #%i", idx);
+    else
+        sprintf(text, "Energy Distribution");
+
+    char aux[256];
+    strcpy(aux, "log(E)");
+
+    if (idx>0)
+        sprintf(aux+strlen(aux), " #%i", idx);
+
+    fHist->SetName(aux);
+    fHist->SetTitle(text);
+}
+
+//-------------------------------------------------------------------------
+//
+//  Defualt Destructor
+//
+MHMcEnergy::~MHMcEnergy()
+{
+    delete fHist;
+}
+
+//--------------------------------------------------------------------------
+//
+//  Fill the histogram with the log10 of the energy for triggered events.
+//
+void MHMcEnergy::Fill(Float_t log10E, Float_t w)
+{
+    fHist->Fill(log10E, w);
+}
+
+// -------------------------------------------------------------------------
+//
+// Fitting function
+//
+void MHMcEnergy::Fit(Axis_t xxmin, Axis_t xxmax)
+{
+    //
+    // 0: don't draw the function (it is drawn together with the histogram)
+    // Q: quiet mode
+    //
+    fHist->Fit("gaus", "Q0", "", xxmin, xxmax);
+
+    TF1 *result = fHist->GetFunction("gaus");
+
+    fThreshold    = CalcThreshold(result);
+    fThresholdErr = CalcThresholdErr(result);
+    fGaussPeak    = CalcGaussPeak(result);
+    fGaussSigma   = CalcGaussSigma(result);
+}
+
+// ------------------------------------------------------------------------
+// 
+// Drawing function. It creates its own canvas.
+//
+void MHMcEnergy::Draw(Option_t *option)
+{
+    char text[256];
+
+    const Float_t min = fHist->GetMinimum();
+    const Float_t max = fHist->GetMaximum();
+    const Float_t sum = min+max;
+
+    TCanvas *c=new TCanvas(fHist->GetName(), fHist->GetTitle());
+
+    fHist->Draw(option);
+
+    sprintf(text, "Energy Threshold = %4.1f +- %4.1f GeV",
+            fThreshold, fThresholdErr);
+
+    TPaveLabel* label = new TPaveLabel(2.2, 0.75*sum, 4.4, 0.90*sum, text);
+    label->SetFillColor(10);
+    label->SetTextSize(0.3);
+    label->SetBit(kCanDelete);
+    label->Draw();
+
+    c->Modified();
+    c->Update();
+}
+
+// --------------------------------------------------------------------------
+//
+// Set the number of bins in the histogran.
+//
+void MHMcEnergy::SetNumBins(Int_t nbins)
+{
+    fHist->SetBins(nbins, 0.5, 4.5);
+}
+// --------------------------------------------------------------------------
+//
+// Write the threshold and its error in the standard output
+//
+void MHMcEnergy::Print(Option_t*)
+{
+    cout << "Threshold: " << fThreshold << " +- " << fThresholdErr << endl;
+}
+
+// -------------------------------------------------------------------------
+//
+//  Return the threshold
+//
+Float_t MHMcEnergy::CalcThreshold(TF1 *gauss)
+{
+    const Float_t p1 = gauss->GetParameter(1);
+
+    return pow(10, p1);
+}
+
+// -------------------------------------------------------------------------
+//
+// Return the error of the threshold.
+//
+Float_t MHMcEnergy::CalcThresholdErr(TF1 *gauss)
+{
+    const Float_t lg10  = log(10);
+    const Float_t p1    = gauss->GetParameter(1);
+    const Float_t p1err = gauss->GetParError(1);
+
+    // The error has into accuont the error in the fit
+    return pow(10, p1) * p1err * lg10;
+}
+
+// -------------------------------------------------------------------------
+//
+// Return the peak of the fitted gaussan function.
+//
+Float_t MHMcEnergy::CalcGaussPeak(TF1 *gauss)
+{
+    return gauss->GetParameter(1);
+}
+
+// -------------------------------------------------------------------------
+//
+// Return the sigma of the fitted gaussan function.
+//
+Float_t MHMcEnergy::CalcGaussSigma(TF1 *gauss)
+{
+    return gauss->GetParameter(2);
+}
+
Index: /tags/Mars_V0-4/Mars/mhist/MHMcEnergy.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHMcEnergy.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHMcEnergy.h	(revision 9634)
@@ -0,0 +1,54 @@
+#ifndef MHMCENERGY_H
+#define MHMCENERGY_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class TH1F;
+class TF1;
+
+class MHMcEnergy : public MParContainer
+{
+private:
+
+    TH1F *fHist;  // histogram with the logarith of the energy
+
+    Float_t fThreshold;
+    Float_t fThresholdErr;
+    Float_t fGaussPeak;
+    Float_t fGaussSigma;
+
+    Float_t CalcThreshold(TF1 *gauss);
+    Float_t CalcThresholdErr(TF1 *gauss);
+
+    Float_t CalcGaussPeak(TF1 *gauss);
+    Float_t CalcGaussSigma(TF1 *gauss);
+
+public:
+
+    MHMcEnergy(const char *name=NULL, const char *title=NULL);
+    ~MHMcEnergy();
+
+    void SetName(const char *name);
+
+    Float_t GetThreshold() const { return fThreshold; }
+    Float_t GetThresholdErr() const { return fThresholdErr; }
+
+    Float_t GetGaussPeak() const { return fGaussPeak; }
+    Float_t GetGaussSigma() const { return fGaussSigma; };
+
+    void Fill(Float_t log10E, Float_t w);
+    void Fit(Axis_t xxmin, Axis_t xxmax);
+    void SetNumBins(Int_t nbins = 100);
+
+    void Draw(Option_t* option = "");
+    void Print(Option_t* option = NULL);
+
+    ClassDef(MHMcEnergy, 1)  // Histogram container for montecarlo energy threshold
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mhist/MHMcRate.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHMcRate.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHMcRate.cc	(revision 9634)
@@ -0,0 +1,209 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MHMcRate.h" 
+
+#include "MLog.h"
+
+ClassImp(MHMcRate);
+
+void MHMcRate::Init(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MMcTriggerRate";
+    *fTitle = title ? title : "Task to calc the collection area ";
+
+    fPartId=0;              // Type of particle
+
+    fEnergyMax=0.0;         // Maximum Energy in GeV
+    fEnergyMin=1000000.0;   // Minimum Energy in GeV
+
+    fThetaMax=0.0;          // Maximum theta angle of run
+    fThetaMin=370.0;        // Minimum theta angle of run
+    fPhiMax=0.0;            // Maximum phi angle of run
+    fPhiMin=370.0;          // Minimum phi angle of run
+
+    fImpactMax=0.0;         // Maximum impact parameter
+    fImpactMin=100000.0;    // Minimum impact parameter
+
+    fBackTrig=-1.0;         // Number of triggers from background
+    fBackSim=-1.0;          // Number of simulated showers for the background
+
+    fTriggerRate= -1.0;        // Trigger rate in Hz
+    fTriggerRateError= -1.0;   // Estimated error for the trigger rate in Hz
+}
+
+// --------------------------------------------------------------------------
+//
+//  default constructor
+//  fills all member data with initial values
+//
+MHMcRate::MHMcRate(const char *name, const char *title)
+{
+    Init(name, title);
+
+    fSpecIndex=0.0;         // dn/dE = k * e^{- fSpecIndex}
+    fFlux0=-1.0;            // dn/dE = fFlux0 * E^{-a}
+
+    fShowerRate= -1.0;        // Showers rate in Hz
+    fShowerRateError=0.0;     // Estimated error of shower rate in Hz
+}
+
+// --------------------------------------------------------------------------
+//
+//  overloaded constructor I
+//  fills all member data with initial values and sets the rate of
+//  incident showers to ShowRate
+//
+MHMcRate::MHMcRate(Float_t showrate,
+                   const char *name, const char *title)
+{
+    Init(name, title);
+
+    fSpecIndex=0.0;         // dn/dE = k * e^{- fSpecIndex}
+    fFlux0=-1.0;            // dn/dE = fFlux0 * E^{-a}
+
+    fShowerRate= showrate;               // Showers rate in Hz
+    fShowerRateError=sqrt(showrate);     // Estimated error of shower rate in Hz
+}
+
+// --------------------------------------------------------------------------
+//
+//  overloaded constructor I
+//  fills all member data with initial values and sets the
+//  spectral index and the initial flux to SpecIndex and Flux0
+//
+MHMcRate::MHMcRate(Float_t specindex, Float_t flux0,
+                   const char *name, const char *title)
+{
+    Init(name, title);
+
+    fSpecIndex=specindex;   // dn/dE = k * e^{- fSpecIndex}
+    fFlux0=flux0;           // dn/dE = fFlux0 * E^{-a}
+
+    fShowerRate= -1.0;
+    fShowerRateError=0.0;
+}
+
+// --------------------------------------------------------------------------
+//
+//  set the particle that produces the showers in the athmosphere
+//
+void MHMcRate:: SetParticle(UShort_t part)
+{
+    fPartId=part;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Set the information about trigger due only to the background conditions
+//
+void MHMcRate::SetBackground (Float_t showers, Float_t triggers)
+{
+    fBackTrig=showers;      // Number of triggers from background
+    fBackSim=triggers;      // Number of simulated showers for the background
+}
+
+// --------------------------------------------------------------------------
+//
+//  update the limits for energy, theta, phi and impact parameter
+//
+void MHMcRate::UpdateBoundaries(Float_t energy, Float_t theta,
+                                Float_t phi, Float_t impact)
+{ 
+  // It updates the limit values 
+
+  if (fThetaMax<theta) fThetaMax=theta;
+  if (fThetaMin>theta) fThetaMin=theta;
+
+  if (fPhiMax<phi) fPhiMax=phi;
+  if (fPhiMin>phi) fPhiMin=phi;
+
+  if (fImpactMax<impact) fImpactMax=impact;
+  if (fImpactMin>impact) fImpactMin=impact;
+
+  if (fEnergyMax<energy) fEnergyMax=energy;
+  if (fEnergyMin>energy) fEnergyMin=energy;
+
+} 
+
+// --------------------------------------------------------------------------
+//
+//  compute the trigger rate
+//
+void MHMcRate::CalcRate(Float_t trig, Float_t anal, Float_t simu) 
+{ 
+    // It computes the trigger rate
+
+    // First one computes the rate of incident showers.
+    const Double_t specidx = 1.0-fSpecIndex;
+
+    const Double_t epowmax = pow(fEnergyMax, specidx);
+    const Double_t epowmin = pow(fEnergyMin, specidx);
+
+    fShowerRate = fFlux0/specidx*(epowmax-epowmin);
+
+    if (fPartId!=1)
+        fShowerRate *= (fPhiMax-fPhiMin)*(cos(fThetaMax)-cos(fThetaMin));
+
+    const Double_t impactdiff = fImpactMax-fImpactMin;
+
+    fShowerRate *= TMath::Pi()*(impactdiff/100.0*impactdiff/100.0);
+
+    fShowerRateError = sqrt(fShowerRate);
+
+    const Double_t anal2 = 1.0-anal*160.0e-9;
+    const Double_t back2 = fBackSim*160.0e-9;
+
+    // Then the trigger rate and its error is evaluated
+    if(fBackTrig<0){
+        fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) +
+                              (anal2*anal2*1/(fBackSim*back2*back2)));
+        fBackTrig=0;
+    }
+    else
+        fTriggerRateError = sqrt((trig*fShowerRate*fShowerRate/(simu*simu)) +
+                              (anal2*anal2*fBackTrig/(back2*back2)));
+
+    fTriggerRate = trig*fShowerRate/simu + anal2*fBackTrig/back2;
+}
+
+// --------------------------------------------------------------------------
+//
+//  print the trigger rate
+//
+void MHMcRate::Print(Option_t *)
+{
+    *fLog << "Incident rate " << fShowerRate << " Hz " << endl;
+    *fLog << "Trigger Rate " << fTriggerRate << " +- " << fTriggerRateError << " Hz" << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+//  draw the trigger rate
+//
+void MHMcRate::Draw(Option_t *)
+{ 
+  *fLog << "To be iplemented" << endl;
+} 
Index: /tags/Mars_V0-4/Mars/mhist/MHMcRate.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHMcRate.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHMcRate.h	(revision 9634)
@@ -0,0 +1,63 @@
+#ifndef MHMCRATE_H
+#define MHMCRATE_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class MHMcRate : public MParContainer
+{
+
+private:
+    UShort_t fPartId;           // Type of particle
+
+    Float_t fEnergyMax;         // Maximum Energy in GeV
+    Float_t fEnergyMin;         // Minimum Energy in GeV
+
+    Float_t fThetaMax;          // Maximum theta angle of run
+    Float_t fThetaMin;          // Minimum theta angle of run
+    Float_t fPhiMax;            // Maximum phi angle of run
+    Float_t fPhiMin;            // Minimum phi angle of run
+
+    Float_t fImpactMax;         // Maximum impact parameter
+    Float_t fImpactMin;         // Minimum impact parameter
+
+    Float_t fBackTrig;          // Number of triggers from background
+    Float_t fBackSim;           // Number of simulated showers for the background
+
+    Float_t fSpecIndex;         // dn/dE = k * e^{- fSpecIndex}
+    Float_t fFlux0;             // dn/dE = fFlux0 * E^{-a}
+
+    Float_t fShowerRate;        // Showers rate in Hz
+    Float_t fShowerRateError;   // Estimated error of shower rate in Hz
+
+    Float_t fTriggerRate;       // Trigger rate in Hz
+    Float_t fTriggerRateError;  // Estimated error for the trigger rate in Hz
+
+    void Init(const char *name, const char *title);
+
+public:
+
+    MHMcRate(const char *name=NULL, const char *title=NULL);
+    MHMcRate(Float_t showrate,
+             const char *name=NULL, const char *title=NULL);
+    MHMcRate(Float_t specindex, Float_t flux0,
+             const char *name=NULL, const char *title=NULL);
+
+    void SetParticle(UShort_t part);
+    void SetBackground(Float_t showers, Float_t triggers);
+
+    void UpdateBoundaries(Float_t energy, Float_t theta, Float_t phi, Float_t impact);
+
+    void CalcRate(Float_t trig, Float_t anal, Float_t simu);
+
+    void Print(Option_t *o=NULL);
+    void Draw(Option_t *o=NULL);
+
+    ClassDef(MHMcRate, 1)  //  Data Container to calculate Collection Area
+};
+
+#endif 
Index: /tags/Mars_V0-4/Mars/mhist/MHStarMap.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHStarMap.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHStarMap.cc	(revision 9634)
@@ -0,0 +1,161 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////
+//
+// MHStarMap
+//
+// This class contains a 2-dimensional histogram. It should show some
+// kind of star map. The algorith which calculates the star map
+// from the Hillas parameters (Fill) can be enhanced.
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHStarMap.h"
+
+#include <TH2.h>      // TH2F
+#include <TStyle.h>   // gStyle
+#include <TColor.h>   // SetRGB
+#include <TCanvas.h>  // TCanvas
+
+#include "MHillas.h"
+
+ClassImp(MHStarMap);
+
+MHStarMap::MHStarMap (const char *name, const char *title)
+{
+    //
+    //  default constructor
+    //  creates an a list of histograms for all pixels and both gain channels
+    //
+
+    //
+    //   set the name and title of this object
+    //
+    
+    *fName  = name  ? name  : "MHStarMap" ;
+    *fTitle = title ? title : "Container for a Star Map" ;
+
+    //
+    //   loop over all Pixels and create two histograms
+    //   one for the Low and one for the High gain
+    //   connect all the histogram with the container fHist
+    //
+    fStarMap = new TH2F("Star Map", "Counts",
+                        150, -300, 300,
+                        150, -300, 300);
+}
+
+MHStarMap::~MHStarMap()
+{
+    delete fStarMap;
+}
+
+void MHStarMap::Draw(Option_t *)
+{
+    //
+    // Creates a new canvas, creates a useful palette and
+    // draws the histogram in the new created canvas
+    //
+
+    TCanvas *c = new TCanvas("Star Map", "Star Map created from Hillas Parameters", 500, 500);
+
+    //
+    // Set the palette you wanna use:
+    //  - you could set the root "Pretty Palette Violet->Red" by
+    //    gStyle->SetPalette(1, 0), but in some cases this may look
+    //    confusing
+    //  - The maximum colors root allowes us to set by ourself
+    //    is 50 (idx: 51-100). This colors are set to a grayscaled
+    //    palette
+    //  - the number of contours must be two less than the number
+    //    of palette entries
+    //
+
+    const Int_t numg = 32; // number of gray scaled colors
+    const Int_t numw = 32; // number of white
+
+    Int_t palette[numg+numw];
+
+    //
+    // The first half of the colors are white.
+    // This is some kind of optical background supression
+    //
+    gROOT->GetColor(51)->SetRGB(1, 1, 1);
+
+    Int_t i;
+    for (i=0; i<numw; i++)
+        palette[i] = 51;
+
+    //
+    // now the (gray) scaled part is coming
+    //
+    for (;i<numw+numg; i++)
+    {
+        const Float_t gray = 1.0-(float)(i-numw)/(numg-1.0);
+
+        gROOT->GetColor(52+i)->SetRGB(gray, gray, gray);
+        palette[i] = 52+i;
+    }
+
+    //
+    // Set the palette and the number of contour levels
+    //
+    gStyle->SetPalette(numg+numw, palette);
+    fStarMap->SetContour(numg+numw-2);
+
+    // gStyle->SetPalette(1, 0);
+    fStarMap->Draw("colz");
+
+    c->Modified();
+    c->Update();
+}
+
+void MHStarMap::Fill(const MParContainer *par)
+{
+    const MHillas &h = *(MHillas*)par;
+
+    const float dist  = h.GetDist();
+    const float theta = h.GetTheta();
+    const float alpha = h.GetAlpha()/kRad2Deg;
+
+    const float m = tan(theta+alpha-kPI);
+    const float t = dist*(sin(theta)-cos(theta)*m);
+
+    if (m>-1 && m<1)
+        for (int x=-298; x<298; x+=4)
+        {
+            const float y = m*x+t;
+
+            fStarMap->Fill(x, y);
+        }
+    else
+        for (int y=-298; y<298; y+=4)
+        {
+            const float x = (y-t)/m;
+
+            fStarMap->Fill(x, y);
+        }
+}
+
Index: /tags/Mars_V0-4/Mars/mhist/MHStarMap.h
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/MHStarMap.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/MHStarMap.h	(revision 9634)
@@ -0,0 +1,38 @@
+#ifndef MHSTARMAP_H
+#define MHSTARMAP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef MH_H
+#include "MH.h"
+#endif
+
+#ifndef ROOT_TH2
+// what's the reason that we need this here? cint complains about it
+// if it is missing...
+#include <TH2.h>
+#endif
+
+class MHillas;
+
+class MHStarMap : public MH
+{
+private:
+    TH2F *fStarMap;
+
+public:
+     MHStarMap(const char *name=NULL, const char *title=NULL);
+    ~MHStarMap();
+
+    void Fill(const MParContainer *par);
+
+    TH2F *GetHist()               { return fStarMap; }
+    void Draw(Option_t *opt=NULL);
+
+    ClassDef(MHStarMap, 1) // Container to hold 2-dim histogram (starmap)
+};
+
+#endif
+
Index: /tags/Mars_V0-4/Mars/mhist/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mhist/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mhist/Makefile	(revision 9634)
@@ -0,0 +1,58 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Hist
+
+#
+# Library name to creatre
+#
+LIB   = mhist.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../mraw -I../manalysis
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MFillH.cc \
+	   MFillHFadc.cc \
+           MFillHHillas.cc \
+           MFillHStarMap.cc \
+           MH.cc \
+           MHFadcPix.cc \
+           MHFadcCam.cc \
+           MHHillas.cc \
+           MHStarMap.cc \
+           MHMcCollectionArea.cc \
+           MHMcEnergy.cc \
+	   MHMcRate.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mmain/MBrowser.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MBrowser.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MBrowser.cc	(revision 9634)
@@ -0,0 +1,385 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MBrowser.h"
+
+#include <TSystem.h>        // gSystem
+
+#include <TGTab.h>          // TGTab
+#include <TGMenu.h>         // TGPopupMenu
+#include <TGButton.h>       // TGTextButton
+#include <TGMsgBox.h>       // TGMsgBox
+#include <TGListBox.h>      // TGListBox
+#include <TGComboBox.h>     // TGComboBox
+#include <TGFSContainer.h>  // TGFileContainer
+
+#include <sys/stat.h>       // S_ISDIR
+
+#include <iostream.h>
+
+enum {
+    M_FILE_CLOSE          = 0x1000,
+    M_PBUTTON_CDIR_UP     = 0x1001,
+    M_PBUTTON_LIST_MODE   = 0x1002,
+    M_PBUTTON_DETAIL_MODE = 0x1003,
+    M_DIRBOX              = 0x1004
+};
+
+
+MBrowser::MBrowser(const TGWindow *main, const TGWindow *p,
+                     const UInt_t w, const UInt_t h)
+: TGTransientFrame(p?p:gClient->GetRoot(),
+                   main?main:gClient->GetRoot(), w, h)
+{
+
+    //
+    //    Main window to controll the october test
+    //
+
+    //    set non-gui members to starting values
+
+    fInputFile[0] = '\0';
+
+    //
+    //    First create the MenuBar.
+    //
+
+    //     Layout objects for menue.
+
+    fLayMenuBar  = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ;
+    fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ;
+
+    //  crate the menu bar
+
+    fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ;
+    fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ;
+    fFileMenu->Associate(this) ;
+
+    //  the button messages are handled by main frame (this)
+
+    fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ;
+    fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;
+    AddFrame(fMenuBar, fLayMenuBar ) ;
+
+    //
+    //    Create the top window with a lot of buttons
+    //
+    fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ;
+
+    fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+    fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+    fTop3 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
+
+    fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+    fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+    fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+    AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;
+
+    //
+    //    Create the low window with a tabs in it
+    //
+    fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ;
+
+    fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
+
+    //    create the first tab
+
+    fTab = new TGTab ( fFrameLow, 400, 400 ) ;
+
+    TGCompositeFrame *tf = fTab->AddTab("Input File") ;
+
+    fTabF1  = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ;
+    fTabF1a = new TGCompositeFrame(tf, 100, 100, kHorizontalFrame);
+    fTabF1b = new TGCompositeFrame(tf, 100, 100, kVerticalFrame);
+
+    tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ;
+    tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ;
+
+    fDir = new TGComboBox(fTabF1a, M_DIRBOX);
+    fDir->Resize(350, 20) ;
+    fDir->Associate(this);
+
+    fPicCdup   = fClient->GetPicture("tb_uplevel.xpm");
+    fPicList   = fClient->GetPicture("tb_list.xpm");
+    fPicDetail = fClient->GetPicture("tb_details.xpm") ;
+
+    fCdup = new TGPictureButton(fTabF1a, fPicCdup, M_PBUTTON_CDIR_UP ) ;
+    fCdup->SetToolTipText("One Level up!") ;
+    fCdup->Associate(this) ;
+
+    fListMode = new TGPictureButton(fTabF1a, fPicList, M_PBUTTON_LIST_MODE);
+    fListMode->SetToolTipText("List Mode") ;
+    fListMode->Associate(this);
+    fListMode->SetState(kButtonUp);
+    fListMode->AllowStayDown(kTRUE);
+
+    fDetail = new TGPictureButton(fTabF1a, fPicDetail, M_PBUTTON_DETAIL_MODE ) ;
+    fDetail->SetToolTipText("Details Mode") ;
+    fDetail->Associate(this) ;
+    fDetail->SetState(kButtonEngaged) ;
+    fDetail->AllowStayDown(kTRUE) ;
+
+    fTabF1a->AddFrame(fDir,      new TGLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX, 5, 5, 5, 5)) ;
+    fTabF1a->AddFrame(fCdup,     new TGLayoutHints(kLHintsLeft|kLHintsTop, 5, 5, 5, 5));
+    fTabF1a->AddFrame(fListMode, new TGLayoutHints(kLHintsLeft|kLHintsTop, 5, 5, 5, 5));
+    fTabF1a->AddFrame(fDetail,   new TGLayoutHints(kLHintsLeft|kLHintsTop, 5, 5, 5, 5));
+
+    fFileView = new TGListView(fTabF1b, 540, 380 ) ;
+    fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
+                                    kVerticalFrame, fgWhitePixel) ;
+
+    fFileCont->Associate(this) ;
+    fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ;
+    fFileView->SetContainer(fFileCont) ;
+    fFileCont->SetFilter("*") ;
+//    fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ;
+    fFileView->SetViewMode(kLVDetails);
+    fFileCont->Sort(kSortByName) ;
+
+    fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ;
+
+    tf->AddFrame(fTabF1, fLayTab) ;
+
+    fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) );
+
+    AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ;
+
+    ChangeDir();
+    //
+    //   Map the window, set up the layout, etc.
+    //
+
+    SetWMSizeHints(400, 350, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
+}
+
+
+// ======================================================================
+// ======================================================================
+
+MBrowser::~MBrowser()
+{
+  //delete  fPicCdup, fPicList, fPicDetail; 
+    delete fLayTab;
+    delete fLayMenuBar;
+    delete fLayMenuItem;
+    delete fFileView;
+    delete fFileCont;
+    delete fCdup;
+    delete fListMode;
+    delete fDetail;
+    delete fDir ;
+    delete fTabF1b;
+    delete fTabF1a;
+    delete fTabF1;
+    delete fTop3;
+    delete fTop2;
+    delete fTop1;
+    delete fTab;
+    delete fFrameTop;
+    delete fFrameLow;
+    delete fFileMenu;
+    delete fMenuBar;
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+void MBrowser::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+  delete this ; 
+}
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MBrowser::InputFileSelected() 
+{
+    //
+    // Checks if there is a selected input root file
+    //
+    return fInputFile[0]!='\0';
+}
+
+
+// ======================================================================
+// ======================================================================
+
+void MBrowser::DisplError(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this, "Error!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+void MBrowser::DisplWarning(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this, "Warning!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+void MBrowser::DisplInfo(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this, "Information!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+void MBrowser::ChangeDir(const char *txt)
+{
+    fFileCont->ChangeDirectory(txt?txt:gSystem->WorkingDirectory());
+
+    const char  *dir = fFileCont->GetDirectory();
+    //    const UInt_t num = fDir->GetSelected()+1;
+
+    //
+    // FIXME: This is a big workaround!
+    //
+    fDir->InsertEntry(dir, -1/*num*/, -1);
+    fDir->Select(-1/*num*/);
+}
+
+Bool_t MBrowser::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+  // Process events generated by the buttons in the frame.
+  
+  switch (GET_MSG(msg))
+  {
+  case kC_COMMAND:
+      switch (GET_SUBMSG(msg))
+      {
+      case kCM_BUTTON:
+
+          switch (parm1)
+          {
+          case M_PBUTTON_CDIR_UP :
+              //
+	      //  goto the parent directory
+              //
+              ChangeDir("..");
+	      return kTRUE;
+	    
+	    case M_PBUTTON_LIST_MODE:
+	      fFileView->SetViewMode(kLVList) ; 
+              fDetail->SetState(kButtonUp) ;
+              return kTRUE;
+	      
+          case M_PBUTTON_DETAIL_MODE:
+              fFileView->SetViewMode(kLVDetails) ;
+              fListMode->SetState(kButtonUp) ;
+              return kTRUE;
+          }
+          return kTRUE;
+
+      case kCM_COMBOBOX:
+          //
+          // FIXME: Don't add the new entry to the list!
+          // But to do this we need the number of entries in the list.
+          //
+          if (parm1 == M_DIRBOX)
+              ChangeDir(((TGTextLBEntry*)fDir->GetSelectedEntry())->GetText()->GetString());
+          return kTRUE;
+
+	case kCM_MENU:
+	  if (parm1==M_FILE_CLOSE)
+              CloseWindow();
+          return kTRUE;
+      }
+      return kTRUE;
+      
+  case kC_CONTAINER:
+      switch (GET_SUBMSG(msg)) {
+
+          //      case kCT_ITEMCLICK:
+          // 	printf ("itemclick\n");
+          //      break;
+
+      case kCT_ITEMDBLCLICK:
+          //
+          //  process the double click in the file view container
+          //
+
+          if (parm1 != kButton1)
+              return kTRUE;
+
+          if (fFileCont->NumSelected() != 1 )
+              return kTRUE;
+
+          //
+          //  one file selected
+          //
+          void *dummy = NULL;
+          const TGFileItem *item = (TGFileItem *)fFileCont->GetNextSelected(&dummy);
+
+          const char *str = item->GetItemName()->GetString();
+
+          //
+          // if the user choose a directory
+          // change to this directory
+          //
+          if (S_ISDIR(item->GetType())) 
+          {
+              ChangeDir(str);
+              return kTRUE;
+          }
+
+          //
+          // file is no directory, is a file
+          //    determine the file type by extensions
+          //
+          const char *extension=strrchr(str, '.');
+
+          if (!extension)
+              return kTRUE;
+
+          const char *dir = fFileCont->GetDirectory();
+
+          if (!strcasecmp(extension, ".ps")) // postscript file
+          {
+              char *cmd = new char[strlen(dir)+strlen(str)+40];
+              sprintf(cmd, "gv %s/%s &", dir, str);
+              gSystem->Exec(cmd);
+              delete cmd;
+              return kTRUE;
+          }
+
+          if (!strcasecmp(extension, ".root"))
+          {
+              sprintf(fInputFile, "%s/%s", dir, str);
+              return kTRUE;
+          }
+          return kTRUE;
+      }
+  }
+  return kTRUE;
+} 
Index: /tags/Mars_V0-4/Mars/mmain/MBrowser.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MBrowser.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MBrowser.h	(revision 9634)
@@ -0,0 +1,97 @@
+#ifndef MBROWSER_H
+#define MBROWSER_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+class TGMenuBar;
+class TGPopupMenu;
+class TGTab;
+class TGComboBox;
+class TGTextButton;
+class TGListBox;
+class TGPictureButton;
+class TGFileContainer;
+class TGListView;
+
+class MBrowser : public TGTransientFrame
+{
+private:
+
+    //
+    // Create a main frame with a number of different buttons.
+    //
+
+    //   some member not connected with Gui
+
+    //  the things for the menu bar
+
+    TGMenuBar         *fMenuBar ;
+    TGPopupMenu       *fFileMenu ;
+
+    //
+    //   divide the Window in two different parts
+    //
+    TGCompositeFrame  *fFrameTop;   // top part of the main window
+    TGCompositeFrame  *fFrameLow;   // low part of the main window
+    TGTab             *fTab;        // different tabs in the low window
+
+    //
+    //   the things in the file selector
+    //
+    TGCompositeFrame  *fTabF1;     // first tab of low part
+    TGCompositeFrame  *fTabF1a;    // subpart of the file selector in low window
+    TGCompositeFrame  *fTabF1b;    // subpart of the file selector in low window
+    TGComboBox        *fDir;
+    TGPictureButton   *fCdup;
+    TGPictureButton   *fListMode;
+    TGPictureButton   *fDetail;
+    TGFileContainer   *fFileCont;
+    TGListView        *fFileView;
+
+    //     Layout hints for different uses
+
+    TGLayoutHints     *fLayMenuBar;
+    TGLayoutHints     *fLayMenuItem;
+    TGLayoutHints     *fLayTab;
+
+    //     some icons and pictures often used
+
+    const TGPicture   *fPicCdup;
+    const TGPicture   *fPicList;
+    const TGPicture   *fPicDetail;
+
+protected:
+    Char_t fInputFile[256];
+
+    void DisplError(const char *txt);
+    void DisplWarning(const char *txt);
+    void DisplInfo(const char *txt);
+
+    void ChangeDir(const char *txt=NULL);
+
+    TGHorizontalFrame *fTop1;
+    TGHorizontalFrame *fTop2;
+    TGHorizontalFrame *fTop3;
+
+ public: 
+     MBrowser(const TGWindow *main=NULL, const TGWindow *p=NULL,
+               const UInt_t w=500, const UInt_t h=500) ;
+
+     ~MBrowser();
+
+     void   CloseWindow();
+
+     Bool_t InputFileSelected();
+
+     virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+} ; 
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mmain/MDataCheck.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MDataCheck.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MDataCheck.cc	(revision 9634)
@@ -0,0 +1,120 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MDataCheck.h"
+
+#include <TGButton.h>  // TGTextButton
+
+ClassImp(MDataCheck)
+
+enum {
+  M_BUTTON_PEDADC,
+  M_BUTTON_CRADC,
+  M_BUTTON_PEDTDC,
+  M_BUTTON_CRTDC
+};
+
+MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p,
+                                 const UInt_t w, const UInt_t h)
+: MBrowser(main, p, w, h)
+{
+
+    fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
+    fButPedADC->Associate(this) ;
+    fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC );
+    fButCrADC->Associate(this) ;
+    fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC );
+    fButPedTDC->Associate(this) ;
+    fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC );
+    fButCrTDC->Associate(this) ;
+    fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("DataCheck Window");
+    SetIconName("DataCheck");
+
+    MapWindow();
+}
+
+MDataCheck::~MDataCheck()
+{
+    delete fButPedADC;
+    delete fButCrADC;
+    delete fButPedTDC;
+    delete fButCrTDC;
+} 
+
+// ======================================================================
+
+Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{     
+  // Process events generated by the buttons in the frame.
+  
+    if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON)
+        return MBrowser::ProcessMessage(msg, parm1, parm2);
+
+    switch (parm1)
+    {
+    case M_BUTTON_PEDADC:
+    case M_BUTTON_CRADC:
+    case M_BUTTON_PEDTDC:
+    case M_BUTTON_CRTDC:
+        if (!InputFileSelected())
+        {     
+            DisplError("No Input (root) File selected!");
+            return kTRUE;
+        }
+
+        switch (parm1)
+        {
+        case M_BUTTON_PEDADC:
+            fViewAdc.AdcSpectra(fInputFile, "PedEvents" ) ;
+            return kTRUE;
+
+        case M_BUTTON_CRADC:
+            fViewAdc.AdcSpectra(fInputFile, "Events" ) ;
+            return kTRUE;
+
+        case M_BUTTON_PEDTDC:
+            // fOctober.PedTdcSpectra(fInputFile) ;
+            return kTRUE;
+
+        case M_BUTTON_CRTDC:
+            return kTRUE;
+        }
+        return kTRUE;
+    }
+
+    return MBrowser::ProcessMessage(msg, parm1, parm2);
+} 
Index: /tags/Mars_V0-4/Mars/mmain/MDataCheck.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MDataCheck.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MDataCheck.h	(revision 9634)
@@ -0,0 +1,46 @@
+#ifndef MDATACHECK_H
+#define MDATACHECK_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+#ifndef MVIEWADCSPECTRA_H
+#include "MViewAdcSpectra.h"
+#endif
+
+#ifndef MBROWSER_H
+#include "MBrowser.h"
+#endif
+
+class TGTextButton;
+
+class MDataCheck : public MBrowser
+{
+private:
+
+    MViewAdcSpectra fViewAdc;
+
+    TGTextButton   *fButPedADC;
+    TGTextButton   *fButPedTDC;
+    TGTextButton   *fButCrADC;
+    TGTextButton   *fButCrTDC;
+
+public:
+    MDataCheck(const TGWindow *main=NULL, const TGWindow *p=NULL,
+                    const UInt_t w=500, const UInt_t h=500) ;
+
+    ~MDataCheck();
+
+    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MDataCheck, 0) // GUI: The 'data-check' window.
+};
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mmain/MEvtDisp.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MEvtDisp.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MEvtDisp.cc	(revision 9634)
@@ -0,0 +1,115 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MEvtDisp.h"
+
+#include <TGButton.h>       // TGTextButton
+
+#include "MGFadcDisp.h"
+
+ClassImp(MEvtDisp)
+
+enum {
+  M_BUT_DISP1_EVT,
+  M_BUT_DISP1_PED,
+  M_BUT_DISP1_CAL
+};
+
+MEvtDisp::MEvtDisp(const TGWindow *main, const TGWindow *p,
+                                 const UInt_t w, const UInt_t h)
+: MBrowser(main, p, w, h)
+{
+
+    fButFadcDispEvts = new TGTextButton(fTop1, "FADC Disp for Events", M_BUT_DISP1_EVT );
+    fButFadcDispEvts->Associate(this) ;
+    fTop1->AddFrame (fButFadcDispEvts, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButFadcDispPed  = new TGTextButton(fTop1, "FADC Disp for PedEvts", M_BUT_DISP1_PED );
+    fButFadcDispPed->Associate(this) ;
+    fTop1->AddFrame (fButFadcDispPed, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    fButFadcDispCal  = new TGTextButton(fTop1, "FADC Disp for CalEvts", M_BUT_DISP1_CAL );
+    fButFadcDispCal->Associate(this) ;
+    fTop1->AddFrame (fButFadcDispCal, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("EventDispMain");
+    SetIconName("EventDispMain");
+
+    MapWindow();
+} 
+
+MEvtDisp::~MEvtDisp()
+{
+    delete fButFadcDispCal; 
+    delete fButFadcDispPed; 
+    delete fButFadcDispEvts;
+} 
+
+// ======================================================================
+
+Bool_t MEvtDisp::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{     
+    // Process events generated by the buttons in the frame.
+
+    if (GET_MSG(msg) != kC_COMMAND || GET_SUBMSG(msg) != kCM_BUTTON)
+        return MBrowser::ProcessMessage(msg, parm1, parm2);
+
+    switch (parm1)
+    {
+    case M_BUT_DISP1_EVT:
+    case M_BUT_DISP1_PED:
+    case M_BUT_DISP1_CAL:
+        if (!InputFileSelected())
+        {        
+            DisplError("No Input (root) File selected!");
+            return kTRUE;
+        }
+
+        switch (parm1)
+        {
+        case M_BUT_DISP1_EVT:
+            new MGFadcDisp(fInputFile, "Events",
+                           fClient->GetRoot(), this, 600, 500);
+            return kTRUE;
+
+        case M_BUT_DISP1_PED:
+            new MGFadcDisp( fInputFile , "PedEvts",
+                            fClient->GetRoot(), this, 600, 500 ) ;
+            return kTRUE;
+
+        case M_BUT_DISP1_CAL:
+            new MGFadcDisp( fInputFile , "CalEvts",
+                            fClient->GetRoot(), this, 600, 500 ) ;
+            return kTRUE;
+        }
+        return kTRUE;
+    }
+
+    return MBrowser::ProcessMessage(msg, parm1, parm2);
+} 
Index: /tags/Mars_V0-4/Mars/mmain/MEvtDisp.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MEvtDisp.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MEvtDisp.h	(revision 9634)
@@ -0,0 +1,39 @@
+#ifndef MEVTDISP_H
+#define MEVTDISP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+#ifndef MBROWSER_H
+#include "MBrowser.h"
+#endif
+
+class TGTextButton;
+
+class MEvtDisp : public MBrowser
+{ 
+private:
+  
+  TGTextButton *fButFadcDispEvts;
+  TGTextButton *fButFadcDispPed;
+  TGTextButton *fButFadcDispCal;
+
+public:
+    MEvtDisp(const TGWindow *main=NULL, const TGWindow *p=NULL,
+                    const UInt_t w=500, const UInt_t h=500) ;
+
+    ~MEvtDisp();
+
+    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MEvtDisp, 0)
+};
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mmain/MGPrototyp.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MGPrototyp.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MGPrototyp.cc	(revision 9634)
@@ -0,0 +1,475 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MGPrototyp.h"
+
+#include <TSystem.h>        // gSystem
+
+#include <TGTab.h>          // TGTab
+#include <TGMenu.h>         // TGPopupMenu
+#include <TGButton.h>       // TGTextButton
+#include <TGMsgBox.h>       // TGMsgBox
+#include <TGListBox.h>      // TGListBox
+#include <TGFSContainer.h>  // TGFileContainer
+#include <TGSplitter.h>    // TGHorizontal3DLine
+#include <TGTextEntry.h> 
+#include <TGLabel.h>       // TGLabel
+
+
+// FIXME: Move to MAGIC.h
+#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
+
+ClassImp(MGPrototyp)
+
+enum CommandPrototyp {
+  M_FILE_CLOSE , 
+  M_BUTTON_ACTION, 
+
+  M_FILERESET, 
+  M_PBUTTON_CDIR_UP, 
+  M_PBUTTON_LIST_MODE, 
+  M_PBUTTON_DETAIL_MODE 
+} ; 
+
+
+MGPrototyp::MGPrototyp(const TGWindow *p, const TGWindow *main, 
+                            UInt_t w, UInt_t h ) 
+        : TGTransientFrame(p, main, w, h ) 
+{
+  //
+  //    Main window to controll the october test
+  //
+
+  //    set non-gui members to starting values 
+
+  sprintf ( fInputFile, "\n" ) ; 
+
+  //
+  //    First create the MenuBar.   
+  //
+
+  //     Layout objects for menue. 
+
+  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
+  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
+  
+  //  crate the menu bar
+
+  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
+  fFileMenu->AddEntry ("Close", M_FILE_CLOSE ) ; 
+  fFileMenu->Associate(this) ; 
+  
+  //  the button messages are handled by main frame (this) 
+
+  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
+  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
+  AddFrame(fMenuBar, fLayMenuBar ) ; 
+  
+  fLineSep1 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+  
+  //
+  //    Create the top window with a lot of buttons 
+  //
+
+  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ; 
+  
+  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
+
+  fButAction = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION );
+  fButAction->Associate(this) ;   
+  fTop1->AddFrame (fButAction, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+  
+  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsCenterX, 10, 10, 5, 5) );
+
+  AddFrame(fFrameTop, new TGLayoutHints (kLHintsTop ) ) ;   
+
+  //   a line between top and low frame
+  
+  fLineSep2 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+  //
+  //    Create the low window with a tabs in it
+  //
+
+  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
+  
+  fLayTab = new TGLayoutHints ( kLHintsExpandX   , 5, 5, 5, 5 ) ;
+
+  //    create the first tab
+
+  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
+
+  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
+  
+  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  //  tf->AddFrame(fTabF1, fLayTab ) ; 
+
+  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fTabF1b = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fTabF1c = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
+  //  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+  tf->AddFrame(fTabF1c,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+  
+  //   the items in the first subframe
+
+  fLabFileName = new TGLabel(fTabF1a, new TGString("selected File:") );
+  fTabF1a->AddFrame( fLabFileName, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fTxtFileName = new TGTextEntry(fTabF1a, fTxtBufFileName = new TGTextBuffer(256) );
+  fTxtFileName->Resize(60, fTxtFileName->GetDefaultHeight());
+  fTabF1a->AddFrame(fTxtFileName, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5)); 
+
+  fButFileReset = new TGTextButton (fTabF1a, "Reset", M_FILERESET ) ;
+  fButFileReset->Associate(this) ; 
+  fTabF1a->AddFrame (fButFileReset, new TGLayoutHints (kLHintsRight, 10, 10, 10, 10  ) ) ; 
+  
+  
+  
+  //   the items in the second subfraem
+
+  fLabDir = new TGLabel(fTabF1b, new TGString("Directory:") );
+  fTabF1b->AddFrame( fLabDir, new TGLayoutHints (kLHintsLeft, 10, 10, 10, 10)) ; 
+
+  fDir = new TGListBox(fTabF1b, -1) ; 
+  fDir->Resize(350,20) ;
+  char temp[100] ; 
+  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
+  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
+  fDir->AddEntry(temp, 1) ; 
+  fTabF1b->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+
+  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
+  fCdup = new TGPictureButton(fTabF1b, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
+  fCdup->SetToolTipText("One Level up!") ; 
+  fCdup->Associate(this) ; 
+  fTabF1b->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fPicList = fClient->GetPicture("tb_list.xpm") ; 
+  fListMode = new TGPictureButton(fTabF1b, fPicList, M_PBUTTON_LIST_MODE ) ; 
+  fListMode->SetToolTipText("List Mode") ; 
+  fListMode->Associate(this) ; 
+  fListMode->SetState(kButtonUp) ; 
+  fListMode->AllowStayDown(kTRUE) ; 
+  fListMode->AllowStayDown(kTRUE) ;  fTabF1b->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ;
+
+  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
+  fDetail = new TGPictureButton(fTabF1b, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
+  fDetail->SetToolTipText("Details Mode") ; 
+  fDetail->Associate(this) ; 
+  fDetail->SetState(kButtonEngaged) ; 
+  fDetail->AllowStayDown(kTRUE) ; 
+  fTabF1b->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  // the items in the third subframe
+
+  fFileView = new TGListView(fTabF1c, 540, 380 ) ; 
+  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
+				  kVerticalFrame, fgWhitePixel) ; 
+
+  fFileCont->Associate(this) ; 
+  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
+  fFileView->SetContainer(fFileCont) ; 
+  fFileCont->SetFilter("*") ; 
+  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
+  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
+  fFileView->SetViewMode(kLVDetails); 
+  fFileCont->Sort(kSortByName) ; 
+  
+  fTabF1c->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ) ; 
+
+  tf->AddFrame(fTabF1, fLayTab) ;
+ 
+  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
+
+  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
+
+  //
+  //   Map the window, set up the layout, etc. 
+  //
+
+  SetWMSizeHints(200, 250, 1000, 1000, 10, 10 ) ;      // set the smallest and biggest size of the Main frame
+
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("Prototyp");
+  SetIconName("Prototyp");
+  
+  MapWindow();
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+MGPrototyp::~MGPrototyp()
+{
+  //delete  fPicCdup, fPicList, fPicDetail; 
+    delete fLayTab;
+    delete fLayMenuBar;
+    delete fLayMenuItem;
+    delete fFileView;
+    delete fFileCont;
+    delete fCdup;
+    delete fListMode;
+    delete fDetail;
+    delete fDir ;
+    delete fLabDir ; 
+
+    delete fButFileReset ; 
+    delete fTxtFileName  ; 
+    delete fLabFileName  ; 
+    
+    delete fTabF1c;
+    delete fTabF1b;
+    delete fTabF1a;
+    delete fTabF1;
+    delete fButAction; 
+    delete fTop1;
+    delete fTab;
+
+    delete fFrameTop;
+    delete fFrameLow;
+    delete fLineSep2 ; 
+    delete fLineSep1 ; 
+
+    delete fFileMenu;
+    delete fMenuBar;
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+void MGPrototyp::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+  delete this ; 
+}
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGPrototyp::InputFileSelected() 
+{
+  //   Checks if there is a selected input root file
+   
+  if ( strcmp ( fInputFile, "\n") == 0 )
+    { 
+      return ( kFALSE ) ; 
+    } 
+  
+  return (kTRUE) ; 
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGPrototyp::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+  // Process events generated by the buttons in the frame.
+  
+  Int_t   buttons = 4, retval = 0 ; 
+  Char_t  wort[100] ;
+  Char_t  extens[5] ;
+  Char_t  command[110] ;
+ 
+  TGFileItem *item ;     // to process items in the file view container
+  void *np = NULL ;      // null pointer
+
+  switch (GET_MSG(msg)) 
+    {
+    case kC_COMMAND:
+      switch (GET_SUBMSG(msg)) 
+	{
+	case kCM_BUTTON:
+	  
+	  switch (parm1)
+	    {  
+
+	    case M_BUTTON_ACTION:
+	      	
+	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
+		
+		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
+			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
+		break ; 
+	      }      
+	      
+	      new TGMsgBox(fClient->GetRoot(), this, "INFORMATION!", 
+			   "Put Intelligence here!!!", kMBIconExclamation, buttons, &retval);
+
+	      break ; 
+		
+
+	    case M_FILERESET:
+	      
+	      sprintf ( fInputFile, "\n" ) ; 
+	      fTxtFileName->SetText( fInputFile ) ; 
+	      
+	      break; 
+	    case M_PBUTTON_CDIR_UP :
+
+	      //  goto the parent directory
+	      
+	      gSystem->ChangeDirectory("..") ; 
+	      fDir->RemoveEntry(1) ; 
+	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+	      fDir->AddEntry(wort,1) ; 
+	      fDir->MapSubwindows() ; 
+	      fDir->Layout() ; 
+	      fFileCont->ChangeDirectory( wort ) ; 
+	      fFileCont->DisplayDirectory() ; 
+	      
+	      break ; 
+	    
+	    case M_PBUTTON_LIST_MODE:
+	      fFileView->SetViewMode(kLVList) ; 
+	      fDetail->SetState(kButtonUp) ; 
+	      
+	      break ; 
+	      
+	    case M_PBUTTON_DETAIL_MODE:
+	      fFileView->SetViewMode(kLVDetails) ; 
+	      fListMode->SetState(kButtonUp) ; 
+	      
+	      break ;
+	      
+	    default:
+	      break ;
+	    } 
+
+	case kCM_MENU:
+
+	  switch (parm1) {
+	  case M_FILE_CLOSE:
+	    CloseWindow() ; 
+
+	    break; 
+	  }
+	  break ;
+	  
+	default:
+	  break ;
+	  
+	}
+      
+    case kC_CONTAINER: 
+      switch (GET_SUBMSG(msg)) {
+	
+	//      case kCT_ITEMCLICK:
+	// 	printf ("itemclick\n"); 
+	//      break; 
+	
+      
+      case kCT_ITEMDBLCLICK: 
+	//
+	//  process the double click in the file view container
+	//
+	
+	if ( parm1 == kButton1) {
+	  if ( fFileCont->NumSelected() == 1 ) {   
+	    //
+	    //  one file selected
+	    //	  
+	    item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
+	    
+	    if ( S_ISDIR(item->GetType()) )   // file is directory
+	      {  
+		//  goto directory 
+		
+		sprintf (wort, "%s", item->GetItemName()->GetString()) ;
+		fFileCont->ChangeDirectory ( wort ) ; 
+		gSystem->ChangeDirectory( wort ) ; 
+		
+		sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+		fDir->RemoveEntry(1) ; 
+		fDir->AddEntry( wort, 1 ) ; 
+		fDir->MapSubwindows() ; 
+		fDir->Layout() ; 
+	      }
+	    else                              // file is no directory, is a file 
+	      { 
+		sprintf (wort, "%s", item->GetItemName()->GetString() ) ; 
+	    
+		//    determine the file type by extensions
+		
+		for (Int_t i = 0 ; i<5; i++) 
+		  extens[i] = '\0' ; 
+		
+		for ( Int_t i=0; wort[i] != '\0'; i++) {
+		  if ( wort[i] == '.') {
+		    strncpy (extens, &wort[i+1], 4 ) ; 
+		    break ; 
+		  }
+		}
+		
+		if ( ! strcmp(extens, "ps") ) {              //     postscript file
+		  sprintf ( command, "gv %s/%s &", 
+			    gSystem->WorkingDirectory(), 
+			    wort ) ; 
+		  gSystem->Exec(command) ; 
+		  break ; 
+		}
+		else if  ( ! strcmp(extens, "root") ) {      //     root file
+		  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ;  
+		  fTxtFileName->SetText( fInputFile ) ;
+
+		  break ; 
+		}
+		
+	      } 
+	  }
+	}
+	break; 
+	
+      default:
+	break ;
+      }
+      
+      
+      
+    default:
+      break;
+    }
+  return kTRUE;
+} 
Index: /tags/Mars_V0-4/Mars/mmain/MGPrototyp.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MGPrototyp.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MGPrototyp.h	(revision 9634)
@@ -0,0 +1,101 @@
+#ifndef MGPROTOTYP_H
+#define MGPROTOTYP_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+class TGMenuBar;
+class TGPopupMenu;
+class TGTab;
+class TGTextButton;
+class TGListBox;
+class TGPictureButton;
+class TGFileContainer;
+class TGListView;
+class TGHorizontal3DLine;
+class TGLabel ; 
+class TGTextEntry ; 
+class TGTextBuffer; 
+
+class MGPrototyp : public TGTransientFrame {
+ private:
+  
+  //
+  // Create a main frame with a number of different buttons.
+  //
+
+  //   some member not connected with Gui 
+  
+  Char_t            fInputFile[256] ; 
+
+  //  the things for the menu bar 
+    
+  TGMenuBar         *fMenuBar ; 
+  TGPopupMenu       *fFileMenu ;
+  TGHorizontal3DLine *fLineSep1, *fLineSep2 ; 
+
+
+  //   divide the Window in two different parts
+  
+  TGCompositeFrame  *fFrameTop ;   // top part of the main window
+  TGCompositeFrame  *fFrameLow ;   // low part of the main window
+  TGTab             *fTab      ;   // different tabs in the low window
+  
+  //     the horizontal frame in the top part
+
+  TGHorizontalFrame *fTop1 ; 
+  
+  //   the buttons in the Top Part
+  
+  TGTextButton      *fButAction ; 
+  
+  //   the things in the file selector
+
+  TGCompositeFrame  *fTabF1 ;                       // first tab of low part 
+  TGCompositeFrame  *fTabF1a, *fTabF1b, *fTabF1c ;  // subpart of the file selector in low window
+
+  TGLabel           *fLabFileName ; 
+  TGTextEntry       *fTxtFileName ; 
+  TGTextBuffer      *fTxtBufFileName ; //!
+  TGTextButton      *fButFileReset ; 
+ 
+  TGLabel           *fLabDir ; 
+  TGListBox         *fDir ; 
+  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
+  TGFileContainer   *fFileCont ; 
+  TGListView        *fFileView ;
+
+  //     Layout hints for different uses 
+   
+  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
+  TGLayoutHints     *fLayTab ; 
+  
+  //     some icons and pictures often used
+  
+  const TGPicture   *fPicCdup;   //!
+  const TGPicture   *fPicList;   //!
+  const TGPicture   *fPicDetail; //!
+  
+ public: 
+  MGPrototyp(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h) ;
+  
+  ~MGPrototyp(); 
+  
+  void   CloseWindow()  ; 
+
+  Bool_t InputFileSelected() ; 
+  
+  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+  ClassDef(MGPrototyp, 0)
+
+} ; 
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mmain/MMars.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MMars.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MMars.cc	(revision 9634)
@@ -0,0 +1,261 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MMars.h"
+
+#include <TApplication.h>  // gROOT->GetApplication()->...
+
+#include <TGTab.h>         // TGTab
+#include <TGMenu.h>        // TGPopupMenu
+#include <TGMsgBox.h>      // TGMsgBox
+#include <TGButton.h>      // TGPictureButton
+#include <TG3DLine.h>      // TGHorizontal3DLine
+                           // use TGSplitter.h for root<3.00
+
+#include "MEvtDisp.h"
+#include "MDataCheck.h"
+#include "MMonteCarlo.h"
+
+#include "MGPrototyp.h"
+
+ClassImp(MMars)
+
+enum {
+  M_FILE_EXIT  ,
+  M_FILE_ABOUT  ,
+
+  M_PICTURE_MAGIC , 
+  M_PICTURE_MARS ,
+
+  M_BUTTON_EVTDISP ,
+  M_BUTTON_DATACHECK ,
+  M_BUTTON_ANALYSE ,
+  M_BUTTON_MONTECARLO 
+} ; 
+
+
+MMars::MMars(/*const TGWindow *p,*/ UInt_t w, UInt_t h)
+  : TGMainFrame(gClient->GetRoot(), w, h)
+{ 
+  //    First create the MenuBar.   
+  
+  //     Layout objects for menue. 
+
+  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
+  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
+  
+  //  crate the menu bar
+  
+  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
+  fFileMenu->AddEntry ("Exit", M_FILE_EXIT ) ; 
+  fFileMenu->Associate(this) ; 
+  
+  //  the button messages are handled by main frame (this) 
+  
+  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
+  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
+  AddFrame(fMenuBar, fLayMenuBar ) ; 
+
+  fLineSep = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+  
+  //   set up the top part of the main window with the logos
+
+  fTop = new TGHorizontalFrame (this, 300, 100 ) ;
+
+  fPicMagic = new TGPictureButton(fTop, 
+                                  gClient->GetPicture("magiclogo.xpm"), M_PICTURE_MAGIC );
+  fPicMagic->Associate(this) ; 
+  fTop->AddFrame ( fPicMagic, new TGLayoutHints(kLHintsLeft, 10., 10., 20., 10.) ) ; 
+
+  fPicMars = new TGPictureButton(fTop, 
+				 gClient->GetPicture("marslogo.xpm"), M_PICTURE_MARS );
+  fPicMars->Associate(this) ;
+  fTop->AddFrame ( fPicMars, new TGLayoutHints(kLHintsLeft, 10., 10., 10., 10.) ) ; 
+
+  AddFrame(fTop, new TGLayoutHints(kLHintsTop | kLHintsExpandX ) );  
+  
+  //  a seperator 
+
+  fLineSep2 = new TGHorizontal3DLine(this) ; 
+  AddFrame(fLineSep2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) );
+
+  //   the low part of the frame 
+
+  fLow = new TGHorizontalFrame (this, 300, 100 ) ;
+
+  //    create the first tab
+
+  fTab = new TGTab ( fLow, 400, 400 ) ;   
+
+  TGCompositeFrame *tf = fTab->AddTab("Control") ; 
+ 
+  fTabF1 = new TGVerticalFrame (tf, 300, 100) ; 
+
+  tf->AddFrame(fTabF1, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ) ; 
+
+  //     the buttons to go in the new window
+
+  fTabF2 = new TGVerticalFrame (tf, 300, 100) ; 
+  
+  fButLayout  = new TGLayoutHints(kLHintsTop | kLHintsCenterX , 10, 10, 10, 10) ; 
+
+  fButEvtDisp = new TGTextButton(fTabF2, "EventDisplay", M_BUTTON_EVTDISP  );
+  fButEvtDisp->Associate(this) ;  
+  fTabF2->AddFrame(fButEvtDisp, fButLayout ) ; 
+ 
+  fButDataCheck = new TGTextButton(fTabF2, "Data Check", M_BUTTON_DATACHECK  );
+  fButDataCheck->Associate(this) ;
+  fTabF2->AddFrame(fButDataCheck, fButLayout ) ; 
+
+  fButAnalys = new TGTextButton(fTabF2, "Analysis", M_BUTTON_ANALYSE  );
+  fButAnalys->Associate(this) ;
+  fTabF2->AddFrame(fButAnalys, fButLayout ) ; 
+
+  fButMonteCarlo = new TGTextButton(fTabF2, "MonteCarlo", M_BUTTON_MONTECARLO  );
+  fButMonteCarlo->Associate(this) ;
+  fTabF2->AddFrame(fButMonteCarlo, fButLayout ) ; 
+
+
+   
+
+  tf->AddFrame(fTabF2, new TGLayoutHints(kLHintsTop | kLHintsExpandX) ) ; 
+  
+  
+
+  fLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) );   
+  AddFrame(fLow, new TGLayoutHints(kLHintsTop | kLHintsExpandX ) );
+  
+  //   Map the window, set up the layout, etc. 
+  
+  SetWMSizeHints(400, 650, 1000, 1000, 10, 10 ) ;  // set the smallest and biggest size of the Main frame
+  
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("MARS Main Window");
+  SetIconName("MARS");
+  
+  MapWindow();
+
+} 
+
+// ======================================================================
+
+MMars::~MMars()
+{
+  
+    delete fButLayout;
+    delete fLayMenuBar;
+    delete fLayMenuItem;
+    delete fButEvtDisp;
+    delete fButDataCheck;
+    delete fButAnalys;
+    delete fButMonteCarlo;
+    delete fPicMagic;
+    delete fPicMars;
+    delete fTabF1;
+    delete fTabF2;
+    delete fTab;
+    delete fLow;
+    delete fTop;
+    delete fLineSep2;
+    delete fLineSep;
+    delete fFileMenu;
+    delete fMenuBar;
+}  
+// ======================================================================
+
+void MMars::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+   TGMainFrame::CloseWindow();
+   gROOT->GetApplication()->Terminate(0)  ; 
+}
+
+void MMars::DisplWarning(const char *txt)
+{
+    Int_t retval;
+    new TGMsgBox(fClient->GetRoot(), this,
+                 "WARNING!", txt,
+                 kMBIconExclamation, 4, &retval);
+}
+
+Bool_t MMars::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+    // Process events generated by the buttons in the frame.
+
+    switch (GET_MSG(msg))
+    {
+    case kC_COMMAND:
+        switch (GET_SUBMSG(msg))
+        {
+        case kCM_BUTTON:
+
+            switch (parm1)
+            {
+
+            case M_BUTTON_EVTDISP:
+                new MEvtDisp(this);
+                return kTRUE;
+
+            case M_BUTTON_DATACHECK:
+                new MDataCheck(this);
+                return kTRUE;
+
+            case M_BUTTON_ANALYSE:
+                DisplWarning("Analysis not yet implemented!");
+                return kTRUE;
+
+            case M_BUTTON_MONTECARLO:
+                new MMonteCarlo(this);
+                return kTRUE;
+
+            case M_PICTURE_MAGIC:
+                DisplWarning("Please open a Netscape to the MAGIC homepage");
+                return kTRUE;
+
+            case M_PICTURE_MARS:
+                DisplWarning("Please open a Netscape to the MARS homepage");
+                return kTRUE;
+
+            }
+
+	case kCM_MENU:
+            if (parm1!=M_FILE_EXIT)
+                return kTRUE;
+
+            CloseWindow() ;
+            return kTRUE;
+	}
+    }
+
+    return kTRUE;
+}
Index: /tags/Mars_V0-4/Mars/mmain/MMars.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MMars.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MMars.h	(revision 9634)
@@ -0,0 +1,73 @@
+#ifndef MMARS_H
+#define MMARS_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+
+class TGTab;
+class TGMenuBar;
+class TGPopupMenu;
+class TGTextButton;
+class TGPictureButton;
+class TGHorizontal3DLine;
+
+class MMars : public TGMainFrame {
+ private:
+  
+  //
+  // Create a main frame with a number of different buttons.
+  //
+
+  //  the things for the menu bar 
+    
+  TGMenuBar          *fMenuBar ;
+  TGPopupMenu        *fFileMenu ;
+  TGLayoutHints      *fLayMenuBar;
+  TGLayoutHints      *fLayMenuItem ;
+  TGHorizontal3DLine *fLineSep ; 
+
+  //   divide the Window in two different parts
+  
+  TGHorizontalFrame  *fTop ;   // top part of the main window
+  TGHorizontal3DLine *fLineSep2 ;
+  TGHorizontalFrame  *fLow ;   // low part of the main window
+  TGTab              *fTab ;   // different tabs in the low window
+  
+  //   the object in the top part of the frame
+  
+  TGPictureButton  *fPicMagic;
+  TGPictureButton  *fPicMars ;
+ 
+  //   the object in the low part of the frame
+ 
+  TGVerticalFrame  *fTabF1; 
+  TGVerticalFrame  *fTabF2 ;
+  
+  TGTextButton     *fButEvtDisp;
+  TGTextButton     *fButDataCheck;
+  TGTextButton     *fButAnalys;
+  TGTextButton     *fButMonteCarlo ;
+  TGLayoutHints    *fButLayout ; 
+
+  void DisplWarning(const char *txt);
+
+ public: 
+  MMars(UInt_t w=400, UInt_t h=500) ;
+  
+  ~MMars(); 
+  
+  void CloseWindow()  ; 
+
+  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+  ClassDef(MMars, 0) // GUI: Mars - the main window
+} ; 
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mmain/MMonteCarlo.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MMonteCarlo.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MMonteCarlo.cc	(revision 9634)
@@ -0,0 +1,73 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MMonteCarlo.h"
+
+#include <TGButton.h>       // TGTextButton
+
+ClassImp(MMonteCarlo)
+
+enum {
+    M_BUTTON_ACTION
+};
+
+MMonteCarlo::MMonteCarlo(const TGWindow *main, const TGWindow *p, 
+                                   const UInt_t w, const UInt_t h )
+    : MBrowser(p, main, w, h)
+{
+
+    fButAction = new TGTextButton(fTop1, "ACTION", M_BUTTON_ACTION );
+    fButAction->Associate(this) ;
+    fTop1->AddFrame (fButAction, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+    MapSubwindows();
+
+    Layout();
+
+    SetWindowName("MonteCarlo Main");
+    SetIconName("MonteCarlo");
+
+    MapWindow();
+} 
+
+MMonteCarlo::~MMonteCarlo()
+{
+    delete fButAction;
+}
+
+// ======================================================================
+
+Bool_t MMonteCarlo::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
+{     
+    if (GET_MSG(msg) == kC_COMMAND &&
+        GET_SUBMSG(msg) == kCM_BUTTON &&
+        parm1 == M_BUTTON_ACTION)
+    {
+        DisplInfo("Put Intelligence here!");
+        return kTRUE;
+    }
+
+    return MBrowser::ProcessMessage(msg, parm1, parm2);
+}
Index: /tags/Mars_V0-4/Mars/mmain/MMonteCarlo.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MMonteCarlo.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MMonteCarlo.h	(revision 9634)
@@ -0,0 +1,36 @@
+#ifndef MMONTECARLO_H
+#define MMONTECARLO_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+#ifndef ROOT_TGFrame
+#include <TGFrame.h>
+#endif
+#ifndef MBROWSER_H
+#include "MBrowser.h"
+#endif
+
+class TGTextButton;
+
+class MMonteCarlo : public MBrowser
+{ 
+private:
+
+    TGTextButton *fButAction;
+
+public:
+    MMonteCarlo(const TGWindow *main=NULL, const TGWindow *p=NULL,
+                     const UInt_t w=500, const UInt_t h=500) ;
+
+    ~MMonteCarlo();
+
+    Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+    ClassDef(MMonteCarlo, 0) // GUI: The 'monte-carlo' window
+};
+
+#endif
+
+
Index: /tags/Mars_V0-4/Mars/mmain/MainIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MainIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MainIncl.h	(revision 9634)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mmain/MainLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/MainLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/MainLinkDef.h	(revision 9634)
@@ -0,0 +1,12 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MMars;
+#pragma link C++ class MEvtDisp;
+#pragma link C++ class MDataCheck;
+#pragma link C++ class MMonteCarlo;
+
+#endif
Index: /tags/Mars_V0-4/Mars/mmain/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mmain/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmain/Makefile	(revision 9634)
@@ -0,0 +1,51 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Main
+
+#
+# Library name to creatre
+#
+LIB   = mmain.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../manalysis -I../mdatacheck -I../meventdisp
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MDataCheck.cc \
+	   MEvtDisp.cc \
+	   MMars.cc \
+	   MMonteCarlo.cc \
+           MBrowser.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MMcCollectionAreaCalc.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MMcCollectionAreaCalc.cc	(revision 9634)
@@ -0,0 +1,97 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!              Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MMcCollectionAreaCalc.h"
+
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MMcEvt.hxx"
+#include "MMcTrig.hxx" 
+
+#include "MHMcCollectionArea.h"
+
+ClassImp(MMcCollectionAreaCalc);
+
+MMcCollectionAreaCalc::MMcCollectionAreaCalc(const char *input,
+                                             const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MMcCollectionAreaCalc";
+    *fTitle = title ? title : "Task to calculate the collection area";
+
+    fObjName = input ? input : "MMcTrig";
+} 
+
+Bool_t MMcCollectionAreaCalc::PreProcess (MParList *pList)
+{
+    // connect the raw data with this task
+
+    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
+    if (!fMcEvt)
+    {
+        *fLog << dbginf << "MMcEvt not found... exit." << endl;
+        return kFALSE;
+    }
+
+    fMcTrig = (MMcTrig*)pList->FindObject(fObjName);
+    if (!fMcTrig)
+    {
+        *fLog << dbginf << fObjName << " not found... exit." << endl;
+        return kFALSE;
+    }
+
+    fCollArea = (MHMcCollectionArea*)pList->FindCreateObj("MHMcCollectionArea");
+    if (!fCollArea)
+        return kFALSE;
+
+    return kTRUE;
+}
+
+Bool_t MMcCollectionAreaCalc::Process () 
+{ 
+    const Float_t energy = log10(fMcEvt->GetEnergy());
+    const Float_t impact = fMcEvt->GetImpact()/100.;
+
+    fCollArea->FillAll(energy, impact);
+
+    if (fMcTrig->GetFirstLevel() <= 0)
+        return kTRUE;
+
+    fCollArea->FillSel(energy, impact);
+
+    return kTRUE;
+}
+
+Bool_t MMcCollectionAreaCalc::PostProcess()
+{ 
+    //
+    //   do the calculation of the effectiv area
+    //
+    fCollArea->CalcEfficiency();
+
+    return kTRUE;
+}
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MMcCollectionAreaCalc.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MMcCollectionAreaCalc.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MMcCollectionAreaCalc.h	(revision 9634)
@@ -0,0 +1,35 @@
+#ifndef MMCCOLLECTIONAREACALC_H
+#define MMCCOLLECTIONAREACALC_H
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MMcEvt;
+class MMcTrig;
+class MHMcCollectionArea;
+
+class MMcCollectionAreaCalc : public MTask
+{
+private:
+    const MMcEvt  *fMcEvt;
+    const MMcTrig *fMcTrig;
+
+    MHMcCollectionArea *fCollArea;
+
+    TString fObjName;
+
+public:
+    MMcCollectionAreaCalc(const char *input=NULL,
+                          const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MMcCollectionAreaCalc, 0) // Task to calculate the collection area histogram
+};
+
+#endif 
+
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MMcThresholdCalc.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MMcThresholdCalc.cc	(revision 9634)
@@ -0,0 +1,169 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Javier Lopez 05/2001 (jlopez@ifae.es)
+!              Thomas Bretz 06/2001 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////
+//
+//  MMcThresholdCalc
+//                                                                         
+//  Input Containers:
+//   MMcEvt, MMcTrig;*
+//
+//  Output Containers:
+//   MHMcEnergies
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MMcThresholdCalc.h"
+
+#include <math.h>
+
+#include "MParList.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MMcEvt.hxx"
+#include "MMcTrig.hxx"
+
+#include "MHMcEnergy.h"
+
+ClassImp(MMcThresholdCalc);
+
+const Float_t MMcThresholdCalc::fSqrt2 = sqrt(2);
+
+// --------------------------------------------------------------------------
+//
+// Default Constructor.
+//
+// Specify the number of trigger conditions you want to use.
+// The default is 0.
+//
+// dim < 0: use only condition number dim (eg "MMcTrig;3")
+// dim = 0: use only condition without a number ("MMcTrig")
+// dim > 0: use conditions up to dim
+//
+MMcThresholdCalc::MMcThresholdCalc(const Int_t dim, const char* name,
+                                   const char* title) : fDimension(dim)
+{
+    *fName  = name  ? name  : "MMcThresholdCalc";
+    *fTitle = title ? title : "Task to calculate the energy threshold from Monte Carlo";
+}
+
+// -------------------------------------------------------------------------
+//
+// Destructor.
+//
+MMcThresholdCalc::~MMcThresholdCalc()
+{
+    if (fMcTrig)
+        delete fMcTrig;
+
+    if (fEnergy)
+        delete fEnergy;
+}
+
+// --------------------------------------------------------------------------
+//
+// connect Monte Carlo data with this task
+//
+Bool_t MMcThresholdCalc::PreProcess(MParList* pList)
+{
+    //
+    // This task takes into accout if the root file has one trigger
+    // condition (MMcTrig) or severl of them (MMcTrig;#.)
+
+    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
+    if (!fMcEvt)
+    {
+        *fLog << dbginf << "MMcEvt not found... aborting." << endl;
+        return kFALSE;
+    }
+
+
+    const UInt_t from = fDimension<=0 ? -fDimension : 0;
+
+    if (fDimension<=0)
+        fDimension = -fDimension;
+
+    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, fDimension));
+    if (fMcTrig->GetEntriesFast() != fDimension)
+    {
+        *fLog << dbginf << "Error: Not all requested MMcTrig objects are available...aborting." << endl;
+        return kFALSE;
+    }
+
+    fEnergy = new TObjArray(pList->FindCreateObjList("MHMcEnergy", from, fDimension));
+    if (fMcTrig->GetEntriesFast() != fDimension)
+        return kFALSE;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// The histograms are filled with log10 of the energy for triggered
+// events and weighted with 1/E because it is needed the dN/dE vs. logE
+// distribution to get the energy threshold.
+//
+Bool_t MMcThresholdCalc::Process()
+{
+    const Float_t energy   = fMcEvt->GetEnergy();
+    const Float_t lg10     = log10(energy);
+    const Float_t reciproc = 1./energy;
+
+    for (Int_t i=0; i<fDimension; i++)
+        if (GetTrig(i)->GetFirstLevel()>0)
+            GetHEnergy(i)->Fill(lg10, reciproc);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// fit the energy distribution to get the threshold
+// Some iterations are done to be sure the fit parameters converge.
+//
+Bool_t MMcThresholdCalc::PostProcess()
+{
+    for (Int_t i=0; i<fDimension; i++)
+    {
+        MHMcEnergy &hist = *GetHEnergy(i);
+
+        Float_t peak;
+        Float_t sigma;
+
+        hist.Fit(1, 3);
+
+        peak  = hist.GetGaussPeak();
+        sigma = hist.GetGaussSigma();
+        hist.Fit(peak - 2.   *sigma, peak + 2.   *sigma);
+
+        peak  = hist.GetGaussPeak();
+        sigma = hist.GetGaussSigma();
+        hist.Fit(peak - fSqrt2*sigma, peak + fSqrt2*sigma);
+    }
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MMcThresholdCalc.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MMcThresholdCalc.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MMcThresholdCalc.h	(revision 9634)
@@ -0,0 +1,54 @@
+#ifndef MMCTHREASHOLDCALC_H
+#define MMCTHREASHOLDCALC_H
+
+/////////////////////////////////////////////////////////////////////////////
+//                                                                         //
+// MMcThresholdCalc                                                        //
+//                                                                         //
+// Compute the energy threshold from Monte Carlo data                      //
+//                                                                         //
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef MTASK_h
+#include "MTask.h"
+#endif
+#ifndef ROOT_TObjArray
+#include "TObjArray.h"
+#endif
+
+class MMcEvt;
+class MMcTrig;
+class MHMcEnergy;
+
+class MMcThresholdCalc : public MTask
+{
+private:
+    Int_t fDimension;
+
+    const MMcEvt  *fMcEvt;       // Container with Monte Carlo information
+
+    TObjArray    *fMcTrig;       // Container with Monte Carlo trigger information
+    TObjArray    *fEnergy;       // Container where we save the energy (threshold)
+
+    const static Float_t fSqrt2; // sqrt(2)
+
+    MMcTrig    *GetTrig   (UInt_t i) { return (MMcTrig*)   (*fMcTrig)[i]; }
+    MHMcEnergy *GetHEnergy(UInt_t i) { return (MHMcEnergy*)(*fEnergy)[i]; }
+
+public:
+
+    MMcThresholdCalc(const Int_t dim = 0,
+                     const char* name = NULL, const char* title = NULL);
+    ~MMcThresholdCalc();
+
+    Bool_t PreProcess(MParList* pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MMcThresholdCalc, 0) // Task to compute the energy threshold
+};
+
+#endif
+
+
+
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MMcTriggerRateCalc.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 9634)
@@ -0,0 +1,207 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
+!   Author(s): Thomas Bretz  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+#include "MMcTriggerRateCalc.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+#include "MParList.h"
+
+#include "MHMcRate.h"
+#include "MMcEvt.hxx"
+#include "MMcTrig.hxx" 
+
+ClassImp(MMcTriggerRateCalc);
+
+void MMcTriggerRateCalc::Init(int dim, int part, float *trigbg,
+                              float simbg, float spec, float flux0,
+                              const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MMcTriggerRateCalc";
+    *fTitle = title ? title : "Task to calc the trigger rate ";
+
+    fDimension=dim;
+
+    for (int i=0;i<10;i++)
+        fTrigger[i] = dim&&trigbg ? trigbg[i] : 0;
+
+    fShowers = 0;
+    fAnalShow = simbg;
+
+    fPartId=part;
+
+    fSpecInd=spec;
+    fFlux0=flux0;
+}
+
+// --------------------------------------------------------------------------
+//
+//  overloaded constructor I
+//
+//      dim: fDimension
+//      part: fPartId
+//      *trigbg: number of shower from bacground that triggers
+//               a given trigger condition.
+//      simbg: Number of simulated showers for the bacground
+//      rate: rate of incident showers
+//
+
+MMcTriggerRateCalc::MMcTriggerRateCalc(float rate, int dim, int part,
+                                       float *trigbg, float simbg,
+                                       const char *name, const char *title)
+{
+    Init(dim, part, trigbg, simbg, rate, 0, name, title);
+}
+
+
+// --------------------------------------------------------------------------
+//
+//  overloaded constructor II
+//
+//      dim: fDimension
+//      part: fPartId
+//      *trigbg: number of shower from bacground that triggers
+//               a given trigger condition.
+//      simbg: Number of simulated showers for the bacground
+//      spec: spectral index
+//      flux0; fFlux0
+//
+
+MMcTriggerRateCalc::MMcTriggerRateCalc(int dim, int part, float *trigbg,
+                                       float simbg, float spec, float flux0,
+                                       const char *name, const char *title)
+{
+    Init(dim, part, trigbg, simbg, spec, flux0, name, title);
+}
+
+
+// --------------------------------------------------------------------------
+//
+//  The PreProcess connects the raw data with this task. It checks if the 
+//  input containers exist, if not a kFalse flag is returned. It also checks
+//  if the output contaniers exist, if not they are created.
+//  This task can read either Montecarlo files with multiple trigger
+//  options, either Montecarlo files with a single trigger option.
+//
+Bool_t MMcTriggerRateCalc::PreProcess (MParList *pList)
+{
+    // connect the raw data with this task
+
+    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
+    if (!fMcEvt)
+    {
+        *fLog << dbginf << "MMcEvt not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    const UInt_t from = fDimension<=0 ? -fDimension : 0;
+
+    if (fDimension<=0)
+        fDimension = -fDimension;
+
+    fMcTrig = new TObjArray(pList->FindObjectList("MMcTrig", from, fDimension));
+    if (fMcTrig->GetEntriesFast() != fDimension)
+    {
+        *fLog << dbginf << "Error: Not all requested MMcTrig objects are available...aborting." << endl;
+        return kFALSE;
+    }
+
+    fMcRate = new TObjArray(pList->FindObjectList("MHMcRate", from, fDimension));
+    if (fMcRate->GetEntriesFast() != fDimension)
+    {
+        *fLog << dbginf << "Error: Not all requested MHMcRate objects are available...aborting." << endl;
+        return kFALSE;
+    }
+
+    for (int i=0; i<fDimension; i++)
+    {
+        MHMcRate &rate = *GetRate(i);
+
+        rate.SetParticle(fPartId);
+        rate.SetBackground(fTrigger[i], fAnalShow);
+
+        fTrigger[i]=0;
+    }
+
+    fAnalShow=0.0;
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  The Process-function counts the number of simulated showers, the
+//  number of analised showers and the number of triggers. It also updates
+//  the limits for theta, phi, energy and impact parameter in the
+//  MHMcRate container.
+//
+Bool_t MMcTriggerRateCalc::Process ()
+{
+    //  Counting analysed and simulated showers
+
+    fShowers++;
+    if (fMcEvt->GetPhotElfromShower())
+        fAnalShow++;
+
+    //  Getting angles, energy and impact parameter to set boundaries
+
+    const Float_t theta=fMcEvt->GetTheta();
+    const Float_t phi  =fMcEvt->GetPhi();
+    const Float_t param=fMcEvt->GetImpact();
+    const Float_t ener =fMcEvt->GetEnergy()/1000.0;
+
+    //  Counting number of triggers
+
+    for (int i=0; i<fDimension; i++)
+    {
+        fTrigger[i] += GetTrig(i)->GetFirstLevel();
+
+        GetRate(i)->UpdateBoundaries(ener, theta, phi, param);
+    }
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+//  The PostProcess-function calculates and shows the trigger rate
+//
+Bool_t MMcTriggerRateCalc::PostProcess ()
+{
+    // Computing trigger rate and showing it
+    for(int i=0; i<fDimension; i++)
+    {
+        MHMcRate &rate = *GetRate(i);
+
+        rate.CalcRate(fTrigger[i], fAnalShow, fShowers);
+        rate.Print();
+        rate.Draw("S");
+    }
+
+    return kTRUE;
+}
+
+
+
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MMcTriggerRateCalc.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 9634)
@@ -0,0 +1,62 @@
+#ifndef MTRIGGERRATECALC_H
+#define MTRIGGERRATECALC_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef ROOT_TObjArray
+#include <TObjArray.h>
+#endif
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class MParList;
+class MMcEvt;
+class MMcTrig;
+class MHMcRate;
+
+class MMcTriggerRateCalc : public MTask
+{
+private:
+    MMcEvt    *fMcEvt;        //!
+
+    TObjArray *fMcRate;
+    TObjArray *fMcTrig;
+
+    Int_t      fDimension;     // Information about the trigger conditions
+    // in the root file to be read.
+
+    Float_t    fTrigger[10];   // Number of triggered showers
+    Float_t    fShowers;       // Number of simulated showers
+    Float_t    fAnalShow;      // Number of analysed showers
+
+    Int_t      fPartId;        // Incident particle that generates showers
+
+    Float_t    fSpecInd;       // Spectral indec of the simualtion
+    Float_t    fFlux0;         // Flux 0 for the differential flux
+
+    void Init(int dim, int part, float *trigbg,
+              float simbg, float spec, float flux0,
+              const char *name, const char *title);
+
+    MHMcRate *GetRate(UInt_t i) const { return (MHMcRate*)((*fMcRate)[i]); }
+    MMcTrig *GetTrig(UInt_t i) const { return (MMcTrig*)((*fMcTrig)[i]); }
+
+public:
+    MMcTriggerRateCalc(int dim=0, int part=14, float *trigbg=NULL,
+                       float simbg=100000, float spec=2.75, float flux0=10.92e-2,
+                       const char *name=NULL, const char *title=NULL);
+
+    MMcTriggerRateCalc(float rate, int dim, int part, float *trigbg,
+                       float simbg,
+                       const char *name=NULL, const char *title=NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MMcTriggerRateCalc, 0)	// Task to compute the trigger rate
+};
+
+#endif 
Index: /tags/Mars_V0-4/Mars/mmontecarlo/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/Makefile	(revision 9634)
@@ -0,0 +1,49 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = MonteCarlo
+
+#
+# Library name to creatre
+#
+LIB   = mmontecarlo.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../mmc -I../mhist
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MMcCollectionAreaCalc.cc \
+	   MMcThresholdCalc.cc \
+	   MMcTriggerRateCalc.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o)
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MonteCarloIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MonteCarloIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MonteCarloIncl.h	(revision 9634)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mmontecarlo/MonteCarloLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mmontecarlo/MonteCarloLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mmontecarlo/MonteCarloLinkDef.h	(revision 9634)
@@ -0,0 +1,11 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MMcThresholdCalc;
+#pragma link C++ class MMcCollectionAreaCalc;
+#pragma link C++ class MMcTriggerRateCalc ; 
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawCrateArray.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawCrateArray.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawCrateArray.cc	(revision 9634)
@@ -0,0 +1,110 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MRawCrateArray
+//
+//  This class exists to make it possible to read in the crate data
+//  TClones Array. In principal we can directly write the TClonesArray
+//  to the root file, but when we read in again the root file we cannot
+//  put the TClonesArray into our parameter list, becaus it isn't derived
+//  from MParContainer. This class is derived from MParContainer and can be
+//  put in the list. The TClones Array containes conatiners which store
+//  the information about one crate (MRawCrateData).
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MRawCrateArray.h"
+
+#include <TClonesArray.h>
+
+#include "MLog.h"
+
+ClassImp(MRawCrateArray);
+
+// --------------------------------------------------------------------------
+//
+//  Default Constructor. It creates the TClonesArray which is used to store
+//  the crate data.
+//
+MRawCrateArray::MRawCrateArray(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MRawCrateArray";
+    *fTitle = title ? title : "Array of MRawCrateData Information";
+
+    //
+    // craete an (almost) empty array. The size is easily determined
+    // while filling the array
+    //
+    fArray = new TClonesArray("MRawCrateData", 0);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Destructor. Deletes the TClones Array which stores the crate information
+//
+MRawCrateArray::~MRawCrateArray()
+{
+    //  FIXME: Is the contained data deleted, too?
+    delete fArray;
+}
+
+// --------------------------------------------------------------------------
+//
+// clear the entries in the TClonesArray
+//
+void MRawCrateArray::Clear(Option_t *opt)
+{
+    fArray->Clear();
+}
+
+// --------------------------------------------------------------------------
+//
+// Return a pointer the i-th entry in the array
+//
+MRawCrateData *MRawCrateArray::GetEntry(Int_t i)
+{
+    return (MRawCrateData*)fArray->AddrAt(i);
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the i-th entry in the array
+//
+MRawCrateData* &MRawCrateArray::operator[](Int_t i)
+{
+    return (MRawCrateData*&)(*fArray)[i];
+}
+
+// --------------------------------------------------------------------------
+//
+// return a pointer to the pointer of the array
+// (actually not used. You may need it if you want to write
+//  the TClonesArray directly)
+//
+TClonesArray **MRawCrateArray::GetArray()
+{
+    return &fArray;
+}
+
Index: /tags/Mars_V0-4/Mars/mraw/MRawCrateArray.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawCrateArray.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawCrateArray.h	(revision 9634)
@@ -0,0 +1,36 @@
+#ifndef MRAWCRATEARRAY_H
+#define MRAWCRATEARRAY_H
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+// MRunHeader                                                        //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class TClonesArray;
+class MRawCrateData;
+
+class MRawCrateArray : public MParContainer
+{
+private:
+    TClonesArray *fArray;
+
+public:
+    MRawCrateArray(const char *name=NULL, const char *title=NULL);
+    ~MRawCrateArray();
+
+    void Clear(Option_t *opt=NULL);
+
+    MRawCrateData *GetEntry(Int_t i);
+
+    MRawCrateData* &operator[](Int_t i);
+
+    TClonesArray **GetArray();
+
+    ClassDef(MRawCrateArray, 1)	// Mapping container for the MRawCrateData TClonesArray
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawCrateData.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawCrateData.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawCrateData.cc	(revision 9634)
@@ -0,0 +1,69 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MRawCrateData
+//
+//  This container stores the information about one crate. A list of this
+//  informations can be find at MRawCrateArray
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MRawCrateData.h"
+
+#include <iostream.h>
+#include <iomanip.h>
+
+#include <fstream.h>
+
+#include "MLog.h"
+
+ClassImp(MRawCrateData);
+
+MRawCrateData::MRawCrateData() : fDAQCrateNumber(0), fFADCEvtNumber(0), fFADCClockTick(0)
+{
+}
+
+// --------------------------------------------------------------------------
+//
+//  read the information from a binary input stream about the CRATE DATA,
+//  like specified in a TDAS note
+//
+void MRawCrateData::ReadEvt(istream& fin)
+{
+    fin.read((Byte_t*)&fDAQCrateNumber, 2);
+    fin.read((Byte_t*)&fFADCEvtNumber,  4);
+    fin.read((Byte_t*)&fFADCClockTick,  4);
+}
+
+// --------------------------------------------------------------------------
+//
+//  print all stored information to gLog
+//
+void MRawCrateData::Print(Option_t *t)
+{
+    gLog << "Crate Number " << fDAQCrateNumber << ":  ";
+    gLog << "FADCEventNr=" << fFADCEvtNumber << "  ";
+    gLog << "FADCClockTick=" << fFADCClockTick << " (20MHz)" << endl;
+}
Index: /tags/Mars_V0-4/Mars/mraw/MRawCrateData.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawCrateData.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawCrateData.h	(revision 9634)
@@ -0,0 +1,49 @@
+#ifndef MRAWCRATEDATA_H
+#define MRAWCRATEDATA_H
+
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+#ifndef ROOT_TObject
+#include <TObject.h>
+#endif
+
+class ifstream;
+
+class MRawCrateData : public TObject
+{
+private:
+    UShort_t fDAQCrateNumber;  // Crate number the information corresponds to
+    UInt_t   fFADCEvtNumber;   // event number from the fadc
+    UInt_t   fFADCClockTick;   // clock tick from the fadc (20MHz)
+
+public:
+    MRawCrateData();
+
+    ~MRawCrateData()
+    {
+    }
+
+    UChar_t GetDAQCrateNumber() const
+    {
+        return fDAQCrateNumber;
+    }
+
+    UInt_t  GetFADCEvtNumber() const
+    {
+        return fFADCEvtNumber;
+    }
+
+    UInt_t  GetFADCClockTick() const
+    {
+        return fFADCClockTick;
+    }
+
+    void Print(Option_t *t=NULL);
+
+    void ReadEvt(istream& fin);
+
+    ClassDef(MRawCrateData, 1) //Container to store the Raw CRATE DATA
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawEvtData.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawEvtData.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawEvtData.cc	(revision 9634)
@@ -0,0 +1,422 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MRawEvtData
+//
+//  Storage container to store the raw FADC values.
+//
+//  MArrayS fHiGainPixId
+//  ---------------------
+//  Array of Pixel Numbers for their high voltage channel in the order the
+//  FADC values are stored in fHiGainFadcSamples
+//
+//  MArrayB fHiGainFadcSaples
+//  -------------------------
+//  FADC samples (hi gain) of all pixels
+//
+//  MArrayS fLoGainPixId
+//  --------------------
+//  see fHiGainPixId
+//
+//  MArrayB fLoGainFadcSamples
+//  --------------------------
+//  see fHiGainFadcSaples
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MRawEvtData.h"
+
+#include <iomanip.h>
+
+#include <fstream.h>
+
+#include <TH1.h>
+#include <TGraph.h>
+#include <TArrayC.h>
+
+#include "MLog.h"
+#include "MArrayS.h"
+#include "MArrayB.h"
+#include "MRawRunHeader.h"
+
+ClassImp(MRawEvtData);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. It initializes all arrays with zero size.
+//
+MRawEvtData::MRawEvtData(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MRawEvtData";
+    *fTitle = title ? title : "Raw Event Data Information";
+
+    InitArrays();
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor. Deletes all the arrays.
+//
+MRawEvtData::~MRawEvtData()
+{
+    DeleteArrays();
+}
+
+// --------------------------------------------------------------------------
+//
+// reset all arrays
+//
+void MRawEvtData::Clear(Option_t *)
+{
+    /*
+     FIXME:
+     Is Reset (set all entries to zero) what you want to do
+     or Set(0) (delete the array)
+     */
+    fHiGainPixId->Reset();
+    fLoGainPixId->Reset();
+    fHiGainFadcSamples->Reset();
+    fLoGainFadcSamples->Reset();
+}
+
+// --------------------------------------------------------------------------
+//
+// return the number of hi gain samples per pixel
+//
+Byte_t MRawEvtData::GetNumHiGainSamples() const
+{
+    return fHiGainPixId->GetSize() ? fHiGainFadcSamples->GetSize()/fHiGainPixId->GetSize() : 0;
+}
+
+// --------------------------------------------------------------------------
+//
+// return the number of lo gain samples per pixel
+//
+Byte_t MRawEvtData::GetNumLoGainSamples() const
+{
+    return fLoGainPixId->GetSize() ? fLoGainFadcSamples->GetSize()/fLoGainPixId->GetSize() : 0;
+}
+
+// --------------------------------------------------------------------------
+//
+// return the number of stored pixel
+//
+UShort_t MRawEvtData::GetNumPixels() const
+{
+    return fHiGainPixId->GetSize();
+}
+
+
+// --------------------------------------------------------------------------
+//
+//  Print out the onformation to *fLog.
+//  Options:
+//     "hex"      Prints the time slices hexadecimal (default)
+//     "dec"      Prints the time slices decimal
+//
+void MRawEvtData::Print(Option_t *opt)
+{
+    //
+    // print fadc inforation to screen
+    // Possible Options:
+    // - DEC: Print values decimal instead of hexadecimal (default)
+    //
+    const Byte_t nHiSamp = GetNumHiGainSamples();
+    const Byte_t nLoSamp = GetNumLoGainSamples();
+
+    const UShort_t nHiPix = fHiGainPixId->GetSize();;
+    const UShort_t nLoPix = fLoGainPixId->GetSize();;
+
+    fLog->unsetf(ios::showbase);
+
+    *fLog << dec;
+    *fLog << "HiGain: " << nHiPix << " Pixels with " << (Int_t)nHiSamp << " Samples" << endl;
+    *fLog << "LoGain: " << nLoPix << " Pixels with " << (Int_t)nLoSamp << " Samples";;
+
+    TString str(opt);
+    Int_t manip = str.Contains("dec", TString::kIgnoreCase);
+
+    Int_t l=0;
+    for (int i=0; i<nHiPix; i++)
+    {
+        *fLog << endl;
+        *fLog << " " << setfill(' ') << setw(3) << dec << i << ": ";
+        *fLog << (manip?dec:hex) << flush;
+
+        if (!manip)
+            *fLog << setfill('0');
+
+        for (int j=0; j<nHiSamp; j++)
+        {
+            *fLog << setw(manip?3:2);
+            *fLog << ((UShort_t)(*fHiGainFadcSamples)[j+i*nHiSamp]&0xff);
+            if (manip)
+                *fLog << ' ';
+            *fLog << flush;
+        }
+
+        if (!(l<nLoPix && (*fLoGainPixId)[l]==(*fHiGainPixId)[i]))
+            continue;
+
+        if (manip)
+            *fLog << "/ ";
+
+        for (int j=0; j<nLoSamp; j++)
+        {
+            *fLog << setw(manip?3:2);
+            *fLog << ((UShort_t)(*fLoGainFadcSamples)[j+i*nLoSamp]&0xff);
+            if (manip)
+                *fLog << ' ';
+            *fLog << flush;
+        }
+        l++;
+    }
+    *fLog << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Draw a pixel. A Histogram or Graph is created and it's draw function is
+// called.
+//  Options:
+//     "GRAPH"      A graph is drawn
+//     "HIST"       A histogram is drawn
+//     number       The pixel with the given number is drawn
+//
+void MRawEvtData::Draw(Option_t *opt)
+{
+    // ----- AppendPad(opt);
+
+    //
+    // FIXME: BIG MEMORY LEAK! (( How and when are the objects deleted?)
+    //
+
+    TString str(opt);
+
+    UInt_t num = 0;
+
+    if (str.BeginsWith("GRAPH", TString::kIgnoreCase))
+    {
+        if (str.Length()>5)
+            sscanf(&str[5], "%d", &num);
+
+        if (num>=GetNumPixels())
+            num= GetNumPixels();
+
+        *fLog << "Drawing Graph: Pixel #" << num << " of " << (int)GetNumPixels() << endl;
+
+        const Int_t n = GetNumHiGainSamples();
+
+        Float_t *x = new Float_t[n];
+        Float_t *y = new Float_t[n];
+
+        for (int i=0; i<n; i++)
+        {
+            x[i] = i;
+            y[i] = (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()];
+        }
+
+        TGraph *graph = new TGraph(n, x, y);
+        graph->SetMaximum (256) ;
+        graph->SetMinimum (0) ;
+
+        graph->SetBit(kCanDelete);
+        graph->Draw("AC*");
+
+        return;
+    }
+
+    if (str.BeginsWith("HIST", TString::kIgnoreCase))
+    {
+        *fLog << "Length: " << str.Length() << endl;
+
+        if (str.Length()>4)
+            sscanf(&str[4], "%d", &num);
+
+        if (num>=GetNumPixels())
+            num= GetNumPixels();
+
+        *fLog << "Drawing Histogram of Pixel " << num << endl;
+
+        const Int_t n = GetNumHiGainSamples();
+
+        char *name = new char[16];
+
+        sprintf(name, "Pixel No.%d", (*fHiGainPixId)[num]);
+
+        TH1F *hist = new TH1F(name, "Hi Gain Samples FADC", n, 0, n);
+
+        for (int i=0; i<n; i++)
+            hist->Fill(0.5+i, (*fHiGainFadcSamples)[i + num*GetNumHiGainSamples()]);
+
+        hist->SetBit(kCanDelete);
+        hist->Draw();
+
+        return;
+    }
+
+    *fLog << "MRawEvtData::Draw: Warning: You must specify either 'GRAPH' or 'HIST'" << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Deletes all arrays describing the pixel Id and Samples in pixels.
+// The flag is for future usage.
+//
+void MRawEvtData::DeletePixels(Bool_t flag)
+{
+    DeleteArrays();
+    InitArrays(flag);
+}
+
+// --------------------------------------------------------------------------
+//
+//  Deletes all the arrays
+//
+void MRawEvtData::DeleteArrays()
+{
+    delete fHiGainPixId;
+    delete fLoGainPixId;
+    delete fHiGainFadcSamples;
+    delete fLoGainFadcSamples;
+}
+
+// --------------------------------------------------------------------------
+//
+//  Deletes all the arrays
+//  The flag is for future usage.
+//
+void MRawEvtData::InitArrays(Bool_t flag)
+{
+    // const int npix = !flag ? 0 : fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
+
+    fHiGainPixId       = new MArrayS(0);//npix);
+    fLoGainPixId       = new MArrayS(0);//npix); 
+    fHiGainFadcSamples = new MArrayB(0);//npix*fRunHeader->GetNumSamplesHiGain());
+    fLoGainFadcSamples = new MArrayB(0);//npix*fRunHeader->GetNumSamplesLoGain());
+}
+
+// --------------------------------------------------------------------------
+//
+//  This is to fill the data of one pixel to the MRawEvtHeader Class.
+//  The parameters are the pixelnumber and the FADC_SLICES values of ADCs
+//  Add to lo gains if lflag = 1
+//
+void MRawEvtData::AddPixel(UShort_t nOfPixel, TArrayC *data, Bool_t lflag)
+{
+    MArrayS *arrpix = lflag ? fLoGainPixId       : fHiGainPixId;
+    MArrayB *arrsam = lflag ? fLoGainFadcSamples : fHiGainFadcSamples;
+
+    //
+    // check whether we got the right number of new samples
+    // if there are no samples already stored: this is the new number of samples
+    //
+    const Byte_t ns    = data->GetSize();
+    const Byte_t nSamp = lflag ? GetNumLoGainSamples() : GetNumHiGainSamples();
+    if (nSamp && ns!=nSamp)
+    {
+        *fLog << "RawEvtData::FillPixel: Error, number of samples in ";
+        *fLog << "TArrayC doesn't match actual number" << endl;
+        return;
+    }
+
+    //
+    // enhance pixel array by one
+    //
+    arrpix->Set(arrpix->GetSize()+1);
+
+    //
+    // add the number of the new pixel to the array as last entry
+    //
+    arrpix->AddAt(nOfPixel, arrpix->GetSize()-1);
+
+    //
+    // enhance the array by the number of new samples
+    //
+    arrsam->Set(arrsam->GetSize()+ns);
+
+    //
+    // add the new slices as last entries to array
+    //
+    arrsam->AddAt((Byte_t*)data->GetArray(), arrsam->GetSize()-ns, ns);
+}
+
+// --------------------------------------------------------------------------
+//
+// Fills members with information from a magic binary file.
+//   WARNING: you have to use Init() before you can do this
+//
+void MRawEvtData::ReadEvt(istream &fin)
+{
+    const UShort_t nlo = fRunHeader->GetNumSamplesLoGain();
+    const UShort_t nhi = fRunHeader->GetNumSamplesHiGain();
+
+    const UShort_t npic = fRunHeader->GetNumPixInCrate();
+
+    //
+    // Enhance array by the size which we'll read now
+    //
+    const int npixhi = fHiGainPixId->GetSize();
+    const int npixlo = fLoGainPixId->GetSize();
+
+    fHiGainPixId->Set(npixhi+npic);
+    fLoGainPixId->Set(npixlo+npic);
+
+    const int nsamhi = fHiGainFadcSamples->GetSize();
+    const int nsamlo = fLoGainFadcSamples->GetSize();
+
+    fHiGainFadcSamples->Set(nsamhi+nhi*npic);
+    fLoGainFadcSamples->Set(nsamlo+nlo*npic);
+
+    Byte_t *higainsam = fHiGainFadcSamples->GetArray()+nsamhi;
+    Byte_t *logainsam = fLoGainFadcSamples->GetArray()+nsamlo;
+
+    for (int i=0; i<npic; i++)
+    {
+        //
+        // get the spiral pixel number from the run header
+        //
+        const UShort_t npix = fRunHeader->GetPixAssignment(i);
+
+        //
+        //  This is to fill the data of one pixel to the MRawEvtHeader Class.
+        //  The parameters are the pixelnumber and the FADC_SLICES values of ADCs
+        //  Add to lo gains if lflag = 1
+        //
+        fHiGainPixId->AddAt(npix, npixhi+i);
+        fin.read(higainsam, nhi);
+        higainsam += nhi;
+
+        // FIXME: Not implemented in the raw files yet
+        //if (IsLoGainOn(i, j))
+        //{
+        fLoGainPixId->AddAt(npix, npixlo+i);
+        fin.read(logainsam, nlo);
+        logainsam += nlo;
+        //}
+    }
+}
+
Index: /tags/Mars_V0-4/Mars/mraw/MRawEvtData.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawEvtData.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawEvtData.h	(revision 9634)
@@ -0,0 +1,61 @@
+#ifndef MRAWEVTDATA_H
+#define MRAWEVTDATA_H
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class ifstream;
+class MRawRunHeader;
+
+class TArrayC;
+class MArrayS;
+class MArrayB;
+
+class MRawEvtData : public MParContainer
+{
+    friend class MRawEvtPixelIter;
+private:
+    MRawRunHeader *fRunHeader;    //! provides information about numbers
+
+    // FIXME: COMMENT ABOUT ORDERING
+
+    MArrayS *fHiGainPixId;        // list of pixel IDs of hi gain channel
+    MArrayB *fHiGainFadcSamples;  // list of hi gain samples of all pixels (ordering: see fHiGainPixId)
+
+    MArrayS *fLoGainPixId;        // list of pixel IDs of lo gain channel
+    MArrayB *fLoGainFadcSamples;  // list of lo gain samples of all pixels (ordering: see fLoGainPixId)
+
+    void InitArrays(Bool_t flag=kFALSE);
+    void DeleteArrays();
+
+public:
+    MRawEvtData(const char *name=NULL, const char *title=NULL);
+    ~MRawEvtData();
+
+    void Init(MRawRunHeader *rh)
+    {
+        //
+        // you have to set this before you can read information
+        // from a magic binary file
+        //
+        fRunHeader = rh;
+    }
+
+    void Clear(Option_t * = NULL);
+    void Print(Option_t * = NULL);
+    void Draw (Option_t * = NULL);
+
+    void DeletePixels(Bool_t flag=kFALSE);
+    void AddPixel(UShort_t nOfPixel, TArrayC *data, Bool_t lflag=kFALSE);
+
+    Byte_t  GetNumHiGainSamples() const;
+    Byte_t  GetNumLoGainSamples() const;
+    UShort_t GetNumPixels() const;
+
+    void ReadEvt(istream &fin);
+
+    ClassDef(MRawEvtData, 1) //Container to store the raw Event Data
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawEvtHeader.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawEvtHeader.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawEvtHeader.cc	(revision 9634)
@@ -0,0 +1,267 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MRawEvtHeader 
+//    
+// One Event is a sample of FADC measurements of different Pixels 
+// (Photomultipliers) from the Camera of MAGIC. So all data (FADC) of the 
+// interesting pixels are the modules of an event. To describe pixels the 
+// class MRawPixel is used and the class MRawCrate to describe Crates.
+// To define a single events some other data members are needed 
+// (Time of the events, tirgger pattern of event..)
+// 
+// To describe one event on the level of FADC values the Class MRawEvtHeader is
+// created. It has the following data members: 
+//
+// UInt_t    fDAQEvtNumber
+// -----------------------
+// This it the number of the Event in one 
+// data run. The first event in this run get
+// the number zero. The next one is one bigger.
+//
+// Assuming that one run takes 1 hour and a
+// triggerrate of 1kHz the number must be able
+// to reach 3.6e6 Events. To reach this number
+// you need at least 22 bits. This is the reason
+// why we use an integer (of root type UInt_t)
+// with a range to 4.2e9. 
+//
+// MTime   fRawEvtTime
+// -------------------
+// Time of the event. 
+// The start point of the time determination can be
+// the millenium. From that start point the time is
+// measured in 200ns-count. One day for example
+// contains 432.e9 counts. An array of two unsigned Int is able to 
+// contain 1.8e19 200ns-counts. This corresponds to 41.e6
+// days. This should be more than the livetime of MAGIC.
+// Private member of MTime.h
+//
+// UInt_t  fNumTrigLvl1
+// --------------------
+//
+// Number of first level trigger
+// This member counts the number of First Level Trigger
+// between the last and this event. May be that due to 
+// dead time of the DAQ this number is different from 1.
+// If the DAQ is fast enough, this value should be 1. 
+// This may be usefull in GammaRayBursts and if we 
+// apply a data reduction in the DAQ-chain, which selects
+// only good events. 
+//
+// UInt_t  fNumTrigLvl2
+// ------------------ -
+//
+// Number of second level trigger
+// This member counts the number of Second Level Trigger
+// between the last and this event. 
+//
+// UInt_t  fTrigPattern[2]
+// -----------------------
+// Trigger Pattern used for this event
+// Each event triggers for a particular configuration and each  
+// configuration shoul have an ID (which is not fixed yet).
+//
+// UShort_t fAllLowGainOn
+// ----------------------
+// Type of Trigger. 
+// This is a Byte (8 bit) to indicated if any of the pixels 
+// have a non-negligible low gain (1) or not (0) 
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MRawEvtHeader.h"
+
+#include <iomanip.h>
+#include <fstream.h>
+
+#include "MLog.h"
+#include "MTime.h"
+#include "MArrayB.h"
+#include "MRawRunHeader.h"
+
+ClassImp(MRawEvtHeader);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. Create the array to store the data.
+//
+MRawEvtHeader::MRawEvtHeader(const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MRawEvtHeader";
+    *fTitle = title ? title : "Raw Event Header Information";
+
+    //
+    //   set all member to zero, init the pointer to ClonesArray,
+    //
+
+    fPixLoGainOn = new MArrayB;
+
+    Clear();
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Destructor. Deletes the array to store pixlogainon
+//
+MRawEvtHeader::~MRawEvtHeader()
+{
+    delete fPixLoGainOn;
+}
+
+// --------------------------------------------------------------------------
+//
+// you have to init the conatainer before you can read from
+// a raw binary file
+//
+void MRawEvtHeader::Init(MRawRunHeader *rh, MTime *t)
+{
+    //
+    // this is the number of entries in the array like specification
+    //
+    UInt_t fN = (rh->GetNumCrates() * rh->GetNumPixInCrate() + 7) / 8;
+
+    //
+    // initialize the array
+    //
+    fPixLoGainOn->Set(fN);
+
+    //
+    // this is the conatiner where we have to store the time of the event we
+    // read from the input stream
+    //
+    fTime = t;
+}
+
+// --------------------------------------------------------------------------
+//
+//   Implementation of the Clear function
+//
+//   Resets all members to zero, clear the list of Pixels
+//
+void MRawEvtHeader::Clear(Option_t *)
+{
+    fDAQEvtNumber   = 0;
+    fNumTrigLvl1    = 0;
+    fNumTrigLvl2    = 0;
+    fTrigPattern[0] = 0;
+    fTrigPattern[1] = 0;
+    fTrigType       = 0;
+    fNumLoGainOn    = 0;
+}
+
+// --------------------------------------------------------------------------
+//
+//  This member function prints all Data of one Event to *fLog.
+//
+void MRawEvtHeader::Print(Option_t *o)
+{
+    *fLog << "DAQEvtNr: " << dec << fDAQEvtNumber << "  (";
+    *fLog << "Trigger: ";
+    *fLog << "NumLvl1=" << fNumTrigLvl1 << " ";
+    *fLog << "NumLvl2=" << fNumTrigLvl2 << " ";
+    *fLog << "Pattern=" << hex << setfill('0');
+    *fLog << setw(2) << fTrigPattern[0];
+    *fLog << setw(2) << fTrigPattern[1] << " " << dec;
+
+    *fLog << "Type=";
+    switch (fTrigType)
+    {
+    case 0:
+        *fLog << "Trigger";
+        break;
+    case 1:
+        *fLog << "Pedestal";
+        break;
+    case 2:
+        *fLog << "Calibration";
+        break;
+    }
+    *fLog << ")" << endl;
+    *fLog << "Number of Lo Gains On: " << fNumLoGainOn << endl;
+
+    for (unsigned int i=0; i<fPixLoGainOn->GetSize(); i++)
+    {
+        for (int j=0; j<8; j++)
+        {
+            const UInt_t on = (*fPixLoGainOn)[i]&(1<<j) ? 1 : 0;
+            *fLog << on;
+        }
+    }
+
+    *fLog << endl;
+
+    *fLog << endl;
+
+}
+
+// --------------------------------------------------------------------------
+//
+// used to set the header information (eg. from MC)
+//
+void MRawEvtHeader::FillHeader(UInt_t uiN, Float_t ulTP)
+{
+    fDAQEvtNumber = uiN;
+    fTrigPattern[0] = (UInt_t) (ulTP/4294967296.0) ;
+    fTrigPattern[1] = (UInt_t) (ulTP-fTrigPattern[0]*4294967296.0);
+}
+
+// --------------------------------------------------------------------------
+//
+// read the EVENT HEADER information from the input stream
+// return FALSE if there is now header anymore, else TRUE
+//
+int MRawEvtHeader::ReadEvt(istream &fin)
+{
+    fin.read((Byte_t*)&fDAQEvtNumber, 4);
+
+    UInt_t fAbsTime[2];
+    fin.read((Byte_t*)fAbsTime,       8);
+
+    //
+    // store the time of the event in the corresponding container
+    //
+    fTime->SetTime(fAbsTime[0], fAbsTime[1]);
+
+    Byte_t dummy[4];
+
+    fin.read((Byte_t*)&fNumTrigLvl1,  4);
+    fin.read((Byte_t*)&fNumTrigLvl2,  4);
+    fin.read((Byte_t*)fTrigPattern,   8);
+    fin.read((Byte_t*)&fTrigType,     2);
+    fin.read((Byte_t*)dummy,          2); // was fAllLoGainOn
+    fin.read((Byte_t*)fPixLoGainOn->GetArray(), fPixLoGainOn->GetSize());
+
+    fNumLoGainOn = 0;
+    for (unsigned int i=0; i<fPixLoGainOn->GetSize(); i++)
+        for (int j=0; j<8; j++)
+            if ((*fPixLoGainOn)[i] & (1<<j))
+                fNumLoGainOn++;
+
+    fin.read((Byte_t*)&dummy, 4);
+
+    return !fin.eof();
+}
Index: /tags/Mars_V0-4/Mars/mraw/MRawEvtHeader.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawEvtHeader.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawEvtHeader.h	(revision 9634)
@@ -0,0 +1,62 @@
+#ifndef MRAWEVTHEADER_H
+#define MRAWEVTHEADER_H
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class ifstream;
+class MTime;
+class MArrayB;
+class MRawRunHeader;
+
+//
+// Trigger Typed (TT)
+//
+enum {
+    kTTEvent       = 0,
+    kTTPedestal    = 1,
+    kTTCalibration = 2
+};
+
+class MRawEvtHeader : public MParContainer
+{
+private:
+    MTime   *fTime;            //! object to store the time in (ReadEvt)
+
+    UInt_t   fDAQEvtNumber;    // Number of Event
+
+    UInt_t   fNumTrigLvl1;     // Number of 1st level tiggers between 2 events
+    UInt_t   fNumTrigLvl2;     // Number of 2nd level tiggers between 2 events
+    UInt_t   fTrigPattern[2];  // Trigger configuration
+
+    UShort_t fNumLoGainOn;     // Indicating if no pixel has a neglegible
+                               // low gain signal (0), else it is the number
+                               // of pixels with lo gain on
+
+    //
+    // Informations only needed to read the raw file correctly
+    //
+    UShort_t fTrigType;        //! Trigger Type of this event
+    MArrayB *fPixLoGainOn;     //! Array which tell you which pixels have lo gain on
+
+public:
+
+    MRawEvtHeader(const char *name=NULL, const char *title=NULL);
+    ~MRawEvtHeader();
+
+    void Init(MRawRunHeader *rh, MTime *t);
+
+    void Clear(Option_t * = NULL);
+    void Print(Option_t * = NULL);
+
+    void FillHeader(UInt_t, Float_t=0);
+
+    UShort_t GetTrigType() const { return fTrigType; }
+
+    int ReadEvt(istream& fin);
+
+    ClassDef(MRawEvtHeader, 1) // Parameter Conatiner for raw EVENT HEADER
+}; 
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawEvtPixelIter.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawEvtPixelIter.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawEvtPixelIter.cc	(revision 9634)
@@ -0,0 +1,185 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+///////////////////////////////////////////////////////////////////////////////
+//
+//  MRawEvtPixelIter
+//
+//  class to iterate over all pixels of one event.
+//  The calling is similar to a root iterator:
+//  
+//  MRawEvtData *evtdata;            // must be filled with data from somewhere
+//  MRawEvtPixelIter pixel(evtdata); // evtdata: ptr to event you want to iterate
+//
+//  while (pixel.Next())
+//  {
+//     // here you can access the actual time slices by using
+//     //   pixel.GetPixelId();
+//     //   pixel.GetHiGainFadcSamples()[i]; // i is the number of the slice
+//     //   pixel.HasLoGain();               // check if pixel has
+//     //   pixel.GetLoGainFadcSamples()[i]; // i is the number of the slice
+//
+//     // WARNING: Don't acces more time slices than available.
+//     //   Get the numbers by calling: evtdata->GetNum[Lo,Hi]GainSamples()
+//     //   This number is constant for one event
+//  }
+//
+///////////////////////////////////////////////////////////////////////////////
+#include "MRawEvtPixelIter.h"
+
+#include "MRawEvtData.h"
+
+#include "MArrayS.h"
+#include "MArrayB.h"
+
+ClassImp(MRawEvtPixelIter);
+
+// --------------------------------------------------------------------------
+//
+// Return the number of stored pixels
+//
+Byte_t MRawEvtPixelIter::GetNumPixels() const
+{
+    return fData->GetNumPixels();
+}
+
+// --------------------------------------------------------------------------
+//
+// It steps to the next pixel. If there is no next pixel NULL is returned.
+// If a next pixel where found, a pointer to the primary given (constructor)
+// data structur is returned.
+//
+MRawEvtData *MRawEvtPixelIter::Next()
+{
+    //
+    // if we are already at the last entry there is no 'next' entry anymore
+    //
+    if (fNumHiGainEntry==fData->fHiGainPixId->GetSize())
+        return NULL;
+
+    //
+    // if we are already at the last entry there is no 'next' entry anymore
+    //
+    if (fNumLoGainEntry != fData->fLoGainPixId->GetSize())
+        if (*fHiGainId == *fLoGainId)
+        {
+            //
+            // if higainpixid and logainpixid of the actual pixel are
+            // identical then we have to move the pointer to the next
+            // entry in the lo gains
+            //
+            fNumLoGainEntry++;
+            fLoGainId++;
+            fLoGainPos += fData->GetNumLoGainSamples();
+        }
+
+    //
+    // here we have to move the pointer to the next entry in the hi gains
+    //
+    fNumHiGainEntry++;
+    fHiGainId++;
+    fHiGainPos += fData->GetNumHiGainSamples();
+
+    //
+    // return a pointer to the 'source' class if we succeed
+    //
+    return fData;
+}
+
+// --------------------------------------------------------------------------
+//
+// Reset the iteration. Jump to the first pixel.
+//
+void MRawEvtPixelIter::Reset()
+{
+    //
+    // set counter to zero
+    //
+    fNumLoGainEntry = 0;
+    fNumHiGainEntry = 0;
+
+    //
+    // set pointer to first entry of arrays
+    //
+    fHiGainId   = fData->fHiGainPixId->GetArray()-1;
+    fLoGainId   = fData->fLoGainPixId->GetArray()-1;
+    fHiGainPos  = fData->fHiGainFadcSamples->GetArray()-fData->GetNumHiGainSamples();
+    fLoGainPos  = fData->fLoGainFadcSamples->GetArray()-fData->GetNumLoGainSamples();
+}
+
+// --------------------------------------------------------------------------
+//
+// Calls the draw-function of the actual pixel (see MRawEvtData::Draw)
+//
+void MRawEvtPixelIter::Draw(Option_t *t)
+{ 
+  char *txt = new char[6+strlen(t)];
+  sprintf(txt, "%s%d", t, *fHiGainId);
+  fData->Draw(txt);
+  delete txt; 
+}
+
+// --------------------------------------------------------------------------
+//
+// returns the sum of all hi gain fadc samples of the actual pixel
+//
+ULong_t MRawEvtPixelIter::GetSumHiGainFadcSamples() const
+{
+    //
+    // return the sum of the hi gain samples of the present pixel
+    //
+    Byte_t *ptr = fHiGainPos;
+    const Byte_t *end = ptr + fData->GetNumHiGainSamples();
+
+    ULong_t sum=0;
+
+    do sum += *ptr++;
+    while (ptr != end);
+
+    return sum;
+}
+
+// --------------------------------------------------------------------------
+//
+// returns the sum of all lo gain fadc samples of the actual pixel.
+// if no lo gain information is available 0 is returned.
+//
+ULong_t MRawEvtPixelIter::GetSumLoGainFadcSamples() const
+{
+    //
+    // return the sum of the lo gain samples of the present pixel
+    //
+    if (!HasLoGain())
+        return 0;
+
+    Byte_t *ptr = fLoGainPos;
+    const Byte_t *end = ptr + fData->GetNumLoGainSamples();
+
+    ULong_t sum=0;
+
+    do sum += *ptr++;
+    while (ptr != end);
+
+    return sum;
+}
Index: /tags/Mars_V0-4/Mars/mraw/MRawEvtPixelIter.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawEvtPixelIter.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawEvtPixelIter.h	(revision 9634)
@@ -0,0 +1,107 @@
+#ifndef MRAWEVTPIXELITER_H
+#define MRAWEVTPIXELITER_H
+///////////////////////////////////////////////////////////////////////////////
+//
+//  MRawEvtPixelIter
+//
+//  class to iterate over all pixels of one event.
+//
+///////////////////////////////////////////////////////////////////////////////
+#ifndef MAGIC_H
+#include "MAGIC.h"
+#endif
+
+class MRawEvtData;
+
+class MRawEvtPixelIter
+{
+private:
+    UShort_t fNumHiGainEntry;   //! actual number of entry in fHiGainPixId
+    UShort_t fNumLoGainEntry;   //! actual number of entry in fLoGainPixId
+
+    UShort_t *fHiGainId;        //! actual entry of fHiGainPixId
+    UShort_t *fLoGainId;        //! actual entry of fLoGainPixId
+
+    Byte_t   *fHiGainPos;       //! pointer to hi-gain samples of actual pixel
+    Byte_t   *fLoGainPos;       //! pointer to lo-gain samples of actual pixel
+
+    UShort_t fNumEntry;
+
+    MRawEvtData *fData;         //! pointer to object which we are iterating
+
+public:
+    MRawEvtPixelIter(MRawEvtData *dat) : fData(dat)
+    {
+        Reset();
+    }
+
+    MRawEvtData *Next();
+
+    Bool_t Jump(UShort_t id)
+    {
+        //
+        // Jump to the pixel with the pixel-id ID
+        // If it doesn't exist return FALSE
+        //
+        Reset();
+        while (Next())
+            if (GetPixelId() == id)
+                return kTRUE;
+        return kFALSE;
+    }
+
+    UShort_t GetPixelId() const
+    {
+        //
+        // return Id of actual pixel
+        //
+        return *fHiGainId;
+    }
+
+    UShort_t GetNumEntry() const
+    {
+        return fNumHiGainEntry;
+    }
+
+    Byte_t GetNumPixels() const;
+
+    Byte_t *GetHiGainFadcSamples() const
+    {
+        //
+        // return a pointer to the fadc samples of the hi gains
+        // WARNING: Don't forget to get the number of valid entries
+        //          (GetNumSamples) to know how many entries of the array
+        //          belong to the actual pixel
+        //
+        return fHiGainPos;
+    }
+
+    ULong_t GetSumHiGainFadcSamples() const;
+
+    Bool_t HasLoGain() const
+    {
+        //
+        // return kTRUE  the lo gains exist for the actual pixel, else return kFALSE
+        //
+        return *fHiGainId==*fLoGainId;
+    }
+
+    Byte_t *GetLoGainFadcSamples() const
+    {
+        //
+        // return a pointer to the fadc samples of the lo gains if they exist
+        // for the actual pixel, else return zero
+        //
+        return HasLoGain() ? fLoGainPos : NULL;
+    }
+
+    ULong_t GetSumLoGainFadcSamples() const;
+
+    void Reset();
+
+    void Draw(Option_t *t="GRAPH");
+
+    ClassDef(MRawEvtPixelIter, 0) // iterates over all pixels of one MRawEvtData object
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawFileRead.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawFileRead.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawFileRead.cc	(revision 9634)
@@ -0,0 +1,226 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+////////////////////////////////////////////////////////////////////////
+//
+//  MRawFile
+//
+//  This tasks reads the raw binary file like specified in the TDAS???
+//  and writes the data in the corresponding containers which are
+//  either retrieved from the parameter list or created and added.
+//
+//  Input Containers:
+//   -/-
+//
+//  Output Containers:
+//   MRawRunHeader, MRawEvtHeader, MRawEvtData, MRawCrateArray, MRawEvtTime
+//
+////////////////////////////////////////////////////////////////////////
+
+#include "MRawFileRead.h"
+
+#include <fstream.h>
+
+#include "MLog.h"
+#include "MTime.h"
+#include "MParList.h"
+#include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
+#include "MRawEvtData.h"
+#include "MRawCrateData.h"
+#include "MRawCrateArray.h"
+
+ClassImp(MRawFileRead);
+
+
+/*/  ----------- please don't delete and don't care about (Thomas) ------------
+#define kBUFSZ 1024
+
+class bifstream : public istream, public streambuf
+{
+private:
+    char fBuffer[kBUFSZ]; //!
+    FILE *fd;
+
+    int sync()
+    {
+        memset(fBuffer, 0, kBUFSZ);
+        return 0; 
+    }
+    int underflow()
+    {
+        int sz=fread(fBuffer, kBUFSZ, 1, fd);
+        setg(fBuffer, fBuffer, fBuffer+kBUFSZ);
+
+        return sz==kBUFSZ ? *(unsigned char*)fBuffer : EOF;//EOF;
+    }
+public:
+    bifstream(const char *name) : istream(this)
+    {
+        fd = fopen(name, "rb");
+        setbuf(fBuffer, kBUFSZ);
+    }
+};
+*/
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. It tries to open the given file.
+//
+MRawFileRead::MRawFileRead(const char *fname, const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MRawFileRead";
+    *fTitle = title ? title : "Read task to read DAQ binary files";
+
+    //
+    // open the input stream
+    //
+    fFileName = fname;
+    fIn = new ifstream(fname);
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor. Delete input stream.
+//
+MRawFileRead::~MRawFileRead()
+{
+    delete fIn;
+}
+
+// --------------------------------------------------------------------------
+//
+// The PreProcess of this task checks for the following containers in the
+// list:
+//   MRawRunHeader <output>   if not found it is created
+//   MRawEvtHeader <output>   if not found it is created
+//   MRawEvtData <output>     if not found it is created
+//   MRawCrateArray <output>  if not found it is created
+//   MRawEvtTime <output>     if not found it is created (MTime)
+//
+// If all containers are found or created the run header is read from the
+// binary file and printed.  If the Magic-Number (file identification)
+// doesn't match we stop the eventloop.
+//
+// Now the EvtHeader and EvtData containers are initialized.
+//
+Bool_t MRawFileRead::PreProcess(MParList *pList)
+{
+    //
+    // first of all check if opening the file in the constructor was
+    // successfull
+    //
+    if (!(*fIn))
+    {
+        *fLog << "Error: Cannot open file '" << fFileName << "'" << endl;
+        return kFALSE;
+    }
+
+    //
+    //  check if all necessary containers exist in the Parameter list.
+    //  if not create one and add them to the list
+    //
+    fRawRunHeader = (MRawRunHeader*)pList->FindCreateObj("MRawRunHeader");
+    if (!fRawRunHeader)
+        return kFALSE;
+
+    fRawEvtHeader = (MRawEvtHeader*)pList->FindCreateObj("MRawEvtHeader");
+    if (!fRawEvtHeader)
+        return kFALSE;
+
+    fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
+    if (!fRawEvtData)
+        return kFALSE;
+
+    fRawCrateArray = (MRawCrateArray*)pList->FindCreateObj("MRawCrateArray");
+    if (!fRawCrateArray)
+        return kFALSE;
+
+    fRawEvtTime = (MTime*)pList->FindCreateObj("MTime", "MRawEvtTime");
+    if (!fRawEvtTime)
+        return kTRUE;
+
+    //
+    // Read RUN HEADER (see specification) from input stream
+    //
+    fRawRunHeader->ReadEvt(*fIn);
+    fRawRunHeader->Print();
+
+    if (fRawRunHeader->GetMagicNumber()!=kMagicNumber)
+        return kFALSE;
+
+    //
+    // Give the run header information to the 'sub-classes'
+    //
+    fRawEvtHeader->Init(fRawRunHeader, fRawEvtTime);
+    fRawEvtData  ->Init(fRawRunHeader);
+
+    return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// The Process reads one event from the binary file:
+//  - The event header is read
+//  - the run header is read
+//  - all crate information is read
+//  - the raw data information of one event is read
+//
+Bool_t MRawFileRead::Process()
+{
+    //
+    //  Read in the next EVENT HEADER (see specification),
+    // if there is no next event anymore stop eventloop
+    //
+    if (!fRawEvtHeader->ReadEvt(*fIn))
+        return kFALSE;
+
+    //
+    // Delete arrays which stores the pixel information (time slices)
+    //
+    fRawEvtData->DeletePixels();
+
+    //
+    // clear the TClonesArray which stores the Crate Information
+    //
+    fRawCrateArray->Clear();
+
+    //
+    //  Get number of crates from the run header
+    //
+    const UShort_t nc = fRawRunHeader->GetNumCrates();
+
+    //
+    // read the CRATE DATA (see specification) from file
+    //
+    for (int i=0; i<nc; i++)
+    {
+        fRawCrateArray->GetEntry(i)->ReadEvt(*fIn);
+
+        fRawEvtData->ReadEvt(*fIn);
+    }
+
+    return kTRUE;
+}
+
Index: /tags/Mars_V0-4/Mars/mraw/MRawFileRead.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawFileRead.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawFileRead.h	(revision 9634)
@@ -0,0 +1,39 @@
+#ifndef MRAWFILEREAD_H
+#define MRAWFILEREAD_H
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class ifstream;
+
+class MTime;
+class MParList;
+class MRawRunHeader;
+class MRawEvtHeader;
+class MRawEvtData;
+class MRawCrateArray;
+
+class MRawFileRead : public MTask
+{
+private:
+    MRawRunHeader  *fRawRunHeader;  // run header information container to fill from file
+    MRawEvtHeader  *fRawEvtHeader;  // event header information container to fill from file
+    MRawEvtData    *fRawEvtData;    // raw evt header infomation container to fill from file
+    MRawCrateArray *fRawCrateArray; // crate information array container to fill from file
+    MTime          *fRawEvtTime;    // raw evt time information container to fill from file
+
+    TString         fFileName;
+    ifstream       *fIn;            //! buffered input stream (file to read from)
+
+public:
+    MRawFileRead(const char *filename, const char *name=NULL, const char *title=NULL);
+    ~MRawFileRead();
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MRawFileRead, 0)	// Task to read the raw data binary file
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawFileWrite.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawFileWrite.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawFileWrite.cc	(revision 9634)
@@ -0,0 +1,229 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+////////////////////////////////////////////////////////////////////////
+//
+//  MRawFileWrite
+//
+//  Here we write the root containers which contains the data from a
+//  root binary file to a root file. See also MRawFileRead
+//
+//  Input Containers:
+//   MRawRunHeader, MRawEvtHeader, MRawEvtData, MRawCrateArray, MRawEvtTime
+//
+//  Output Containers:
+//   -/-
+//
+////////////////////////////////////////////////////////////////////////
+
+#include "MRawFileWrite.h"
+
+#include <TFile.h>
+#include <TTree.h>
+#include <TBranch.h>
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MParList.h"
+#include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
+#include "MRawEvtData.h"
+#include "MRawCrateArray.h"
+
+ClassImp(MRawFileWrite);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. It opens the output file (root-file)
+//
+MRawFileWrite::MRawFileWrite(const char *fname,
+                             const Option_t *opt,
+                             const char *ftitle,
+                             const Int_t comp,
+                             const char *name, const char *title)
+{
+    *fName  = name  ? name  : "MRawFileWrite";
+    *fTitle = title ? title : "Write task to write DAQ root files";
+
+    //
+    // Open a rootfile
+    //
+    fOut = new TFile(fname, opt, ftitle, comp);
+}
+
+MRawFileWrite::~MRawFileWrite()
+{
+    //
+    // delete instance, this also does a fOut->Close()
+    //
+    if (fOut->IsOpen())
+        fOut->Write();
+
+    delete fOut;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// The PreProcess function checks for the following input containers:
+//  - MRawEvtHeader
+//  - MRawEvtData
+//  - MRawCrateArray
+//  - MRawEvtTime <MTime>
+//  - MRawRunHeader
+// if a container isn't found the eventloop is stopped.
+//
+// The tree which should containe the run header is created. <RunHeaders>
+// The trees which contains the Events <Events>, <PedEvents>, <CalEvents>
+// are created.
+//
+Bool_t MRawFileWrite::PreProcess (MParList *pList)
+{
+    //
+    // test whether file is now open or not
+    //
+    if (!fOut->IsOpen())
+    {
+        *fLog << dbginf << "Error: Cannot open file '" << fOut->GetName() << "'" << endl;
+        return kFALSE;
+    }
+
+    //
+    // remember the pointer to the parameter list fur further usage
+    //
+    pParList = pList;
+
+    //
+    //  check if MEvtHeader exists in the Parameter list already.
+    //  if not create one and add them to the list
+    //
+    fRawEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
+    if (!fRawEvtHeader)
+    {
+        *fLog << dbginf << "MRawEvtHeader not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fRawEvtData = (MRawEvtData*)pList->FindObject("MRawEvtData");
+    if (!fRawEvtData)
+    {
+        *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fRawCrateArray = (MRawCrateArray*)pList->FindObject("MRawCrateArray");
+    if (!fRawCrateArray)
+    {
+        *fLog << dbginf << "MRawCrateArray not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fRawEvtTime = (MTime*)pList->FindObject("MRawEvtTime");
+    if (!fRawEvtTime)
+    {
+        *fLog << dbginf << "MRawEvtTime not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    fRawRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
+    if (!fRawRunHeader)
+    {
+        *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
+        return kFALSE;
+    }
+
+    //
+    // Write the run header information to the file
+    //
+    TTree   *rh = new TTree("RunHeaders", "Run headers of all runs in this file");
+    TBranch *tb = rh->Branch("MRawRunHeader", "MRawRunHeader", &fRawRunHeader, 32000, 1);
+    rh->Fill();
+    rh->Write();
+    delete tb;
+    delete rh;
+
+    //
+    // create data trees for the three types of data
+    //
+    fTData        = new TTree("Events",    "Normal Triggered Events");
+    fTPedestal    = new TTree("PedEvents", "Pedestal Triggered Events");
+    fTCalibration = new TTree("CalEvents", "Calibration Triggered Events");
+
+    //
+    // create all branches which are necessary
+    //
+    fTData       ->Branch("MTime",          "MTime",          &fRawEvtTime,    32000, 1);
+    fTPedestal   ->Branch("MTime",          "MTime",          &fRawEvtTime,    32000, 1);
+    fTCalibration->Branch("MTime",          "MTime",          &fRawEvtTime,    32000, 1);
+    fTData       ->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000, 1);
+    fTPedestal   ->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000, 1);
+    fTCalibration->Branch("MRawEvtHeader",  "MRawEvtHeader",  &fRawEvtHeader,  32000, 1);
+    fTData       ->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    32000, 1);
+    fTPedestal   ->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    320000, 1);
+    fTCalibration->Branch("MRawEvtData",    "MRawEvtData",    &fRawEvtData,    320000, 1);
+    //fTree->Branch("MRawCrateArray",  fRawCrateArray->GetArray(),      32000, 1);
+    fTData       ->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000, 1);
+    fTPedestal   ->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000, 1);
+    fTCalibration->Branch("MRawCrateArray", "MRawCrateArray", &fRawCrateArray, 32000, 1);
+
+    return kTRUE;
+}
+    
+// --------------------------------------------------------------------------
+//
+// Gets the trigger type from the run header to decide into which tree the
+// event should be filled in and fills  it into this tree.
+//
+Bool_t MRawFileWrite::Process()
+{
+    //
+    // get the trigger type of the actual event
+    //
+    const UShort_t type = fRawEvtHeader->GetTrigType();
+    cout << "W" << flush;
+    //
+    // writa data to the tree. the tree is choosen by the type of the event
+    //
+    switch (type)
+    {
+    case kTTEvent:
+        fTData->Fill();
+        return kTRUE;
+
+    case kTTPedestal:
+        fTPedestal->Fill();
+        return kTRUE;
+
+    case kTTCalibration:
+        fTCalibration->Fill();
+        return kTRUE;
+    }
+
+    *fLog << dbginf << "Got wrong number for the trigger type: " << type;
+    *fLog << "  - skipping" << endl;
+
+    return kCONTINUE;
+}
+
Index: /tags/Mars_V0-4/Mars/mraw/MRawFileWrite.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawFileWrite.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawFileWrite.h	(revision 9634)
@@ -0,0 +1,49 @@
+#ifndef MRAWFILEWRITE_H
+#define MRAWFILEWRITE_H
+
+#ifndef MTASK_H
+#include "MTask.h"
+#endif
+
+class TFile;
+class TTree;
+
+class MTime;
+class MParList;
+class MRawRunHeader;
+class MRawEvtHeader;
+class MRawCrateArray;
+class MRawEvtData;
+
+class MRawFileWrite : public MTask
+{
+private:
+    MParList *pParList;             
+
+    MTime          *fRawEvtTime;    
+    MRawRunHeader  *fRawRunHeader;  
+    MRawEvtHeader  *fRawEvtHeader;  
+    MRawEvtData    *fRawEvtData;    
+    MRawCrateArray *fRawCrateArray; 
+
+    TTree *fTData;                  //!
+    TTree *fTPedestal;              //!
+    TTree *fTCalibration;           //!
+
+    TFile *fOut;                    //!
+
+public:
+    MRawFileWrite(const char *fname,
+                  const Option_t *opt="UPDATE",
+                  const char *ftitle="Unnamed",
+                  const Int_t comp=9,
+                  const char *name=NULL, const char *title=NULL);
+    ~MRawFileWrite();
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MRawFileWrite, 0)	// Task to write the raw data containers to a root file
+};
+
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/MRawRunHeader.cc
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawRunHeader.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawRunHeader.cc	(revision 9634)
@@ -0,0 +1,181 @@
+/* ======================================================================== *\
+!
+! *
+! * 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  12/2000 (tbretz@uni-sw.gwdg.de)
+!
+!   Copyright: MAGIC Software Development, 2000-2001
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MRawRunHeader
+//
+// Root storage container for the RUN HEADER information
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "MRawRunHeader.h"
+
+#include <fstream.h>
+#include <iomanip.h>
+
+#include "MLog.h"
+#include "MArrayS.h"
+
+ClassImp(MRawRunHeader);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. Creates array which stores the pixel assignment.
+//
+//
+MRawRunHeader::MRawRunHeader(const char *name, const char *title) : fPixAssignment(NULL)
+{
+    *fName  = name  ? name  : "MRawRunHeader";
+    *fTitle = title ? title : "Raw Run Header Information";
+
+    fPixAssignment = new MArrayS(0);
+
+    // This is only valid for root > 3.0
+    // IsA()->CanIgnoreTObjectStreamer();
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor. Deletes the 'pixel-assignment-array'
+//
+MRawRunHeader::~MRawRunHeader()
+{
+    delete fPixAssignment;
+}
+
+// --------------------------------------------------------------------------
+//
+// Read in one run header from the binary file
+//
+void MRawRunHeader::ReadEvt(istream& fin)
+{
+    //
+    // read one RUN HEADER from the input stream
+    //
+    fin.read((Byte_t*)&fMagicNumber,       2);
+
+    //
+    // check whether the the file has the right file type or not
+    //
+    if (fMagicNumber != kMagicNumber)
+    {
+        *fLog << "Error: Wrong Magic Number: Not a Magic File!" << endl;
+        return;
+    }
+
+    Byte_t dummy[16];
+
+    fin.read((Byte_t*)&fFormatVersion,    2);
+    fin.read((Byte_t*)&fSoftVersion,      2);
+    fin.read((Byte_t*)&fRunType,          2);
+    fin.read((Byte_t*)&fRunNumber,        4);
+    fin.read((Byte_t*)&fProjectName,     22);
+    fin.read((Byte_t*)&fSourceName,      12);
+    fin.read((Byte_t*)dummy,              4); // was RA
+    fin.read((Byte_t*)dummy,              4); // was DEC
+    fin.read((Byte_t*)&fSourceEpochChar,  2);
+    fin.read((Byte_t*)&fSourceEpochDate,  2);
+    fin.read((Byte_t*)&fMJD,              4);
+    fin.read((Byte_t*)&fDateYear,         2);
+    fin.read((Byte_t*)&fDateMonth,        2);
+    fin.read((Byte_t*)&fDateDay,          2);
+    fin.read((Byte_t*)&fNumCrates,        2);
+    fin.read((Byte_t*)&fNumPixInCrate,    2);
+    fin.read((Byte_t*)&fNumSamplesLoGain, 2);
+    fin.read((Byte_t*)&fNumSamplesHiGain, 2);
+    fin.read((Byte_t*)&fNumEvents,        4);
+
+
+    //
+    // calculate size of array, create it and fill it
+    //
+    Int_t nPixel = fNumCrates*fNumPixInCrate;
+    fPixAssignment->Set(nPixel);
+
+    fin.read((Byte_t*)fPixAssignment->GetArray(), nPixel*2);
+    fin.read((Byte_t*)&dummy, 16);
+}
+
+// --------------------------------------------------------------------------
+//
+// print run header information on *fLog
+//
+void MRawRunHeader::Print(Option_t *t)
+{
+    *fLog << endl;
+    *fLog << "MagicNumber:  0x" << hex << fMagicNumber << " - " << (fMagicNumber==kMagicNumber?"OK":"Wrong!") << endl;
+    *fLog << "Version:      " << dec << "Format=" << fFormatVersion << "  ";
+    *fLog << "Software=" << fSoftVersion << endl;
+    *fLog << "RunNumber:    " << fRunNumber << " (Type=";
+    switch (fRunType)
+    {
+    case 0:
+        *fLog << "Data";
+        break;
+    case 1:
+        *fLog << "Pedestal";
+        break;
+    case 2:
+        *fLog << "Calibration";
+        break;
+    case 256:
+        *fLog << "Monte Carlo Data";
+        break;
+    }
+    *fLog << ")" << endl;
+    *fLog << "ProjectName: '" << fProjectName << "'" << endl;
+    *fLog << "Source:      '" << fSourceName << "' " << "  ";
+    *fLog << fSourceEpochChar << dec << fSourceEpochDate << endl;
+    *fLog << "Date:         " << setprecision(1) << setiosflags(ios::fixed) << fMJD << " (MJD)  " << fDateYear << "/" << fDateMonth << "/" << fDateDay << endl;
+    *fLog << "Crates:       " << fNumCrates << " x " << fNumPixInCrate << " Pixel/Crate = " << fNumCrates*fNumPixInCrate << " Pixel/Evt" << endl;
+    *fLog << "Samples:      " << fNumSamplesLoGain << "/" << fNumSamplesHiGain << " (lo/hi) = " << (fNumSamplesLoGain+fNumSamplesHiGain) * fNumCrates * fNumPixInCrate /1024 << "kB/Evt" << endl;
+    *fLog << "Evt Counter:  " << fNumEvents << endl;
+
+    *fLog << hex;
+    for (int i=0; i<GetNumPixel(); i++)
+        *fLog << setfill('0') << setw(3) << (*fPixAssignment)[i] << " ";
+    *fLog << hex << endl;
+
+    *fLog << endl;
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the assigned pixel number for the given FADC channel
+//
+UShort_t MRawRunHeader::GetPixAssignment(UShort_t i) const
+{
+    // FIXME: Do we need a range check here?
+    return (*fPixAssignment)[i];
+}
+
+// --------------------------------------------------------------------------
+//
+// return the number of pixel in this event.
+//
+UShort_t MRawRunHeader::GetNumPixel() const
+{
+    return fPixAssignment->GetSize();
+}
Index: /tags/Mars_V0-4/Mars/mraw/MRawRunHeader.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/MRawRunHeader.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/MRawRunHeader.h	(revision 9634)
@@ -0,0 +1,96 @@
+#ifndef MRAWRUNHEADER_H
+#define MRAWRUNHEADER_H
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+// MRunHeader                                                        //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
+
+#ifndef MPARCONTAINER_H
+#include "MParContainer.h"
+#endif
+
+class TBuffer;
+class ifstream;
+class MArrayS;
+
+//
+// Magic number to detect the magic file type
+//
+const UShort_t kMagicNumber = 0xc0c0;
+
+class MRawRunHeader : public MParContainer
+{
+private:
+    /* ---- Run Header Informations ---- */
+    UShort_t  fMagicNumber;
+    UShort_t  fFormatVersion;
+    UShort_t  fSoftVersion;
+    UShort_t  fRunType;
+    UInt_t    fRunNumber;
+    Char_t    fProjectName[22];
+    Char_t    fSourceName[12];
+    //Float_t   fSourceRA;
+    //Float_t   fSourceDEC;
+    Char_t    fSourceEpochChar[2];
+    UShort_t  fSourceEpochDate;
+    Float_t   fMJD;
+    UShort_t  fDateYear;
+    UShort_t  fDateMonth;
+    UShort_t  fDateDay;
+    UShort_t  fNumCrates;
+    UShort_t  fNumPixInCrate;
+    UShort_t  fNumSamplesLoGain;
+    UShort_t  fNumSamplesHiGain;
+    UInt_t    fNumEvents;
+    MArrayS  *fPixAssignment;
+
+public:
+    MRawRunHeader(const char *name=NULL, const char *title=NULL);
+    ~MRawRunHeader();
+
+    void SetMagicNumber(UShort_t a){fMagicNumber=a;}
+    void SetFormatVersion(UShort_t a){fFormatVersion=a;}    
+    void SetSoftVersion(UShort_t a){fSoftVersion=a;}
+    void SetRunType(UShort_t a){ fRunType=a;}
+    void SetRunNumber(UInt_t a){fRunNumber=a;}
+    void SetNumSamples(UShort_t low, UShort_t high)
+      {fNumSamplesLoGain=low;fNumSamplesHiGain=high;}
+    void SetNumEvents(UInt_t a){fNumEvents=a;}
+
+    UShort_t GetMagicNumber() const      { return fMagicNumber; }
+    UShort_t GetFormatversion() const    { return fFormatVersion; }
+    UShort_t GetSoftVersion() const      { return fSoftVersion; }
+    UShort_t GetRunType() const          { return fRunType; }
+    UInt_t   GetRunNumber() const        { return fRunNumber; }
+    const Char_t  *GetProjectName() const      { return fProjectName; }
+    const Char_t  *GetSourceName() const       { return fSourceName; }
+    //Float_t  GetSourceRa() const         { return fSourceRA; }
+    //Float_t  GetSourceDec() const        { return fSourceDEC; }
+    const Char_t  *GetSourceEpocheChar() const { return fSourceEpochChar; }
+    UShort_t GetSourceEpocheDate() const { return fSourceEpochDate; }
+    Float_t  GetMJD() const              { return fMJD; }
+    UShort_t GetDateYear() const         { return fDateYear; }
+    Byte_t   GetDateMonth() const        { return fDateMonth; }
+    Byte_t   GetDateDay() const          { return fDateDay; }
+    UShort_t GetNumCrates() const        { return fNumCrates; }
+    UShort_t GetNumPixInCrate() const    { return fNumPixInCrate; }
+    UShort_t GetNumSamplesLoGain() const { return fNumSamplesLoGain; }
+    UShort_t GetNumSamplesHiGain() const { return fNumSamplesHiGain; }
+    UShort_t GetNumEvents() const        { return fNumEvents; }
+    UShort_t GetPixAssignment(UShort_t i) const;
+
+    UInt_t GetNumSamplesPerCrate() const
+    {
+        return fNumPixInCrate*(fNumSamplesLoGain+fNumSamplesHiGain);
+    }
+
+    UShort_t GetNumPixel() const;
+
+    void Print(Option_t *t=NULL);
+
+    void ReadEvt(istream& fin);
+
+    ClassDef(MRawRunHeader, 1)	// storage container for general info
+};
+#endif
Index: /tags/Mars_V0-4/Mars/mraw/Makefile
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/Makefile	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/Makefile	(revision 9634)
@@ -0,0 +1,54 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = Raw
+
+#
+# Library name to creatre
+#
+LIB   = mraw.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MRawRunHeader.cc \
+	   MRawEvtHeader.cc \
+	   MRawEvtData.cc \
+	   MRawEvtPixelIter.cc \
+	   MRawCrateArray.cc \
+	   MRawCrateData.cc \
+           MRawFileRead.cc \
+           MRawFileWrite.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+mrproper:	clean rmbak
+
+# @endcode
+
Index: /tags/Mars_V0-4/Mars/mraw/RawIncl.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/RawIncl.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/RawIncl.h	(revision 9634)
@@ -0,0 +1,10 @@
+#ifndef __CINT__
+
+#include "MTime.h"
+#include "MArrayB.h"
+#include "MArrayS.h"
+#include "MParList.h"
+
+#include <TClonesArray.h>
+
+#endif // __CINT__
Index: /tags/Mars_V0-4/Mars/mraw/RawLinkDef.h
===================================================================
--- /tags/Mars_V0-4/Mars/mraw/RawLinkDef.h	(revision 9634)
+++ /tags/Mars_V0-4/Mars/mraw/RawLinkDef.h	(revision 9634)
@@ -0,0 +1,19 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MRawRunHeader;
+
+#pragma link C++ class MRawEvtHeader;
+#pragma link C++ class MRawEvtData;
+#pragma link C++ class MRawEvtPixelIter;
+
+#pragma link C++ class MRawCrateArray;
+#pragma link C++ class MRawCrateData;
+
+#pragma link C++ class MRawFileRead;
+#pragma link C++ class MRawFileWrite;
+
+#endif
Index: /tags/Mars_V0-4/Mars/readraw.cc
===================================================================
--- /tags/Mars_V0-4/Mars/readraw.cc	(revision 9634)
+++ /tags/Mars_V0-4/Mars/readraw.cc	(revision 9634)
@@ -0,0 +1,167 @@
+#include <TSystem.h>
+
+#include "TFile.h"
+#include "TTree.h"
+#include "TBranch.h"
+
+#include "MParList.h"
+#include "MTaskList.h"
+#include "MEvtLoop.h"
+
+#include "MLog.h"
+#include "MTime.h"
+#include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
+#include "MRawEvtData.h"
+#include "MRawCrateArray.h"
+#include "MInputStreamID.h"
+
+#include "MMcEvt.hxx" 
+#include "MMcTrig.hxx" 
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// This is an demonstration how to read in a merpped root file
+//
+/////////////////////////////////////////////////////////////////////////////
+
+int main(const int argc, const char **argv)
+{
+    gLog << "==================================================" << endl ;
+    gLog << "                   ReadRaw v0.1" << endl;
+    gLog << "      MARS Merging and Preprocessing Program" << endl ;
+    gLog << "            Compiled on <" << __DATE__ << ">" << endl ;
+    gLog << "==================================================" << endl ;
+    gLog << endl;
+
+    //
+    // check for the right usage of the program
+    //
+    if (argc!=2)
+    {
+        gLog << "Sorry the usage is:" << endl;
+        gLog << "   readraw inputfile" << endl << endl;
+        return -1;
+    }
+
+    //
+    //     initialize ROOT  (this is obligatory here)
+    //
+    TROOT simple("Readraw","Mars - Merging and Preprocessing Program");
+
+    //
+    // check whether the given files are OK.
+    //
+    if (gSystem->AccessPathName(argv[1], kFileExists))
+    {
+        gLog << "Sorry, the file '" << argv[1] << "' doesn't exist." << endl;
+        return -1;
+    }
+
+    MRawRunHeader  *runheader = new MRawRunHeader();
+    MRawEvtHeader  *evtheader = new MRawEvtHeader();
+    MTime          *evttime   = new MTime();
+    MRawEvtData    *evtdata   = new MRawEvtData();
+    MRawCrateArray *evtcrate  = new MRawCrateArray();
+
+    MMcEvt         *evtmc     = new MMcEvt() ; 
+    MMcTrig        *trigmc    = new MMcTrig() ; 
+
+    //
+    //  open the file
+    //
+    gLog << " Open the file " << endl ; 
+    TFile input(argv[1], "READ");
+
+    //
+    // open the Run Header and read in
+    //
+    gLog << " Check the RunHeader " << endl ; 
+    TTree *runtree = (TTree*) input.Get("RunHeaders") ;
+    
+    if (!runtree)
+    {
+        gLog << endl
+            << "  WARNING: This file has NO RunHeader "
+            << endl << endl ;
+    }
+    else
+    {
+        gLog << " Entries in Tree RunHeaders: " << dec << runtree->GetEntries() << endl ;
+
+        runtree->GetBranch("MRawRunHeader")->SetAddress(&runheader);
+        runtree->GetEvent(0);
+
+        runheader->Print();
+    }
+
+    //
+    // open the DataTree and read in 
+    //
+    gLog << " Check the Event Tree " << endl ; 
+    TTree *evttree = (TTree*) input.Get("Events") ;
+    gLog << " Check all the Branches in the Tree " << endl ; 
+    
+    //
+    //  check the branches in the Tree 
+    //
+    TIter Next(evttree->GetListOfBranches());
+    TBranch *branch=NULL;
+    
+    while ((branch=(TBranch*)Next()))
+    {
+        //
+        // Get Name of Branch
+        //
+        const char *name = branch->GetName();
+	
+        if (!strcmp(name, "MRawEvtHeader"))
+            evttree->GetBranch("MRawEvtHeader")->SetAddress(&evtheader);
+
+        if (!strcmp(name, "MTime"))
+            evttree->GetBranch("MTime")->SetAddress(&evttime);
+
+        if (!strcmp(name, "MRawEvtData"))
+            evttree->GetBranch("MRawEvtData")->SetAddress(&evtdata);
+
+        if (!strcmp(name, "MRawCrateArray"))
+            evttree->GetBranch("MRawCrateArray")->SetAddress(&evtcrate);
+
+        if (!strcmp(name, "MMcTrig"))
+            evttree->GetBranch("MMcTrig")->SetAddress(&trigmc);
+
+        if (!strcmp(name, "MMcEvt"))
+            evttree->GetBranch("MMcEvt")->SetAddress(&evtmc);
+    } 
+
+    //
+    // loop over all entries 
+    //
+    Int_t nent = (Int_t)evttree->GetEntries();
+
+    gLog << endl << endl;
+    gLog << " Entries in Tree Data: " << dec << nent << endl;
+
+    for (Int_t i = 0; i<nent; i++)
+    {
+        gLog << "Entry: " << i << endl;
+
+        //
+        // readin event with the selected branches
+        //
+        evttree->GetEvent(i);
+
+	evtmc->Print("") ; 
+	
+        evtheader->Print();
+        evttime->Print();
+        evtcrate->Print();
+        evtdata->Print();
+    } 
+    
+    //   end of small readin program 
+
+    return 0;
+}
+
+
