Index: trunk/MagicSoft/Mars/macros/calibration.C
===================================================================
--- trunk/MagicSoft/Mars/macros/calibration.C	(revision 3742)
+++ trunk/MagicSoft/Mars/macros/calibration.C	(revision 3743)
@@ -22,10 +22,40 @@
 !
 \* ======================================================================== */
-//const TString inpath = "/home/rootdata/Calib/2004_04_08/";
+/////////////////////////////////////////////////////////////////////////////
+//
+//  calibration.C
+//
+//  Needs as arguments the run number of a calibration file ("*_C_*.root") and 
+//  the run number of the corresponding pedestal file ("*_P_*.root"). 
+//
+//  The TString inpath has to be set correctly.
+//
+//  The macro searches for the pulser colour which corresponds to the calibration
+//  run number. If the run number is smaller than 20000, pulser colour "CT1" 
+//  is assumed, otherwise, it searches for the strings "green", "blue", "uv" or 
+//  "ct1" in the filenames. If no colour or multiple colours are found, the 
+//  execution is aborted.  
+//
+//  The container MBadPixelsCam is created and followed during the execution of the 
+//  rest of the macro.
+// 
+//  A first loop over the pedestal file is performed using the class MJPedestal
+//
+//  The container MCalibrationQECam is created and followed during the execution of the 
+//  rest of the macro.
+//
+//  A loop over the calibration files is performed using the class MJCalibration. 
+//  The results are displayed using the MJCalibration::SetNormalDisplay() facility, 
+//  but other displays can easily be uncommented. 
+//  The call to MJCalibration skips the relative time calibration, which can be 
+//  uncommented as well. 
+// 
+/////////////////////////////////////////////////////////////////////////////
 const TString inpath = "/home/rootdata/BlindPixel/";
-const Int_t pedrun = 20491;
-const Int_t calrun = 20494;
-
-void calibration(const Int_t prun=pedrun, const Int_t crun=calrun)
+const Int_t pedrun  = 20491;
+const Int_t calrun1 = 20494;
+const Int_t calrun2 = 20496;
+
+void calibration(const Int_t prun=pedrun, const Int_t crun1=calrun1, const Int_t crun2=calrun2)
 {
   
@@ -34,9 +64,13 @@
 
   pruns.AddRun(prun,inpath);
-  cruns.AddRun(crun,inpath);
+
+  if (crun2==0)
+    cruns.AddRun(crun1,inpath);
+  else
+    cruns.AddRuns(crun1,crun2,inpath);
 
   MCalibrationCam::PulserColor_t color;
 
-  if (crun < 20000)
+  if (crun1 < 20000)
     color = MCalibrationCam::kCT1;
   else
@@ -48,5 +82,10 @@
   MCalibrationQECam qecam;
   MBadPixelsCam     badcam;
-  badcam.AsciiRead("badpixels.dat");
+
+  //
+  // If you want to exclude pixels from the beginning, read 
+  // an ascii-file with the corr. pixel numbers (see MBadPixelsCam)
+  //
+  //  badcam.AsciiRead("badpixels.dat");
 
   for (Int_t i=0;i<badcam.GetSize();i++)
@@ -98,4 +137,5 @@
   //
   // If you want to calibrate the times as well, choose:
+  //
   //  calloop.SetRelTimeCalibration();
   calloop.SetInput(&cruns);
