Index: trunk/MagicSoft/Simulation/Detector/include-CORSIKA/COREventEnd.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-CORSIKA/COREventEnd.cxx	(revision 791)
+++ trunk/MagicSoft/Simulation/Detector/include-CORSIKA/COREventEnd.cxx	(revision 791)
@@ -0,0 +1,31 @@
+/////////////////////////////////////////////////////////////////
+//
+// COREventEnd
+//
+//  Created: Thu May 10 15:32:13 2001
+//  Author:  Carles Domingo
+//  Purpose: Base class for RunHeader-classes
+//  Notes:   
+//
+/////////////////////////////////////////////////////////////////
+
+// @T \newpage
+
+// @section Source code of {\tt COREventEnd.cxx}
+
+// @subsection Class {\em COREventEnd}: Implementation
+
+// @code
+
+#include "COREventEnd.hxx"
+
+void 
+COREventEnd::print(void) {
+
+  cout << "  EVTE           :" << (char*)EVTE << endl;
+  cout << "  EvtNumber      :" << EvtNumber << endl;
+
+  cout << flush;
+}
+
+// @endcode
Index: trunk/MagicSoft/Simulation/Detector/include-CORSIKA/COREventEnd.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-CORSIKA/COREventEnd.hxx	(revision 791)
+++ trunk/MagicSoft/Simulation/Detector/include-CORSIKA/COREventEnd.hxx	(revision 791)
@@ -0,0 +1,94 @@
+/////////////////////////////////////////////////////////////////
+//
+// COREventEnd
+//
+//  Created: Tue Apr 28 16:27:14 1998
+//  Author:  Jose Carlos Gonzales
+//  Purpose: Base class for EventEnd-classes
+//  Notes:   
+//
+/////////////////////////////////////////////////////////////////
+
+// @T \newpage
+
+// @section Source code of {\tt COREventEnd.hxx}
+
+/* @text
+This section shows the include file {\tt COREventEnd.hxx}
+@endtext */
+
+#ifndef COREventEnd_Class
+#define COREventEnd_Class
+
+// @subsection Include files
+
+// @code
+#ifdef __ROOT__
+#include "TROOT.h"
+#include "TObject.h"
+#else // not __ROOT__
+#include "Rtypes.h"
+#endif
+
+#include <iostream.h>
+#include <iomanip.h>
+#include <fstream.h>
+#include <stdlib.h>
+#include <math.h>
+
+// @endcode
+
+// @subsection Class {\em COREventEnd}: Definition
+
+// @code
+class COREventEnd {
+
+public:
+
+  char         EVTE[4];
+  Float_t      EvtNumber;
+
+  Float_t      dmmy[271];
+  
+public:
+  COREventEnd(void) {}  // default constructor
+
+  virtual ~COREventEnd(void) {}  // default destructor
+  
+  // reads EventEnd from binary input stream
+  Int_t read ( ifstream &is ) {
+    is.read ( (char *)this, sizeof( float ) * 273 ); 
+    return is.gcount();
+  }
+
+  // writes EventEnd to binary output stream
+  Int_t write ( ofstream &os ) {
+    os.write ( (char *)this, sizeof( float ) * 273 ); 
+    return 0;
+  }
+  
+  // get information about the EventEnd
+
+  // print-out of the EVTE
+  void print(void);
+  
+  // get the event number
+  inline Float_t get_eventnumber ( void ) { return (EvtNumber); }
+
+  // fill Event end
+  inline void fill ( Float_t theEvtNumber ) {
+           
+      strcpy(EVTE,"EVTE");
+      EvtNumber = theEvtNumber;
+      
+      for (Int_t i=0; i<271; i++){
+        dmmy[i]=0.;
+      }
+      
+    return; 
+  }
+
+};
+// @endcode
+
+#endif  // not defined COREventEnd_Class
Index: trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunEnd.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunEnd.cxx	(revision 791)
+++ trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunEnd.cxx	(revision 791)
@@ -0,0 +1,35 @@
+/////////////////////////////////////////////////////////////////
+//
+// CORRunEnd
+//
+//  Created: Thu May 15 15:32:13 2001
+//  Author:  Carles Domingo
+//  Purpose: Base class for RunEnd-classes
+//  Notes:   
+//
+/////////////////////////////////////////////////////////////////
+
+// @T \newpage
+
+// @section Source code of {\tt CORRunEnd.cxx}
+
+// @subsection Class {\em CORRunEnd}: Implementation
+
+// @code
+
+#include "CORRunEnd.hxx"
+
+void 
+CORRunEnd::print(void) {
+
+  cout << "  RUNE           :" << (char*)RUNE << endl;
+  cout << "  RunNumber      :" << RunNumber << endl;
+  cout << "  NumEvts        :" << NumEvts << endl;
+
+  cout << flush;
+}
+
+// @endcode
+
+
+
Index: trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunEnd.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunEnd.hxx	(revision 791)
+++ trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunEnd.hxx	(revision 791)
@@ -0,0 +1,101 @@
+/////////////////////////////////////////////////////////////////
+//
+// CORRunEnd
+//
+//  Created: Tue May 15 2001
+//  Author:  Carles Domingo
+//  Purpose: Base class for RunEnd-classes
+//  Notes:   
+//
+/////////////////////////////////////////////////////////////////
+
+// @T \newpage
+
+// @section Source code of {\tt CORRunEnd.hxx}
+
+/* @text
+This section shows the include file {\tt CORRunEnd.hxx}
+@endtext */
+
+#ifndef CORRunEnd_Class
+#define CORRunEnd_Class
+
+// @subsection Include files
+
+// @code
+#ifdef __ROOT__
+#include "TROOT.h"
+#include "TObject.h"
+#else // not __ROOT__
+#include "Rtypes.h"
+#endif
+
+#include <iostream.h>
+#include <iomanip.h>
+#include <fstream.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "COREventHeader.hxx"
+
+// @endcode
+
+// @subsection Class {\em CORRunEnd}: Definition
+
+// @code
+class CORRunEnd {
+
+public:
+
+  char         RUNE[4];
+  Float_t      RunNumber;
+  Float_t      NumEvts;
+
+  Float_t      dmmy[270];
+  
+public:
+  CORRunEnd(void) {}  // default constructor
+
+  virtual ~CORRunEnd(void) {}  // default destructor
+  
+  // reads RunEnd from binary input stream
+  Int_t read ( ifstream &is ) {
+    is.read ( (char *)this, sizeof( float ) * 273 ); 
+    return is.gcount();
+  }
+
+  // writes RunEnd to binary output stream
+  Int_t write ( ofstream &os ) {
+    os.write ( (char *)this, sizeof( float ) * 273 ); 
+    return 0;
+  }
+  
+  // get information about the RunEnd
+
+  // print-out of the RUNE
+  void print(void);
+  
+  // get the run number
+  inline Float_t get_runnumber ( void ) { return (RunNumber); }
+
+  // get the number of events
+  inline Float_t get_numberevents ( void ) { return ( NumEvts ); }
+
+  // fill Run Header
+  inline void fill ( Float_t theRunNumber,
+		     Float_t theNumEvts) {
+           
+      strcpy(RUNE,"RUNE");
+      RunNumber = theRunNumber;
+      NumEvts = theNumEvts;
+      
+      for (Int_t i=0; i<270; i++){
+        dmmy[i]=0.;
+      }
+    return; 
+  }
+
+};
+// @endcode
+
+#endif  // not defined CORRunEnd_Class
Index: trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunHeader.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunHeader.cxx	(revision 791)
+++ trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunHeader.cxx	(revision 791)
@@ -0,0 +1,130 @@
+/////////////////////////////////////////////////////////////////
+//
+// CORRunHeader
+//
+//  Created: Thu May 10 15:32:13 2001
+//  Author:  Carles Domingo
+//  Purpose: Base class for RunHeader-classes
+//  Notes:   
+//
+/////////////////////////////////////////////////////////////////
+
+// @T \newpage
+
+// @section Source code of {\tt CORRunHeader.cxx}
+
+// @subsection Class {\em CORRunHeader}: Implementation
+
+// @code
+
+#include "CORRunHeader.hxx"
+
+void 
+CORRunHeader::reset(void) {
+
+  RunNumber = 0.;
+  DateRun = 0.;
+  VersionPGM = 0.;
+
+  NumObsLev = 0.;
+
+  SlopeSpec = 0.; 
+  ELowLim = 0.;   
+  EUppLim = 0.;   
+
+  EGS4yn = 0.;
+  NKGyn = 0.;
+
+  Ecutoffh = 0.;  
+  Ecutoffm = 0.;  
+  Ecutoffe = 0.;  
+  Ecutoffg = 0.;  
+
+  NFLAIN = 0.;
+  NFLDIF = 0.;
+  NFLPI0_PIF = 0.;
+  NFLCHE_AGM = 0.;
+
+  for (Int_t i=0; i<5; i++ ){
+    AATM[i]=0.;
+    BATM[i]=0.;
+    CATM[i]=0.;
+    CETA[i]=0.;
+  }
+  for (Int_t i=0; i<10; i++){
+    HeightLev[i]=0.;
+  }
+  for (Int_t i=0; i<11; i++){
+    CSTRBA[i]=0.;
+  }
+  for (Int_t i=0; i<20; i++){
+    dmmy1[i]=0.;
+  }  
+  for (Int_t i=0; i<40; i++){
+    CKA[i]=0.;
+  }
+  for (Int_t i=0; i<50; i++){
+    C[i]=0.;
+  }
+  for (Int_t i=0; i<104; i++){
+    dmmy2[i]=0.;
+  }
+}
+
+void 
+CORRunHeader::print(void) {
+
+  cout << "  RUNH           :" << (char*)RUNH << endl;
+  cout << "  RunNumber      :" << RunNumber << endl;
+  cout << "  DateRun        :" << DateRun << endl;
+  cout << "  VersionPGM     :" << VersionPGM << endl;
+
+  cout << "  NumObsLev      :" << NumObsLev << endl;
+  cout << "  HeightLev[0]   :" << HeightLev[0]  << endl;
+                                
+  cout << "  SlopeSpec      :" << SlopeSpec << endl;
+  cout << "  ELowLim        :" << ELowLim    << endl;
+  cout << "  EUppLim        :" << EUppLim    << endl;
+                                
+  cout << "  EGS4yn         :" << EGS4yn << endl;
+  cout << "  NKGyn          :" << NKGyn << endl;
+                                
+  cout << "  Ecutoffh       :" << Ecutoffh   << endl;
+  cout << "  Ecutoffm       :" << Ecutoffm   << endl;
+  cout << "  Ecutoffe       :" << Ecutoffe   << endl;
+  cout << "  Ecutoffg       :" << Ecutoffg   << endl;
+                                
+  cout << "  NFLPI0_PIF     :" << NFLPI0_PIF << endl;
+  cout << "  NFLCHE_AGM     :" << NFLCHE_AGM << endl;
+
+  cout << flush;
+}
+
+void CORRunHeader::transport( COREventHeader *e )
+{
+  CORRunHeader::reset () ;
+  strcpy (RUNH,"RUNH");
+  RunNumber      = e->RunNumber;
+  DateRun        = e->DateRun;
+  VersionPGM     = e->VersionPGM;
+  NumObsLev      = e->NumObsLev;
+  
+  memcpy( HeightLev, e->HeightLev, 10*sizeof(Float_t) );
+      
+  SlopeSpec      = e->SlopeSpec;
+  ELowLim        = e->ELowLim;
+  EUppLim        = e->EUppLim;
+  EGS4yn         = e->EGS4yn;
+  NKGyn          = e->NKGyn;
+  Ecutoffh       = e->Ecutoffh;  
+  Ecutoffm       = e->Ecutoffm;  
+  Ecutoffe       = e->Ecutoffe;  
+  Ecutoffg       = e->Ecutoffg;
+  
+  NFLAIN         = e->NFLAIN;
+  NFLDIF         = e->NFLDIF;
+  NFLPI0_PIF     = (e->NFLPI0) + 100*(e->NFLPIF)  ;
+  NFLCHE_AGM     = (e->NFLCHE) + 100*(e->NFRAGM)  ;
+}
+
+// @endcode
Index: trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunHeader.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunHeader.hxx	(revision 791)
+++ trunk/MagicSoft/Simulation/Detector/include-CORSIKA/CORRunHeader.hxx	(revision 791)
@@ -0,0 +1,180 @@
+/////////////////////////////////////////////////////////////////
+//
+// CORRunHeader
+//
+//  Created: Tue Apr 15 16:27:14 2001
+//  Author:  Carles Domingo
+//  Purpose: Base class for RunHeader-classes
+//  Notes:   
+//
+/////////////////////////////////////////////////////////////////
+
+// @T \newpage
+
+// @section Source code of {\tt CORRunHeader.hxx}
+
+/* @text
+This section shows the include file {\tt CORRunHeader.hxx}
+@endtext */
+
+#ifndef CORRunHeader_Class
+#define CORRunHeader_Class
+
+// @subsection Include files
+
+// @code
+#ifdef __ROOT__
+#include "TROOT.h"
+#include "TObject.h"
+#else // not __ROOT__
+#include "Rtypes.h"
+#endif
+
+#include <iostream.h>
+#include <iomanip.h>
+#include <fstream.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "COREventHeader.hxx"
+
+// @endcode
+
+// @subsection Class {\em CORRunHeader}: Definition
+
+// @code
+class CORRunHeader {
+
+public:
+
+  char         RUNH[4];
+  Float_t      RunNumber;
+  Float_t      DateRun;
+  Float_t      VersionPGM;
+
+  Float_t      NumObsLev;
+  Float_t      HeightLev[10]; 
+
+  Float_t      SlopeSpec;
+  Float_t      ELowLim;   
+  Float_t      EUppLim;   
+
+  Float_t      EGS4yn;
+  Float_t      NKGyn;
+
+  Float_t      Ecutoffh;  
+  Float_t      Ecutoffm;  
+  Float_t      Ecutoffe;  
+  Float_t      Ecutoffg;  
+
+  Float_t      C[50];
+  Float_t      dmmy1[20];
+  Float_t      CKA[40];
+  Float_t      CETA[5];
+  Float_t      CSTRBA[11];
+  Float_t      dmmy2[104];
+  Float_t      AATM[5];
+  Float_t      BATM[5];
+  Float_t      CATM[5];
+  Float_t      NFLAIN;
+  Float_t      NFLDIF;
+  Float_t      NFLPI0_PIF;
+  Float_t      NFLCHE_AGM;
+  
+public:
+  CORRunHeader(void) {}  // default constructor
+
+  virtual ~CORRunHeader(void) {}  // default destructor
+  
+  // reads RunHeader from binary input stream
+  Int_t read ( ifstream &is ) {
+    is.read ( (char *)this, sizeof( float ) * 273 ); 
+    return is.gcount();
+  }
+
+  // writes RunHeader to binary output stream
+  Int_t write ( ofstream &os ) {
+    os.write ( (char *)this, sizeof( float ) * 273 ); 
+    return 0;
+  }
+  
+  // get information about the RunHeader
+
+  // print-out of the RUNH
+  void print(void);
+  
+  // get the run number
+  inline Float_t get_number ( void ) { return (RunNumber); }
+
+  // get the spectrum slope
+  inline Float_t get_slope ( void ) { return ( SlopeSpec ); }
+
+  // get the energy range of this run
+  inline void get_energy_range ( Float_t *elow, Float_t *eup ) { 
+    *elow = ELowLim;   
+    *eup = EUppLim;
+  }
+
+  // fill Run Header
+  inline void fill ( Float_t theRunNumber,
+             Float_t theDateRun,
+             Float_t theVersionPGM,             
+             Float_t theNumObsLev,
+             Float_t theHeightLev1,
+             Float_t theHeightLev2,
+             Float_t theHeightLev3,
+             Float_t theHeightLev4,
+             Float_t theHeightLev5,                                     
+             Float_t theHeightLev6,
+             Float_t theHeightLev7,                         
+             Float_t theHeightLev8,             
+             Float_t theHeightLev9,             
+             Float_t theHeightLev10,             
+             Float_t theSlopeSpec,
+             Float_t theELowLim,   
+             Float_t theEUppLim,   
+             Float_t theEGS4yn,
+             Float_t theNKGyn,
+             Float_t theEcutoffh,  
+             Float_t theEcutoffm,  
+             Float_t theEcutoffe,  
+             Float_t theEcutoffg) {  
+             
+      strcpy(RUNH,"RUNH");
+      RunNumber = theRunNumber;
+      DateRun = theDateRun;
+      VersionPGM = theVersionPGM;
+      NumObsLev = theNumObsLev;
+      HeightLev[0] = theHeightLev1; 
+      HeightLev[1] = theHeightLev2; 
+      HeightLev[2] = theHeightLev3; 
+      HeightLev[3] = theHeightLev4; 
+      HeightLev[4] = theHeightLev5; 
+      HeightLev[5] = theHeightLev6; 
+      HeightLev[6] = theHeightLev7; 
+      HeightLev[7] = theHeightLev8; 
+      HeightLev[8] = theHeightLev9; 
+      HeightLev[9] = theHeightLev10; 
+      SlopeSpec = theSlopeSpec;
+      ELowLim = theELowLim;   
+      EUppLim = theEUppLim;   
+      EGS4yn = theEGS4yn;
+      NKGyn = theNKGyn;
+      Ecutoffh = theEcutoffh;  
+      Ecutoffm = theEcutoffm;  
+      Ecutoffe = theEcutoffe;  
+      Ecutoffg = theEcutoffg;  
+
+    return; 
+  }
+
+  // transport from COREventHeader to CORRunHeader
+  void transport ( COREventHeader *e );
+
+  // Reset CORRunHeader
+  void reset ( void );
+
+};
+// @endcode
+
+#endif  // not defined CORRunHeader_Class
