Index: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MSimone.cxx
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MSimone.cxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MSimone.cxx	(revision 4308)
@@ -0,0 +1,109 @@
+#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. ;
+
+  NumCerPhot = 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.  ; 
+
+  NumCerPhot = 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;
+  
+  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,CoreX, CoreY, CoreD, NumCerPhot ) ; 
+}
+
+
+
+
+
+
+
Index: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MSimone.hxx
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MSimone.hxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MSimone.hxx	(revision 4308)
@@ -0,0 +1,52 @@
+#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
+
+  Float_t  NumCerPhot ;  // Number of Cerenkov photons in shower
+  
+ public:
+  MSimone() ;         
+  
+  ~MSimone(); 
+
+  void Clear();
+
+  void Print(void);
+
+  void Transfer ( COREventHeader *e );
+
+  void NtupFill ( TNtuple *n ) ; 
+
+  void SetNumCerPhot( Int_t iN ) ; 
+
+  //  ClassDef(MSimone, 1)   //Stores Montecarlo Information 
+
+};
+
+#endif
Index: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.cxx
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.cxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.cxx	(revision 4308)
@@ -0,0 +1,636 @@
+//
+//
+//
+#define  START_DIRECTORY  "/dat1"
+#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
+
+#include <TApplication.h>
+#include <TGMsgBox.h>
+
+#include "MainFrameSimone.hxx"
+
+
+
+MainFrameSimone::MainFrameSimone(const TGWindow *p, UInt_t w, UInt_t h)
+    : TGMainFrame(p, w, h)
+{
+  sprintf (fInputPath, "\0" ) ; 
+  fNumEvents = 0 ; 
+  
+  fNtup = new TNtuple ("fNtup", "Ntuple with Run distributions", 
+		       "PartID:Energy:CoreX:CoreY") ; 
+  //
+  // Create a main frame with a number of different buttons.
+  //
+
+  //
+  // First create the MenuBar. 
+  //
+
+  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX,
+				    2, 2, 2, 2 ) ; 
+  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft ,
+				     0, 4, 0, 0 ) ; 
+
+  
+  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
+  fFileMenu->AddEntry ("Exit", M_FILE_EXIT ) ; 
+
+  //
+  //  the button messages are handled by main frame (this) 
+  //
+  fFileMenu->Associate(this) ; 
+
+
+  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
+  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ; 
+  
+  AddFrame(fMenuBar, fLayMenuBar ) ; 
+
+
+  //
+  // create the Tab 
+  //
+
+  fFrame = new TGCompositeFrame (this, 300,300, kHorizontalFrame ) ; 
+  
+  fLayTab = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX  , 5, 5, 5, 5 ) ; 
+  fTab = new TGTab ( fFrame, 400, 400 ) ; 
+  
+  TGCompositeFrame *tf = fTab->AddTab("Input") ; 
+  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+
+  tf->AddFrame(fTabF1, fLayTab ) ; 
+
+  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fTabF1b = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
+  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+
+  fDir = new TGListBox(fTabF1, -1) ; 
+  fDir->Resize(350,20) ; 
+  char temp[100] ; 
+  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
+  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
+  fDir->AddEntry(temp, 1) ; 
+  fTabF1->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+
+  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
+  fCdup = new TGPictureButton(fTabF1, fPicCdup, M_CDIR_UP ) ; 
+  fCdup->SetToolTipText("One Level up!") ; 
+  fCdup->Associate(this) ; 
+  fTabF1->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fPicList = fClient->GetPicture("tb_list.xpm") ; 
+  fListMode = new TGPictureButton(fTabF1, fPicList, M_LIST_MODE ) ; 
+  fListMode->SetToolTipText("List Mode") ; 
+  fListMode->Associate(this) ; 
+  fListMode->SetState(kButtonUp) ; 
+  fListMode->AllowStayDown(kTRUE) ; 
+  fTabF1->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
+  fDetail = new TGPictureButton(fTabF1, fPicDetail, M_DETAIL_MODE ) ; 
+  fDetail->SetToolTipText("Details Mode") ; 
+  fDetail->Associate(this) ; 
+  fDetail->SetState(kButtonEngaged) ; 
+  fDetail->AllowStayDown(kTRUE) ; 
+  fTabF1->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  
+  fSelectButton = new TGTextButton(fTabF1b, "Select", M_BUTTON_SELECT );
+  fSelectButton->SetToolTipText("To select a path with Mmcs data files!");
+  fSelectButton->SetState(kButtonDisabled); 
+  fSelectButton->Associate(this) ; 
+
+  fTabF1b->AddFrame(fSelectButton,
+		    new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 5, 5) ) ; 
+  
+  fFileView = new TGListView(fTabF1b, 540, 380 ) ; 
+  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
+				  kVerticalFrame, fgWhitePixel) ; 
+
+  fFileCont->Associate(this) ; 
+  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
+  fFileView->SetContainer(fFileCont) ; 
+  fFileCont->SetFilter("*") ; 
+  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
+  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
+  fFileView->SetViewMode(kLVDetails); 
+  fFileCont->Sort(kSortByName) ; 
+  
+  fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5) ) ; 
+
+  //
+  //  create Tab 2 
+  //
+
+  tf = fTab->AddTab("Run Dist") ; 
+  fTabF2 = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
+  
+  tf->AddFrame(fTabF2,  new TGLayoutHints(kLHintsTop | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5)) ; 
+
+  //  create the vertical subframes
+
+  fTabF2a = new TGCompositeFrame (fTabF2, 100, 100, kHorizontalFrame) ; 
+  fTabF2->AddFrame(fTabF2a, fLayTab ) ; 
+
+  fTabF2b = new TGCompositeFrame (fTabF2, 300, 300, kHorizontalFrame) ; 
+  fTabF2->AddFrame(fTabF2b, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX |kLHintsExpandY, 5, 5, 5, 5 ) ) ; 
+
+  fTabF2c = new TGCompositeFrame (fTabF2, 100, 100, kHorizontalFrame) ; 
+  fTabF2->AddFrame(fTabF2c,new TGLayoutHints(kLHintsBottom | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 )  ) ; 
+
+  //  create the entries in first subframe
+
+  fLabelInput = new TGLabel(fTabF2a, new TGString("Title:") );       
+  fTabF2a->AddFrame( fLabelInput, new TGLayoutHints(kLHintsTop | kLHintsLeft , 5, 5, 5, 5 ) ) ;   
+
+  fDir2 = new TGListBox(fTabF2a, -1) ; 
+  fDir2->Resize(350,20) ; 
+  sprintf ( temp, "%s", fInputPath ) ; 
+  fDir2->AddEntry(temp, 1) ; 
+  fTabF2a->AddFrame( fDir2, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5 ) ) ; 
+  
+  fLabelNumEvts = new TGLabel(fTabF2a, new TGString("Number of Events:") );       
+  fTabF2a->AddFrame( fLabelNumEvts, new TGLayoutHints(kLHintsTop | kLHintsLeft , 5, 5, 5, 5 ) ) ;   
+  
+  fDirNum = new TGListBox(fTabF2a, -1) ; 
+  fDirNum->Resize(50,20) ; 
+  fTabF2a->AddFrame( fDirNum, 
+		     new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5 ) ) ;
+
+  fButtonPlot = new TGTextButton(fTabF2a, "PLOT", M_BUTTON_PLOT );
+  fButtonPlot->Associate(this) ;   
+  fTabF2a->AddFrame (fButtonPlot, new TGLayoutHints(kLHintsTop | kLHintsLeft, 50, 50, 5, 5) );
+
+  //  create the entries in the second subframe
+  
+  fCanvasRun = new TRootEmbeddedCanvas("fCanvasRun", fTabF2b, 300, 300 ) ; 
+  fTabF2b->AddFrame(fCanvasRun, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  //  create the entries in the second subframe
+
+  fButtonPartID = new TGTextButton(fTabF2c, "PartId", M_BUTTON_PARTID );
+  fButtonPartID->Associate(this) ;
+  fTabF2c->AddFrame (fButtonPartID, new TGLayoutHints(kLHintsBottom | kLHintsLeft, 2, 2, 2, 2) );
+
+  fButtonEnergy = new TGTextButton(fTabF2c, "Energy", M_BUTTON_ENERGY );
+  fButtonEnergy->Associate(this) ;
+  fTabF2c->AddFrame (fButtonEnergy, new TGLayoutHints(kLHintsBottom | kLHintsLeft, 2, 2, 2, 2) );
+
+  fButtonCore = new TGTextButton(fTabF2c, "CoreX", M_BUTTON_CORE );
+  fButtonCore->Associate(this) ;
+  fTabF2c->AddFrame (fButtonCore, new TGLayoutHints(kLHintsBottom | kLHintsLeft, 2, 2, 2, 2) );
+
+  //
+  //  create Tab 3 
+  //
+
+  tf = fTab->AddTab("Control") ; 
+  fTabF3 = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
+  
+  
+  fButton1 = new TGTextButton(fTabF3, "&Exit", M_CTRL_EXIT);
+  fButton2 = new TGTextButton(fTabF3, "Working Directory", M_CTRL_PWD);
+  fButton3 = new TGTextButton(fTabF3, "Input Path", M_CTRL_PATH);
+
+  fButton1->Associate(this) ; 
+  fButton2->Associate(this) ; 
+  fButton3->Associate(this) ; 
+  
+  fLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 10, 10);
+  
+  fTabF3->AddFrame (fButton1, fLayout ) ; 
+  fTabF3->AddFrame (fButton2, fLayout ) ; 
+  fTabF3->AddFrame (fButton3, fLayout ) ; 
+  
+  tf->AddFrame(fTabF3, fLayTab) ; 
+
+  fFrame->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
+
+  AddFrame(fFrame, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
+
+
+
+  //
+  //
+  //
+
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("MainSimone");
+  SetIconName("MainSimone");
+  
+  MapWindow();
+}
+ 
+// ======================================================================
+// ======================================================================
+
+MainFrameSimone::~MainFrameSimone() {
+  
+  delete fButton1 ; 
+  delete fButton2 ; 
+  delete fFrame, fTab, fTabF1, fTabF2, fTabF3 ; 
+  delete fTabF1a, fTabF1b ; 
+  delete fDir, fCdup, fListMode, fDetail ; 
+  delete fFileCont, fFileView ;
+  delete fFileMenu, fMenuBar; 
+  delete fLayout, fLayMenuBar, fLayMenuItem, fLayTab ; 
+ 
+  delete  fPicCdup, fPicList, fPicDetail ; 
+  
+}
+
+// ======================================================================
+// ======================================================================
+ 
+void MainFrameSimone::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+   TGMainFrame::CloseWindow();
+   gROOT->GetApplication()->Terminate(0)  ; 
+
+}
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MainFrameSimone::CerFileExist(Char_t *dir)
+{
+  Char_t testfile[110] ;
+  FILE *unit ; 
+  
+  sprintf (testfile, "%s/%s/cer000001", 
+	    	     gSystem->WorkingDirectory(), dir  ) ; 
+  //
+  //   try to open the testfile
+  //
+
+  if ( (unit = fopen (testfile, "r" )) == 0 ) {
+    //
+    //  doesn't exist --> kFALSE
+     return (kFALSE) ; 
+  }
+  else {
+    fclose ( unit ) ; 
+    
+    return ( kTRUE ) ; 
+  }
+  
+  return (kFALSE) ; 
+}
+
+// ======================================================================
+// ======================================================================        
+Bool_t MainFrameSimone::CheckNtup()
+{
+  if ( ! strcmp( fInputPath, "\0")  ) {
+    printf ("No InputPath specified!! Do this before!!\n") ; 
+    return (kFALSE) ;
+  }
+  
+
+  if ( ! strcmp ( fInputPath, fNtupPath ) ) {
+    return (kTRUE) ; 
+  }
+  else {
+    
+    if ( ReadDataToNtup() ) {
+      return (kTRUE) ; 
+    }
+  }
+      
+  return (kFALSE) ;
+}
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MainFrameSimone::ReadDataToNtup()
+{
+  Char_t  cername[256] ; 
+  Char_t  datname[256] ;
+  
+  ifstream   cerfile ; 
+  
+  COREventHeader Event ;  
+  
+  printf("readin the input path: %s \n", fInputPath ) ; 
+  
+  fNtup->Reset() ; 
+
+  for (int i_cer = 1; i_cer <= 100000; i_cer++ ) {
+  
+    //   create the file names 
+    
+    sprintf ( cername, "%s/cer%06d", fInputPath, i_cer ) ; 
+    sprintf ( datname, "%s/dat%06d", fInputPath, i_cer ) ; 
+    
+    //   try to open the files
+        
+    cerfile.open( cername );
+    
+    if ( cerfile.bad() ) { 
+
+      fNumEvents = i_cer -1 ;
+      
+      sprintf ( datname, "%d", fNumEvents ) ; 
+
+      fDirNum->RemoveEntry(1) ; 
+      fDirNum->AddEntry(datname,1) ; 	    
+      fDirNum->MapSubwindows() ; 
+      fDirNum->Layout() ;  
+      
+      break ; 
+    }
+    
+    Event.read( cerfile );
+
+    //
+    //   fill Ntuple
+    // 
+    
+    fNtup->Fill( Event.get_primary() ,
+		 Event.get_energy() , 
+		 Event.get_coreX(), 
+		 Event.get_coreY() ) ;  
+
+ 
+    cerfile.close();
+    
+  }
+
+  //
+  //    set some value of this class
+  //
+  sprintf ( fNtupPath, "%s", fInputPath) ;  
+
+  return (kTRUE) ; 
+}
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MainFrameSimone::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{
+  Int_t retval = 0 ; 
+  Char_t  wort[100] ;
+  Char_t  testfile[100] ;
+  Char_t  extens[5] ;
+  Char_t  command[110] ;
+ 
+  TGFileItem *item ;     // to process items in the file view container
+  void *np = NULL ;      // null pointer
+
+  TCanvas *canvas =  fCanvasRun->GetCanvas();   
+ 
+  // Process events generated by the buttons in the frame.
+
+  switch (GET_MSG(msg)) {
+  case kC_COMMAND:
+    switch (GET_SUBMSG(msg)) {
+    case kCM_BUTTON:
+
+      switch (parm1) {
+      case M_CDIR_UP :
+	sprintf ( fInputPath, "\0") ; 
+	fSelectButton->SetState(kButtonDisabled) ; 
+	fDir2->RemoveEntry(1) ; 
+	fDir2->AddEntry(fInputPath,1) ; 
+	fDir2->MapSubwindows() ; 
+	fDir2->Layout() ;   
+	      
+	//
+	//  goto the parent directory
+	//
+	gSystem->ChangeDirectory("..") ; 
+	fDir->RemoveEntry(1) ; 
+	sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+	fDir->AddEntry(wort,1) ; 
+	fDir->MapSubwindows() ; 
+	fDir->Layout() ; 
+	fFileCont->ChangeDirectory( wort ) ; 
+	fFileCont->DisplayDirectory() ; 
+	  
+	break ; 
+
+      case M_LIST_MODE:
+	fFileView->SetViewMode(kLVList) ; 
+	fDetail->SetState(kButtonUp) ; 
+	break ; 
+
+      case M_DETAIL_MODE:
+	fFileView->SetViewMode(kLVDetails) ; 
+	fListMode->SetState(kButtonUp) ; 
+	break ; 
+
+      case M_BUTTON_SELECT: 
+
+	if ( fFileCont->NumSelected() == 1 ) {   
+	  //
+	  //  one file selected
+	  //	  
+	  item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
+
+	  if ( S_ISDIR(item->GetType()) ) {   // file is directory
+	    
+	    sprintf (fInputPath, "%s/%s",
+		     gSystem->WorkingDirectory(), 
+		     item->GetItemName()->GetString()) ;
+
+	    fDir2->RemoveEntry(1) ; 
+	    fDir2->AddEntry(fInputPath,1) ; 	    
+	    fDir2->MapSubwindows() ; 
+	    fDir2->Layout() ;   
+	      
+	  }
+	}
+	break;
+
+      case M_BUTTON_PARTID: 
+	if ( CheckNtup() )  
+	  {
+	    fNtup->Draw("PartID") ; 
+	    canvas->Modified() ; 
+	    canvas->Update() ; 
+	  }
+	else  
+	  printf("No Ntuple exist!!\n"); 
+	break; 
+
+      case M_BUTTON_ENERGY: 
+	if ( CheckNtup() )  
+	  {
+	    fNtup->Draw("Energy") ; 
+	    canvas->Modified() ; 
+	    canvas->Update() ; 
+	  }
+	else  
+	  printf("No Ntuple exist!!\n"); 
+	break; 
+
+      case M_BUTTON_CORE: 
+	if ( CheckNtup() )  
+	  {
+	    fNtup->Draw("CoreY:CoreX") ; 
+	    canvas->Modified() ; 
+	    canvas->Update() ; 
+	  }
+	else  
+	  printf("No Ntuple exist!!\n"); 
+	break; 
+
+      case M_CTRL_EXIT:
+	CloseWindow() ; 
+	break; 
+
+      case M_CTRL_PWD: 
+	printf ("WorkingDirectory -> %s <- \n", gSystem->WorkingDirectory() ) ;
+	break ; 
+
+      case M_CTRL_PATH: 
+	printf ("Input Path: -> %s <- \n", fInputPath ) ;
+	break ; 
+      }
+
+      break; 
+      
+    case kCM_CHECKBUTTON:
+
+      break;
+
+    case kCM_RADIOBUTTON:
+      break;
+
+
+    case kCM_MENU: 
+      switch (parm1) {
+      case M_FILE_EXIT: 
+	CloseWindow() ;
+	break; 
+	
+      }
+      break ; 
+	 
+    default:
+      break;
+      
+    }
+
+  case kC_CONTAINER: 
+    switch (GET_SUBMSG(msg)) {
+      
+      //      case kCT_ITEMCLICK:
+      //        printf ("itemclick\n"); 
+      //        break; 
+
+      
+    case kCT_ITEMDBLCLICK: 
+      //
+      //  process the double click in the file view container
+      //
+      
+      if ( parm1 == kButton1) {
+	if ( fFileCont->NumSelected() == 1 ) {   
+	  //
+	  //  one file selected
+	  //	  
+	  item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
+
+	  if ( S_ISDIR(item->GetType()) ) {   // file is directory
+
+	    sprintf (wort, "%s", item->GetItemName()->GetString()) ;
+	    
+	    //
+	    //  check if in this directory the file cer000001 exits
+	    //  if it exists, do not open the stuff
+	    //
+
+	    if ( CerFileExist( wort ) ) {
+	      printf ("Warning: Cer files in directory\n") ; 
+	      fSelectButton->SetState(kButtonUp) ; 
+	    }  
+	    else {
+	      sprintf (fInputPath,"\0") ; 
+	      fSelectButton->SetState(kButtonDisabled) ;
+	      fDir2->RemoveEntry(1) ; 
+	      fDir2->AddEntry(fInputPath,1) ;
+	      fDir2->MapSubwindows() ; 
+	      fDir2->Layout() ;   
+	      //
+	      //  goto directory 
+	      //
+	      fFileCont->ChangeDirectory ( wort ) ; 
+	      gSystem->ChangeDirectory( wort ) ; 
+	      
+	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+	      fDir->RemoveEntry(1) ; 
+	      fDir->AddEntry( wort, 1 ) ; 
+	      fDir->MapSubwindows() ; 
+	      fDir->Layout() ; 
+	    }
+	    
+	  }
+	  else {   // item is a file
+	    sprintf (testfile, "%s", item->GetItemName()->GetString() ) ; 
+	    
+	    //
+	    //    determine the file type by extensions
+	    //
+	    
+	    for (Int_t i = 0 ; i<5; i++) 
+	      extens[i] = '\0' ; 
+	    
+	    for ( Int_t i=0; testfile[i] != '\0'; i++) {
+	      if ( testfile[i] == '.') {
+		strncpy (extens, &testfile[i+1], 4 ) ; 
+		break ; 
+	      }
+	    }
+
+	    //
+	    //     postscript file
+	    //
+	    
+	    if ( ! strcmp(extens, "ps") ) {
+	      sprintf ( command, "gv %s/%s &", 
+			gSystem->WorkingDirectory(), 
+			testfile ) ; 
+	      gSystem->Exec(command) ; 
+	      break ; 
+	    }
+	    
+		
+	    
+	      
+	  }
+	}
+      }      
+      else if ( parm1 == kButton3) {  // right mouse double click
+	printf ("huschel kButton3\n");  
+      }
+
+      break; 
+      
+    }
+    break ;
+
+     
+  default:
+    break;
+  }
+  return kTRUE;
+}
+
+
Index: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.hxx
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.hxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/MainFrameSimone.hxx	(revision 4308)
@@ -0,0 +1,101 @@
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TGClient.h>
+#include <TGButton.h>
+#include <TGMenu.h>
+#include <TGTab.h>
+#include <TGListBox.h>
+#include <TGLabel.h>
+#include <TGPicture.h>
+#include <TGFSContainer.h>
+#include <TRootEmbeddedCanvas.h>
+#include <TNtuple.h>
+#include <TCanvas.h>
+
+#include "COREventHeader.hxx"
+
+
+enum CommandIdentifiers {
+  M_FILE_EXIT ,
+
+  M_CDIR_UP,
+  M_LIST_MODE , 
+  M_DETAIL_MODE, 
+  M_BUTTON_SELECT,
+
+  M_BUTTON_PLOT, 
+  M_BUTTON_PARTID, 
+  M_BUTTON_ENERGY, 
+  M_BUTTON_CORE,
+
+
+  M_CTRL_EXIT, 
+  M_CTRL_PWD, 
+  M_CTRL_PATH 
+}; 
+
+
+class MainFrameSimone : public TGMainFrame {
+
+private:
+  Char_t            fInputPath[200] ; 
+  Int_t             fNumEvents ; 
+  Char_t            fNtupPath[200] ; 
+
+  TNtuple           *fNtup ; 
+
+  TGMenuBar         *fMenuBar ; 
+  TGPopupMenu       *fFileMenu ;
+  TGCompositeFrame  *fFrame ; 
+  TGTab             *fTab ; 
+  TGCompositeFrame  *fTabF1, *fTabF2, *fTabF3 ; 
+  TGCompositeFrame  *fTabF1a, *fTabF1b ; 
+  TGTextButton      *fSelectButton ; 
+  TGListBox         *fDir ; 
+  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
+  TGFileContainer   *fFileCont ; 
+  TGListView        *fFileView ;
+  TGCompositeFrame  *fTabF2a, *fTabF2b, *fTabF2c ; 
+  TGLabel           *fLabelInput, *fLabelNumEvts ;
+  TGListBox         *fDir2, *fDirNum ; 
+  TGTextButton      *fButtonPlot ; 
+  TRootEmbeddedCanvas    *fCanvasRun ; 
+  TGTextButton      *fButtonPartID, *fButtonEnergy, *fButtonCore ; 
+  
+  TGTextButton      *fButton1 ;
+  TGTextButton      *fButton2 ;
+  TGTextButton      *fButton3 ;
+  TGLayoutHints     *fLayout, *fLayMenuBar, *fLayMenuItem ; 
+  TGLayoutHints     *fLayTab; 
+
+  const TGPicture   *fPicCdup, *fPicList, *fPicDetail ; 
+  
+public:
+  MainFrameSimone(const TGWindow *p, UInt_t w, UInt_t h);
+  ~MainFrameSimone(); 
+  
+  void CloseWindow()  ; 
+
+
+  Bool_t CerFileExist(Char_t *dir) ; 
+  Bool_t CheckNtup() ; 
+  Bool_t ReadDataToNtup() ; 
+  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/Makefile
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/Makefile	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/Makefile	(revision 4308)
@@ -0,0 +1,256 @@
+##################################################################
+#
+# 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: 2000-07-06 10:18:48 $
+#
+##################################################################
+# @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 \
+	MainFrameSimone.cxx \
+	simone.cxx      
+
+HEADERS = \
+	COREventHeader.hxx \
+	CORParticle.hxx \
+	CORStatfile.hxx \
+	MainFrameSimone.hxx \
+	simone.h
+
+OBJS = \
+	${INCLUDE_COR}/COREventHeader.o \
+	${INCLUDE_COR}/CORParticle.o \
+	${INCLUDE_COR}/CORStatfile.o \
+	MainFrameSimone.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/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/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/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/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/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/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
+../../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
+MainFrameSimone.o: MainFrameSimone.hxx
+MainFrameSimone.o: ../../Detector/include-CORSIKA/COREventHeader.hxx
+MainFrameSimone.o: /usr/include/stdlib.h /usr/include/features.h
+MainFrameSimone.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+MainFrameSimone.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+MainFrameSimone.o: /usr/include/sys/types.h /usr/include/bits/types.h
+MainFrameSimone.o: /usr/include/time.h /usr/include/endian.h
+MainFrameSimone.o: /usr/include/bits/endian.h /usr/include/sys/select.h
+MainFrameSimone.o: /usr/include/bits/select.h /usr/include/bits/sigset.h
+MainFrameSimone.o: /usr/include/sys/sysmacros.h /usr/include/alloca.h
+MainFrameSimone.o: /usr/include/math.h /usr/include/bits/huge_val.h
+MainFrameSimone.o: /usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h
+MainFrameSimone.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: MainFrameSimone.hxx
+simone.o: ../../Detector/include-CORSIKA/COREventHeader.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
Index: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/config.mk.linux-gnu
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/config.mk.linux-gnu	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/config.mk.linux-gnu	(revision 4308)
@@ -0,0 +1,71 @@
+##################################################################
+#
+# 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: 2000-07-06 10:18:48 $
+##################################################################
+# @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/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
+
+
+GLIBS         = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/X11R6/lib \
+                -lXpm -lX11  -lm -ldl 
+
+
+RANLIBDIR = ../../Detector/lib
+CERNDIR = /CERN
+
+# system
+
+SYSTEM  = linux
+
+# @endcode
+##EOF
Index: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/config.mk.osf1
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/config.mk.osf1	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/config.mk.osf1	(revision 4308)
@@ -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: 2000-07-06 10:18:48 $
+##################################################################
+# @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: branches/start/MagicSoft/Simulation/Corsika/GuiSimone/simone.cxx
===================================================================
--- branches/start/MagicSoft/Simulation/Corsika/GuiSimone/simone.cxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Corsika/GuiSimone/simone.cxx	(revision 4308)
@@ -0,0 +1,33 @@
+//
+//
+//
+//
+//
+//
+#include <stdlib.h>
+#include "TROOT.h"
+#include "TApplication.h"
+#include <TVirtualX.h>
+
+#include <TGClient.h>   
+
+#include "MainFrameSimone.hxx"
+
+int main(int argc, char **argv)
+{
+  // initialise ROOT
+
+  TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
+
+  TApplication theApp("App", &argc, argv);
+  
+  MainFrameSimone mainWin(gClient->GetRoot(), 600, 500);     
+  
+
+  theApp.Run();
+
+
+  return 0;                              
+}
+
+
Index: branches/start/MagicSoft/Simulation/Corsika/Mmcs/main.f
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Mmcs/main.f	(revision 353)
+++ branches/start/MagicSoft/Simulation/Corsika/Mmcs/main.f	(revision 4308)
@@ -11,6 +11,4 @@
 C  PERFORMS PRINTING OF TABLES AT END OF SHOWER AND AT END OF RUN
 C-----------------------------------------------------------------------
-
-      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
  
 c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -24,4 +22,5 @@
 c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
+      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
 *KEEP,BAL.
       COMMON /BAL/     EBAL
@@ -1308,5 +1307,5 @@
  209  FORMAT(//' ENERGY - MULTIPLICITY MATRIX FOR ALL SHOWERS'/
      *       ' ENERGY RUNS VERTICALLY, MULTIPLICITY HORIZONTALLY'//,
-     *       ' ',6X,5I9,3I8,5I7,'   ENERGY RANGE (GEV)'/
+     *       ' ',6X,5I9,3I8,5I7'   ENERGY RANGE (GEV)'/
      *       37(/' ',I4,1X,I10,4I9,3I8,5I7,1X,1P,2E10.1,0P)//
      *       ' MULT. ',5I9,3I8,5I7,4X,'LOWER BIN LIMIT'/
Index: branches/start/MagicSoft/Simulation/Corsika/Mmcs/start.f
===================================================================
--- trunk/MagicSoft/Simulation/Corsika/Mmcs/start.f	(revision 353)
+++ branches/start/MagicSoft/Simulation/Corsika/Mmcs/start.f	(revision 4308)
@@ -194,10 +194,10 @@
      *' COSMIC RAY SIMULATION FOR KASCADE'///
      *' A PROGRAM TO SIMULATE EXTENSIVE AIR SHOWERS IN ATMOSPHERE'//
-     *' BASED ON A PROGRAM OF P.K.F. GRIEDER, UNIVERSITY BERN,',
+     *' BASED ON A PROGRAM OF P.K.F. GRIEDER, UNIVERSITY BERN,'
      *' SWITZERLAND'/
      *' HDPM MODEL ACCORDING TO J.N. CAPDEVIELLE, COLLEGE DE FRANCE,',
      *' PARIS, FRANCE'/
      *' VENUS MODEL ACCORDING TO K. WERNER, UNIVERSITY NANTES, FRANCE'/
-     *' GHEISHA ROUTINES ACCORDING TO H. FESEFELDT, RWTH. AACHEN,',
+     *' GHEISHA ROUTINES ACCORDING TO H. FESEFELDT, RWTH. AACHEN,'
      *' GERMANY'/
      *' EGS4 AND NKG FORMULAS FOR SIMULATION OF EL.MAG. PARTICLES'//)
Index: branches/start/MagicSoft/Simulation/Detector/Camera/Makefile
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/Makefile	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Camera/Makefile	(revision 4308)
@@ -19,7 +19,7 @@
 #
 # $RCSfile: Makefile,v $
-# $Revision: 1.2 $
+# $Revision: 1.1.1.1 $
 # $Author: harald $ 
-# $Date: 1999-11-19 08:40:41 $
+# $Date: 1999-11-05 11:59:32 $
 #
 ##################################################################
@@ -28,5 +28,5 @@
 # @code
 
-INCLUDEMK = config.mk.${OSTYPE}
+INCLUDEMK = config.mk.${OSTYPE} 
 include ${INCLUDEMK}
 
@@ -43,11 +43,21 @@
 		   -I${INCLUDE_REFL} \
                    -I${INCLUDE_ROOT} \
-	           -I${INCLUDE_CPLUS}
+	           -I/usr/include/g++
 
 RANLIB  = -L${RANLIBDIR} -lranlib
 
-# what is needed for ROOT is inside the config.mk... file
-
-
+# what is needed for ROOT
+
+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      = 
+
+ROOTGLIBS     = -lGpad -lGui -lGX11 -lX3d -lX11
+#ROOTGLIBS     =
+
+GLIBS         = $(ROOTLIBS) $(ROOTGLIBS) -L/usr/X11R6/lib \
+                -lXpm -lX11  -lm -ldl -rdynamic
 # special flags
 
@@ -170,4 +180,5 @@
 		${INCLUDE_EVITA}/MRawEvt.h \
 		${INCLUDE_EVITA}/MMcEvt.h \
+#		${INCLUDE_EVITA}/MCameraDisplay.h \
 		${INCLUDE_EVITA}/Mdefine.h \
 		${INCLUDE_EVITA}/LinkDef.h
@@ -220,270 +231,197 @@
 ../include-MC/MCEventHeader.o: ../include-MC/MCEventHeader.hxx
 ../include-MC/MCEventHeader.o: ../include-GENERAL/Rtypes.h
-../include-MC/MCEventHeader.o: /usr/include/cxx/iostream.h
-../include-MC/MCEventHeader.o: /usr/include/cxx/iostream.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/compnent.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/iostream_impl.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/cxxl.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/cxxl_share.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/messages.hxx
-../include-MC/MCEventHeader.o: /usr/include/stddef.h /usr/include/standards.h
-../include-MC/MCEventHeader.o: /usr/include/stdio.h /usr/include/sys/seek.h
-../include-MC/MCEventHeader.o: /usr/include/va_list.h
-../include-MC/MCEventHeader.o: /usr/include/sys/types.h
-../include-MC/MCEventHeader.o: /usr/include/mach/machine/vm_types.h
+../include-MC/MCEventHeader.o: /usr/include/g++/iostream.h
+../include-MC/MCEventHeader.o: /usr/include/g++/streambuf.h
+../include-MC/MCEventHeader.o: /usr/include/libio.h /usr/include/features.h
+../include-MC/MCEventHeader.o: /usr/include/sys/cdefs.h
+../include-MC/MCEventHeader.o: /usr/include/gnu/stubs.h
+../include-MC/MCEventHeader.o: /usr/include/_G_config.h
+../include-MC/MCEventHeader.o: /usr/include/gnu/types.h
+../include-MC/MCEventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+../include-MC/MCEventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+../include-MC/MCEventHeader.o: /usr/include/g++/iomanip.h
+../include-MC/MCEventHeader.o: /usr/include/g++/fstream.h
+../include-MC/MCEventHeader.o: /usr/include/stdlib.h /usr/include/sys/types.h
+../include-MC/MCEventHeader.o: /usr/include/time.h /usr/include/endian.h
+../include-MC/MCEventHeader.o: /usr/include/bytesex.h
 ../include-MC/MCEventHeader.o: /usr/include/sys/select.h
-../include-MC/MCEventHeader.o: /usr/include/getopt.h
-../include-MC/MCEventHeader.o: /usr/include/sys/limits.h
-../include-MC/MCEventHeader.o: /usr/include/sys/machine/machlimits.h
-../include-MC/MCEventHeader.o: /usr/include/sys/syslimits.h
-../include-MC/MCEventHeader.o: /usr/include/sys/machine/machtime.h
-../include-MC/MCEventHeader.o: /usr/include/sys/rt_limits.h
-../include-MC/MCEventHeader.o: /usr/include/limits.h /usr/include/memory.h
-../include-MC/MCEventHeader.o: /usr/include/string.h /usr/include/strings.h
-../include-MC/MCEventHeader.o: /usr/include/cxx/iomanip.h
-../include-MC/MCEventHeader.o: /usr/include/cxx/iomanip.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/iomanip_impl.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/generic.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/mutex.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/fstream.h
-../include-MC/MCEventHeader.o: /usr/include/cxx/fstream.hxx
-../include-MC/MCEventHeader.o: /usr/include/cxx/fstream_impl.hxx
-../include-MC/MCEventHeader.o: /usr/include/stdlib.h /usr/include/math.h
+../include-MC/MCEventHeader.o: /usr/include/selectbits.h
+../include-MC/MCEventHeader.o: /usr/include/alloca.h /usr/include/math.h
+../include-MC/MCEventHeader.o: /usr/include/huge_val.h
+../include-MC/MCEventHeader.o: /usr/include/mathcalls.h
+../include-MC/MCEventHeader.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
 ../include-MC/MCEventHeader.o: ../include-CORSIKA/COREventHeader.hxx
 ../include-MC/MCCphoton.o: ../include-MC/MCCphoton.hxx
 ../include-MC/MCCphoton.o: ../include-GENERAL/Rtypes.h
-../include-MC/MCCphoton.o: /usr/include/cxx/iostream.h
-../include-MC/MCCphoton.o: /usr/include/cxx/iostream.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/compnent.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/iostream_impl.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/cxxl.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/cxxl_share.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/messages.hxx
-../include-MC/MCCphoton.o: /usr/include/stddef.h /usr/include/standards.h
-../include-MC/MCCphoton.o: /usr/include/stdio.h /usr/include/sys/seek.h
-../include-MC/MCCphoton.o: /usr/include/va_list.h /usr/include/sys/types.h
-../include-MC/MCCphoton.o: /usr/include/mach/machine/vm_types.h
-../include-MC/MCCphoton.o: /usr/include/sys/select.h /usr/include/getopt.h
-../include-MC/MCCphoton.o: /usr/include/sys/limits.h
-../include-MC/MCCphoton.o: /usr/include/sys/machine/machlimits.h
-../include-MC/MCCphoton.o: /usr/include/sys/syslimits.h
-../include-MC/MCCphoton.o: /usr/include/sys/machine/machtime.h
-../include-MC/MCCphoton.o: /usr/include/sys/rt_limits.h /usr/include/limits.h
-../include-MC/MCCphoton.o: /usr/include/memory.h /usr/include/string.h
-../include-MC/MCCphoton.o: /usr/include/strings.h /usr/include/cxx/iomanip.h
-../include-MC/MCCphoton.o: /usr/include/cxx/iomanip.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/iomanip_impl.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/generic.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/mutex.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/fstream.h
-../include-MC/MCCphoton.o: /usr/include/cxx/fstream.hxx
-../include-MC/MCCphoton.o: /usr/include/cxx/fstream_impl.hxx
-../include-MC/MCCphoton.o: /usr/include/stdlib.h /usr/include/math.h
+../include-MC/MCCphoton.o: /usr/include/g++/iostream.h
+../include-MC/MCCphoton.o: /usr/include/g++/streambuf.h /usr/include/libio.h
+../include-MC/MCCphoton.o: /usr/include/features.h /usr/include/sys/cdefs.h
+../include-MC/MCCphoton.o: /usr/include/gnu/stubs.h /usr/include/_G_config.h
+../include-MC/MCCphoton.o: /usr/include/gnu/types.h
+../include-MC/MCCphoton.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+../include-MC/MCCphoton.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+../include-MC/MCCphoton.o: /usr/include/g++/iomanip.h
+../include-MC/MCCphoton.o: /usr/include/g++/fstream.h /usr/include/stdlib.h
+../include-MC/MCCphoton.o: /usr/include/sys/types.h /usr/include/time.h
+../include-MC/MCCphoton.o: /usr/include/endian.h /usr/include/bytesex.h
+../include-MC/MCCphoton.o: /usr/include/sys/select.h
+../include-MC/MCCphoton.o: /usr/include/selectbits.h /usr/include/alloca.h
+../include-MC/MCCphoton.o: /usr/include/string.h /usr/include/math.h
+../include-MC/MCCphoton.o: /usr/include/huge_val.h /usr/include/mathcalls.h
+../include-MC/MCCphoton.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
 ../include-MC/MCCphoton.o: ../include-GENERAL/jcmacros.h
 ../include-MTrigger/MTrigger.o: ../include-MTrigger/MTrigger.hxx
-../include-MTrigger/MTrigger.o: /usr/include/cxx/iostream.h
-../include-MTrigger/MTrigger.o: /usr/include/cxx/iostream.hxx
-../include-MTrigger/MTrigger.o: /usr/include/cxx/compnent.hxx
-../include-MTrigger/MTrigger.o: /usr/include/cxx/iostream_impl.hxx
-../include-MTrigger/MTrigger.o: /usr/include/cxx/cxxl.hxx
-../include-MTrigger/MTrigger.o: /usr/include/cxx/cxxl_share.hxx
-../include-MTrigger/MTrigger.o: /usr/include/cxx/messages.hxx
-../include-MTrigger/MTrigger.o: /usr/include/stddef.h
-../include-MTrigger/MTrigger.o: /usr/include/standards.h /usr/include/stdio.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/seek.h
-../include-MTrigger/MTrigger.o: /usr/include/va_list.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/types.h
-../include-MTrigger/MTrigger.o: /usr/include/mach/machine/vm_types.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/select.h
-../include-MTrigger/MTrigger.o: /usr/include/getopt.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/limits.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/machine/machlimits.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/syslimits.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/machine/machtime.h
-../include-MTrigger/MTrigger.o: /usr/include/sys/rt_limits.h
-../include-MTrigger/MTrigger.o: /usr/include/limits.h /usr/include/memory.h
-../include-MTrigger/MTrigger.o: /usr/include/string.h /usr/include/strings.h
-../include-MTrigger/MTrigger.o: /usr/include/math.h /usr/include/stdlib.h
-../include-MTrigger/MTrigger.o: /CERN/root/include/TObject.h
+../include-MTrigger/MTrigger.o: /usr/include/g++/iostream.h
+../include-MTrigger/MTrigger.o: /usr/include/g++/streambuf.h
+../include-MTrigger/MTrigger.o: /usr/include/libio.h /usr/include/features.h
+../include-MTrigger/MTrigger.o: /usr/include/sys/cdefs.h
+../include-MTrigger/MTrigger.o: /usr/include/gnu/stubs.h
+../include-MTrigger/MTrigger.o: /usr/include/_G_config.h
+../include-MTrigger/MTrigger.o: /usr/include/gnu/types.h
+../include-MTrigger/MTrigger.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+../include-MTrigger/MTrigger.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+../include-MTrigger/MTrigger.o: /usr/include/math.h /usr/include/huge_val.h
+../include-MTrigger/MTrigger.o: /usr/include/mathcalls.h
+../include-MTrigger/MTrigger.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
+../include-MTrigger/MTrigger.o: /cern/root/include/TObject.h
 ../include-MTrigger/MTrigger.o: ../../../include-Classes/Mdefine.h
-../../../include-Classes/MRawPixel.o: /usr/include/cxx/iostream.h
-../../../include-Classes/MRawPixel.o: /usr/include/cxx/iostream.hxx
-../../../include-Classes/MRawPixel.o: /usr/include/cxx/compnent.hxx
-../../../include-Classes/MRawPixel.o: /usr/include/cxx/iostream_impl.hxx
-../../../include-Classes/MRawPixel.o: /usr/include/cxx/cxxl.hxx
-../../../include-Classes/MRawPixel.o: /usr/include/cxx/cxxl_share.hxx
-../../../include-Classes/MRawPixel.o: /usr/include/cxx/messages.hxx
-../../../include-Classes/MRawPixel.o: /usr/include/stddef.h
-../../../include-Classes/MRawPixel.o: /usr/include/standards.h
-../../../include-Classes/MRawPixel.o: /usr/include/stdio.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/seek.h
-../../../include-Classes/MRawPixel.o: /usr/include/va_list.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/types.h
-../../../include-Classes/MRawPixel.o: /usr/include/mach/machine/vm_types.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/select.h
-../../../include-Classes/MRawPixel.o: /usr/include/getopt.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/limits.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/machine/machlimits.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/syslimits.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/machine/machtime.h
-../../../include-Classes/MRawPixel.o: /usr/include/sys/rt_limits.h
-../../../include-Classes/MRawPixel.o: /usr/include/limits.h
-../../../include-Classes/MRawPixel.o: /usr/include/memory.h
+../../../include-Classes/MRawPixel.o: /usr/include/g++/iostream.h
+../../../include-Classes/MRawPixel.o: /usr/include/g++/streambuf.h
+../../../include-Classes/MRawPixel.o: /usr/include/libio.h
+../../../include-Classes/MRawPixel.o: /usr/include/features.h
+../../../include-Classes/MRawPixel.o: /usr/include/sys/cdefs.h
+../../../include-Classes/MRawPixel.o: /usr/include/gnu/stubs.h
+../../../include-Classes/MRawPixel.o: /usr/include/_G_config.h
+../../../include-Classes/MRawPixel.o: /usr/include/gnu/types.h
+../../../include-Classes/MRawPixel.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+../../../include-Classes/MRawPixel.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+../../../include-Classes/MRawPixel.o: /cern/root/include/TClonesArray.h
+../../../include-Classes/MRawPixel.o: /cern/root/include/TString.h
 ../../../include-Classes/MRawPixel.o: /usr/include/string.h
-../../../include-Classes/MRawPixel.o: /usr/include/strings.h
-../../../include-Classes/MRawPixel.o: /CERN/root/include/TClonesArray.h
-../../../include-Classes/MRawPixel.o: /CERN/root/include/TString.h
-../../../include-Classes/MRawPixel.o: /CERN/root/include/TRandom.h
+../../../include-Classes/MRawPixel.o: /cern/root/include/TRandom.h
 ../../../include-Classes/MRawPixel.o: ../../../include-Classes/MRawPixel.h
-../../../include-Classes/MRawPixel.o: /CERN/root/include/TObject.h
+../../../include-Classes/MRawPixel.o: /cern/root/include/TObject.h
 ../../../include-Classes/MRawPixel.o: ../../../include-Classes/Mdefine.h
-../../../include-Classes/MRawEvt.o: /usr/include/cxx/iostream.h
-../../../include-Classes/MRawEvt.o: /usr/include/cxx/iostream.hxx
-../../../include-Classes/MRawEvt.o: /usr/include/cxx/compnent.hxx
-../../../include-Classes/MRawEvt.o: /usr/include/cxx/iostream_impl.hxx
-../../../include-Classes/MRawEvt.o: /usr/include/cxx/cxxl.hxx
-../../../include-Classes/MRawEvt.o: /usr/include/cxx/cxxl_share.hxx
-../../../include-Classes/MRawEvt.o: /usr/include/cxx/messages.hxx
-../../../include-Classes/MRawEvt.o: /usr/include/stddef.h
-../../../include-Classes/MRawEvt.o: /usr/include/standards.h
-../../../include-Classes/MRawEvt.o: /usr/include/stdio.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/seek.h
-../../../include-Classes/MRawEvt.o: /usr/include/va_list.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/types.h
-../../../include-Classes/MRawEvt.o: /usr/include/mach/machine/vm_types.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/select.h
-../../../include-Classes/MRawEvt.o: /usr/include/getopt.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/limits.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/machine/machlimits.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/syslimits.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/machine/machtime.h
-../../../include-Classes/MRawEvt.o: /usr/include/sys/rt_limits.h
-../../../include-Classes/MRawEvt.o: /usr/include/limits.h
-../../../include-Classes/MRawEvt.o: /usr/include/memory.h
+../../../include-Classes/MRawEvt.o: /usr/include/g++/iostream.h
+../../../include-Classes/MRawEvt.o: /usr/include/g++/streambuf.h
+../../../include-Classes/MRawEvt.o: /usr/include/libio.h
+../../../include-Classes/MRawEvt.o: /usr/include/features.h
+../../../include-Classes/MRawEvt.o: /usr/include/sys/cdefs.h
+../../../include-Classes/MRawEvt.o: /usr/include/gnu/stubs.h
+../../../include-Classes/MRawEvt.o: /usr/include/_G_config.h
+../../../include-Classes/MRawEvt.o: /usr/include/gnu/types.h
+../../../include-Classes/MRawEvt.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+../../../include-Classes/MRawEvt.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+../../../include-Classes/MRawEvt.o: /cern/root/include/TClonesArray.h
+../../../include-Classes/MRawEvt.o: /cern/root/include/TString.h
 ../../../include-Classes/MRawEvt.o: /usr/include/string.h
-../../../include-Classes/MRawEvt.o: /usr/include/strings.h
-../../../include-Classes/MRawEvt.o: /CERN/root/include/TClonesArray.h
-../../../include-Classes/MRawEvt.o: /CERN/root/include/TString.h
-../../../include-Classes/MRawEvt.o: /CERN/root/include/TRandom.h
+../../../include-Classes/MRawEvt.o: /cern/root/include/TRandom.h
 ../../../include-Classes/MRawEvt.o: ../../../include-Classes/MRawEvt.h
-../../../include-Classes/MRawEvt.o: /CERN/root/include/TObject.h
+../../../include-Classes/MRawEvt.o: /cern/root/include/TObject.h
 ../../../include-Classes/MRawEvt.o: ../../../include-Classes/Mdefine.h
 ../../../include-Classes/MRawEvt.o: ../../../include-Classes/MRawPixel.h
-../../../include-Classes/MMcEvt.o: /usr/include/cxx/iostream.h
-../../../include-Classes/MMcEvt.o: /usr/include/cxx/iostream.hxx
-../../../include-Classes/MMcEvt.o: /usr/include/cxx/compnent.hxx
-../../../include-Classes/MMcEvt.o: /usr/include/cxx/iostream_impl.hxx
-../../../include-Classes/MMcEvt.o: /usr/include/cxx/cxxl.hxx
-../../../include-Classes/MMcEvt.o: /usr/include/cxx/cxxl_share.hxx
-../../../include-Classes/MMcEvt.o: /usr/include/cxx/messages.hxx
-../../../include-Classes/MMcEvt.o: /usr/include/stddef.h
-../../../include-Classes/MMcEvt.o: /usr/include/standards.h
-../../../include-Classes/MMcEvt.o: /usr/include/stdio.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/seek.h
-../../../include-Classes/MMcEvt.o: /usr/include/va_list.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/types.h
-../../../include-Classes/MMcEvt.o: /usr/include/mach/machine/vm_types.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/select.h
-../../../include-Classes/MMcEvt.o: /usr/include/getopt.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/limits.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/machine/machlimits.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/syslimits.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/machine/machtime.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/rt_limits.h
-../../../include-Classes/MMcEvt.o: /usr/include/limits.h
-../../../include-Classes/MMcEvt.o: /usr/include/memory.h
-../../../include-Classes/MMcEvt.o: /usr/include/string.h
-../../../include-Classes/MMcEvt.o: /usr/include/strings.h
+../../../include-Classes/MMcEvt.o: /usr/include/g++/iostream.h
+../../../include-Classes/MMcEvt.o: /usr/include/g++/streambuf.h
+../../../include-Classes/MMcEvt.o: /usr/include/libio.h
+../../../include-Classes/MMcEvt.o: /usr/include/features.h
+../../../include-Classes/MMcEvt.o: /usr/include/sys/cdefs.h
+../../../include-Classes/MMcEvt.o: /usr/include/gnu/stubs.h
+../../../include-Classes/MMcEvt.o: /usr/include/_G_config.h
+../../../include-Classes/MMcEvt.o: /usr/include/gnu/types.h
+../../../include-Classes/MMcEvt.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+../../../include-Classes/MMcEvt.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
 ../../../include-Classes/MMcEvt.o: ../../../include-Classes/MMcEvt.h
 ../../../include-Classes/MMcEvt.o: /usr/include/stdlib.h
+../../../include-Classes/MMcEvt.o: /usr/include/sys/types.h
+../../../include-Classes/MMcEvt.o: /usr/include/time.h /usr/include/endian.h
+../../../include-Classes/MMcEvt.o: /usr/include/bytesex.h
+../../../include-Classes/MMcEvt.o: /usr/include/sys/select.h
+../../../include-Classes/MMcEvt.o: /usr/include/selectbits.h
+../../../include-Classes/MMcEvt.o: /usr/include/alloca.h /usr/include/stdio.h
+../../../include-Classes/MMcEvt.o: /usr/include/stdio_lim.h
+../../../include-Classes/MMcEvt.o: /usr/include/string.h
 ../../../include-Classes/MMcEvt.o: /usr/include/unistd.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/access.h
+../../../include-Classes/MMcEvt.o: /usr/include/posix_opt.h
+../../../include-Classes/MMcEvt.o: /usr/include/confname.h
 ../../../include-Classes/MMcEvt.o: /usr/include/fcntl.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/fcntl.h
-../../../include-Classes/MMcEvt.o: /usr/include/sys/mode.h
-../../../include-Classes/MMcEvt.o: /CERN/root/include/TObject.h
-MDiag.o: MDiag.h /usr/include/stdlib.h /usr/include/standards.h
-MDiag.o: /usr/include/getopt.h /usr/include/sys/types.h
-MDiag.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
-MDiag.o: /usr/include/cxx/iostream.h /usr/include/cxx/iostream.hxx
-MDiag.o: /usr/include/cxx/compnent.hxx /usr/include/cxx/iostream_impl.hxx
-MDiag.o: /usr/include/cxx/cxxl.hxx /usr/include/cxx/cxxl_share.hxx
-MDiag.o: /usr/include/cxx/messages.hxx /usr/include/stddef.h
-MDiag.o: /usr/include/stdio.h /usr/include/sys/seek.h /usr/include/va_list.h
-MDiag.o: /usr/include/sys/limits.h /usr/include/sys/machine/machlimits.h
-MDiag.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
-MDiag.o: /usr/include/sys/rt_limits.h /usr/include/limits.h
-MDiag.o: /usr/include/memory.h /usr/include/string.h /usr/include/strings.h
-MDiag.o: /usr/include/cxx/fstream.h /usr/include/cxx/fstream.hxx
-MDiag.o: /usr/include/cxx/fstream_impl.hxx /CERN/root/include/TROOT.h
-MDiag.o: /CERN/root/include/TFile.h /CERN/root/include/TRandom.h
-MDiag.o: /CERN/root/include/TTree.h
-moments.o: moments.h /usr/include/cxx/iostream.h
-moments.o: /usr/include/cxx/iostream.hxx /usr/include/cxx/compnent.hxx
-moments.o: /usr/include/cxx/iostream_impl.hxx /usr/include/cxx/cxxl.hxx
-moments.o: /usr/include/cxx/cxxl_share.hxx /usr/include/cxx/messages.hxx
-moments.o: /usr/include/stddef.h /usr/include/standards.h
-moments.o: /usr/include/stdio.h /usr/include/sys/seek.h
-moments.o: /usr/include/va_list.h /usr/include/sys/types.h
-moments.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
-moments.o: /usr/include/getopt.h /usr/include/sys/limits.h
-moments.o: /usr/include/sys/machine/machlimits.h /usr/include/sys/syslimits.h
-moments.o: /usr/include/sys/machine/machtime.h /usr/include/sys/rt_limits.h
-moments.o: /usr/include/limits.h /usr/include/memory.h /usr/include/string.h
-moments.o: /usr/include/strings.h /usr/include/cxx/fstream.h
-moments.o: /usr/include/cxx/fstream.hxx /usr/include/cxx/fstream_impl.hxx
-moments.o: /usr/include/stdlib.h /usr/include/math.h /usr/include/float.h
-moments.o: /usr/include/fp_class.h ../include-GENERAL/jcmacros.h
-moments.o: ../include-GENERAL/jcdebug.h camera-v.h
-creadparam.o: creadparam.h /usr/include/cxx/iostream.h
-creadparam.o: /usr/include/cxx/iostream.hxx /usr/include/cxx/compnent.hxx
-creadparam.o: /usr/include/cxx/iostream_impl.hxx /usr/include/cxx/cxxl.hxx
-creadparam.o: /usr/include/cxx/cxxl_share.hxx /usr/include/cxx/messages.hxx
-creadparam.o: /usr/include/stddef.h /usr/include/standards.h
-creadparam.o: /usr/include/stdio.h /usr/include/sys/seek.h
-creadparam.o: /usr/include/va_list.h /usr/include/sys/types.h
-creadparam.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
-creadparam.o: /usr/include/getopt.h /usr/include/sys/limits.h
-creadparam.o: /usr/include/sys/machine/machlimits.h
-creadparam.o: /usr/include/sys/syslimits.h
-creadparam.o: /usr/include/sys/machine/machtime.h
-creadparam.o: /usr/include/sys/rt_limits.h /usr/include/limits.h
-creadparam.o: /usr/include/memory.h /usr/include/string.h
-creadparam.o: /usr/include/strings.h /usr/include/cxx/fstream.h
-creadparam.o: /usr/include/cxx/fstream.hxx /usr/include/cxx/fstream_impl.hxx
-creadparam.o: /usr/include/stdlib.h /usr/include/math.h /usr/include/float.h
-creadparam.o: /usr/include/fp_class.h ../include-GENERAL/jcmacros.h
-creadparam.o: ../include-GENERAL/jcdebug.h camera-v.h
-camera.o: /CERN/root/include/TROOT.h /CERN/root/include/TFile.h
-camera.o: /CERN/root/include/TTree.h /CERN/root/include/TBranch.h MDiag.h
-camera.o: /usr/include/stdlib.h /usr/include/standards.h
-camera.o: /usr/include/getopt.h /usr/include/sys/types.h
-camera.o: /usr/include/mach/machine/vm_types.h /usr/include/sys/select.h
-camera.o: /usr/include/cxx/iostream.h /usr/include/cxx/iostream.hxx
-camera.o: /usr/include/cxx/compnent.hxx /usr/include/cxx/iostream_impl.hxx
-camera.o: /usr/include/cxx/cxxl.hxx /usr/include/cxx/cxxl_share.hxx
-camera.o: /usr/include/cxx/messages.hxx /usr/include/stddef.h
-camera.o: /usr/include/stdio.h /usr/include/sys/seek.h /usr/include/va_list.h
-camera.o: /usr/include/sys/limits.h /usr/include/sys/machine/machlimits.h
-camera.o: /usr/include/sys/syslimits.h /usr/include/sys/machine/machtime.h
-camera.o: /usr/include/sys/rt_limits.h /usr/include/limits.h
-camera.o: /usr/include/memory.h /usr/include/string.h /usr/include/strings.h
-camera.o: /usr/include/cxx/fstream.h /usr/include/cxx/fstream.hxx
-camera.o: /usr/include/cxx/fstream_impl.hxx /CERN/root/include/TRandom.h
-camera.o: ../include-MTrigger/MTrigger.hxx /usr/include/math.h
-camera.o: /CERN/root/include/TObject.h ../../../include-Classes/Mdefine.h
+../../../include-Classes/MMcEvt.o: /usr/include/fcntlbits.h
+../../../include-Classes/MMcEvt.o: /cern/root/include/TObject.h
+MDiag.o: MDiag.h /usr/include/stdlib.h /usr/include/features.h
+MDiag.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+MDiag.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+MDiag.o: /usr/include/sys/types.h /usr/include/gnu/types.h
+MDiag.o: /usr/include/time.h /usr/include/endian.h /usr/include/bytesex.h
+MDiag.o: /usr/include/sys/select.h /usr/include/selectbits.h
+MDiag.o: /usr/include/alloca.h /usr/include/g++/iostream.h
+MDiag.o: /usr/include/g++/streambuf.h /usr/include/libio.h
+MDiag.o: /usr/include/_G_config.h
+MDiag.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+MDiag.o: /usr/include/g++/fstream.h /usr/include/string.h
+MDiag.o: /cern/root/include/TROOT.h /cern/root/include/TFile.h
+MDiag.o: /cern/root/include/TRandom.h /cern/root/include/TTree.h
+moments.o: moments.h /usr/include/g++/iostream.h /usr/include/g++/streambuf.h
+moments.o: /usr/include/libio.h /usr/include/features.h
+moments.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+moments.o: /usr/include/_G_config.h /usr/include/gnu/types.h
+moments.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+moments.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+moments.o: /usr/include/g++/fstream.h /usr/include/stdlib.h
+moments.o: /usr/include/sys/types.h /usr/include/time.h /usr/include/endian.h
+moments.o: /usr/include/bytesex.h /usr/include/sys/select.h
+moments.o: /usr/include/selectbits.h /usr/include/alloca.h
+moments.o: /usr/include/stdio.h /usr/include/stdio_lim.h
+moments.o: /usr/include/string.h /usr/include/math.h /usr/include/huge_val.h
+moments.o: /usr/include/mathcalls.h
+moments.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
+moments.o: ../include-GENERAL/jcmacros.h ../include-GENERAL/jcdebug.h
+moments.o: camera-v.h
+creadparam.o: creadparam.h /usr/include/g++/iostream.h
+creadparam.o: /usr/include/g++/streambuf.h /usr/include/libio.h
+creadparam.o: /usr/include/features.h /usr/include/sys/cdefs.h
+creadparam.o: /usr/include/gnu/stubs.h /usr/include/_G_config.h
+creadparam.o: /usr/include/gnu/types.h
+creadparam.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+creadparam.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+creadparam.o: /usr/include/g++/fstream.h /usr/include/stdlib.h
+creadparam.o: /usr/include/sys/types.h /usr/include/time.h
+creadparam.o: /usr/include/endian.h /usr/include/bytesex.h
+creadparam.o: /usr/include/sys/select.h /usr/include/selectbits.h
+creadparam.o: /usr/include/alloca.h /usr/include/stdio.h
+creadparam.o: /usr/include/stdio_lim.h /usr/include/string.h
+creadparam.o: /usr/include/math.h /usr/include/huge_val.h
+creadparam.o: /usr/include/mathcalls.h
+creadparam.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
+creadparam.o: ../include-GENERAL/jcmacros.h ../include-GENERAL/jcdebug.h
+creadparam.o: camera-v.h
+camera.o: /cern/root/include/TROOT.h /cern/root/include/TFile.h
+camera.o: /cern/root/include/TTree.h /cern/root/include/TBranch.h MDiag.h
+camera.o: /usr/include/stdlib.h /usr/include/features.h
+camera.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
+camera.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stddef.h
+camera.o: /usr/include/sys/types.h /usr/include/gnu/types.h
+camera.o: /usr/include/time.h /usr/include/endian.h /usr/include/bytesex.h
+camera.o: /usr/include/sys/select.h /usr/include/selectbits.h
+camera.o: /usr/include/alloca.h /usr/include/g++/iostream.h
+camera.o: /usr/include/g++/streambuf.h /usr/include/libio.h
+camera.o: /usr/include/_G_config.h
+camera.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/stdarg.h
+camera.o: /usr/include/g++/fstream.h /usr/include/string.h
+camera.o: /cern/root/include/TRandom.h ../include-MTrigger/MTrigger.hxx
+camera.o: /usr/include/math.h /usr/include/huge_val.h
+camera.o: /usr/include/mathcalls.h
+camera.o: /usr/lib/gcc-lib/i486-linux/2.7.2.3/include/float.h
+camera.o: /cern/root/include/TObject.h ../../../include-Classes/Mdefine.h
 camera.o: ../../../include-Classes/MRawEvt.h
-camera.o: /CERN/root/include/TClonesArray.h ../../../include-Classes/MMcEvt.h
-camera.o: /usr/include/unistd.h /usr/include/sys/access.h
-camera.o: /usr/include/fcntl.h /usr/include/sys/fcntl.h
-camera.o: /usr/include/sys/mode.h camera.h /usr/include/stdarg.h
-camera.o: /usr/include/dirent.h /usr/include/libgen.h camera-v.h
+camera.o: /cern/root/include/TClonesArray.h ../../../include-Classes/MMcEvt.h
+camera.o: /usr/include/stdio.h /usr/include/stdio_lim.h /usr/include/unistd.h
+camera.o: /usr/include/posix_opt.h /usr/include/confname.h
+camera.o: /usr/include/fcntl.h /usr/include/fcntlbits.h camera.h
+camera.o: /usr/include/dirent.h /usr/include/direntry.h
+camera.o: /usr/include/posix1_lim.h /usr/include/local_lim.h
+camera.o: /usr/include/linux/limits.h /usr/include/libgen.h camera-v.h
 camera.o: ../include-GENERAL/jcmacros.h ../include-GENERAL/jcdebug.h
-camera.o: creadparam.h /usr/include/float.h /usr/include/fp_class.h
-camera.o: ../Reflector/atm.h ../Reflector/reflector-v.h moments.h
-camera.o: ../include-GENERAL/lagrange.h ../include-MC/MCEventHeader.hxx
-camera.o: ../include-GENERAL/Rtypes.h /usr/include/cxx/iomanip.h
-camera.o: /usr/include/cxx/iomanip.hxx /usr/include/cxx/iomanip_impl.hxx
-camera.o: /usr/include/cxx/generic.hxx /usr/include/cxx/mutex.hxx
-camera.o: ../include-CORSIKA/COREventHeader.hxx ../include-MC/MCCphoton.hxx
-camera.o: ../include-GENERAL/ranlib.h
+camera.o: creadparam.h ../Reflector/atm.h ../Reflector/reflector-v.h
+camera.o: moments.h ../include-GENERAL/lagrange.h
+camera.o: ../include-MC/MCEventHeader.hxx ../include-GENERAL/Rtypes.h
+camera.o: /usr/include/g++/iomanip.h ../include-CORSIKA/COREventHeader.hxx
+camera.o: ../include-MC/MCCphoton.hxx ../include-GENERAL/ranlib.h
Index: branches/start/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 4308)
@@ -21,7 +21,7 @@
 //
 // $RCSfile: camera.cxx,v $
-// $Revision: 1.4 $
-// $Author: petry $ 
-// $Date: 2000-01-25 08:36:23 $
+// $Revision: 1.1.1.1 $
+// $Author: harald $ 
+// $Date: 1999-11-05 11:59:31 $
 //
 ////////////////////////////////////////////////////////////////////////
@@ -517,5 +517,5 @@
   MTrigger  Trigger ;         //@< A instance of the Class MTrigger 
 
-#endif // __DETAIL_TRIGGER__ 
+#endif __DETAIL_TRIGGER__ 
 
   //!@' @#### Definition of variables for |getopt()|.
@@ -705,4 +705,6 @@
   // initalize the ROOT file 
   //
+  //     erzeuge ein Root file 
+  //
 
   TFile outfile ( rootname , "RECREATE" ) ; 
@@ -726,5 +728,5 @@
   unsigned short ulli = 0 ; 
 
-#endif // __ROOT__
+#endif __ROOT__
 
   // for safety and for dimensioning image_data: count the elements in the 
@@ -855,9 +857,9 @@
   fnslicesum = new float [ (2 * SLICES) ] ; 
   
-  float slices   [CAMERA_PIXELS][ (2 * SLICES) ] ; 
-  float slices2  [CAMERA_PIXELS][ SLICES ] ; 
+  float slices   [ct_NPixels][ (2 * SLICES) ] ; 
+  float slices2  [ct_NPixels][ SLICES ] ; 
 
   float trans    [ SLICES ] ; 
-#endif // __ROOT__ 
+#endif __ROOT__ 
 
   
@@ -1032,5 +1034,5 @@
 	    slices [i][ii] = 0 ; 
 	  }
