Index: /trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/callisto.cc	(revision 5557)
@@ -280,7 +280,8 @@
     {
         //
-        // Calculate pedestal for calibration
-        //
-        MJPedestal job1(Form("MJPedestalC #%d", seq.GetSequence()));
+        // Calculate pedestal for pedestal-calculation and calibration
+        //
+        MJPedestal job1(Form("MJPedestalC1 #%d", seq.GetSequence()));
+        job1.SetNoStorage();
         job1.SetSequence(seq);
         job1.SetEnv(kConfig);
@@ -305,18 +306,52 @@
 
         //
-        // Do calibration
-        //
-        MJCalibration job2(Form("MJCalibration #%d", seq.GetSequence()));
+        // Calculate pedestal and pedestal resolution
+        //
+        MJPedestal job2(Form("MJPedestalC2 #%d", seq.GetSequence()));
+        job2.SetNoStorage();
         job2.SetSequence(seq);
         job2.SetEnv(kConfig);
         job2.SetEnvDebug(kDebugEnv);
         job2.SetDisplay(d);;
+        job2.SetOverwrite(kOverwrite);
+        job2.SetPathData(kInpathD);
+        // job1.SetPathOut(kOutpathC); // not yet needed
+        // job1.SetPathIn(kInpathC);   // not yet needed
+
+        job2.SetExtractorResolution();
+        job2.SetExtractor(job1.GetExtractor());
+        job2.SetPedestals(job1.GetPedestalCam());
         job2.SetBadPixels(job1.GetBadPixels());
-        job2.SetOverwrite(kOverwrite);
-        job2.SetPathOut(kOutpathC);
-        job2.SetPathData(kInpathD);
+
+        if (!job2.ProcessFile())
+        {
+            gLog << err << "Calculation of pedestal resolution failed." << endl << endl;
+            return -1;
+        }
+
+        if (!job2.GetDisplay())
+        {
+            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
+            return 1;
+        }
+
+        //
+        // Do calibration
+        //
+        MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence()));
+        job3.SetSequence(seq);
+        job3.SetEnv(kConfig);
+        job3.SetEnvDebug(kDebugEnv);
+        job3.SetDisplay(d);;
+        job3.SetOverwrite(kOverwrite);
+        job3.SetPathOut(kOutpathC);
+        job3.SetPathData(kInpathD);
         // job2.SetPathIn(kInpathC); // not yet needed
 
-        if (!job2.ProcessFile(job1.GetPedestalCam()))
+        job3.SetBadPixels(job2.GetBadPixels());
+        job3.SetExtractor(job2.GetExtractor());
+        job3.SetExtractorCam(job2.GetPedestalCam());
+
+        if (!job3.ProcessFile(job1.GetPedestalCam()))
         {
             gLog << err << "Calculation of calibration failed." << endl << endl;
@@ -324,5 +359,5 @@
         }
 
-        if (!job2.GetDisplay())
+        if (!job3.GetDisplay())
         {
             gLog << warn << "Display closed by user... execution aborted." << endl << endl;
@@ -338,13 +373,15 @@
         // Calculate starting pedestal for data extraction
         //
-        MJPedestal job1(Form("MJPedestalY #%d", seq.GetSequence()));
+        MJPedestal job1(Form("MJPedestalY1 #%d", seq.GetSequence()));
+        job1.SetNoStorage();
         job1.SetSequence(seq);
         job1.SetEnv(kConfig);
         job1.SetEnvDebug(kDebugEnv);
         job1.SetDisplay(d);;
+        job1.SetOverwrite(kOverwrite);
+        job1.SetPathData(kInpathD);
         job1.SetPathIn(kInpathY);
         //job1.SetPathOut(kOutpathY);   // not yet needed
-        job1.SetPathData(kInpathD);
-        job1.SetOverwrite(kOverwrite);
+        job1.SetUseData();
 
         if (!job1.ProcessFile())
@@ -360,4 +397,36 @@
         }
 
+        //
+        // Calculate pedestal and pedestal resolution
+        //
+        MJPedestal job2(Form("MJPedestalY2 #%d", seq.GetSequence()));
+        job2.SetNoStorage();
+        job2.SetSequence(seq);
+        job2.SetEnv(kConfig);
+        job2.SetEnvDebug(kDebugEnv);
+        job2.SetDisplay(d);;
+        job2.SetOverwrite(kOverwrite);
+        job2.SetPathData(kInpathD);
+        // job1.SetPathOut(kOutpathC); // not yet needed
+        // job1.SetPathIn(kInpathC);   // not yet needed
+
+        job2.SetUseData();
+        job2.SetExtractorResolution();
+        job2.SetExtractor(job1.GetExtractor());
+        job2.SetPedestals(job1.GetPedestalCam());
+        job2.SetBadPixels(job1.GetBadPixels());
+
+        if (!job2.ProcessFile())
+        {
+            gLog << err << "Calculation of pedestal resolution failed." << endl << endl;
+            return -1;
+        }
+
+        if (!job2.GetDisplay())
+        {
+            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
+            return 1;
+        }
+/*
         //
         // Extract signal and calibrate it
@@ -381,5 +450,5 @@
             gLog << warn << "Display closed by user... execution aborted." << endl << endl;
             return 1;
-        }
+        }*/
     }
 
Index: /trunk/MagicSoft/Mars/mbase/MParContainer.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mbase/MParContainer.cc	(revision 5557)
@@ -194,4 +194,14 @@
 const char *MParContainer::GetDescriptor() const
 {
+    return GetDescriptor(*this);
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the name of the object. If the name of the object is not the
+// class name it returns the object name and in []-brackets the class name.
+//
+const char *MParContainer::GetDescriptor(const TObject &o)
+{
     //
     // Because it returns a (const char*) we cannot return a casted
@@ -200,6 +210,6 @@
     //
     MString desc;
-    desc.Print("%s [%s]", fName.Data(), ClassName());
-    return fName==ClassName() ? ClassName() : desc.Data();
+    desc.Print("%s [%s]", o.GetName(), o.ClassName());
+    return (TString)o.GetName()==o.ClassName() ? o.ClassName() : desc.Data();
 }
 
Index: /trunk/MagicSoft/Mars/mbase/MParContainer.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 5556)
+++ /trunk/MagicSoft/Mars/mbase/MParContainer.h	(revision 5557)
@@ -73,4 +73,6 @@
         ;
     virtual void        FillBuffer(char *&buffer);
