Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 6912)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.cxx	(revision 7094)
@@ -1,10 +1,30 @@
-#include "MMcEvt.hxx"
-
-#include "MLog.h"
-#include "MLogManip.h"
-
-//==========
-// MMcEvt
-//    
+/* ======================================================================== *\
+!
+! *
+! * 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):
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MMcEvt
+//
 // This class handles and contains the MonteCarlo information
 // with which the events have been generated
@@ -19,6 +39,20 @@
 // So, fTelescopeTheta=90, fTelescopePhi = 0 means the telescope is 
 // pointing horizontally towards South. For an explanation, see also 
-// TDAS 02-11. 
-//
+// TDAS 02-11.
+//
+// Version 4: 
+//   - Added member fFadcTimeJitter
+//
+// Version 5:
+//   - removed fPartId, fEnergy, fImpact, fTelescopeTheta, fTelescopePhi
+//   - derives now from MMcEvtBasic which contains all these values
+//   - moved ParticleId_t to base class MMcEvtBasic
+//
+/////////////////////////////////////////////////////////////////////////////
+#include "MMcEvt.hxx"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
 ClassImp(MMcEvt);
 
@@ -26,9 +60,10 @@
 
 
+// --------------------------------------------------------------------------
+//
+// Default constructor. Calls Clear()
+//
 MMcEvt::MMcEvt()
 {
-    //
-    //  default constructor
-    //  set all values to zero
     fName  = "MMcEvt";
     fTitle = "Event info from Monte Carlo";
@@ -37,107 +72,40 @@
 }
 
-MMcEvt::MMcEvt( UInt_t  fEvtNum,
-		UShort_t usPId,
-		Float_t  fEner,
-		Float_t  fThi0,
-		Float_t  fFirTar,
-		Float_t  fzFirInt,
-		Float_t  fThet, 
-		Float_t  fPhii, 
-		Float_t  fCorD, 
-		Float_t  fCorX, 
-		Float_t  fCorY,
-		Float_t  fImpa,
-		Float_t  fTPhii,
-		Float_t  fTThet,
-		Float_t  fTFirst,
-		Float_t  fTLast,
-		Float_t  fL_Nmax,
-		Float_t  fL_t0,
-		Float_t  fL_tmax,
-		Float_t  fL_a,
-		Float_t  fL_b,
-		Float_t  fL_c,
-		Float_t  fL_chi2,
-		UInt_t   uiPin, 
-		UInt_t   uiPat,  
-		UInt_t   uiPre, 
-		UInt_t   uiPco,  
-		UInt_t   uiPelS,
-		UInt_t   uiPelC,
-		Float_t  elec,
-		Float_t  muon,
-		Float_t  other,
-		Float_t  fadc_jitter) {
-
+// --------------------------------------------------------------------------
+//
+// Constructor. Use this to set all data members
+//
+// THIS FUNCTION IS FOR THE SIMULATION OLNY.
+// DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS.
+//
+MMcEvt::MMcEvt(UInt_t  fEvtNum,    ParticleId_t usPId, Float_t  fEner,
+               Float_t  fThi0,     Float_t  fFirTar,   Float_t  fzFirInt,
+               Float_t  fThet,     Float_t  fPhii,     Float_t  fCorD,
+               Float_t  fCorX,     Float_t  fCorY,     Float_t  fImpa,
+               Float_t  fTPhii,    Float_t  fTThet,    Float_t  fTFirst,
+               Float_t  fTLast,    Float_t  fL_Nmax,   Float_t  fL_t0,
+               Float_t  fL_tmax,   Float_t  fL_a,      Float_t  fL_b,
+               Float_t  fL_c,      Float_t  fL_chi2,   UInt_t   uiPin,
+               UInt_t   uiPat,     UInt_t   uiPre,     UInt_t   uiPco,
+               UInt_t   uiPelS,    UInt_t   uiPelC,    Float_t  elec,
+               Float_t  muon,      Float_t  other,     Float_t  fadc_jitter)
+{
     fName  = "MMcEvt";
     fTitle = "Event info from Monte Carlo";
-  //
-  //  constuctor II 
-  //
-  //  All datamembers are parameters. 
-  //
-  //  Don't use this memberfunction in analysis
-  //  
-
-  fEvtNumber = fEvtNum;
-  fPartId = usPId  ;
-  fEnergy  = fEner  ;
-  fThick0 = fThi0;
-  fFirstTarget = fFirTar;
-  fZFirstInteraction = fzFirInt;
-
-  fTheta   = fThet ;
-  fPhi     = fPhii ;
-
-  fCoreD   = fCorD ;
-  fCoreX   = fCorX ;
-  fCoreY   = fCorY ;
-  fImpact  = fImpa ;
-
-  fTelescopePhi = fTPhii;
-  fTelescopeTheta = fTThet;
-  fTimeFirst = fTFirst;
-  fTimeLast = fTLast;
-  fLongiNmax = fL_Nmax;
-  fLongit0 = fL_t0;
-  fLongitmax = fL_tmax;
-  fLongia = fL_a;
-  fLongib = fL_b;
-  fLongic = fL_c;
-  fLongichi2 = fL_chi2;
-
-
-  fPhotIni      = uiPin ;
-  fPassPhotAtm  = uiPat ;
-  fPassPhotRef  = uiPre ;
-  fPassPhotCone = uiPco ;
-  fPhotElfromShower = uiPelS ;
-  fPhotElinCamera   = uiPelC ;
-
-  fElecCphFraction=elec;
-  fMuonCphFraction=muon;
-  fOtherCphFraction=other;
-
-  fFadcTimeJitter = fadc_jitter;
-}
-
-
-
-MMcEvt::~MMcEvt() {
-  //
-  //  default destructor
-  //
-}
-
-
-
-
+
+    Fill(fEvtNum, usPId, fEner, fThi0, fFirTar, fzFirInt, fThet,
+	 fPhii, fCorD, fCorX, fCorY, fImpa, fTPhii, fTThet, fTFirst,
+	 fTLast, fL_Nmax, fL_t0, fL_tmax, fL_a, fL_b, fL_c, fL_chi2,
+	 uiPin, uiPat, uiPre, uiPco, uiPelS, uiPelC, elec, muon, other,
+	 fadc_jitter);
+}
+
+// --------------------------------------------------------------------------
+//
+//  reset all values to values as nonsense as possible
+//
 void MMcEvt::Clear(Option_t *opt)
 {
-    //
-    //  reset all values to values as nonsense as possible
-    //
-    fPartId = 0;
+    fPartId = kUNDEFINED;
     fEnergy = -1;
 
@@ -162,91 +130,68 @@
 }
 
-void MMcEvt::Fill( UInt_t  fEvtNum,
-		   UShort_t usPId, 
-		   Float_t  fEner, 
-		   Float_t  fThi0,
-		   Float_t  fFirTar,
-		   Float_t  fzFirInt,
-		   Float_t  fThet, 
-		   Float_t  fPhii, 
-		   Float_t  fCorD, 
-		   Float_t  fCorX, 
-		   Float_t  fCorY,
-		   Float_t  fImpa, 
-		   Float_t  fTPhii,
-		   Float_t  fTThet,
-		   Float_t  fTFirst,
-		   Float_t  fTLast,
-		   Float_t  fL_Nmax,
-		   Float_t  fL_t0,
-		   Float_t  fL_tmax,
-		   Float_t  fL_a,
-		   Float_t  fL_b,
-		   Float_t  fL_c,
-		   Float_t  fL_chi2,
-		   UInt_t   uiPin, 
-		   UInt_t   uiPat,  
-		   UInt_t   uiPre, 
-		   UInt_t   uiPco,  
-		   UInt_t   uiPelS,  
-		   UInt_t   uiPelC,
-		   Float_t  elec,
-		   Float_t  muon,
-		   Float_t  other,
-		   Float_t  fadc_jitter) {
-  //
-  //  All datamembers are filled with the correspondin parameters. 
-  //
-  //  Don't use this memberfunction in analysis
-  //  
-
-  fEvtNumber = fEvtNum;
-  fPartId = usPId  ;
-  fEnergy = fEner  ;
-  fThick0 = fThi0;
-  fFirstTarget = fFirTar;
-  fZFirstInteraction = fzFirInt;
-
-  fTheta  = fThet ;
-  fPhi    = fPhii ;
-
-  fCoreD  = fCorD ;
-  fCoreX  = fCorX ;
-  fCoreY  = fCorY ;
-  fImpact = fImpa ;
-
-  fTelescopePhi = fTPhii;
-  fTelescopeTheta = fTThet;
-  fTimeFirst = fTFirst;
-  fTimeLast = fTLast;
-  fLongiNmax = fL_Nmax;
-  fLongit0 = fL_t0;
-  fLongitmax = fL_tmax;
-  fLongia = fL_a;
-  fLongib = fL_b;
-  fLongic = fL_c;
-  fLongichi2 = fL_chi2;
-
-  fPhotIni      = uiPin ;
-  fPassPhotAtm  = fPhotIni-uiPat ;
-  fPassPhotRef  = fPassPhotAtm-uiPre ;
-  fPassPhotCone = uiPco ;
-  fPhotElfromShower = uiPelS ;
-  fPhotElinCamera = uiPelC ;
-
-  fElecCphFraction=elec;
-  fMuonCphFraction=muon;
-  fOtherCphFraction=other;
-
-  fFadcTimeJitter = fadc_jitter;
-}
-
-/*
-void MMcEvt::AsciiWrite(ofstream &fout) const
-{
-    fout << fEnergy << " ";
-    fout << fTheta ;
-}
-*/
+// --------------------------------------------------------------------------
+//
+// Use this to set all data members
+//
+// THIS FUNCTION IS FOR THE SIMULATION OLNY.
+// DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS.
+//
+void MMcEvt::Fill( UInt_t  fEvtNum,    ParticleId_t usPId, Float_t  fEner,
+		   Float_t  fThi0,     Float_t  fFirTar,   Float_t  fzFirInt,
+		   Float_t  fThet,     Float_t  fPhii,     Float_t  fCorD, 
+		   Float_t  fCorX,     Float_t  fCorY,     Float_t  fImpa, 
+		   Float_t  fTPhii,    Float_t  fTThet,    Float_t  fTFirst,
+		   Float_t  fTLast,    Float_t  fL_Nmax,   Float_t  fL_t0,
+		   Float_t  fL_tmax,   Float_t  fL_a,      Float_t  fL_b,
+		   Float_t  fL_c,      Float_t  fL_chi2,   UInt_t   uiPin, 
+		   UInt_t   uiPat,     UInt_t   uiPre,     UInt_t   uiPco,  
+		   UInt_t   uiPelS,    UInt_t   uiPelC,    Float_t  elec,
+                   Float_t  muon,      Float_t  other,     Float_t  fadc_jitter)
+{
+    //
+    //  All datamembers are filled with the correspondin parameters.
+    //
+    //  Don't use this memberfunction in analysis
+    //
+    fEvtNumber = fEvtNum;
+    fPartId = usPId  ;
+    fEnergy = fEner  ;
+    fThick0 = fThi0;
+    fFirstTarget = fFirTar;
+    fZFirstInteraction = fzFirInt;
+
+    fTheta  = fThet ;
+    fPhi    = fPhii ;
+
+    fCoreD  = fCorD ;
+    fCoreX  = fCorX ;
+    fCoreY  = fCorY ;
+    fImpact = fImpa ;
+
+    fTelescopePhi = fTPhii;
+    fTelescopeTheta = fTThet;
+    fTimeFirst = fTFirst;
+    fTimeLast = fTLast;
+    fLongiNmax = fL_Nmax;
+    fLongit0 = fL_t0;
+    fLongitmax = fL_tmax;
+    fLongia = fL_a;
+    fLongib = fL_b;
+    fLongic = fL_c;
+    fLongichi2 = fL_chi2;
+
+    fPhotIni      = uiPin ;
+    fPassPhotAtm  = fPhotIni-uiPat ;
+    fPassPhotRef  = fPassPhotAtm-uiPre ;
+    fPassPhotCone = uiPco ;
+    fPhotElfromShower = uiPelS ;
+    fPhotElinCamera = uiPelC ;
+
+    fElecCphFraction=elec;
+    fMuonCphFraction=muon;
+    fOtherCphFraction=other;
+
+    fFadcTimeJitter = fadc_jitter;
+}
 
 // --------------------------------------------------------------------------