-#endif // __ROOT__ 
+#endif __ROOT__ 
 	}
 
@@ -1044,5 +1046,5 @@
       
 	Trigger.Reset() ; 
-#endif // __DETAIL_TRIGGER__ 
+#endif __DETAIL_TRIGGER__ 
        
 	//- - - - - - - - - - - - - - - - - - - - - - - - - 
@@ -1073,33 +1075,93 @@
 	  else
 	    inputfile.read( ((char*)&cphoton)+SIZE_OF_FLAGS, cphoton.mysize()-SIZE_OF_FLAGS );
-	  
+	
 	  // increase number of photons
 	  
 	  ncph++;
-	  
+
 	  t = cphoton.get_t() ; 
-	  
+
 	  if(t_ini == -99999){ // this is the first photon we read from this event
 	    t_ini = t; // memorize time
 	  }
-	  
+
 	  // The photons don't come in chronological order!
           // Put the first photon at the center of the array by adding the constant SLICES
-	  
+             
 	  t_chan = (int) ((t - t_ini )/ WIDTH_TIMESLICE ) + SLICES ; 	  
-	  
+
 	  if (t_chan > (2 * SLICES)){
 	    log(SIGNATURE, "warning, channel number (%d) exceded limit (%d).\n Setting it to %d .\n",
-		t_chan, (2 * SLICES), (2 * SLICES));
+	    t_chan, (2 * SLICES), (2 * SLICES));
 	    t_chan = (2 * SLICES);
 	  }
 	  else if(t_chan < 0){
 	    log(SIGNATURE, "warning, channel number (%d) below limit (%d).\n Setting it to %d .\n",
-		t_chan, 0, 0);
+	    t_chan, 0, 0);
 	    t_chan = 0;
 	  } 
