Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 6347)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 6351)
@@ -35,5 +35,5 @@
 #include "TArrayC.h"
 #include "TObjArray.h"
-                                                         
+                                               
 #include "MTrigger.hxx"
 #include "MFadc.hxx"
@@ -61,4 +61,5 @@
 #include "MGeomPix.h"
 #include "MGeomCorsikaCT.h"
+#include "MTriggerPattern.h"
 
 /*!@" 
@@ -2277,5 +2278,6 @@
 				    EvtHeader[iconcount]->
 				      FillHeader( (UInt_t) (ntshow + nshow),0);
-
+				    EvtHeader[iconcount]->
+				      SetTriggerPattern((UInt_t)MTriggerPattern::kTriggerLvl1);
 				    //   fill pixel information
 				    if (Lev1 || Write_All_Images){
@@ -2534,5 +2536,6 @@
 		EvtHeader[ict]
 		  ->FillHeader ( (UInt_t) (ntshow + nshow) , 0 ) ; 
-	      
+		EvtHeader[ict]->SetTriggerPattern((UInt_t)MTriggerPattern::kTriggerLvl1);
+
 		//   fill pixel information
 	      
@@ -4698,4 +4701,17 @@
 	  EvtHeader[ict]->FillHeader((UInt_t) calevent, 0);
 
+	  // Set flag to indicate this is a calibration or a pedestal run:
+	  if (phot_per_pix > 1.e-3)
+	    {
+	      EvtHeader[ict]->SetTriggerPattern((UInt_t)(MTriggerPattern::kCalibration |
+	      MTriggerPattern::kTriggerLvl1));
+	      //
+	      // FIXME! For now color and intensity of the pulser is fixed!
+	      EvtHeader[ict]->SetCalibrationPattern((UInt_t)((BIT(11) | BIT(12))<<16));
+	    }
+	  else  // 0 cal. photons per pixel ==> pedestal run
+	    EvtHeader[ict]->SetTriggerPattern((UInt_t)MTriggerPattern::kPedestal);
+
+
 	  McEvt[ict]->Fill( 0, 0, 0., -1.0, -1.0, -1.0, 0., 0., 0., 0., 0.,
 			    0., 0., 0., 0., 0., 0., 0., 0.,
@@ -4966,5 +4982,11 @@
 //
 // $Log: not supported by cvs2svn $
-// Revision 1.84  2004/12/15 01:56:39  MAGIC
+// Revision 1.85  2005/02/10 12:00:32  moralejo
+//
+//  Changed call to EvtHeader[ict]->FillHeader in line 2535: second argument
+//  was 20, and I set it now to 0. No idea why that was 20: like that, it was
+//  setting a CL trigger pattern on all events (???!!!)
+//
+// Revision 1.84  2004/12/15 01:56:39  moralejo
 //
 //  Added input card option pmt_jitter_ns to simulate the time jitter of
