Index: trunk/MagicSoft/Mars/macros/readIPR.C
===================================================================
--- trunk/MagicSoft/Mars/macros/readIPR.C	(revision 8337)
+++ trunk/MagicSoft/Mars/macros/readIPR.C	(revision 8384)
@@ -51,15 +51,12 @@
     tlist.AddToList(&read);
 
-    // Create the container for the IPRs
-    MTriggerIPR ipr;
-    plist.AddToList(&ipr);
+    MHCamEvent evt0(0, "IPR", "Individual Pixel Rate;;IPR [Hz]");
+    //    evt0b.SetThreshold(0);
 
-    // Create the histo to display the IPRs
-    MHCamEvent IPRhist("IPRhist","IPRs");
-    plist.AddToList(&IPRhist);
-        
-    // create a task to fill a histogram from the container
-    MFillH fillIPR(&IPRhist, "MTriggerIPR");
-    tlist.AddToList(&fillIPR);
+    MFillH fill0(&evt0, "MTriggerIPR", "FillIPR");
+
+    tlist.AddToList(&fill0);
+
+    MStatusDisplay *d = new MStatusDisplay;
 
     //
@@ -68,80 +65,10 @@
     MEvtLoop evtloop;
     evtloop.SetParList(&plist);
+    evtloop.SetDisplay(d);
 
-    //
-    // Execute the analysis
-    //
-    if (!evtloop.PreProcess())
-      return;
-    
     if (!evtloop.Eventloop())
       return;
 
     tlist.PrintStatistics();
-
-    //-----------------------------------
-    // Now display the result of the loop
-    //
-
-    // create a MHCamera histo where the sum off all events is filled
-    MHCamera &h = *(MHCamera*)IPRhist.GetHistByName("sum");
-
-    TCanvas *c = MH::MakeDefCanvas();
-    c->Divide(2, 2);
-
-    MHCamera *disp1=h.Clone();
-    MHCamera *disp2=h.Clone();
-    //MHCamera *disp3=h.Clone();
-    disp2->SetCamContent(h, 1);
-    //disp3->SetCamContent(h, 2);
-
-    disp1->SetYTitle("Rate [Hz]");
-    disp2->SetYTitle("\\sigma_{Rate} [Hz]");
-    //disp3->SetYTitle("\\sigma_{Rate} [%]");
-    disp1->SetName("IPRs;avg");
-    disp2->SetName("IPRs;err");
-    //disp3->SetName("IPRs;rel");
-    disp1->SetTitle("IPRs Average");
-    disp2->SetTitle("IPRs error");
-    //disp3->SetTitle("IPRs relative error");
-
-    c->cd(1);
-    TText text(0.1, 0.95, &fname[fname.Last('/')+1]);
-    text.SetTextSize(0.03);
-    text.DrawClone();
-    gPad->SetBorderMode(0);
-    gPad->Divide(1,1);
-    gPad->cd(1);
-    gPad->SetLogy();
-    disp1->Draw();
-    disp1->SetBit(kCanDelete);
-    c->cd(2);
-    gPad->SetBorderMode(0);
-    gPad->Divide(1,1);
-    gPad->cd(1);
-    gPad->SetLogy();
-    disp2->Draw();
-    disp2->SetBit(kCanDelete);
-    //c->cd(3);
-    //gPad->SetBorderMode(0);
-    //gPad->Divide(1,1);
-    //gPad->cd(1);
-    //gPad->SetLogy();
-    //disp3->Draw();
-    //disp3->SetBit(kCanDelete);
-    c->cd(3);
-    gPad->SetBorderMode(0);
-    disp1->Draw("EPhist");
-    c->cd(4);
-    gPad->SetBorderMode(0);
-    gPad->SetLogy();
-    disp2->Draw("Phist");
-    //c->cd(6);
-    //gPad->SetBorderMode(0);
-    //gPad->SetLogy();
-    //disp3->Draw("Phist");
-
-    c->SaveAs(fname(0, fname.Last('.')+1) + "ps");
-    //c->SaveAs(fname(0, fname.Last('.')+1) + "root");
 }
 