-	    
+	  /*!@'
+	    
+	    @#### Pixelization (for the central pixels).
+	    
+	    In order to calculate the coordinates, we use the
+	    change of system described in the documentation
+	    of the source code of |pixel\_coord.cxx|.
+	    Then, we will use simply the matrix of change
+	    from one system to the other. In our case, this is:
+	    
+	    @[
+	    \begin{bmatrix}X\\Y\\\end{bmatrix}                                
+	    =
+	    \begin{bmatrix}
+	    1 & \cos(60^\circ)\\
+	    0 & \sin(60^\circ)\\
+	    \end{bmatrix}                                
+	    \begin{bmatrix}I\\J\\\end{bmatrix}                                
+	    @]
+	    
+	    and hence
+	    
+	    @[
+	    \begin{bmatrix}I\\J\\\end{bmatrix}                                
+	    =
+	    \begin{bmatrix}    
+	    1 & -\frac{\cos(60^\circ)}{\sin(60^\circ)}\\
+	    0 &\frac{1}{\sin(60^\circ)}\\
+	    \end{bmatrix}                                
+	    \begin{bmatrix}X\\Y\\\end{bmatrix}                                
+	    @]
+	    
+	  */
+	  
+	  //+++
 	  // Pixelization
-	    
+	  //---
+	  
+	  // calculate ij-coordinates
+	  
+	  // We use a change of coordinate system, using the following 
+	  // matrix of change (m^-1) (this is taken from Mathematica output).
+	  /*
+	   * In[1]:= m={{1,cos60},{0,sin60}}; MatrixForm[m]
+	   *
+	   * Out[1]//MatrixForm= 1       cos60
+	   * 
+	   *                     0       sin60
+	   * 
+	   * In[2]:= inv=Inverse[m]; MatrixForm[inv]
+	   * 
+	   * Out[2]//MatrixForm=              cos60
+	   *                                -(-----)
+	   *                       1          sin60
+	   * 
+	   *                                    1
+	   *                                  -----
+	   *                       0          sin60
+	   * 
+	   */
+	  
+	  // go to IJ-coordinate system
+	  
 	  cx = cphoton.get_x();
 	  cy = cphoton.get_y(); 
@@ -1110,9 +1172,14 @@
 	  wl = cphoton.get_wl();
 	  