+
+    static const char *GetDescriptor(const TObject &o);
 
     virtual const char   *GetDescriptor() const;
Index: /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 5557)
@@ -1733,5 +1733,5 @@
     const Int_t n = list.Write(name, kSingleKey);
 
-    *fLog << inf << "MStatusDisplay: " << n << " keys written to file as key " << name << "." << endl;
+    //*fLog << inf << "MStatusDisplay: " << n << " keys written to file as key " << name << "." << endl;
 
     return n;
Index: /trunk/MagicSoft/Mars/mbase/MTaskEnv.h
===================================================================
--- /trunk/MagicSoft/Mars/mbase/MTaskEnv.h	(revision 5556)
+++ /trunk/MagicSoft/Mars/mbase/MTaskEnv.h	(revision 5557)
@@ -24,5 +24,4 @@
     Int_t  PostProcess();
 
-    Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
     Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const;
 
@@ -38,4 +37,6 @@
     MTask *GetTask() { return fTask; }
 
+    Int_t  ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);
+
     ClassDef(MTaskEnv, 0) // Task which can be setup from an environment file
 };
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc	(revision 5557)
@@ -760,4 +760,6 @@
   }
 
+  *fLog << all << "--1--" << fGeom << " " << fPedestals << endl;
+
   for (UInt_t aidx=0; aidx<fGeom->GetNumAreas(); aidx++)
     {
@@ -766,9 +768,13 @@
       MCalibrationChargePix &pix = (MCalibrationChargePix&)chargecam->GetAverageArea(aidx);
 
+      *fLog << "1: " << aidx << " " << &ped << " " << &pix << endl;
       FinalizePedestals(ped,pix,aidx);
+      *fLog << "2: " << aidx << endl;
       FinalizeCharges(pix, 
                       fIntensCam ? fIntensCam->GetAverageBadArea(aidx) : fCam->GetAverageBadArea(aidx),
-                      "area id");
-    }
+                      "area idx");
+      *fLog << "3: " << aidx << endl;
+    }
+  *fLog << all << "--2--" << fGeom << " " << fPedestals << endl;
   
   *fLog << endl;
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc	(revision 5557)
@@ -631,7 +631,5 @@
 // arr[1]: Error (rms) of averaged conversion factors (default: 0.)
 //
-// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
-//
-TArrayF *MCalibrationChargeCam::GetAveragedConvFADC2PhotPerArea  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
+TArrayF MCalibrationChargeCam::GetAveragedConvFADC2PhotPerArea  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
                                            const UInt_t ai,  MBadPixelsCam *bad)
 {
@@ -667,7 +665,7 @@
     }
 
-  TArrayF *arr = new TArrayF(2);
-  arr->AddAt(nr   ? mean/nr : -1.,0);
-  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
+  TArrayF arr(2);
+  arr[0] = nr   ? mean/nr : -1;
+  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
 
   return arr;
@@ -687,7 +685,5 @@
 // arr[1]: Error (rms) of averaged conversion factors (default: 0.)
 //
-// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
-//
-TArrayF *MCalibrationChargeCam::GetAveragedConvFADC2PhotPerSector( const MGeomCam &geom, const MCalibrationQECam &qecam,
+TArrayF MCalibrationChargeCam::GetAveragedConvFADC2PhotPerSector( const MGeomCam &geom, const MCalibrationQECam &qecam,
                                              const UInt_t sec, MBadPixelsCam *bad)
 {
@@ -722,8 +718,7 @@
     }
 
-  TArrayF *arr = new TArrayF(2);
-  arr->AddAt(nr   ? mean/nr : -1.,0);
-  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
-
+  TArrayF arr(2);
+  arr[0] = nr   ? mean/nr : -1;
+  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
   return arr;
 }  
@@ -741,8 +736,6 @@
 // arr[1]: Error (rms) of averaged mean arrival times (default: 0.)
 //
-// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
-//
-TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerArea  ( const MGeomCam &geom, 
-                                           const UInt_t ai,  MBadPixelsCam *bad)
+TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerArea(const MGeomCam &geom,
+                                                                 const UInt_t ai,  MBadPixelsCam *bad)
 {
 
@@ -772,8 +765,7 @@
     }
 
-  TArrayF *arr = new TArrayF(2);
-  arr->AddAt(nr   ? mean/nr : -1.,0);
-  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
-
+  TArrayF arr(2);
+  arr[0] = nr   ? mean/nr : -1;
+  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
   return arr;
 }
@@ -791,8 +783,6 @@
 // arr[1]: Error (rms) of averaged mean arrival times (default: 0.)
 //
-// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
-//
-TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerSector( const MGeomCam &geom, 
-                                             const UInt_t sec, MBadPixelsCam *bad)
+TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeMeanPerSector(const MGeomCam &geom,
+                                                                   const UInt_t sec, MBadPixelsCam *bad)
 {
   const Int_t np = GetSize();
@@ -821,8 +811,7 @@
     }
 
-  TArrayF *arr = new TArrayF(2);
-  arr->AddAt(nr   ? mean/nr : -1.,0);
-  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
-
+  TArrayF arr(2);
+  arr[0] = nr   ? mean/nr : -1;
+  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
   return arr;
 }  
@@ -840,8 +829,6 @@
 // arr[1]: Error (rms) of averaged arrival time RMSs (default: 0.)
 //
-// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
-//
-TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerArea  ( const MGeomCam &geom, 
-                                           const UInt_t ai,  MBadPixelsCam *bad)
+TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerArea  ( const MGeomCam &geom,
+                                                                   const UInt_t ai,  MBadPixelsCam *bad)
 {
 
@@ -871,8 +858,7 @@
     }
 
-  TArrayF *arr = new TArrayF(2);
-  arr->AddAt(nr   ? mean/nr : -1.,0);
-  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
-
+  TArrayF arr(2);
+  arr[0] = nr   ? mean/nr : -1;
+  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
   return arr;
 }
@@ -890,7 +876,5 @@
 // arr[1]: Error (rms) of averaged arrival time RMSs (default: 0.)
 //
-// ATTENTION: THE USER HAS TO DELETE THE RETURNED TARRAYF ACCORDINGLY
-//
-TArrayF *MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerSector( const MGeomCam &geom, const UInt_t sec, MBadPixelsCam *bad)
+TArrayF MCalibrationChargeCam::GetAveragedArrivalTimeRmsPerSector( const MGeomCam &geom, const UInt_t sec, MBadPixelsCam *bad)
 {
   const Int_t np = GetSize();
@@ -918,7 +902,7 @@
     }
 
-  TArrayF *arr = new TArrayF(2);
-  arr->AddAt(nr   ? mean/nr : -1.,0);
-  arr->AddAt(nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0. ,1);
+  TArrayF arr(2);
+  arr[0] = nr   ? mean/nr : -1;
+  arr[1] = nr>1 ? TMath::Sqrt((mean2 - mean*mean/nr)/(nr-1)) : 0;
 
   return arr;
Index: /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h
===================================================================
--- /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h	(revision 5556)
+++ /trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.h	(revision 5557)
@@ -44,16 +44,16 @@
   Bool_t  IsFFactorMethodValid            () const;
 
-  TArrayF *GetAveragedConvFADC2PhotPerArea    ( const MGeomCam &geom, const MCalibrationQECam &qecam,
-                                                const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
-  TArrayF *GetAveragedConvFADC2PhotPerSector  ( const MGeomCam &geom, const MCalibrationQECam &qecam,
-                                                const UInt_t sec=0, MBadPixelsCam *bad=NULL);  
-  TArrayF *GetAveragedArrivalTimeMeanPerArea  ( const MGeomCam &geom, 
-	                                        const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
-  TArrayF *GetAveragedArrivalTimeMeanPerSector( const MGeomCam &geom, 
-                                                const UInt_t sec=0, MBadPixelsCam *bad=NULL);  
-  TArrayF *GetAveragedArrivalTimeRmsPerArea   ( const MGeomCam &geom, 
-                                                const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
-  TArrayF *GetAveragedArrivalTimeRmsPerSector ( const MGeomCam &geom, 
-                                                const UInt_t sec=0, MBadPixelsCam *bad=NULL);  
+  TArrayF GetAveragedConvFADC2PhotPerArea    (const MGeomCam &geom, const MCalibrationQECam &qecam,
+                                              const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
+  TArrayF GetAveragedConvFADC2PhotPerSector  (const MGeomCam &geom, const MCalibrationQECam &qecam,
+                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
+  TArrayF GetAveragedArrivalTimeMeanPerArea  (const MGeomCam &geom,
+                                              const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
+  TArrayF GetAveragedArrivalTimeMeanPerSector(const MGeomCam &geom,
+                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
+  TArrayF GetAveragedArrivalTimeRmsPerArea   (const MGeomCam &geom,
+                                              const UInt_t ai=0,  MBadPixelsCam *bad=NULL);
+  TArrayF GetAveragedArrivalTimeRmsPerSector (const MGeomCam &geom,
+                                              const UInt_t sec=0, MBadPixelsCam *bad=NULL);
   
   // Prints
Index: /trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc
===================================================================
--- /trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc	(revision 5557)
@@ -560,6 +560,4 @@
         return kFALSE;
     }
-    *fLog << all << "Name of MPedPhotCam container = " << fNamePedPhotCam 
-          << endl;
 
     fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));
@@ -662,6 +660,10 @@
         break;
     }
-    *fLog << " cleaning initialized with level " << fCleanLvl1 << " and " << fCleanLvl2;
+    *fLog << " cleaning" << endl;
+    *fLog << "initialized with level " << fCleanLvl1 << " and " << fCleanLvl2;
     *fLog << " (CleanRings=" << fCleanRings << ")" << endl;
+
+    *fLog << "Name of MPedPhotCam container used: ";
+    *fLog << (fPed?((MParContainer*)fPed)->GetName():(const char*)fNamePedPhotCam) << endl;
 }
 
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 5557)
@@ -1689,16 +1689,17 @@
     //
     if (fExtractor->InheritsFrom("MExtractTimeAndCharge"))
-      {
+    {
         SetTimeAndCharge();
         if (fExtractorCam.GetSize() == pedcam.GetSize())
-          {
-            plist.AddToList(&fExtractorCam);
-            calcalc.SetNamePedestalCam(fExtractorCam.GetName());
-          }
+            calcalc.SetPedestals(&fExtractorCam);
         else
-          *fLog << warn << "Used Extractor derives from MExtractTimeAndCharge, " 
-                << "but no MExtractorCam has been handed over! " << endl;
-      }
-    
+        {
+            *fLog << warn;
+            *fLog << "Used Extractor derives from MExtractTimeAndCharge, " << endl;
+            *fLog << "but MExtractorCam size " << fExtractorCam.GetSize() << " ";
+            *fLog << "mismatch pedcam size " << pedcam.GetSize() << "! " << endl;
+        }
+    }
+
     MTaskEnv taskenv("ExtractSignal");
     taskenv.SetDefault(fExtractor);
@@ -1965,52 +1966,47 @@
 Bool_t MJCalibration::WriteResult(TObject *geom)
 {
-
-  if (fPathOut.IsNull())
-    return kTRUE;
-  
-  const TString oname(GetOutputFile());
-  
-  *fLog << inf << "Writing to file: " << oname << endl;
-
-  TFile file(oname, "UPDATE", "File created by MJCalibration", 9);
-  if (!file.IsOpen())
-    {
-      *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
-      return kFALSE;
-    }
-  
-  *fLog << inf << " - MStatusDisplay..." << flush;
-  if (fDisplay && fDisplay->Write()<=0)
-    {
-      *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
-      return kFALSE;
-    }
-  *fLog << inf << "ok." << endl;
-  
-  TObjArray cont;
-  if (IsIntensity())
-    {
-      cont.Add(&fIntensBadCam);
-      cont.Add(&fIntensCalibCam);
-      cont.Add(&fIntensQECam);
-      cont.Add(&fIntensBlindCam);
-    }
-  else
-    {
-      cont.Add(&fBadPixels);
-      cont.Add(&fCalibrationCam);
-      cont.Add(&fQECam);
-      cont.Add(&fCalibrationBlindCam);
-    }
-  cont.Add(&fCalibrationPINDiode);
-  if (IsRelTimes())
-    cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
-  
-  if (!geom)
-    *fLog << warn << " - WARNING - MGeomCam... not found!" << endl;
-  else
-    cont.Add(geom);
-  
-  return WriteContainer(cont);
+    if (fPathOut.IsNull())
+        return kTRUE;
+
+    const TString oname(GetOutputFile());
+
+    *fLog << inf << "Writing to file: " << oname << endl;
+
+    TFile file(oname, "UPDATE", "File created by MJCalibration", 9);
+    if (!file.IsOpen())
+    {
+        *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
+        return kFALSE;
+    }
+
+    TObjArray cont;
+    if (fDisplay)
+        cont.Add(fDisplay);
+
+    if (IsIntensity())
+    {
+        cont.Add(&fIntensBadCam);
+        cont.Add(&fIntensCalibCam);
+        cont.Add(&fIntensQECam);
+        cont.Add(&fIntensBlindCam);
+    }
+    else
+    {
+        cont.Add(&fBadPixels);
+        cont.Add(&fCalibrationCam);
+        cont.Add(&fQECam);
+        cont.Add(&fCalibrationBlindCam);
+    }
+    cont.Add(&fCalibrationPINDiode);
+
+    if (IsRelTimes())
+        cont.Add(IsIntensity() ? (TObject*)&fIntensRelTimeCam : (TObject*)&fRelTimeCam);
+
+    if (!geom)
+        *fLog << warn << " - WARNING - MGeomCam... not found!" << endl;
+    else
+        cont.Add(geom);
+
+    return WriteContainer(cont);
 }
 
Index: /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 5557)
@@ -31,37 +31,5 @@
 #include "MJPedestal.h"
 
