Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 5232)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 5233)
@@ -19,4 +19,12 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2004/10/12: Markus Gaug
+
+   * mjobs/MJPedestal.[h,cc]
+     - fixed documentation of data members
+     - implemented option kNoStorage for neither reading nor writing 
+       the F0-files to disk.
+
 
  2004/10/11: Markus Gaug
Index: /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 5232)
+++ /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 5233)
@@ -88,5 +88,10 @@
 // Default constructor. 
 //
-// Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE
+// Sets:
+// - fRuns to 0, 
+// - fExtractor to NULL, 
+// - fDataCheck to kFALSE, 
+// - fUseData to kFALSE
+// - fStorage to kNormalStorage
 //
 MJPedestal::MJPedestal(const char *name, const char *title) 
@@ -94,6 +99,9 @@
       fDataCheck(kFALSE), fUseData(kFALSE)
 {
-    fName  = name  ? name  : "MJPedestal";
-    fTitle = title ? title : "Tool to create a pedestal file (MPedestalCam)";
+
+  fName  = name  ? name  : "MJPedestal";
+  fTitle = title ? title : "Tool to create a pedestal file (MPedestalCam)";
+  
+  SetNormalStorage();
 }
 
@@ -109,40 +117,57 @@
 }
 
+//---------------------------------------------------------------------------------
+//
+// Try to read an existing MPedestalCam from a previously created output file. 
+// If found, also an MBadPixelsCam and the corresponding display is read.
+//
+// In case of Storage type "kNoStorage" or if the file is not found or the 
+// MPedestalCam cannot be read, return kFALSE, otherwise kTRUE.
+//
 Bool_t MJPedestal::ReadPedestalCam()
 {
-    const TString fname = GetOutputFile();
-
-    if (gSystem->AccessPathName(fname, kFileExists))
-    {
-        *fLog << warn << "Input file " << fname << " doesn't exist, will create it." << endl;
-        return kFALSE;
-    }
-
-    *fLog << inf << "Reading from file: " << fname << endl;
-
-    TFile file(fname, "READ");
-    if (fPedestalCam.Read()<=0)
-    {
-        *fLog << err << "Unable to read MPedestalCam from " << fname << endl;
-        return kFALSE;
-    }
-
-    if (file.FindKey("MBadPixelsCam"))
-    {
-        MBadPixelsCam bad;
+
+  if (IsNoStorage())
+    return kFALSE;
+  
+  const TString fname = GetOutputFile();
+  
+  if (gSystem->AccessPathName(fname, kFileExists))
+    {
+      *fLog << warn << "Input file " << fname << " doesn't exist, will create it." << endl;
+      return kFALSE;
+    }
+  
+  *fLog << inf << "Reading from file: " << fname << endl;
+  
+  TFile file(fname, "READ");
+  if (fPedestalCam.Read()<=0)
+    {
+      *fLog << err << "Unable to read MPedestalCam from " << fname << endl;
+      return kFALSE;
+    }
+  
+  if (file.FindKey("MBadPixelsCam"))
+    {
+      MBadPixelsCam bad;
         if (bad.Read()<=0)
-        {
+          {
             *fLog << err << "Unable to read MBadPixelsCam from " << fname << endl;
             return kFALSE;
-        }
+          }
         fBadPixels.Merge(bad);
     }
 
-    if (fDisplay && !fDisplay->GetCanvas("Pedestals"))
-        fDisplay->Read();
-
-    return kTRUE;
-}
-
+  if (fDisplay && !fDisplay->GetCanvas("Pedestals"))
+    fDisplay->Read();
+  
+  return kTRUE;
+}
+
+//---------------------------------------------------------------------------------
+//
+// Display the results. 
+// If Display type "kDataCheck" was chosen, also the reference lines are displayed.
+//
 void MJPedestal::DisplayResult(MParList &plist)
 {
@@ -480,39 +505,51 @@
 }
 
