Index: trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.cxx	(revision 405)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.cxx	(revision 415)
@@ -27,5 +27,7 @@
   CoreY   = 0. ;
   
-  FirstInt = 0. ; 
+  FirstInt = 0. ;
+
+  NumCerPhot = 0. ; 
 }
 
@@ -55,4 +57,6 @@
   
   FirstInt= 0.  ; 
+
+  NumCerPhot = 0. ; 
 }
 
@@ -77,11 +81,23 @@
   Phi            = e->Phi;
   
+  Float_t x, y ; 
+
+  CoreD = e->get_core(&x, &y, 0 ) ; 
+
+  CoreX = x ; 
+  CoreY = y ; 
+
   FirstInt      = e->zFirstInt;
+
 }
 
+void MSimone::SetNumCerPhot( Int_t iN ) 
+{
+  NumCerPhot = (Float_t) iN ; 
+}
 
 void MSimone::NtupFill( TNtuple *n )
 {
-  n->Fill(PartId,Energy,Theta,Phi) ; 
+  n->Fill(PartId,Energy,Theta,Phi,CoreX, CoreY, CoreD, NumCerPhot ) ; 
 }
 
Index: trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.hxx	(revision 405)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/MSimone.hxx	(revision 415)
@@ -29,5 +29,6 @@
   Float_t  FirstInt ;    // First interaction in cm above sea level
 
-
+  Float_t  NumCerPhot ;  // Number of Cerenkov photons in shower
+  
  public:
   MSimone() ;         
@@ -43,4 +44,6 @@
   void NtupFill ( TNtuple *n ) ; 
 
+  void SetNumCerPhot( Int_t iN ) ; 
+
   //  ClassDef(MSimone, 1)   //Stores Montecarlo Information 
 
Index: trunk/MagicSoft/Simulation/Corsika/Simone/Makefile
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/Makefile	(revision 405)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/Makefile	(revision 415)
@@ -19,7 +19,7 @@
 #
 # $RCSfile: Makefile,v $
-# $Revision: 1.1.1.1 $
+# $Revision: 1.2 $
 # $Author: harald $ 
-# $Date: 1999-11-18 09:39:14 $
+# $Date: 2000-07-06 10:24:00 $
 #
 ##################################################################
@@ -168,49 +168,103 @@
 ../../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/features.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/cdefs.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/gnu/stubs.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.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/bits/types.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/time.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/endian.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/endian.h
 ../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/select.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/select.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/sigset.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/sys/sysmacros.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/alloca.h
 ../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/math.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/huge_val.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/mathdef.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/include/bits/mathcalls.h
+../../Detector/include-CORSIKA/COREventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.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/features.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/cdefs.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/gnu/stubs.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.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/bits/types.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/time.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/endian.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/endian.h
 ../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/select.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/select.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/sigset.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/sys/sysmacros.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/alloca.h
 ../../Detector/include-CORSIKA/CORParticle.o: /usr/include/math.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/huge_val.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/mathdef.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/include/bits/mathcalls.h
+../../Detector/include-CORSIKA/CORParticle.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.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/features.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/cdefs.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/gnu/stubs.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.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/bits/types.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/time.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/endian.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/endian.h
 ../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/select.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/select.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/sigset.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/sys/sysmacros.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/alloca.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
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/huge_val.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/mathdef.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/include/bits/mathcalls.h
+../../Detector/include-CORSIKA/CORStatfile.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
+MSimone.o: MSimone.hxx /usr/include/stdlib.h /usr/include/features.h
+MSimone.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+MSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+MSimone.o: /usr/include/sys/types.h /usr/include/bits/types.h
+MSimone.o: /usr/include/time.h /usr/include/endian.h
+MSimone.o: /usr/include/bits/endian.h /usr/include/sys/select.h
+MSimone.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
+MSimone.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
+MSimone.o: /usr/include/stdio.h
+MSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+MSimone.o: /usr/include/libio.h /usr/include/_G_config.h
+MSimone.o: /usr/include/bits/stdio_lim.h /usr/include/string.h
+MSimone.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
+MSimone.o: /usr/include/bits/confname.h /usr/include/getopt.h
+MSimone.o: /usr/include/fcntl.h /usr/include/bits/fcntl.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
+MSimone.o: /usr/include/math.h /usr/include/bits/huge_val.h
+MSimone.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h
+MSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
+simone.o: /usr/include/stdlib.h /usr/include/features.h
+simone.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+simone.o: /usr/include/sys/types.h /usr/include/bits/types.h
+simone.o: /usr/include/time.h /usr/include/endian.h
+simone.o: /usr/include/bits/endian.h /usr/include/sys/select.h
+simone.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
+simone.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
 simone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