-#include "MLog.h"
-#include "MLogManip.h"
-
-#include "MTaskEnv.h"
-#include "MSequence.h"
-#include "MRunIter.h"
-#include "MParList.h"
-#include "MTaskList.h"
-#include "MEvtLoop.h"
-#include "MExtractor.h"
-
-#include "MStatusDisplay.h"
-
-#include "MGeomCam.h"
-#include "MHCamera.h"
-#include "MPedestalCam.h"
-#include "MPedestalPix.h"
-#include "MBadPixelsCam.h"
-
-#include "MCalibrationPedCam.h"
-#include "MCalibrationPix.h"
-#include "MHPedestalCam.h"
-#include "MHPedestalPix.h"
-#include "MFillH.h"
-
-
-#include "MReadMarsFile.h"
-#include "MRawFileRead.h"
-#include "MGeomApply.h"
-#include "MBadPixelsMerge.h"
-#include "MPedCalcPedRun.h"
-#include "MPedCalcFromLoGain.h"
-
+// root classes
 #include <TF1.h>
 #include <TEnv.h>
@@ -75,4 +43,41 @@
 #include <TPad.h>
 
+// mars core
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MTaskEnv.h"
+#include "MSequence.h"
+#include "MRunIter.h"
+#include "MParList.h"
+#include "MTaskList.h"
+#include "MEvtLoop.h"
+
+#include "MStatusDisplay.h"
+
+// Other basic classes
+#include "MExtractor.h"
+
+// parameter containers
+#include "MGeomCam.h"
+#include "MHCamera.h"
+#include "MPedestalCam.h"
+#include "MPedestalPix.h"
+#include "MBadPixelsCam.h"
+
+#include "MCalibrationPedCam.h"
+#include "MCalibrationPix.h"
+#include "MHPedestalCam.h"
+#include "MHPedestalPix.h"
+
+// tasks
+#include "MReadMarsFile.h"
+#include "MRawFileRead.h"
+#include "MGeomApply.h"
+#include "MBadPixelsMerge.h"
+#include "MFillH.h"
+#include "MPedCalcPedRun.h"
+#include "MPedCalcFromLoGain.h"
+
 ClassImp(MJPedestal);
 
@@ -94,5 +99,4 @@
 const Float_t  MJPedestal::fgRefPedRmsGalacticOuter      = 4.2;
 
-const TString  MJPedestal::fgNameExtractorCam = "ExtractorResolution";
 // --------------------------------------------------------------------------
 //
@@ -106,5 +110,4 @@
 // - fStorage to Normal Storage
 // - fExtractorResolution to kFALSE
-// - fNameExtractorCam to "ExtractorResolution"
 //
 MJPedestal::MJPedestal(const char *name, const char *title) 
@@ -119,5 +122,10 @@
     SetPathIn("");
     SetExtractorResolution(kFALSE);
-    SetNameExtractorCam();
+}
+
+MJPedestal::~MJPedestal()
+{
+    if (fExtractor)
+        delete fExtractor;
 }
 
