Index: trunk/MagicSoft/Mars/macros/getThreshold.C
===================================================================
--- trunk/MagicSoft/Mars/macros/getThreshold.C	(revision 854)
+++ trunk/MagicSoft/Mars/macros/getThreshold.C	(revision 855)
@@ -1,74 +1,53 @@
-void getThreshold( char* filename = "/hdb1/users/jlopez/temp_loop.root")
+void getThreshold( char* filename = "data/oscar_protons.root")
 {
+    //
     // This macro fill the container MMcEnerThre using the task
     // MMcEnerThreCalc and shows the results.
+    //
+    MParList  parlist;
 
-    MParList parlist;
     MTaskList tasklist;
+    parlist.AddToList(&tasklist);
 
+    //
     // Setup the parameter list
     // - You need create the container MMcEnerThre.
     //    + You need to put the number of trigger conditions when
-    //      you declarete the MMcEnerThre
-    //    + If you don't put any dimension to MMcEnerThre it works
+    //      you declarete the MHMcEnergies
+    //    + If you don't put any dimension to MHMcEnergies it works
     //      taking only the trigger information from MMcTrig
-    // - You can control the number of bins in the energy distribution
-    //   histogram used to compute the energy threshold using
-    //   the SetBins() function.
+    //
+    const UInt_t numtriggerconditions = 1;
 
-    Int_t numtrigcond = 5;
-    MHMcEnergies *hists = new MHMcEnergies(numtrigcond);
-
-    parlist.AddToList(&tasklist);
+    MHMcEnergies *hists = new MHMcEnergies(numtriggerconditions);
     hists->AddEntriesToList(&parlist);
 
+    //
     // Setup the task list
-    // - You need the read and the MMcEnerThreCalc tasks
+    // - You need the read and the MMcThresholdCalc tasks
+    // - You have to fill the histograms for the Energy threshold
     //    + You need to put the number of trigger conditions when
-    //      you declarete the MMcEnerThreCalc
-    //    + If you don't put any dimension to MMcEnerThreCalc it works
-    //      like one dimension MMcEnerThreCalc
-
-    MReadTree read("Events", filename);
-
-    MMcThresholdCalc tcalc(numtrigcond);
+    //      you declarete the MMcThresholdCalc
+    //    + If you don't put any dimension to MMcThresholdCalc it works
+    //      like one dimension MMcThresholdCalc
+    //
+    MReadTree        read("Events", filename);
+    MMcThresholdCalc calc(numtriggerconditions);
 
     tasklist.AddToList(&read);
-    tasklist.AddToList(&tcalc);
+    tasklist.AddToList(&calc);
 
     MEvtLoop evtloop;
     evtloop.SetParList(&parlist);
 
+    //
     // Begin the loop
-
+    //
     evtloop.Eventloop();
 
+    //
     // Now you can display the results
-
-    TCanvas *c;
-
-    c=new TCanvas("c0","Energy distribution for triggered events", 50, 50, 850, 550);
-    hists[0].Print();
-    hists[0].Draw();
-    c->Update();
-
-    c= new TCanvas("c1","Energy distribution for triggered events", 50, 50, 850, 550);
-    hists[1].Print();
-    hists[1].Draw();
-    c->Update();
-
-    c= new TCanvas("c2","Energy distribution for triggered events", 50, 50, 850, 550);
-    hists[2].Print();
-    hists[2].Draw();
-    c->Update();
-
-    c= new TCanvas("c3","Energy distribution for triggered events", 50, 50, 850, 550);
-    hists[3].Print();
-    hists[3].Draw();
-    c->Update();
-
-    c= new TCanvas("c4","Energy distribution for triggered events", 50, 50, 850, 550);
-    hists[4].Print();
-    hists[4].Draw();
-    c->Update();
+    //
+    for (UInt_t i=0; i<numtriggerconditions; i++)
+        ((*hists)[i]).Draw();
 }
Index: trunk/MagicSoft/Mars/macros/readMagic.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readMagic.C	(revision 854)
+++ trunk/MagicSoft/Mars/macros/readMagic.C	(revision 855)
@@ -31,10 +31,9 @@
     MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
 
-    Int_t icount = 0 ;
     MCamDisplay display(&geomcam) ;
 
     while (read.Process())
     {
-        cout << "Event: " << icount++  << endl  ;
+        cout << "Event #" << read.GetEventNum() ":" << endl;
 
         ncalc.Process();
