Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 3733)
+++ trunk/MagicSoft/Mars/Changelog	(revision 3734)
@@ -18,4 +18,27 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2004/04/14: Thomas Bretz
+
+   * manalysis/MCerPhotEvt.[h,cc]:
+     - fixed a bug which caused a missing last pixel (in most cases
+       Index 576)
+
+   * manalysis/MCerPhotPix.cc:
+     - fixed output in Print
+
+   * macros/mccalibrate.C, mmain/MEventDisplay.cc:
+     - added missing SetCalibrationMethod
+
+   * mbadpixels/MBadPixelsCam.[h,cc]:
+     - added copy constructor
+
+   * mbadpixels/MBadPixelsMerge.cc:
+     - added comments
+
+   * mraw/MRawRunHeader.[h,cc]:
+     - added new run-type (kRTPointRun=7)
+
+
+
  2004/04/14: Markus Gaug
   
@@ -40,4 +63,5 @@
 
 
+
  2004/04/13: Markus Gaug
 
@@ -78,11 +102,10 @@
      - set the possibility to choose different displays
  
-
    * mcalib/MCalibrationChargeCalc.cc
      - set the pulser colour (now obligatory)
 
-
    * mcalib/MCalibrationChargePix.[h,cc]
      - put GetRSigmaPerCharge into this class
+
 
 
Index: trunk/MagicSoft/Mars/macros/mccalibrate.C
===================================================================
--- trunk/MagicSoft/Mars/macros/mccalibrate.C	(revision 3733)
+++ trunk/MagicSoft/Mars/macros/mccalibrate.C	(revision 3734)
@@ -101,4 +101,5 @@
 
   MCalibrate calib; // Transforms signals from ADC counts into photons.
+  calib.SetCalibrationMethod(MCalibrate::kDummy);
 
   //    MBlindPixelCalc   blind;
@@ -169,4 +170,6 @@
     }
 
+  calib.SetCalibrationMethod(MCalibrate::kFfactor);
+
   //
   // Second loop: analysis loop
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 3733)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc	(revision 3734)
@@ -96,6 +96,6 @@
 void MCerPhotEvt::Reset()
 {
-    fNumPixels = 0;
-    fMaxIndex  = 0;
+    fNumPixels =  0;
+    fMaxIndex  = -1;
     fLut.Set(0);
     // fPixels->Delete();
@@ -104,5 +104,5 @@
 void MCerPhotEvt::FixSize()
 {
-    fLut.Set(fMaxIndex);
+    fLut.Set(fMaxIndex+1);
 
     if (fPixels->GetEntriesFast() == (Int_t)fNumPixels)
@@ -401,6 +401,6 @@
 
         fLut[idx] = fNumPixels;
-        if ((UInt_t)idx>fMaxIndex)
-            fMaxIndex=(UInt_t)idx;
+        if (idx>fMaxIndex)
+            fMaxIndex=idx;
 
         return new ((*fPixels)[fNumPixels++]) MCerPhotPix(idx, nph, er);
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 3733)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h	(revision 3734)
@@ -24,5 +24,5 @@
 private:
     UInt_t        fNumPixels;
-    UInt_t        fMaxIndex;
+     Int_t        fMaxIndex;
     TArrayI       fLut;        // Lookup tabel to lookup pixel by index
     TClonesArray *fPixels;     //-> FIXME: Change TClonesArray away from a pointer?
Index: trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc
===================================================================
--- trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 3733)
+++ trunk/MagicSoft/Mars/manalysis/MCerPhotPix.cc	(revision 3734)
@@ -73,6 +73,6 @@
     gLog << (fRing>0?"   Used ":" Unused ");
     gLog << (fIsCore?" Core ":"      ");
-    gLog << "High gain " << (fIsHGSaturated?"   ":"not") << " saturated";
-    gLog << (fIsSaturated?"   ":"Not") << " saturated";
-    gLog << " Nphot= " << fPhot << " Error(Nphot)=" << fErrPhot << endl;
+    gLog << (fIsSaturated?"   ":"not") << " saturated ";
+    gLog << "High gain " << (fIsHGSaturated?"   ":"not") << " saturated ";
+    gLog << "Nphot= " << fPhot << " Error(Nphot)=" << fErrPhot << endl;
 }
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc	(revision 3733)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc	(revision 3734)
@@ -53,7 +53,16 @@
 {
     fName  = name  ? name  : "MBadPixelsCam";
-    fTitle = title ? title : "";
+    fTitle = title ? title : "Storage container to store bad pixel information";
 
     fArray = new TClonesArray("MBadPixelsPix", 1);
+}
+
+MBadPixelsCam::MBadPixelsCam(const MBadPixelsCam &cam)
+{
+    fName  = "MBadPixelsCam";
+    fTitle = "Storage container to store bad pixel information";
+
+    fArray = new TClonesArray("MBadPixelsPix", 1);
+    cam.Copy(*fArray);
 }
 
@@ -342,89 +351,67 @@
       val = (*this)[idx].GetInfo()[0];
       return (*this)[idx].IsOK();
-      break;
     case 1:
       val = (*this)[idx].IsUnsuitable(MBadPixelsPix::kUnsuitableRun);
       return val;
-      break;
     case 2:
       val = (*this)[idx].IsUnsuitable(MBadPixelsPix::kUnsuitableEvt);
       return val;
