Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 1251)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 1252)
@@ -21,7 +21,7 @@
 //
 // $RCSfile: camera.cxx,v $
-// $Revision: 1.34 $
+// $Revision: 1.35 $
 // $Author: blanch $ 
-// $Date: 2002-03-13 18:13:56 $
+// $Date: 2002-03-15 15:15:52 $
 //
 ////////////////////////////////////////////////////////////////////////
@@ -248,5 +248,5 @@
 
 //@: Trigger conditions for a single trigger mode
-static float qThreshold[TRIGGER_PIXELS];  
+static float qThreshold[CAMERA_PIXELS];  
 static int Trigger_multiplicity = 4;
 static int Trigger_topology = 2;
@@ -449,5 +449,5 @@
   Float_t nsb_fadcresp[(Int_t) SLICES_MFADC];   //@< array to write the fadc
                                                 //@< response from the database
-  Byte_t trigger_map[((Int_t)(TRIGGER_PIXELS/8))+1];//@< Pixels on when the
+  Byte_t trigger_map[((Int_t)(CAMERA_PIXELS/8))+1]; //@< Pixels on when the
                                                     //@< camera triggers
   Float_t fadc_elecnoise[CAMERA_PIXELS];  //@< Electronic niose for each pixel
@@ -480,5 +480,5 @@
   UShort_t numPix;            //@< number of sets of fadc written counts
 
-  float fpixelthres[TRIGGER_PIXELS];         //@< Threshold values
+  float fpixelthres[CAMERA_PIXELS];         //@< Threshold values
 
   TArrayC *fadcValues;  //@< the analog Fadc signal for pixels
@@ -780,6 +780,13 @@
   // initialise instance of Trigger and FADC classes
 
-  MTrigger  Trigger(Trigger_gate_length, Trigger_overlaping_time,
-		    Trigger_response_ampl, Trigger_response_fwhm);  //@< A instance of the Class MTrigger 
+  MTrigger  Trigger(Trigger_gate_length, 
+		    Trigger_overlaping_time,
+		    Trigger_response_ampl, 
+		    Trigger_response_fwhm);  //@< A instance of the Class MTrigger 
+
+  // Set Right Discriminator threshold, taking into account trigger pixels
+
+  Trigger.CheckThreshold(&qThreshold[0]);
+
 
   //  Initialise McTrig information class if we want to save trigger informtion
@@ -955,5 +962,5 @@
 	  HeaderTrig[iconcount]->SetTopology((Short_t) isorttopo[itopocount+Trigger_loop_ltop]);
 	  HeaderTrig[iconcount]->SetMultiplicity((Short_t) imulticount+Trigger_loop_lmult);
-	  for(int i=0;i<TRIGGER_PIXELS;i++){
+	  for(int i=0;i<CAMERA_PIXELS;i++){
 	    fpixelthres[i]=
 	      ((Float_t)(fthrescount)>=qThreshold[i])?
@@ -1430,5 +1437,5 @@
 	  int iconcount;
 	  for (iconcount=0, ithrescount=0, fthrescount=Trigger_loop_lthres;fthrescount<=Trigger_loop_uthres;ithrescount++, fthrescount+=Trigger_loop_sthres){
-	    for (i=0;i<TRIGGER_PIXELS;i++)
+	    for (i=0;i<CAMERA_PIXELS;i++)
 	      fpixelthres[i]=
 		((Float_t)(fthrescount)>=qThreshold[i])?
@@ -1579,5 +1586,5 @@
 	  Trigger.SetMultiplicity(Trigger_multiplicity);
 	  Trigger.SetTopology(Trigger_topology);
-	  for (int i=0;i<TRIGGER_PIXELS;i++)
+	  for (int i=0;i<CAMERA_PIXELS;i++)
 	    fpixelthres[i]=qThreshold[i];
 	  Trigger.SetThreshold(fpixelthres);
@@ -3369,4 +3376,7 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.34  2002/03/13 18:13:56  blanch
+// Some changes to fill correctly the new format of MMcRunHeader.
+//
 // Revision 1.33  2002/03/04 17:21:48  blanch
 // Small and not important changes.
@@ -3472,4 +3482,7 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.34  2002/03/13 18:13:56  blanch
+// Some changes to fill correctly the new format of MMcRunHeader.
+//
 // Revision 1.33  2002/03/04 17:21:48  blanch
 // Small and not important changes.