-	  // check if photon has valid wavelength and is inside outermost camera radius
-	  
-	  if( (wl > 800.0) || (wl < 290.0) ||
-	      (sqrt(cx*cx + cy*cy) > (cam.dxc[ct_NPixels-1]+1.5*ct_PixelWidth)) ){ 
-	    
+	  if ( wl < 1.0 )
+	    break;
+	  
+	  if ( (wl > 600.0) || (wl < 290.0) )
+	    break;
+	  
+	  // check if photon is inside outermost camera radius
+
+	  if(sqrt(cx*cx + cy*cy) > (cam.dxc[ct_NPixels-1]+1.5*ct_PixelWidth)){ 
+	   
 	    // read next CPhoton
 	    if ( Data_From_STDIN ) 
@@ -1123,20 +1190,88 @@
 	    // go to beginning of loop, the photon is lost
 	    continue;
-	    
+
 	  }
 
 	  // cout << "@#1 " << nshow << ' ' << cx << ' ' << cy << endl;
 	  
-	  nPMT = -1;
-
-	  for(i=0; i<ct_NPixels; i++){
-	    if( bpoint_is_in_pix( cx, cy, i, &cam) ){
-	      nPMT = i;
-	      break;
+	  ci = floor( (cx - cy*COS60/SIN60)/ ct_2Apot + 0.5);
+	  cj = floor( (cy/SIN60) / ct_2Apot + 0.5);
+	  
+	  ici = (int)(ci);
+	  icj = (int)(cj);
+	  
+	  iici = ici+PIX_ARRAY_HALF_SIDE;
+	  iicj = icj+PIX_ARRAY_HALF_SIDE;
+	  
+	  // is it inside the array?
+	  
+	  if ( (iici > 0) && (iici < PIX_ARRAY_SIDE) &&
+	       (iicj > 0) && (iicj < PIX_ARRAY_SIDE) ) {
+	    	  
+	    // try to put into pixel
+	    
+	    // obtain the pixel number for this photon
+	    
+	    nPMT = (int)
+	      pixels[ici+PIX_ARRAY_HALF_SIDE][icj+PIX_ARRAY_HALF_SIDE][PIXNUM];
+	  
+	  }
+	  else{
+
+	    nPMT = -1;
+
+	  }
+
+	  // check if outside the central camera
+	  
+	  if ( (nPMT < 0) || (nPMT >= ct_NCentralPixels) ) {
+
+	    // check the outer pixels
+	    nPMT = -1;
+
+	    for(i=ct_NCentralPixels; i<ct_NPixels; i++){
+	      if( bpoint_is_in_pix( cx, cy, i, &cam) ){
+		nPMT = i;
+		break;
+	      }
 	    }
+	   
+	    if(nPMT==-1){// the photon is in none of the pixels
+
+	      // read next CPhoton
+	      if ( Data_From_STDIN ) 
+		cin.read( flag, SIZE_OF_FLAGS );
+	      else
+		inputfile.read ( flag, SIZE_OF_FLAGS );
+	      
+	      // go to beginning of loop, the photon is lost
+	      continue;
+	    }
+	    
 	  }
-	   
-	  if(nPMT==-1){// the photon is in none of the pixels
-
+	  
+#ifdef __QE__
+	  
+	  //!@' @#### QE simulation.
+	  //@'
+	  
+	  //+++
+	  // QE simulation
+	  //---
+	  
+	  // find data point to be used in Lagrange interpolation (-> k)
+	  
+	  qeptr = (float **)QE[nPMT];
+	  
+	  FindLagrange(qeptr,k,wl);
+	  
+	  // if random > quantum efficiency, reject it
+	  
+	  qe = Lagrange(qeptr,k,wl) / 100.0;
+
+	  // fprintf(stdout, "%f\n", qe);
+	  
+	  if ( RandomNumber > qe ) {
+	    
 	    // read next CPhoton
 	    if ( Data_From_STDIN ) 
@@ -1145,39 +1280,4 @@
 	      inputfile.read ( flag, SIZE_OF_FLAGS );
 	    
-	    // go to beginning of loop, the photon is lost
-	    continue;
-	  }
-	  
-	
-	  
-#ifdef __QE__
-	  
-	  //!@' @#### QE simulation.
-	  //@'
-	  
-	  //+++
-	  // QE simulation
-	  //---
-	  
-	  // find data point to be used in Lagrange interpolation (-> k)
-	  
-	  qeptr = (float **)QE[nPMT];
-	  
-	  FindLagrange(qeptr,k,wl);
-	  
-	  // if random > quantum efficiency, reject it
-	  
-	  qe = Lagrange(qeptr,k,wl) / 100.0;
-	  
-	  // fprintf(stdout, "%f\n", qe);
-	  
-	  if ( RandomNumber > qe ) {
-	    
-	    // read next CPhoton
-	    if ( Data_From_STDIN ) 
-	      cin.read( flag, SIZE_OF_FLAGS );
-	    else
-	      inputfile.read ( flag, SIZE_OF_FLAGS );
-	    
 	    // go to beginning of loop
 	    continue;
@@ -1196,10 +1296,10 @@
 	  
 	  fnpix[nPMT] += 1.0;
-	  
+
 #ifdef __ROOT__ 
 	  fnslicesum[t_chan]  += 1.0 ; 
 	  slices[nPMT][t_chan] += 1.0 ; 
-#endif // __ROOT__ 	  
-	  
+#endif __ROOT__ 	  
+
 #ifdef __DETAIL_TRIGGER__ 
 	  //
@@ -1207,24 +1307,24 @@
 	  //
 	  //
-	  
+
 	  Trigger.Fill( nPMT, ( t - t_ini  ) ) ; 
-#endif // __DETAIL_TRIGGER__ 
+#endif __DETAIL_TRIGGER__ 
 	  
 	  // read next CPhoton
-	  
+
 	  if ( Data_From_STDIN ) 
 	    cin.read( flag, SIZE_OF_FLAGS );
 	  else
 	    inputfile.read ( flag, SIZE_OF_FLAGS );
-	  
+
 	}  // end while, i.e. found end of event
 	
 	log(SIGNATURE, "End of this event: %d cphs(+%d). . .\n",
 	    ncph, ntcph);
-      
+
 	// show number of photons
 	
 	//cout << ncph << " photons read . . . " << endl << flush;
-      
+	
 	// skip it ?
 	
@@ -1301,85 +1401,85 @@
 	
 	// if we should apply any kind of correction, do it here.
-	
+
 	for ( i=0; i<ct_NPixels; ++i ) 
 	  fnpix[i] *= fCorrection;
-	
+
 #ifdef __DETAIL_TRIGGER__ 
-	//   Trigger.Print() ; 
-	cout << Trigger.Diskriminate() << endl << endl ;
-#endif // __DETAIL_TRIGGER__ 
-	
+      //   Trigger.Print() ; 
+      cout << Trigger.Diskriminate() << endl << endl ;
+#endif __DETAIL_TRIGGER__ 
+
 #ifdef __ROOT__
-	
-	//
-	//  Fill the header of this event 
-	//
-	
-	Evt->FillHeader ( (UShort_t) (ntshow + nshow) ,  20 ) ; 
-	
-	//  now put out the data of interest
-	//
-	//  1.  -> look for the first slice with signal
-	//
-	
-	for ( i=0; i<(2 * SLICES); i++ ) 
-	  if ( fnslicesum[i] > 0. )
-	    break ; 
-	
-	startchan = i ; 
-	
-	//
-	//     copy the slices out of the big array 
-	//   
-	//     put the first slice with signal to slice 4
-	//
-	
-	for (i=0; i<ct_NPixels; i++ ) 
-	  for ( ii=(startchan-3); ii < (startchan+12); ii++ )  
-	    slices2 [i][ii-startchan+3] = slices [i][ii] ; 
-	
-	
-	// 
-	//  if a pixes has a signal put it to the MRawEvt
-	//
-	
-	for (i=0; i<ct_NPixels; i++ ) {
-	  if ( fnpix[i] > 0 ) {
-	    
-	    for ( ii=0; ii < 15; ii++ ) {
-	      trans [ii] = slices2[i][ii] ; 
-	    }
-	    
-	    Evt->FillPixel ( (UShort_t) i , trans ) ; 
-	    
+
+      //
+      //  Fill the header of this event 
+      //
+      
+      Evt->FillHeader ( (UShort_t) (ntshow + nshow) ,  20 ) ; 
+
+      //  now put out the data of interest
+      //
+      //  1.  -> look for the first slice with signal
+      //
+
+      for ( i=0; i<(2 * SLICES); i++ ) 
+	if ( fnslicesum[i] > 0. )
+	  break ; 
+
+      startchan = i ; 
+
+      //
+      //     copy the slices out of the big array 
+      //   
+      //     put the first slice with signal to slice 4
+      //
+      
+      for (i=0; i<ct_NPixels; i++ ) 
+	for ( ii=(startchan-3); ii < (startchan+12); ii++ )  
+	  slices2 [i][ii-startchan+3] = slices [i][ii] ; 
+
+
+      // 
+      //  if a pixes has a signal put it to the MRawEvt
+      //
+      
+      for (i=0; i<ct_NPixels; i++ ) {
+	if ( fnpix[i] > 0 ) {
+
+	  for ( ii=0; ii < 15; ii++ ) {
+	    trans [ii] = slices2[i][ii] ; 
 	  }
+	
+	  Evt->FillPixel ( (UShort_t) i , trans ) ; 
+	  
 	}
-	
-	//
-	//   
-	//
-	
-	McEvt->Fill( (UShort_t) mcevth.get_primary() , 
-		     mcevth.get_energy(), 
-		     mcevth.get_theta(), 
-		     mcevth.get_phi(), 
-		     mcevth.get_core(),
-		     mcevth.get_coreX(),
-		     mcevth.get_coreY(),
-		     flli,
-		     ulli, ulli, ulli, ulli, ulli ) ; 
-	
-	//
-	//    write it out to the file outfile
-	// 
-	
-	EvtTree.Fill() ; 
-	
-	//    clear all
-	
-	Evt->Clear() ; 
-	McEvt->Clear() ; 
-	
-#endif // __ROOT__
+      }
+      
+      //
+      //   
+      //
+      
+      McEvt->Fill( (UShort_t) mcevth.get_primary() , 
+		   mcevth.get_energy(), 
+		   mcevth.get_theta(), 
+		   mcevth.get_phi(), 
+		   mcevth.get_core(),
+		   mcevth.get_coreX(),
+		   mcevth.get_coreY(),
+		   flli,
+		   ulli, ulli, ulli, ulli, ulli ) ; 
+      
+      //
+      //    write it out to the file outfile
+      // 
+
+      EvtTree.Fill() ; 
+
+      //    clear all
+
+      Evt->Clear() ; 
+      McEvt->Clear() ; 
+
+#endif __ROOT__
 	
 	//++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -1393,4 +1493,38 @@
 	//--------------------------------------------------
 	
+#ifdef __DEBUG__  
+	printf("\n");
+	
+	for ( ici=0; ici<PIX_ARRAY_SIDE; ++ici ) {
+	  
+	  for ( icj=0; icj<PIX_ARRAY_SIDE; ++icj ) {
+	    
+	    if ( (int)pixels[ici][icj][PIXNUM] > -1 ) {
+	      
+	      if ( fnpix[(int)pixels[ici][icj][PIXNUM]] > 0. ) {
+		
+		printf ("@@ %4d %4d %10f %10f %4f (%4d %4d)\n", nshow, 
+			(int)pixels[ici][icj][PIXNUM], 
+			pixels[ici][icj][PIXX],
+			pixels[ici][icj][PIXY],
+			fnpix[(int)pixels[ici][icj][PIXNUM]], ici, icj);
+		
+	      }
+	      
+	    }
+	    
+	  }
+	  
+	}
+	
+	for (i=0; i<ct_NPixels; ++i) {
+	  printf("%d (%d): ", i, npixneig[i]);
+	  for (j=0; j<npixneig[i]; ++i) 
+	    printf(" %d", pixneig[i][j]);
+	  printf("\n");
+	}
+	
+#endif // __DEBUG__
+	
 #ifdef __TRIGGER__
 	
@@ -1437,5 +1571,5 @@
 	//@ If the input parameter "threshold" is 0 we find the maximum 
 	//@ trigger threshold this event can pass
-	
+
 	for(k=0; ( qThreshold == 0 ? (k <= iMAX_THRESHOLD_PHE) : (k == 1) ); k++){
 	  
@@ -1539,5 +1673,5 @@
 		
 		for ( j=0 ; j<npixneig[i] && pixneig[i][j]>-1; ++j ) {
-		
+		  
 		  if ( fnpix[pixneig[i][j]] > q0 ) {
 		    
@@ -1609,5 +1743,5 @@
 		    
 		    trigger = FALSE;
-		    
+		  
 		  }
 		  
@@ -1715,7 +1849,7 @@
 	  
 	  // calculate moments and other things
-	  
+
 	  moments_ptr = moments( anaPixels, fnpixclean, pixary,
-				 plateScale_cm2deg, 0 );
+                               plateScale_cm2deg, 0 );
 	  
 	  charge = moments_ptr->charge ;
@@ -1734,10 +1868,10 @@
 	  asymx  = moments_ptr->asymx  ;
 	  phiasym= moments_ptr->phi;
-	  
+
 	  lenwid_ptr = lenwid( anaPixels, fnpixclean, pixary,
 			       plateScale_cm2deg,
 			       ct_PixelWidth_corner_2_corner_half);
-	  
-	  
+          
+
 	  // fill the diagnostic Tree
 	  
@@ -1862,7 +1996,7 @@
 	  image_data[i] =	-1.; i++;
 	  image_data[i] =	-1.; i++;
-	  
+
 	  // there should be "nvar" variables
-	  
+
 	  if ( i != nvar ) 
 	    error( SIGNATURE, "Wrong entry length for Ntuple.\n" );
@@ -1872,7 +2006,7 @@
 	  
 	  // put this information in the data file, 
-	  
+
 	  if ( Write_All_Data ) {
-	    
+
 	    datafile << ntrigger;
 	    for ( i=0; i<nvar; ++i )
@@ -1889,7 +2023,7 @@
 	  
 	} // trigger == FALSE 
-	
+        
 #endif // __TRIGGER__
-	
+
 	//!@' @#### Save data.
 	//@'
@@ -1900,5 +2034,5 @@
 	// the output file
 	//--------------------------------------------------
-	
+
 	//++ 
 	// save the image to the file
@@ -1908,20 +2042,20 @@
 	
 	outputfile.write( (char *)&mcevth, mcevth.mysize() ); 
-	
+      
 #ifdef __TRIGGER__
-	
+
 	// save the image 
-	
+      
 	if ( (trigger == TRUE) || (Write_All_Images == TRUE) )
 	  outputfile.write( (char *) fnpix, ct_NPixels * sizeof( float ) );
-	
+
 #else
-	
+
 	// save the image 
-	
+      
 	outputfile.write( (char *) fnpix, ct_NPixels * sizeof( float ) );
-	
+
 #endif // __TRIGGER__
-	
+
 	if ( Data_From_STDIN ) 
 	  cin.read( flag, SIZE_OF_FLAGS );
@@ -1930,5 +2064,5 @@
 	
       } // end while there is a next event
-      
+
       if( !isA( flag, FLAG_END_OF_RUN   )){
 	error( SIGNATURE, "Expected end of run flag, but found: %s\n", flag );
@@ -1974,5 +2108,5 @@
 	    
 	  }
-	  
+	
 	} // end if found end of file
       } // end if found end of run
@@ -1983,21 +2117,21 @@
     } // end if else found start of run
   } // end big while loop
-  
-//!@' @#### End of program.
-//@'
-  
+
+  //!@' @#### End of program.
+  //@'
+
   //end my version
 
 #ifdef __ROOT__
-  //++
-  // put the Event to the root file
-  //--
-  
-  EvtTree.Write() ; 
-  outfile.Write() ;
-  outfile.Close() ; 
-
-#endif // __ROOT__
-  
+      //++
+      // put the Event to the root file
+      //--
+
+      EvtTree.Write() ; 
+      outfile.Write() ;
+      outfile.Close() ; 
+
+#endif __ROOT__
+              
   // close input file
   
@@ -2007,9 +2141,9 @@
   log( SIGNATURE, "Fraction of triggers: %5.1f%% (%d out of %d)\n", 
        ((float)ntrigger) / ((float)ntshow) * 100.0, ntrigger, ntshow);
-  
+
   // close files
   
   log( SIGNATURE, "Closing files\n" );
-  
+
   inputfile.close();
   outputfile.close();
@@ -2025,5 +2159,5 @@
 
   Trigger.PrintStat() ; 
-#endif // __DETAIL_TRIGGER__ 
+#endif __DETAIL_TRIGGER__ 
 
   // program finished
@@ -2147,5 +2281,5 @@
   perror(funct);
 
-  exit(1);
+  abort();
 }
 //!@}
@@ -2670,5 +2804,5 @@
     /* Initialise variables. The central pixel = ipixno 1 in ring iring_no 0 */
 
-    pcam->dpixsizefactor[ipixno-1] = 1.;
+    pcam->dpixsizefactor[ipixno] = 1.;
 
     in = 0;
@@ -2977,237 +3111,4 @@
 //
 // $Log: not supported by cvs2svn $
-// Revision 1.3  2000/01/20 18:22:17  petry
-// Found little bug which makes camera crash if it finds a photon
-// of invalid wavelength. This bug is now fixed and the range
-// of valid wavelengths extended to 290 - 800 nm.
-// This is in preparation for the NSB simulation to come.
-// Dirk
-//
-// Revision 1.2  1999/11/19 08:40:42  harald
-// Now it is possible to compile the camera programm under osf1.
-//
-// Revision 1.1.1.1  1999/11/05 11:59:31  harald
-// This the starting point for CVS controlled further developments of the
-// camera program. The program was originally written by Jose Carlos. 
-// But here you can find a "rootified" version to the program. This means 
-// that there is no hbook stuff in it now. Also the output of the
-// program changed to the MagicRawDataFormat. 
-//
-// The "rootification" was done by Dirk Petry and Harald Kornmayer. 
-//
-// In the following you can see the README file of that version:
-//
-// ==================================================
-//
-// Fri Oct 22  1999   D.P.
-//
-// The MAGIC Monte Carlo System
-//
-// Camera Simulation Programme
-// ---------------------------
-//
-// 1) Description
-//
-// This version is the result of the fusion of H.K.'s
-// root_camera which is described below (section 2)
-// and another version by D.P. which had a few additional
-// useful features.
-//
-// The version compiles under Linux with ROOT 2.22 installed
-// (variable ROOTSYS has to be set).
-//
-// Compile as before simply using "make" in the root_camera
-// directory.
-//
-// All features of H.K.'s root_camera were retained.
-//
-// Additional features of this version are:
-//
-//   a) HBOOK is no longer used and all references are removed.
-//
-//   b) Instead of HBOOK, the user is given now the possibility of 
-//      having Diagnostic data in ROOT format as a complement
-//      to the ROOT Raw data.
-//
-//      This data is written to the file which is determined by
-//      the new input parameter "diag_file" in the camera parameter
-//      file.
-//
-//      All source code file belonging to this part have filenames
-//      starting with "MDiag".
-//
-//      The user can read the output file using the following commands
-//      in an interactive ROOT session:
-//
-//        	root [0] .L MDiag.so
-// 	root [1] new TFile("diag.root");
-// 	root [2] new TTreeViewer("T");
-// 	
-//      This brings up a viewer from which all variables of the
-//      TTree can be accessed and histogrammed. This example
-//      assumes that you have named the file "diag.root", that
-//      you are using ROOT version 2.22 or later and that you have
-//      the shared object library "MDiag.so" which is produced
-//      by the Makefile along with the executable "camera".
-//        
-//  !   The contents of the so-called diag file is not yet fixed.
-//  !   At the moment it is what J.C.G. used to put into the HBOOK
-//  !   ntuple. In future versions the moments calculation can be
-//  !   removed and the parameter list be modified correspondingly.
-//
-//   c) Now concatenated reflector files can be read. This is useful
-//      if you have run the reflector with different parameters but
-//      you want to continue the analysis with all reflector data
-//      going into ONE ROOT outputfile.
-//
-//      The previous camera version contained a bug which made reading 
-//      of two or more concatenated reflector files impossible.
-//
-//   d) The reflector output format was changed. It is now version
-//      0.4 .
-//      The change solely consists in a shortening of the flag
-//      definition in the file 
-//
-//            include-MC/MCCphoton.hxx  
-//
-//  !   IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily
-//  !   do so by recompiling camera with the previous version of
-//  !   include-MC/MCCphoton.hxx.
-//
-//      The change was necessary for saving space and better
-//      debugging. From now on, this format can be frozen.
-//
-//  !   For producing reflector output in the new format, you
-//  !   of course have to recompile your reflector with the
-//  !   new include-MC/MCCphoton.hxx .
-//
-//   e) A first version of the pixelization with the larger
-//      outer pixels is implemented. THIS IS NOT YET FULLY
-//      TESTED, but first rough tests show that it works
-//      at least to a good approximation.
-//
-//      The present version implements the camera outline
-//      with 18 "gap-pixels" and 595 pixels in total as
-//      shown in 
-//
-//         http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps
-//
-//      This change involved 
-//
-// 	(i) The file pixels.dat is no longer needed. Instead
-//           the coordinates are generated by the program itself
-//           (takes maybe 1 second). In the file 
-//
-// 		pixel-coords.txt
-//
-// 	  in the same directory as this README, you find a list
-//           of the coordinates generated by this new routine. It
-//           has the format
-//
-//               number   i   j   x  y  size-factor
-//
-//           where i and j are J.C.G.'s so called biaxis hexagonal
-//           coordinates (for internal use) and x and y are the
-//           coordinates of the pixel centers in the standard camera
-//           coordinate system in units of centimeters. The value
-//           of "size-factor" determines the linear size of the pixel
-//           relative to the central pixels. 
-//
-//         (ii) The magic.def file has two additional parameters
-//           which give the number of central pixels and the
-//           number of gap pixels
-//
-//         (iii) In camera.h and camera.cxx several changes were 
-//           necessary, among them the introduction of several
-//           new functions 
-//
-//      The newly suggested outline with asymmetric Winston cones
-//      will be implemented in a later version.
-//
-//   f) phe files can no longer be read since this contradicts
-//      our philosophy that the analysis should be done with other
-//      programs like e.g. EVITA and not with "camera" itself.
-//      This possibility was removed. 
-//
-//   g) ROOT is no longer invoked with an interactive interface.
-//      In this way, camera can better be run as a batch program and
-//      it uses less memory.
-//
-//   h) small changes concerning the variable "t_chan" were necessary in
-//      order to avoid segmentation faults: The variable is used as an
-//      index and it went sometimes outside the limits when camera
-//      was reading proton data. This is because the reflector files
-//      don't contain the photons in a chronological order and also
-//      the timespread can be considerably longer that the foreseen
-//      digitisation timespan. Please see the source code of camera.cxx
-//      round about line 1090.
-//
-//   j) several unused variables were removed, a few warning messages
-//      occur when you compile camera.cxx but these can be ignored at
-//      the moment.
-//
-// In general the program is of course not finished. It still needs
-// debugging, proper trigger simulation, simulation of the asymmetric
-// version of the outer pixels, proper NSB simulation, adaption of
-// the diag "ntuple" contents to our need and others small improvements.
-//
-// In the directory rfl-files there is now a file in reflector format 0.4
-// containing a single event produced by the starfiled adder. It has
-// a duration of 30 ns and represents the region around the Crab Nebula.
-// Using the enclosed input parameter file, camera should process this
-// file without problems.
-//
-// 2) The README for the previous version of root_camera
-//
-// README for a preliminary version of the 
-// root_camera program. 
-//
-// root_camera is based on the program "camera"of Jose Carlos
-// Gonzalez. It was changed in the way that only the pixelisation 
-// and the distibution of the phe to the FADCs works in a 
-// first version. 
-//
-// Using the #undef command most possibilities of the orignal 
-// program are switched of. 
-//
-// The new parts are signed by 
-//
-// - ROOT or __ROOT__ 
-//   nearly all  important codelines for ROOT output are enclosed 
-//   in structures like 
-//   #ifdef __ROOT__ 
-//   
-//     code 
-//
-//   #endif __ROOT__ 
-//
-//   In same case the new lines are signed by a comment with the word 
-//   ROOT in it. 
-//
-//   For timing of the pulse some variable names are changed. 
-//   (t0, t1, t  -->  t_ini, t_fin, t_1st, t_chan,...) 
-//   Look also for this changes. 
-//
-//   For the new root-file is also a change in readparm-files
-//
-//
-// - __DETAIL_TRIGGER__
-//
-//   This is for the implementation of the current work on trigger 
-//   studies. Because the class MTrigger is not well documented it 
-//   isn´t a part of this tar file. Only a dummy File exists. 
-//
-//
-//
-// With all files in the archive, the root_camera program should run. 
-//
-// A reflector file is in the directory rfl-files
-//
-// ==================================================
-//
-// From now on, use CVS for development!!!!
-//
-//
-//
 // Revision 1.3  1999/10/22 15:01:28  petry
 // version sent to H.K. and N.M. on Fri Oct 22 1999
Index: branches/start/MagicSoft/Simulation/Detector/Camera/camera.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.h	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Camera/camera.h	(revision 4308)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: camera.h,v $
-//= $Revision: 1.3 $
+//= $Revision: 1.1.1.1 $
 //= $Author: harald $ 
-//= $Date: 1999-11-11 20:29:29 $
+//= $Date: 1999-11-05 11:59:31 $
 //=
 //=//////////////////////////////////////////////////////////////////////
@@ -85,5 +85,5 @@
 
 #define REFL_PROGRAM reflector
-#define REFL_VERSION 0.3
+#define REFL_VERSION 0.4
 
 const char REFL_SIGNATURE[] = GLUE_postp( REFL_PROGRAM, REFL_VERSION );
@@ -236,5 +236,5 @@
 //!@{
 
-#define QE_FILE     "../Data/qe.dat"
+#define QE_FILE     "qe.dat"
 
 //!@}
@@ -278,230 +278,4 @@
 /*
  *$Log: not supported by cvs2svn $
- *Revision 1.2  1999/11/10 07:42:41  harald
- *Small change to read the right data files in.
- *
- *Revision 1.1.1.1  1999/11/05 11:59:31  harald
- *This the starting point for CVS controlled further developments of the
- *camera program. The program was originally written by Jose Carlos. 
- *But here you can find a "rootified" version to the program. This means 
- *that there is no hbook stuff in it now. Also the output of the
- *program changed to the MagicRawDataFormat. 
- *
- *The "rootification" was done by Dirk Petry and Harald Kornmayer. 
- *
- *In the following you can see the README file of that version:
- *
- *==================================================
- *
- *Fri Oct 22  1999   D.P.
- *
- *The MAGIC Monte Carlo System
- *
- *Camera Simulation Programme
- *---------------------------
- *
- *1) Description
- *
- *This version is the result of the fusion of H.K.'s
- *root_camera which is described below (section 2)
- *and another version by D.P. which had a few additional
- *useful features.
- *
- *The version compiles under Linux with ROOT 2.22 installed
- *(variable ROOTSYS has to be set).
- *
- *Compile as before simply using "make" in the root_camera
- *directory.
- *
- *All features of H.K.'s root_camera were retained.
- *
- *Additional features of this version are:
- *
- *  a) HBOOK is no longer used and all references are removed.
- *
- *  b) Instead of HBOOK, the user is given now the possibility of 
- *     having Diagnostic data in ROOT format as a complement
- *     to the ROOT Raw data.
- *
- *     This data is written to the file which is determined by
- *     the new input parameter "diag_file" in the camera parameter
- *     file.
- *
- *     All source code file belonging to this part have filenames
- *     starting with "MDiag".
- *
- *     The user can read the output file using the following commands
- *     in an interactive ROOT session:
- *
- *       	root [0] .L MDiag.so
- *	root [1] new TFile("diag.root");
- *	root [2] new TTreeViewer("T");
- *	
- *     This brings up a viewer from which all variables of the
- *     TTree can be accessed and histogrammed. This example
- *     assumes that you have named the file "diag.root", that
- *     you are using ROOT version 2.22 or later and that you have
- *     the shared object library "MDiag.so" which is produced
- *     by the Makefile along with the executable "camera".
- *       
- * !   The contents of the so-called diag file is not yet fixed.
- * !   At the moment it is what J.C.G. used to put into the HBOOK
- * !   ntuple. In future versions the moments calculation can be
- * !   removed and the parameter list be modified correspondingly.
- *
- *  c) Now concatenated reflector files can be read. This is useful
- *     if you have run the reflector with different parameters but
- *     you want to continue the analysis with all reflector data
- *     going into ONE ROOT outputfile.
- *
- *     The previous camera version contained a bug which made reading 
- *     of two or more concatenated reflector files impossible.
- *
- *  d) The reflector output format was changed. It is now version
- *     0.4 .
- *     The change solely consists in a shortening of the flag
- *     definition in the file 
- *
- *           include-MC/MCCphoton.hxx  
- *
- * !   IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily
- * !   do so by recompiling camera with the previous version of
- * !   include-MC/MCCphoton.hxx.
- *
- *     The change was necessary for saving space and better
- *     debugging. From now on, this format can be frozen.
- *
- * !   For producing reflector output in the new format, you
- * !   of course have to recompile your reflector with the
- * !   new include-MC/MCCphoton.hxx .
- *
- *  e) A first version of the pixelization with the larger
- *     outer pixels is implemented. THIS IS NOT YET FULLY
- *     TESTED, but first rough tests show that it works
- *     at least to a good approximation.
- *
- *     The present version implements the camera outline
- *     with 18 "gap-pixels" and 595 pixels in total as
- *     shown in 
- *
- *        http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps
- *
- *     This change involved 
- *
- *	(i) The file pixels.dat is no longer needed. Instead
- *          the coordinates are generated by the program itself
- *          (takes maybe 1 second). In the file 
- *
- *		pixel-coords.txt
- *
- *	  in the same directory as this README, you find a list
- *          of the coordinates generated by this new routine. It
- *          has the format
- *
- *              number   i   j   x  y  size-factor
- *
- *          where i and j are J.C.G.'s so called biaxis hexagonal
- *          coordinates (for internal use) and x and y are the
- *          coordinates of the pixel centers in the standard camera
- *          coordinate system in units of centimeters. The value
- *          of "size-factor" determines the linear size of the pixel
- *          relative to the central pixels. 
- *
- *        (ii) The magic.def file has two additional parameters
- *          which give the number of central pixels and the
- *          number of gap pixels
- *
- *        (iii) In camera.h and camera.cxx several changes were 
- *          necessary, among them the introduction of several
- *          new functions 
- *
- *     The newly suggested outline with asymmetric Winston cones
- *     will be implemented in a later version.
- *
- *  f) phe files can no longer be read since this contradicts
- *     our philosophy that the analysis should be done with other
- *     programs like e.g. EVITA and not with "camera" itself.
- *     This possibility was removed. 
- *
- *  g) ROOT is no longer invoked with an interactive interface.
- *     In this way, camera can better be run as a batch program and
- *     it uses less memory.
- *
- *  h) small changes concerning the variable "t_chan" were necessary in
- *     order to avoid segmentation faults: The variable is used as an
- *     index and it went sometimes outside the limits when camera
- *     was reading proton data. This is because the reflector files
- *     don't contain the photons in a chronological order and also
- *     the timespread can be considerably longer that the foreseen
- *     digitisation timespan. Please see the source code of camera.cxx
- *     round about line 1090.
- *
- *  j) several unused variables were removed, a few warning messages
- *     occur when you compile camera.cxx but these can be ignored at
- *     the moment.
- *
- *In general the program is of course not finished. It still needs
- *debugging, proper trigger simulation, simulation of the asymmetric
- *version of the outer pixels, proper NSB simulation, adaption of
- *the diag "ntuple" contents to our need and others small improvements.
- *
- *In the directory rfl-files there is now a file in reflector format 0.4
- *containing a single event produced by the starfiled adder. It has
- *a duration of 30 ns and represents the region around the Crab Nebula.
- *Using the enclosed input parameter file, camera should process this
- *file without problems.
- *
- *2) The README for the previous version of root_camera
- *
- *README for a preliminary version of the 
- *root_camera program. 
- *
- *root_camera is based on the program "camera"of Jose Carlos
- *Gonzalez. It was changed in the way that only the pixelisation 
- *and the distibution of the phe to the FADCs works in a 
- *first version. 
- *
- *Using the #undef command most possibilities of the orignal 
- *program are switched of. 
- *
- *The new parts are signed by 
- *
- *- ROOT or __ROOT__ 
- *  nearly all  important codelines for ROOT output are enclosed 
- *  in structures like 
- *  #ifdef __ROOT__ 
- *  
- *    code 
- *
- *  #endif __ROOT__ 
- *
- *  In same case the new lines are signed by a comment with the word 
- *  ROOT in it. 
- *
- *  For timing of the pulse some variable names are changed. 
- *  (t0, t1, t  -->  t_ini, t_fin, t_1st, t_chan,...) 
- *  Look also for this changes. 
- *
- *  For the new root-file is also a change in readparm-files
- *
- *
- *- __DETAIL_TRIGGER__
- *
- *  This is for the implementation of the current work on trigger 
- *  studies. Because the class MTrigger is not well documented it 
- *  isn´t a part of this tar file. Only a dummy File exists. 
- *
- *
- *
- *With all files in the archive, the root_camera program should run. 
- *
- *A reflector file is in the directory rfl-files
- *
- *==================================================
- *
- *From now on, use CVS for development!!!!
- *
- *
- *
  *Revision 1.3  1999/10/22 15:32:56  petry
  *tidied-up version, really sent to H.K. and N.M., 22-10-99
Index: branches/start/MagicSoft/Simulation/Detector/Camera/config.mk.Linux
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/config.mk.Linux	(revision 353)
+++ 	(revision )
@@ -1,94 +1,0 @@
-##################################################################
-#
-# 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 camera program
-# Notes:   
-#    
-#---------------------------------------------------------------
-# $RCSfile: config.mk.Linux,v $
-# $Revision: 1.1 $
-# $Author: petry $ 
-# $Date: 2000-01-25 15:21:43 $
-##################################################################
-# @maintitle
-
-# @code
-
-# program
-
-PROGRAM = camera
-
-# compilers
-
-CC            = g++
-CXX           = g++
-F77           = f77
-
-DOCUM         = ${HOME}/detector/sus/sus
-
-# includes
-
-INCLUDE         = ../include-GENERAL
-INCLUDE_COR     = ../include-CORSIKA
-INCLUDE_MC      = ../include-MC
-INCLUDE_TRIGGER = ../include-MTrigger
-INCLUDE_EVITA   = ../../../include-Classes
-INCLUDE_REFL    = ../Reflector
-INCLUDE_ROOT    = ${ROOTSYS}/include
-INCLUDE_CPLUS   = /usr/include/g++
-
-# all the stuff for ROOT
-
-# for ROOT 2.23 or later
-
-ROOTLIBS      = -L$(ROOTSYS)/lib -lNew -lCint -lCore \
-                -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMinuit \
-                -lPostscript -lProof -lTree 
-ROOTGLIBS     = -lGpad -lGui -lGX11 -lX3d
-
-# for ROOT 2.22 or earlier
-#
-#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 -rdynamic
-
-
-# compiler options
-
-#OPTIM    = -O2 -ieee  
-OPTIM    = -O2 -Wall -fno-rtti -fno-exceptions -fPIC
-DEBUG    = -g 
-
-# libraries
-
-RANLIBDIR = ../lib
-CERNDIR = /cern
-
-# system
-
-SYSTEM  = linux
-
-# uncomment this for quiet compilation
-
-.SILENT:
-
-# @endcode
-##EOF
Index: branches/start/MagicSoft/Simulation/Detector/Camera/config.mk.linux-gnu
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/config.mk.linux-gnu	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Camera/config.mk.linux-gnu	(revision 4308)
@@ -18,7 +18,7 @@
 #---------------------------------------------------------------
 # $RCSfile: config.mk.linux-gnu,v $
-# $Revision: 1.2 $
+# $Revision: 1.1.1.1 $
 # $Author: harald $ 
-# $Date: 1999-11-19 08:40:43 $
+# $Date: 1999-11-05 11:59:32 $
 ##################################################################
 # @maintitle
@@ -47,21 +47,5 @@
 INCLUDE_REFL    = ../Reflector
 INCLUDE_ROOT    = ${ROOTSYS}/include
-INCLUDE_CPLUS   = /usr/include/g++
-
-# all the stuff for ROOT
-
-
-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 -rdynamic
-
-
-# compiler options
+INCLUDE_g++     = /usr/include/g++
 
 #OPTIM    = -O2 -ieee  
Index: branches/start/MagicSoft/Simulation/Detector/Camera/config.mk.osf1
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/config.mk.osf1	(revision 353)
+++ 	(revision )
@@ -1,82 +1,0 @@
-##################################################################
-#
-# 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 camera program
-# Notes:   
-#    
-#---------------------------------------------------------------
-# $RCSfile: config.mk.osf1,v $
-# $Revision: 1.1 $
-# $Author: harald $ 
-# $Date: 1999-11-19 08:40:44 $
-##################################################################
-# @maintitle
-
-# @code
-
-# program
-
-PROGRAM = camera
-
-# compilers
-
-CC            = cc
-CXX           = cxx
-F77           = f77
-
-DOCUM         = ${HOME}/detector/sus/sus
-
-# includes
-
-INCLUDE         = ../include-GENERAL
-INCLUDE_COR     = ../include-CORSIKA
-INCLUDE_MC      = ../include-MC
-INCLUDE_TRIGGER = ../include-MTrigger
-INCLUDE_EVITA   = ../../../include-Classes
-INCLUDE_REFL    = ../Reflector
-INCLUDE_ROOT    = ${ROOTSYS}/include
-INCLUDE_CPLUS   = /usr/include/cxx
-
-OPTIM    = -ieee -arch host    
-#OPTIM    = -O2 -Wall -fno-rtti -fno-exceptions -fPIC
-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 = ../lib
-CERNDIR = /cern
-
-# system
-
-SYSTEM  = linux
-
-# uncomment this for quiet compilation
-
-.SILENT:
-
-# @endcode
-##EOF
-
Index: branches/start/MagicSoft/Simulation/Detector/Camera/input.card
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/input.card	(revision 353)
+++ 	(revision )
@@ -1,19 +1,0 @@
-camera 0.3
-#data_from_stdin
-input_file    /data/reflect/test.rfl
-output_file   /data/camera/test.phe
-data_file     /data/camera/test.dat
-diag_file     /data/camera/test-diag.root
-root_file     /data/camera/test-raw.root
-write_all_images
-write_all_data
-ct_file       ../Data/magic.def
-ana_pixels    595
-nsb_mean      0.
-nsb_off
-threshold     0.0
-tail_cut      0.0
-islands_off
-seeds   69184 10406
-end_file   
-
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/Makefile
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/Makefile	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/Makefile	(revision 4308)
@@ -19,7 +19,7 @@
 #
 # $RCSfile: Makefile,v $
-# $Revision: 1.4 $
+# $Revision: 1.1.1.1 $
 # $Author: harald $ 
-# $Date: 2000-01-28 09:19:54 $
+# $Date: 1999-10-29 07:00:32 $
 #
 ##################################################################
@@ -28,5 +28,5 @@
 # @code
 
-INCLUDEMK = config.mk.${OSTYPE}
+INCLUDEMK = config.mk
 include ${INCLUDEMK}
 
@@ -40,5 +40,5 @@
 	   -I${INCLUDE_MC}   \
 	   -I${INCLUDE_REFL} \
-           -I/usr/include  -I/usr/include/g++
+           -I/usr/include
 
 #CERNLIBDIR = ${CERNDIR}/pro/lib/
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/atm.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/atm.cxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/atm.cxx	(revision 4308)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: atm.cxx,v $
-//= $Revision: 1.2 $
+//= $Revision: 1.1.1.1 $
 //= $Author: harald $ 
-//= $Date: 1999-11-01 11:05:53 $
+//= $Date: 1999-10-29 07:00:32 $
 //=
 //=//////////////////////////////////////////////////////////////////////
@@ -158,5 +158,5 @@
   for (i=0; i<=ATM_CORSIKA; i++) {
     strcpy(s2, ATM_MODELS_NAMES[i]);
-    if (strcmp(s, s2) == 0 )
+    if (strcmp(s, s2) == NULL)
       break;
   }
@@ -216,8 +216,4 @@
 //
 // $Log: not supported by cvs2svn $
-// Revision 1.1.1.1  1999/10/29  07:00:32  harald
-// This is the startpoint for the futher development of the Reflector program
-// of Jose Carlos. For all developments use this CVS-controlled directory.
-//
 // Revision 1.3  1999/03/24  16:32:59  gonzalez
 // REFLECTOR 1.1: Release
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/config.mk
===================================================================
--- branches/start/MagicSoft/Simulation/Detector/Reflector/config.mk	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/config.mk	(revision 4308)
@@ -0,0 +1,61 @@
+##################################################################
+#
+# 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,v $
+# $Revision: 1.1.1.1 $
+# $Author: harald $ 
+# $Date: 1999-10-29 07:00:33 $
+##################################################################
+# @maintitle
+
+# @code
+
+# program
+
+PROGRAM = camera
+
+# compilers & tools
+
+CC            = cc
+CXX           = cxx
+F77           = f77
+
+DOCUM         = ../sus/sus
+RATE          = ../../comstat/comstat -g -p 
+
+# includes		
+
+INCLUDE       = ../include-GENERAL
+INCLUDE_COR   = ../include-CORSIKA
+INCLUDE_MC    = ../include-MC
+INCLUDE_REFL  = .
+
+OPTIM    = -O
+DEBUG    = -g
+
+# libraries
+
+RANLIBDIR = ../lib
+CERNDIR = /CERN
+
+# system
+
+SYSTEM  = osf
+
+# @endcode
+##EOF
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/config.mk.linux-gnu
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/config.mk.linux-gnu	(revision 353)
+++ 	(revision )
@@ -1,61 +1,0 @@
-##################################################################
-#
-# 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 $
-# $Author: harald $ 
-# $Date: 1999-11-01 10:53:50 $
-##################################################################
-# @maintitle
-
-# @code
-
-# program
-
-PROGRAM = camera
-
-# compilers & tools
-
-CC            = gcc
-CXX           = g++
-F77           = g77
-
-DOCUM         = ../sus/sus
-RATE          = ../../comstat/comstat -g -p 
-
-# includes		
-
-INCLUDE       = ../include-GENERAL
-INCLUDE_COR   = ../include-CORSIKA
-INCLUDE_MC    = ../include-MC
-INCLUDE_REFL  = .
-
-OPTIM    = 
-DEBUG    = -g
-
-# libraries
-
-RANLIBDIR = ../lib
-CERNDIR = /CERN
-
-# system
-
-SYSTEM  = linux
-
-# @endcode
-##EOF
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/config.mk.osf1
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/config.mk.osf1	(revision 353)
+++ 	(revision )
@@ -1,61 +1,0 @@
-##################################################################
-#
-# 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 $
-# $Author: harald $ 
-# $Date: 1999-11-01 10:53:51 $
-##################################################################
-# @maintitle
-
-# @code
-
-# program
-
-PROGRAM = camera
-
-# compilers & tools
-
-CC            = cc
-CXX           = cxx
-F77           = f77
-
-DOCUM         = ../sus/sus
-RATE          = ../../comstat/comstat -g -p 
-
-# includes		
-
-INCLUDE       = ../include-GENERAL
-INCLUDE_COR   = ../include-CORSIKA
-INCLUDE_MC    = ../include-MC
-INCLUDE_REFL  = .
-
-OPTIM    = -O
-DEBUG    = -g
-
-# libraries
-
-RANLIBDIR = ../lib
-CERNDIR = /CERN
-
-# system
-
-SYSTEM  = osf
-
-# @endcode
-##EOF
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/param
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/param	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/param	(revision 4308)
@@ -6,5 +6,5 @@
 # Sample parameters file
 #
-verbose_level 1
+verbose_level 0
 #
 #fixed_target  0. 0.
@@ -12,19 +12,20 @@
 #skip 1 2946
 #range_events 381 382
-max_events   10000
+#max_events   2
 #energy_cuts   800. 1000.
 #
-ct_file        ../Data/magic.def 
+ct_file        magic.def 
 #
-output_file   /hd02/Maggi/RefData/prot.rfl
+#output_file   /hd80/MC/CT1/ana/g_magic_run16.rfl
+output_file   ./p.dummy
 #
-atm_model     ATM_CORSIKA
-#atm_model     ATM_NOATMOSPHERE
+#atm_model     ATM_CORSIKA
+atm_model     ATM_NOATMOSPHERE
 #
 data_paths 1
-/hd02/Maggi/Data/mmcs_prod_14_2003_30:30000
+./
 #
-#data_from_stdin
-#data_to_stdout
+data_from_stdin
+data_to_stdout
 #
 #output_file   ./pb.rfl
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/readparam.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/readparam.cxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/readparam.cxx	(revision 4308)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: readparam.cxx,v $
-//= $Revision: 1.2 $
+//= $Revision: 1.1.1.1 $
 //= $Author: harald $ 
-//= $Date: 2000-01-28 09:19:54 $
+//= $Date: 1999-10-29 07:00:33 $
 //=
 //=//////////////////////////////////////////////////////////////////////
@@ -120,7 +120,4 @@
 static int Data_To_STDOUT = FALSE;
 
-//@: number of times a shower is going to be processed
-static int nRepeat_Random = 1;
-
 //!@}
 
@@ -151,5 +148,5 @@
 // @desc  read parameters from the stdin / parameters file
 //
-// @var   *filename  Name of the parameters file (0->STDIN)
+// @var   *filename  Name of the parameters file (NULL->STDIN)
 //
 // @date Mon Sep 14 13:27:56 MET DST 1998
@@ -169,9 +166,9 @@
 
   // use cin or ifile (reading from STDIN or from parameters file?
-  if ( filename != 0 )
+  if ( filename != NULL )
     ifile.open( filename );
 
   // get signature
-  if ( filename != 0 )
+  if ( filename != NULL )
     ifile.getline(line, LINE_MAX_LENGTH);
   else
@@ -191,5 +188,5 @@
 
     // get line from file or stdin
-    if ( filename != 0 )
+    if ( filename != NULL )
       ifile.getline(line, LINE_MAX_LENGTH);
     else
@@ -236,5 +233,5 @@
       for (i=0; i<Num_of_paths; i++) {
 
-        if ( filename != 0 )
+        if ( filename != NULL )
           ifile.getline(Paths_list[i], PATH_MAX_LENGTH);
         else
@@ -361,4 +358,5 @@
       
       break;
+      
     
     case random_pointing:     // uses a random CT pointing for each shower
@@ -371,16 +369,8 @@
       cerr << "random_pointing: " << Random_Pointing_MaxDist << ' ';
       Random_Pointing_MaxDist = RAD(Random_Pointing_MaxDist);
-      cerr << Random_Pointing_MaxDist << " radians \n" << flush;
-
-      break;
-      
-    case repeat_random:       // number of times a random pointing is to be done
-          
-      // set nRepeat_Random
-      sscanf(line, "%s %d", token, &nRepeat_Random);
-
-      cerr << "repeat_random: " << nRepeat_Random << '\n' << flush;
-
-      break;
+      cerr << Random_Pointing_MaxDist << " radians \n";
+
+      break;
+      
     
     case block:               // analyzes data in blocks
@@ -420,5 +410,5 @@
   } // while (! is_end)
 
-  if ( filename != 0 ) {
+  if ( filename != NULL ) {
     ifile.close();
   }
@@ -831,24 +821,4 @@
 
 
-//!---------------------------------------------------------------------
-// @name get_repeat_random
-//       
-// @desc get number of times a random displacement is going to be done
-//
-// @return   number of times
-//
-// @date 
-//----------------------------------------------------------------------
-// @function
-
-//!@{ 
-int
-get_repeat_random(void)
-{
-  return ( nRepeat_Random );
-}
-//!@}
-
-
 //=------------------------------------------------------------
 //!@subsection Log of this file.
@@ -857,7 +827,4 @@
 //
 // $Log: not supported by cvs2svn $
-// Revision 1.14  2000/01/27  10:47:54  gonzalez
-// JAN2000-STABLE
-//
 // Revision 1.13  1999/10/05  11:06:38  gonzalez
 // Sep. 1999
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/readparam.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/readparam.h	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/readparam.h	(revision 4308)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: readparam.h,v $
-//= $Revision: 1.2 $
+//= $Revision: 1.1.1.1 $
 //= $Author: harald $ 
-//= $Date: 2000-01-28 09:19:54 $
+//= $Date: 1999-10-29 07:00:33 $
 //=
 //=//////////////////////////////////////////////////////////////////////
@@ -123,5 +123,4 @@
 T(block),           /* size of the block of files, when 'blocking' */ \
 T(random_pointing), /* random CT pointing from each shower (hadrons) */ \
-T(repeat_random),   /* number of times a random pointing is to be done */ \
 T(data_from_stdin), /* read data from STDIN */ \
 T(data_to_stdout),  /* read data from STDIN */ \
@@ -194,5 +193,4 @@
 int get_data_to_stdout(void);
 int get_random_pointing(float *maxdist);
-int get_repeat_random(void);
 
 //!@}
@@ -211,7 +209,4 @@
 /*
  * $Log: not supported by cvs2svn $
- * Revision 1.14  2000/01/27  10:47:54  gonzalez
- * JAN2000-STABLE
- *
  * Revision 1.13  1999/10/05  11:06:37  gonzalez
  * Sep. 1999
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/reflector.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/reflector.cxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/reflector.cxx	(revision 4308)
@@ -20,7 +20,7 @@
 //
 // $RCSfile: reflector.cxx,v $
-// $Revision: 1.10 $
+// $Revision: 1.1.1.1 $
 // $Author: harald $ 
-// $Date: 2000-01-31 20:53:57 $
+// $Date: 1999-10-29 07:00:33 $
 //
 ////////////////////////////////////////////////////////////////////////
@@ -795,10 +795,4 @@
 int Random_Pointing = FALSE;
 
-//@: number of times a shower is going to be processed
-int nRepeat_Random;
-
-//@: number of times a shower is already processed
-int nRepeated;
-
 //@: maximum random pointing distance
 float Random_Pointing_MaxDist; // [radians]
@@ -927,5 +921,5 @@
   parname[0] = '\0';
 
-  optarg = 0;
+  optarg = NULL;
   while ( !errflg && ((ch = getopt(argc, argv, COMMAND_LINE_OPTIONS)) != -1) )
     switch (ch) {
@@ -951,5 +945,5 @@
 
   if ( strlen(parname) < 1 )
-    readparam(0);
+    readparam(NULL);
   else
     readparam(parname);
@@ -1171,12 +1165,7 @@
     outputfile.write( SIGNATURE, sizeof(SIGNATURE) );
 
-  // get random pointing variables
-  
-  Random_Pointing = get_random_pointing( &Random_Pointing_MaxDist );
-
   // generate a sort of log information
 
   if ( verbose >= VERBOSE_MINIMAL ) {
-    log( SIGNATURE, "Random poi.:       %f\n", Random_Pointing_MaxDist );
     log( SIGNATURE, "Atmospheric model: %s\n", get_atm_mod() );
     log( SIGNATURE, "Number of paths:   %d\n", get_num_of_paths() );
@@ -1188,8 +1177,4 @@
 
   get_energy_cuts( &lE, &uE );
-
-  // get number of times which a shower is going to be used
-  // at different pointing directions
-  nRepeat_Random = get_repeat_random();   
 
   /*!@'
@@ -1217,5 +1202,5 @@
     directory = opendir(pathname);
 
-    if ( directory == 0 ) 
+    if ( directory == NULL ) 
       error( SIGNATURE, 
              "Cannot open directory %s\n", pathname );
@@ -1247,5 +1232,5 @@
         log(SIGNATURE, " * * * READING DATA FROM STDIN * * *\n");
 
-      get_stdin_files(0, lE, uE, TRUE);
+      get_stdin_files(NULL, lE, uE, TRUE);
 
     }
@@ -1261,8 +1246,6 @@
     //            maximum number is not reached ) )
 
-    nRepeated = 0;
-
     while ( (
-             ((de = readdir( directory )) != 0) &&
+             ((de = readdir( directory )) != NULL) &&
              (num_cer_files < max_num_cer_files)
              )
@@ -1272,9 +1255,5 @@
              (num_cer_files < max_num_cer_files)
              ) ) {
-	/*
-      // increment the number of times this files is used
-      nRepeated++;
-	*/
-
+      
       // if Block > 0, then we wait till a file __DOIT is present
       
@@ -1472,5 +1451,5 @@
 
       // do we want random pointing (around shower axis) ?
-      if ( Random_Pointing == TRUE ) {
+      if ( get_random_pointing( &Random_Pointing_MaxDist ) == TRUE ) {
 
         // we do, then get a random position
@@ -2007,10 +1986,8 @@
         // the photon actually hit the mirror!!
 
-        
-        t = t + ((( xm[2] > 0. ) ? -1.0 : +1.0) *
-                 sqrt( SQR(xm[0] - xcut[0]) +
-                       SQR(xm[1] - xcut[1]) +
-                       SQR(xm[2] - xcut[2]) ) / Speed_of_Light_air_cmns);
-                 
+        t = t - sqrt( SQR(xm[0] - xcut[0]) +
+                      SQR(xm[1] - xcut[1]) +
+                      SQR(xm[2] - xcut[2]) ) / Speed_of_Light_air_cmns;
+        
         // add path from the mirror till the camera
 
@@ -2234,5 +2211,5 @@
 
   delete [] ct_Focal;        
-  ct_Focal = 0;
+  ct_Focal = NULL;
 
   // delete reflectivity table
@@ -2243,5 +2220,5 @@
   
   delete [] Reflectivity;    
-  Reflectivity = 0;
+  Reflectivity = NULL;
 
   // delete mirrors' data table
@@ -2252,5 +2229,5 @@
   
   delete [] ct_data;
-  ct_data = 0;
+  ct_data = NULL;
 }
 //!@}
@@ -3525,30 +3502,21 @@
   // using this option
 
-  it = acos(cos(range) + RandomNumber * (1 - cos(range)));
+  it = RandomNumber * range;
   ip = RandomNumber * 2.0 * M_PI;
 
-  if ( theta == 0.0 ) {
-
-    *newtheta = it;
-    *newphi = ip;
-
-  } else {
-    
-    sin_theta = sin(theta);
-    cos_theta = cos(theta);
-
-    cos_newtheta = cos_theta*cos(it) + sin_theta*sin(it)*cos(ip);
-    *newtheta = acos( cos_newtheta );
-    sin_newtheta = sin( *newtheta );
-    
-    sin_iphi = sin(it)*sin(ip) / sin_newtheta;
-    cos_iphi = (( cos(it) - cos_newtheta * cos_theta ) /
-                ( sin_newtheta * sin_theta ));
-    
-    iphi = atan2( sin_iphi, cos_iphi );
-    
-    *newphi = phi + iphi;
-
-  }
+  sin_theta = sin(theta);
+  cos_theta = cos(theta);
+
+  cos_newtheta = cos_theta*cos(it) + sin_theta*sin(it)*cos(ip);
+  *newtheta = acos( cos_newtheta );
+  sin_newtheta = sin( *newtheta );
+
+  sin_iphi = sin(it)*sin(ip) / sin_newtheta;
+  cos_iphi = (( cos(it) - cos_newtheta * cos_theta ) /
+              ( sin_newtheta * sin_theta ));
+
+  iphi = atan2( sin_iphi, cos_iphi );
+
+  *newphi = phi + iphi;
 
   return( it );
@@ -3563,14 +3531,4 @@
 //
 // $Log: not supported by cvs2svn $
-// Revision 1.9  2000/01/28 09:19:54  harald
-// A new version from JoseCarlosGonzalez. The old routine for random_pointing
-// was not correct. This one should be okay!!
-//
-// Revision 1.20  2000/01/27  10:47:54  gonzalez
-// JAN2000-STABLE
-//
-// Revision 1.19  1999/11/19  20:52:31  gonzalez
-// *** empty log message ***
-//
 // Revision 1.18  1999/10/05  11:11:12  gonzalez
 // Sep.1999
Index: branches/start/MagicSoft/Simulation/Detector/Reflector/reflector.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Reflector/reflector.h	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/Reflector/reflector.h	(revision 4308)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: reflector.h,v $
-//= $Revision: 1.2 $
+//= $Revision: 1.1.1.1 $
 //= $Author: harald $ 
-//= $Date: 2000-01-28 09:19:54 $
+//= $Date: 1999-10-29 07:00:34 $
 //=
 //=//////////////////////////////////////////////////////////////////////
Index: branches/start/MagicSoft/Simulation/Detector/include-GENERAL/jcdebug.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-GENERAL/jcdebug.h	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/include-GENERAL/jcdebug.h	(revision 4308)
@@ -19,10 +19,9 @@
 #define __JC_DEBUG__
 
-
-#ifdef __DEBUG__
-
 // @code
 
 int DBGi;
+
+#ifdef __DEBUG__
 
 #define DBGvec(a,n,m)    {puts("DBG> vector " #a);\
Index: branches/start/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/include-MC/MCCphoton.hxx	(revision 4308)
@@ -42,12 +42,12 @@
 // const char variables to use in MCCphoton::isA() function
 
-const char FLAG_START_OF_RUN[]   = "\nSTART---RUN\n";
-const char FLAG_START_OF_EVENT[] = "\nSTART-EVENT\n";
-const char FLAG_END_OF_EVENT[] =   "\nEND---EVENT\n";
-const char FLAG_END_OF_RUN[] =     "\nEND-----RUN\n";
-const char FLAG_END_OF_FILE[] =    "\nEND----FILE\n";
-const char FLAG_END_OF_STDIN[] =   "\nEND---STDIN\n";
+const char FLAG_START_OF_RUN[]   = "START-RUN-START-RUN-START-RUN-START-RUN-";
+const char FLAG_START_OF_EVENT[] = "START-EVENT-START-EVENT-START-EVENT-STAR";
+const char FLAG_END_OF_EVENT[] =   "END-EVENT-END-EVENT-END-EVENT-END-EVENT-";
+const char FLAG_END_OF_RUN[] =     "END-RUN-END-RUN-END-RUN-END-RUN-END-RUN-";
+const char FLAG_END_OF_FILE[] =    "END-FILE-END-FILE-END-FILE-END-FILE-END-";
+const char FLAG_END_OF_STDIN[] =   "END-STDIN-END-STDIN-END-STDIN-END-STDIN-";
 
-#define SIZE_OF_FLAGS  13
+#define SIZE_OF_FLAGS  40
 
 // @endcode
@@ -79,4 +79,5 @@
   // reads photon from binary input stream
   Int_t read ( ifstream &is ) {
+    int n;
     is.read (  (char *)this, mysize() );
     return is.gcount();
Index: branches/start/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx	(revision 4308)
@@ -144,14 +144,4 @@
                               ((CorePos[1][ncore])*(CorePos[1][ncore])) ) );
   }
