Index: trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 2373)
+++ trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 2393)
@@ -262,4 +262,6 @@
   GenElec = new TRandom() ; 
 
+  GenElec->SetSeed(0);
+
   //
   //  Read in the lookup table for NN trigger
@@ -885,5 +887,5 @@
       <<endl;
 
-    for (i=0;i<(UInt_t)(TRIGGER_TIME_SLICES*1001);i++){
+    for (i=0;i<TRIGGER_TIME_SLICES*1001;i++){
       noise[i]=GenElec->Gaus(0., rausch  );
       }
@@ -1030,7 +1032,9 @@
     fclose (unit) ;
 
-    for (int i=0;i<CAMERA_PIXELS;i++)
+    for (int i=0;i<CAMERA_PIXELS;i++){
       thres[i]=thres_aux[i];
-  }
+    }
+  }
+
 }
 
@@ -1138,5 +1142,5 @@
   for ( i=0 ; i < pixnum; i++  ) {
     if ( used [i] == TRUE ) {
-           
+
       for ( ii=1 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 
 	//
@@ -1144,5 +1148,4 @@
 	// form low to big signals
 	//
-	
 	if ( a_sig[i][ii-1] <   chan_thres[i]  && 
 	     a_sig[i][ii]   >=  chan_thres[i]  ) { 
@@ -1315,5 +1318,5 @@
     //
     Int_t iReturn = 0 ; 
-  
+
     for (Int_t iS=0; iS< TRIGGER_TIME_SLICES; iS++ ) {
       
@@ -1326,5 +1329,4 @@
       else SlicesZero[iS] = FALSE;
     }
-
     return ( iReturn ) ; 
   }
Index: trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx	(revision 2373)
+++ trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx	(revision 2393)
@@ -178,4 +178,6 @@
   ~MTrigger() ; 
 
+  void SetSeed(UInt_t seed)  {GenElec->SetSeed(seed);}
+
   void Reset() ; 
 
