Index: /trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx
===================================================================
--- /trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 1249)
+++ /trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 1250)
@@ -941,4 +941,39 @@
     chan_thres[i]=thres[i];
   }
+}
+
+
+void MTrigger::CheckThreshold(float *thres){
+  //=============================================================
+  //
+  //   Set Right Discriminator threshold, taking into account trigger pixels
+
+  FILE *unit;
+
+  float thres_aux[CAMERA_PIXELS];
+  int id;
+  
+  for (int i=0;i<CAMERA_PIXELS;i++)
+    thres_aux[i]=999999.99;
+  
+  if((unit =fopen("../include-MTrigger/TABLE_PIXELS_IN_CELLS", "r" )) == 0 ){ 
+    cout << "ERROR: not able to read ../include-MTrigger/TABLE_PIXELS_IN_CELLS"
+	 << endl ; 
+    exit(123) ; 
+  }  
+  else { 
+    while ( feof(unit) == 0 ) {
+      for ( Int_t k=0; k<TRIGGER_CELLS; k++ ) { 
+	fscanf ( unit, "%d ", &id ) ;
+	if ((id-1)<TRIGGER_PIXELS)
+	  thres_aux[id-1]=thres[id-1];
+      }
+    }
+  }
+  fclose (unit) ;
+
+  for (int i=0;i<CAMERA_PIXELS;i++)
+    thres[i]=thres_aux[i];
+  
 }
 