-      break;
     case 3:
       val = (*this)[idx].IsUnsuitable(MBadPixelsPix::kUnreliableRun);
       return val;
-      break;
     case 4:
       val = (*this)[idx].IsHiGainBad();
       return val;
-      break;
     case 5:
       val = (*this)[idx].IsLoGainBad();
       return val;
-      break;
     case 6:
       val = !(*this)[idx].IsCalibrationSignalOK();
       return val;
-      break;
     case 7:
       val = !(*this)[idx].IsCalibrationResultOK(); 
       return val;
-      break;
     case 8:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainNotFitted);
       return val;
-      break;
     case 9:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainNotFitted);
       return val;
-      break;
     case 10:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kHiGainOscillating);
       return val;
-      break;
     case 11:
      val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainOscillating);
       return val;
-      break;
     case 12:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kLoGainSaturation );
       return val;
-      break;
     case 13:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeIsPedestal );
       return val;
-      break;
     case 14:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeErrNotValid);
       return val;
-      break;
     case 15:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeRelErrNotValid);
       return val;
-      break;
     case 16:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kChargeSigmaNotValid );
       return val;
-      break;
     case 17:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInFirstBin  );
       return val;
-      break;
     case 18:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kMeanTimeInLast2Bins );
       return val;
-      break;
     case 19:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kDeviatingNumPhes    );
       return val;
-      break;
     case 20:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kRelTimeNotFitted );
       return val;
-      break;
     case 21:
       val = (*this)[idx].IsUncalibrated(MBadPixelsPix::kRelTimeOscillating  );
       return val;
-      break;
     default:
       return kFALSE;
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.h
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.h	(revision 3733)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.h	(revision 3734)
@@ -19,4 +19,5 @@
 public:
     MBadPixelsCam(const char *name=NULL, const char *title=NULL);
+    MBadPixelsCam(const MBadPixelsCam &cam);
     ~MBadPixelsCam();
 
Index: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsMerge.cc
===================================================================
--- trunk/MagicSoft/Mars/mbadpixels/MBadPixelsMerge.cc	(revision 3733)
+++ trunk/MagicSoft/Mars/mbadpixels/MBadPixelsMerge.cc	(revision 3734)
@@ -26,4 +26,5 @@
 //
 //  MBadPixelsMerge
+//  ===============
 //
 //  Merges in ReInit two bad pixel containers together:
@@ -33,4 +34,24 @@
 //      into the container given in the constructor. While the contents
 //      to which 1) refers are still untouched.
+//
+//
+// An explanation taken from Mantis:
+// --------------------------------
+// In my eyes everything works a supposed to do. We have different sources
+// for bad-pixels, eg from Pedestal calculation, from the calibration
+// constant calculation, manual setting and so on. If processing data we
+// have to take care of all this different sources. Therefor we have to
+// store the bad pixels from this sources (eg. from calibration). In
+// addition MBadPixelsCam is read from the file containing the data (once
+// per file). Now always after a new (data-)file has been opened the bad
+// pixels from (for example) the calibration file have to be merged into
+// the container loaded from the (data-)file which is stored in the
+// parameter list. Copying the pointer would totally overwrite the pixels
+// loaded (automatically by MReadMarsFile) from the data-file. All this is
+// done using a copy of the original MBadPixelsCam (fSource). In addition
+// fDest is initialized to the pointer given as argument to the
+// constructor. To keep track of all bad pixels the instance this pointer
+// is pointing to is used to collect all bad pixels used so far.
+//
 //
 //  Input Containers:
@@ -69,6 +90,5 @@
     fTitle = title ? title : fgDefTitle.Data();
 
-    fSource = new MBadPixelsCam;
-    bad->Copy(*fSource);
+    fSource = new MBadPixelsCam(*bad);
 }
 
Index: trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 3733)
+++ trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 3734)
@@ -243,5 +243,5 @@
     MCerPhotAnal2     *nanal = new MCerPhotAnal2;
     MFillH            *fill1 = new MFillH(evt1, "MCerPhotEvt", "MFillH1");
-    MImgCleanStd      *clean = new MImgCleanStd;
+    MImgCleanStd      *clean = new MImgCleanStd(6.5, 6.5);
     MFillH            *fill2 = new MFillH(evt2, "MCerPhotEvt", "MFillH2");
     MFillH            *fill3 = new MFillH(evt3, "MPedPhotCam", "MFillH3");
@@ -271,4 +271,5 @@
 
         MCalibrate* mccal = new MCalibrate;
+        mccal->SetCalibrationMethod(MCalibrate::kDummy);
 
         // MC
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 3733)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc	(revision 3734)
@@ -190,4 +190,6 @@
     case kRTCalibration:
         return "Calibration";
+    case kRTPointRun:
+        return "Point-Run";
     case kRTMonteCarlo:
         return "Monte Carlo";
Index: trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 3733)
+++ trunk/MagicSoft/Mars/mraw/MRawRunHeader.h	(revision 3734)
@@ -25,4 +25,5 @@
         kRTPedestal    = 0x0001,
         kRTCalibration = 0x0002,
+        kRTPointRun    = 0x0007,
         kRTMonteCarlo  = 0x0100,
         kRTNone        = 0xffff
