Index: trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4638)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 4641)
@@ -686,5 +686,4 @@
       pave->ConvertNDCtoPad();
       pave->SetTextSize(0.05);
-      TText *t0 = pave->AddText("  ");
       TText *t1 = pave->AddText("Signal smaller 3 Pedestal RMS");
       t1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max*numcol)));
@@ -739,5 +738,4 @@
       pave2->ConvertNDCtoPad();
       pave2->SetTextSize(0.05);
-      TText *tt0 = pave2->AddText("  ");
       TText *tt1 = pave2->AddText("High Gain Signals could not be fitted");
       tt1->SetTextColor(gStyle->GetColorPalette(Int_t(1./max2*numcol)));
@@ -1761,4 +1759,5 @@
     TFile file(oname, "UPDATE");
 
+    *fLog << inf << " - MStatusDisplay..." << flush;
     if (fDisplay && fDisplay->Write()<=0)
     {
@@ -1766,5 +1765,7 @@
         return kFALSE;
     }
-
+    *fLog << inf << "ok." << endl;
+
+    *fLog << inf << " - MCalibrationChargeCam..." << flush;
     if (fCalibrationCam.Write()<=0)
     {
@@ -1772,5 +1773,7 @@
         return kFALSE;
     }
-
+    *fLog << inf << "ok." << endl;
+
+    *fLog << inf << " - MCalibrationChargeBlindCam..." << flush;
     if (fCalibrationBlindCam.Write()<=0)
     {
@@ -1778,5 +1781,7 @@
         return kFALSE;
     }
-
+    *fLog << inf << "ok." << endl;
+
+    *fLog << inf << " - MCalibrationChargePINDiode..." << flush;
     if (fCalibrationPINDiode.Write()<=0)
     {
@@ -1784,5 +1789,7 @@
         return kFALSE;
     }
-
+    *fLog << inf << "ok." << endl;
+
+    *fLog << inf << " - MCalibrationQECam..." << flush;
     if (fQECam.Write()<=0)
     {
@@ -1790,6 +1797,17 @@
         return kFALSE;
     }
+    *fLog << inf << "ok." << endl;
+
+    *fLog << inf << " - MBadPixelsCam..." << flush;
+    if (fBadPixels.Write()<=0)
+    {
+        *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
+        return kFALSE;
+    }
+    *fLog << inf << "ok." << endl;
 
     if (fRelTimes)
+    {
+        *fLog << inf << " - MCalibrationRelTimeCam..." << flush;
 	if (fRelTimeCam.Write()<=0)
 	{
@@ -1797,9 +1815,5 @@
 	    return kFALSE;
 	}
-
-    if (fBadPixels.Write()<=0)
-    {
-        *fLog << err << "Unable to write MBadPixelsCam to " << oname << endl;
-        return kFALSE;
+        *fLog << inf << "ok." << endl;
     }
 
Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 4638)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 4641)
@@ -91,5 +91,5 @@
 MJPedestal::MJPedestal(const char *name, const char *title) 
     : fEnv(0), fRuns(0), fSequence(0), fExtractor(NULL), fDisplayType(kNormalDisplay),
-      fDataCheck(kFALSE)
+      fDataCheck(kFALSE), fUseData(kFALSE), fMaxEvents(0)
 {
     fName  = name  ? name  : "MJPedestal";
@@ -507,4 +507,7 @@
         SetOutputPath(e1);
     }
+
+    fMaxEvents = fEnv->GetValue("MJPedestal.MaxEvents", fMaxEvents);
+    fUseData   = fEnv->GetValue("MJPedestal.UseData",   fUseData);
 }
 
@@ -545,5 +548,5 @@
     MDirIter iter;
     if (fSequence)
-        fSequence->SetupPedRuns(iter);
+        fUseData ? fSequence->SetupDatRuns(iter) : fSequence->SetupPedRuns(iter);
 
     if (fDataCheck)
@@ -603,5 +606,5 @@
 
     // Execute first analysis
