Index: trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx	(revision 2355)
+++ trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx	(revision 2391)
@@ -19,7 +19,7 @@
 //=
 //= $RCSfile: creadparam.cxx,v $
-//= $Revision: 1.23 $
+//= $Revision: 1.24 $
 //= $Author: blanch $ 
-//= $Date: 2003-09-23 17:38:48 $
+//= $Date: 2003-10-17 19:40:24 $
 //=
 //=//////////////////////////////////////////////////////////////////////
@@ -70,5 +70,5 @@
 static char Input_filename[100][PATH_MAX_LENGTH];  //@< input filename
 static char Starfield_filename[PATH_MAX_LENGTH]; //@< starfield input filename
-static int Starfield_center[6];               //@< center of the starfield FOV
+static int Starfield_center[6]={0,0,0,0,0,0}; //@< center of the starfield FOV
                                               //@< RA(H,M,S) & DEC (D,M,S)
 static char Data_filename[PATH_MAX_LENGTH];   //@< data filename
@@ -82,6 +82,7 @@
 static int  Starfield_rotate = FALSE;         //@< switch on starfield rotation
 static int ElecNoise = TRUE;                  //@< Will we add ElecNoise?
-static float FADC_pedestal = 50.0;            //@< Value for FADC Pedestal
+static float FADC_pedestal = 10.0;            //@< Value for FADC Pedestal
 static float FADC_Noise = 2.0;                //@< Value for FADC ElecNoise
+static float Digital_Noise = 1.0;            //@< Value for FADC  digital Noise
 static float Trig_Noise = 0.3;                //@< Factor for Trigger ElecNoise
 static int simulateNSB = TRUE;                //@< Will we simulate NSB?
@@ -92,5 +93,5 @@
 static float RiseDisc = -1.0;
 static float SecureDisc = 7.0;
-static long int Seeds[2]; 
+static long int Seeds[2]={69184,10406}; 
 static int *Skip;
 static int nSkip=0;
@@ -126,8 +127,9 @@
 static float FADC_resp_ampl_out = MFADC_RESPONSE_AMPLITUDE;
 static float FADC_resp_fwhm_out = MFADC_RESPONSE_FWHM;
-static float Source_offset_th=0.;     //<@  Displacement in Theta of the 
-                                      //<@ source from the center
-static float Source_offset_ph=0.;     //<@  Displacement in Phi of the 
-                                      //<@ source from the center
+static float High_to_Low = 10.0;      //@< Low gain channel respct to High
+static float Source_offset_th=0.;     //@<  Displacement in Theta of the 
+                                      //@< source from the center
+static float Source_offset_ph=0.;     //@<  Displacement in Phi of the 
+                                      //@< source from the center
 
 //!@}
@@ -215,4 +217,8 @@
       // get the name of the input_file from the line
       sscanf(line, "%s %i %s", token,&k, filename_tmp);
+      if(k>99 || k<0){
+	printf("ERROR :  The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
+	exit(1);
+      }
       strcpy(&Input_filename[k][0],&filename_tmp[0]);
       break;
@@ -285,8 +291,15 @@
       break;
 
+    case high_to_low:              //@< FADC ElecNoise
+          
+      // Value for the Low Gain channel respect to the High gain
+      sscanf(line, "%s %f", token, &High_to_Low);
+          
+      break;
+
     case fadc_noise:              //@< FADC ElecNoise
           
       // value for FADC Elec Noise
-      sscanf(line, "%s %f", token, &FADC_Noise);
+      sscanf(line, "%s %f %f", token, &FADC_Noise, &Digital_Noise);
       ElecNoise = TRUE;
           
@@ -348,4 +361,8 @@
       // get value of threshold (in ph.e.)
       sscanf(line, "%s %i %f", token,&k, &aux);
+      if(k>99 || k<0){
+	printf("ERROR :  The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
+	exit(1);
+      }
       qThreshold[0][k]=aux;
       Individual_Thres = TRUE;
@@ -494,4 +511,8 @@
       //  Get trigger conditions
       sscanf(line, "%s %d %f %d %d", token, &j, &aux, &aux3, &aux4);
+      if(j>99 || j<0){
+	printf("ERROR :  The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
+	exit(1);
+      }
       Trigger_threshold[j]=aux;
       Trigger_multiplicity[j]=aux3;
@@ -793,8 +814,10 @@
 //!@{
 int
-add_elec_noise(float *fadc, float *trig)
+add_elec_noise(float *fadc, float *digi, float *trig)
 {
   *fadc = FADC_Noise;
+  *digi = Digital_Noise;
   *trig = Trig_Noise;
+  
   return ( ElecNoise);
 }
@@ -1255,4 +1278,22 @@
 
 //!@}
+//!-----------------------------------------------------------
+// @name get_High_to_Low
+//                                                
+// @desc get the conversion factor between high and low gain
+//
+//------------------------------------------------------------
+// @function 
+
+//!@{
+
+
+float get_High_to_Low(void){
+
+  return High_to_Low;
+
+}
+
+//!@}
 //=------------------------------------------------------------
 //!@subsection Log of this file.
@@ -1261,4 +1302,7 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.23  2003/09/23 17:38:48  blanch
+// ana_pixels command has been removed.
+//
 // Revision 1.22  2003/09/23 16:52:07  blanch
 // We do not read ct_file anymore.
