Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 9594)
+++ trunk/MagicSoft/Mars/Changelog	(revision 9595)
@@ -33,4 +33,33 @@
      - changed interpretation from file from radius to diameter
 
+   * ceres.cc:
+     - added option --run-number
+
+   * showplot.cc:
+     - set default palette to pretty palette
+
+   * mcorsika/MCorsikaRunHeader.h:
+     - added getter for ViewConeInnerAngle
+
+   * mmc/MMcCorsikaRunHeader.h:
+     - added HasViewCone
+     - added SetViewCone
+
+   * mmc/MMcEvt.cxx, mmc/MMcEvtBasic.h:
+     - moved fPhi and fTheta from MMcEvt to MMcEvtBasic
+     - increased class version number accordingly
+     - moved setter
+     - moved getter
+     - adapted Clean()
+     - adapter copy-constructor
+
+   * mpointing/MPointingDevCalc.cc:
+     - added some comments
+
+   * msim/MSimMMCS.cc:
+     - transfer view cone data
+     - set run-info (run/file-number) according to new scheme
+     - always set MMcEvt::fPhi/fTheta to particle direction
+
 
 
Index: trunk/MagicSoft/Mars/NEWS
===================================================================
--- trunk/MagicSoft/Mars/NEWS	(revision 9594)
+++ trunk/MagicSoft/Mars/NEWS	(revision 9595)
@@ -15,4 +15,8 @@
      objects and TCanvas' but no MStatusArray object has been improved.
 
+   * MMcEvt.fPhi and MMcEvt.fTheta have been moved to its base class
+     MMcEvtBasic. Consequently, the direction of the primary shower
+     is not lost in the OriginalMC tree anymore
+
  ;ceres:
 
@@ -29,4 +33,9 @@
    * The number of photons in the calibration signal is now distributed
      by a possonian instead of a Gauss.
+
+   * implemented new file-naming scheme (corsika run-number is new
+     tranfered to the ceres output as file-number). Therefore a new option
+     has been implemented to set an artificial run-number:
+        ---run-number=12345
 
 
Index: trunk/MagicSoft/Mars/ceres.cc
===================================================================
--- trunk/MagicSoft/Mars/ceres.cc	(revision 9594)
+++ trunk/MagicSoft/Mars/ceres.cc	(revision 9595)
@@ -71,5 +71,6 @@
     gLog << "   --mode=pedestal           Execution mode. Produce either pedestals," << endl;
     gLog << "   --mode=calibration        calibration data (no input files required) or" << endl;
-    gLog << "   --mode=data               process data files [default]" << endl;
+    gLog << "   --mode=data               process data files [default]" << endl << endl;
+    gLog << "   --run-number=#            Optionally set the run number of the run to simulate" << endl << endl;
     gLog << endl;
 //    gLog << "     -f:  force reading of runheader" << endl;
@@ -166,4 +167,6 @@
     const TString kOutpath    = arg.GetStringAndRemove("--out=", ".");
 
+    const Int_t   kRunNumber  = arg.GetIntAndRemove("--run-number=", -1);
+
     const TString kOpMode     = arg.GetStringAndRemove("--mode=", "data");
 
@@ -342,4 +345,6 @@
         job.SetMode(opmode);
         job.SetCommandLine(MArgs::GetCommandLine(argc, argv));
+        job.SetRunNumber(kRunNumber);
+
         // job.SetPathIn(kInpath); // not yet needed
 
Index: trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h
===================================================================
--- trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h	(revision 9594)
+++ trunk/MagicSoft/Mars/mcorsika/MCorsikaRunHeader.h	(revision 9595)
@@ -98,4 +98,5 @@
     Float_t GetMagneticFieldAz() const { return fMagneticFieldAz; }
 
+    Float_t GetViewConeInnerAngle() const { return fViewConeInnerAngle; }
     Float_t GetViewConeOuterAngle() const { return fViewConeOuterAngle; }
     Bool_t HasViewCone() const { return fViewConeOuterAngle>0; }
Index: trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc
===================================================================
--- trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 9594)
+++ trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc	(revision 9595)
@@ -282,4 +282,8 @@
 // New LUTs for M2
 //
+// [2010-06-14 M. Garcz.]
+//
+// New LUTs for M1
+//
 //
 // Others
