Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 3198)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 3199)
@@ -30,4 +30,5 @@
 
 
+
  2004/02/16: Thomas Bretz
 
@@ -97,4 +98,24 @@
      - fixed usage of logging stream output levels
 
+   * manalysis/MPedCalcPedRun.[h,cc]:
+     - removed obsolete fSignals
+
+     - removed obsolete fNumPixels
+
+   * manalysis/MPedestalCam.h:
+     - added '->' to fArray
+
+   * mfileio/MWriteRootFile.cc:
+     - changed some output to make debugging easier
+
+   * mjobs/MJCalibration.cc:
+     - fixed a bug in drawing
+
+   * mjobs/MJExtractSignal.cc:
+     - removed MPedestalCam from MWriteRootFile output.
+       When creating the branch it crashes - reason unknown I'll
+       investigate further
+
+
 
  2004/02/16: Markus Gaug
@@ -115,7 +136,7 @@
      - changed function GetNumPixels to GetSize
 
-   * macros/bootcampstandardanalysis.C
-   * macros/pedphotcalc.C
+   * macros/bootcampstandardanalysis.C, macros/pedphotcalc.C
      - included cosmics rejection which was in MCalibrationCalc before
+
 
 
Index: /trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc	(revision 3198)
+++ /trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.cc	(revision 3199)
@@ -108,5 +108,5 @@
 //
 MPedCalcPedRun::MPedCalcPedRun(const char *name, const char *title)
