Index: trunk/MagicSoft/Mars/macros/calibration.C
===================================================================
--- trunk/MagicSoft/Mars/macros/calibration.C	(revision 2952)
+++ trunk/MagicSoft/Mars/macros/calibration.C	(revision 2974)
@@ -23,6 +23,6 @@
 \* ======================================================================== */
 
-const TString pedfile = "/mnt/Data/rootdata/Mrk421/2004_01_26/20040125_12094_P_Mrk421_E.root";
-const TString calfile = "/mnt/Data/rootdata/Mrk421/2004_01_26/20040125_1211*_C_Mrk421_E.root";
+const TString pedfile = "/mnt/Data/rootdata/CrabNebula/2004_01_27/20040126_12149_P_Cab-On_E.root";
+const TString calfile = "/mnt/Data/rootdata/CrabNebula/2004_01_27/20040126_1252*_C_Cab-On_E.root";
 
 //const TString pedfile = "/mnt/Data/rootdata/Miscellaneous/2003_12_19/20031218_03522_P_Park_E.root";
@@ -52,4 +52,5 @@
     MGeomApply     geomapl;
     MExtractSignal sigcalc;
+    sigcalc.SetRange(1,14,1,14);
     MPedCalcPedRun pedcalc;
     pedcalc.SetUseHists();
@@ -79,5 +80,5 @@
     tlist.PrintStatistics();
 
-    pedcam[559].DrawClone();
+    pedcam[17].DrawClone();
 
     MStatusDisplay *d1 = new MStatusDisplay;
@@ -85,13 +86,17 @@
     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");
+    MHCamera dispped0   (geomcam, "MPedestalPix;Pedestal", "Mean per Slice");
+    MHCamera dispped1   (geomcam, "MPedestalPix;PedestalErr", "Mean Error per Slice");
+    MHCamera dispped2   (geomcam, "MPedestalPix;PedestalRms", "RMS per Slice");
+    MHCamera dispped3   (geomcam, "MPedestalPix;PedestalRmsErr", "RMS Error per Slice");
+    MHCamera dispped4   (geomcam, "MPedestalPix;Mean", "Fitted Mean per Slice");
+    MHCamera dispped5   (geomcam, "MPedestalPix;MeanErr", "Fitted Error of Mean per Slice");
+    MHCamera dispped6   (geomcam, "MPedestalPix;Sigma", "Fitted Sigma per Slice");
+    MHCamera dispped7   (geomcam, "MPedestalPix;SigmaErr", "Fitted Error of Sigma per Slice");
+    MHCamera dispped8   (geomcam, "MPedestalPix;Prob", "Probability of Fit");
+    MHCamera dispped9   (geomcam, "MPedestalPix;DeltaPedestalMean", "Pedestal minus Fitted Mean per Slice");
+    MHCamera dispped10  (geomcam, "MPedestalPix;DeltaPedestalMeanError", "Pedestal minus Fitted Mean (Error)");
+    MHCamera dispped11  (geomcam, "MPedestalPix;DeltaRmsSigma", "Pedestal RMS minus Fitted Sigma per Slice");
+    MHCamera dispped12  (geomcam, "MPedestalPix;DeltaRmsSigmaError", "Pedestal RMS minus Fitted Sigma (Error)");
 
     dispped0.SetCamContent(pedcam, 0);
@@ -101,44 +106,53 @@
     dispped2.SetCamError(pedcam,3);
     dispped3.SetCamContent(pedcam, 3);
-    dispped3.SetCamError(pedcam, 4);
     dispped4.SetCamContent(pedcam, 4);
+    dispped4.SetCamError(pedcam, 5);
     dispped5.SetCamContent(pedcam, 5);
     dispped6.SetCamContent(pedcam, 6);
+    dispped6.SetCamError(pedcam, 7);
     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]");
+    dispped9.SetCamContent(pedcam, 9);
+    dispped9.SetCamError(pedcam, 10);
+    dispped10.SetCamContent(pedcam, 10);
+    dispped11.SetCamContent(pedcam, 11);
+    dispped11.SetCamError(pedcam, 12);
+    dispped12.SetCamContent(pedcam, 12);
+
+    dispped0.SetYTitle("Pedestal per slice [FADC counts]");
+    dispped1.SetYTitle("Pedestal Error per slice [FADC counts]");
+    dispped2.SetYTitle("Pedestal RMS per slice [FADC counts]");
+    dispped3.SetYTitle("Pedestal RMS Error per slice [FADC counts]");
+    dispped4.SetYTitle("Mean Pedestal per slice [FADC counts]");
+    dispped5.SetYTitle("Error of Mean Pedestal per slice [FADC counts]");
+    dispped6.SetYTitle("Sigma Pedestal per slice [FADC counts]");
+    dispped7.SetYTitle("Error of Sigma Pedestal per slice [FADC counts]");
+    dispped8.SetYTitle("Fit Probability [1]");
+    dispped9.SetYTitle("Pedestal-Mean per slice [FADC counts]");
+    dispped10.SetYTitle("Pedestal-Mean Error per slice [FADC counts]");
+    dispped11.SetYTitle("RMS-Sigma per slice [FADC counts]");
+    dispped12.SetYTitle("RMS-Sigma Error per slice [FADC counts]");
 
     gStyle->SetOptStat(1111);
     gStyle->SetOptFit();
     
-    // Charges
+    // Histogram values
     TCanvas &b1 = d1->AddTab("Pedestals"); 
-    b1.Divide(2,3);
-
-    CamDraw(b1,dispped0,pedcam,1,2,1);
-    CamDraw(b1,dispped1,pedcam,2,2,1);
-
-    // Means 
+    b1.Divide(4,3);
+
+    CamDraw(b1,dispped0,pedcam,1,4,0);
+    CamDraw(b1,dispped1,pedcam,2,4,1);
+    CamDraw(b1,dispped2,pedcam,3,4,1);
+    CamDraw(b1,dispped3,pedcam,4,4,1);
+
+    // Fitted values 
     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);
+    b2.Divide(4,3);
+
+    CamDraw(b2,dispped4,pedcam,1,4,0);
+    CamDraw(b2,dispped5,pedcam,2,4,1);
+    CamDraw(b2,dispped6,pedcam,3,4,0);
+    CamDraw(b2,dispped7,pedcam,4,4,1);
+
 
     // Fits Probability
@@ -146,12 +160,14 @@
     b3.Divide(1,3);
 
-    CamDraw(b3,dispped6,pedcam,1,1,3);
+    CamDraw(b3,dispped8,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);
+    c4.Divide(4,3);
+
+    CamDraw(c4,dispped9,pedcam,1,4,1);
+    CamDraw(c4,dispped10,pedcam,2,4,1);
+    CamDraw(c4,dispped11,pedcam,3,4,1);
+    CamDraw(c4,dispped12,pedcam,4,4,1);
 
     //
@@ -205,5 +221,5 @@
     // (This is a preliminary feature)
     //
-    //    calcalc.ExcludePixelsFromAsciiFile("badpixels_all.dat");
+    //calcalc.ExcludePixelsFromAsciiFile("badpixels_all.dat");
     
     //
