Index: trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 1783)
+++ trunk/MagicSoft/Mars/mmain/MMonteCarlo.cc	(revision 1800)
@@ -330,5 +330,17 @@
 
     //
-    // Add the histograms to the paramater list.
+    // Set for each MHMcRate object the trigger condition number in the 
+    // camera file (for the case of camera files with several conditions,
+    // produced with the trigger_loop option.
+    //
+
+    if (dim < 0)
+      ((MHMcRate*)(hists[0]))->SetTriggerCondNum((Short_t)(-dim));
+    else if (dim > 0)
+      for (Short_t i = from ; i <= to; i++)
+	((MHMcRate*)(hists[i-1]))->SetTriggerCondNum(i);
+
+    //
+    // Add the histograms to the parameter list.
     //
     plist.AddToList(&hists);
@@ -353,5 +365,5 @@
 
     // We calculate only shower rate (not including NSB-only triggers)
-    Float_t* BgR = new Float_t[dim];
+    Float_t* BgR = new Float_t[num];
     memset(BgR, 0, num*sizeof(Float_t));
 