-    : fRawEvt(NULL), fPedestals(NULL), fSignals(NULL)
+    : fRawEvt(NULL), fPedestals(NULL)
 {
     fName  = name  ? name  : "MPedCalcPedRun";
@@ -121,15 +121,9 @@
 void MPedCalcPedRun::Clear(const Option_t *o)
 {
-
-  fNumHiGainSamples = 0;
-  fNumPixels        = 0;
-  fNumSamplesTot    = 0;
-  
-  fRawEvt    = NULL;
-  fPedestals = NULL;
-  fSignals   = NULL;
-
-  return;
-  
+    fNumHiGainSamples = 0;
+    fNumSamplesTot    = 0;
+
+    fRawEvt    = NULL;
+    fPedestals = NULL;
 }
 
@@ -148,4 +142,6 @@
 Int_t MPedCalcPedRun::PreProcess( MParList *pList )
 {
+    Clear();
+
     fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData");
     if (!fRawEvt)
@@ -159,8 +155,4 @@
         return kFALSE;
 
-    fSignals = (MExtractedSignalCam*)pList->FindObject("MExtractedSignalCam");
-
-    fNumSamplesTot=0;
-
     return kTRUE;
 }
@@ -186,14 +178,14 @@
             return kTRUE;
 
-    fNumPixels = fPedestals->GetSize();
-
-    if(fSumx.GetSize()==0)
-      {
-	fSumx.Set(fNumPixels);
-	fSumx2.Set(fNumPixels);
+    Int_t n = fPedestals->GetSize();
+
+    if (fSumx.GetSize()==0)
+    {
+	fSumx.Set(n);
+	fSumx2.Set(n);
 
 	fSumx.Reset();
 	fSumx2.Reset();
-      }
+    }
 
     // Calculate an even number for the hi gain samples to avoid
Index: /trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.h	(revision 3198)
+++ /trunk/MagicSoft/Mars/manalysis/MPedCalcPedRun.h	(revision 3199)
@@ -1,12 +1,4 @@
 #ifndef MARS_MPedCalcPedRun
 #define MARS_MPedCalcPedRun
-
-/////////////////////////////////////////////////////////////////////////////
-//                                                                         //
-// MPedCalcPedRun                                                          //
-//                                                                         //
-// Evaluate the pedestals from pedestal runs                               //
-//                                                                         //
-/////////////////////////////////////////////////////////////////////////////
 
 #ifndef MARS_MTask
@@ -14,19 +6,18 @@
 #endif
 
+#ifndef ROOT_TArrayF
 #include <TArrayF.h>
+#endif
 
 class MRawEvtData;
 class MPedestalCam;
-class MExtractedSignalCam;
 
 class MPedCalcPedRun : public MTask
 {
-    Byte_t   fNumHiGainSamples;
-    UShort_t fNumPixels;
-    UInt_t   fNumSamplesTot;
+    Byte_t fNumHiGainSamples;
+    UInt_t fNumSamplesTot;
 
-    MRawEvtData         *fRawEvt;     // raw event data (time slices)
-    MPedestalCam        *fPedestals;  // Pedestals of all pixels in the camera
-    MExtractedSignalCam *fSignals;    // Signals of all pixels in the camera    
+    MRawEvtData  *fRawEvt;     // raw event data (time slices)
+    MPedestalCam *fPedestals;  // Pedestals of all pixels in the camera
 
     TArrayF fSumx;   // sum of values
Index: /trunk/MagicSoft/Mars/manalysis/MPedestalCam.h
===================================================================
--- /trunk/MagicSoft/Mars/manalysis/MPedestalCam.h	(revision 3198)
+++ /trunk/MagicSoft/Mars/manalysis/MPedestalCam.h	(revision 3199)
@@ -13,40 +13,39 @@
 class MGeomCam;
 class MPedestalPix;
+
 class MPedestalCam : public MCamEvent, public MParContainer
 {
 private:
+    TClonesArray *fArray;  //-> FIXME: Change TClonesArray away from a pointer?
+    UInt_t fTotalEntries;  // Total number of times, the Process was executed (to estimate the error of pedestal)
 
-  TClonesArray *fArray;  // FIXME: Change TClonesArray away from a pointer?
-  UInt_t fTotalEntries;  // Total number of times, the Process was executed (to estimate the error of pedestal)
-  
 public:
-  MPedestalCam(const char *name=NULL, const char *title=NULL);
-  ~MPedestalCam();
-  
-  void Clear(Option_t *o="");
-  
-  void InitSize(const UInt_t i);
-  
-  MPedestalPix &operator[](Int_t i);
-  const MPedestalPix &operator[](Int_t i) const;
+    MPedestalCam(const char *name=NULL, const char *title=NULL);
+    ~MPedestalCam();
 
-  // Setters
-  void SetTotalEntries(const UInt_t n)    { fTotalEntries = n; }
+    void Clear(Option_t *o="");
 
-  // Getters
-  UInt_t GetSize()                          const;
-  UInt_t GetTotalEntries()                  const { return fTotalEntries; }
+    void InitSize(const UInt_t i);
 
-  Float_t GetPedestalMin(const MGeomCam *cam) const;
-  Float_t GetPedestalMax(const MGeomCam *cam) const;
-  
-  void Print(Option_t *o="") const;
-  
-  Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
-  void DrawPixelContent(Int_t idx) const;
-  
-  ClassDef(MPedestalCam, 1)	// Storage Container for all pedestal information of the camera
+    MPedestalPix &operator[](Int_t i);
+    const MPedestalPix &operator[](Int_t i) const;
+
+    // Setters
+    void SetTotalEntries(const ULong_t n) { fTotalEntries = n; }
+
+    // Getters
+    Int_t   GetSize()         const;
+    ULong_t GetTotalEntries() const { return fTotalEntries; }
+
+    Float_t GetPedestalMin(const MGeomCam *cam) const;
+    Float_t GetPedestalMax(const MGeomCam *cam) const;
+
+    void Print(Option_t *o="") const;
+
+    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
+    void DrawPixelContent(Int_t idx) const;
+
+    ClassDef(MPedestalCam, 1)	// Storage Container for all pedestal information of the camera
 };
 
 #endif
-
Index: /trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc
===================================================================
--- /trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 3198)
+++ /trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc	(revision 3199)
@@ -357,4 +357,6 @@
         // The containers should be written in Splitlevel=1
         //
+        *fLog << inf << "Creating Branch " << cname << " of " << cont->ClassName() << "... " << flush;
+
         TString branchname(cname);
         branchname.Append(".");
@@ -366,8 +368,11 @@
         if (!branch)
         {
+            *fLog << endl;
             *fLog << err << "Unable to create branch '" << cname << "'." << endl;
             return kFALSE;
         }
 
+        *fLog << "done." << endl;
+
         //
         // Tell the entry also which branch belongs to it (this is necessary
@@ -375,5 +380,4 @@
         //
         entry->SetBranch(branch);
-        *fLog << inf << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;
     }
     return kTRUE;
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 3198)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibration.cc	(revision 3199)
@@ -204,24 +204,23 @@
 
     // Create histograms to display
