Index: /trunk/MagicSoft/Mars/macros/calibration.C
===================================================================
--- /trunk/MagicSoft/Mars/macros/calibration.C	(revision 4068)
+++ /trunk/MagicSoft/Mars/macros/calibration.C	(revision 4069)
@@ -55,7 +55,23 @@
 //
 /////////////////////////////////////////////////////////////////////////////
-static const TString inpath = "/mnt/Data/rootdata/Miscellaneous/2004_03_03/";
-static const Int_t pedrun  = 20123;
-static const Int_t calrun1 = 20125;
+static const TString outpath = "./";
+static const TString inpath = "./";
+//static const TString inpath = "/home/rootdata/Calib/";
+//
+// Tell if you want to calibrate times:
+//
+static const  Bool_t useTimes = kTRUE;
+//
+// the default pedestal run for the calibration
+//
+static const Int_t   pedrun  = 13426;
+//
+// the default start calibration run 
+//
+static const Int_t   calrun1 = 16744;
+//
+// the default last calibration run (if 0, only one run is taken, otherwise consecutive runs 
+// between calrun1 and calrun2)
+//
 static const Int_t calrun2 = 0;
 
@@ -67,12 +83,12 @@
   // Choose the signal Extractor:
   //
-  MExtractFixedWindowPeakSearch extractor;
+  //  MExtractFixedWindowPeakSearch extractor;
   //  MExtractSlidingWindow  extractor;   
-  //  MExtractFixedWindow    extractor;   
+   MExtractFixedWindow    extractor;   
 
   //
   // Set Ranges or Windows
   //
-  //  extractor.SetRange(2,14,5,14);
+   extractor.SetRange(3,14,3,14);
   //  extractor.SetWindows(8,8);
 
@@ -80,16 +96,10 @@
   // Choose the arrival time Extractor:
   //
-  MExtractTimeHighestIntegral timeext;
-  // MExtractTimeSpline timeext;
+  //  MExtractTimeHighestIntegral timeext;
+  MExtractTimeFastSpline timeext;
   //
   // Set Ranges or Windows
   //
-  // timeext.SetRange(0,14,6,14);
-
-  //
-  // Tell if you want to calibrate times:
-  //
-  Bool_t useTimes = kTRUE;
-  //  Bool_t calibrateTimes = kFALSE;  
+  timeext.SetRange(2,12,4,14);
 
   MRunIter pruns;
@@ -122,9 +132,10 @@
   // an ascii-file with the corr. pixel numbers (see MBadPixelsCam)
   //
-  badcam.AsciiRead("badpixels.dat");
+//  badcam.AsciiRead("badpixels.dat");
 
   MJPedestal pedloop;
   pedloop.SetExtractor(&extractor);
   pedloop.SetInput(&pruns);
+  pedloop.SetOutputPath(outpath.Data());
   pedloop.SetDisplay(display);
   pedloop.SetBadPixels(badcam);
@@ -156,18 +167,14 @@
   calloop.SetTimeExtractor(&timeext);
   calloop.SetInput(&cruns);
+  calloop.SetOutputPath(outpath.Data());
   calloop.SetDisplay(display);
   calloop.SetQECam(qecam);
   calloop.SetBadPixels(pedloop.GetBadPixels());
-  if (!calloop.Process(pedloop.GetPedestalCam()))
-    return;
-
-  /*
-  MCalibrationChargeCam &chargecam = calloop.GetCalibrationCam();
-  MLog juanlog;
-  juanlog.SetOutputFile("test.txt",1);
-  chargecam.SetLogStream(&juanlog);
-  chargecam.Print();
-  chargecam.SetLogStream(&gLog);
-  */
+
+//  TObject::SetObjectStat(kTRUE);
+
+  calloop.Process(pedloop.GetPedestalCam());
+
+//  gObjectTable->Print();
 
   /********************************************************************/
@@ -178,9 +185,25 @@
 
   testloop.SetExtractor(&extractor);
+  testloop.SetTimeExtractor(&timeext);
   testloop.SetInput(&cruns);
+  testloop.SetOutputPath(outpath);
   testloop.SetDisplay(display);
   testloop.SetBadPixels(calloop.GetBadPixels());
   testloop.ProcessD(pedloop.GetPedestalCam(),calloop.GetCalibrationCam(),calloop.GetQECam());
+  if (useTimes)
+      testloop.ProcessT(pedloop.GetPedestalCam(),calloop.GetRelTimeCam());
   
+  //
+  // List of useful containers:
+  // 
+/*
+  MPedestalCam          &pedcam      = pedloop.GetPedestalCam();
+  MCalibrationChargeCam &chargecam   = calloop.GetCalibrationCam();
+  MCalibrationQECam     &qecam       = calloop.GetCalibrationCam();
+  MBadPixelsCam         &badcam      = calloop.GetBadPixels();
+  MHCalibrationTestCam  &testcam     = testloop.GetTestCam();
+  MHCalibrationTestTimeCam &testtime = testloop.GetTestTimeCam();
+*/
 }
 
+
