Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 9284)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 9285)
@@ -27,4 +27,11 @@
      - extended loop to show all periods again
 
+   * msim/MPhotonData.cc:
+     - don't change the sign of the cosines. The direction of the
+       particle doesn't neet to be changed
+
+   * msimreflector/MSimReflector.cc:
+     - change the rotation matrix to fit the change in MPhotonData
+
 
 
@@ -298,3 +305,296 @@
      msimreflector/MMirrorHex.cc, msimreflector/MMirrorSquare.[h,cc],
      msimreflector/MReflector.cc, msimreflector/MSimReflector.cc,
- 
+     melectronics/MAnalogSignal.cc:
+     - moved code which needs TMath to source file
+     - included TMath for newer root versions
+     - included TObjArray for newer root versions
+
+   * msimcamera/MSimAPD.[h,cc], msimcamera/MSimBundlePhotons.[h,cc], 
+     msimcamera/MSimRandomPhotons.[h,cc]:
+     - added
+
+   * melectronics/Makefile, melectronics/MAnalogChannels.[h,cc],
+     melectronics/ElectronicsIncl.h, melectronics/ElectronicsLinkDef.h, 
+     melectronics/MDigitalSignal.[h,cc],  
+     melectronics/MAnalogSignal.[h,cc], 
+     melectronics/MAvalanchePhotoDiode.[h,cc]:
+     - added
+
+   * msim/M*.cc, msimreflector/M*.cc, msimcamera/M*.cc:
+     - changed copyright notice
+
+   * mjobs/MJob.[h,cc]:
+     - for convinience replaced GetEnvValue by GetEnvValue2
+     - added initialization of the random number generator
+
+   * ceres.cc, mcorsika/CorsikaIncl.h:
+     - added
+
+
+
+ 2009/01/22 Thomas Bretz
+
+   * mraw/MRawRunHeader.h:
+     - added new functions to access the runtype
+
+   * msim/MPhotonData.cc:
+     - removed some obsolete comments
+
+   * msim/MPhotonEvent.[h,cc]
+     - added some comments
+     - added new member function GetFirst and GetLast
+     - UnSort the array after reading new data
+     - removed some old obsolete code
+     - added new meber function Sort and IsSorted
+
+   * msimreflector/MSimReflector.cc:
+     - force sorting of the array
+
+  * msimcamera/MSimPSF.[h,cc], msimcamera/MSimGeomCam.[h,cc], 
+    msimcamera/MSimExcessNoise.[h,cc], msimcamera/MSimSignalCam.[h,cc]:
+    - added
+
+
+
+ 2009/01/21 Thomas Bretz
+
+   * mbase/BaseLinkDef.h, mbase/Makefile:
+     - added MQuaternion
+     - added MReflection
+
+   * mbase/MQuaternion.[h,cc], mbase/MReflection.[h,cc]:
+     - added
+
+   * mbase/MArrayI.[h,cc]:
+     - added a few new functions (ReSort, Add, Find and AddUniq)
+
+   * mbase/MMath.cc:
+     - replaced delete by delete[] where appropriate
+
+   * mgeom/MGeomCam.h:
+     - added new virtual functions HitFrame and HitDetector
+     - included MQuaternion
+
+   * mgeom/MGeomCamDwarf.[h,cc], mgeom/MGeomCamMagic.[h,cc]:
+     - added new functions HitFrame and HitDetector:
+
+   * msim/MHPhotonEvent.cc:
+     - removed the reference to MCamera
+
+   * mgeom/MGeomPix.[h,cc], mgui/MHexagon.[h,cc]:
+     - moved DistanceToPrimitive from MHexagon to MGeomPix
+     - moved the funtions to calculate overlapping areas 
+       also, but they are still in a comment
+
+   * mgui/MHexagon.[h,cc]:
+     - started implementing a rotation angle
+     - added data meber fPhi
+     - increased class version number
+
+   * mhist/MHCamera.cc, mtools/MagicJam.cc:
+     - we don't have to use a MHexagon anymore caluclating 
+       DistanceToPrimitive
+
+   * msimreflector/MMirror.[h,cc], msimreflector/MMirrorSquare.[h,cc],
+     msimreflector/MMirrorHex.[h,cc], msimreflector/MMirrorDisk.[h,cc],
+     msimreflector/MReflector.[h,cc], msimreflector/MSimReflector.[h,cc],
+     msimreflector/Makefile, msimreflector/SimReflectorLinkDef.h, 
+     msimreflector/SimReflectorIncl.h:
+     - added
+
+
+
+ 2009/01/21 Stefan Ruegamer
+
+   * datacenter/scripts/read_lapalma-tapes:
+     - added check of the tape slot when exporting the tapes
+
+
+
+ 2009/01/20 Thomas Bretz
+
+   * mjobs/MJob.h:
+     - added Esc member function
+
+   * msim/MPhotonData.[h,cc], msim/MPhotonEvent.[h,cc], 
+     msim/MSimAbsorption.[h,cc], msim/MSimPointingPos.[h,cc],
+     MHPhotonEvent.[h,cc], msim/Makefile, msim/SimIncl.h 
+     msim/SimLinkDef.h:
+     - added
+
+
+ 2009/01/19 Thomas Bretz
+
+   * mfileio/MWriteRootFile.cc:
+     - simplified how the rules are evaluated using TPregexp
+     - by this the rules got more powerful
+
+   * mjobs/MJCalibrateSignal.cc, mjobs/MJStar.cc:
+     - changed ols style rule to new style
+
+
+
+ 2009/01/18 Thomas Bretz
+
+   * mbase/BaseLinkDef.h, mbase/Makefile:
+     - added MSpline3
+
+   * mcorsika/MCorsikaEvtHeader.cc:
+     - some little cosmetics
+
+   * mcorsika/MCorsikaEvtHeader.h:
+     - added some missing getters
+
+   * mcorsika/MCorsikaRunHeader.cc:
+     - removed some obsolete comments
+     - reordered some comments
+
+   * mextralgo/MExtralgoSpline.h:
+     - changed default in GetIntegral from true to false
+
+   * mraw/MRawEvtHeader.h:
+     - added Setter for DAQEventNumber
+
+   * mraw/MRawRunHeader.cc:
+     - start pixel hardware indices with 1 not with 0
+
+
+
+ 2009/01/17 Thomas Bretz
+
+  * mbase/MMath.[h,cc]:
+     - added a new function RndmExp which should be a tiny bit faster than
+       root's own implementation because it ises Rndm() instead of Uniform()
+
+   * mextralgo/ExtralgoIncl.h:
+     - added MArrayF
+
+   * mextralgo/MExtralgoSpline.[h,cc]:
+     - divided FindY into FindYup and FindYdn to avoid an obsolete if-clause
+     - added a new member function to return the integral function of the
+       spline. This is useful to init a new spline and use it for 
+       producing the proper random distribution.
+
+   * mpedestal/MPedestalSubtractedEvt.[h,cc]:
+     - added Print() function
+
+   * mraw/MRawEvtData.[h,cc]:
+     - added a member function to Reset the arrays
+     - added member function to set the pixel indices
+     - Improved the new Set function
+
+  * readcorsika.cc:
+    - added
+
+
+
+ 2009/01/16 Daniel Hoehne-Moench
+
+   * datacenter/scripts/mcsequences:
+     - implemented sumtrigger -> modes, fTriggerFlagKEY
+     - fPriority(MCSequenceProcessStatus) is now filled into the mcdb
+
+   * datacenter/scripts/fillmccallisto, fillmcstar:
+     - bugfix: changed argument of $primaries from [$s+$s] to [$s]
+
+   * datacenter/macros/fillcamera.C:
+     - changed NumPheFromDNSB to float(7,3)
+     - fPriority(MCRunProcessStatus) is now filled into the mcdb
+
+   * datacenter/macros/fillmccalib.C:
+     - minor changes, bugfix (wrong column name for mcdb)
+
+   * datacenter/macros/fillmcsignal.C:
+     - definition of some parameters changed according to fillsignal.C
+     - minor changes, deleted unnecessary code
+     - implemented if clause for HiLo-Parameters. Instead of 
+       seqno<200000 the fAmplFadcKEY is queried in the mcdb for each
+       sequence. For MUX MCs the HiLo-Parameters are not calculated.
+
+
+
+ 2009/01/15 Thomas Bretz
+
+   * callisto.cc:
+     - cosmetics to output
+
+   * mcorsika/MCorsikaRunHeader.cc:
+     - cosmetics (removed a ;;)
+
+   * mhist/MHEvent.[h,cc]:
+     - ReInit to allow the change of the camera geoemtry in ReInit
+
+
+
+ 2009/01/15 Stefan Ruegamer
+
+   * datacenter/scripts/dodatacheck:
+     - removed the _E in the find command; files from 2008/06/04 on do
+       not have it any more
+
+
+
+ 2009/01/14 Daniel Hoehne-Moench
+
+   * datacenter/scripts/sourcefile:
+     - extended errorcoding on mc run process status
+
+   * datacenter/scripts/runmccallisto, runmcstar:
+     - deleted unnecessary lines, adapted to primary structure
+
+   * datacenter/macros/fillmcsignal.C, fillmccalib.C, fillmcstar.C:
+     - added
+
+   * datacenter/scripts/fillmccallisto, fillmcstar:
+     - added
+
+
+
+ 2009/01/14 Thomas Bretz
+
+   * readraw.cc:
+     - check first whether the file exist before adding the extension
+
+   * mbase/MMath.[h,cc]:
+     - added function to Re-sort an array
+
+   * mfileio/MReadMarsFile.cc, mfileio/MWriteRootFile.cc:
+     - Improved output
+
+   * mfileio/MWriteRootFile.cc:
+     - fixed a problem which prevented to open more than one /dev/null
+       devices independantly
+
+   * mgeom/MGeomCam.cc:
+     - cosmetics
+
+   * mgeom/MGeomCamDwarf.h:
+     - fixed a typo in an ifdef
+
+   * mgeom/MGeomPix.[h,cc]:
+     - added funtion to return positon as TVector2
+     - slightly improved the algorithm to check IsInside
+     - fixed the conditional signs for the orientation of pixels
+       in GetDirection
+
+   * mmain/MEventDisplay.cc:
+     - Give different names to the MPedestalSubtract tasks
+     - fixed buttons
+     - call AddGeometryTags after ReInit to allow reading new geometries in
+       ReInit
+
+   * mmc/MMcEvtBasic.h:
+     - added a new primary type kNightSky
+
+   * mraw/MRawEvtPixelIter.h:
+     - replaced type of the number of bytes by UInt_t
+
+   * mraw/MRawRunHeader.h:
+     - allow to validate the magic-number from outside (for MCs)
+
+   * datacenter/scripts/runcorsika:
+     - added a lot of comments
+     - reordered values in input card
+     - switched off a lot of obsolete output
+     - changed the Magnetic field to a value corresponding to the location of
+       MAGIC at 2200m height valid for January 200
Index: /trunk/MagicSoft/Mars/msim/MPhotonData.cc
===================================================================
--- /trunk/MagicSoft/Mars/msim/MPhotonData.cc	(revision 9284)
+++ /trunk/MagicSoft/Mars/msim/MPhotonData.cc	(revision 9285)
@@ -200,6 +200,6 @@
     fPosY = -f[1];  // [cm]
 
-    fCosU = -f[4];  // cos to x
-    fCosV =  f[3];  // cos to y
+    fCosU =  f[4];  // cos to x
+    fCosV = -f[3];  // cos to y
 
     fTime =  f[5];  // [ns]
Index: /trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc
===================================================================
--- /trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc	(revision 9284)
+++ /trunk/MagicSoft/Mars/msimreflector/MSimReflector.cc	(revision 9285)
@@ -442,5 +442,5 @@
     TRotation rot;    // The signs are positive because we align the incident point on ground to the telescope axis
     rot.RotateZ( az); // Rotate point on ground to align it with the telescope axis
-    rot.RotateX( zd); // tilt the point from ground to make it parallel to the mirror plane
+    rot.RotateX(-zd); // tilt the point from ground to make it parallel to the mirror plane
 
     // Now: viewed from the backside of the mirror
