Index: trunk/MagicSoft/Simulation/Detector/Starfield/Makefile
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Starfield/Makefile	(revision 431)
+++ trunk/MagicSoft/Simulation/Detector/Starfield/Makefile	(revision 432)
@@ -3,5 +3,5 @@
 ## Starfield Generator Makefile
 ##
-## $Id: Makefile,v 1.2 2000-09-21 10:08:10 harald Exp $
+## $Id: Makefile,v 1.3 2000-09-21 10:31:36 harald Exp $
 ##   
 ##################################################################
@@ -149,2 +149,26 @@
 parameters.o: /usr/include/sys/machine/machtime.h
 parameters.o: /usr/include/sys/rt_limits.h
+../include-CORSIKA/COREventHeader.o: ../include-CORSIKA/COREventHeader.hxx
+../include-CORSIKA/COREventHeader.o: /usr/include/stdlib.h
+../include-CORSIKA/COREventHeader.o: /usr/include/standards.h
+../include-CORSIKA/COREventHeader.o: /usr/include/getopt.h
+../include-CORSIKA/COREventHeader.o: /usr/include/sys/types.h
+../include-CORSIKA/COREventHeader.o: /usr/include/mach/machine/vm_types.h
+../include-CORSIKA/COREventHeader.o: /usr/include/sys/select.h
+../include-CORSIKA/COREventHeader.o: /usr/include/math.h
+../include-CORSIKA/CORParticle.o: ../include-CORSIKA/CORParticle.hxx
+../include-CORSIKA/CORParticle.o: /usr/include/stdlib.h
+../include-CORSIKA/CORParticle.o: /usr/include/standards.h
+../include-CORSIKA/CORParticle.o: /usr/include/getopt.h
+../include-CORSIKA/CORParticle.o: /usr/include/sys/types.h
+../include-CORSIKA/CORParticle.o: /usr/include/mach/machine/vm_types.h
+../include-CORSIKA/CORParticle.o: /usr/include/sys/select.h
+../include-CORSIKA/CORParticle.o: /usr/include/math.h
+../include-CORSIKA/CORStatfile.o: ../include-CORSIKA/CORStatfile.hxx
+../include-CORSIKA/CORStatfile.o: /usr/include/stdlib.h
+../include-CORSIKA/CORStatfile.o: /usr/include/standards.h
+../include-CORSIKA/CORStatfile.o: /usr/include/getopt.h
+../include-CORSIKA/CORStatfile.o: /usr/include/sys/types.h
+../include-CORSIKA/CORStatfile.o: /usr/include/mach/machine/vm_types.h
+../include-CORSIKA/CORStatfile.o: /usr/include/sys/select.h
+../include-CORSIKA/CORStatfile.o: /usr/include/math.h
Index: trunk/MagicSoft/Simulation/Detector/Starfield/starfield.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Starfield/starfield.cxx	(revision 431)
+++ trunk/MagicSoft/Simulation/Detector/Starfield/starfield.cxx	(revision 432)
@@ -9,5 +9,5 @@
 #include "starfield.h"
 
-#define PROGRAMID "$Id: starfield.cxx,v 1.2 2000-01-21 16:39:25 petry Exp $"
+#define PROGRAMID "$Id: starfield.cxx,v 1.3 2000-09-21 10:31:36 harald Exp $"
 
 /////////////////////////////////////////////////////////////////////////
@@ -18,5 +18,5 @@
   parameters pars;
   star stars[iMAXSTARS];
-  photon photons[iMAXPHOT];  
+  photon *photons;  
 
   ifstream in; 
@@ -77,4 +77,8 @@
   in.close();
 
+  // Allocate memory for photons
+
+  photons=new photon[iMAXPHOT];
+
 
   // prepare loop over star catalog files
@@ -223,4 +227,12 @@
     
       for(j=0; j<nph[k]; j++){ // loop over photons of this waveband
+
+	// Check if we have overflowed the alllowed ph number
+
+	  if(totalphotinside >= iMAXPHOT){
+	    cout << "Warning: photon memory full. Can only store " << iMAXPHOT << " photons.\n";
+	    break;
+	    //exit(1);
+	  }
       
 	// for every photon, a pair of uniform random x,y coordinates ( x*x+y*y<300 ) is generated
@@ -254,9 +266,4 @@
 	  totalphotinside++;
 
-	  if(totalphotinside >= iMAXPHOT){
-	    cout << "Error: photon memory full. Can only store " << iMAXPHOT << " photons.\n";
-	    exit(1);
-	  }
-
 	  totalnumphot++;	 
 	  
@@ -270,9 +277,8 @@
 	
       } // end photon loop   
-    
     } // end waveband loop
 
     stars[i].numphot = photinside;
-    
+    //if (i>81) break;
     if (pars.verbose) cout<<"Star number= "<<i<< " (catalog number " << 
 			starnumber << ") Number of photons accepted = "<< photinside<<endl;
@@ -284,6 +290,6 @@
   convertcorsika( 
 		 ((int)pars.ct_ra_h*10)*1000 + (int)(abs(pars.ct_dec_deg)*10), // the file id
-		  totalphotinside, photons, pars.integtime_s, pars.verbose);
-   
+		 totalphotinside, photons, pars.integtime_s, pars.verbose, pars.output_file);
+
   return 0;
   
