Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc	(revision 6375)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.cc	(revision 6375)
@@ -0,0 +1,180 @@
+/* ======================================================================== *\
+!
+! *
+! * 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): Abelardo Moralejo, 02/2005 <mailto:moralejo@pd.infn.it>
+!
+!   Copyright: MAGIC Software Development, 2000-2005
+!
+!
+\* ======================================================================== */
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// MMcEvtBasic
+//
+// This class contains the most basic MonteCarlo information
+// with which an event has been generated
+//
+// Note: The azimuth fTelescopePhi angle in this and other MC classes 
+// follow the convention in the Corsika program (see Corsika manual and
+// TDAS 02-11). There, phi is the azimuth of the momentum vector of 
+// particles, and is measured from the north direction, anticlockwise 
+// (i.e, west is phi=90 degrees). When it refers to the telescope 
+// orientation, it is the azimuth of a vector along the telescope axis, 
+// going from the camera to the mirror. So, fTelescopeTheta=90, 
+// fTelescopePhi = 0 means the telescope is pointing horizontally towards 
+// South. 
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MMcEvtBasic.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+ClassImp(MMcEvtBasic);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//  Default constructor set all values to zero
+//
+MMcEvtBasic::MMcEvtBasic()
+{    
+  fName  = "MMcEvtBasic";
+  fTitle = "Basic event info from Monte Carlo";
+
+  Clear();
+}
+
+// --------------------------------------------------------------------------
+//  constuctor II 
+//
+//  All datamembers are parameters. 
+//
+MMcEvtBasic::MMcEvtBasic(MMcEvt::ParticleId_t usPId,
+			 Float_t              fEner,
+			 Float_t              fImpa,
+			 Float_t              fTPhii,
+			 Float_t              fTThet)
+{
+  fName  = "MMcEvtBasic";
+  fTitle = "Basic event info from Monte Carlo";
+
+  fPartId         = usPId;
+  fEnergy         = fEner;
+  fImpact         = fImpa;
+  fTelescopePhi   = fTPhii;
+  fTelescopeTheta = fTThet;
+}
+
+
+// --------------------------------------------------------------------------
+//  default destructor
+//
+MMcEvtBasic::~MMcEvtBasic() {
+}
+
+
+// --------------------------------------------------------------------------
+//
+//  Reset all values. We have no "error" value for fPartId, 
+//  we just set kGAMMA
+//
+void MMcEvtBasic::Clear(Option_t *opt)
+{
+  fPartId         = MMcEvt::kGAMMA;
+  fEnergy         = -1.;
+  fImpact         = -1.;
+  fTelescopeTheta = -1.;
+  fTelescopePhi   = -1.;
+}
+
+// --------------------------------------------------------------------------
+//
+// Fill all data members
+//
+void MMcEvtBasic::Fill(MMcEvt::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;
+}
+
+// --------------------------------------------------------------------------
+//
+// Print the contents of the container.
+//
+//  if you specify an option only the requested data members are printed:
+//  allowed options are: id, energy, impact
+//
+void MMcEvtBasic::Print(Option_t *opt) const
+{
+  //
+  //  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;
+    }
+  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;
+}
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 6375)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 6375)
@@ -0,0 +1,120 @@
+#ifndef __MMcEvtBasic__
+#define __MMcEvtBasic__
+
+#ifndef MARS_MParContainer
+#include "MParContainer.h"
+#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
+{
+
+private:
+  MMcEvt::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]
+
+  
+ public:
+  MMcEvtBasic();
+  
+  MMcEvtBasic(MMcEvt::ParticleId_t, Float_t, Float_t, Float_t, Float_t);
+  ~MMcEvtBasic(); 
+
+  void Clear(Option_t *opt=NULL);
+
+  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; }
+
+  TString GetParticleName() const
+  {
+      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";
+      }
+
+      return Form("Id:%d", fPartId);
+  }
+
+  TString GetParticleSymbol() const
+  {
+      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";
+      }
+
+      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 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
+
+  void SetTelescopeTheta(Float_t Theta) { fTelescopeTheta=Theta; }
+
+  void SetTelescopePhi  (Float_t Phi)   { fTelescopePhi=Phi; }
+
+  ClassDef(MMcEvtBasic, 1) //Stores Basic Montecarlo Information of one event
+
+};
+
+#endif
Index: trunk/MagicSoft/include-Classes/MMcFormat/Makefile
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/Makefile	(revision 5599)
+++ trunk/MagicSoft/include-Classes/MMcFormat/Makefile	(revision 6375)
@@ -21,5 +21,6 @@
            MMcTrig.cxx \
 	   MMcConfigRunHeader.cc \
-	   MMcCorsikaRunHeader.cc
+	   MMcCorsikaRunHeader.cc \
+	   MMcEvtBasic.cc
 
 ############################################################
Index: trunk/MagicSoft/include-Classes/MMcFormat/McLinkDef.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/McLinkDef.h	(revision 5599)
+++ trunk/MagicSoft/include-Classes/MMcFormat/McLinkDef.h	(revision 6375)
@@ -6,4 +6,5 @@
  
 #pragma link C++ class MMcEvt+;
+#pragma link C++ class MMcEvtBasic+;
 #pragma link C++ class MMcTrig+;
 #pragma link C++ class MMcRunHeader+;
