Index: trunk/MagicSoft/Mars/macros/calibration.C
===================================================================
--- trunk/MagicSoft/Mars/macros/calibration.C	(revision 2926)
+++ trunk/MagicSoft/Mars/macros/calibration.C	(revision 2952)
@@ -51,27 +51,24 @@
 
     MGeomApply     geomapl;
+    MExtractSignal sigcalc;
     MPedCalcPedRun pedcalc;
+    pedcalc.SetUseHists();
+
+    tlist.AddToList(&read);
+    tlist.AddToList(&geomapl);
+    tlist.AddToList(&sigcalc);
+    tlist.AddToList(&pedcalc);
+
     MGeomCamMagic  geomcam;
     MPedestalCam   pedcam;
-
-    tlist.AddToList(&read);
-    tlist.AddToList(&geomapl);
-    tlist.AddToList(&pedcalc);
-
+    plist.AddToList(&geomcam);
     plist.AddToList(&pedcam);
 
-    MHCamEvent hist("Pedestal");
-    hist.SetType(1);
-    plist.AddToList(&hist);
-    MFillH fill(&hist, "MPedestalCam");
-
-    tlist.AddToList(&fill);
-
     //
     // Create and setup the eventloop
-    //
+     //
     MEvtLoop evtloop;
     evtloop.SetParList(&plist);
-
+ 
     //
     // Execute first analysis
@@ -81,4 +78,80 @@
 
     tlist.PrintStatistics();
+
+    pedcam[559].DrawClone();
+
+    MStatusDisplay *d1 = new MStatusDisplay;
+    d1->SetUpdateTime(3000);
+    d1->Resize(850,700);
+
+    MHCamera dispped0   (geomcam, "MPedestalPix;Pedestal", "Mean");
+    MHCamera dispped1   (geomcam, "MPedestalPix;PedestalRms", "RMS");
+    MHCamera dispped2   (geomcam, "MPedestalPix;Mean", "Fitted Mean");
+    MHCamera dispped3   (geomcam, "MPedestalPix;MeanErr", "Fitted Error of Mean");
+    MHCamera dispped4   (geomcam, "MPedestalPix;Sigma", "Fitted Sigma");
+    MHCamera dispped5   (geomcam, "MPedestalPix;SigmaErr", "Fitted Error of Sigma");
+    MHCamera dispped6   (geomcam, "MPedestalPix;Prob", "Probability of Fit");
+    MHCamera dispped7   (geomcam, "MPedestalPix;DeltaPedestalMean", "Pedestal minus Fitted Mean");
+    MHCamera dispped8   (geomcam, "MPedestalPix;DeltaRmsSigma", "Pedestal RMS minus Fitted Sigma");
+
+    dispped0.SetCamContent(pedcam, 0);
+    dispped0.SetCamError(pedcam, 1);
+    dispped1.SetCamContent(pedcam, 1);
+    dispped2.SetCamContent(pedcam, 2);
+    dispped2.SetCamError(pedcam,3);
+    dispped3.SetCamContent(pedcam, 3);
+    dispped3.SetCamError(pedcam, 4);
+    dispped4.SetCamContent(pedcam, 4);
+    dispped5.SetCamContent(pedcam, 5);
+    dispped6.SetCamContent(pedcam, 6);
+    dispped7.SetCamContent(pedcam, 7);
+    dispped8.SetCamContent(pedcam, 8);
+
+    dispped0.SetYTitle("Pedestal [FADC counts]");
+    dispped1.SetYTitle("Pedestal RMS [FADC counts]");
+    dispped2.SetYTitle("Mean Pedestal [FADC counts]");
+    dispped3.SetYTitle("Error of Mean Pedestal [FADC counts]");
+    dispped4.SetYTitle("Sigma Pedestal [FADC counts]");
+    dispped5.SetYTitle("Error of Sigma Pedestal [FADC counts]");
+    dispped6.SetYTitle("Fit Probability [1]");
+    dispped7.SetYTitle("Pedestal - Mean [FADC counts]");
+    dispped8.SetYTitle("RMS - Sigma [FADC counts]");
+
+    gStyle->SetOptStat(1111);
+    gStyle->SetOptFit();
+    
+    // Charges
+    TCanvas &b1 = d1->AddTab("Pedestals"); 
+    b1.Divide(2,3);
+
+    CamDraw(b1,dispped0,pedcam,1,2,1);
+    CamDraw(b1,dispped1,pedcam,2,2,1);
+
+    // Means 
+    TCanvas &b2 = d1->AddTab("Means"); 
+    b2.Divide(2,3);
+
+    CamDraw(b2,dispped2,pedcam,1,2,1);
+    CamDraw(b2,dispped3,pedcam,2,2,1);
+
+    // Sigmas 
+    TCanvas &b12 = d1->AddTab("Sigmas"); 
+    b12.Divide(2,3);
+
+    CamDraw(b12,dispped4,pedcam,1,2,1);
+    CamDraw(b12,dispped5,pedcam,2,2,1);
+
+    // Fits Probability
+    TCanvas &b3 = d1->AddTab("Fit Probabilities");
+    b3.Divide(1,3);
+
+    CamDraw(b3,dispped6,pedcam,1,1,3);
+
+    // Differences
+    TCanvas &c4 = d1->AddTab("Differences");
+    c4.Divide(2,3);
+
+    CamDraw(c4,dispped7,pedcam,1,2,1);
+    CamDraw(c4,dispped8,pedcam,2,2,1);
 
     //
@@ -94,4 +167,5 @@
     // Get the previously created MPedestalCam into the new Parameter List 
     //
+    plist2.AddToList(&geomcam);
     plist2.AddToList(&pedcam);
     plist2.AddToList(&sigcam);
@@ -102,5 +176,4 @@
     //
     tlist2.AddToList(&geomapl);
-    plist2.AddToList(&geomcam);
 
     //
@@ -112,5 +185,5 @@
     read2.DisableAutoScheme();
 
-    MExtractSignal       sigcalc;
+    //    MExtractSignal       sigcalc;
     MArrivalTimeCalc     timecalc;
     MCalibrationCalc     calcalc;
@@ -132,5 +205,5 @@
     // (This is a preliminary feature)
     //
-    // calcalc.ExcludePixelsFromAsciiFile("badpixels_all.dat");
+    //    calcalc.ExcludePixelsFromAsciiFile("badpixels_all.dat");
     
     //
