Index: trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.cxx	(revision 324)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.cxx	(revision 324)
@@ -0,0 +1,93 @@
+#include <iostream.h>
+#include "MSimone.hxx"
+//==========
+// MSimone
+//    
+// This class handles and contains the MonteCarlo information
+// with which the events have been generated
+// This information exists for each event.
+
+//ClassImp(MSimone)
+
+
+
+MSimone::MSimone() {
+  //
+  //  default constructor
+  //  set all values to zero
+
+  PartId = 0  ;
+  Energy  = 0. ;
+
+  Theta   = 0. ;
+  Phi     = 0. ;
+
+  CoreD   = 0. ;
+  CoreX   = 0. ;
+  CoreY   = 0. ;
+  
+  FirstInt = 0. ; 
+}
+
+MSimone::~MSimone() {
+  //
+  //  default destructor
+  //
+}
+
+
+
+
+void MSimone::Clear() {
+  //
+  //  
+  //  reset all values to zero
+
+  PartId  = 0.  ;
+  Energy  = 0.  ;
+
+  Theta   = 0.  ;
+  Phi     = 0.  ;
+
+  CoreD   = 0.  ;
+  CoreX   = 0.  ;
+  CoreY   = 0.  ;
+  
+  FirstInt= 0.  ; 
+}
+
+
+void MSimone::Print(void) {
+  //
+  //  print out the data member on screen
+  //
+  cout <<endl << "Monte Carlo output:" <<endl;
+  cout << " Particle Id    : " << PartId ; 
+  cout << " Energy (GeV)   : " << Energy  ; 
+  cout << endl ; 
+}
+
+
+void MSimone::Transfer( COREventHeader *e )
+{
+  PartId       = e->PrimaryID;
+  Energy       = e->Etotal;
+
+  Theta          = e->Theta;
+  Phi            = e->Phi;
+  
+  FirstInt      = e->zFirstInt;
+}
+
+
+void MSimone::NtupFill( TNtuple *n )
+{
+  n->Fill(PartId,Energy,Theta,Phi) ; 
+}
+
+
+
+
+
+
+
Index: trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.hxx	(revision 324)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.hxx	(revision 324)
@@ -0,0 +1,49 @@
+#ifndef __MSimone__
+#define __MSimone__
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>  
+
+#include <iostream.h>
+#include "TObject.h"
+#include "TNtuple.h"
+
+#include "COREventHeader.hxx"
+
+//class MSimone : public TObject {
+class MSimone {
+ private:
+  Float_t  PartId;        // Type of particle
+  Float_t  Energy;       // Energy in GeV
+
+  Float_t  Theta;        // Theta angle of event 
+  Float_t  Phi;          // Phi angle of event 
+
+  Float_t  CoreD;        // Core d pos
+  Float_t  CoreX;        // Core x pos
+  Float_t  CoreY;        // Core y pos
+
+  Float_t  FirstInt ;    // First interaction in cm above sea level
+
+
+ public:
+  MSimone() ;         
+  
+  ~MSimone(); 
+
+  void Clear();
+
+  void Print(void);
+
+  void Transfer ( COREventHeader *e );
+
+  void NtupFill ( TNtuple *n ) ; 
+
+  //  ClassDef(MSimone, 1)   //Stores Montecarlo Information 
+
+};
+
+#endif
Index: trunk/MagicSoft/Simulation/Corsika/Simone/Makefile
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/Makefile	(revision 324)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/Makefile	(revision 324)
@@ -0,0 +1,216 @@
+##################################################################
+#
+# makefile
+#
+# @file        makefile 
+# @title       Simulation of the camera and trigger logic
+# @author      J C Gonz\'alez
+# @email       gonzalez@mppmu.mpg.de
+# @date        Fri Mar 12 11:51:11 MET 1999
+#
+#_______________________________________________________________
+#
+# Created: Fri Mar 12 11:51:11 MET 1999
+# Author:  Jose Carlos Gonzalez
+# Purpose: Makefile for the compilation of the camera program
+# Notes:   
+#    
+#---------------------------------------------------------------
+#
+# $RCSfile: Makefile,v $
+# $Revision: 1.1.1.1 $
+# $Author: harald $ 
+# $Date: 1999-11-18 09:39:14 $
+#
+##################################################################
+# @maintitle
+
+# @code
+
+INCLUDEMK = config.mk.${OSTYPE}
+include ${INCLUDEMK}
+
+# @endcode
+
+# @code 
+
+# common flags
+INCLUDES = -I${INCLUDE}      \
+	   -I${INCLUDE_COR}  \
+	   -I${INCLUDE_ROOT}  \
+	   -I${INCLUDE_SIMO} \
+           -I/usr/include  -I/usr/include/g++
+
+RANLIB  = -L${RANLIBDIR} -lranlib
+
+# what is needed for ROOT is declared in config.mk file
+
+
+# special flags
+
+osf_FORLIBS = -lUfor -lfor -lutil -lots -lm 
+linux_FORLIBS = -lm 
+generic_FORLIBS = -lm 
+
+FORLIBS = ${${SYSTEM}_FORLIBS}
+
+# compilation and linking flags
+
+CXXFLAGS  = -D__${SYSTEM}__ ${INCLUDES} ${OPTIM} ${DEBUG}
+CFLAGS    = ${CXXFLAGS}
+FFLAGS    = ${CXXFLAGS}
+LIBS      = ${RANLIB} ${ROOTLIBS} ${ROOTGLIBS} ${GLIBS} ${FORLIBS} 
+#LIBS      = ${CERNLIB} ${RANLIB} ${FORLIBS} 
+
+#------------------------------------------------------------------------------
+
+#.SILENT:
+
+.SUFFIXES: .c .cxx .C .c++ .h .hxx .H .h++ .o .so .f
+
+SRCS = \
+	${INCLUDE_COR}/COREventHeader.cxx \
+	${INCLUDE_COR}/CORParticle.cxx \
+	${INCLUDE_COR}/CORStatfile.cxx \
+	MSimone.cxx \
+	simone.cxx      
+
+HEADERS = \
+	COREventHeader.hxx \
+	CORParticle.hxx \
+	CORStatfile.hxx \
+	MSimone.hxx \
+	simone.h
+
+OBJS = \
+	${INCLUDE_COR}/COREventHeader.o \
+	${INCLUDE_COR}/CORParticle.o \
+	${INCLUDE_COR}/CORStatfile.o \
+	MSimone.o \
+	simone.o      
+
+PROGRAM=simone
+
+############################################################
+
+all: ${PROGRAM}
+
+depend:
+	@makedepend $(SRCS) -fMakefile 2> /dev/null
+
+doc: reflector-doc
+
+reflector-doc: 
+	@echo "Generating documentation for camera . . . "
+	$(DOCUM) -latex -o reflector.tex \
+	reflector.cxx reflector.h \
+	readparam.cxx readparam.h \
+	atm.cxx atm.h
+	latex "\nonstopmode\input{reflector.tex}" && \
+	makeindex reflector && \
+	latex "\nonstopmode\input{reflector.tex}" && \
+	latex "\nonstopmode\input{reflector.tex}"
+	@echo "Files reflector.tex and reflector.dvi generated."
+
+rate: 
+	@echo "Rating documentation inside code . . . "
+	$(RATE) \
+	reflector.cxx reflector.h \
+	readparam.cxx readparam.h \
+	atm.cxx atm.h
+
+${PROGRAM}: $(OBJS)
+	@echo "Linking..." $@
+	$(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $@
+	@echo "done."
+
+.cxx.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.c.o:	
+	@echo "Compiling " $<
+	$(CC) $(CFLAGS) -c $< -o $@
+
+.f.o:	
+	@echo "Compiling " $<
+	$(F77) $(FFLAGS) -c $< -o $@
+
+lclean:
+	@echo "Cleanning..."
+	@rm -f *.o core 
+
+clean:
+	@echo "Cleanning..."
+	@rm -f $(OBJS) core 
+
+mrproper: clean
+	@echo "Mr.Proper in action . . ."
+	@rm -f $(PROGRAM)
+
+ctags:
+	@echo "Creating CTAGS file . . ."
+	@ctags -txw $(SRCS) $(HEADERS) > CTAGS
+
+etags:
+	@echo "Creating TAGS file . . ."
+	@etags -C $(SRCS) $(HEADERS)
+
+listsrc:
+	@ls -m $(SRCS) $(HEADERS) | sed 's/,//g'
+
+redo: clean all
+
+# @endcode
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+../../Detector/include-CORSIKA/COREventHeader.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/stdlib.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/standards.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/getopt.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/types.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/mach/machine/vm_types.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/select.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/math.h
+../../Detector/include-CORSIKA/CORParticle.o: ../../Detector/include-CORSIKA/CORParticle.hxx
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/stdlib.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/standards.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/getopt.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/types.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/mach/machine/vm_types.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/select.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/math.h
+../../Detector/include-CORSIKA/CORStatfile.o: ../../Detector/include-CORSIKA/CORStatfile.hxx
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/stdlib.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/standards.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/getopt.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/types.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/mach/machine/vm_types.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/select.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/math.h
+MSimone.o: MSimone.hxx /usr/include/stdlib.h /usr/include/standards.h
+MSimone.o: /usr/include/getopt.h /usr/include/sys/types.h
+MSimone.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
+MSimone.o: /usr/include/stdio.h /usr/include/sys/seek.h
+MSimone.o: /usr/include/va_list.h /usr/include/sys/limits.h
+MSimone.o: /usr/include/sys/machine/machlimits.h /usr/include/sys/syslimits.h
+MSimone.o: /usr/include/sys/machine/machtime.h /usr/include/sys/rt_limits.h
+MSimone.o: /usr/include/string.h /usr/include/strings.h /usr/include/unistd.h
+MSimone.o: /usr/include/sys/access.h /usr/include/fcntl.h
+MSimone.o: /usr/include/sys/fcntl.h /usr/include/sys/mode.h
+MSimone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
+MSimone.o: /usr/include/math.h
+simone.o: /usr/include/stdlib.h /usr/include/standards.h
+simone.o: /usr/include/getopt.h /usr/include/sys/types.h
+simone.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
+simone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
+simone.o: /usr/include/math.h ../../Detector/include-CORSIKA/CORParticle.hxx
+simone.o: ../../Detector/include-CORSIKA/CORStatfile.hxx MSimone.hxx
+simone.o: /usr/include/stdio.h /usr/include/sys/seek.h /usr/include/va_list.h
+simone.o: /usr/include/sys/limits.h /usr/include/sys/machine/machlimits.h
+simone.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
+simone.o: /usr/include/sys/rt_limits.h /usr/include/string.h
+simone.o: /usr/include/strings.h /usr/include/unistd.h
+simone.o: /usr/include/sys/access.h /usr/include/fcntl.h
+simone.o: /usr/include/sys/fcntl.h /usr/include/sys/mode.h
Index: trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.linux-gnu
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.linux-gnu	(revision 324)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.linux-gnu	(revision 324)
@@ -0,0 +1,74 @@
+##################################################################
+#
+# config.mk
+#
+# @file        config.mk
+# @title       small configuration file for Makefile
+# @author      J C Gonz\'alez
+# @email       gonzalez@mppmu.mpg.de
+# @date        Fri Mar 12 11:51:11 MET 1999
+#
+#_______________________________________________________________
+#
+# Created: Fri Mar 12 11:51:11 MET 1999
+# Author:  Jose Carlos Gonzalez
+# Purpose: Makefile for the compilation of the reflector program
+# Notes:   
+#    
+#---------------------------------------------------------------
+# $RCSfile: config.mk.linux-gnu,v $
+# $Revision: 1.1.1.1 $
+# $Author: harald $ 
+# $Date: 1999-11-18 09:39:14 $
+##################################################################
+# @maintitle
+
+# @code
+
+# program
+
+PROGRAM = camera
+
+# compilers & tools
+
+CC            = gcc
+CXX           = g++
+F77           = g77
+
+DOCUM         = ../sus/sus
+RATE          = ../../comstat/comstat -g -p 
+
+# includes		
+
+INCLUDE       = ../../Detector/include-GENERAL
+INCLUDE_COR   = ../../Detector/include-CORSIKA
+INCLUDE_ROOT  = ${ROOTSYS}/include  
+INCLUDE_SIMO  = .
+
+OPTIM    = 
+DEBUG    = -g
+
+# libraries
+
+
+ROOTLIBS      = -L$(ROOTSYS)/lib -lNew -lBase -lCint -lClib \
+                -lCont -lFunc -lGraf -lGraf3d -lHist -lHtml \
+                -lMatrix -lMeta -lMinuit -lNet -lPostscript \
+                -lProof -lTree -lUnix -lZip -lRint
+
+ROOTGLIBS     = -lGpad -lGui -lGX11 -lX3d -lX11
+
+
+GLIBS         = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/X11R6/lib \
+                -lXpm -lX11  -lm -ldl 
+
+
+RANLIBDIR = ../../Detector/lib
+CERNDIR = /CERN
+
+# system
+
+SYSTEM  = linux
+
+# @endcode
+##EOF
Index: trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.osf1
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.osf1	(revision 324)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.osf1	(revision 324)
@@ -0,0 +1,72 @@
+##################################################################
+#
+# config.mk
+#
+# @file        config.mk
+# @title       small configuration file for Makefile
+# @author      J C Gonz\'alez
+# @email       gonzalez@mppmu.mpg.de
+# @date        Fri Mar 12 11:51:11 MET 1999
+#
+#_______________________________________________________________
+#
+# Created: Fri Mar 12 11:51:11 MET 1999
+# Author:  Jose Carlos Gonzalez
+# Purpose: Makefile for the compilation of the reflector program
+# Notes:   
+#    
+#---------------------------------------------------------------
+# $RCSfile: config.mk.osf1,v $
+# $Revision: 1.1.1.1 $
+# $Author: harald $ 
+# $Date: 1999-11-18 09:39:14 $
+##################################################################
+# @maintitle
+
+# @code
+
+# program
+
+PROGRAM = camera
+
+# compilers & tools
+
+CC            = cc
+CXX           = cxx
+F77           = f77
+
+DOCUM         = ../sus/sus
+RATE          = ../../comstat/comstat -g -p 
+
+# includes		
+
+INCLUDE       = ../../Detector/include-GENERAL
+INCLUDE_COR   = ../../Detector/include-CORSIKA
+INCLUDE_ROOT  = ${ROOTSYS}/include  
+INCLUDE_SIMO  = .
+
+OPTIM    = -O
+DEBUG    = -g
+
+# libraries
+
+ROOTLIBS =  	-L/CERN/root/lib -lNew -lCore -lCint -lHist \
+		-lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript \
+		-lMatrix -lPhysics -lm  
+
+ROOTGLIBS = 	-L/CERN/root/lib -lNew -lCore -lCint -lHist \
+		-lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript \
+		-lMatrix -lPhysics -lGui -lm  
+
+GLIBS = 	$(ROOTLIBS) $(ROOTGLIBS)
+
+
+RANLIBDIR = ../../Detector/lib
+CERNDIR = /CERN
+
+# system
+
+SYSTEM  = osf
+
+# @endcode
+##EOF
Index: trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx	(revision 324)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx	(revision 324)
@@ -0,0 +1,91 @@
+//
+//
+//
+//
+//
+//
+#include <stdlib.h>
+#include "TROOT.h"
+
+#include "TFile.h"
+#include "TNtuple.h"
+
+#include "COREventHeader.hxx"
+#include "CORParticle.hxx"
+#include "CORStatfile.hxx"
+
+#include "MSimone.hxx"
+
+main() 
+  {
+    // initialise ROOT
+
+    TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
+              
+    //    char  path[100] = "/hd61/Maggi/Data/mcMAGIC-1-30:30000-1" ; 
+    char  path[100] = "/hd31/Data/mmcs_prod_1009_30:30000_14" ; 
+    //    char  path[100] = "/data/mmcs/" ; 
+    char  cername[120] ; 
+    char  datname[120] ; 
+
+    ifstream   cerfile ; 
+
+    COREventHeader Event ;   
+    
+    MSimone    Infos ; 
+    Infos.Print() ; 
+    //
+    //    now create a root-file for the ntuple output
+    // 
+
+    TFile *outfile = new TFile("simone.root","RECREATE");
+
+    TNtuple *Ntup = new TNtuple("simone",
+			       "Simone info of mmcs",
+			       "PartId:Energy:Theta:Phi");
+
+
+    for (int i_cer = 1; i_cer < 1000; i_cer++ ) {
+
+      //
+      //   create the file names 
+      //
+      sprintf ( cername, "%s/cer%06d", path, i_cer ) ; 
+      sprintf ( datname, "%s/dat%06d", path, i_cer ) ; 
+
+      //      cout << cername  << endl ; 
+      //      cout << datname  << endl ; 
+
+      //
+      //   try to open the files
+      // 
+
+      cerfile.open( cername );
+        
+      if ( cerfile.bad() ) { 
+        cout << "Cannot open input file:  " << cername << endl ;
+	continue ; 
+      }
+          
+      cout << " Read event " << endl ;
+      Event.read( cerfile );
+      
+      Infos.Transfer ( &Event ) ; 
+
+      Infos.Print() ; 
+
+      Infos.NtupFill ( Ntup ) ; 
+ 
+      cerfile.close();
+
+    } 
+    
+
+    //
+    //   write all to file
+    //
+    outfile->Write() ; 
+
+  } 
+
+