-    if (!evtloop.Eventloop())
+    if (!evtloop.Eventloop(fMaxEvents))
     {
         *fLog << err << GetDescriptor() << ": Failed." << endl;
Index: trunk/MagicSoft/Mars/mjobs/MJPedestal.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 4638)
+++ trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 4641)
@@ -21,76 +21,78 @@
 {
 private:
+    static const Double_t fgPedestalMin;
+    static const Double_t fgPedestalMax;
+    static const Double_t fgPedRmsMin;
+    static const Double_t fgPedRmsMax;
 
-  static const Double_t fgPedestalMin;
-  static const Double_t fgPedestalMax;
-  static const Double_t fgPedRmsMin;
-  static const Double_t fgPedRmsMax;
-  
-  static const Float_t  fgRefPedClosedLids;
-  static const Float_t  fgRefPedExtraGalactic;
-  static const Float_t  fgRefPedGalactic;
+    static const Float_t  fgRefPedClosedLids;
+    static const Float_t  fgRefPedExtraGalactic;
+    static const Float_t  fgRefPedGalactic;
 
-  static const Float_t  fgRefPedRmsClosedLidsInner;
-  static const Float_t  fgRefPedRmsExtraGalacticInner;
-  static const Float_t  fgRefPedRmsGalacticInner;
-  
-  static const Float_t  fgRefPedRmsClosedLidsOuter;
-  static const Float_t  fgRefPedRmsExtraGalacticOuter;
-  static const Float_t  fgRefPedRmsGalacticOuter;
-  
-  TString fOutputPath;        // Directory where the F0-files get stored
-  
-  TEnv       *fEnv;           // Input setup-file
-  MRunIter   *fRuns;          // Used pedestal runs
-  MSequence  *fSequence;      // Sequence
+    static const Float_t  fgRefPedRmsClosedLidsInner;
+    static const Float_t  fgRefPedRmsExtraGalacticInner;
+    static const Float_t  fgRefPedRmsGalacticInner;
 
-  MExtractor *fExtractor;     // Signal extractor, used to find the nr. of used FADC slices
-  
-  MPedestalCam  fPedestalCam; // Created pedestal results
-  MBadPixelsCam fBadPixels;   // Bad Pixels
-  
-  enum  Display_t { kDataCheckDisplay, kNormalDisplay }; // Possible Display types
+    static const Float_t  fgRefPedRmsClosedLidsOuter;
+    static const Float_t  fgRefPedRmsExtraGalacticOuter;
+    static const Float_t  fgRefPedRmsGalacticOuter;
+    
+    TString fOutputPath;        // Directory where the F0-files get stored
 
-  Display_t fDisplayType;     // Chosen Display type    
-  
-  Bool_t fDataCheck;          // Flag if the data check is run on raw data
-  
-  Bool_t ReadPedestalCam();
-  Bool_t WriteResult();
-  
-  void   DisplayResult(MParList &plist);
-  void   DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
-  void   DisplayOutliers(TH1D *hist) const;
-  void   FixDataCheckHist(TH1D *hist) const;
-  
-  void   CheckEnv();
-  
+    TEnv       *fEnv;           // Input setup-file
+    MRunIter   *fRuns;          // Used pedestal runs
+    MSequence  *fSequence;      // Sequence
+
+    MExtractor *fExtractor;     // Signal extractor, used to find the nr. of used FADC slices
+
+    MPedestalCam  fPedestalCam; // Created pedestal results
+    MBadPixelsCam fBadPixels;   // Bad Pixels
+
+    enum  Display_t { kDataCheckDisplay, kNormalDisplay }; // Possible Display types
+
+    Display_t fDisplayType;     // Chosen Display type    
+    
+    Bool_t fDataCheck;          // Flag if the data check is run on raw data
+    Bool_t fUseData;            // Use data-runs from sequence instead of pedestal runs
+
+    Int_t fMaxEvents;           // Maximum number of events
+
+    Bool_t ReadPedestalCam();
+    Bool_t WriteResult();
+
+    void   DisplayResult(MParList &plist);
+    void   DisplayReferenceLines(MHCamera *cam, const Int_t what) const;
+    void   DisplayOutliers(TH1D *hist) const;
+    void   FixDataCheckHist(TH1D *hist) const;
+    
+    void   CheckEnv();
+
 public:
+    MJPedestal(const char *name=NULL, const char *title=NULL);
+    ~MJPedestal();
 
-  MJPedestal(const char *name=NULL, const char *title=NULL);
-  ~MJPedestal();
-  
-  MPedestalCam &GetPedestalCam()            { return fPedestalCam; }
-  const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
-  
-  const char* GetOutputFile() const;
-  const Bool_t IsDataCheck() const    { return fDataCheck;  }
-  
-  Bool_t Process();
-  Bool_t ProcessFile();
-  
-  void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
-  void SetExtractor(MExtractor* ext) { fExtractor = ext; }
-  void SetInput(MRunIter *iter) { fRuns = iter; }
-  void SetSequence(MSequence *seq) { fSequence = seq; }
-  void SetOutputPath(const char *path=".");
-  void SetEnv(const char *env);
-  
-  void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
-  
-  void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
-  void SetNormalDisplay()    { fDisplayType = kNormalDisplay;    }
-  
-  ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
+    MPedestalCam &GetPedestalCam()            { return fPedestalCam; }
+    const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
+
+    const char* GetOutputFile() const;
+    const Bool_t IsDataCheck() const    { return fDataCheck;  }
+
+    Bool_t Process();
+    Bool_t ProcessFile();
+
+    void SetBadPixels(const MBadPixelsCam &bad) { bad.Copy(fBadPixels); }
+    void SetExtractor(MExtractor* ext) { fExtractor = ext; }
+    void SetInput(MRunIter *iter) { fRuns = iter; }
+    void SetSequence(MSequence *seq, Bool_t usedata=kFALSE) { fSequence = seq; }
+    void SetOutputPath(const char *path=".");
+    void SetEnv(const char *env);
+    void SetMaxEvents(Int_t max) { fMaxEvents = max; }
+
+    void SetDataCheck(const Bool_t b=kTRUE) { fDataCheck = b; SetDataCheckDisplay(); }
+
+    void SetDataCheckDisplay() { fDisplayType = kDataCheckDisplay; }
+    void SetNormalDisplay()    { fDisplayType = kNormalDisplay;    }
+
+    ClassDef(MJPedestal, 0) // Tool to create a pedestal file (MPedestalCam)
 };
 