@@ -260,47 +205,11 @@
 void MMcEvt::Print(Option_t *opt) const
 {
-    //
-    //  print out the data member on screen
-    //
+    MMcEvtBasic::Print(opt);
+
     TString str(opt);
     if (str.IsNull())
     {
-        *fLog << all << endl;
-        *fLog << "Monte Carlo output:" << endl;
-        *fLog << " Particle Id:    ";
-        switch(fPartId)
-        {
-        case kGAMMA:
-            *fLog << "Gamma" << endl;
-            break;
-        case kPROTON:
-            *fLog << "Proton" << endl;
-            break;
-        case kHELIUM:
-            *fLog << "Helium" << endl;
-            break;
-        }
-        *fLog << " Energy:         " << fEnergy << "GeV" << endl;
-        *fLog << " Impactpar.:     " << fImpact/100 << "m" << endl;
         *fLog << " Photoelectrons: " << fPhotElfromShower << endl;
-        *fLog << endl;
         return;
     }
-    if (str.Contains("id", TString::kIgnoreCase))
-        switch(fPartId)
-        {
-        case kGAMMA:
-            *fLog << "Particle: Gamma" << endl;
-            break;
-        case kPROTON:
-            *fLog << "Particle: Proton" << endl;
-            break;
-        case kHELIUM:
-            *fLog << "Particle: Helium" << endl;
-            break;
-        }
-    if (str.Contains("energy", TString::kIgnoreCase))
-        *fLog << "Energy: " << fEnergy << "GeV" << endl;
-    if (str.Contains("impact", TString::kIgnoreCase))
-        *fLog << "Impact: " << fImpact << "cm" << endl;
-}
+}
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 6912)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 7094)
@@ -1,244 +1,117 @@
-#ifndef __MMcEvt__
-#define __MMcEvt__
+#ifndef MARS_MMcEvt
+#define MARS_MMcEvt
 
