Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9236)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9237)
@@ -60,5 +60,7 @@
    * msimreflector/MMirror.[h,cc], msimreflector/MMirrorHex.[h,cc],
      msimreflector/MMirrorSquare.[h,cc], msimreflector/MMirrorDisk.[h,cc],
-     msimreflector/MReflector.[h,cc], msimreflector/MSimReflector.[h,cc]:
+     msimreflector/MReflector.[h,cc], msimreflector/MSimReflector.[h,cc],
+     msimreflector/SimReflectorLinkDef.h, msimreflector/SimReflectorIncl.h,
+     msimreflector/Makefile:
      - added
 
Index: trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 9236)
+++ trunk/MagicSoft/Mars/mbase/BaseLinkDef.h	(revision 9237)
@@ -30,4 +30,5 @@
 #pragma link C++ class MSpline3+;
 #pragma link C++ class MQuaternion+;
+#pragma link C++ class MReflection+;
 
 #pragma link C++ class MString+;
Index: trunk/MagicSoft/Mars/mbase/MReflection.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReflection.cc	(revision 9237)
+++ trunk/MagicSoft/Mars/mbase/MReflection.cc	(revision 9237)
@@ -0,0 +1,41 @@
+/* ======================================================================== *\
+!
+! *
+! * This file is part of MARS, the MAGIC Analysis and Reconstruction
+! * Software. It is distributed to you in the hope that it can be a useful
+! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+! * It is distributed WITHOUT ANY WARRANTY.
+! *
+! * Permission to use, copy, modify and distribute this software and its
+! * documentation for any purpose is hereby granted without fee,
+! * provided that the above copyright notice appear in all copies and
+! * that both that copyright notice and this permission notice appear
+! * in supporting documentation. It is provided "as is" without express
+! * or implied warranty.
+! *
+!
+!
+!   Author(s): Thomas Bretz  11/2008 <mailto:tbretz@astro.uni-wuerzburg.de>
+!
+!   Copyright: Software Development, 2000-2009
+!
+!
+\* ======================================================================== */
+
+//////////////////////////////////////////////////////////////////////////////
+//
+//  MReflection
+//
+// This is a fast way to create a rotation matrix which rotates a vector
+// by 180deg around another vector (normal vector of a reflection)
+// and changes its direction. This is nothing else than a reflection
+// on a surface.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include "MReflection.h"
+
+
+ClassImp(MReflection);
+
+using namespace std;
+
Index: trunk/MagicSoft/Mars/mbase/MReflection.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MReflection.h	(revision 9237)
+++ trunk/MagicSoft/Mars/mbase/MReflection.h	(revision 9237)
@@ -0,0 +1,63 @@
+#ifndef MARS_MReflection
+#define MARS_MReflection
+
+#ifndef ROOT_TRotation
+#include <TRotation.h>
+#endif
+
+class MReflection : public TRotation
+{
+private:
+    MReflection(Double_t a, Double_t b, Double_t c,
+                Double_t d, Double_t e, Double_t f,
+                Double_t g, Double_t h, Double_t i)
+        : TRotation(a,b,c,d,e,f,g,h,i) { }
+
+    void Init(Double_t x, Double_t y, Double_t z)
+    {
+        // Normalize components of vector (including factor 2!)
+        const Double_t n = -2./(x*x + y*y + z*z);
+
+        // Expressed by the focal length
+        //const Double_t n = -1./(2*F*F);
+
+        // Construct rotation matrix to rotate the photon direction
+        // around the axis defined by the normal vector. (This is
+        // a simplified version of TVector3::Rotate(double, TVector3&)
+        // The minus-sign does the relfection, i.e. flips the
+        // direction of the vector.
+        static_cast<TRotation&>(*this) =
+            MReflection(
+                        1+n*x*x,   n*y*x,   n*z*x,
+                          n*x*y, 1+n*y*y,   n*z*y,
+                          n*x*z,   n*y*z, 1+n*z*z
+                       );
+
+        //
+        //  n = ( x / y (UInt_t)-1;/ z )  // Normalenvektor
+        //  V = ( X / Y / Z )  // Photon to be reflected
+        //
+        //  nV := -2 * ( x*X + y*Y + z*Z ) / ( x*x + y*y + z*z )
+        //
+        //  V' = nV * vec(n) + vec(V)
+        //
+
+        // return TVector2(X/Z, Y/Z);
+    }
+
+public:
+    // Normal vector of the reflecting surface
+    MReflection(const TVector3 &v)
+    {
+        Init(v.X(), v.Y(), v.Z());
+    }
+    // Normal vector of the reflecting surface
+    MReflection(Double_t x, Double_t y, Double_t z)
+    {
+        Init(x, y, z);
+    }
+
+    ClassDef(MReflection, 0) // A TRotation derivative describing the reflection by the normal vector of the surface
+};
+
+#endif
Index: trunk/MagicSoft/Mars/mbase/Makefile
===================================================================
--- trunk/MagicSoft/Mars/mbase/Makefile	(revision 9236)
+++ trunk/MagicSoft/Mars/mbase/Makefile	(revision 9237)
@@ -24,4 +24,5 @@
            MMath.cc \
            MSpline3.cc \
+           MReflection.cc \
 	   MQuaternion.cc \
            MEnv.cc \
Index: trunk/MagicSoft/Mars/msimreflector/Makefile
===================================================================
--- trunk/MagicSoft/Mars/msimreflector/Makefile	(revision 9237)
+++ trunk/MagicSoft/Mars/msimreflector/Makefile	(revision 9237)
@@ -0,0 +1,37 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+include ../Makefile.conf.$(OSTYPE)
+include ../Makefile.conf.general
+
+#------------------------------------------------------------------------------
+
+#
+# Handling name of the Root Dictionary Files
+#
+CINT  = SimReflector
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I. -I../mbase -I../mhbase -I../mcorsika -I../msim -I../mpointing \
+	   -I../mmc -I../mgui -I../mgeom
+
+SRCFILES = MSimReflector.cc \
+	   MReflector.cc \
+	   MMirror.cc \
+	   MMirrorSquare.cc \
+	   MMirrorHex.cc \
+	   MMirrorDisk.cc
+
+############################################################
+
+all: $(OBJS)
+
+include ../Makefile.rules
+
+mrproper:	clean rmbak
Index: trunk/MagicSoft/Mars/msimreflector/SimReflectorIncl.h
===================================================================
--- trunk/MagicSoft/Mars/msimreflector/SimReflectorIncl.h	(revision 9237)
+++ trunk/MagicSoft/Mars/msimreflector/SimReflectorIncl.h	(revision 9237)
@@ -0,0 +1,3 @@
+#ifndef __CINT__
+
+#endif // __CINT__
Index: trunk/MagicSoft/Mars/msimreflector/SimReflectorLinkDef.h
===================================================================
--- trunk/MagicSoft/Mars/msimreflector/SimReflectorLinkDef.h	(revision 9237)
+++ trunk/MagicSoft/Mars/msimreflector/SimReflectorLinkDef.h	(revision 9237)
@@ -0,0 +1,15 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MSimReflector+;
+
+#pragma link C++ class MReflector+;
+#pragma link C++ class MMirror+;
+#pragma link C++ class MMirrorSquare+;
+#pragma link C++ class MMirrorDisk+;
+#pragma link C++ class MMirrorHex+;
+
+#endif
