Index: /tags/Mars_V0-7/Mars/mmc/MFadcDefine.h
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MFadcDefine.h	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MFadcDefine.h	(revision 9644)
@@ -0,0 +1,43 @@
+//
+//  --> Frist of all the WIDTH of the time slice of one FADC slice 
+//      this is 3.33333 nsec.
+//
+#define WIDTH_FADC_TIMESLICE   (50./15.)       //  this means 3.33 nsec 
+//
+//  --> Second the number of slices to fill in MFADC. This must by 
+//      connected to the MTrigger class. The time of interest must be
+//      equal in both classes. 
+//
+#define SLICES_MFADC           (TOTAL_TRIGGER_TIME / WIDTH_FADC_TIMESLICE)
+//
+//  --> The amount of FADC slice written to the raw format.
+//
+#define FADC_SLICES  15
+//
+//  --> The amount of ns before trigger that would be read from the ADC
+//      in oder to show also the start of the pulse before the
+//      the trigger time.
+//
+#define TIME_BEFORE_TRIGGER    10.
+//  --> like the trigger the FADC value will also have a standard response
+//      to one single Photo electron. This response is binned with smaller
+//      bins. The WIDTH of that response function is done here. 
+// 
+#define SUBBINS     5.
+#define WIDTH_RESPONSE_MFADC   (WIDTH_FADC_TIMESLICE /  SUBBINS )  
+// 5 sub-bin in one FADC slice 
+//
+//  --> the number of Response slices
+//
+#define RESPONSE_SLICES_MFADC   45         
+//
+//
+#define MFADC_RESPONSE_FWHM        5.0
+
+//
+//
+#define MFADC_RESPONSE_AMPLITUDE   4.0
+//
+// -->  The maximum number of FADC channels
+//      Most likely it will be always equal to CAMERA_PIXELS 
+#define MFADC_CHANNELS  577
Index: /tags/Mars_V0-7/Mars/mmc/MMcEvt.cxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcEvt.cxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcEvt.cxx	(revision 9644)
@@ -0,0 +1,183 @@
+#include "MMcEvt.hxx"
+
+#include <iostream.h>
+#include <fstream.h>
+
+
+//==========
+// MMcEvt
+//    
+// This class handles and contains the MonteCarlo information
+// with which the events have been generated
+// This information exists for each event.
+ 
+
+
+ClassImp(MMcEvt);
+
+
+
+MMcEvt::MMcEvt() {
+  //
+  //  default constructor
+  //  set all values to zero
+    fName  = "MMcEvt";
+    fTitle = "Event info from Monte Carlo";
+
+  fPartId = 0  ;
+  fEnergy  = 0. ;
+
+  fTheta   = 0. ;
+  fPhi     = 0. ;
+
+  fCoreD   = 0. ;
+  fCoreX   = 0. ;
+  fCoreY   = 0. ;
+  fImpact  = 0. ;
+
+  fPhotIni      = 0 ;
+  fPassPhotAtm  = 0 ;
+  fPassPhotRef  = 0 ;
+  fPassPhotCone = 0 ;
+  fPhotElfromShower = 0 ;
+  fPhotElinCamera = 0 ;
+}
+
+MMcEvt::MMcEvt( UShort_t usPId, 
+		Float_t  fEner, 
+		Float_t  fThet, 
+		Float_t  fPhii, 
+		Float_t  fCorD, 
+		Float_t  fCorX, 
+		Float_t  fCorY,
+		Float_t  fImpa, 
+		UInt_t   uiPin, 
+		UInt_t   uiPat,  
+		UInt_t   uiPre, 
+		UInt_t   uiPco,  
+		UInt_t   uiPelS,
+		UInt_t   uiPelC ) {
+
+    fName  = "MMcEvt";
+    fTitle = "Event info from Monte Carlo";
+  //
+  //  constuctor II 
+  //
+  //  All datamembers are parameters. 
+  //
+  //  Don't use this memberfunction in analysis
+  //  
+
+  fPartId = usPId  ;
+  fEnergy  = fEner  ;
+
+  fTheta   = fThet ;
+  fPhi     = fPhii ;
+
+  fCoreD   = fCorD ;
+  fCoreX   = fCorX ;
+  fCoreY   = fCorY ;
+  fImpact  = fImpa ;
+
+  fPhotIni      = uiPin ;
+  fPassPhotAtm  = uiPat ;
+  fPassPhotRef  = uiPre ;
+  fPassPhotCone = uiPco ;
+  fPhotElfromShower = uiPelS ;
+  fPhotElinCamera   = uiPelC ;
+}
+
+
+
+MMcEvt::~MMcEvt() {
+  //
+  //  default destructor
+  //
+}
+
+
+
+
+void MMcEvt::Clear(Option_t *opt) {
+  //
+  //  
+  //  reset all values to zero
+
+  fPartId = 0  ;
+  fEnergy  = 0. ;
+
+  fTheta   = 0. ;
+  fPhi     = 0. ;
+
+  fCoreD   = 0. ;
+  fCoreX   = 0. ;
+  fCoreY   = 0. ;
+  fImpact  = 0. ;
+
+  fPhotIni      = 0 ;
+  fPassPhotAtm  = 0 ;
+  fPassPhotRef  = 0 ;
+  fPassPhotCone = 0 ;
+  fPhotElfromShower = 0 ;
+  fPhotElinCamera   = 0 ;
+}
+
+void MMcEvt::Fill( UShort_t usPId, 
+		   Float_t  fEner, 
+		   Float_t  fThet, 
+		   Float_t  fPhii, 
+		   Float_t  fCorD, 
+		   Float_t  fCorX, 
+		   Float_t  fCorY,
+		   Float_t  fImpa, 
+		   UInt_t   uiPin, 
+		   UInt_t   uiPat,  
+		   UInt_t   uiPre, 
+		   UInt_t   uiPco,  
+		   UInt_t   uiPelS,  
+		   UInt_t   uiPelC ) {
+  //
+  //  All datamembers are filled with the correspondin parameters. 
+  //
+  //  Don't use this memberfunction in analysis
+  //  
+
+  fPartId = usPId  ;
+  fEnergy = fEner  ;
+
+  fTheta  = fThet ;
+  fPhi    = fPhii ;
+
+  fCoreD  = fCorD ;
+  fCoreX  = fCorX ;
+  fCoreY  = fCorY ;
+  fImpact = fImpa ;
+
+  fPhotIni      = uiPin ;
+  fPassPhotAtm  = fPhotIni-uiPat ;
+  fPassPhotRef  = fPassPhotAtm-uiPre ;
+  fPassPhotCone = uiPco ;
+  fPhotElfromShower = uiPelS ;
+  fPhotElinCamera = uiPelC ;
+}
+
+/*
+void MMcEvt::AsciiWrite(ofstream &fout) const
+{
+    fout << fEnergy << " ";
+    fout << fTheta ;
+}
+*/
+
+void MMcEvt::Print(Option_t *Option) const {
+  //
+  //  print out the data member on screen
+  //
+  cout << endl;
+  cout << "Monte Carlo output:" << endl;
+  cout << " Particle Id:    " << fPartId; 
+  cout << " Energy:         " << fEnergy << "GeV";
+  cout << " Impactpar.:     " << fImpact/100 << "m";
+  cout << " Photoelectrons: " << fPhotElfromShower; 
+  cout << endl; 
+}
Index: /tags/Mars_V0-7/Mars/mmc/MMcEvt.hxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcEvt.hxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcEvt.hxx	(revision 9644)
@@ -0,0 +1,106 @@
+#ifndef __MMcEvt__
+#define __MMcEvt__
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+class MMcEvt : public MParContainer
+{
+ private:
+  UShort_t fPartId;         // Type of particle
+  Float_t  fEnergy;         // [GeV] Energy
+
+  Float_t fTheta;           // [rad] Theta angle of event 
+  Float_t fPhi;             // [rad] Phi angle of event 
+
+  Float_t fCoreD;           // Core d pos
+  Float_t fCoreX;           // Core x pos
+  Float_t fCoreY;           // Core y pos
+  Float_t fImpact;          // [mm] impact parameter
+
+  UInt_t fPhotIni;          // Initial number of photons
+  UInt_t fPassPhotAtm;      // Passed atmosphere
+  UInt_t fPassPhotRef;      // Passed reflector(reflectivity + effective area)
+  UInt_t fPassPhotCone;     // Passed glas
+  UInt_t fPhotElfromShower; // Passed qe coming from the shower
+  UInt_t fPhotElinCamera;   // usPhotElfromShower + mean of phe
+                            // from NSB
+
+ public:
+  MMcEvt() ;
+  
+  MMcEvt( UShort_t, 
+	  Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
+	  UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t ) ; 
+  
+  ~MMcEvt(); 
+
+  void Clear(Option_t *opt=NULL);
+
+  void Fill( UShort_t, 
+	     Float_t, Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
+	     UInt_t, UInt_t, UInt_t, UInt_t, UInt_t, UInt_t ) ; 
+
+  //virtual void AsciiWrite(ofstream &fout) const;
+
+  void Print(Option_t *opt=NULL) const;
+
+  Short_t GetPartId() const { return fPartId; }       //Get Type of particle
+  Float_t GetEnergy() const { return fEnergy; }        //Get Energy
+
+  Float_t GetTheta() const { return fTheta; }          //Get Theta angle
+  Float_t GetPhi() const { return fPhi ;  }            //Get Phi angle
+
+/*    Float_t GetCoreD() { return fCoreD; }          //Get Core d pos */
+/*    Float_t GetCoreX() { return fCoreX; }          //Get Core x pos */
+/*    Float_t GetCoreY() { return fCoreY; }          //Get Core y pos */
+  Float_t GetImpact() const { return fImpact;}         //Get impact parameter 
+
+/*    UInt_t GetPhotIni() { return fPhotIni; }           //Get Initial photons */
+/*    UInt_t GetPassPhotAtm() { return fPassPhotAtm;}    //Get Passed atmosphere */
+/*    UInt_t GetPassPhotRef() { return fPassPhotRef; }   //Get Passed reflector */
+/*    UInt_t GetPassPhotCone() { return fPassPhotCone; } //Get Passed glas */
+  UInt_t GetPhotElfromShower() { return fPhotElfromShower; }             //Get Passed qe from shower
+/*    UInt_t GetPhotElinCamera() { return fPhotElinCamera; }             //Get Passed qe total*/
+
+
+  void SetPartId(Short_t PartId)
+  {fPartId=PartId;}             //Set Type of particle 
+
+  void SetEnergy(Float_t Energy)
+  { fEnergy=Energy; }              //Set Energy 
+ 
+  void SetTheta(Float_t Theta) 
+  { fTheta=Theta; }                //Set Theta angle 
+
+  void SetPhi(Float_t Phi) 
+  { fPhi=Phi;  }                   //Set Phi angle 
+ 
+  void SetCoreD(Float_t CoreD) 
+  { fCoreD=CoreD; }                //Set Core d pos
+
+  void SetCoreX(Float_t CoreX)
+  { fCoreX=CoreX; }                //Set Core x pos 
+
+  void SetCoreY(Float_t CoreY ) 
+  { fCoreY=CoreY; }                //Set Core y pos
+
+  void SetImpact(Float_t Impact) 
+  { fImpact=Impact;}               //Set impact parameter
+  
+/*    void SetPhotIni(Short_t PhotIni)  */
+/*      { fPhotIni=PhotIni; }                 //Set Initial photons */
+/*    void SetPassPhotAtm(Short_t PassPhotAtm)  */
+/*      { fPassPhotAtm=PassPhotAtm;}         //Set Passed atmosphere */
+/*    void SetPassPhotRef(Short_t PassPhotRef)  */
+/*      { fPassPhotRef=PassPhotRef ; }       //Set Passed reflector */
+/*    void SetPassPhotCone(Short_t PhotCon)  */
+/*      { fPassPhotCone=PhotCon; }           //Set Passed glas */
+
+
+  ClassDef(MMcEvt, 1)  //Stores Montecarlo Information of one event (eg. the energy)
+
+};
+
+#endif
Index: /tags/Mars_V0-7/Mars/mmc/MMcFadcHeader.cxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcFadcHeader.cxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcFadcHeader.cxx	(revision 9644)
@@ -0,0 +1,61 @@
+#include "MMcFadcHeader.hxx"
+
+#include <iostream.h>
+
+//==========
+// MMcFadcHeader
+//    
+// This class contains the MonteCarlo information
+// of the FADC simulation for the current run.
+// The information is saved only once, whatever the
+// number of events is
+ 
+
+
+ClassImp(MMcFadcHeader);
+
+
+
+MMcFadcHeader::MMcFadcHeader(const char *name, const char *title) {
+  //
+  //  default constructor
+
+  fName  = name  ? name  : "MMcFadcHeader";
+  fTitle = title ? title : "Fadc Header Information from Monte Carlo";
+
+  //  set all values to zero
+
+  Int_t i;
+
+  fFadcShape=0.0; 
+  fAmplFadc=MFADC_RESPONSE_AMPLITUDE;
+  fFwhmFadc=MFADC_RESPONSE_FWHM;
+
+  for(i=0;i<MFADC_CHANNELS;i++){
+    fPedesMean[i]= 0.0    ;
+    fElecNoise[i]=-1.0   ;
+  }
+}
+
+MMcFadcHeader::~MMcFadcHeader(){
+  //
+  //  default destructor
+  //
+}
+
+
+void MMcFadcHeader::Print(Option_t *Option) const {
+  //
+  //  print out the data member on screen
+  //
+  cout << endl;
+  cout << "Monte Carlo Fadc output:" << endl;
+  cout << " Shape type of the signal: "       << fFadcShape << endl;
+  cout << " Amplitude of the trigger in mV: " << fAmplFadc << endl;
+  cout << " Width of the signal in nsec: "    << fFwhmFadc << endl;
+  cout << " Pedestals and ElecNoise in fadc counts: " << endl;
+  for (int i=0;i<MFADC_CHANNELS;i++){
+    cout << " Pixel "<<i<<": "<<fPedesMean[i]<<"  "<<fElecNoise[i]<<endl;
+  }
+  cout << endl ; 
+}
Index: /tags/Mars_V0-7/Mars/mmc/MMcFadcHeader.hxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcFadcHeader.hxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcFadcHeader.hxx	(revision 9644)
@@ -0,0 +1,64 @@
+#ifndef __MMcFadcHeader__
+#define __MMcFadcHeader__
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+#include "MFadcDefine.h"
+
+class MMcFadcHeader : public MParContainer{
+ private:
+
+  Float_t  fFadcShape   ;   // a number that indicate the shape type of 
+                            // the signal   
+                            // = 0 --> a gaussian  
+  Float_t  fAmplFadc    ;   // the amplitude of the trigger in mV
+  Float_t  fFwhmFadc    ;   // the width of the signal in nsec
+  Float_t  fPedesMean[MFADC_CHANNELS]    ;  //  The mean value for the pedestal
+                                            //  of each pixel (channel)
+  Float_t  fElecNoise[MFADC_CHANNELS]   ;  //  The rms value in the pedestal 
+                                           //  due to the electronics for
+                                           //  each pixel (channel)
+
+ public:
+  MMcFadcHeader(const char *name=NULL, const char *title=NULL);
+
+  ~MMcFadcHeader(); 
+
+  void Print(Option_t *opt=NULL) const;
+  
+  void SetShape(Float_t shape){
+    fFadcShape=shape;
+  }
+
+  void SetAmplitud(Float_t amp){
+    fAmplFadc=amp;
+ }
+
+  void SetFwhm(Float_t fwhm){
+    fFwhmFadc=fwhm;
+  }
+
+  void SetPedestal(Float_t *mean, Int_t dim){
+    for (Int_t i=0;i<dim;i++)
+      fPedesMean[i]=mean[i];
+  }
+
+  void SetElecNoise(Float_t *sigma, Int_t dim){
+    for (Int_t i=0;i<dim;i++)
+      fElecNoise[i]=sigma[i];
+  }
+  
+  Float_t GetPedestal(UInt_t i) const    { return fPedesMean[i]; }
+  Float_t GetPedestalRms(UInt_t i) const { return fElecNoise[i]; }
+  Float_t GetAmplitud() const { return fAmplFadc; }
+
+  UInt_t GetNumPixel() const { return MFADC_CHANNELS; }
+
+  ClassDef(MMcFadcHeader, 1)  //Stores Montecarlo Information describing the FADC behaviour
+
+};
+
+#endif
+
Index: /tags/Mars_V0-7/Mars/mmc/MMcRunHeader.cxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcRunHeader.cxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcRunHeader.cxx	(revision 9644)
@@ -0,0 +1,241 @@
+/* ======================================================================== *\
+!
+! *
+! * 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
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MMcRunHeader
+//
+// Root storage container for the RUN MONTE CARLO HEADER information
+//
+// This the second version of this output class. Old root files, which have
+// a previous version of this class, are still compatibles and can be used.
+// But of course, you can no try to get infromatino in these old files about
+// the new data members.
+//
+// The following data member have been introduced in this second version 
+// and they do not exist in the previous one:
+//
+//  Float_t fMcRunNumber;      Run Number
+//  UInt_t  fProductionSite;   code to know where the run was generated
+//  Float_t fDateRunMMCs;      Date of the MMCs production
+//  Float_t fDateRunCamera;    Date, when the Camera program is run.
+//  Byte_t  fRawEvt;           RawEvt[Data,Hedaer] stored or not
+//  Byte_t  fElecNoise;        Electronic Noise simulated or not
+//  Byte_t  fStarFieldRotate;  Is the starfield rotation switched on (1) or
+//                             off (0)
+//  Float_t fCWaveLower;       Wavelength limits for the Cerenkov photons
+//  Float_t fCWaveUpper;
+//  UInt_t  fNumObsLev;        Observation levels
+//  Float_t fHeightLev[10];
+//  Float_t fSlopeSpec;        Spectral index
+//
+////////////////////////////////////////////////////////////////////////////
+
+#include "MMcRunHeader.hxx"
+
+#include <fstream.h>
+#include <iomanip.h>
+
+#include "MLog.h"
+
+ClassImp(MMcRunHeader);
+
+// --------------------------------------------------------------------------
+//
+// Default constructor. Creates array which stores the pixel assignment.
+//
+//
+MMcRunHeader::MMcRunHeader(const char *name, const char *title)
+{
+    fName  = name  ? name  : "MMcRunHeader";
+    fTitle = title ? title : "Raw Run Header Information";
+
+    fMcRunNumber =0;
+    fProductionSite = 0;
+    fDateRunMMCs = 0;
+    fDateRunCamera = 0;
+    fNumTrigCond = 0;
+    fAllEvtsTriggered = 0 ;
+    fMcEvt = 0;
+    fMcTrig = 0;
+    fMcFadc = 0;
+    fRawEvt = 0;
+    fElecNoise = 0;
+    fStarFieldRotate = 0;
+    fNumAnalisedPixels = 0;
+    fNumSimulatedShowers = 0;
+    fNumStoredShowers = 0;
+
+    fStarFieldRaH = 0;
+    fStarFieldRaM = 0;
+    fStarFieldRaS = 0;
+    fStarFieldDeD = 0;
+    fStarFieldDeM = 0;
+    fStarFieldDeS = 0;
+
+    fNumPheFromDNSB = 0.0;
+    fTelesTheta = 0.0;
+    fTelesPhi = 0.0;
+    fSourceOffsetTheta = 0.0; 
+    fSourceOffsetPhi = 0.0;
+    fShowerThetaMax = 0.0;
+    fShowerThetaMin = 0.0;
+    fShowerPhiMax = 0.0;
+    fShowerPhiMin = 0.0;
+
+    fCWaveLower = 0.0;
+    fCWaveUpper = 0.0;
+
+    fNumObsLev = 0;
+    for (int i=0; i<10; i++){
+      fHeightLev[i]=0.0;
+    }
+    fSlopeSpec = 0.0;
+
+    fCorsikaVersion = 0;
+    fReflVersion = 0;
+    fCamVersion = 0;
+
+}
+
+// --------------------------------------------------------------------------
+//
+// Destructor.
+//
+MMcRunHeader::~MMcRunHeader()
+{
+
+}
+
+// -------------------------------------------------------------------------
+//
+// Fill. Put data in the container
+//
+void MMcRunHeader::Fill(const Float_t  runnumber,
+			const UInt_t   productionsite,
+			const Float_t  daterunMMCs,
+			const Float_t   daterunCamera,
+			const UInt_t   numtrigcond,
+			const Byte_t   allevts,
+			const Byte_t   mcevt,
+			const Byte_t   mctrig,
+			const Byte_t   mcfadc,
+			const Byte_t   rawevt,
+			const Byte_t   elecnoise, 
+			const Int_t    numanalpixels,
+			const UInt_t   numsim,
+			const UInt_t   numsto,
+			const Byte_t   starfieldrotate,
+			const Int_t    sfRaH,
+			const Int_t    sfRaM,
+			const Int_t    sfRaS,
+			const Int_t    sfDeD,
+			const Int_t    sfDeM,
+			const Int_t    sfDeS,
+			const Float_t  numdnsb,
+			const Float_t  telestheta,
+			const Float_t  telesphi,
+			const Float_t  sofftheta,
+			const Float_t  soffphi,
+			const Float_t  shthetamax,
+			const Float_t  shthetamin,
+			const Float_t  shphimax,
+			const Float_t  shphimin,
+			const Float_t  cwavelower,
+			const Float_t  cwaveupper,
+			const Float_t  slopespec,
+			const UInt_t   numObslev,
+			const Float_t  heightlev[10],
+			const UInt_t   corsika,
+			const UInt_t   refl,
+			const UInt_t   cam)
+{
+    fMcRunNumber =runnumber;
+    fProductionSite = productionsite;
+    fDateRunMMCs = daterunMMCs;
+    fDateRunCamera = daterunCamera;
+    fNumTrigCond = numtrigcond;
+    fAllEvtsTriggered = allevts;
+    fMcEvt = mcevt;
+    fMcTrig = mctrig;
+    fMcFadc = mcfadc;
+    fRawEvt = rawevt;
+    fElecNoise = elecnoise;
+    fStarFieldRotate = starfieldrotate;
+    fNumAnalisedPixels = numanalpixels;
+    fNumSimulatedShowers = numsim;
+    fNumStoredShowers = numsto;
+
+    fStarFieldRaH = sfRaH;
+    fStarFieldRaM = sfRaM;
+    fStarFieldRaS = sfRaS;
+    fStarFieldDeD = sfDeD;
+    fStarFieldDeM = sfDeM;
+    fStarFieldDeS = sfDeS;
+
+    fNumPheFromDNSB = numdnsb;
+    fTelesTheta = telestheta;
+    fTelesPhi = telesphi;
+    fSourceOffsetTheta = sofftheta; 
+    fSourceOffsetPhi = soffphi;
+    fShowerThetaMax = shthetamax;
+    fShowerThetaMin = shthetamin;
+    fShowerPhiMax = shphimax;
+    fShowerPhiMin = shphimin;
+
+    fCWaveLower = cwavelower;
+    fCWaveUpper = cwaveupper;
+
+    fNumObsLev = numObslev;
+    for (UInt_t i=0; i<numObslev; i++){
+      fHeightLev[i]=heightlev[i];
+    }
+    fSlopeSpec = slopespec;
+
+    fCorsikaVersion = corsika;
+    fReflVersion = refl;
+    fCamVersion = cam;
+    
+}
+
+// -------------------------------------------------------------------------
+//
+// GetStarFieldRa. Get RA coordinates of the starfield
+//
+void MMcRunHeader::GetStarFieldRa(Int_t *hour, Int_t *minute, Int_t *second) const
+{
+    *hour   = fStarFieldRaH;
+    *minute = fStarFieldRaM;
+    *second = fStarFieldRaS;
+}
+// -------------------------------------------------------------------------
+//
+// GetStarFieldDec. Get DE coordinates of the starfield
+//
+void MMcRunHeader::GetStarFieldDec(Int_t *degree, Int_t *minute, Int_t *second) const
+{
+    *degree = fStarFieldDeD;
+    *minute = fStarFieldDeM;
+    *second = fStarFieldDeS;
+}
Index: /tags/Mars_V0-7/Mars/mmc/MMcRunHeader.hxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcRunHeader.hxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcRunHeader.hxx	(revision 9644)
@@ -0,0 +1,148 @@
+#ifndef MARS_MMcRunHeader
+#define MARS_MMcRunHeader
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+// MRunHeader                                                        //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+
+class MMcRunHeader : public MParContainer
+{
+private:
+  UInt_t  fNumTrigCond;     // Number of trigger conditions in this file,
+  // zero means single condition mode
+  
+  //-- 0 means: MMcTrig
+  //-- 1 means: MMcTrig;1
+  //-- 2 means: MMcTrig;1 MMcTrig;2
+  
+  Byte_t  fAllEvtsTriggered;  // boolean that indicates is all images are 
+                              // saved or only the ones that trigger
+
+  Byte_t  fMcEvt;           // McEvt stored or not
+  Byte_t  fMcTrig;          // McTrig stored or not
+  Byte_t  fMcFadc;          // McFadc stored or not
+
+  Int_t   fNumAnalisedPixels;  // Number of analised pixels
+  
+  UInt_t  fNumSimulatedShowers; // Number of showers that were simualted
+  UInt_t  fNumStoredShowers;    // Number of store showers in this run
+  
+  //  Coordinates of the Starfield
+  
+  Int_t fStarFieldRaH;
+  Int_t fStarFieldRaM;
+  Int_t fStarFieldRaS;
+  Int_t fStarFieldDeD;
+  Int_t fStarFieldDeM;
+  Int_t fStarFieldDeS;
+
+  Float_t fNumPheFromDNSB;  // Number of phe/ns from diffuse NSB
+  
+  //  Telescope axis position (zenith and azimutal angle)
+  Float_t fTelesTheta;  // >180 (200) means for each shower,
+                        // the Theta of shower
+  Float_t fTelesPhi;    // > 360 (400) means for each shower,
+                        // the Phi of shower
+
+  //  Angular distance from the source position to the camera center
+  Float_t fSourceOffsetTheta; 
+  Float_t fSourceOffsetPhi;
+  
+  //  Angular range used in the Corsika showers generation (degrees)
+  Float_t fShowerThetaMax;
+  Float_t fShowerThetaMin;
+  Float_t fShowerPhiMax;
+  Float_t fShowerPhiMin;
+
+  UShort_t fCorsikaVersion;
+  UShort_t fReflVersion;
+  UShort_t fCamVersion;
+
+  /* ---- Run Header Informations ---- */
+  Float_t fMcRunNumber;     // Run Number
+  UInt_t  fProductionSite;  // code to know where the run was generated
+  Float_t fDateRunMMCs;     // Date of the MMCs production
+  Float_t fDateRunCamera;   // Date, when the Camera program is run.
+
+  Byte_t  fRawEvt;          // RawEvt[Data,Hedaer] stored or not
+
+  Byte_t  fElecNoise;       // Electronic Noise simulated or not
+  Byte_t  fStarFieldRotate; // Is the starfield rotation 
+                            // switched on (1) or off (0)
+
+  //  Wavelength limits for the Cerenkov photons
+  Float_t fCWaveLower;
+  Float_t fCWaveUpper;
+
+  //  Observation levels  
+  UInt_t    fNumObsLev;
+  Float_t   fHeightLev[10]; 
+
+  //  Spectral index
+  Float_t   fSlopeSpec;
+
+public:
+  MMcRunHeader(const char *name=NULL, const char *title=NULL);
+  ~MMcRunHeader();
+
+  void Fill(const Float_t  runnumber,
+	    const UInt_t   productionsite,
+	    const Float_t  daterunMMCs,
+	    const Float_t   daterunCamera,
+	    const UInt_t   numtrigcond,
+	    const Byte_t   allevts,
+	    const Byte_t   mcevt,
+	    const Byte_t   mctrig,
+	    const Byte_t   mcfadc,
+	    const Byte_t   rawevt,
+	    const Byte_t   elecnoise, 
+	    const Int_t    numanalpixels,
+	    const UInt_t   numsim,
+	    const UInt_t   numsto,
+	    const Byte_t   starfieldrotate,
+	    const Int_t    sfRaH,
+	    const Int_t    sfRaM,
+	    const Int_t    sfRaS,
+	    const Int_t    sfDeD,
+	    const Int_t    sfDeM,
+	    const Int_t    sfDeS,
+	    const Float_t  numdnsb,
+	    const Float_t  telestheta,
+	    const Float_t  telesphi,
+	    const Float_t  sofftheta,
+	    const Float_t  soffphi,
+	    const Float_t  shthetamax,
+	    const Float_t  shthetamin,
+	    const Float_t  shphimax,
+	    const Float_t  shphimin,
+	    const Float_t  cwavelower,
+	    const Float_t  cwaveupper,
+	    const Float_t  slopespec,
+	    const UInt_t   num0bslev,
+	    const Float_t  heightlev[10],
+	    const UInt_t   corsika,
+	    const UInt_t   refl,
+	    const UInt_t   cam
+	    );
+  
+  void     GetStarFieldRa(Int_t *hour, Int_t *minute, Int_t *second) const;
+  void     GetStarFieldDec(Int_t *degree, Int_t *minute, Int_t *second) const;
+
+  Float_t  GetNumPheFromDNSB() const      { return fNumPheFromDNSB; }
+  Float_t  GetTelesTheta() const          { return fTelesTheta; }
+  UShort_t GetCamVersion() const          { return fCamVersion; }
+  UInt_t   GetNumSimulatedShowers() const { return fNumSimulatedShowers; }
+  UInt_t   GetCorsikaVersion() const      { return fCorsikaVersion; }
+  Bool_t   GetAllEvtsTriggered() const    { return fAllEvtsTriggered ? kTRUE : kFALSE; }
+
+  ClassDef(MMcRunHeader, 2)	// storage container for general info
+};
+#endif
+
+
Index: /tags/Mars_V0-7/Mars/mmc/MMcTrig.cxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcTrig.cxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcTrig.cxx	(revision 9644)
@@ -0,0 +1,135 @@
+#include "MMcTrig.hxx"
+
+#include <iostream.h>
+
+
+//==========
+// MMcTrig
+//    
+// This class handles and contains the MonteCarlo information
+// with which the events have been generated
+// This information exists for each event.
+//
+// This the second version of this output class. Old root files, which have
+// a previous version of this class, are still compatibles and can be used.
+// But of course, you can no try to get infromatino in these old files about
+// the new data members.
+//
+// The fPixelsFirst array has been increased from 273 (which was the trigger 
+// zone) to 577 (which is the full Camera)
+//
+////////////////////////////////////////////////////////////// 
+
+
+ClassImp(MMcTrig);
+
+
+
+MMcTrig::MMcTrig(const char *name, const char *title) {
+  //
+  //  default constructor
+  //  set all values to zero
+
+  
+  fName  = name  ? name  : "MMcTrig";
+  fTitle = title ? title : "Trigger info from Monte Carlo";
+
+    
+  Int_t i,j;
+
+  fNumFirstLevel  = 0 ;
+
+  for(i=0;i<TOTAL_TRIGGER_TIME/LEVEL1_DEAD_TIME+1;i++){
+    fTimeFirst[i]    = -99.9;
+    for(j=0;j<CAMERA_PIXELS/8+1;j++){
+      fPixelsFirst[j][i]   = 0;
+    }
+  }
+
+  fNumSecondLevel = 0 ; 
+  for(i=0;i<TOTAL_TRIGGER_TIME/LEVEL2_DEAD_TIME+1;i++){
+    fFirstToSecond[i]=0;
+  }
+}
+
+MMcTrig::~MMcTrig() {
+  //
+  //  default destructor
+  //
+}
+
+void MMcTrig::SetTime(Float_t t, Int_t i)
+{
+    if (i>TOTAL_TRIGGER_TIME/LEVEL1_DEAD_TIME+1  || i<1)
+    {
+        cout << "fNumFirstLevel out of range. Time will be -99" << endl;
+        return;
+    }
+
+    fTimeFirst[i-1]=t;
+}
+
+void MMcTrig::Clear(Option_t *opt) {
+  //
+  //  
+  //  reset all values to zero
+  Int_t i,j;
+
+  fNumFirstLevel  = 0 ;
+  for(i=0;i<TOTAL_TRIGGER_TIME/LEVEL1_DEAD_TIME+1;i++){
+    fTimeFirst[i]    = -99.9;
+    for(j=0;j<CAMERA_PIXELS/8+1;j++){
+      fPixelsFirst[j][i]   = 0;
+    }
+  }
+
+  fNumSecondLevel = 0 ; 
+  for(i=0;i<TOTAL_TRIGGER_TIME/LEVEL2_DEAD_TIME+1;i++){
+    fFirstToSecond[i]=0;
+  }
+
+  //  cout << "MMcTrig::Clear() " << endl ; 
+}
+
+void MMcTrig::Print(Option_t *Option) const {
+  //
+  //  print out the data member on screen
+  //
+  Int_t i,j;
+
+  cout <<endl << "Monte Carlo Trigger output:" <<endl;
+  cout << " First  Level Trigger in this Event: "<<fNumFirstLevel<<endl; 
+  cout << " Times of first  Level Trigger in this Event: ";
+  for (i=0;i<fNumFirstLevel;i++){
+    cout<< fTimeFirst[i]<<"-";
+  }
+  cout<<endl;
+  cout << " Pixels of first  Level Trigger in this Event : ";
+  for (i=0;i<fNumFirstLevel;i++){
+    for(j=0;j<CAMERA_PIXELS/8+1;j++){
+      cout<<fPixelsFirst[j][i]<<"-";
+    }
+  }
+  cout<<endl;
+  cout << " Second Level Trigger in this Event: " << fNumSecondLevel << endl; 
+  cout << endl ; 
+}
+
+Byte_t MMcTrig::IsPixelFired(Int_t npix, Int_t nfirstlevel){
+  //======================================================================
+  //
+  //  It returns >1 if the pixel npix was fired when the nfirstlevel
+  //  first level trigger happened, 0 if not.
+  //
+
+  Byte_t ret=0;
+  Byte_t reminder;
+  Int_t body;
+
+  body=npix/8;
+  reminder=(Byte_t)(pow(2,npix%8));
+
+  ret=reminder&fPixelsFirst[body][nfirstlevel];
+  return(ret);
+
+}
Index: /tags/Mars_V0-7/Mars/mmc/MMcTrig.hxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcTrig.hxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcTrig.hxx	(revision 9644)
@@ -0,0 +1,63 @@
+#ifndef __MMcTrig__
+#define __MMcTrig__
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+#include "MTriggerDefine.h"
+#include "Mdefine.h"
+
+class MMcTrig : public MParContainer {
+ private:
+
+  Short_t fNumFirstLevel  ;    // Number of First Level Trigger in this Event
+  Short_t fNumSecondLevel ;    // Number of Second Level Trigger in this Event
+
+  Float_t fTimeFirst[((Int_t)(TOTAL_TRIGGER_TIME/LEVEL1_DEAD_TIME))+1];
+                            // Time when it triggers
+  Byte_t fPixelsFirst[((Int_t)(CAMERA_PIXELS/8))+1][((Int_t)(TOTAL_TRIGGER_TIME/LEVEL1_DEAD_TIME))+1];
+                            // Pixel which are above threshold when trigger happens
+  Short_t fFirstToSecond[((Int_t)(TOTAL_TRIGGER_TIME/LEVEL2_DEAD_TIME))+1];
+
+ public:
+  MMcTrig(const char *name=NULL, const char *title=NULL);
+
+  ~MMcTrig(); 
+
+  void Clear(Option_t *opt=NULL);
+  
+  void Print(Option_t *opt=NULL) const;
+
+  void SetFirstLevel  ( Short_t nTr ) {
+    fNumFirstLevel = nTr ; 
+  } 
+  void SetSecondLevel ( Short_t nTr ) {
+    fNumSecondLevel = nTr ; 
+  } 
+
+  void SetTime( Float_t t, Int_t i);
+
+  void SetMapPixels(Byte_t *map,Int_t nfirst){
+    //  
+    //  It sets the map of pixel that are above the trheshold
+    //
+
+    int i;
+
+    for(i=0;i<((Int_t)(CAMERA_PIXELS/8))+1;i++){
+      fPixelsFirst[i][nfirst]=map[i];
+    }
+  }
+
+  Int_t GetFirstLevel() const {
+    return ( fNumFirstLevel );  
+  }
+
+  Byte_t IsPixelFired(Int_t npix, Int_t nfirstlevel);
+
+  ClassDef(MMcTrig, 2)  //Stores Montecarlo Information (number of 1st, 2nd level triggers)
+
+};
+
+#endif
Index: /tags/Mars_V0-7/Mars/mmc/MMcTrigHeader.cxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcTrigHeader.cxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcTrigHeader.cxx	(revision 9644)
@@ -0,0 +1,73 @@
+#include "MMcTrigHeader.hxx"
+
+#include <iostream.h>
+
+
+//==========
+// MMcTrigHeader
+//    
+// This class contains the MonteCarlo information
+// of the trigger simulation for the current run.
+// The information is saved only once, whatever the
+// number of events is
+//
+// This is the second version of this output class. Old root files, which have
+// a previous version of this class, are still compatibles and can be used.
+// But of course, you can no try to get infromatino in these old files about
+// the new data members.
+//
+// The following data member have been introduced in this second version 
+// and they do not exist in the previous one:
+//
+//   Float_t  fElecNoiseTrig;  The width of the gaussian noise is that times
+//                             the amplitude of the single phe response 
+//                             for the trigger 
+//
+/////////////////////////
+
+ClassImp(MMcTrigHeader);
+
+
+
+MMcTrigHeader::MMcTrigHeader() {
+  //
+  //  default constructor
+  //  set all values to zero
+
+  Int_t i;
+
+  fTopology     = -1 ;
+  fMultiplicity = -1 ;
+  for(i=0;i<CAMERA_PIXELS;i++){
+    fThreshold[i] = -1.0;
+  }
+  
+  fTrigPattern[0]=0;
+  fTrigPattern[1]=0;
+
+  fTrigShape=0.0; 
+  fAmplTrig=RESPONSE_AMPLITUDE;
+  fFwhmTrig=RESPONSE_FWHM;
+  fOverlapingTime=TRIGGER_OVERLAPING;
+  fGateLeng=TRIGGER_GATE ;
+}
+
+MMcTrigHeader::~MMcTrigHeader() {
+  //
+  //  default destructor
+  //
+}
+
+
+void MMcTrigHeader::Print(Option_t *opt) const {
+  //
+  //  print out the data member on screen
+  //
+  cout << endl;
+  cout << "Monte Carlo Trigger output:" << endl;
+  cout << " XSTopology Trigger in this run: "   << fTopology << endl;
+  cout << " Multiplicity Trigger in this run: " << fMultiplicity << endl;
+  cout << " Trigger Pattern in this run: ";
+  cout << fTrigPattern[0] << ", " << fTrigPattern[1] << endl;
+  cout << endl; 
+}
Index: /tags/Mars_V0-7/Mars/mmc/MMcTrigHeader.hxx
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MMcTrigHeader.hxx	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MMcTrigHeader.hxx	(revision 9644)
@@ -0,0 +1,97 @@
+#ifndef __MMcTrigHeader__
+#define __MMcTrigHeader__
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#endif
+
+#include "MTriggerDefine.h"
+#include "Mdefine.h"
+
+class MMcTrigHeader : public MParContainer{
+ private:
+
+  Short_t fTopology     ;      // Topology of the trigger
+                                   // 0 = N-1 neighbours of one pixel
+                                   // 1 = N neighbours
+                                   // 2 = N closed pack
+  Short_t fMultiplicity ;      // Pixel multiplicity of trigger configuration
+  Float_t fThreshold[CAMERA_PIXELS] ; // Threshold for trigger
+  UInt_t fTrigPattern[2];     // Used to inddentify with 
+                              // RawEvt::Trigger Pattern identification  
+  Float_t  fTrigShape   ;   // a number that indicate the shape type of 
+                            // the signal   
+                            // = 0 --> a gaussian  
+  Float_t  fAmplTrig    ;   // the amplitude of the trigger in mV
+  Float_t  fFwhmTrig    ;   // the width of the signal in nsec
+  Float_t  fOverlapingTime;// Minimum coincidence time
+  Float_t  fGateLeng;       // the length of the digital signal if analog 
+                            // signal is above threshold
+  Float_t  fElecNoiseTrig;  // The width of the gaussian noise is that times
+                            // the amplitude of the single phe response 
+                            // for the trigger
+
+ public:
+  MMcTrigHeader() ;
+
+  ~MMcTrigHeader(); 
+
+  void Print(Option_t *opt=NULL) const;
+  
+  void SetTopology(Short_t nTop) {
+    fTopology=nTop;
+  }
+
+  void SetMultiplicity(Short_t nMul) {
+    fMultiplicity=nMul;
+  }
+
+  void SetThreshold(Float_t fthr[]){
+    int i;
+    for(i=0;i<CAMERA_PIXELS;i++){
+      fThreshold[i]=fthr[i];
+    }
+  }
+
+  void SetTrigPattern (UInt_t upi, UInt_t loi){
+
+    if (upi==loi==0) {
+      fTrigPattern[0]= (UInt_t) fThreshold[0];
+      fTrigPattern[1]= (UInt_t) (100*fMultiplicity+fTopology);
+    }
+    else {
+      fTrigPattern[0]=upi;
+      fTrigPattern[1]=loi;
+    }
+  }
+
+  void SetShape(Float_t shape){
+    fTrigShape=shape;
+  }
+
+  void SetAmplitud(Float_t amp){
+    fAmplTrig=amp;
+ }
+
+  void SetFwhm(Float_t fwhm){
+    fFwhmTrig=fwhm;
+  }
+
+  void SetOverlap(Float_t overlap){
+    fOverlapingTime=overlap;
+  }
+
+  void SetGate(Float_t gate){
+    fGateLeng=gate;
+  }
+
+  void SetElecNoise( Float_t elecnoise){
+    fElecNoiseTrig = elecnoise;
+  }
+
+  ClassDef(MMcTrigHeader, 2)  //Stores Montecarlo Information which describes the used trigger
+
+};
+
+#endif
+
Index: /tags/Mars_V0-7/Mars/mmc/MTriggerDefine.h
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/MTriggerDefine.h	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/MTriggerDefine.h	(revision 9644)
@@ -0,0 +1,98 @@
+//
+//
+//      In this file are the fundamental definitions for the class MCTrigger
+//
+//
+#define TRIGGER_PIXELS        397
+//
+//      This is the number of Pixels contributing to the TRIGGER logic
+//      All Pixels-Id above that value don't do an trigger stuff. 
+//      Actually, not all of them are involved in TRIGGER logic, only the
+//      ones of them that are also in some TRIGGER_CELL 
+//   (MagicSoft/Simulation/Detector/include-MTrigger/TABLE_PIXELS_IN_CELLS)
+//
+#define TOTAL_TRIGGER_TIME    160 
+//
+//      This values defines the total range in that we try to find
+//      a trigger. 
+//
+#define LEVEL1_DEAD_TIME    50
+//
+//      Dead time of the detector after one first level trigger happens.
+//
+#define LEVEL2_DEAD_TIME    300
+//
+//      Dead time of the detector after second level trigger fires
+//
+#define SLICES_PER_NSEC         4
+//      
+//      Each nano second is divided into the number of this values slices. 
+//      So you can get the total number of timeslices for one Pixel by 
+//      ( TOTAL_TRIGGER_TIME * SLICES_PER_NSEC ). 
+//      In the current settings this are 1000 slices
+//
+#define TRIGGER_TIME_SLICES     (TOTAL_TRIGGER_TIME*SLICES_PER_NSEC) 
+//
+//
+//
+//
+//       ------>>>   SETTINGS for the RESPONSE FUNCTION
+// 
+#define RESPONSE_SLICES        40
+//
+//       This is for the standard response Signal to 1 Photoelectron
+//       that leaves the Photocathode
+//       The whole Timescale for the signal is 10 nsec
+//
+//       The Response function
+//
+//       These values are discussed with Eckart. We start from this point. 
+//
+#define RESPONSE_FWHM          2. 
+
+#define RESPONSE_AMPLITUDE     1. 
+//
+//       This are the Standard values of the response function for
+//       1 photo electron. ( 1 means 1 mV per phote electron ) 
+//
+//
+//       -------->>> SETTINGS for the DISKRIMINATORS
+//
+//
+#define CHANNEL_THRESHOLD      2.5 
+//
+//       This is the diskriminator threshold for each individual channel
+//       First we set the value to 2 unit of the RESPONSE_AMPLITUDE 
+//
+#define TRIGGER_GATE           3. 
+// 
+//       Here we set the width of the digital signal we get if the signal
+//       passes the diskriminator
+//
+//
+#define TRIGGER_OVERLAPING           0.25 
+// 
+//       Here we set the required overlaping time among pixels
+//       to be in coincidence.
+//
+//
+//      --------->>>> SETTINGS for the TRIGGER logic
+//
+//
+#define TRIGGER_CELLS          19  
+//
+//       Number of trigger cells that cover the trigger zone
+//
+#define TRIGGER_MULTI          4.  
+//
+//       We get a Level Zero Trigger, if we have a least TRIGGER_MULTI
+//       channels with a diskrimiator signal at the same time 
+//
+#define TRIGGER_GEOM           0
+//
+//      This defines the geometry required for a trigger. There exists 
+//      different meaning for this behaviour: 
+//         0 means a pixel with trigger_multi-1 neighbours
+//         1 means trigger_multi neighbours
+//         2 means trigger_multi closed neighbours
+//
Index: /tags/Mars_V0-7/Mars/mmc/Makefile
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/Makefile	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/Makefile	(revision 9644)
@@ -0,0 +1,53 @@
+##################################################################
+#
+#   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../MBase
+
+# @code 
+
+CINT     = Mc
+LIB      = mmc.a
+
+#------------------------------------------------------------------------------
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+SRCFILES = MMcTrigHeader.cxx \
+	   MMcFadcHeader.cxx \
+	   MMcRunHeader.cxx \
+	   MMcEvt.cxx \
+           MMcTrig.cxx 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cxx=.hxx)
+OBJS    = $(SRCFILES:.cxx=.o) 
+
+############################################################
+
+all: $(LIB)
+
+include ../Makefile.rules
+
+clean:	rmcint rmobjs rmcore rmlib
+
+mrproper:	clean rmbak
+
+# @endcode
Index: /tags/Mars_V0-7/Mars/mmc/McIncl.h
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/McIncl.h	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/McIncl.h	(revision 9644)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: /tags/Mars_V0-7/Mars/mmc/McLinkDef.h
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/McLinkDef.h	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/McLinkDef.h	(revision 9644)
@@ -0,0 +1,13 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+ 
+#pragma link C++ class MMcEvt+;
+#pragma link C++ class MMcTrig+;
+#pragma link C++ class MMcRunHeader+;
+#pragma link C++ class MMcTrigHeader+;
+#pragma link C++ class MMcFadcHeader+;
+
+#endif
Index: /tags/Mars_V0-7/Mars/mmc/Mdefine.h
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/Mdefine.h	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/Mdefine.h	(revision 9644)
@@ -0,0 +1,41 @@
+//
+//     Mdefine.h
+//
+//     defines some Values for the MAGIC telecope
+//
+
+//     Number of the Pixels in the Camera
+
+#define     CAMERA_PIXELS         577
+
+//     Number of the Slices of one Fadc. Be carefull this is the number of 
+//     slices for one gain branch. We sample two times this number. 
+
+#define     FADC_SLICES            15
+
+//     ParticleId for Monte Carlo simulation
+
+#define  GAMMA 0
+#define  PROTON 14
+#define  HELIUM 402
+#define  OXIGEN 1608
+#define  IRON 5626
+
+
+//---------------------------------------------------------
+// definition of constants
+
+#define TRUE 1
+#define FALSE 0
+
+#define MAX_ADC 30  // nummber of ADC conversions per pixel
+
+//camera dimensions and definitions
+#define PIXEL_DIST  10.0  //cm
+#define CAMERA_COLOR 13   //Background light grey
+#define DEFAULT_COLOR 1 //black
+//#define TRACK_WALL_COLOR 7   //light blue
+#define PIXEL_LINE_COLOR 15 //dark grey
+#define COLORTABLE_START 18 //Begin of colortable
+#define MAX_PH_EL 500 //upper limit for colortable
+
Index: /tags/Mars_V0-7/Mars/mmc/readme.txt
===================================================================
--- /tags/Mars_V0-7/Mars/mmc/readme.txt	(revision 9644)
+++ /tags/Mars_V0-7/Mars/mmc/readme.txt	(revision 9644)
@@ -0,0 +1,6 @@
+
+ Please be aware of that this subdirectory is used in two CVS modules.
+ 
+ If you change something it can affect the Mars and/or Monte Carlo
+ code!
+ 