+//---------------------------------------------------------------------------------
+//
+// Try to write the created MPedestalCam in the output file. 
+// If possible, also an MBadPixelsCam and the corresponding display is written.
+//
+// In case of Storage type "kNoStorage" or if any of the containers
+// cannot be written, return kFALSE, otherwise kTRUE.
+//
 Bool_t MJPedestal::WriteResult()
 {
-    if (fPathOut.IsNull())
-        return kTRUE;
-
-    const TString oname(GetOutputFile());
-
-    *fLog << inf << "Writing to file: " << oname << endl;
-
-    TFile file(oname, "UPDATE", "File created by MJPedestal", 9);
-    if (!file.IsOpen())
-    {
-        *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
-        return kFALSE;
-    }
-
-    if (fDisplay && fDisplay->Write()<=0)
-    {
-        *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
-        return kFALSE;
-    }
-
-    if (fPedestalCam.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;
-    }
-
+  
+  if (IsNoStorage())
     return kTRUE;
+
+  if (fPathOut.IsNull())
+    return kTRUE;
+  
+  const TString oname(GetOutputFile());
+  
+  *fLog << inf << "Writing to file: " << oname << endl;
+
+  TFile file(oname, "UPDATE", "File created by MJPedestal", 9);
+  if (!file.IsOpen())
+    {
+      *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl;
+      return kFALSE;
+    }
+  
+  if (fDisplay && fDisplay->Write()<=0)
+    {
+      *fLog << err << "Unable to write MStatusDisplay to " << oname << endl;
+      return kFALSE;
+    }
+
+  if (fPedestalCam.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;
 }
 
Index: /trunk/MagicSoft/Mars/mjobs/MJPedestal.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 5232)
+++ /trunk/MagicSoft/Mars/mjobs/MJPedestal.h	(revision 5233)
@@ -23,70 +23,82 @@
 {
 private:
-    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 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     
+    
+  MRunIter   *fRuns;                                  // Used pedestal runs
+  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  fgRefPedRmsClosedLidsInner;
-    static const Float_t  fgRefPedRmsExtraGalacticInner;
-    static const Float_t  fgRefPedRmsGalacticInner;
+  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
+  Bool_t fUseData;                                    // Use data-runs from sequence instead of pedestal runs
+  
+  Bool_t ReadPedestalCam();
+  Bool_t WriteResult();
+  //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
 
-    static const Float_t  fgRefPedRmsClosedLidsOuter;
-    static const Float_t  fgRefPedRmsExtraGalacticOuter;
-    static const Float_t  fgRefPedRmsGalacticOuter;
-    
-    MRunIter   *fRuns;          // Used pedestal runs
-    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
-
-    Bool_t ReadPedestalCam();
-    Bool_t WriteResult();
-    //Bool_t WriteEventloop(MEvtLoop &evtloop) const;
-
-    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 CheckEnvLocal();
+  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);
 
-    MPedestalCam &GetPedestalCam()            { return fPedestalCam; }
-    const MBadPixelsCam &GetBadPixels() const { return fBadPixels;   }
+  MJPedestal(const char *name=NULL, const char *title=NULL);
 
-    const char*  GetOutputFile() const;
-    const Bool_t IsDataCheck  () const    { return fDataCheck; }
-    const Bool_t IsUseData    () const    { return fUseData;   }    
-
-    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 SetUseData   ( const Bool_t b=kTRUE    ) { fUseData   = b;       }
-    void SetDataCheck ( const Bool_t b=kTRUE    ) { fDataCheck = b; 
-                        b ? SetDataCheckDisplay() : SetNormalDisplay(); }
-    void SetDataCheckDisplay()                    { fDisplayType = kDataCheckDisplay; }
-    void SetNormalDisplay   ()                    { fDisplayType = kNormalDisplay;    }
-    
-    void SetPedContainerName(const char *name) { fPedestalCam.SetName(name); }
-
-    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; }
+  const Bool_t IsUseData    () const    { return fUseData;   }    
+  
+  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 SetUseData   ( const Bool_t b=kTRUE    ) { fUseData   = b;       }
+  void SetDataCheck ( const Bool_t b=kTRUE    ) { fDataCheck = b; 
+                                                  b ? SetDataCheckDisplay() : SetNormalDisplay(); }
+  void SetDataCheckDisplay()                    { fDisplayType = kDataCheckDisplay; }
+  void SetNormalDisplay   ()                    { fDisplayType = kNormalDisplay;    }
+  
+  void SetPedContainerName(const char *name)    { fPedestalCam.SetName(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)
 };
 
