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);
 
     //
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.h	(revision 9594)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.h	(revision 9595)
@@ -101,4 +101,5 @@
     Float_t GetViewconeAngleOuter() const { return fViewconeAngles[1]; }
     Float_t GetAtmosphericModel() const { return fAtmosphericModel; }
+    Bool_t HasViewCone() const { return fViewconeAngles[1]>0; }
 
     Int_t GetNumCT() const { return fNumCT; }
@@ -113,4 +114,10 @@
         fSlopeSpec=slope; fELowLim=emin; fEUppLim=emax;
     }
+    void SetViewCone(Float_t inner, Float_t outer)
+    {
+        fViewconeAngles[0] = inner;
+        fViewconeAngles[1] = outer;
+    }
+
 
     MGeomCorsikaCT &operator[](Int_t i) const;
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 9594)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx	(revision 9595)
@@ -14,7 +14,4 @@
     Float_t fFirstTarget;        // []
     Float_t fZFirstInteraction;  // [cm]
-
-    Float_t fTheta;              // [rad] Theta angle of event
-    Float_t fPhi;                // [rad] Phi angle of event (see class description)
 
     Float_t fCoreD;              // [cm] Core d pos
@@ -72,6 +69,4 @@
     // Getter
     UInt_t  GetEvtNumber() const { return fEvtNumber; }  //Get Event Number
-    Float_t GetTheta() const { return fTheta; }          //Get Theta angle
-    Float_t GetPhi() const { return fPhi ;  }            //Get Phi angle
 
     Float_t GetCoreX() const { return fCoreX; }          //Get Core x pos
@@ -103,6 +98,4 @@
 
     // Setter
-    void SetTheta(Float_t Theta) { fTheta=Theta; }                //Set Theta angle
-    void SetPhi(Float_t Phi)     { fPhi=Phi;  }                   //Set Phi angle
     void SetCoreD(Float_t CoreD) { fCoreD=CoreD; }                //Set Core d pos
     void SetCoreX(Float_t CoreX) { fCoreX=CoreX; }                //Set Core x pos
@@ -123,5 +116,5 @@
     void Clear(Option_t *opt=NULL);
 
-    ClassDef(MMcEvt, 6)  //Stores Montecarlo Information of one event (eg. the energy)
+    ClassDef(MMcEvt, 7)  //Stores Montecarlo Information of one event (eg. the energy)
 };
 
Index: trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h
===================================================================
--- trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 9594)
+++ trunk/MagicSoft/include-Classes/MMcFormat/MMcEvtBasic.h	(revision 9595)
@@ -36,5 +36,8 @@
   Float_t      fTelescopePhi;    // [rad]
   Float_t      fTelescopeTheta;  // [rad]
-  
+
+  Float_t      fTheta;           // [rad] Theta angle of event
+  Float_t      fPhi;             // [rad] Phi angle of event (see class description)
+
 public:
   MMcEvtBasic();
@@ -50,4 +53,10 @@
   Float_t GetTelescopePhi() const { return fTelescopePhi; }
   Float_t GetTelescopeTheta() const { return fTelescopeTheta; }
+
+  Float_t GetParticlePhi() const { return fPhi; }
+  Float_t GetParticleTheta() const { return fTheta; }
+
+  //Float_t GetTheta() const { return fTheta; }
+  //Float_t GetPhi() const { return fPhi ;  }
 
   static TString GetParticleName(Int_t id);
@@ -78,4 +87,10 @@
   void SetTelescopePhi  (Float_t Phi)   { fTelescopePhi=Phi; }
 
+  void SetParticleTheta(Float_t Theta)  { fTheta=Theta; }
+  void SetParticlePhi  (Float_t Phi)    { fPhi=Phi; }
+
+  //void SetTheta(Float_t Theta) { fTheta=Theta; }                //Set Theta angle
+  //void SetPhi(Float_t Phi)     { fPhi=Phi;  }                   //Set Phi angle
+
   void Fill(ParticleId_t, Float_t, Float_t, Float_t, Float_t);
 
@@ -84,5 +99,5 @@
   void Print(Option_t *opt=NULL) const;
 
-  ClassDef(MMcEvtBasic, 2) //Stores Basic Montecarlo Information of one event
+  ClassDef(MMcEvtBasic, 3) //Stores Basic Montecarlo Information of one event
 
 };