-    MHCamera disp1  (geomcam, "Cal;Charge",         "Fitted Mean Charges");
-    MHCamera disp2  (geomcam, "Cal;SigmaCharge",    "Sigma of Fitted Charges");
-    MHCamera disp3  (geomcam, "Cal;FitProb",        "Probability of Fit");
-    MHCamera disp4  (geomcam, "Cal;RSigma",         "Reduced Sigmas");
-    MHCamera disp5  (geomcam, "Cal;RSigma/Charge",  "Reduced Sigma per Charge");
-    MHCamera disp6  (geomcam, "Cal;FFactorPhe",     "Nr. of Phe's (F-Factor Method)");
-    MHCamera disp7  (geomcam, "Cal;FFactorConv",    "Conversion Factor (F-Factor Method)");
-    MHCamera disp8  (geomcam, "Cal;FFactorFFactor", "Total F-Factor (F-Factor Method)");
-    MHCamera disp9  (geomcam, "Cal;BlindPixPh",     "Photon flux inside plexiglass (Blind Pixel Method)");
-    MHCamera disp10 (geomcam, "Cal;BlindPixConv",   "Conversion Factor (Blind Pixel Method)");
-    MHCamera disp11 (geomcam, "Cal;BlindPixFFactor","Total F-Factor (Blind Pixel Method)");
-    MHCamera disp12 (geomcam, "Cal;PINDiodePh",     "Photons flux outside plexiglass (PIN Diode Method)");
-    MHCamera disp13 (geomcam, "Cal;PINDiodeConv",   "Conversion Factor (PIN Diode Method)");
-    MHCamera disp14 (geomcam, "Cal;PINDiodeFFactor","Total F-Factor (PIN Diode Method)");
-    MHCamera disp15 (geomcam, "Cal;Excluded",       "Pixels previously excluded");
-    MHCamera disp16 (geomcam, "Cal;NotFitted",      "Pixels that could not be fitted");
-    MHCamera disp17 (geomcam, "Cal;NotFitValid",    "Pixels with not valid fit results");
-    MHCamera disp18 (geomcam, "Cal;Oscillation",    "Oscillating Pixels");
-    MHCamera disp19 (geomcam, "Cal;Saturation",     "Pixels with saturated Hi Gain");
-
+    MHCamera disp1 (geomcam, "Cal;Charge",         "Fitted Mean Charges");
+    MHCamera disp2 (geomcam, "Cal;SigmaCharge",    "Sigma of Fitted Charges");
+    MHCamera disp3 (geomcam, "Cal;FitProb",        "Probability of Fit");
+    MHCamera disp4 (geomcam, "Cal;RSigma",         "Reduced Sigmas");
+    MHCamera disp5 (geomcam, "Cal;RSigma/Charge",  "Reduced Sigma per Charge");
+    MHCamera disp6 (geomcam, "Cal;FFactorPhe",     "Nr. of Phe's (F-Factor Method)");
+    MHCamera disp7 (geomcam, "Cal;FFactorConv",    "Conversion Factor (F-Factor Method)");
+    MHCamera disp8 (geomcam, "Cal;FFactorFFactor", "Total F-Factor (F-Factor Method)");
+    MHCamera disp9 (geomcam, "Cal;BlindPixPh",     "Photon flux inside plexiglass (Blind Pixel Method)");
+    MHCamera disp10(geomcam, "Cal;BlindPixConv",   "Conversion Factor (Blind Pixel Method)");
+    MHCamera disp11(geomcam, "Cal;BlindPixFFactor","Total F-Factor (Blind Pixel Method)");
+    MHCamera disp12(geomcam, "Cal;PINDiodePh",     "Photons flux outside plexiglass (PIN Diode Method)");
+    MHCamera disp13(geomcam, "Cal;PINDiodeConv",   "Conversion Factor (PIN Diode Method)");
+    MHCamera disp14(geomcam, "Cal;PINDiodeFFactor","Total F-Factor (PIN Diode Method)");
+    MHCamera disp15(geomcam, "Cal;Excluded",       "Pixels previously excluded");
+    MHCamera disp16(geomcam, "Cal;NotFitted",      "Pixels that could not be fitted");
+    MHCamera disp17(geomcam, "Cal;NotFitValid",    "Pixels with not valid fit results");
+    MHCamera disp18(geomcam, "Cal;Oscillation",    "Oscillating Pixels");
+    MHCamera disp19(geomcam, "Cal;Saturation",     "Pixels with saturated Hi Gain");
 
     // Fitted charge means and sigmas
@@ -272,23 +271,22 @@
     disp19.SetCamContent(fCalibrationCam,31);
 
