Index: trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1823)
+++ trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1880)
@@ -16,8 +16,8 @@
 !
 !
-!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
+!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
 !   Author(s): Harald Kornmayer 1/2001
 !
-!   Copyright: MAGIC Software Development, 2000-2001
+!   Copyright: MAGIC Software Development, 2000-2003
 !
 !   Modified 4/7/2002 Abelardo Moralejo: now the dimension of fTrigger is
@@ -27,5 +27,4 @@
 !
 \* ======================================================================== */
-
 #include "MMcTriggerRateCalc.h"
 
@@ -105,22 +104,24 @@
     if (fMcRunHeader->GetAllEvtsTriggered())
       {
-	*fLog << endl << all << endl <<
-	  "WARNING: the input data file contains only the" << endl << 
-	  "events that triggered. I will assume the standard value" << endl <<
-	  "for maximum impact parameter (400 m)" <<endl;
-
-
-	if (fTrigNSB[0] > 0)
-	  *fLog << endl << all <<
-	    "WARNING: NSB rate can be overestimated by up to 5%." << endl <<
-	    "For a precise estimate of the total rate including NSB" << endl << 
-	    "accidental triggers I need a file containing all event headers." 
-		<< endl;
-	else 
-	  *fLog << endl << all <<
-	    "WARNING: calculating only shower rate (no NSB accidental triggers)" << endl;
+          *fLog << warn;
+          *fLog << "WARNING - the input data file contains only the" << endl;
+          *fLog << "events that triggered. I will assume the standard value" << endl;
+          *fLog << "for maximum impact parameter (400 m)" <<endl;
+
+
+          if (fTrigNSB[0] > 0)
+          {
+              *fLog << warn;
+              *fLog << "WARNING - NSB rate can be overestimated by up to 5%." << endl;
+              *fLog << "For a precise estimate of the total rate including NSB" << endl;
+              *fLog << "accidental triggers I need a file containing all event headers." << endl;
+          }
+          else
+          {
+            *fLog << warn << "WARNING - calculating only shower rate (no NSB accidental triggers)" << endl;
+          }
       }
 
-    *fLog << endl << all <<
+    *fLog << endl << warn <<
       "WARNING: I will assume the standard maximum off axis angle" << endl <<
       "(5 degrees) for the original showers" << endl;
@@ -168,5 +169,4 @@
 //      rate:    rate of incident showers
 //
-
 MMcTriggerRateCalc::MMcTriggerRateCalc(float rate, int dim,
                                        float *trigbg, float simbg,
@@ -325,9 +325,9 @@
 	  if (fMcCorRunHeader->GetSlopeSpec() != -2.75)
 	    {
-	      *fLog << err << dbginf <<
-		"Spectrum slope as read from  input file ("<< 
-		fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected one (-2.75) for protons" << endl << "... aborting." << endl;
-	      return kFALSE;
-	    }
+                *fLog << err << dbginf << "Spectrum slope as read from input file (";
+                *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected ";
+                *fLog << "one (-2.75) for protons" << endl << "... aborting." << endl;
+                return kFALSE;
+            }
 	  rate.SetFlux(0.1091, 2.75);
 	  break;
@@ -335,8 +335,8 @@
 	  if (fMcCorRunHeader->GetSlopeSpec() != -2.62)
 	    {
-	      *fLog << err << dbginf <<
-		"Spectrum slope as read from  input file ("<< 
-		fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected one (-2.75) for Helium" << endl << "... aborting." << endl;
-	      return kFALSE;
+                *fLog << err << dbginf << "Spectrum slope as read from input file (";
+                *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected ";
+                *fLog << "one (-2.75) for Helium" << endl << "... aborting." << endl;
+                return kFALSE;
 	    }
 	  rate.SetFlux(0.0660, 2.62);
@@ -363,9 +363,15 @@
 void MMcTriggerRateCalc::Draw()
 {
+    /*
+     Commented out, because this is creating a memory leak!
+     The histograms are neither deleted anywhere, nor it is made
+     sure, that the histograms are not overwritten.
+     Also the comment for the function doesn't match the rules.
+
   TCanvas *c = MH::MakeDefCanvas("Rate");
 
   Float_t xmin = GetRate(0)->GetMeanThreshold()-0.55;
   Float_t xmax = GetRate(fNum-1)->GetMeanThreshold()+0.55;
-  Int_t  nbins = 10*(xmax-xmin);
+  Int_t  nbins = (Int_t)((xmax-xmin)*10);
 
   fHist[1] = new TH1F("Rate2","Trigger rate, mult. 2", nbins, xmin, xmax);
@@ -412,6 +418,5 @@
   fHist[4]->Draw("same");
   fHist[4]->SetMarkerColor(4);
-
-  return;
-}
-
+     */
+}
+