@@ -323,15 +331,15 @@
       }
 
-    disp0.SetYTitle("Pedestal [counts/slice]");
-    disp1.SetYTitle("RMS [counts/slice]");
-    disp2.SetYTitle("Hist. Mean  [counts/slice]");
-    disp3.SetYTitle("Hist. Sigma [counts/slice]");
-    disp4.SetYTitle("Calc. Mean  [counts/slice]");
-    disp5.SetYTitle("Calc. RMS   [counts/slice]");
-    disp6.SetYTitle("Diff. Mean  [counts/slice]");
-    disp7.SetYTitle("Diff. RMS   [counts/slice]");
-    disp8.SetYTitle("Diff. Mean  [counts/slice]");
-    disp9.SetYTitle("Abs. Diff. RMS   [counts/slice]");
-    disp10.SetYTitle("Rel. Diff. RMS   [1]");
+    disp0.SetYTitle("P [cts/slice]");
+    disp1.SetYTitle("P_{rms} [cts/slice]");
+    disp2.SetYTitle("Hist. Mean  [cts/slice]");
+    disp3.SetYTitle("Hist. Sigma [cts/slice]");
+    disp4.SetYTitle("Calc. Mean  [cts/slice]");
+    disp5.SetYTitle("Calc. RMS   [cts/slice]");
+    disp6.SetYTitle("Diff. Mean  [cts/slice]");
+    disp7.SetYTitle("Diff. RMS   [cts/slice]");
+    disp8.SetYTitle("Diff. Mean  [cts/slice]");
+    disp9.SetYTitle("Abs.Diff.RMS [cts/slice]");
+    disp10.SetYTitle("Rel.Diff.RMS [1]");
 
     //
@@ -381,5 +389,5 @@
       {
 
-        TCanvas &c3 = fDisplay->AddTab(fExtractorResolution ? "Extr.Res." : "Pedestals");
+        TCanvas &c3 = fDisplay->AddTab(fExtractorResolution ? "PedExtrd" : "Ped");
         c3.Divide(2,3);
         
@@ -538,5 +546,5 @@
       {
             
-        TCanvas &c3 = fDisplay->AddTab("Extr.Res.");
+        TCanvas &c3 = fDisplay->AddTab("PedExtrd");
         c3.Divide(2,3);
         
@@ -544,5 +552,5 @@
         disp1.CamDraw(c3, 2, 2, 6);
         
-        TCanvas &c13 = fDisplay->AddTab("Diff.(Extr.-Pedestal)");
+        TCanvas &c13 = fDisplay->AddTab("PedDiff");
         c13.Divide(2,3);
         
@@ -672,4 +680,11 @@
 */
 
+void MJPedestal::SetExtractor(MExtractor* ext)
+{
+    if (fExtractor)
+        delete fExtractor;
+    fExtractor = ext ? (MExtractor*)ext->Clone() : NULL;
+}
+
 // --------------------------------------------------------------------------
 //
@@ -690,23 +705,37 @@
 Bool_t MJPedestal::CheckEnvLocal()
 {
-
-  SetDataCheck(GetEnv("DataCheck", fDataCheck));
-  
-  if (HasEnv("DataCheckDisplay"))
-    fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay;
-  
-  if (HasEnv("UseData"))
-    fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
-  
-  if (HasEnv("UseHists"))
-    if (GetEnv("UseHists",kFALSE))
-      fExtractType = kUseHists;
-
-  SetExtractorResolution(GetEnv("ExtractorResolution", fExtractorResolution));
-  SetNameExtractorCam(GetEnv("NameExtractorCam", fNameExtractorCam));
-  
-  SetNoStorage(GetEnv("DisableOutput", IsNoStorage()));
-  
-  return kTRUE;
+    SetDataCheck(GetEnv("DataCheck", fDataCheck));
+
+    if (HasEnv("DataCheckDisplay"))
+        fDisplayType = GetEnv("DataCheckDisplay", kFALSE) ? kDataCheckDisplay : kNormalDisplay;
+
+    if (HasEnv("UseData"))
+        fExtractType = GetEnv("UseData",kFALSE) ? kUseData : kUsePedRun;
+
+    if (HasEnv("UseHists"))
+        if (GetEnv("UseHists",kFALSE))
+            fExtractType = kUseHists;
+
+    SetExtractorResolution(GetEnv("ExtractorResolution", fExtractorResolution));
+
+    SetNoStorage(GetEnv("DisableOutput", IsNoStorage()));
+
+    MTaskEnv tenv;
+    tenv.SetDefault(fExtractor);
+
+    if (tenv.ReadEnv(*GetEnv(), GetEnvPrefix()+".ExtractSignal", GetEnvDebug())==kERROR)
+        return kFALSE;
+
+    if (fExtractor==tenv.GetTask())
+        return kTRUE;
+
+    if (!tenv.GetTask()->InheritsFrom(MExtractor::Class()))
+    {
+        *fLog << err << "ERROR: ExtractSignal from resource file doesn't inherit from MExtractor.... abort." << endl;
+        return kFALSE;
+    }
+
+    SetExtractor((MExtractor*)tenv.GetTask());
+    return kTRUE;
 }
 
@@ -738,23 +767,13 @@
     }
 
-    if (fDisplay && fDisplay->Write()<=0)
-    {
-        *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
-        return kFALSE;
-    }
-
-    if (fPedestalCamOut.Write()<=0)
-    {
-        *fLog << err << "Unable to write MPedestalCam to " << oname << endl;
-        return kFALSE;
-    }
-
-    if (fBadPixels.Write()<=0)
-    {
-        *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
-        return kFALSE;
-    }
-
-    return kTRUE;
+    TObjArray cont;
+
+    if (fDisplay)
+        cont.Add(fDisplay);
+
+    cont.Add(&fPedestalCamOut);
+    cont.Add(&fBadPixels);
+
+    return WriteContainer(cont);
 }
 