-
-    disp1.SetYTitle("Charge [FADC units]");
-    disp2.SetYTitle("\\sigma_{Charge} [FADC units]");
-    disp3.SetYTitle("P_{Charge} [1]");
-
-    disp4.SetYTitle("\\sqrt{\\sigma^{2}_{Charge} - RMS^{2}_{Ped}} [FADC Counts]");
-    disp5.SetYTitle("Reduced Sigma / Mean Charge [1]");
-
-    disp6.SetYTitle("Nr. Photo-Electrons [1]");
-    disp7.SetYTitle("Conversion Factor [PhE/FADC Count]");
-    disp8.SetYTitle("\\sqrt{N_{PhE}}*\\sigma_{Charge}/\\mu_{Charge} [1]");
-
-    disp9.SetYTitle("Photon flux [ph/mm^2]");
-    disp10.SetYTitle("Conversion Factor [Phot/FADC Count]");
-    disp11.SetYTitle("\\sqrt{N_{Ph}}*\\sigma_{Charge}/\\mu_{Charge} [1]");
-
-    disp12.SetYTitle("Photon flux [ph/mm^2]");
-    disp13.SetYTitle("Conversion Factor [Phot/FADC Count]");
-    disp14.SetYTitle("\\sqrt{N_{Ph}}*\\sigma_{Charge}/\\mu_{Charge} [1]");
+    disp1.SetYTitle("Q [FADC units]");
+    disp2.SetYTitle("\\sigma_{Q} [FADC units]");
+    disp3.SetYTitle("P_{Q} [1]");
+
+    disp4.SetYTitle("\\sqrt{\\sigma^{2}_{Q} - RMS^{2}_{Ped}} [FADC Counts]");
+    disp5.SetYTitle("Red.Sigma/<Q> [1]");
+
+    disp6.SetYTitle("PhE [#]");
+    disp7.SetYTitle("Conv.Factor [PhE/FADC units]");
+    disp8.SetYTitle("\\sqrt{N_{PhE}}*\\sigma_{Q}/\\mu_{Q} [1]");
+
+    disp9.SetYTitle("Phot.flux [ph/mm^{2}]");
+    disp10.SetYTitle("Conv.Factor [Phot/FADC Count]");
+    disp11.SetYTitle("\\sqrt{N_{Ph}}*\\sigma_{Q}/\\mu_{Q} [1]");
+
+    disp12.SetYTitle("Phot.flux [ph/mm^{2}]");
+    disp13.SetYTitle("Conv.Factor [Phot/FADC Count]");
+    disp14.SetYTitle("\\sqrt{N_{Ph}}*\\sigma_{Q}/\\mu_{Q} [1]");
 
     disp15.SetYTitle("[1]");
@@ -357,6 +355,5 @@
     c8.Divide(1,3);
 
-    CamDraw(c8, 1, 4, disp19, 0);
-
+    CamDraw(c8, 1, 1, disp19, 0);
 }
 
@@ -495,6 +492,6 @@
     // when the calibration hardware-trigger is working)
     // 
-    MFCosmics            cosmics;
-    MContinue            cont(&cosmics);
+    MFCosmics cosmics;
+    MContinue cont(&cosmics);
 
     //
Index: /trunk/MagicSoft/Mars/mjobs/MJExtractSignal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJExtractSignal.cc	(revision 3198)
+++ /trunk/MagicSoft/Mars/mjobs/MJExtractSignal.cc	(revision 3199)
@@ -298,15 +298,23 @@
     *fLog << endl;
 
+    // Setup Lists
+    MParList plist;
+    plist.AddToList(&pedcam);
+
+    MTaskList tlist;
+    plist.AddToList(&tlist);
+
+    // Setup Parameters
+
+    // Make sure, that at least an empty MBadPixelsCam is available
+    // This is necessary for input which don't contain a MBadPixelsCam
+    MBadPixelsCam badcam;
+    plist.AddToList(&badcam);
+
+    // Setup Task-lists
     MReadMarsFile read("Events");
     read.DisableAutoScheme();
     static_cast<MRead&>(read).AddFiles(*fRuns);
 
-    // Setup Tasklist
-    MParList plist;
-    plist.AddToList(&pedcam);
-
-    MTaskList tlist;
-    plist.AddToList(&tlist);
-
     MGeomApply      apply; // Only necessary to craete geometry
     MBadPixelsMerge merge(&fBadPixels);
@@ -320,6 +328,6 @@
     write.AddContainer("MExtractedSignalCam", "Events");
     write.AddContainer("MTime",               "Events");
+    // FIXME: CRAHSES! write.AddContainer("MPedestalCam",        "RunHeaders");
     write.AddContainer("MRawRunHeader",       "RunHeaders");
-    write.AddContainer("MPedestalCam",        "RunHeaders");
     write.AddContainer("MBadPixelsCam",       "RunHeaders");
 