-simone.o: /usr/include/math.h ../../Detector/include-CORSIKA/CORParticle.hxx
+simone.o: /usr/include/math.h /usr/include/bits/huge_val.h
+simone.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h
+simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
+simone.o: ../../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
+simone.o: /usr/include/stdio.h
+simone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+simone.o: /usr/include/libio.h /usr/include/_G_config.h
+simone.o: /usr/include/bits/stdio_lim.h /usr/include/string.h
+simone.o: /usr/include/unistd.h /usr/include/bits/posix_opt.h
+simone.o: /usr/include/bits/confname.h /usr/include/getopt.h
+simone.o: /usr/include/fcntl.h /usr/include/bits/fcntl.h
Index: trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.linux-gnu
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.linux-gnu	(revision 405)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/config.mk.linux-gnu	(revision 415)
@@ -18,7 +18,7 @@
 #---------------------------------------------------------------
 # $RCSfile: config.mk.linux-gnu,v $
-# $Revision: 1.1.1.1 $
+# $Revision: 1.2 $
 # $Author: harald $ 
-# $Date: 1999-11-18 09:39:14 $
+# $Date: 2000-07-06 10:24:00 $
 ##################################################################
 # @maintitle
@@ -52,8 +52,5 @@
 
 
-ROOTLIBS      = -L$(ROOTSYS)/lib -lNew -lBase -lCint -lClib \
-                -lCont -lFunc -lGraf -lGraf3d -lHist -lHtml \
-                -lMatrix -lMeta -lMinuit -lNet -lPostscript \
-                -lProof -lTree -lUnix -lZip -lRint
+ROOTLIBS      = -L/cern/root/lib -lNew -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lm -ldl -lpthread -rdynamic 
 
 ROOTGLIBS     = -lGpad -lGui -lGX11 -lX3d -lX11
Index: trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx	(revision 405)
+++ trunk/MagicSoft/Simulation/Corsika/Simone/simone.cxx	(revision 415)
@@ -7,4 +7,13 @@
 #include <stdlib.h>
 #include "TROOT.h"
+#include "TApplication.h"
+
+#include "TCanvas.h"
+#include "TView.h"
+
+#include "TSPHE.h"
+#include "TBRIK.h"
+
+#include "TNode.h"
 
 #include "TFile.h"
@@ -17,131 +26,141 @@
 #include "MSimone.hxx"
 