@@ -763,4 +782,18 @@
     if (!ReadPedestalCam())
         return ProcessFile();
+
+    return kTRUE;
+}
+
+Bool_t MJPedestal::SetupExtractor(MParList &plist, MExtractPedestal &extped)
+{
+    if (!fExtractor)
+        return kTRUE;
+
+    if (!fExtractorResolution || !fExtractor->InheritsFrom("MExtractTimeAndCharge"))
+        return kFALSE;
+
+    extped.SetPedestalsIn(&fPedestalCamIn);
+    extped.SetExtractor((MExtractTimeAndCharge*)fExtractor);
 
     return kTRUE;
@@ -849,16 +882,17 @@
     plist.AddToList(&fBadPixels);
     
-    MGeomApply      geomapl;
+    MGeomApply geomapl;
     MBadPixelsMerge merge(&fBadPixels);
 
-    MPedCalcPedRun     pedcalc;
+    MPedCalcPedRun pedcalc;
     pedcalc.SetPedestalUpdate(kFALSE);
+
     MPedCalcFromLoGain pedlogain;
     pedlogain.SetPedestalUpdate(kFALSE);
 
-    MHPedestalCam      hpedcam;
+    MHPedestalCam hpedcam;
     hpedcam.SetRenorm(kTRUE);
     
-    MFillH fillped(&hpedcam, "MExtractedSignalCam");
+    MFillH fillped(&hpedcam, "MExtractedSignalCam", "FillPedestalCam");
     fillped.SetBit(MFillH::kDoNotDisplay);
 
@@ -873,5 +907,5 @@
 
         *fLog << all;
-        *fLog << underline << "Signal Extractor found in calibration file" << endl;
+        *fLog << underline << "Signal Extractor found in calibration file:" << endl;
         fExtractor->Print();
         *fLog << endl;
@@ -882,49 +916,36 @@
     {
     case kUseData:
-      taskenv.SetDefault(&pedlogain);
-      tlist.AddToList(&taskenv);
-      if (!fExtractor)
+        taskenv.SetDefault(&pedlogain);
+        tlist.AddToList(&taskenv);
+
+        if (!SetupExtractor(plist, pedlogain))
+            pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
         break;
-      if (fExtractorResolution && fExtractor->InheritsFrom("MExtractTimeAndCharge"))
+
+    case kUsePedRun:
+        taskenv.SetDefault(&pedcalc);
+        tlist.AddToList(&taskenv);
+
+        if (!SetupExtractor(plist, pedcalc))
+            pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(), TMath::Nint(fExtractor->GetNumHiGainSamples()));
+        break;
+
+    case kUseHists:
+        if (!fExtractor)
         {
-          plist.AddToList(&fPedestalCamIn);
-          fPedestalCamOut.SetName(fNameExtractorCam.Data());
-          pedlogain.SetNamePedestalCamOut(fNameExtractorCam.Data());
-          pedlogain.SetExtractor((MExtractTimeAndCharge*)fExtractor);
+            *fLog << err << GetDescriptor() << " - ERROR: ";
+            *fLog << "Extraction Type is kUseHists, but no extractor was set" << endl;
+            return kFALSE;
         }
-      else
-        pedlogain.SetExtractWindow(15, (Int_t)TMath::Nint(fExtractor->GetNumHiGainSamples()));
-      break;
-
-    case kUsePedRun:
-      taskenv.SetDefault(&pedcalc);
-      tlist.AddToList(&taskenv);
-      if (!fExtractor)
+
+        tlist.AddToList(fExtractor);
+        tlist.AddToList(&fillped);
         break;
-      if (fExtractorResolution && fExtractor->InheritsFrom("MExtractTimeAndCharge"))
-        {
-          plist.AddToList(&fPedestalCamIn);
-          fPedestalCamOut.SetName(fNameExtractorCam.Data());
-          pedcalc.SetNamePedestalCamOut(fNameExtractorCam.Data());
-          pedcalc.SetExtractor((MExtractTimeAndCharge*)fExtractor);
-        }
-      else
-        pedcalc.SetExtractWindow(fExtractor->GetHiGainFirst(),TMath::Nint(fExtractor->GetNumHiGainSamples()));
-      break;
-      
-    case kUseHists:
-      if (!fExtractor)
-        {
-          *fLog << err << GetDescriptor();
-          *fLog << ": Extraction Type kUseExtractor is chosen, but no extractor has been handed over" 
-                << endl;
-          return kFALSE;
-        }
-      
-      plist.AddToList(&hpedcam);
-      tlist.AddToList(fExtractor);
-      tlist.AddToList(&fillped);
-
-      break;
+    }
+
+    if (!fPathIn.IsNull())
+    {
+        delete fExtractor;
+        fExtractor = 0;
     }
 
@@ -933,17 +954,6 @@
     // means that the each "sliding" of the sliding window is not applied
     //
-    if (fExtractorResolution && !fExtractor->IsNoiseCalculation())
-      {
-        *fLog << warn << GetDescriptor();
-        *fLog <<": Extraction type is kUseExtractor, but extractor has kNoiseCalculation not set... set." 
-              << endl;
-        fExtractor->SetNoiseCalculation();
-      }
-    
-    if (!fPathIn.IsNull())
-    {
-      delete fExtractor;
-      fExtractor = 0;
-    }
+    if (fExtractor)
+        fExtractor->SetNoiseCalculation(fExtractorResolution);
 
     //
Index: /trunk/MagicSoft/Mars/mjobs/MJPedestal.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 5556)
+++ /trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 5557)
@@ -18,4 +18,5 @@
 class TH1D;
 class MExtractor;
+class MExtractPedestal;
 class MEvtLoop;
 