-#ifndef MARS_MParContainer
-#include "MParContainer.h"
+#ifndef MARS_MMcEvtBasic
+#include "MMcEvtBasic.h"
 #endif
 
-//
-// Version 4: 
-//   Added member fFadcTimeJitter
-//
 
-class MMcEvt : public MParContainer
+class MMcEvt : public MMcEvtBasic
 {
+private:
+    UInt_t  fEvtNumber;
+    Float_t fThick0;             // [g/cm2]
+    Float_t fFirstTarget;        // []
+    Float_t fZFirstInteraction;  // [cm]
+
+    Float_t fTheta;              // [rad] Theta angle of event
+    Float_t fPhi;                // [rad] Phi angle of event (see class description)
+
+    Float_t fCoreD;              // [cm] Core d pos
+    Float_t fCoreX;              // [cm] Core x pos
+    Float_t fCoreY;              // [cm] Core y pos
+
+    // Up to here, the info from the CORSIKA event header.
+
+    // Time of first and last photon:
+    Float_t fTimeFirst;          // [ns]
+    Float_t fTimeLast;           // [ns]
+
+    // 6 parameters and chi2 of the NKG fit to the longitudinal
+    // particle distribution. See CORSIKA manual for explanation,
+    // section 4.42 "Longitudinal shower development":
+    //
+    Float_t fLongiNmax;          // [particles]
+    Float_t fLongit0;            // [g/cm2]
+    Float_t fLongitmax;          // [g/cm2]
+    Float_t fLongia;             // [g/cm2]
+    Float_t fLongib;             // []
+    Float_t fLongic;             // [cm2/g]
+    Float_t fLongichi2;
+
+    UInt_t fPhotIni;             // [ph] Initial number of photons
+    UInt_t fPassPhotAtm;         // [ph] Passed atmosphere
+    UInt_t fPassPhotRef;         // [ph] Passed reflector(reflectivity + effective area)
+    UInt_t fPassPhotCone;        // [ph]  Within any valid pixel, before plexiglas
+    UInt_t fPhotElfromShower;    // [phe] Passed qe, coming from the shower
+    UInt_t fPhotElinCamera;      // [phe] usPhotElfromShower + mean of phe from NSB
+
+    // Now follow the fraction of photons reaching the camera produced by
+    // electrons, muons and other particles respectively:
+
+    Float_t  fElecCphFraction;
+    Float_t  fMuonCphFraction;
+    Float_t  fOtherCphFraction;
+
+    Float_t  fFadcTimeJitter;
+
 public:
-    //
-    //     ParticleId for Monte Carlo simulation
-    //
-    enum ParticleId_t
-    {
-        kGAMMA    =  1,
-        kPOSITRON =  2,
-        kELECTRON =  3,
-        kANTIMUON =  5,
-        kMUON     =  6,
-        kPI0      =  7,
-        kNEUTRON  = 13,
-        kPROTON =   14,
-        kHELIUM =  402,
-        kOXYGEN = 1608,
-        kIRON   = 5626
-    };
+    MMcEvt();
+    MMcEvt(UInt_t, ParticleId_t, Float_t, Float_t, Float_t,
+           Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
+           Float_t, Float_t, Float_t, Float_t, Float_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,
+           Float_t, Float_t, Float_t, Float_t) ;
 
-private:
-  UInt_t      fEvtNumber;
-  UShort_t     fPartId;             // Type of particle
-  Float_t      fEnergy;             // [GeV] Energy
-  Float_t      fThick0;             // [g/cm2]
-  Float_t      fFirstTarget;        // []
-  Float_t      fZFirstInteraction;  // [cm]
+    // Getter
+    UInt_t  GetEvtNumber() const { return fEvtNumber; }  //Get Event Number
+    Float_t GetTheta() const { return fTheta; }          //Get Theta angle
+    Float_t GetPhi() const { return fPhi ;  }            //Get Phi angle
 
-  Float_t fTheta;           // [rad] Theta angle of event 
-  Float_t fPhi;             // [rad] Phi angle of event (see class description)
+    Float_t GetCoreX() const { return fCoreX; }          //Get Core x pos
+    Float_t GetCoreY() const { return fCoreY; }          //Get Core y pos
 
-  Float_t fCoreD;           // [cm] Core d pos
-  Float_t fCoreX;           // [cm] Core x pos
-  Float_t fCoreY;           // [cm] Core y pos
-  Float_t fImpact;          // [cm] impact parameter
+    UInt_t  GetPhotIni() const { return fPhotIni; }           //Get Initial photons
+    UInt_t  GetPassPhotAtm() const { return fPassPhotAtm;}    //Get Passed atmosphere
+    UInt_t  GetPassPhotRef() const { return fPassPhotRef; }   //Get Passed reflector
+    UInt_t  GetPassPhotCone() const { return fPassPhotCone; } //Get Passed glas
+    UInt_t  GetPhotElfromShower() const { return fPhotElfromShower; }   //Get Passed qe from shower
+    UInt_t  GetPhotElinCamera() const { return fPhotElinCamera; }       //Get Passed qe total
+    Float_t GetZFirstInteraction() const { return fZFirstInteraction; }
 
-  // Up to here, the info from the CORSIKA event header. 
+    Float_t GetOtherCphFraction() const { return fOtherCphFraction; }
 
-  // Telescope orientation: 
-  Float_t	fTelescopePhi;    // [rad] (see class description)
-  Float_t	fTelescopeTheta;  // [rad]
+    Float_t GetLongiNmax() const { return fLongiNmax; }
+    Float_t GetLongia()    const { return fLongia; }
+    Float_t GetLongib()    const { return fLongib; }
+    Float_t GetLongic()    const { return fLongic; }
+    Float_t GetLongichi2() const { return fLongichi2; }
+    Float_t GetLongit0()   const { return fLongit0; }
+    Float_t GetLongitmax() const { return fLongitmax; }
 
-  // Time of first and last photon:
-  Float_t      fTimeFirst;   // [ns]
-  Float_t      fTimeLast;    // [ns]
+    Float_t GetFadcTimeJitter() const { return fFadcTimeJitter; }
 
-  // 6 parameters and chi2 of the NKG fit to the longitudinal 
-  // particle distribution. See CORSIKA manual for explanation,
-  // section 4.42 "Longitudinal shower development": 
-  //
-  Float_t       fLongiNmax;   // [particles]
-  Float_t       fLongit0;     // [g/cm2]
-  Float_t       fLongitmax;   // [g/cm2]
-  Float_t       fLongia;      // [g/cm2]
-  Float_t       fLongib;      // []
-  Float_t       fLongic;      // [cm2/g]
-  Float_t       fLongichi2;
+    Float_t GetMuonCphFraction() const { return fMuonCphFraction; }
 
-  UInt_t fPhotIni;          // [ph] Initial number of photons
-  UInt_t fPassPhotAtm;      // [ph] Passed atmosphere
-  UInt_t fPassPhotRef;      // [ph] Passed reflector(reflectivity + effective area)
-  UInt_t fPassPhotCone;     // [ph]  Within any valid pixel, before plexiglas
-  UInt_t fPhotElfromShower; // [phe] Passed qe, coming from the shower
-  UInt_t fPhotElinCamera;   // [phe] usPhotElfromShower + mean of phe
-                            // from NSB
+    // Setter
+    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
 
-  // Now follow the fraction of photons reaching the camera produced by
-  // electrons, muons and other particles respectively:
+    void Fill( UInt_t, ParticleId_t, Float_t, Float_t, Float_t,
+               Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
+               Float_t, Float_t, Float_t, Float_t, Float_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,
+               Float_t, Float_t, Float_t, Float_t) ;
 
-  Float_t  fElecCphFraction;
-  Float_t  fMuonCphFraction;
-  Float_t  fOtherCphFraction;
-  
-  Float_t  fFadcTimeJitter;
+    // TObject
+    void Print(Option_t *opt=NULL) const;
+    void Clear(Option_t *opt=NULL);
 
- public:
-  MMcEvt() ;
-  
-  MMcEvt( UInt_t, UShort_t, Float_t, Float_t, Float_t,
-	  Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
-	  Float_t, Float_t, Float_t, Float_t, Float_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,
-	  Float_t, Float_t, Float_t, Float_t) ; 
-  
-  ~MMcEvt(); 
-
-  void Clear(Option_t *opt=NULL);
-
-  void Fill( UInt_t, UShort_t, Float_t, Float_t, Float_t, 
-	     Float_t, Float_t, Float_t, Float_t, Float_t, Float_t,
-	     Float_t, Float_t, Float_t, Float_t, Float_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,
-	     Float_t, Float_t, Float_t, Float_t) ; 
-
-  //virtual void AsciiWrite(ofstream &fout) const;
-
-  void Print(Option_t *opt=NULL) const;
-
-  UInt_t GetEvtNumber() const { return fEvtNumber; }  //Get Event Number
-  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
-  Float_t GetZFirstInteraction() const { return fZFirstInteraction; }
-
-  Float_t GetTelescopePhi() const { return fTelescopePhi; }
-  Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
-  Float_t GetOtherCphFraction() const { return fOtherCphFraction; }
-
-  Float_t GetLongiNmax() const { return fLongiNmax; }
-  Float_t GetLongia()    const { return fLongia; }
-  Float_t GetLongib()    const { return fLongib; }
-  Float_t GetLongic()    const { return fLongic; }
-  Float_t GetLongichi2() const { return fLongichi2; }
-  Float_t GetLongit0()   const { return fLongit0; }
-  Float_t GetLongitmax() const { return fLongitmax; }
-
-  Float_t GetFadcTimeJitter() const { return fFadcTimeJitter; }
-
-  Float_t GetMuonCphFraction() const { return fMuonCphFraction; }
-
-  void SetPartId(Short_t PartId)
-  {fPartId=PartId;}             //Set Type of particle 
-
-  TString GetParticleName() const
-  {
-      switch (fPartId)
-      {
-      case kGAMMA:    return "Gamma";
-      case kPOSITRON: return "Positron";
-      case kELECTRON: return "Electron";
-      case kANTIMUON: return "Anti-Muon";
-      case kMUON:     return "Muon";
-      case kPI0:      return "Pi-0";
-      case kNEUTRON:  return "Neutron";
-      case kPROTON:   return "Proton";
-      case kHELIUM:   return "Helium";
-      case kOXYGEN:   return "Oxygen";
-      case kIRON:     return "Iron";
-      }
-
-      return Form("Id:%d", fPartId);
-  }
-  TString GetParticleSymbol() const
-  {
-      switch (fPartId)
-      {
-      case kGAMMA:    return "\\gamma";
-      case kPOSITRON: return "e^{+}";
-      case kELECTRON: return "e^{-}";
-      case kANTIMUON: return "\\mu^{+}";
-      case kMUON:     return "\\mu^{-}";
-      case kPI0:      return "\\pi^{0}";
-      case kNEUTRON:  return "n";
-      case kPROTON:   return "p";
-      case kHELIUM:   return "He";
-      case kOXYGEN:   return "O";
-      case kIRON:     return "Fe";
-      }
-
-      return Form("Id:%d", fPartId);
-  }
-  TString GetEnergyStr() const
-  {
-      if (fEnergy>1000)
-          return Form("%.1fTeV", fEnergy/1000);
-
-      if (fEnergy>10)
-          return Form("%dGeV", (Int_t)(fEnergy+.5));
-
-      if (fEnergy>1)
-          return Form("%.1fGeV", fEnergy);
-
-      return Form("%dMeV", (Int_t)(fEnergy*1000+.5));
-  }
-
-  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
-
-  // DO NOT USE THIS IS A WORKAROUND!
-  void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; }
-  void SetTelescopePhi(Float_t Phi)     { fTelescopePhi=Phi; }
-
-  
-/*    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, 4)  //Stores Montecarlo Information of one event (eg. the energy)
-
+    ClassDef(MMcEvt, 5)  //Stores Montecarlo Information of one event (eg. the energy)
 };
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc	(revision 6912)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc	(revision 7094)
@@ -40,6 +40,14 @@
 // South. 
 //
+//
+// Version 1: 
+//  New container to keep the very basic informations on the
+//  original MC events produced by Corsika
+//
+// Version 2:
+//  - added typedef for ParticleId_t from MMcEvt
+//  - replaced MMcEvt::ParticleId_t by ParticleId_t
+//
 /////////////////////////////////////////////////////////////////////////////
-
 #include "MMcEvtBasic.h"
 
@@ -52,55 +60,38 @@
 
 // --------------------------------------------------------------------------
-//  Default constructor set all values to zero
+//
+// Default constructor. Calls Clear()
 //
 MMcEvtBasic::MMcEvtBasic()
-{    
-  fName  = "MMcEvtBasic";
-  fTitle = "Basic event info from Monte Carlo";
+{
+    fName  = "MMcEvtBasic";
+    fTitle = "Basic event info from Monte Carlo";
 
-  Clear();
+    Clear();
 }
 
 // --------------------------------------------------------------------------
-//  constuctor II 
 //
-//  All datamembers are parameters. 
+// Constructor. Use this to set all data members
 //
-MMcEvtBasic::MMcEvtBasic(MMcEvt::ParticleId_t usPId,
-			 Float_t              fEner,
-			 Float_t              fImpa,
-			 Float_t              fTPhii,
-			 Float_t              fTThet)
+// THIS FUNCTION IS FOR THE SIMULATION OLNY.
+// DON'T USE THIS MEMBERFUNCTION IN THE ANALYSIS.
+//
+MMcEvtBasic::MMcEvtBasic(ParticleId_t usPId, Float_t fEner,
+			 Float_t fImpa, Float_t fTPhii, Float_t fTThet)
 {
-  fName  = "MMcEvtBasic";
-  fTitle = "Basic event info from Monte Carlo";
+    fName  = "MMcEvtBasic";
+    fTitle = "Basic event info from Monte Carlo";
 
-  fPartId         = usPId;
-  fEnergy         = fEner;
-  fImpact         = fImpa;
-  fTelescopePhi   = fTPhii;
-  fTelescopeTheta = fTThet;
+    Fill(usPId, fEner, fImpa, fTPhii, fTThet);
 }
-
-
-// --------------------------------------------------------------------------
-//  default destructor
-//
-MMcEvtBasic::~MMcEvtBasic() {
-}
-
 
 // --------------------------------------------------------------------------
 //
-//  Reset all values. We have no "error" value for fPartId, 
-//  we just set kGAMMA
+//  Reset all values: Fill(kUNDEFINED, -1, -1, 0, 0)
 //
 void MMcEvtBasic::Clear(Option_t *opt)
 {
-  fPartId         = MMcEvt::kGAMMA;
-  fEnergy         = -1.;
-  fImpact         = -1.;
-  fTelescopeTheta = -1.;
-  fTelescopePhi   = -1.;
+    Fill(kUNDEFINED, -1, -1, 0, 0);
 }
 
@@ -109,15 +100,14 @@
 // Fill all data members
 //
-void MMcEvtBasic::Fill(MMcEvt::ParticleId_t usPId, 
-		       Float_t  fEner, 
-		       Float_t  fImpa, 
-		       Float_t  fTPhii,
-		       Float_t  fTThet)
+void MMcEvtBasic::Fill(ParticleId_t usPId, Float_t fEner,
+		       Float_t fImpa, Float_t fTPhii, Float_t fTThet)
 {
-  fPartId = usPId;
-  fEnergy = fEner;
-  fImpact = fImpa;
-  fTelescopePhi = fTPhii;
-  fTelescopeTheta = fTThet;
+    fPartId         = usPId;
+
+    fEnergy         = fEner;
+    fImpact         = fImpa;
+
+    fTelescopePhi   = fTPhii;
+    fTelescopeTheta = fTThet;
 }
 
@@ -131,50 +121,23 @@
 void MMcEvtBasic::Print(Option_t *opt) const
 {
-  //
-  //  print out the data member on screen
-  //
-  TString str(opt);
-  if (str.IsNull())
+    //
+    //  print out the data member on screen
+    //
+    TString str(opt);
+    if (str.IsNull())
     {
-      *fLog << all << endl;
-      *fLog << "Monte Carlo output:" << endl;
-      *fLog << " Particle Id:    ";
-      switch(fPartId)
-        {
-        case MMcEvt::kGAMMA:
-	  *fLog << "Gamma" << endl;
-	  break;
-        case MMcEvt::kPROTON:
-	  *fLog << "Proton" << endl;
-	  break;
-        case MMcEvt::kHELIUM:
-	  *fLog << "Helium" << endl;
-	  break;
-	default:
-	  break;
-        }
-      *fLog << " Energy:         " << fEnergy << "GeV" << endl;
-      *fLog << " Impactpar.:     " << fImpact/100 << "m" << endl;
-      *fLog << endl;
-      return;
+        *fLog << all << endl;
+        *fLog << "Monte Carlo output:" << endl;
+        *fLog << " Particle Id:    " << GetParticleName() << endl;
+        *fLog << " Energy:         " << fEnergy << "GeV" << endl;
+        *fLog << " Impactparam.:   " << fImpact/100 << "m" << endl;
+        *fLog << endl;
+        return;
     }
-  if (str.Contains("id", TString::kIgnoreCase))
-    switch(fPartId)
-      {
-      case MMcEvt::kGAMMA:
-	*fLog << "Particle: Gamma" << endl;
-	break;
-      case MMcEvt::kPROTON:
-	*fLog << "Particle: Proton" << endl;
-	break;
-      case MMcEvt::kHELIUM:
-	*fLog << "Particle: Helium" << endl;
-	break;
-      default:
-	break;
-      }
-  if (str.Contains("energy", TString::kIgnoreCase))
-    *fLog << "Energy: " << fEnergy << "GeV" << endl;
-  if (str.Contains("impact", TString::kIgnoreCase))
-    *fLog << "Impact: " << fImpact << "cm" << endl;
+    if (str.Contains("id", TString::kIgnoreCase))
+        *fLog << "Particle: " << GetParticleName() << endl;
+    if (str.Contains("energy", TString::kIgnoreCase))
+        *fLog << "Energy: " << fEnergy << "GeV" << endl;
+    if (str.Contains("impact", TString::kIgnoreCase))
+        *fLog << "Impact: " << fImpact << "cm" << endl;
 }
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 6912)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 7094)
@@ -1,4 +1,4 @@
-#ifndef __MMcEvtBasic__
-#define __MMcEvtBasic__
+#ifndef MARS_MMcEvtBasic
+#define MARS_MMcEvtBasic
 
 #ifndef MARS_MParContainer
@@ -6,41 +6,44 @@
 #endif
 
-#include "MMcEvt.hxx"
-
-//
-// Version 1: 
-// New container to keep the very basic informations on the
-// original MC events produced by Corsika
-//
 
 class MMcEvtBasic : public MParContainer
 {
+public:
+    enum ParticleId_t
+    {
+        kUNDEFINED = -1,
+        kGAMMA     =  1,
+        kPOSITRON  =  2,
+        kELECTRON  =  3,
+        kANTIMUON  =  5,
+        kMUON      =  6,
+        kPI0       =  7,
+        kNEUTRON   = 13,
+        kPROTON  =   14,
+        kHELIUM  =  402,
+        kOXYGEN  = 1608,
+        kIRON    = 5626
+    };
 
 private:
-  MMcEvt::ParticleId_t fPartId;  // Type of particle
-  Float_t              fEnergy;  // [GeV] Energy
-  Float_t              fImpact;  // [cm] impact parameter
+  ParticleId_t fPartId;  // Type of particle
+  Float_t      fEnergy;  // [GeV] Energy
+  Float_t      fImpact;  // [cm] impact parameter
 
   // Telescope orientation (see TDAS 02-11 regarding the 
   // precise meaning of these angles):
-  Float_t              fTelescopePhi;    // [rad]
-  Float_t              fTelescopeTheta;  // [rad]
-
+  Float_t      fTelescopePhi;    // [rad]
+  Float_t      fTelescopeTheta;  // [rad]
   
  public:
   MMcEvtBasic();
-  
-  MMcEvtBasic(MMcEvt::ParticleId_t, Float_t, Float_t, Float_t, Float_t);
-  ~MMcEvtBasic(); 
+  MMcEvtBasic(ParticleId_t, Float_t, Float_t, Float_t, Float_t);
 
-  void Clear(Option_t *opt=NULL);
+  // Getter
+  ParticleId_t GetPartId() const { return fPartId; }
 
-  void Fill(MMcEvt::ParticleId_t, Float_t, Float_t, Float_t, Float_t);
-
-  void Print(Option_t *opt=NULL) const;
-
-  MMcEvt::ParticleId_t GetPartId() const { return fPartId; }
   Float_t GetEnergy()  const { return fEnergy; }
   Float_t GetImpact()  const { return fImpact; }
+
   Float_t GetTelescopePhi() const { return fTelescopePhi; }
   Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
@@ -50,15 +53,16 @@
       switch (fPartId)
       {
-      case MMcEvt::kGAMMA:    return "Gamma";
-      case MMcEvt::kPOSITRON: return "Positron";
-      case MMcEvt::kELECTRON: return "Electron";
-      case MMcEvt::kANTIMUON: return "Anti-Muon";
-      case MMcEvt::kMUON:     return "Muon";
-      case MMcEvt::kPI0:      return "Pi-0";
-      case MMcEvt::kNEUTRON:  return "Neutron";
-      case MMcEvt::kPROTON:   return "Proton";
-      case MMcEvt::kHELIUM:   return "Helium";
-      case MMcEvt::kOXYGEN:   return "Oxygen";
-      case MMcEvt::kIRON:     return "Iron";
+      case kUNDEFINED:return "Undefined";
+      case kGAMMA:    return "Gamma";
+      case kPOSITRON: return "Positron";
+      case kELECTRON: return "Electron";
+      case kANTIMUON: return "Anti-Muon";
+      case kMUON:     return "Muon";
+      case kPI0:      return "Pi-0";
+      case kNEUTRON:  return "Neutron";
+      case kPROTON:   return "Proton";
+      case kHELIUM:   return "Helium";
+      case kOXYGEN:   return "Oxygen";
+      case kIRON:     return "Iron";
       }
 
@@ -70,15 +74,16 @@
       switch (fPartId)
       {
-      case MMcEvt::kGAMMA:    return "\\gamma";
-      case MMcEvt::kPOSITRON: return "e^{+}";
-      case MMcEvt::kELECTRON: return "e^{-}";
-      case MMcEvt::kANTIMUON: return "\\mu^{+}";
-      case MMcEvt::kMUON:     return "\\mu^{-}";
-      case MMcEvt::kPI0:      return "\\pi^{0}";
-      case MMcEvt::kNEUTRON:  return "n";
-      case MMcEvt::kPROTON:   return "p";
-      case MMcEvt::kHELIUM:   return "He";
-      case MMcEvt::kOXYGEN:   return "O";
-      case MMcEvt::kIRON:     return "Fe";
+      case kUNDEFINED:return "N/A";
+      case kGAMMA:    return "\\gamma";
+      case kPOSITRON: return "e^{+}";
+      case kELECTRON: return "e^{-}";
+      case kANTIMUON: return "\\mu^{+}";
+      case kMUON:     return "\\mu^{-}";
+      case kPI0:      return "\\pi^{0}";
+      case kNEUTRON:  return "n";
+      case kPROTON:   return "p";
+      case kHELIUM:   return "He";
+      case kOXYGEN:   return "O";
+      case kIRON:     return "Fe";
       }
 
@@ -101,18 +106,19 @@
 
 
-  void SetPartId(MMcEvt::ParticleId_t id)
-    { fPartId = id; }
-
-  void SetEnergy(Float_t Energy)
-  { fEnergy=Energy; }              //Set Energy 
- 
-  void SetImpact(Float_t Impact) 
-  { fImpact=Impact;}               //Set impact parameter
+  // Setter
+  void SetPartId(ParticleId_t id) { fPartId = id; }
+  void SetEnergy(Float_t Energy)  { fEnergy=Energy; }              //Set Energy
+  void SetImpact(Float_t Impact)  { fImpact=Impact;}               //Set impact parameter
 
   void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; }
-
   void SetTelescopePhi  (Float_t Phi)   { fTelescopePhi=Phi; }
 
-  ClassDef(MMcEvtBasic, 1) //Stores Basic Montecarlo Information of one event
+  void Fill(ParticleId_t, Float_t, Float_t, Float_t, Float_t);
+
+  // TObject
+  void Clear(Option_t *opt=NULL);
+  void Print(Option_t *opt=NULL) const;
+
+  ClassDef(MMcEvtBasic, 2) //Stores Basic Montecarlo Information of one event
 
 };