-  
-  // get the core position in X 
-  inline Float_t get_coreX ( Int_t ncore = 0 ) {
-    return ( (Float_t) CorePos[0][ncore] );
-  }
-
-  // get the core position in Y 
-  inline Float_t get_coreY ( Int_t ncore = 0 ) {
-    return ( (Float_t) CorePos[1][ncore] );
-  }
 
   // transport from COREventHeader to MCEventHeader
@@ -187,29 +177,16 @@
   // get deviations of the CT from the original shower direction
   inline Float_t get_deviations ( Float_t *t1, Float_t *t2 ) {
- 
-    float ct1,st1,cp1,sp1;
-    float ct2,st2,cp2,sp2;
-    float x1,y1,z1;
-    float x2,y2,z2;
-
-    ct1 = cos(Theta);
-    st1 = sin(Theta);
-    cp1 = cos(Phi);
-    sp1 = sin(Phi);
-
-    ct2 = cos(Theta+deviationTheta);
-    st2 = sin(Theta+deviationTheta);
-    cp2 = cos(Phi+deviationPhi);
-    sp2 = sin(Phi+deviationPhi);
-
-    x1 = st1*cp1; y1 = st1*sp1; z1 = ct1;
-    x2 = st2*cp2; y2 = st2*sp2; z2 = ct2;
-
+
+    float r;
+
+    r = sqrt(deviationTheta*deviationTheta + deviationPhi*deviationPhi);
     *t1 = deviationTheta;
     *t2 = deviationPhi;
-    
-    return (  acos(x1*x2 + y1*y2 + z1*z2) );
-  }
-  
+
+    // cerr << '\n' << deviationTheta << ' ' << deviationPhi << '\n' << flush;
+
+    return ( r );
+  }
+
   inline void print ( void ) {
     float *ptr = (float *)this;
Index: branches/start/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx
===================================================================
--- branches/start/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Detector/include-MFadc/MFadc.cxx	(revision 4308)
@@ -0,0 +1,313 @@
+/////////////////////////////////////////////////////////////////
+//
+//  MFadc
+//
+//  
+#include "MFadc.hxx"
+
+#include "MMcEvt.h"
+
+#include "TROOT.h"
+#include <TApplication.h>
+#include <TVirtualX.h>
+#include <TGClient.h>
+
+#include "TH1.h"
+#include "TObjArray.h"
+
+#include "MGFadcSignal.hxx"
+
+MFadc::MFadc() { 
+  //
+  //  default constructor 
+  //  
+  //  The procedure is the following: 
+  //  1. some parameters of the trigger are set to default.   
+  //     this parameters of the trigger may be changed
+  //  3. Then the all signals are set to zero
+  
+  fwhm_resp = MFADC_RESPONSE_FWHM       ; 
+  ampl_resp = MFADC_RESPONSE_AMPLITUDE  ; 
+  
+  //
+  //    set up the response shape
+  // 
+  Int_t  i ; 
+  
+  Float_t   sigma ; 
+  Float_t   x, x0 ; 
+
+  sigma = fwhm_resp / 2.35 ; 
+  x0 = 3*sigma ; 
+  
+  Float_t   dX, dX2 ; 
+  
+  dX  = WIDTH_FADC_TIMESLICE / SUBBINS ; 
+  dX2 = dX/2. ; 
+  
+  for (i=0; i< RESPONSE_SLICES_MFADC ; i++ ) {  
+
+    x = i * dX + dX2 ; 
+    
+    //
+    //   the value 0.125 was introduced to normalize the things
+    //
+    sing_resp[i] = 0.125 *  
+      ampl_resp * expf(-0.5 * (x-x0)*(x-x0) / (sigma*sigma) ) ; 
+
+  } 
+
+  //
+  //    init the Random Generator for Electonic Noise
+  //
+
+  GenElec = new TRandom () ; 
+
+  //
+  //  set all the booleans used to FALSE, indicating that the pixel is not 
+  //  used in this event. 
+  //
+  
+  for ( i =0 ; i <CAMERA_PIXELS ; i++ ) { 
+    used [i] = FALSE ; 
+  }
+}
+
+  
+void MFadc::Reset() { 
+  //
+  //  set all values of the signals to zero
+  //
+  Int_t  i ; 
+  
+  for ( i =0 ; i <CAMERA_PIXELS ; i++ ) {
+    used [i] = FALSE ; 
+  } 
+}
+
+
+void MFadc::Fill( Int_t iPix, Float_t time, Float_t amplitude ) { 
+  
+  //
+  // fills the information about one single Phe in the Trigger class
+  //
+  // parameter is the number of the pixel and the time-difference to the
+  // first particle
+  //
+  //
+
+  Int_t i, ichan, ichanfadc ; 
+  
+  //
+  //   first we have to check if the pixel iPix is used or not until now
+  //   if this is the first use, reset all signal for that pixels
+  // 
+  if ( iPix > CAMERA_PIXELS ) {
+    cout << " WARNING:  MFadc::Fill() :  iPix greater than CAMERA_PIXELS"
+	 << endl ;
+    exit(987) ; 
+  }
+
+  if ( used[iPix] == FALSE ) {
+    used [iPix] = TRUE ; 
+    
+    for (i=0; i < SLICES_MFADC; i++ ) {
+      sig[iPix][i] = 0. ; 
+    }
+  }
+
+  //
+  //   then select the time slice to use (ican) 
+  // 
+
+  
+  if ( time < 0. ) {
+    cout << "  WARNING! Fadc::Fill  " << time << "  below ZERO!! Very strange!!" 
+	 << endl ; 
+  }
+  else if ( time < TOTAL_TRIGGER_TIME ) { 
+    //
+    //   determine the slices number assuming the WIDTH_RESPONSE_MFADC
+    //
+    ichan = (Int_t) ( time / ((Float_t) WIDTH_RESPONSE_MFADC )); 
+
+    //
+    //   putting the response slices in the right sig slices.
+    //   Be carefull, because both slices have different widths. 
+    //
+
+    for ( i = 0 ; i<RESPONSE_SLICES; i++ ) {
+      ichanfadc = (Int_t) ((ichan+i)/SUBBINS) ; 
+      if ( (ichanfadc) < SLICES_MFADC ) {  
+	sig[iPix][ichanfadc] += (amplitude * sing_resp[i] )  ; 
+      } 
+    }
+  }
+  else {
+    cout << "  WARNING!  Fadc::Fill " << time << "  out of TriggerTimeRange " 
+	 << TOTAL_TRIGGER_TIME << endl ; 
+  }
+
+}
+
+void MFadc::ElecNoise() {
+  //
+  //  
+  //
+  
+  for ( Int_t i = 0 ; i < CAMERA_PIXELS; i++) {
+    if ( used [i] == TRUE ) {
+      
+      for ( Int_t is=0 ; is< SLICES_MFADC ; is++ ) {
+
+	sig[i][is] += GenElec->Gaus(0., 2.) ; 
+      }
+    }
+  }
+}
+
+
+
+void MFadc::Scan() {
+  
+
+  for ( Int_t ip=0; ip<CAMERA_PIXELS; ip++ ) {
+    
+    if ( used[ip] == kTRUE ) {
+
+      printf ("Pid %3d",  ip ) ; 
+
+      for ( Int_t is=0 ; is < SLICES_MFADC; is++ ) {
+
+	if ( sig[ip][is] > 0. ) {
+	  printf (" %4.1f/", sig[ip][is] ) ;
+	}
+	else {
+	  printf ("----/" ) ;
+	}
+      }
+      
+      printf ("\n"); 
+
+    }
+  }
+  
+} 
+
+void MFadc::Scan(Float_t time) {
+  
+  //
+  //    first of all we subtract from the time a offset (8 ns) 
+  // 
+  
+  Float_t t ; 
+
+  t = time - 10. ; // to show also the start of the pulse before the
+                   // the trigger time
+
+  if ( t < 0. ) {
+    cout << " WARNING!! FROM MFADC::SCAN(t) " << endl ; 
+    exit (776) ;  
+  }
+
+  //
+  //  calculate the first slice to write out
+  // 
+  
+  Int_t  iFirstSlice ; 
+
+  iFirstSlice = (Int_t) ( t /  WIDTH_FADC_TIMESLICE ) ; 
+
+  for ( Int_t ip=0; ip<CAMERA_PIXELS; ip++ ) {
+    
+    if ( used[ip] == kTRUE ) {
+
+      printf ("Pid %3d",  ip ) ; 
+
+      for ( Int_t is=iFirstSlice ; is < (iFirstSlice+15); is++ ) {
+	printf (" %5.2f /", sig[ip][is] ) ; 
+      }
+      
+      printf ("\n"); 
+
+    }
+  }  
+} 
+
+
+
+void MFadc::ShowSignal (MMcEvt *McEvt, Float_t trigTime) { 
+  // ============================================================
+  //
+  //  This method is used to book the histogramm to show the signal in 
+  //  a special gui frame (class MGTriggerSignal). After the look onto the
+  //  signals for a better understanding of the things we will expect 
+  //  the gui frame and all histogramms will be destroyed.   
+  //
+  
+  //
+  //  first of all create a list of the histograms to show
+  //
+  //  take only that one with a entry
+
+  TH1F *hist ; 
+  Char_t dumm[10]; 
+  Char_t name[256]; 
+  
+  TObjArray  *AList ;
+  AList = new TObjArray(10) ; 
+
+  // the list of analog signal histograms
+  // at the beginning we initalise 10 elements
+  // but this array expand automaticly if neccessay
+  
+  Int_t ic = 0 ; 
+  for ( Int_t i=0 ; i < CAMERA_PIXELS; i++  ) {
+    if ( used [i] == TRUE ) {
+
+      sprintf (dumm, "FADC_%d", i ) ; 
+      sprintf (name, "fadc signal %d", i ) ; 
+      
+      hist = new TH1F(dumm, name, SLICES_MFADC, 0., TOTAL_TRIGGER_TIME); 
+      //
+      //  fill the histogram
+      //
+      
+      for (Int_t ibin=1; ibin <=SLICES_MFADC; ibin++) {
+	hist->SetBinContent (ibin, sig[i][ibin-1]) ;
+      }
+
+      //      hist->SetMaximum( 5.);
+      //      hist->SetMinimum(-10.);
+      hist->SetStats(kFALSE); 
+  
+      //      hist->SetAxisRange(0., 80. ) ; 
+      
+      AList->Add(hist) ; 
+      
+      ic++ ; 
+    }
+  }  
+
+  //
+  //   create the Gui Tool
+  //
+  //
+  
+  new MGFadcSignal(McEvt,
+  		   AList,
+		   trigTime, 
+  		   gClient->GetRoot(), 
+		   gClient->GetRoot(), 
+  		   400, 400 ) ; 
+   
+  //
+  //   delete the List of histogramms
+  //
+  AList->Delete() ; 
+  
+  delete AList ; 
+}
+
+
+
Index: branches/start/MagicSoft/Simulation/Detector/include-MFadc/MFadc.hxx
===================================================================
--- branches/start/MagicSoft/Simulation/Detector/include-MFadc/MFadc.hxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Detector/include-MFadc/MFadc.hxx	(revision 4308)
@@ -0,0 +1,120 @@
+#ifndef __MFadc__
+#define __MFadc__
+//
+//     class MFadc
+//
+//     implemented by Harald Kornmayer
+//
+//     This is a class to simulate the FADC. 
+//     It assumes a special response of the PMT for one single Photo-electron. 
+//     
+//
+//
+#include <stream.h>
+#include <math.h>
+
+#include "TObject.h"
+#include "TRandom.h"
+
+#include "Mdefine.h" 
+
+#include "MTriggerDefine.h"
+
+class MMcEvt  ; 
+
+//==========
+//  MFadc 
+//
+//  The simulation of the Flash ADC system for the MAGIC teleskop is done with
+//  this class. 
+//  So all methods concerning the FADC System should be done inside this
+//  class. 
+//
+//  The Idea is to (in)put the data of the photo electrons into the class and
+//  generate the response (output) of the FADC to that input. Response means 
+//  in this sense the ADC values of the different time slices for all pixels
+//
+//  The pixelisation is done by the camera program of Jose Carlos. 
+//
+//  This class is closly connected to the MTrigger classs. So some of the
+//  values defined in MTriggerDefine.h are also used by this class. 
+//
+//  But a lot of other stuff is defined here. 
+//
+//  --> Frist of all the WIDTH of the time slice of one FADC slice 
+//      this is 3.33333 nsec.
+//
+#define WIDTH_FADC_TIMESLICE   (50./15.)       //  this means 3.33 nsec 
+//
+//  --> Second the number of slices to fill in MFADC. This must by 
+//      connected to the MTrigger class. The time of interest must be
+//      equal in both classes. 
+//
+#define SLICES_MFADC           (TOTAL_TRIGGER_TIME / WIDTH_FADC_TIMESLICE)
+//
+//  --> like the trigger the FADC value will also have a standard response
+//      to one single Photo electron. This response is binned with smaller
+//      bins. The WIDTH of that response function is done here. 
+// 
+#define SUBBINS     5.
+#define WIDTH_RESPONSE_MFADC   (WIDTH_FADC_TIMESLICE /  SUBBINS )   // 5 sub-bin in one FADC slice 
+//
+//  --> the number of Response slices
+//
+#define RESPONSE_SLICES_MFADC   45         
+//
+//
+#define MFADC_RESPONSE_FWHM        5.0
+
+//
+//
+#define MFADC_RESPONSE_AMPLITUDE   4.0
+//
+//
+//
+//
+class MFadc {
+ private:
+  //
+  //    then for all pixels the shape of all the analog signals 
+  //
+  Bool_t   used[CAMERA_PIXELS] ;  //  a boolean to indicated if the pixels is used in this event
+
+  Float_t  sig[CAMERA_PIXELS][(Int_t) SLICES_MFADC] ; //  the analog signal for pixels
+
+  //
+  //    first the data for the response function
+  //
+  Float_t fwhm_resp ;                      // fwhm of the phe_response function 
+  Float_t ampl_resp ;                      // amplitude of the phe_response function (in mV)
+  Float_t sing_resp[ RESPONSE_SLICES_MFADC ] ;   // the shape of the phe_response function 
+
+  //
+  //   RandomGenerator for the Electonic Noise
+  //
+
+  TRandom  *GenElec ; 
+
+
+public:
+
+  MFadc() ; 
+  
+  void Reset() ; 
+
+  void Fill( Int_t, Float_t, Float_t  ) ;  
+
+  void ElecNoise() ; 
+
+  void Scan() ; 
+
+  void Scan(Float_t time) ;
+
+  void ShowSignal ( MMcEvt *McEvt , Float_t ) ; 
+} ; 
+
+
+#endif
+
+
+
Index: branches/start/MagicSoft/Simulation/Detector/include-MFadc/MGFadcSignal.cxx
===================================================================
--- branches/start/MagicSoft/Simulation/Detector/include-MFadc/MGFadcSignal.cxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Detector/include-MFadc/MGFadcSignal.cxx	(revision 4308)
@@ -0,0 +1,355 @@
+//
+//
+//
+#include "MGFadcSignal.hxx" 
+
+#include "TPavesText.h"
+#include "TObjArray.h"
+#include "TCanvas.h"
+
+#include "TLine.h"
+
+MGFadcSignal::MGFadcSignal(const MMcEvt    *McInfo, 
+			   const TObjArray *aList, 
+			   Float_t   trigTime, 
+			   const TGWindow *p, const TGWindow *main,
+			   UInt_t w, UInt_t h, UInt_t options) :
+     TGTransientFrame(p, main, w, h, options)
+{
+  //  Default constructor
+  //
+  // Create a frame to show the signals.
+  // 
+  //
+  fTrigTime = trigTime ; 
+
+  iAnaSigs =  aList->GetEntries() ; 
+
+  iPage = 1 ;  
+
+  //
+  //  at the beginning copy the aList into Liste    
+  //
+  
+  ListeA = new TObjArray( *aList ) ; 
+
+  Liste  = new TObjArray( *ListeA ) ; 
+  
+  
+  //
+  //  First of all the Menus in the menubar
+  //
+   
+  fMenuFile = new TGPopupMenu(gClient->GetRoot());
+  fMenuFile->AddEntry("Open...", M_FILE_OPEN);
+  fMenuFile->AddEntry("Save", M_FILE_SAVE);
+  fMenuFile->AddEntry("Save as...", M_FILE_SAVEAS);
+  fMenuFile->AddEntry("Close", M_FILE_CLOSE);
+  fMenuFile->AddSeparator();
+  fMenuFile->AddEntry("Print", M_FILE_PRINT);
+  fMenuFile->AddSeparator();
+  fMenuFile->AddEntry("Exit", M_FILE_EXIT );
+  
+  fMenuFile->DisableEntry(M_FILE_OPEN);
+  fMenuFile->DisableEntry(M_FILE_SAVE);
+  fMenuFile->DisableEntry(M_FILE_SAVEAS);
+  fMenuFile->DisableEntry(M_FILE_CLOSE);
+  fMenuFile->DisableEntry(M_FILE_PRINT);
+  fMenuFile->DisableEntry(M_FILE_EXIT);
+
+  fMenuFile->Associate(this);
+
+  //
+  //   create the menu bar
+  //
+
+  fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
+  fMenuBar->AddPopup("&File", fMenuFile, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
+
+  AddFrame(fMenuBar, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
+				       0, 0, 1, 1));
+
+  //
+  //    create the information frame
+  // 
+
+  Char_t winf[100]; 
+  fMcInfo = new TGCompositeFrame(this, 60, 20, kHorizontalFrame | kLHintsTop |kSunkenFrame );
+  sprintf ( winf,"Particle: %d", McInfo->GetPartId() ); 
+  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
+		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
+					10, 10, 10, 10));  
+
+  sprintf ( winf,"Energy: %6.1f [GeV]", McInfo->GetEnergy() ); 
+  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
+		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
+					10, 10, 10, 10));  
+
+  sprintf ( winf,"Theta: %6.1f [deg]", McInfo->GetTheta()* 57.2974 ); 
+  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
+		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
+					10, 10, 10, 10));  
+ 
+  sprintf ( winf,"Impact: %6.1f [m]", McInfo->GetImpact()/100. ); 
+  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
+		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
+					10, 10, 10, 10));  
+
+  AddFrame(fMcInfo, new TGLayoutHints(kLHintsTop | kLHintsExpandX,
+				      0, 0, 1, 0));
+
+  //
+  //   build the canvas (here we will plot the histograms
+  //
+
+  fCanvasWindow = new TRootEmbeddedCanvas("test",this, 800, 500);
+  fContainer = new TGCompositeFrame(fCanvasWindow->GetViewPort(), 10, 10,
+				    kHorizontalFrame, GetWhitePixel());
+  fContainer->SetLayoutManager(new TGTileLayout(fContainer, 7));
+  fCanvasWindow->SetContainer(fContainer);
+  
+  tcan = fCanvasWindow->GetCanvas() ; 
+
+  AddFrame(fCanvasWindow, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,
+  				    0, 0, 2, 2));
+  
+
+  //
+  //  build the control frame
+  //
+  fControl = new TGCompositeFrame(this, 60, 20, kHorizontalFrame | kLHintsTop |kSunkenFrame );
+  
+  fPrevChannels = new TGTextButton(fControl, "Previous Channels", M_PREV_CHANNELS);
+  fPrevChannels->Associate(this);
+  fPrevChannels->SetToolTipText("To see the previous sample of chanels");
+  fControl->AddFrame(fPrevChannels, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
+
+
+  lPage = new TGLabel (fControl, "--") ;
+  fControl->AddFrame(lPage,
+		     new TGLayoutHints(kLHintsTop | kLHintsLeft ,
+                                          5, 0, 10, 5));
+  sprintf ( winf,"/"); 
+  fControl->AddFrame(new TGLabel (fControl, "/" ),
+		     new TGLayoutHints(kLHintsTop | kLHintsLeft ,
+					0, 0, 10, 5));
+  
+  lPageAll = new TGLabel (fControl, "--") ;
+  fControl->AddFrame(lPageAll,
+		     new TGLayoutHints(kLHintsTop | kLHintsLeft ,
+                                          0, 5, 10, 5));
+   
+  fNextChannels = new TGTextButton(fControl, "Next Channels", M_NEXT_CHANNELS);
+  fNextChannels->Associate(this);
+  fNextChannels->SetToolTipText("To see the next sample of chanels");
+  fControl->AddFrame(fNextChannels, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
+
+
+  fAnalog = new TGTextButton(fControl, "analog", M_ANALOG);
+  fAnalog->Associate(this);
+  fAnalog->SetToolTipText("Display of analog signals");
+  fControl->AddFrame(fAnalog, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 50, 5, 5, 5));
+
+
+  fDigital = new TGTextButton(fControl, "digital", M_DIGITAL);
+  fDigital->Associate(this);
+  fDigital->SetToolTipText("Display of digital signals");
+  fControl->AddFrame(fDigital, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
+
+
+  fBeide = new TGTextButton(fControl, "both", M_BEIDE);
+  fBeide->Associate(this);
+  fBeide->SetToolTipText("Display the analog and digital signals");
+  fControl->AddFrame(fBeide, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
+
+
+
+  AddFrame(fControl, new TGLayoutHints(kLHintsExpandX,
+				       0, 0, 1, 0));
+  
+
+  //
+  //    the close button line
+  // 
+
+  fFrame = new TGCompositeFrame(this, 60, 20, kHorizontalFrame |
+				kSunkenFrame);
+
+  fCloseButton = new TGTextButton(fFrame, "Close", M_BUTTON_CLOSE);
+  fCloseButton->Associate(this);
+  fCloseButton->SetToolTipText("Close and skip to the next event!");
+  fFrame->AddFrame(fCloseButton, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 100, 5, 5, 5));
+ 
+
+  fExitButton = new TGTextButton(fFrame, "Stop Job", M_BUTTON_EXIT);
+  fExitButton->Associate(this);
+  fExitButton->SetToolTipText("Shut down this job!");
+  fFrame->AddFrame(fExitButton, 
+		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 200, 5, 5, 5));
+
+  AddFrame(fFrame, new TGLayoutHints(kLHintsBottom | kLHintsExpandX,
+				     0, 0, 1, 0));
+  
+  SetWindowName("MGFadcSignal");
+
+  MapSubwindows();
+
+  // we need to use GetDefault...() to initialize the layout algorithm...
+  Resize(GetDefaultSize());
+
+  //  Resize (1000,650); 
+
+  MapWindow();
+
+  DisplayChannels ( Liste) ; 
+  
+  gClient->WaitFor(this);  
+}
+
+
+MGFadcSignal::~MGFadcSignal() {
+  delete  fMenuBar ; 
+  delete  fMenuFile; 
+
+  delete  fContainer ; 
+  delete  fCanvasWindow ; 
+
+  delete  fCloseButton ; 
+  delete  fExitButton ; 
+  delete  fFrame ; 
+}
+
+void MGFadcSignal::CloseWindow() {
+   delete this ; 
+}
+
+
+void MGFadcSignal::DisplayChannels ( TObjArray *disList ) {
+  
+  Int_t imax ; 
+
+  if ( iPage == 0 ) {
+    printf ("Warning from DisplayChannels: Page 0 don't exist!!\n"); 
+    iPage = 1 ;
+    return ; 
+  }
+  
+  if ( (iPage-1)*16 >= (imax = disList->GetEntries()) ) {
+    printf ("Warning from DisplayChannels: PageNumber to big!\n");
+    iPage=iPage-1 ; 
+    return;
+  } 
+  
+  Char_t wort[4] ; 
+  sprintf ( wort, "%d", iPage) ;   
+  lPage->SetText ( new TGString ( wort ) ) ; 
+  sprintf ( wort, "%d", imax/16 + 1 ) ;   
+  lPageAll->SetText ( new TGString ( wort ) ) ; 
+ 
+
+  tcan->Clear() ; 
+  tcan->Divide(4,4) ;
+
+  Int_t ifirst, ilast ; 
+
+  ifirst = (iPage-1)*16 ; 
+  ilast  = iPage*16 ; 
+
+  if ( ilast > imax ) {
+    ilast = imax ; 
+  }
+
+  Int_t ic = 1 ; 
+  for (Int_t ih=ifirst; ih<ilast; ih++ ) {
+    tcan->cd(ic++);
+    disList->At(ih)->Draw() ; 
+
+    TLine *linie = new TLine( fTrigTime, 0., fTrigTime, 20. ) ; 
+    linie->Draw() ; 
+  }
+
+
+
+  tcan->Modified();
+  tcan->Update();
+  
+  
+
+}
+
+// ========================================
+// ========================================
+// ========================================
+
+Bool_t MGFadcSignal::ProcessMessage(Long_t msg, Long_t parm1, Long_t) {
+  // Handle messages send to the TestMainFrame object. E.g. all menu button
+  // messages.
+  
+  //  printf (" processmessage \n" ) ; 
+
+  switch (GET_MSG(msg)) {
+    
+  case kC_COMMAND:
+    switch (GET_SUBMSG(msg)) {
+       
+    case kCM_MENU:
+      printf("Pointer over menu entry, id=%ld\n", parm1);
+      break;
+
+      
+    case kCM_BUTTON:
+      switch ( parm1 ) {
+	
+      case M_BUTTON_CLOSE:      
+	CloseWindow() ; 
+        break; 
+
+      case M_BUTTON_EXIT:      
+        exit (1234)  ; 
+        break; 
+
+      case M_PREV_CHANNELS:
+	iPage = iPage - 1 ; 
+	DisplayChannels (Liste) ; 
+	break; 
+
+      case M_NEXT_CHANNELS:
+	iPage = iPage + 1 ; 
+	DisplayChannels (Liste) ; 
+	break; 
+
+      case M_ANALOG:
+	Liste  = new TObjArray( *ListeA ) ;
+	DisplayChannels (Liste) ; 
+	break; 
+
+      case M_DIGITAL:
+	break; 
+
+      case M_BEIDE:
+	//
+	//  to draw the analog and the digital signal
+	//
+	break; 
+      } 
+      
+      return kFALSE;
+    }
+    return kFALSE; 
+  }  
+  return kTRUE;
+}
+
+
+
+
+
+
+
+
Index: branches/start/MagicSoft/Simulation/Detector/include-MFadc/MGFadcSignal.hxx
===================================================================
--- branches/start/MagicSoft/Simulation/Detector/include-MFadc/MGFadcSignal.hxx	(revision 4308)
+++ branches/start/MagicSoft/Simulation/Detector/include-MFadc/MGFadcSignal.hxx	(revision 4308)
@@ -0,0 +1,113 @@
+#ifndef __MGFadcSignal__
+#define __MGFadcSignal__
+
+
+#include <stdlib.h>
+#include <iostream.h>
+
+#include <TROOT.h>
+#include <TApplication.h>
+#include <TVirtualX.h>
+
+#include <TGListBox.h>
+#include <TGClient.h>
+#include <TGFrame.h>
+#include <TGIcon.h>
+#include <TGLabel.h>
+#include <TGButton.h>
+#include <TGTextEntry.h>
+#include <TGMsgBox.h>
+#include <TGMenu.h>
+#include <TGCanvas.h>
+#include <TGComboBox.h>
+#include <TGTab.h>
+#include <TGSlider.h>
+#include <TGDoubleSlider.h>
+#include <TGFileDialog.h>
+#include <TRootEmbeddedCanvas.h>
+#include <TCanvas.h>
+#include <TH1.h>
+#include <TH2.h>
+#include <TRandom.h>
+#include <TSystem.h>
+#include <TEnv.h>
+
+#include "MMcEvt.h"
+
+
+enum ETestCommandIdentifiers {
+   M_FILE_OPEN = 201,
+   M_FILE_SAVE,
+   M_FILE_SAVEAS,
+   M_FILE_CLOSE,
+   M_FILE_PRINT,
+   M_FILE_EXIT , 
+   
+   M_BUTTON_CLOSE,
+   M_BUTTON_EXIT,
+
+   M_PREV_CHANNELS, 
+   M_NEXT_CHANNELS,
+   M_ANALOG,
+   M_DIGITAL, 
+   M_BEIDE
+}; 
+
+
+
+
+
+class MGFadcSignal : public TGTransientFrame {
+
+private:
+  Float_t             fTrigTime ; 
+  Int_t               iAnaSigs ; 
+  Int_t               iDigSigs ;
+  Int_t               iPage  ; 
+
+  TObjArray           *ListeA ; 
+  TObjArray           *Liste ; 
+
+  TGCompositeFrame    *fFrame ; 
+  TGButton            *fCloseButton;
+  TGButton            *fExitButton;
+
+  TGCompositeFrame    *fControl ; 
+  TGButton            *fPrevChannels;
+  TGLabel             *lPageAll    ;
+  TGLabel             *lPage    ;
+  TGButton            *fNextChannels;
+  TGButton            *fAnalog;
+  TGButton            *fDigital;
+  TGButton            *fBeide;
+
+  TGCompositeFrame    *fMcInfo ; 
+
+  TRootEmbeddedCanvas *fCanvasWindow ; 
+  TGCompositeFrame    *fContainer ; 
+  TCanvas             *tcan ; 
+
+  TGMenuBar           *fMenuBar;
+  TGPopupMenu         *fMenuFile;
+
+
+public:
+  MGFadcSignal(const MMcEvt    *McInfo, 
+	       const TObjArray *aList,
+	       Float_t   trigTime, 
+	       const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
+	       UInt_t options = kMainFrame | kVerticalFrame);
+  virtual ~MGFadcSignal();
+  
+  virtual void CloseWindow();
+
+  void DisplayChannels( TObjArray *disList ) ; 
+
+  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+};
+
+#endif
+
+
+
+
Index: branches/start/MagicSoft/Simulation/Detector/include-MTrigger/MGTriggerSignal.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MGTriggerSignal.cxx	(revision 353)
+++ 	(revision )
@@ -1,358 +1,0 @@
-//
-//
-//
-#include "MGTriggerSignal.hxx" 
-
-#include "TPavesText.h"
-#include "TObjArray.h"
-#include "TCanvas.h"
-
-MGTriggerSignal::MGTriggerSignal(const MMcEvt    *McInfo, 
-				 const TObjArray *aList, 
-				 const TObjArray *dList, 
-				 const TGWindow *p, const TGWindow *main,
-                       UInt_t w, UInt_t h, UInt_t options) :
-     TGTransientFrame(p, main, w, h, options)
-{
-  //  Default constructor
-  //
-  // Create a frame to show the signals.
-  // 
-  // 
-
-  iAnaSigs =  aList->GetEntries() ; 
-  iDigSigs =  dList->GetEntries() ; 
-
-  iPage = 1 ;  
-
-  //
-  //  at the beginning copy the aList into Liste    
-  //
-  
-  ListeA = new TObjArray( *aList ) ; 
-  ListeD = new TObjArray( *dList ) ; 
-
-  Liste  = new TObjArray( *ListeA ) ; 
-  
-  
-  //
-  //  First of all the Menus in the menubar
-  //
-   
-  fMenuFile = new TGPopupMenu(gClient->GetRoot());
-  fMenuFile->AddEntry("Open...", M_FILE_OPEN);
-  fMenuFile->AddEntry("Save", M_FILE_SAVE);
-  fMenuFile->AddEntry("Save as...", M_FILE_SAVEAS);
-  fMenuFile->AddEntry("Close", M_FILE_CLOSE);
-  fMenuFile->AddSeparator();
-  fMenuFile->AddEntry("Print", M_FILE_PRINT);
-  fMenuFile->AddSeparator();
-  fMenuFile->AddEntry("Exit", M_FILE_EXIT );
-  
-  fMenuFile->DisableEntry(M_FILE_OPEN);
-  fMenuFile->DisableEntry(M_FILE_SAVE);
-  fMenuFile->DisableEntry(M_FILE_SAVEAS);
-  fMenuFile->DisableEntry(M_FILE_CLOSE);
-  fMenuFile->DisableEntry(M_FILE_PRINT);
-  fMenuFile->DisableEntry(M_FILE_EXIT);
-
-  fMenuFile->Associate(this);
-
-  //
-  //   create the menu bar
-  //
-
-  fMenuBar = new TGMenuBar(this, 1, 1, kHorizontalFrame);
-  fMenuBar->AddPopup("&File", fMenuFile, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
-
-  AddFrame(fMenuBar, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX,
-				       0, 0, 1, 1));
-
-  //
-  //    create the information frame
-  // 
-
-  Char_t winf[100]; 
-  fMcInfo = new TGCompositeFrame(this, 60, 20, kHorizontalFrame | kLHintsTop |kSunkenFrame );
-  sprintf ( winf,"Particle: %d", McInfo->GetPartId() ); 
-  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
-		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
-					10, 10, 10, 10));  
-
-  sprintf ( winf,"Energy: %6.1f [GeV]", McInfo->GetEnergy() ); 
-  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
-		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
-					10, 10, 10, 10));  
-
-  sprintf ( winf,"Theta: %6.1f [deg]", McInfo->GetTheta()* 57.2974 ); 
-  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
-		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
-					10, 10, 10, 10));  
- 
-  sprintf ( winf,"Impact: %6.1f [m]", McInfo->GetImpact()/100. ); 
-  fMcInfo->AddFrame(new TGLabel (fMcInfo, winf ),
-		    new TGLayoutHints(kLHintsTop | kLHintsLeft ,
-					10, 10, 10, 10));  
-
-  AddFrame(fMcInfo, new TGLayoutHints(kLHintsTop | kLHintsExpandX,
-				      0, 0, 1, 0));
-
-  //
-  //   build the canvas (here we will plot the histograms
-  //
-
-  fCanvasWindow = new TRootEmbeddedCanvas("test",this, 800, 500);
-  fContainer = new TGCompositeFrame(fCanvasWindow->GetViewPort(), 10, 10,
-				    kHorizontalFrame, GetWhitePixel());
-  fContainer->SetLayoutManager(new TGTileLayout(fContainer, 7));
-  fCanvasWindow->SetContainer(fContainer);
-  
-  tcan = fCanvasWindow->GetCanvas() ; 
-
-  AddFrame(fCanvasWindow, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,
-  				    0, 0, 2, 2));
-  
-
-  //
-  //  build the control frame
-  //
-  fControl = new TGCompositeFrame(this, 60, 20, kHorizontalFrame | kLHintsTop |kSunkenFrame );
-  
-  fPrevChannels = new TGTextButton(fControl, "Previous Channels", M_PREV_CHANNELS);
-  fPrevChannels->Associate(this);
-  fPrevChannels->SetToolTipText("To see the previous sample of chanels");
-  fControl->AddFrame(fPrevChannels, 
-		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
-
-
-  lPage = new TGLabel (fControl, "--") ;
-  fControl->AddFrame(lPage,
-		     new TGLayoutHints(kLHintsTop | kLHintsLeft ,
-                                          5, 0, 10, 5));
-  sprintf ( winf,"/"); 
-  fControl->AddFrame(new TGLabel (fControl, "/" ),
-		     new TGLayoutHints(kLHintsTop | kLHintsLeft ,
-					0, 0, 10, 5));
-  
-  lPageAll = new TGLabel (fControl, "--") ;
-  fControl->AddFrame(lPageAll,
-		     new TGLayoutHints(kLHintsTop | kLHintsLeft ,
-                                          0, 5, 10, 5));
-   
-  fNextChannels = new TGTextButton(fControl, "Next Channels", M_NEXT_CHANNELS);
-  fNextChannels->Associate(this);
-  fNextChannels->SetToolTipText("To see the next sample of chanels");
-  fControl->AddFrame(fNextChannels, 
-		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
-
-
-  fAnalog = new TGTextButton(fControl, "analog", M_ANALOG);
-  fAnalog->Associate(this);
-  fAnalog->SetToolTipText("Display of analog signals");
-  fControl->AddFrame(fAnalog, 
-		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 50, 5, 5, 5));
-
-
-  fDigital = new TGTextButton(fControl, "digital", M_DIGITAL);
-  fDigital->Associate(this);
-  fDigital->SetToolTipText("Display of digital signals");
-  fControl->AddFrame(fDigital, 
-		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
-
-
-  fBeide = new TGTextButton(fControl, "both", M_BEIDE);
-  fBeide->Associate(this);
-  fBeide->SetToolTipText("Display the analog and digital signals");
-  fControl->AddFrame(fBeide, 
-		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5));
-
-
-
-  AddFrame(fControl, new TGLayoutHints(kLHintsExpandX,
-				       0, 0, 1, 0));
-  
-
-  //
-  //    the close button line
-  // 
-
-  fFrame = new TGCompositeFrame(this, 60, 20, kHorizontalFrame |
-				kSunkenFrame);
-
-  fCloseButton = new TGTextButton(fFrame, "Close", M_BUTTON_CLOSE);
-  fCloseButton->Associate(this);
-  fCloseButton->SetToolTipText("Close and skip to the next event!");
-  fFrame->AddFrame(fCloseButton, 
-		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 100, 5, 5, 5));
- 
-
-  fExitButton = new TGTextButton(fFrame, "Stop Job", M_BUTTON_EXIT);
-  fExitButton->Associate(this);
-  fExitButton->SetToolTipText("Shut down this job!");
-  fFrame->AddFrame(fExitButton, 
-		   new TGLayoutHints(kLHintsTop | kLHintsLeft, 200, 5, 5, 5));
-
-  AddFrame(fFrame, new TGLayoutHints(kLHintsBottom | kLHintsExpandX,
-				     0, 0, 1, 0));
-  
-  SetWindowName("MGTriggerSignal");
-
-  MapSubwindows();
-
-  // we need to use GetDefault...() to initialize the layout algorithm...
-  Resize(GetDefaultSize());
-
-  //  Resize (1000,650); 
-
-  MapWindow();
-
-  DisplayChannels ( Liste) ; 
-  
-  gClient->WaitFor(this);  
-}
-
-
-MGTriggerSignal::~MGTriggerSignal() {
-  delete  fMenuBar ; 
-  delete  fMenuFile; 
-
-  delete  fContainer ; 
-  delete  fCanvasWindow ; 
-
-  delete  fCloseButton ; 
-  delete  fExitButton ; 
-  delete  fFrame ; 
-}
-
-void MGTriggerSignal::CloseWindow() {
-   delete this ; 
-}
-
-
-void MGTriggerSignal::DisplayChannels ( TObjArray *disList ) {
-  
-  Int_t imax ; 
-
-  if ( iPage == 0 ) {
-    printf ("Warning from DisplayChannels: Page 0 don't exist!!\n"); 
-    iPage = 1 ;
-    return ; 
-  }
-  
-  if ( (iPage-1)*16 >= (imax = disList->GetEntries()) ) {
-    printf ("Warning from DisplayChannels: PageNumber to big!\n");
-    iPage=iPage-1 ; 
-    return;
-  } 
-  
-  Char_t wort[4] ; 
-  sprintf ( wort, "%d", iPage) ;   
-  lPage->SetText ( new TGString ( wort ) ) ; 
-  sprintf ( wort, "%d", imax/16 + 1 ) ;   
-  lPageAll->SetText ( new TGString ( wort ) ) ; 
- 
-
-  tcan->Clear() ; 
-  tcan->Divide(4,4) ;
-
-  Int_t ifirst, ilast ; 
-
-  ifirst = (iPage-1)*16 ; 
-  ilast  = iPage*16 ; 
-
-  if ( ilast > imax ) {
-    ilast = imax ; 
-  }
-
-  Int_t ic = 1 ; 
-  for (Int_t ih=ifirst; ih<ilast; ih++ ) {
-    tcan->cd(ic++);
-    disList->At(ih)->Draw() ; 
-  }
-
-  tcan->Modified();
-  tcan->Update();
-  
-}
-
-// ========================================
-// ========================================
-// ========================================
-
-Bool_t MGTriggerSignal::ProcessMessage(Long_t msg, Long_t parm1, Long_t) {
-  // Handle messages send to the TestMainFrame object. E.g. all menu button
-  // messages.
-  
-  //  printf (" processmessage \n" ) ; 
-
-  switch (GET_MSG(msg)) {
-    
-  case kC_COMMAND:
-    switch (GET_SUBMSG(msg)) {
-       
-    case kCM_MENU:
-      printf("Pointer over menu entry, id=%ld\n", parm1);
-      break;
-
-      
-    case kCM_BUTTON:
-      switch ( parm1 ) {
-	
-      case M_BUTTON_CLOSE:      
-	CloseWindow() ; 
-        break; 
-
-      case M_BUTTON_EXIT:      
-        exit (1234)  ; 
-        break; 
-
-      case M_PREV_CHANNELS:
-	iPage = iPage - 1 ; 
-	DisplayChannels (Liste) ; 
-	break; 
-
-      case M_NEXT_CHANNELS:
-	iPage = iPage + 1 ; 
-	DisplayChannels (Liste) ; 
-	break; 
-
-      case M_ANALOG:
-	Liste  = new TObjArray( *ListeA ) ;
-	DisplayChannels (Liste) ; 
-	break; 
-
-      case M_DIGITAL:
-	Liste  = new TObjArray( *ListeD ) ;
-	DisplayChannels (Liste) ; 
-	break; 
-
-      case M_BEIDE:
-	//
-	//  to draw the analog and the digital signal
-	//
-	Liste = new TObjArray(2*iAnaSigs) ; 
-
-	Int_t iL ; 
-	
-	for (iL = 0; iL<=(iAnaSigs); iL++ ) {
-	  Liste->Add( ListeA->At(iL) ) ; 
-	  Liste->Add( ListeD->At(iL) ) ; 
-	}
-	DisplayChannels (Liste) ; 
-	break; 
-      } 
-      
-      return kFALSE;
-    }
-    return kFALSE; 
-  }  
-  return kTRUE;
-}
-
-
-
-
-
-
-
-
Index: branches/start/MagicSoft/Simulation/Detector/include-MTrigger/MGTriggerSignal.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MGTriggerSignal.hxx	(revision 353)
+++ 	(revision )
@@ -1,113 +1,0 @@
-#ifndef __MGTriggerSignal__
-#define __MGTriggerSignal__
-
-
-#include <stdlib.h>
-#include <iostream.h>
-
-#include <TROOT.h>
-#include <TApplication.h>
-#include <TVirtualX.h>
-
-#include <TGListBox.h>
-#include <TGClient.h>
-#include <TGFrame.h>
-#include <TGIcon.h>
-#include <TGLabel.h>
-#include <TGButton.h>
-#include <TGTextEntry.h>
-#include <TGMsgBox.h>
-#include <TGMenu.h>
-#include <TGCanvas.h>
-#include <TGComboBox.h>
-#include <TGTab.h>
-#include <TGSlider.h>
-#include <TGDoubleSlider.h>
-#include <TGFileDialog.h>
-#include <TRootEmbeddedCanvas.h>
-#include <TCanvas.h>
-#include <TH1.h>
-#include <TH2.h>
-#include <TRandom.h>
-#include <TSystem.h>
-#include <TEnv.h>
-
-#include "MMcEvt.h"
-
-
-enum ETestCommandIdentifiers {
-   M_FILE_OPEN = 201,
-   M_FILE_SAVE,
-   M_FILE_SAVEAS,
-   M_FILE_CLOSE,
-   M_FILE_PRINT,
-   M_FILE_EXIT , 
-   
-   M_BUTTON_CLOSE,
-   M_BUTTON_EXIT,
-
-   M_PREV_CHANNELS, 
-   M_NEXT_CHANNELS,
-   M_ANALOG,
-   M_DIGITAL, 
-   M_BEIDE
-}; 
-
-
-
-
-
-class MGTriggerSignal : public TGTransientFrame {
-
-private:
-  Int_t               iAnaSigs ; 
-  Int_t               iDigSigs ;
-  Int_t               iPage  ; 
-
-  TObjArray           *ListeA ; 
-  TObjArray           *ListeD ; 
-  TObjArray           *Liste ; 
-
-  TGCompositeFrame    *fFrame ; 
-  TGButton            *fCloseButton;
-  TGButton            *fExitButton;
-
-  TGCompositeFrame    *fControl ; 
-  TGButton            *fPrevChannels;
-  TGLabel             *lPageAll    ;
-  TGLabel             *lPage    ;
-  TGButton            *fNextChannels;
-  TGButton            *fAnalog;
-  TGButton            *fDigital;
-  TGButton            *fBeide;
-
-  TGCompositeFrame    *fMcInfo ; 
-
-  TRootEmbeddedCanvas *fCanvasWindow ; 
-  TGCompositeFrame    *fContainer ; 
-  TCanvas             *tcan ; 
-
-  TGMenuBar           *fMenuBar;
-  TGPopupMenu         *fMenuFile;
-
-
-public:
-  MGTriggerSignal(const MMcEvt    *McInfo, 
-		  const TObjArray *aList,
-		  const TObjArray *dList,  
-                  const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
-		  UInt_t options = kMainFrame | kVerticalFrame);
-  virtual ~MGTriggerSignal();
-  
-  virtual void CloseWindow();
-
-  void DisplayChannels( TObjArray *disList ) ; 
-
-  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
-};
-
-#endif
-
-
-
-
Index: branches/start/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 4308)
@@ -6,781 +6,2 @@
 #include "MTrigger.hxx"
 