@@ -23,95 +24,91 @@
 {
 private:
+    static const Double_t fgPedestalMin;                 //! Minimum Axis value for pedestal datacheck display
+    static const Double_t fgPedestalMax;                 //! Maximum Axis value for pedestal datacheck display
+    static const Double_t fgPedRmsMin;                   //! Minimum Axis value for ped. RMS datacheck display
+    static const Double_t fgPedRmsMax;                   //! Maximum Axis value for ped. RMS datacheck display
 
-  static const Double_t fgPedestalMin;                 //! Minimum Axis value for pedestal datacheck display
-  static const Double_t fgPedestalMax;                 //! Maximum Axis value for pedestal datacheck display
-  static const Double_t fgPedRmsMin;                   //! Minimum Axis value for ped. RMS datacheck display
-  static const Double_t fgPedRmsMax;                   //! Maximum Axis value for ped. RMS datacheck display
-  
-  static const Float_t  fgRefPedClosedLids;            //! Reference line pedestal for closed lids run
-  static const Float_t  fgRefPedExtraGalactic;         //! Reference line pedestal for extragalactic source
-  static const Float_t  fgRefPedGalactic;              //! Reference line pedestal for galactic source     
-  
-  static const Float_t  fgRefPedRmsClosedLidsInner;    //! Ref. line ped. RMS for closed lids run - inner pixels     
-  static const Float_t  fgRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels 
-  static const Float_t  fgRefPedRmsGalacticInner;      //! Ref. line ped. RMS for galactic source - inner pixels     
-  
-  static const Float_t  fgRefPedRmsClosedLidsOuter;    //! Ref. line ped. RMS for closed lids run - outer pixels     
-  static const Float_t  fgRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
-  static const Float_t  fgRefPedRmsGalacticOuter;      //! Ref. line ped. RMS for galactic source - outer pixels     
-    
-  static const TString  fgNameExtractorCam;            //! "ExtractorResolution"
+    static const Float_t  fgRefPedClosedLids;            //! Reference line pedestal for closed lids run
+    static const Float_t  fgRefPedExtraGalactic;         //! Reference line pedestal for extragalactic source
+    static const Float_t  fgRefPedGalactic;              //! Reference line pedestal for galactic source
 
-  MRunIter   *fRuns;                                   // Used pedestal runs
-  MExtractor *fExtractor;                              // Signal extractor, used to find the nr. of used FADC slices
-  
-  MPedestalCam  fPedestalCamIn;                        // Handed over pedestal results
-  MPedestalCam  fPedestalCamOut;                       // Created pedestal results
-  MBadPixelsCam fBadPixels;                            // Bad Pixels
+    static const Float_t  fgRefPedRmsClosedLidsInner;    //! Ref. line ped. RMS for closed lids run - inner pixels
+    static const Float_t  fgRefPedRmsExtraGalacticInner; //! Ref. line ped. RMS for extragalactic source - inner pixels
+    static const Float_t  fgRefPedRmsGalacticInner;      //! Ref. line ped. RMS for galactic source - inner pixels
 
-  TString fNameExtractorCam;                           // Name of the outgoing MPedestalCam if fExtractorResolution
-  
-  enum Display_t {kDataCheckDisplay, kNormalDisplay};  // Possible Display types
-  Display_t fDisplayType;                              // Chosen Display type    
-  
-  enum Storage_t { kNoStorage };                       // Possible flags for the storage of results
-  Byte_t fStorage;                                     // Bit-field for chosen storage type
-    
-  Bool_t fDataCheck;                                   // Flag if the data check is run on raw data
+    static const Float_t  fgRefPedRmsClosedLidsOuter;    //! Ref. line ped. RMS for closed lids run - outer pixels
+    static const Float_t  fgRefPedRmsExtraGalacticOuter; //! Ref. line ped. RMS for extragalactic source - outer pixels
+    static const Float_t  fgRefPedRmsGalacticOuter;      //! Ref. line ped. RMS for galactic source - outer pixels
 
-  enum Extract_t {kUseData, kUsePedRun, kUseHists };   // Possible flags for the extraction of the pedestal
-  Extract_t fExtractType;                              // Chosen extractor type
+    MRunIter   *fRuns;                                   // Used pedestal runs
+    MExtractor *fExtractor;                              // Signal extractor, used to find the nr. of used FADC slices
 
-  Bool_t fExtractorResolution;                         // Flag if the extractor is used to calculate the pedestals
-  
-  MExtractor *ReadCalibration() const;
-  Bool_t ReadPedestalCam();
-  Bool_t WriteResult();
-  //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
+    MPedestalCam  fPedestalCamIn;                        // Handed over pedestal results
+    MPedestalCam  fPedestalCamOut;                       // Created pedestal results
+    MBadPixelsCam fBadPixels;                            // Bad Pixels
 
-  void   DisplayResult(MParList &plist);
-  void   DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
-  void   DisplayOutliers(TH1D *hist) const;
-  void   FixDataCheckHist(TH1D *hist) const;
-  
-  Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
-  
-  Bool_t CheckEnvLocal();
-    
+    enum Display_t {kDataCheckDisplay, kNormalDisplay};  // Possible Display types
+    Display_t fDisplayType;                              // Chosen Display type
+
+    enum Storage_t { kNoStorage };                       // Possible flags for the storage of results
+    Byte_t fStorage;                                     // Bit-field for chosen storage type
+
+    Bool_t fDataCheck;                                   // Flag if the data check is run on raw data
+
+    enum Extract_t {kUseData, kUsePedRun, kUseHists };   // Possible flags for the extraction of the pedestal
+    Extract_t fExtractType;                              // Chosen extractor type
+
+    Bool_t fExtractorResolution;                         // Flag if the extractor is used to calculate the pedestals
+
+    MExtractor *ReadCalibration() const;
+    Bool_t ReadPedestalCam();
+    Bool_t WriteResult();
+    //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
+
+    Bool_t SetupExtractor(MParList &plist, MExtractPedestal &extped);
+
+    void   DisplayResult(MParList &plist);
+    void   DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
+    void   DisplayOutliers(TH1D *hist) const;
+    void   FixDataCheckHist(TH1D *hist) const;
+
+    Bool_t IsNoStorage() const { return TESTBIT(fStorage, kNoStorage); }
+
+    Bool_t CheckEnvLocal();
+
 public:
+    MJPedestal(const char *name=NULL, const char *title=NULL);
+    ~MJPedestal();
 
-  MJPedestal(const char *name=NULL, const char *title=NULL);
+    MPedestalCam &GetPedestalCam()            { return fPedestalCamOut; }
+    const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
 
-  MPedestalCam &GetPedestalCam()            { return fPedestalCamOut; }
-  const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
-  
-  const char*  GetNameExtractorCam()  const { return fNameExtractorCam.Data(); }
-  const char*  GetOutputFile()        const;
+    const char*  GetOutputFile() const;
 
-  const Bool_t IsDataCheck()          const { return fDataCheck; }
-  const Bool_t IsUseData()            const { return fExtractType == kUseData; }
-  
-  Bool_t Process    ();
-  Bool_t ProcessFile();
-  
-  void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
-  void SetPedestals(const MPedestalCam  &ped) { ped.Copy(fPedestalCamIn); }  
-  void SetExtractor(MExtractor* ext)          { fExtractor = ext;     }
-  void SetInput(MRunIter  *iter)              { fRuns      = iter;    }
-  void SetUseData()                           { fExtractType = kUseData;   }
-  void SetUseHists()                          { fExtractType = kUseHists;  }
-  void SetUsePedRun()                         { fExtractType = kUsePedRun; }
-  void SetDataCheck(const Bool_t b=kTRUE)     { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); }
-  void SetDataCheckDisplay()                  { fDisplayType = kDataCheckDisplay; }
-  void SetNormalDisplay()                     { fDisplayType = kNormalDisplay;    }
-  void SetExtractorResolution(const Bool_t b=kTRUE) { fExtractorResolution = b;  }
-  void SetNameExtractorCam( const char* name= fgNameExtractorCam.Data())  { fNameExtractorCam = name;  }
-  
-  
-  // Storage
-  void SetNoStorage(const Bool_t b)           { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
-  void SetNormalStorage()                     { CLRBIT(fStorage, kNoStorage); }
-  
-  ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
+    const Bool_t IsDataCheck() const { return fDataCheck; }
+    const Bool_t IsUseData() const { return fExtractType == kUseData; }
+
+    Bool_t Process    ();
+    Bool_t ProcessFile();
+
+    void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
+    void SetPedestals(const MPedestalCam  &ped) { ped.Copy(fPedestalCamIn); }
+    void SetExtractor(MExtractor* ext);
+    void SetInput(MRunIter  *iter)              { fRuns      = iter;    }
+    void SetUseData()                           { fExtractType = kUseData;   }
+    void SetUseHists()                          { fExtractType = kUseHists;  }
+    void SetUsePedRun()                         { fExtractType = kUsePedRun; }
+    void SetDataCheck(const Bool_t b=kTRUE)     { fDataCheck = b; b ? SetDataCheckDisplay() : SetNormalDisplay(); }
+    void SetDataCheckDisplay()                  { fDisplayType = kDataCheckDisplay; }
+    void SetNormalDisplay()                     { fDisplayType = kNormalDisplay;    }
+    void SetExtractorResolution(const Bool_t b=kTRUE) { fExtractorResolution = b;  }
+
+    MExtractor *GetExtractor() const { return fExtractor; }
+
+    // Storage
+    void SetNoStorage(const Bool_t b=kTRUE)     { b ? SETBIT(fStorage, kNoStorage) : CLRBIT(fStorage,kNoStorage); }
+    void SetNormalStorage()                     { CLRBIT(fStorage, kNoStorage); }
+
+    ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
 };
 
