Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 1378)
+++ trunk/MagicSoft/Mars/Changelog	(revision 1379)
@@ -1,3 +1,8 @@
                                                                   -*-*- END -*-*-
+ 2002/07/04: Abelardo Moralejo
+
+   * macros/trigrate.C:
+     - Introduced some style improvements suggested by T. Bretz.
+
  2002/07/04: Abelardo Moralejo
 
Index: trunk/MagicSoft/Mars/macros/trigrate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/trigrate.C	(revision 1378)
+++ trunk/MagicSoft/Mars/macros/trigrate.C	(revision 1379)
@@ -29,5 +29,4 @@
 !
 \* ======================================================================== */
-
 
 void trigrate(int dim=0, char *filename = "data/camera.root", 
@@ -101,8 +100,8 @@
     // Now we have to build the BgR array, containing the number 
     // of triggers (may be more than 1 trigger/event!) from the
-    // total_nsb_events simulated in the nsbfile (3rd input parameter).
+    // numnsbevents simulated in the nsbfile (3rd input parameter).
     // If no nsbfile is supplied, we assume no triggers from NSB
 
-    Float_t total_nsb_events = 5.e4; // some default value.
+    Float_t numnsbevents = 5.e4; // some default value.
 
     Float_t* BgR = new float[num];
@@ -110,42 +109,28 @@
       BgR[i] = 0.;
 
-    //    Float_t* BgR = new float[36];
-    //    for(Int_t i = 0; i < 36; i++)
-    //      BgR[i] = 0.;
-
     if (nsbfile)
       {
-	nsb_events = new TChain("Events");
-	nsb_events->Add(nsbfile);
+	TChain nsb_events("Events");
+	nsb_events.Add(nsbfile);
 
-	//	nsb_events = new TFile(nsbfile);
-	//	nsb_events->cd();
+       	TH1F h("h","",5,.5,5.5);
 
-	h = new TH1F("h","",5,.5,5.5);
-
-	Char_t plot[256];
 	for (Int_t i = from; i <= to; i++)
 	  {
-	    // For each trigger condition (i)...
-	    // histogram Number of L1 triggers:
-	    sprintf(plot, "MMcTrig;%d.fNumFirstLevel>>h", i);
-	    nsb_events->Draw(plot,"", "goff");
+	    TString plot = "MMcTrig;"; 
+	    plot+=i; 
+	    plot+=".fNumFirstLevel>>h";
+
+	    nsb_events.Draw(plot,"", "goff");
 	    // Get total number of L1 triggers from histogram:
-	    if (dim > 0)
-	      BgR[i-1] = h->Integral()*h->GetMean();
-	    else
-	      BgR[0] = h->Integral()*h->GetMean();
+	    BgR[dim>0? i-1: 0] = h.Integral()*h.GetMean();
 
-	    total_nsb_events = (Float_t) h->GetEntries();
+	    numnsbevents = (Float_t) h.GetEntries();
 	  }
-	h->Delete();
-	nsb_events->Delete();
-	//	nsb_headers = new TChain("RunHeaders");
-	//	nsb_headers->Add(nsbfile);
       }
 
     cout << "Number of Trigger conditions: " << num << endl;
 
-    MMcTriggerRateCalc rate(dim, kPROTON, BgR, total_nsb_events);
+    MMcTriggerRateCalc rate(dim, kPROTON, BgR, numnsbevents);
     tasklist.AddToList(&rate);
 
