Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 1789)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 1790)
@@ -3,11 +3,14 @@
  2003/02/24: Abelardo Moralejo
 
-    * mmontecarlo/MMcTriggerRateCalc.cc
+    * mmontecarlo/MMcTriggerRateCalc.[h,cc]
       - Fixed mistake when analysing camera files containing all events 
         (including non-triggers): fShowers was always zero.
       - Added reading of MMcTrigHeaders in ReInit
+      - Added procedure Draw for graphics output: rate versus discriminator 
+        threshold (useful for camera files with several trigger conditions).
 
     * macros/trigrate.C
       - Added some explanations. Style improvements in function GetNSBEvents.
+        Added call to MMcTriggerRateCalc::Draw
 
     * mhist/MHMcRate.[h,cc]
Index: /trunk/MagicSoft/Mars/macros/trigrate.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/trigrate.C	(revision 1789)
+++ /trunk/MagicSoft/Mars/macros/trigrate.C	(revision 1790)
@@ -34,4 +34,6 @@
 !
 \* ======================================================================== */
+
+
 
 Float_t GetNSBEvents(TString name, Float_t *BgR, int dim)
@@ -180,3 +182,10 @@
 
     hists.Print();
+
+    gStyle->SetOptStat(0);
+    rate->Draw();
 }
+
+
+
+
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1789)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc	(revision 1790)
@@ -41,4 +41,7 @@
 #include "MMcTrigHeader.hxx"
 #include "MMcCorsikaRunHeader.h"
+
+#include "MH.h"
+#include <TCanvas.h>
 
 ClassImp(MMcTriggerRateCalc);
@@ -350,2 +353,56 @@
     return kTRUE;
 }
+
+
+// Draw rate as a funtion of discriminator threshold.
+
+void MMcTriggerRateCalc::Draw()
+{
+  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);
+
+  fHist[1] = new TH1F("Rate2","Trigger rate, mult. 2", nbins, xmin, xmax);
+  fHist[2] = new TH1F("Rate3","Trigger rate, mult. 3", nbins, xmin, xmax);
+  fHist[3] = new TH1F("Rate4","Trigger rate, mult. 4", nbins, xmin, xmax);
+  fHist[4] = new TH1F("Rate5","Trigger rate, mult. 5", nbins, xmin, xmax);
+
+  for (UInt_t i=0; i<fNum; i++)
+    {
+      Short_t mult = GetRate(i)->GetMultiplicity();
+
+      fHist[mult-1]->SetBinContent(fHist[mult-1]->FindBin(GetRate(i)->GetMeanThreshold()), GetRate(i)->GetTriggerRate());
+
+      fHist[mult-1]->SetBinError(fHist[mult-1]->FindBin(GetRate(i)->GetMeanThreshold()), GetRate(i)->GetTriggerRateError());
+    }
+
+  for (Int_t i = 1; i <=4; i++)
+    {
+      fHist[i]->SetLineWidth(2);
+      fHist[i]->SetMarkerStyle(20);
+      fHist[i]->SetMarkerSize(.5);
+      fHist[i]->SetMaximum(1.2*GetRate(0)->GetTriggerRate());
+      fHist[i]->SetMinimum(0.5*GetRate(fNum-1)->GetTriggerRate());
+    }
+
+  fHist[2]->SetLineColor(1);
+  fHist[2]->SetMarkerColor(1);
+  fHist[2]->Draw();
+
+  fHist[3]->SetLineColor(3);
+  fHist[3]->SetMarkerColor(3);
+  fHist[3]->Draw("same");
+
+  fHist[4]->SetLineColor(4);
+  fHist[4]->Draw("same");
+  fHist[4]->SetMarkerColor(4);
+
+  c->SetLogy();
+  c->SetGridy();
+  c->SetGridx();
+
+  return;
+}
+
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 1789)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.h	(revision 1790)
@@ -8,4 +8,6 @@
 #include "MTask.h"
 #endif
+
+#include <TGraphErrors.h>
 
 class MParList;
@@ -46,4 +48,6 @@
     MMcTrig  *GetTrig(UInt_t i) const { return (MMcTrig*)((*fMcTrig)[i]); }
 
+    TH1F*     fHist[5];
+
 public:
     MMcTriggerRateCalc(int dim=0, float *trigbg=NULL, float simbg=100000,
@@ -61,4 +65,6 @@
     Bool_t PostProcess();
 
+    void Draw();
+
     ClassDef(MMcTriggerRateCalc, 0)	// Task to compute the trigger rate
 };