-#include "TROOT.h"
-#include "TFile.h"
-#include "TH1.h"
-#include "TObjArray.h"
-#include "MGTriggerSignal.hxx"
-
-
-MTrigger::MTrigger() { 
-  
-  FILE *unit_mtrig ; 
-  Int_t endflag = 1  ; 
-  char   datac[256] ; 
-  char   dummy[50] ; 
-  //
-  //  default constructor 
-  //  
-  //  The procedure is the following: 
-  //
-  //  1. Allocation of some memory needed
-  //  2. some parameters of the trigger are set to default.   
-  //  3. if a File MTrigger.card exists in the current directory, 
-  //     this parameters of the trigger may be changed
-  //  4. Then the all signals are set to zero
-  
-  // 
-  //   allocate the memory for the 2dim arrays (a_sig, d_sig ) 
-  //
-
-  for( Int_t j=0; j<TRIGGER_PIXELS; j++ ) { 
-
-    a_sig[j] = new Float_t[TRIGGER_TIME_SLICES] ; 
-
-    d_sig[j] = new Float_t[TRIGGER_TIME_SLICES] ; 
-  } 
-
-  //
-  //   set the values for the standard response pulse
-  //
-
-  fwhm_resp = RESPONSE_FWHM       ; 
-  ampl_resp = RESPONSE_AMPLITUDE  ; 
-  
-  chan_thres    = CHANNEL_THRESHOLD  ; 
-  gate_leng     = TRIGGER_GATE       ; 
-  trigger_multi = TRIGGER_MULTI      ; 
- 
-  //
-  //  check if the file MTrigger.card exists
-  //
-
-  if ( (unit_mtrig = fopen ("MTrigger.card", "r")) != 0 ) {
-    cout << "[MTrigger]  use the values from MTrigger.card "<< endl ; 
-    
-    while ( endflag == 1  ) {
-      //
-      //
-      fgets (datac, 255, unit_mtrig) ;
-      //      printf ("--> %s <--", datac ) ;
-      
-      //
-      //   now compare the line with controlcard words
-      //
-      
-      if (      strncmp (datac, "channel_threshold", 17 ) == 0 ) {
-	sscanf (datac, "%s %f", dummy, &chan_thres ) ; 
-      }
-      else if ( strncmp (datac, "gate_length", 11 ) == 0 ) {
-	sscanf (datac, "%s %f", dummy, &gate_leng ) ;
-      }
-      else if ( strncmp (datac, "response_fwhm", 13 ) == 0 ) {
-	sscanf (datac, "%s %f", dummy, &fwhm_resp ) ;
-      }
-      else if ( strncmp (datac, "response_ampl", 13 ) == 0 ) {
-	sscanf (datac, "%s %f", dummy, &ampl_resp ) ;
-      }
-
-      if ( feof(unit_mtrig) != 0 ) {
-	endflag = 0 ;
-      }
-      
-    }
-
-    fclose ( unit_mtrig ) ; 
-  }
-  else {
-    cout << "[MTrigger]  use the standard values for MTrigger "<< endl ; 
-  }
-
-  cout << endl
-       << "[MTrigger]  Setting up the MTrigger with this values "<< endl ; 
-  cout << endl 
-       << "[MTrigger]    ChannelThreshold:   " << chan_thres << " mV" 
-       << endl ; 
-
-  cout << "[MTrigger]    Gate Length:        " << gate_leng  << " ns"
-       << endl ; 
-  cout << "[MTrigger]    Response FWHM:      " << fwhm_resp  << " ns"
-       << endl ; 
-  cout << "[MTrigger]    Response Amplitude: " << ampl_resp  << " mV"
-       << endl ; 
-  
-  cout << endl ; 
-  //
-  //    set up the response shape
-  // 
-  Int_t  i, ii ; 
-     
-  Float_t   sigma ; 
-  Float_t   x, x0 ; 
-
-  sigma = fwhm_resp / 2.35 ; 
-  x0 = 3*sigma ; 
-  
-  for (i=0; i< RESPONSE_SLICES ; i++ ) {  
-
-    x = i * (1./((Float_t)SLICES_PER_NSEC)) 
-      + (1./( 2 * (Float_t)SLICES_PER_NSEC ))  ; 
-    
-    sing_resp[i] = 
-      ampl_resp * expf(-0.5 * (x-x0)*(x-x0) / (sigma*sigma) ) ; 
-
-    //      cout << i << "  "
-    //  	 << x << "  "
-    //  	 << sing_resp[i] 
-    //  	 << endl ; 
-
-  } 
-
-  //
-  //   the amplitude of one single photo electron is not a constant. 
-  //   There exists a measured distribution from Razmik. This distribution
-  //   is used to simulate the noise of the amplitude. 
-  //   For this a histogramm (histPmt) is created and filled with the
-  //   values. 
-  // 
-
-  histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ;
-  
-  Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08,  2.15,
-			   2.27, 2.40, 2.48, 2.55, 2.50, 2.35, 2.20,  2.10,
-			   1.90, 1.65, 1.40, 1.25, 1.00, 0.80, 0.65,  0.50,
-			   0.35, 0.27, 0.20, 0.18, 0.16, 0.14, 0.12,  0.10, 
-			   0.08, 0.06, 0.04, 0.02, 0.01, 0.005,0.003, 0.001} ; 
-
-  histMean =  histPmt->GetMean() ;   
-  
-  histPmt->SetContent( ValRazmik) ; 
-
-  histMean =  histPmt->GetMean() ; 
-
-  //
-  //   create the random generator for the Electronic Noise
-  // 
-
-  GenElec = new TRandom() ; 
-
-
-  //
-  //  Read in the lookup table for NN trigger
-  //
-  
-  FILE *unit ;
-  int id ;
-  float y ;
-
-  i = 0 ; 
-
-  if ( (unit = fopen("../include-MTrigger/TABLE_NEXT_NEIGHBOUR", "r" )) == 0 ) { 
-    cout << "ERROR: not able to read ../include-MTrigger/TABLE_NEXT_NEIGHBOUR"
-	 << endl ; 
-    exit(123) ; 
-  }  
-  else { 
-    while ( i < TRIGGER_PIXELS )
-      {
-	fscanf ( unit, " %d", &id ) ;
-	
-	for ( Int_t k=0; k<6; k++ ) { 
-	  fscanf ( unit, "%d ", &NN[i][k]  ) ; 
-	}
-	i++ ;
-      }
-    
-    fclose (unit) ;
-  }
-
-
-  //
-  //
-  //  set all the booleans used to FALSE, indicating that the pixel is not 
-  //  used in this event. 
-  //
-  
-  for ( i =0 ; i <TRIGGER_PIXELS ; i++ ) { 
-    used [i] = FALSE ;
-
-    nphot[i] = 0 ;
-  }
-
-  for ( ii=0 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 
-    sum_d_sig[ii] = 0. ;  
-  }
-  
-  //
-  //   set the information about the Different Level Triggers to zero
-  //
-
-  nZero = nFirst = nSecond = 0 ; 
-  
-  for ( i = 0 ; i < 5 ; i++) {
-    SlicesZero[i]   = 0 ; 
-    SlicesFirst[i]  = 0 ; 
-    SlicesSecond[i] = 0 ; 
-  }
-  
-  cout << " end of MTrigger::MTrigger()" << endl ; 
-} 
-
-MTrigger::~MTrigger() {
-
-  delete histPmt ; 
-}
-  
-void MTrigger::Reset() { 
-  //
-  //  set all values of the signals to zero
-  //
-  Int_t  i, ii ; 
-  
-  for ( i =0 ; i <TRIGGER_PIXELS ; i++ ) {
-    used [i] = FALSE ; 
-    dknt [i] = FALSE ; 
-    
-    nphot[i] = 0 ; 
-    } 
-  
-  for ( ii=0 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 
-    sum_d_sig[ii] = 0. ;  
-  }
-
-  //
-  //   set the information about the Different Level Triggers to zero
-  //
-
-  nZero = nFirst = nSecond = 0 ; 
-  
-  for ( i = 0 ; i < 5 ; i++) {
-    SlicesZero[i]   = 0 ; 
-    SlicesFirst[i]  = 0 ; 
-    SlicesSecond[i] = 0 ; 
-  }
-    
-}
-
-
-Float_t  MTrigger::Fill( Int_t iPix, Float_t time ) { 
-  //
-  // fills the information about one single Phe in the Trigger class
-  //
-  // parameter is the number of the pixel and the time-difference to the
-  // first particle
-  //
-  //
-
-  Int_t i, ichan ; 
-
-  Float_t NoiseAmp = 0 ;   //  Amplitude of the PMT signal (results from noise)
-
-  //
-  //   first we have to check if the pixel iPix is used or not until now
-  //   if this is the first use, reset all signal for that pixels
-  // 
-  if ( iPix >= CAMERA_PIXELS ) {
-    // 
-    //   the PixelID is greater than the CAMERA  
-    //
-    cout << " WARNING:  MTrigger::Fill() :  iPix greater than CAMERA_PIXELS"
-	 << endl ; 
-    NoiseAmp = 0. ; 
-  }
-  else if ( iPix >=TRIGGER_PIXELS ) {
-    //
-    //   the pixel is inside the Camera, but outside of the TRIGGER-FIELD
-    //  
-    //   we just scramble the amplitude of the PMT-signal for the FADC
-    //
-    //   scramble the Amplitude of this single photo electron signal
-    //
-    NoiseAmp = (histPmt->GetRandom()/histMean) ; 
-  } 
-  else { 
-    //
-    //   the photoelectron is contributing to the trigger
-    //
-    if ( used[iPix] == FALSE ) {
-      used [iPix] = TRUE ; 
-      //      baseline[iPix] = 0. ; 
-
-      for (i=0; i < TRIGGER_TIME_SLICES; i++ ) {
-	a_sig[iPix][i] = 0. ; 
-	d_sig[iPix][i] = 0. ; 
-      }
-    }
-    
-    //
-    //   then select the time slice to use (ican) 
-    // 
-
-    
-    if ( time < 0. ) {
-      cout << "  WARNING!!   " << time << "  below ZERO!! Very strange!!" 
-	   << endl ; 
-    }
-    else if ( time < TOTAL_TRIGGER_TIME ) { 
-      nphot[iPix]++ ; 
-      //
-      ichan = (Int_t) ( time * ((Float_t) SLICES_PER_NSEC) ) ; 
-      
-      //
-      //   scramble the Amplitude of this single photo electron signal
-      //
-      NoiseAmp = (histPmt->GetRandom()/histMean) ; 
-      
-      for ( i = 0 ; i<RESPONSE_SLICES; i++ ) {
-	
-	if ( (ichan+i) < TRIGGER_TIME_SLICES ) {  
-	  a_sig[iPix][ichan+i] += NoiseAmp * sing_resp[i] ;
- 
-	} 
-      }
-    }
-    else {
-      cout << "  WARNING!!   " << time << "  out of TriggerTimeRange " 
-	   << TOTAL_TRIGGER_TIME << endl ; 
-    }
-  }
-  
-  return NoiseAmp ; 
-  
-}
-
-
-Float_t  MTrigger::FillNSB( Int_t iPix, Float_t time ) { 
-  //
-  // fills the information about one single Phe in the Trigger class
-  //
-  // parameter is the number of the pixel and the time-difference to the
-  // first particle
-  //
-  //
-
-  Int_t i, ichan ; 
-
-  Float_t NoiseAmp = 0 ;   //  Amplitude of the PMT signal (results from noise)
-
-  //
-  //   first we have to check if the pixel iPix is used or not until now
-  //   if this is the first use, reset all signal for that pixels
-  // 
-  if ( iPix >= CAMERA_PIXELS ) {
-    cout << " WARNING:  MTrigger::Fill() :  iPix greater than CAMERA_PIXELS"
-	 << endl ; 
-  }
-  else if ( iPix >= TRIGGER_PIXELS ) {
-    //
-    //   scramble the Amplitude of this single photo electron signal
-    //
-    NoiseAmp = (histPmt->GetRandom()/histMean) ; 
-  } 
-  
-  else {
-    if ( used[iPix] == FALSE ) {
-      used [iPix] = TRUE ; 
-      //      baseline[iPix] = 0. ; 
-
-      for (i=0; i < TRIGGER_TIME_SLICES; i++ ) {
-	a_sig[iPix][i] = 0. ; 
-	d_sig[iPix][i] = 0. ; 
-      }
-    }
-
-    //
-    //   then select the time slice to use (ican) 
-    // 
-    
-    if ( time < 0. ) {
-      cout << "  WARNING!!   " << time << "  below ZERO!! Very strange!!" 
-	   << endl ; 
-    }
-    else if ( time < TOTAL_TRIGGER_TIME ) { 
-      //
-      //  FillNSB doesn't add a photon to nphot[iPix] as the method Fill do!!
-      //
-      
-      ichan = (Int_t) ( time * ((Float_t) SLICES_PER_NSEC) ) ; 
-      
-      //
-      //   scramble the Amplitude of this single photo electron signal
-      //
-      NoiseAmp = (histPmt->GetRandom()/histMean) ; 
-      
-      for ( i = 0 ; i<RESPONSE_SLICES; i++ ) {
-	
-	if ( (ichan+i) < TRIGGER_TIME_SLICES ) {  
-	  a_sig[iPix][ichan+i] += NoiseAmp * sing_resp[i] ; 
-	} 
-      }
-    }
-    else {
-      cout << "  WARNING!!   " << time << "  out of TriggerTimeRange " 
-	   << TOTAL_TRIGGER_TIME << endl ; 
-    }
-  }
-  
-  return NoiseAmp ; 
-  
-}
-
-void MTrigger::ElecNoise() {
-
-  Float_t rausch ; 
-
-  rausch = RESPONSE_AMPLITUDE * 0.3 ; 
- 
-  for ( Int_t i=0 ; i < TRIGGER_PIXELS; i++  ) {
-    if ( used [i] == TRUE ) {
-      //cout << "Pixel " << i << " used"  ; 
-       
-      for ( Int_t ii=1 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 
-
-	a_sig [i][ii] +=  GenElec->Gaus(0., rausch  ) ; 
-
-      }
-    }
-  }
-
-}
-
-
-Int_t MTrigger::Diskriminate() {
-
-  cout << " MTrigger::Diskriminate()" << flush ; 
-
-  Int_t  iM = 0 ; 
-  Int_t  i, ii  ; 
-
-  Int_t  jmax = (Int_t) (gate_leng * SLICES_PER_NSEC )  ; 
-
-
-  //
-  //    first of all determine the integral of all signals to get
-  //    the baseline shift. 
-  // 
-
-
-  for ( i=0 ; i < TRIGGER_PIXELS ; i++ ) {
-    if ( used[i] == TRUE ) {
-      baseline[i] = 0. ; 
-
-      for ( ii = 0 ;  ii < TRIGGER_TIME_SLICES ; ii++ ) {
-	baseline[i] += a_sig[i][ii] ; 
-      } 
-
-      baseline[i] = baseline[i] / ( (Float_t ) TRIGGER_TIME_SLICES)  ;
-
-      //cout << "Pixel " << i 
-      //   << " baseline " << baseline[i] 
-      //   <<endl ; 
-
-    }
-  }
-  
-  //
-  //  take only that pixel which are used
-  //
-
-  for ( i=0 ; i < TRIGGER_PIXELS; i++  ) {
-    if ( used [i] == TRUE ) {
-      //cout << "Pixel " << i << " used"  ; 
-       
-      for ( ii=1 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 
-      
-	//
-	// first check if the signal is crossing the CHANNEL_THRESHOLD 
-	// form low to big signals
-	//
-	
-	if ( a_sig[i][ii-1] <   chan_thres  && 
-	     a_sig[i][ii]   >=  chan_thres  ) { 
-	  { 
-	    if ( dknt[i] == FALSE ) {
-	      dknt [i] = TRUE ; 
-	      iM++ ; 
-	    }
-	    //    cout << " disk " << ii  ; 
-	    // 
-	    //   put the standard diskriminator signal in 
-	    //   the diskriminated signal 
-	    //
-	    for ( Int_t j=0 ; j < jmax ; j++ ) { 
-	      
-	      if ( ii+j  < TRIGGER_TIME_SLICES ) { 
-		d_sig  [i][ii+j] = 1. ;  
-		sum_d_sig [ii+j] += 1. ;  
-	      } 
-	    } 
-	    ii = ii + jmax ; 
-	  }
-	}
-      }
-      //      cout << endl ; 
-    }
-  }
-
-  //cout << "**  MTrigger::Diskriminate()  " << iM << endl ; 
-
-
-  //
-  //   determine the number of zero level triggers
-  //
-  //   zero level trigger = the sum of all diskriminated signals
-  //   is above the TRIGGER_MULTI value. 
-  //   only for this events it is neccessay to look for next neighbours!!!
-  // 
-  
-  if ( iM > TRIGGER_MULTI ) {
-    Int_t iReturn = 0 ; 
-
-    for ( ii=1 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 
-      if ( sum_d_sig[ii] > TRIGGER_MULTI ) { 
-	iReturn++ ; 
-
-	SlicesZero[nZero++] = ii ; 
-	
-	//
-	//    if a trigger occurs we read out the next 50 nsec
-	//
-	//    -> don't study the next 50/0.25 = 200 slices
-	//
-	ii = ii + 200 ; 
-      }      
-    } 
-    
-    return ( iReturn ) ; 
-  }
-  else {
-    return ( 0 ) ; 
-  }
-
-  return ( 0 ) ; 
-  
-}  
-
-Int_t MTrigger::FirstLevel() {
-
-  Int_t iReturn = 0 ; 
-
-  Bool_t Muster[TRIGGER_PIXELS] ; 
-  Int_t  iMulti = 0 ; 
-
-  // cout << "#### MTrigger::FirstLevel()" << endl ; 
-  // cout << nZero << "  " << SlicesZero[0] <<  endl ; 
-  
-  if ( nZero > 1 ) { 
-    cout << " INFORMATION:  more than one Zero Level TRIGGER " << endl ; 
-  }
-
-  //
-  //   loop over all ZeroLevel Trigger
-  //
-  //   it is only neccessary to look after a ZeroLevel Trigger for
-  //   a FirstLevel (NextNeighbour) trigger. 
-  //
-  
-  for (Int_t iloop = 0; iloop < nZero ; iloop++ ) {
-    
-    //
-    //   Then run over all slices 
-    //   start at the ZeroLevelTrigger slices
-    //
-    
-    for ( Int_t iSli = SlicesZero[iloop];
-	  iSli < SlicesZero[iloop]+ 200; iSli++ ) {
-
-      //
-      //  then look in all pixel if the diskriminated signal is 1
-      //
-      iMulti = 0 ; 
-
-      for ( Int_t iPix = 0 ; iPix < TRIGGER_PIXELS; iPix++ ) {
-	Muster[iPix] = kFALSE ; 
-
-	if ( used [iPix] == TRUE ) {
-	  //
-	  //  now check the diskriminated signal
-	  //
-	  if ( d_sig [iPix][iSli] > 0. ) {
-
-	    iMulti++ ; 
-	    Muster[iPix] = kTRUE ; 
-	  } 
-	}
-      } // end of loop over the pixels
-      
-      //
-      //   here we have to look for next neighbours
-      //
-      
-      if ( PassNextNeighbour ( Muster ) ) { 
-	//
-	//   A NN-Trigger is detected at time Slice 
-	//
-	SlicesFirst[nFirst++] = iSli ; 
-	iReturn++ ;
-	break ; 
-      }   
-    } // end of loop over the slices  
-    
-  } // end of loop over zerolevelTriggers
-
-  //
-  //   return the Number of FirstLevel Triggers
-  //
-  return iReturn ; 
-}
-
-
-Bool_t MTrigger::PassNextNeighbour ( Bool_t m[] ) {
-  //
-  //  This method is looking for next neighbour triggers using a 
-  //  NNlookup table. This table is builded by the default constructor
-  //
-  
-  Int_t iNN ; 
-
-  //
-  //   loop over all trigger pixels
-  //
-  for ( Int_t i=0; i<TRIGGER_PIXELS; i++) { 
-    //
-    //  check if this pixel has a diskrminator signal 
-    //  (this is inside m[] ) 
-    //
-
-    if ( m[i] ) { 
-      iNN = 1 ; 
-      //      cout << "/ " << i  ; 
-      
-      //
-      //  look in the next neighbours from the lookuptable
-      //
-      for ( Int_t kk=0; kk<6; kk++ ) { 
-	//
-	//  if the nextneighbour is outside the triggerarea do nothing
-	//
-	if (NN[i][kk] >= TRIGGER_PIXELS ) {
-
-	} 
-	// the nextneighbout is inside the TRIGGER_PIXELS
-	else { 
-	  //
-	  //  look if the boolean of nn pixels is true
-	  //
-	  
-	  if ( m[ NN[i][kk] ] ) { 
-	    iNN++ ; 
-	  }  
-	}
-      } 
-      
-      //   cout << "   NN  " << iNN ; 
-      
-      if ( iNN >=4 ) { 
-	return ( kTRUE ) ; 
-      }  
-    } 
-  } 
-  return ( kFALSE ) ; 
-}
-
-Float_t MTrigger::GetFirstLevelTime(Int_t il ) {
-  return ( (Float_t)SlicesFirst[il]/ SLICES_PER_NSEC   ) ; 
-}
-
-
-
-void MTrigger::ShowSignal (MMcEvt *McEvt) { 
-  //
-  //  This method is used to book the histogramm to show the signal in 
-  //  a special gui frame (class MGTriggerSignal). After the look onto the
-  //  signals for a better understanding of the things we will expect 
-  //  the gui frame and all histogramms will be destroyed.   
-  //
-  
-  //
-  //  first of all create a list of the histograms to show
-  //
-  //  take only that one with a entry
-  
-  TH1F *hist ; 
-  TH1F *dhist ; 
-  Char_t dumm[10]; 
-  Char_t name[256]; 
-  
-  TObjArray  *AList ;
-  AList = new TObjArray(10) ; 
-
-  TObjArray  *DList ;
-  DList = new TObjArray(10) ; 
-
-  // the list of analog signal histograms
-  // at the beginning we initalise 10 elements
-  // but this array expand automaticly if neccessay
-  
-  Int_t ic = 0 ; 
-  for ( Int_t i=0 ; i < TRIGGER_PIXELS; i++  ) {
-    if ( used [i] == TRUE ) {
-
-      sprintf (dumm, "A_%d", i ) ; 
-      sprintf (name, "analog %d", i ) ; 
-      
-      hist = new TH1F(dumm, name, TRIGGER_TIME_SLICES, 0., TOTAL_TRIGGER_TIME); 
-      //
-      //  fill the histogram
-      //
-
-      for (Int_t ibin=1; ibin <=TRIGGER_TIME_SLICES; ibin++) {
-	hist->SetBinContent (ibin, a_sig[i][ibin-1]) ;
-      }
-      hist->SetMaximum(8.); 
-      hist->SetStats(kFALSE); 
-  
-      AList->Add(hist) ; 
-      
-      sprintf (dumm, "D_%d", i ) ; 
-      sprintf (name, "digital %d", i ) ; 
-      
-      dhist = new TH1F(dumm, name, TRIGGER_TIME_SLICES, 0., TOTAL_TRIGGER_TIME); 
-      if ( dknt[i] == TRUE ) {
-	//
-	//   fill the histogram of digital signal
-	//
-	for (Int_t ibin=1; ibin <=TRIGGER_TIME_SLICES; ibin++) {
-	  dhist->SetBinContent (ibin, d_sig[i][ibin-1]) ;
-	  dhist->SetStats(kFALSE); 
-	} 
-      }
-      dhist->SetMaximum(1.5);
-	
-      DList->Add(dhist); 
-      
-      ic++ ; 
-
-    }
-  }  
-
-  //
-  //   create the Gui Tool
-  //
-  //
-
-  new MGTriggerSignal(McEvt,
-		      AList,
- 		      DList,
-		      gClient->GetRoot(), 
- 		      gClient->GetRoot(), 
- 		      400, 400 ) ; 
-  
-  //
-  //   delete the List of histogramms
-  //
-
-  AList->Delete() ; 
-  DList->Delete() ; 
-  
-  delete AList ; 
-  delete DList ; 
-}
-  
Index: branches/start/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx	(revision 353)
+++ branches/start/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx	(revision 4308)
@@ -1,5 +1,3 @@
-#ifndef __MTrigger__
-#define __MTrigger__
-
+//
 //     class MTrigger
 //
