Index: trunk/MagicSoft/Mars/macros/calibration.C
===================================================================
--- trunk/MagicSoft/Mars/macros/calibration.C	(revision 3638)
+++ trunk/MagicSoft/Mars/macros/calibration.C	(revision 3651)
@@ -59,4 +59,70 @@
   if (!pedloop.Process())
     return;
+
+  //
+  // Create a empty Parameter List and an empty Task List
+  // The tasklist is identified in the eventloop by its name
+  //
+  MParList  plist0;
+  MTaskList tlist0;
+  plist0.AddToList(&tlist0);
+  
+  //
+  // Now setup the tasks and tasklist for the pedestals:
+  // ---------------------------------------------------
+  //
+  MReadMarsFile read("Events");
+  read.DisableAutoScheme();
+  static_cast<MRead&>(read).AddFiles(pruns);
+
+  MGeomApply      geomapl;
+  MExtractSignal  sigcalc;
+  
+  //
+  // Additionally to calculating the pedestals, 
+  // you can fill histograms and look at them
+  //
+  MFillH fill("MHPedestalCam", "MExtractedSignalCam");
+  
+  tlist0.AddToList(&read);
+  tlist0.AddToList(&geomapl);
+  tlist0.AddToList(&sigcalc);
+  tlist0.AddToList(&fill);
+  
+  MGeomCamMagic  geomcam;
+  MHPedestalCam  hpedcam;
+  plist0.AddToList(&geomcam);
+  plist0.AddToList(&pedloop.GetPedestalCam());
+  plist0.AddToList(&badcam);
+  plist0.AddToList(&hpedcam);
+  
+  //
+  // Create and setup the eventloop
+  //
+  MEvtLoop evtloop0;
+  
+  evtloop0.SetParList(&plist0);
+  evtloop0.SetDisplay(display);
+  
+  //
+  // Execute first analysis
+  //
+  if (!evtloop0.Eventloop())
+    return;
+
+  tlist0.PrintStatistics();
+
+  for (Int_t aidx=0;aidx<2;aidx++)
+    {
+      hpedcam.GetAverageHiGainArea(aidx).DrawClone("fourierevents");
+      hpedcam.GetAverageLoGainArea(aidx).DrawClone("fourierevents");
+    }
+  
+  for (Int_t sector=1;sector<7;sector++)
+    {
+      hpedcam.GetAverageHiGainSector(sector).DrawClone("fourierevents");
+      hpedcam.GetAverageLoGainSector(sector).DrawClone("fourierevents");
+    }
+  
 
   // 
