Index: trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 2989)
+++ trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 5082)
@@ -365,5 +365,5 @@
 
 MTrigger::MTrigger(Int_t pix, MGeomCam *camgeom,
-		   float gate, float overt, float ampl, float fwhm) { 
+		   float gate, float overt, float ampl, float fwhm, int ct_id) { 
   // ============================================================
   //
@@ -487,5 +487,7 @@
   // 
 
-  histPmt = new TH1F ("histPmt","Noise of PMT", 40, 0., 40.) ;
+  char histname[32];
+  sprintf(histname, "histPmt_%d", ct_id);
+  histPmt = new TH1F (histname,"Noise of PMT", 40, 0., 40.) ;
   
   Stat_t ValRazmik[41] = { 0., 2.14, 2.06, 2.05, 2.05, 2.06, 2.07, 2.08,  2.15,
@@ -925,22 +927,14 @@
   else if ( iPix >= pixnum ) {
     //
-    //  We have not to fill information in the trigger part, 
-    //  but we must create the height of the puls going into 
+    //  We do not have to fill information in the trigger part, 
+    //  but we must create the height of the pulse going into 
     //  the FADC simulation
     //
     PmtAmp =  (histPmt->GetRandom()/histMean) ; 
-    
-    //
-    //  But we fill the information in the counters of phe's
-    //
-    
-    if ( fall == CASE_SHOW )
-      nphotshow[iPix]++ ; 
-    else if ( fall == CASE_NSB ) 
-      nphotshow[iPix]++ ; 
-    else if ( fall == CASE_STAR ) 
-      nphotstar[iPix]++ ; 
-    
-      
+
+    // AM April 2004: removed updating of counters nphotshow, nphotnsb,
+    // nphotstar for outer pixels... these arrays (see constructors) are
+    // initialized only with as many elements as trigger pixels!! This
+    // made the camera crash at random in some ocassions.
   }
   else {  
@@ -995,5 +989,5 @@
       nphotshow[iPix]++ ; 
     else if ( fall == CASE_NSB ) 
-      nphotshow[iPix]++ ; 
+      nphotnsb[iPix]++ ; 
     else if ( fall == CASE_STAR ) 
       nphotstar[iPix]++ ; 
Index: trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx	(revision 2989)
+++ trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.hxx	(revision 5082)
@@ -115,5 +115,5 @@
 
   TH1F     *histPmt ; 
-  Float_t  histMean ;    // Mean value of the distribution of Rasmik (stored in histPmt) 
+  Float_t  histMean ;    // Mean value of the distribution of Razmik (stored in histPmt) 
   TRandom  *GenElec  ;   // RandomGenerator for the Electronic Noise
 
@@ -174,5 +174,5 @@
 
   MTrigger(int pix, MGeomCam *camgeom,
-	   float gate, float overt, float ampl, float fwhm) ; 
+	   float gate, float overt, float ampl, float fwhm, int ct_id=0) ; 
   
   MTrigger(int pix, 
