Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2131)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2132)
@@ -1,3 +1,16 @@
                                                  -*-*- END OF LINE -*-*-
+
+
+
+ 2003/05/22: Wolfgang Wittek
+
+   * mfileio/MCT1ReadPreProc.[h,cc]
+     - add member function DiscreteTheta
+     - discretize the Theta according to the binning in Theta
+       (for data and MC)
+       original Theta is stored in the container "ThetaOrig"
+       the discretized Theta is stored in MMcEvt.fTelescopeTheta
+
+
  2003/05/21: Thomas Bretz
 
Index: trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc	(revision 2131)
+++ trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc	(revision 2132)
@@ -832,4 +832,27 @@
 // --------------------------------------------------------------------------
 //
+// Discretize Theta according to the binning in Theta
+//   theta [rad]
+//   DiscreteTheta [rad]  (= bin center)
+//
+Double_t MCT1ReadPreProc::DiscreteTheta(Double_t theta)
+{
+    if (!fBinningT)
+        return theta;
+
+    const Int_t bin = fBinningT->FindLoEdge(theta * 180/TMath::Pi());
+    if (bin<0)
+        return theta;
+
+    const Double_t low = fBinningT->GetEdges()[bin];
+    const Double_t up  = fBinningT->GetEdges()[bin+1];
+
+    Double_t discreteTheta = 0.5*(up+low) * TMath::Pi()/180;
+
+    return discreteTheta;
+}
+
+// --------------------------------------------------------------------------
+//
 // Analyse the event data, means store and copy the needed data into
 // Mars structures and data members
@@ -921,11 +944,4 @@
     const Double_t theta = TMath::Pi()*(0.5-1./180*event.ialt_arcs/3600);
     fThetaOrig->SetVal(theta);
-
-    //if (theta>TMath::Pi()/2)
-    //{
-    //    *fLog << "MCT1ReadPreProc::ProcessEvent; theta out of range : "
-    //          << theta << endl;
-    //    return kCONTINUE;
-    //}
 
     // store hour angle
@@ -948,5 +964,6 @@
                  fIsMcFile ? event.imcimpact_m*100 : 0,
                  TMath::Pi()/180*event.iaz_arcs/3600, // azimuth (arcseconds)
-                 fIsMcFile ? SmearTheta(theta) : theta,
+		 // fIsMcFile ? SmearTheta(theta) : theta,
+                 DiscreteTheta(theta),
                  0, /* fTFirst */
 		 0, /* fTLast */
Index: trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h
===================================================================
--- trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h	(revision 2131)
+++ trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h	(revision 2132)
@@ -72,4 +72,5 @@
 
     Double_t SmearTheta(Double_t theta);
+    Double_t DiscreteTheta(Double_t theta);
 
     Bool_t PreProcess(MParList *pList);