Index: /trunk/MagicSoft/Mars/mjobs/MJob.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJob.cc	(revision 5556)
+++ /trunk/MagicSoft/Mars/mjobs/MJob.cc	(revision 5557)
@@ -181,12 +181,12 @@
     }
 
-    MIter Next(&list);
-    MParContainer *o=0;
+    TIter Next(&list);
+    TObject *o=0;
     while ((o=Next()))
     {
-        *fLog << inf << " - Writing " << o->GetDescriptor() << "..." << flush;
+        *fLog << inf << " - Writing " << MParContainer::GetDescriptor(*o) << "..." << flush;
         if (o->Write(o->GetName())<=0)
         {
-            *fLog << err << dbginf << "ERROR - Writing " << o->GetDescriptor() << " to file " << gFile->GetName() << endl;
+            *fLog << err << dbginf << "ERROR - Writing " << MParContainer::GetDescriptor(*o) << " to file " << gFile->GetName() << endl;
             return kFALSE;
         }
Index: /trunk/MagicSoft/Mars/mjobs/MJob.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJob.h	(revision 5556)
+++ /trunk/MagicSoft/Mars/mjobs/MJob.h	(revision 5557)
@@ -14,7 +14,7 @@
     void FixPath(TString &path) const;
 
-    TEnv     *fEnv;           // Resource file
-    TString   fEnvPrefix;     // Prefix for resources
-    Bool_t    fEnvDebug;      // Debug setup of resources
+    const TEnv *fEnv;         // Resource file
+    TString     fEnvPrefix;   // Prefix for resources
+    Bool_t      fEnvDebug;    // Debug setup of resources
 
 protected:
@@ -28,4 +28,8 @@
 
     MSequence fSequence;      // Sequence
+
+    const TEnv *GetEnv() const { return fEnv; }
+    const TString &GetEnvPrefix() const { return fEnvPrefix; }
+    Bool_t GetEnvDebug() const { return fEnvDebug; }
 
     Int_t       GetEnv(const char *name, Int_t dflt) const;