Index: trunk/MagicSoft/Mars/msim/MSimMMCS.cc
===================================================================
--- trunk/MagicSoft/Mars/msim/MSimMMCS.cc	(revision 9594)
+++ trunk/MagicSoft/Mars/msim/MSimMMCS.cc	(revision 9595)
@@ -122,4 +122,6 @@
     mch->SetSpectrum(fRunHeader->GetSlopeSpectrum(),
                      fRunHeader->GetEnergyMin(), fRunHeader->GetEnergyMax());
+    mch->SetViewCone(fRunHeader->GetViewConeInnerAngle(),
+                     fRunHeader->GetViewConeOuterAngle());
     mch->SetReadyToSave();
 
@@ -147,5 +149,5 @@
 
     // FIXME: Is there a way to write them as LAST entry in the file?
-    rh->SetRunInfo(1, fRunHeader->GetRunNumber(), 0);
+    rh->SetFileNumber(fRunHeader->GetRunNumber()%1000);
     rh->SetSourceInfo(MMcEvtBasic::GetParticleName(id));
     rh->SetReadyToSave();
@@ -160,4 +162,31 @@
 // --------------------------------------------------------------------------
 //
+// We have two scenarios for the ponting:
+//
+//  1) Diffuse flux (view cone option)
+//
+//     Azimuth and Zenith angle are fixed values (min==max).
+//     The diffuse flux is produced in a cone around this angle.
+//
+//     That means that the telescope orientation is aligned and fixed
+//     along the cone axis.
+//
+//     To analyse a diffuse flux the source position should be fixed to
+//     the camera center.
+//     In some cases (e.g. training of RF) the source depending parameters
+//     might be needed w.r.t. the real origin of the primary particle.
+//     In this case the primary shower direction is needed.
+//
+//  2) Directed flux
+//
+//     Particles are produced between a min and max Azimuth and Zenith angle.
+//     The telescope axis is either parallel (on source) or off axis
+//     (wobble) to the primary particle direction.
+//     This is used to "fake" the trajectory of the source.
+//
+//  3) Flux along a trajectory
+//
+//     [...]
+//
 Int_t MSimMMCS::Process()
 {
@@ -165,23 +194,19 @@
     fMcEvtBasic->SetImpact(fEvtHeader->GetImpact());
 
+    // Pointing direction of the telescope (telescope axis)
     fMcEvtBasic->SetTelescopeTheta(fPointingTel->GetZdRad());
     fMcEvtBasic->SetTelescopePhi(fPointingTel->GetAzRad());
 
-    fMcEvtBasic->SetReadyToSave();
-
-    static_cast<MMcEvtBasic&>(*fMcEvt) = *fMcEvtBasic;
-
+    // Direction of primary particle
     // Convert from corsika frame to telescope frame, taking
     // the magnetic field into account: tel = corsika+offset
-    if (fRunHeader->HasViewCone())
-    {
-        fMcEvt->SetTheta(fPointingTel->GetZdRad());
-        fMcEvt->SetPhi(fPointingTel->GetAzRad());
-    }
-    else
-    {
-        fMcEvt->SetTheta(fEvtHeader->GetZd());
-        fMcEvt->SetPhi(fEvtHeader->GetAz()+fRunHeader->GetMagneticFieldAz());
-    }
+    fMcEvtBasic->SetParticleTheta(fEvtHeader->GetZd());
+    fMcEvtBasic->SetParticlePhi(fEvtHeader->GetAz()+fRunHeader->GetMagneticFieldAz());
+
+    fMcEvtBasic->SetReadyToSave();
+
+
+    static_cast<MMcEvtBasic&>(*fMcEvt) = *fMcEvtBasic;
+
 
     fMcEvt->SetEvtNumber(fEvtHeader->GetEvtNumber());
Index: trunk/MagicSoft/Mars/showplot.cc
===================================================================
--- trunk/MagicSoft/Mars/showplot.cc	(revision 9594)
+++ trunk/MagicSoft/Mars/showplot.cc	(revision 9595)
@@ -1,4 +1,5 @@
 #include <TROOT.h>
 #include <TClass.h>
+#include <TStyle.h>
 #include <TGClient.h>
 #include <TRint.h>
@@ -245,4 +246,6 @@
         return 1;
     }
+
+    gStyle->SetPalette(1, 0);
 
     //