@@ -14,154 +12,43 @@
 #include <math.h> 
 
-#include "TROOT.h"
 #include "TObject.h"
-#include "TRandom.h"
-#include "TH1.h"
 
 #include "Mdefine.h" 
-#include "MMcEvt.h"
 
-#include "MTriggerDefine.h"
-
-
-//==========
-//  MTrigger
+#define TRIGGER_TIME_SLICES    400
 //
-//  The simulation of the Trigger for MonteCarlo Events is using this 
-//  class. So all methods concerning the trigger should be done inside this
-//  class. 
+//      We need 400 Time Slices of 0.25 nsec width. 
+//      So the whole Time range we studies is 100 nsec. 
 //
-//  For a better understanding of the behavior of the trigger is here small
-//  abstract of the trigger. This may change in the future. 
+#define RESPONSE_SLICES        40
 //
-//  
-//  We now from the camera program (This is the surrounding of the class 
-//  MTrigger.) that one photo electron leaves at time t the photo cathode 
-//  of the pixel number iPix). 
-//
-//  At the end of the PMT, the preamp, the optical fiber transmission we
-//  get a signal of a given shape. After some discussion with Eckart the 
-//  standard response function looks like this :    
-//                                  
-//  It is a gaussian Signal with a given FWHM. 
-//
-//  So whenever a photo electron leaves the photo cathod, on has to add
-//  the standard response function to the analog signal of the pixel. 
-//
-//  Each pixel of the camera has such an summed-up analog signal. It may 
-//  look like this picture: 
+//       This is for the standard response Signal to 1 Photoelectron
+//       that leaves the Photocathode
+//       The whole Timescale for the signal is 10 nsec
 //
 //