-main() 
-  {
-    // initialise ROOT
+int main(int argc, char **argv)
+{
+  // initialise ROOT
 
-    TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
-              
-    //    char  path[100] = "/hd61/Maggi/Data/mcMAGIC-1-30:30000-1" ; 
-    char  path[100] = "/hd02/Maggi/Data/prot_15/" ; 
-    //    char  path[100] = "/data/mmcs/" ; 
-    char  cername[120] ; 
-    char  datname[120] ; 
+  TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
 
-    ifstream   cerfile ; 
+  TApplication theApp("App", &argc, argv);
+  
+  char  path[100] = "/dat1/Mmcs/Gamm/" ; 
+  //    char  path[100] = "/hd02/Maggi/Data/prot_15/" ; 
+  //    char  path[100] = "/data/mmcs/" ; 
+  char  cername[120] ; 
+  char  datname[120] ; 
+  
+  ifstream   cerfile ; 
+  
+  COREventHeader Event ;   
+  CORParticle    Photon ; 
+  
+  MSimone    Infos ; 
+    
+  Int_t iPhotonInShower ; 
+  
+  Float_t lambda ; 
+  
+  cout << " SImulated MONte carlo Events" << endl ; 
 
-    COREventHeader Event ;   
-    CORParticle    Photon ; 
+  //
+  //    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",
+			      "fPartId:fEnergy:fTheta:fPhi:fCoreX:fCoreY:fCoreD:fNumCerPhot");
+  
+  
+  for (int i_cer = 1; i_cer <= 100; i_cer++ ) {
+    //
+    //   info of progress
+    //
+    if (!( i_cer %10) )
+      {
+	cout << i_cer << endl ; 
+      }
 
-    MSimone    Infos ; 
+    //
+    //   create the file names 
+    //
+    sprintf ( cername, "%s/cer%06d", path, i_cer ) ; 
+    sprintf ( datname, "%s/dat%06d", path, i_cer ) ; 
     
-    Int_t iPhotonInShower ; 
+    //      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 ) ; 
+    
+    //
+    //   loop over the particles (cerenkov photons) in 
+    //   the file 
+    //
+    
+    iPhotonInShower = 0 ; 
+    
+    while( ! (cerfile.eof() || cerfile.bad() )) {
+      
+      //
+      //   read in the particles
+      //
+      
+      Photon.read ( cerfile ) ; 
+      
+      //
+      //   only if the wavelength lambda is greater than 
+      //   1.0 it is a real cerenkov photon 
+      //
+      lambda = Photon.get_wl() ; 
+      
+      if ( lambda < 1.0 ) 
+	break ; 
+      
+      iPhotonInShower++ ; 
+      
+      //Photon.print() ; 
+    }
+    
+    Infos.SetNumCerPhot( iPhotonInShower ) ; 
+    
+    //
+    //   fill the ntuple
+    //
+    
+    Infos.NtupFill ( Ntup ) ; 
+    
+    
+    cerfile.close();
+    
+    
+    
+  } 
+  
+  
+  //
+  //   write all to file
+  //
+  outfile->Write() ; 
 
-    Float_t lambda ; 
-    //
-    //    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",
-			       "fPartId:fEnergy:fTheta:fPhi");
+  Ntup->Draw("fEnergy") ; 
 
 
-    for (int i_cer = 1; i_cer <= 100; i_cer++ ) {
-
-      //
-      //   info of progress
-      //
-      if (!( i_cer %10) )
-	{
-	  cout << i_cer << endl ; 
-	}
-
-      //
-      //   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 ) ; 
-
-      //
-      //   fill the ntuple
-      //
-      Infos.NtupFill ( Ntup ) ; 
- 
-      //
-      //   loop over the particles (cerenkov photons) in 
-      //   the file 
-      //
-
-      iPhotonInShower = 0 ; 
-      
-      while( ! (cerfile.eof() || cerfile.bad() )) {
-	
-	//
-	//   read in the particles
-	//
-
-	Photon.read ( cerfile ) ; 
-	
-	//
-	//   only if the wavelength lambda is greater than 
-	//   1.0 it is a real cerenkov photon 
-	//
-	lambda = Photon.get_wl() ; 
-
-	if ( lambda < 1.0 ) 
-	  break ; 
-
-	iPhotonInShower++ ; 
-
-	Photon.print() ; 
-
-      }
-
-      cout << iPhotonInShower << endl ;       
+  theApp.Run();
+  return 0;                            
+   
+  
+}
 
 
-
-      cerfile.close();
-      
-
-
-    } 
-    
-
-    //
-    //   write all to file
-    //
-    outfile->Write() ; 
-
-
-    //
-    //
-    //
-    
-  }
-
-
