Index: trunk/MagicSoft/Mars/macros/calibration.C
===================================================================
--- trunk/MagicSoft/Mars/macros/calibration.C	(revision 3274)
+++ trunk/MagicSoft/Mars/macros/calibration.C	(revision 3293)
@@ -23,6 +23,8 @@
 \* ======================================================================== */
 
-//const TString pedfile = "../20040215_16770_P_OffCrab4_E.root";
-//const TString calfile = "../20040215_16771_C_OffCrab4_E.root";
+//const TString pedfile = "/remote/home/pc2/operator/Crab20040214/20040215_16743_P_CrabOn_E.root";
+//const TString calfile = "/remote/home/pc2/operator/Crab20040214/20040215_16744_C_CrabOn_E.root";
+const TString pedfile = "../20040215_16770_P_OffCrab4_E.root";
+const TString calfile = "../20040215_16771_C_OffCrab4_E.root";
 
 //const TString pedfile = "/mnt/users/mdoro/Mars/Data/20040201_14418_P_OffMrk421-1_E.root";
@@ -39,5 +41,5 @@
 
 void calibration(TString pedname=pedfile,
-             TString calname=calfile)
+                 TString calname=calfile)
 {
 
@@ -220,11 +222,20 @@
     plist2.AddToList(&tlist2);
 
-    MExtractedSignalCam     sigcam;
-    MCalibrationChargeCam   calcam;
-    MHCalibrationRelTimeCam timecam;
-    MHCalibrationChargeCam  chargecam;
-    MHCalibrationChargePINDiode chargepin;
-
-   //
+    MExtractedSignalCam        sigcam;
+    MCalibrationChargeCam      calcam;
+    MCalibrationChargePINDiode pindiode;   
+    MCalibrationChargeBlindPix blindpix;   
+    
+    MHCalibrationRelTimeCam     histtime;
+    MHCalibrationChargeCam      histcharge;
+    MHCalibrationChargePINDiode histpin;
+    MHCalibrationChargeBlindPix histblind;
+    //
+    // As long, as we don't have digital modules,
+    // we have to set the color of the pulser LED by hand
+    //
+    calcam.SetColor(MCalibrationChargeCam::kECT1);
+    pindiode.SetColor(MCalibrationChargePINDiode::kECT1);
+    //
     // Get the previously created MPedestalCam into the new Parameter List 
     //
@@ -233,7 +244,8 @@
     plist2.AddToList(&sigcam);
     plist2.AddToList(&calcam);
-    plist2.AddToList(&timecam);
-    plist2.AddToList(&chargecam);
-    plist2.AddToList(&chargepin);
+    plist2.AddToList(&histtime);
+    plist2.AddToList(&histcharge);
+    plist2.AddToList(&histpin);
+    plist2.AddToList(&histblind);
     //
     // Get the MAGIC geometry
@@ -258,7 +270,8 @@
     MCalibrationChargeCalc calcalc;
 
-    MFillH filltime("MHCalibrationRelTimeCam", "MArrivalTime");
-    MFillH fillpin("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode");
-    MFillH fillcam("MHCalibrationChargeCam"     , "MExtractedSignalCam");
+    MFillH filltime ("MHCalibrationRelTimeCam"    , "MArrivalTime");
+    MFillH fillpin  ("MHCalibrationChargePINDiode", "MExtractedSignalPINDiode");
+    MFillH fillblind("MHCalibrationChargeBlindPix", "MExtractedSignalBlindPixel");
+    MFillH fillcam  ("MHCalibrationChargeCam"     , "MExtractedSignalCam");
 
     //
@@ -321,4 +334,5 @@
     tlist2.AddToList(&filltime);
     tlist2.AddToList(&fillpin);
+    tlist2.AddToList(&fillblind);
     tlist2.AddToList(&fillcam);
     //
@@ -347,5 +361,6 @@
     // just one example how to get the plots of individual pixels
     //
-    chargecam[5].DrawClone("fourierevents");
+//    histblind.DrawClone("all");
+//    histcharge[5].DrawClone("time");
 
     // Create histograms to display
@@ -355,23 +370,23 @@
     MHCamera disp4  (geomcam, "Cal;RSigma",         "Reduced Sigmas");
     MHCamera disp5  (geomcam, "Cal;RSigma/Charge",  "Reduced Sigma per Charge");
-    MHCamera disp6  (geomcam, "Cal;FFactorPh",      "Nr. of Photons (F-Factor Method)");
-    MHCamera disp7  (geomcam, "Cal;FFactorConv",    "Conversion Factor (F-Factor Method)");
+    MHCamera disp6  (geomcam, "Cal;FFactorPh",      "Nr. of Photo-electrons (F-Factor Method)");
+    MHCamera disp7  (geomcam, "Cal;FFactorConv",    "Conversion Factor to photons (F-Factor Method)");
     MHCamera disp8  (geomcam, "Cal;FFactorFFactor", "Total F-Factor (F-Factor Method)");
     MHCamera disp9  (geomcam, "Cal;BlindPixPh",     "Photon flux inside plexiglass (Blind Pixel Method)");
-    MHCamera disp10 (geomcam, "Cal;BlindPixConv",   "Conversion Factor (Blind Pixel Method)");
+    MHCamera disp10 (geomcam, "Cal;BlindPixConv",   "Conversion Factor to photons (Blind Pixel Method)");
     MHCamera disp11 (geomcam, "Cal;BlindPixFFactor","Total F-Factor (Blind Pixel Method)");
     MHCamera disp12 (geomcam, "Cal;PINDiodePh",     "Photon flux outside plexiglass (PIN Diode Method)");
-    MHCamera disp13 (geomcam, "Cal;PINDiodeConv",   "Conversion Factor (PIN Diode Method)");
+    MHCamera disp13 (geomcam, "Cal;PINDiodeConv",   "Conversion Factor tp photons (PIN Diode Method)");
     MHCamera disp14 (geomcam, "Cal;PINDiodeFFactor","Total F-Factor (PIN Diode Method)");
     MHCamera disp15 (geomcam, "Cal;Excluded",       "Pixels previously excluded");
     MHCamera disp16 (geomcam, "Cal;NotFitted",      "Pixels that could not be fitted");
     MHCamera disp17 (geomcam, "Cal;NotFitValid",    "Pixels with not valid fit results");
-    MHCamera disp18 (geomcam, "Cal;HiGainOscillating", "Oscillating Pixels HI Gain");
-    MHCamera disp19 (geomcam, "Cal;LoGainOscillating", "Oscillating Pixels LO Gain");
-    MHCamera disp20 (geomcam, "Cal;HiGainPickup",      "Number Pickup events Hi Gain");
-    MHCamera disp21 (geomcam, "Cal;LoGainPickup",      "Number Pickup events Lo Gain");
-    MHCamera disp22 (geomcam, "Cal;Saturation",        "Pixels with saturated Hi Gain");
-    MHCamera disp23 (geomcam, "Cal;FFactorValid",      "Pixels with valid F-Factor calibration");
-    MHCamera disp24 (geomcam, "Cal;BlindPixelValid",   "Pixels with valid BlindPixel calibration");
+    MHCamera disp18 (geomcam, "Cal;HiGainOscillating",     "Oscillating Pixels HI Gain");
+    MHCamera disp19 (geomcam, "Cal;LoGainOscillating",     "Oscillating Pixels LO Gain");
+    MHCamera disp20 (geomcam, "Cal;HiGainPickup",          "Number Pickup events Hi Gain");
+    MHCamera disp21 (geomcam, "Cal;LoGainPickup",          "Number Pickup events Lo Gain");
+    MHCamera disp22 (geomcam, "Cal;Saturation",            "Pixels with saturated Hi Gain");
+    MHCamera disp23 (geomcam, "Cal;FFactorValid",          "Pixels with valid F-Factor calibration");
+    MHCamera disp24 (geomcam, "Cal;BlindPixelValid",       "Pixels with valid BlindPixel calibration");
     MHCamera disp25 (geomcam, "Cal;PINdiodeFFactorValid",  "Pixels with valid PINDiode calibration");
 
@@ -450,5 +465,4 @@
     disp27.SetCamError(  calcam,41);
 
-/*
     // Relative Times
     disp28.SetCamContent(timecam,0);
@@ -459,5 +473,5 @@
     disp31.SetCamContent(timecam,5);
     disp32.SetCamContent(timecam,6);
-*/
+
     // Absolute Times
     disp33.SetCamContent(calcam,42);
@@ -472,7 +486,7 @@
     disp5.SetYTitle("Reduced Sigma / Mean Charge [1]");
 
-    disp6.SetYTitle("Nr. Photons [1]");
+    disp6.SetYTitle("Nr. Photo-electrons [1]");
     disp7.SetYTitle("Conversion Factor [Ph/FADC Count]");
-    disp8.SetYTitle("\\sqrt{N_{PhE}}*\\sigma_{Charge}/\\mu_{Charge} [1]");
+    disp8.SetYTitle("\\sqrt{N_{Ph}}*\\sigma_{Charge}/\\mu_{Charge} [1] ");
 
     disp9.SetYTitle("Photon flux [ph/mm^2]");
@@ -585,5 +599,4 @@
     CamDraw(c9,disp27,calcam,2,2,2);
 
-/*
     // Rel. Times
     TCanvas &c10 = display->AddTab("Fitted Rel. Times");
@@ -600,5 +613,5 @@
     CamDraw(c11, disp31,calcam,1,2, 0);
     CamDraw(c11, disp32,calcam,2,2, 0);
-*/
+
     // Abs. Times
     TCanvas &c12 = display->AddTab("Abs. Times");
