Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 5801)
+++ trunk/MagicSoft/Mars/Changelog	(revision 5802)
@@ -31,5 +31,7 @@
 
    * mhcalib/MHCalibrationCam.[h,cc]
-     - add possible flag 'kInterlaced'
+     - add possible flag 'kInterlaced': default: kFALSE (like before)
+     - added pointer to MRawEvtHeader to deny cosmics events in case
+       of 'interlaced' flag is set. No changes for 'normal' calibration
 
 
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc	(revision 5801)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc	(revision 5802)
@@ -81,4 +81,5 @@
 
 #include "MRawRunHeader.h"
+#include "MRawEvtHeader.h"
 
 ClassImp(MHCalibrationCam);
@@ -113,4 +114,5 @@
 //-  SetOscillations(kTRUE);
 //-  SetSizeCheck   (kTRUE);
+//-  SetInterlaced  (kFALSE);
 //
 MHCalibrationCam::MHCalibrationCam(const char *name, const char *title)
@@ -118,5 +120,6 @@
        fHistXTitle(gsHistXTitle),fHistYTitle(gsHistYTitle), 
        fColor(MCalibrationCam::kNONE), fIntensBad(NULL),
-       fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL), fRunHeader(NULL)
+       fBadPixels(NULL), fIntensCam(NULL), fCam(NULL), fGeom(NULL), 
+       fRunHeader(NULL), fEvtHeader(NULL)
 {
 
@@ -147,4 +150,5 @@
     SetOscillations(kTRUE);
     SetSizeCheck   (kTRUE);
+    SetInterlaced  (kFALSE);
 }
 
@@ -510,14 +514,14 @@
   }
 
-  /* not needed -> Class is never used twice
-  fHiGainArray->Delete();
-  fLoGainArray->Delete();
-
-  fAverageHiGainAreas->Delete();
-  fAverageLoGainAreas->Delete();
-
-  fAverageHiGainSectors->Delete();
-  fAverageLoGainSectors->Delete();
-  */
+  fEvtHeader = (MRawEvtHeader*)pList->FindObject("MRawEvtHeader");
+  if (!fEvtHeader)
+  {
+    if (IsInterlaced())
+      {
+        *fLog << err << GetDescriptor() 
+              << ": MRawEvtHeader not found... Cannot run interlaced calibration events." << endl;
+        return kFALSE;
+      }
+  }
 
   return SetupHists(pList);
@@ -853,4 +857,8 @@
 {
 
+  if (IsInterlaced())
+    if (!(fEvtHeader->GetTriggerID() & BIT(1)))
+      return kTRUE;
+
   if (!IsSizeCheck())
     return FillHists(par,w);
@@ -1439,2 +1447,3 @@
   return rc;
 }
+
Index: trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h
===================================================================
--- trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h	(revision 5801)
+++ trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h	(revision 5802)
@@ -29,4 +29,5 @@
 class MGeomCam;
 class MRawRunHeader;
+class MRawEvtHeader;
 class MCalibrationIntensityCam;
 class MCalibrationCam;
@@ -88,4 +89,5 @@
   MGeomCam         *fGeom;               //! Camera geometry
   MRawRunHeader    *fRunHeader;          //! Run Header
+  MRawEvtHeader    *fEvtHeader;          //! Evt Header
   
   TOrdCollection *fHiGainArray;          // Array of calibration pixels, one per pixel
@@ -95,5 +97,6 @@
 
   enum { kDebug, kLoGain, kAverageing,
-         kOscillations, kSizeCheck };    // Possible flags
+         kOscillations, kSizeCheck,
+         kInterlaced };                  // Possible flags
   
   Byte_t     fFlags;                     // Bit-field to hold the flags
@@ -144,4 +147,5 @@
   Bool_t IsOscillations() const  { return TESTBIT(fFlags,kOscillations); }
   Bool_t IsSizeCheck   () const  { return TESTBIT(fFlags,kSizeCheck);    }
+  Bool_t IsInterlaced  () const  { return TESTBIT(fFlags,kInterlaced);   }
   
   void   Remove(TOrdCollection *col);
@@ -204,4 +208,7 @@
 								? SETBIT(fFlags,kSizeCheck) 
 								: CLRBIT(fFlags,kSizeCheck); }
+  void SetInterlaced              ( const Bool_t b=kTRUE ) { b 
+								? SETBIT(fFlags,kInterlaced) 
+								: CLRBIT(fFlags,kInterlaced); }
   void SetHistName  ( const char *name )  { fHistName  = name;  }
   void SetHistTitle ( const char *name )  { fHistTitle = name;  }