-//  This is the input of the discriminator for the pixels. The output of
-//  the discriminator is a digital signal. The response of the diskriminator
-//  is not fixed at the moment. There are discussion about this topic. 
-//  
-//  At the moment the response is very simple. Whenever the analog signal
-//  is crossing a defined threshold from below to above, a digital signal 
-//  with a given length is created. 
+//       These values are discussed with Eckart. We start from this point. 
+#define RESPONSE_FWHM          2. 
+#define RESPONSE_AMPLITUDE     1. 
+//
+//       This are the Standard values of the response function for
+//       1 photo electron. 
+//       We assume a gaussian pulse with FWHM 2.5 nsec. 
+//
+
+#define CHANNEL_THRESHOLD      2. 
+//
+//       This is the diskriminator threshold for each individual channel
+//       First we set the value to 2 unit of the RESPONSE_AMPLITUDE 
+//
+#define TRIGGER_GATE           3. 
 // 
-//  No one can start with the simulation of different trigger levels. 
-//  
-//  The TriggerLevelZero is a very easy one. It is just looking if there 
-//  are more then N digital signals at level ON (=1). If this is the case,
-//  a TriggerLevelZero signal is created.
+//       Here we set the width of the digital signal we get if the signal
+//       passes the diskriminator
 //
-//  The TriggerLevelOne is not implemented now. This will be a kind of next 
-//  neighbour condition (i.e. four neigbouring analog signals at the same 
-//  time, but this requests at least four digital signals at level ON, what 
-//  is equivalent with a TriggerLevelZero.   
-//  
-//  
-class MTrigger {
+#define TRIGGER_MULTI          4.  
+//
+//       We get a Level Zero Trigger, if we have a least TRIGGER_MULTI
+//       channels with a diskrimiator signal at the same time 
+//
 
- private:
-  //
-  //    then for all pixels the shape of all the analog signals 
-  //
-  Bool_t   used [TRIGGER_PIXELS] ;  //  a boolean to indicated if the pixels is used in this event
-  Int_t    nphot[TRIGGER_PIXELS];   //  count the photo electrons per pixel (NSB phe are not counted) 
- 
-  Float_t  *a_sig[TRIGGER_PIXELS] ; //  the analog signal for pixels
-
-  Float_t  baseline[TRIGGER_PIXELS] ; //  for the baseline shift
-
-  //
-  //    then for all pixels the shape of the digital signal
-  //
-  Bool_t  dknt [TRIGGER_PIXELS] ;  //  a boolean to indicated if the pixels has passed the diskrminator 
-  Float_t *d_sig[TRIGGER_PIXELS] ; //  the digital signal for all pixels
-
-  //
-  //    and the sum of all digital signals
-  // 
-  Float_t sum_d_sig[TRIGGER_TIME_SLICES] ; 
-
-
-  //
-  //    first the data for the response function
-  //
-  Float_t fwhm_resp ;                      // fwhm of the phe_response function 
-  Float_t ampl_resp ;                      // amplitude of the phe_response function (in mV)
-  Float_t sing_resp[ RESPONSE_SLICES ] ;   // the shape of the phe_response function 
-
-  TH1F     *histPmt ; 
-  Float_t  histMean ;    // Mean value of the distribution of Rasmik (stored in histPmt) 
-  TRandom  *GenElec  ;   // RandomGenerator for the Electronic Noise
-
-  //
-  //    some values for the trigger settings
-  //
-  
-  Float_t chan_thres ; // the threshold (in mV) for each individuel pixels
-  Float_t gate_leng  ; // the length of the digital signal if analog signal is above threshold
-
-  Float_t trigger_multi  ;  // Number of Pixels requested for a Trigger
-
-  //
-  //  The lookup table for the next neighbours
-  // 
-
-  Int_t NN[TRIGGER_PIXELS][6] ; 
- 
-  //
-  //    some information about the different TriggerLevels in each Event
-  // 
-
-  Int_t  nZero ;         // how many ZeroLevel Trigger in one Event
-  Int_t  SlicesZero[5] ; // Times Slices at which the ZeroLevel Triggers occur
-
-  Int_t  nFirst ;         // how many FirstLevel Trigger in one Event
-  Int_t  SlicesFirst[5] ; // Times Slices at which the FirstLevel Triggers occur
-
-  Int_t  nSecond ;         // how many SecondLevel Trigger in one Event
-  Int_t  SlicesSecond[5] ; // Times Slices at which the SecondLevel Triggers occur
-
-
-public:
-
-  MTrigger() ; 
-
-  ~MTrigger() ; 
-
-  void Reset() ; 
-
-  Float_t  Fill( Int_t, Float_t ) ;  
-
-  Float_t  FillNSB( Int_t, Float_t ) ;  
-
-  void ElecNoise() ;
-
-  Int_t Diskriminate() ;
-
-  Int_t FirstLevel() ;   
-
-  Bool_t PassNextNeighbour( Bool_t m[] ) ; 
- 
-  void ShowSignal (MMcEvt *McEvt) ; 
-
-  Float_t GetFirstLevelTime( Int_t il ) ; 
-
-} ; 
-
-#endif
-
Index: branches/start/MagicSoft/Simulation/Detector/include-MTrigger/MTriggerDefine.h
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTriggerDefine.h	(revision 353)
+++ 	(revision )
@@ -1,72 +1,0 @@
-//
-//
-//      In this file are the fundamental definitions for the class MCTrigger
-//
-//
-#define TRIGGER_PIXELS        271
-//
-//      This is the number of Pixels contributing to the TRIGGER logic
-//      All Pixels-Id above that value don't do an trigger stuff. 
-//      
-//
-#define TOTAL_TRIGGER_TIME    250 
-//
-//      This values defines the total range in that we try to find
-//      a trigger. 
-//
-#define SLICES_PER_NSEC         4
-//      
-//      Each nano second is divided into the number of this values slices. 
-//      So you can get the total number of timeslices for one Pixel by 
-//      ( TOTAL_TRIGGER_TIME * SLICES_PER_NSEC ). 
-//      In the current settings this are 1000 slices
-//
-#define TRIGGER_TIME_SLICES     (TOTAL_TRIGGER_TIME*SLICES_PER_NSEC) 
-//
-//
-//
-//
-//       ------>>>   SETTINGS for the RESPONSE FUNCTION
-// 
-#define RESPONSE_SLICES        40
-//
-//       This is for the standard response Signal to 1 Photoelectron
-//       that leaves the Photocathode
-//       The whole Timescale for the signal is 10 nsec
-//
-//       The Response function
-//
-//       These values are discussed with Eckart. We start from this point. 
-//
-#define RESPONSE_FWHM          2. 
-
-#define RESPONSE_AMPLITUDE     1. 
-//
-//       This are the Standard values of the response function for
-//       1 photo electron. ( 1 means 1 mV per phote electron ) 
-//
-//
-//       -------->>> SETTINGS for the DISKRIMINATORS
-//
-//
-#define CHANNEL_THRESHOLD      2.5 
-//
-//       This is the diskriminator threshold for each individual channel
-//       First we set the value to 2 unit of the RESPONSE_AMPLITUDE 
-//
-#define TRIGGER_GATE           3. 
-// 
-//       Here we set the width of the digital signal we get if the signal
-//       passes the diskriminator
-//
-//
-//      --------->>>> SETTINGS for the TRIGGER logic
-//
-//
-#define TRIGGER_MULTI          4.  
-//
-//       We get a Level Zero Trigger, if we have a least TRIGGER_MULTI
-//       channels with a diskrimiator signal at the same time 
-//
-
-
Index: branches/start/MagicSoft/Simulation/Detector/include-MTrigger/TABLE_NEXT_NEIGHBOUR
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/TABLE_NEXT_NEIGHBOUR	(revision 353)
+++ 	(revision )
@@ -1,331 +1,0 @@
-    0       2     3     5     6     1     4 
-    1       2     6     8    18     0     7 
-    2       0     1     9    10     3     8 
-    3       0     4    10    11     2    12 
-    4       3     5    12    14     0    13 
-    5       0     4    15    16     6    14 
-    6       0     1    16    17     5    18 
-    7       8    18    20    36     1    19 
-    8       1     7     9    21     2    20 
-    9       2     8    22    23    10    21 
-   10       2     3    23    24     9    11 
-   11       3    12    24    25    10    26 
-   12       4    11    13    26     3    27 
-   13      12    14    27    29     4    28 
-   14       4    13    15    30     5    29 
-   15       5    14    31    32    16    30 
-   16       5     6    32    33    15    17 
-   17       6    18    33    34    16    35 
-   18       1     7    17    35     6    36 
-   19      20    36    38    60     7    37 
-   20       7    19    21    39     8    38 
-   21       8    20    22    40     9    39 
-   22       9    21    41    42    23    40 
-   23       9    10    42    43    22    24 
-   24      10    11    43    44    23    25 
-   25      11    26    44    45    24    46 
-   26      12    25    27    46    11    47 
-   27      13    26    28    47    12    48 
-   28      27    29    48    50    13    49 
-   29      13    28    30    51    14    50 
-   30      14    29    31    52    15    51 
-   31      15    30    53    54    32    52 
-   32      15    16    54    55    31    33 
-   33      16    17    55    56    32    34 
-   34      17    35    56    57    33    58 
-   35      18    34    36    58    17    59 
-   36       7    19    35    59    18    60 
-   37      38    60    62    90    19    61 
-   38      19    37    39    63    20    62 
-   39      20    38    40    64    21    63 
-   40      21    39    41    65    22    64 
-   41      66    67    22    40    42    65 
-   42      67    68    22    23    41    43 
-   43      68    69    23    24    42    44 
-   44      69    70    24    25    43    45 
-   45      70    71    25    46    44    72 
-   46      26    45    47    72    25    73 
-   47      27    46    48    73    26    74 
-   48      28    47    49    74    27    75 
-   49      48    50    75    77    28    76 
-   50      28    49    51    78    29    77 
-   51      29    50    52    79    30    78 
-   52      30    51    53    80    31    79 
-   53      81    82    31    52    54    80 
-   54      82    83    31    32    53    55 
-   55      83    84    32    33    54    56 
-   56      84    85    33    34    55    57 
-   57      85    86    34    58    56    87 
-   58      35    57    59    87    34    88 
-   59      36    58    60    88    35    89 
-   60      19    37    59    89    36    90 
-   61      62    90    92   126    37    91 
-   62      37    61    63    93    38    92 
-   63      38    62    64    94    39    93 
-   64      39    63    65    95    40    94 
-   65      66    96    40    64    41    95 
-   66      41    65    97    98    67    96 
-   67      41    42    98    99    66    68 
-   68      42    43    99   100    67    69 
-   69      43    44   100   101    68    70 
-   70      44    45   101   102    69    71 
-   71      45    72   102   103    70   104 
-   72      71   104    46    73    45   105 
-   73      47    72    74   105    46   106 
-   74      48    73    75   106    47   107 
-   75      49    74    76   107    48   108 
-   76      75    77   108   110    49   109 
-   77      49    76    78   111    50   110 
-   78      50    77    79   112    51   111 
-   79      51    78    80   113    52   112 
-   80      81   114    52    79    53   113 
-   81      53    80   115   116    82   114 
-   82      53    54   116   117    81    83 
-   83      54    55   117   118    82    84 
-   84      55    56   118   119    83    85 
-   85      56    57   119   120    84    86 
-   86      57    87   120   121    85   122 
-   87      86   122    58    88    57   123 
-   88      59    87    89   123    58   124 
-   89      60    88    90   124    59   125 
-   90      37    61    89   125    60   126 
-   91      92   126   128   168    61   127 
-   92      61    91    93   129    62   128 
-   93      62    92    94   130    63   129 
-   94      63    93    95   131    64   130 
-   95      96   132    64    94    65   131 
-   96      65    95    97   133    66   132 
-   97      66    96    98   133   134   135 
-   98      66    67    97    99   135   136 
-   99      67    68    98   100   136   137 
-  100      68    69    99   101   137   138 
-  101      69    70   100   102   138   139 
-  102      70    71   101   103   139   140 
-  103      71   104   102   142   140   141 
-  104      72   105   103   142    71   143 
-  105     104   143    73   106    72   144 
-  106      74   105   107   144    73   145 
-  107      75   106   108   145    74   146 
-  108      76   107   109   146    75   147 
-  109     108   110   147   149    76   148 
-  110      76   109   111   150    77   149 
-  111      77   110   112   151    78   150 
-  112      78   111   113   152    79   151 
-  113     114   153    79   112    80   152 
-  114      80   113   115   154    81   153 
-  115      81   114   116   154   155   156 
-  116      81    82   115   117   156   157 
-  117      82    83   116   118   157   158 
-  118      83    84   117   119   158   159 
-  119      84    85   118   120   159   160 
-  120      85    86   119   121   160   161 
-  121      86   122   120   163   161   162 
-  122      87   123   121   163    86   164 
-  123     122   164    88   124    87   165 
-  124      89   123   125   165    88   166 
-  125      90   124   126   166    89   167 
-  126      61    91   125   167    90   168 
-  127     128   168   170   216    91   169 
-  128      91   127   129   171    92   170 
-  129      92   128   130   172    93   171 
-  130      93   129   131   173    94   172 
-  131     132   174    94   130    95   173 
-  132      95   131   133   175    96   174 
-  133      96   132    97   175   134   176 
-  134     177   178   135   176    97   133 
-  135     178   179   134   136    97    98 
-  136     179   180   135   137    98    99 
-  137     180   181   136   138    99   100 
-  138     181   182   137   139   100   101 
-  139     182   183   138   140   101   102 
-  140     183   184   139   141   102   103 
-  141     184   185   140   186   103   142 
-  142     104   143   103   187   141   186 
-  143     105   144   142   187   104   188 
-  144     143   188   106   145   105   189 
-  145     107   144   146   189   106   190 
-  146     108   145   147   190   107   191 
-  147     109   146   148   191   108   192 
-  148     147   149   192   194   109   193 
-  149     109   148   150   195   110   194 
-  150     110   149   151   196   111   195 
-  151     111   150   152   197   112   196 
-  152     153   198   112   151   113   197 
-  153     113   152   154   199   114   198 
-  154     114   153   115   199   155   200 
-  155     201   202   156   200   115   154 
-  156     202   203   155   157   115   116 
-  157     203   204   156   158   116   117 
-  158     204   205   157   159   117   118 
-  159     205   206   158   160   118   119 
-  160     206   207   159   161   119   120 
-  161     207   208   160   162   120   121 
-  162     208   209   161   210   121   163 
-  163     122   164   121   211   162   210 
-  164     123   165   163   211   122   212 
-  165     164   212   124   166   123   213 
-  166     125   165   167   213   124   214 
-  167     126   166   168   214   125   215 
-  168      91   127   167   215   126   216 
-  169     170   216   218   270   127   217 
-  170     127   169   171   219   128   218 
-  171     128   170   172   220   129   219 
-  172     129   171   173   221   130   220 
-  173     174   222   130   172   131   221 
-  174     131   173   175   223   132   222 
-  175     132   174   133   223   176   224 
-  176     177   225   134   224   133   175 
-  177     134   176   226   227   178   225 
-  178     134   135   227   228   177   179 
-  179     135   136   228   229   178   180 
-  180     136   137   229   230   179   181 
-  181     137   138   230   231   180   182 
-  182     138   139   231   232   181   183 
-  183     139   140   232   233   182   184 
-  184     140   141   233   234   183   185 
-  185     141   186   234   235   184   236 
-  186     185   236   141   237   142   187 
-  187     143   188   142   238   186   237 
-  188     144   189   187   238   143   239 
-  189     188   239   145   190   144   240 
-  190     146   189   191   240   145   241 
-  191     147   190   192   241   146   242 
-  192     148   191   193   242   147   243 
-  193     192   194   243   245   148   244 
-  194     148   193   195   246   149   245 
-  195     149   194   196   247   150   246 
-  196     150   195   197   248   151   247 
-  197     198   249   151   196   152   248 
-  198     152   197   199   250   153   249 
-  199     153   198   154   250   200   251 
-  200     201   252   155   251   154   199 
-  201     155   200   253   254   202   252 
-  202     155   156   254   255   201   203 
-  203     156   157   255   256   202   204 
-  204     157   158   256   257   203   205 
-  205     158   159   257   258   204   206 
-  206     159   160   258   259   205   207 
-  207     160   161   259   260   206   208 
-  208     161   162   260   261   207   209 
-  209     162   210   261   262   208   263 
-  210     209   263   162   264   163   211 
-  211     164   212   163   265   210   264 
-  212     165   213   211   265   164   266 
-  213     212   266   166   214   165   267 
-  214     167   213   215   267   166   268 
-  215     168   214   216   268   167   269 
-  216     127   169   215   269   168   270 
-  217     218   270   272   330   169   271 
-  218     169   217   219   273   170   272 
-  219     170   218   220   274   171   273 
-  220     171   219   221   275   172   274 
-  221     222   276   172   220   173   275 
-  222     173   221   223   277   174   276 
-  223     174   222   175   277   224   278 
-  224     225   279   176   278   175   223 
-  225     176   224   226   280   177   279 
-  226     177   225   281   282   227   280 
-  227     177   178   282   283   226   228 
-  228     178   179   283   284   227   229 
-  229     179   180   284   285   228   230 
-  230     180   181   285   286   229   231 
-  231     181   182   286   287   230   232 
-  232     182   183   287   288   231   233 
-  233     183   184   288   289   232   234 
-  234     184   185   289   290   233   235 
-  235     185   236   290   291   234   292 
-  236     186   235   237   292   185   293 
-  237     236   293   186   294   187   238 
-  238     188   239   187   295   237   294 
-  239     189   240   238   295   188   296 
-  240     239   296   190   241   189   297 
-  241     191   240   242   297   190   298 
-  242     192   241   243   298   191   299 
-  243     193   242   244   299   192   300 
-  244     243   245   300   302   193   301 
-  245     193   244   246   303   194   302 
-  246     194   245   247   304   195   303 
-  247     195   246   248   305   196   304 
-  248     249   306   196   247   197   305 
-  249     197   248   250   307   198   306 
-  250     198   249   199   307   251   308 
-  251     252   309   200   308   199   250 
-  252     200   251   253   310   201   309 
-  253     201   252   311   312   254   310 
-  254     201   202   312   313   253   255 
-  255     202   203   313   314   254   256 
-  256     203   204   314   315   255   257 
-  257     204   205   315   316   256   258 
-  258     205   206   316   317   257   259 
-  259     206   207   317   318   258   260 
-  260     207   208   318   319   259   261 
-  261     208   209   319   320   260   262 
-  262     209   263   320   321   261   322 
-  263     210   262   264   322   209   323 
-  264     263   323   210   324   211   265 
-  265     212   266   211   325   264   324 
-  266     213   267   265   325   212   326 
-  267     266   326   214   268   213   327 
-  268     215   267   269   327   214   328 
-  269     216   268   270   328   215   329 
-  270     169   217   269   329   216   330 
-  271     272   330   332   396   217   331 
-  272     217   271   273   333   218   332 
-  273     218   272   274   334   219   333 
-  274     219   273   275   335   220   334 
-  275     276   336   220   274   221   335 
-  276     221   275   277   337   222   336 
-  277     222   276   223   337   278   338 
-  278     279   339   224   338   223   277 
-  279     224   278   280   340   225   339 
-  280     225   279   281   341   226   340 
-  281     342   343   226   280   282   341 
-  282     343   344   226   227   281   283 
-  283     344   345   227   228   282   284 
-  284     345   346   228   229   283   285 
-  285     346   347   229   230   284   286 
-  286     347   348   230   231   285   287 
-  287     348   349   231   232   286   288 
-  288     349   350   232   233   287   289 
-  289     350   351   233   234   288   290 
-  290     351   352   234   235   289   291 
-  291     352   353   235   292   290   354 
-  292     236   293   291   354   235   355 
-  293     237   292   294   355   236   356 
-  294     293   356   237   357   238   295 
-  295     239   296   238   358   294   357 
-  296     240   297   295   358   239   359 
-  297     296   359   241   298   240   360 
-  298     242   297   299   360   241   361 
-  299     243   298   300   361   242   362 
-  300     244   299   301   362   243   363 
-  301     300   302   363   365   244   364 
-  302     244   301   303   366   245   365 
-  303     245   302   304   367   246   366 
-  304     246   303   305   368   247   367 
-  305     306   369   247   304   248   368 
-  306     248   305   307   370   249   369 
-  307     249   306   250   370   308   371 
-  308     309   372   251   371   250   307 
-  309     251   308   310   373   252   372 
-  310     252   309   311   374   253   373 
-  311     375   376   253   310   312   374 
-  312     376   377   253   254   311   313 
-  313     377   378   254   255   312   314 
-  314     378   379   255   256   313   315 
-  315     379   380   256   257   314   316 
-  316     380   381   257   258   315   317 
-  317     381   382   258   259   316   318 
-  318     382   383   259   260   317   319 
-  319     383   384   260   261   318   320 
-  320     384   385   261   262   319   321 
-  321     385   386   262   322   320   387 
-  322     263   323   321   387   262   388 
-  323     264   322   324   388   263   389 
-  324     323   389   264   390   265   325 
-  325     266   326   265   391   324   390 
-  326     267   327   325   391   266   392 
-  327     326   392   268   328   267   393 
-  328     269   327   329   393   268   394 
-  329     270   328   330   394   269   395 
-  330     217   271   329   395   270   396 
