Index: /trunk/Mars/Makefile
===================================================================
--- /trunk/Mars/Makefile	(revision 18450)
+++ /trunk/Mars/Makefile	(revision 18451)
@@ -21,5 +21,5 @@
 #
 #PROGRAMS = readraw merpp mars test mona status
-PROGRAMS := readdaq readraw readcorsika ceres merpp callisto star ganymed sponde showlog showplot mars mars-config
+PROGRAMS := readdaq readraw readcorsika ceres merpp callisto star ganymed sponde showlog showplot mars mars-config mirrorSimulation
 SOLIB    := libmars.so
 
Index: /trunk/Mars/mirrorSimulation.cc
===================================================================
--- /trunk/Mars/mirrorSimulation.cc	(revision 18451)
+++ /trunk/Mars/mirrorSimulation.cc	(revision 18451)
@@ -0,0 +1,269 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+//  mirrorSimulation
+//
+//
+// This program performs a simulation of the mirrors (in detail all processes up
+// to the camera front window.
+//
+// It is meaned only for test purposes of the mirror simulation. At the moment it
+// is a copy of the normal ceres simulation (revision 18447), with all processor removed behind
+// MSimAbsorption absapd (so the absorption by the pde of the SiPMs).
+//
+// It doesn't provide any graphical output, and the only output is a ASCII file
+// with the information of the photons.
+//
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include <TClass.h>
+#include <TSystem.h>
+#include <TApplication.h>
+#include <TObjectTable.h>
+
+#include <TVector2.h>
+
+#include "MArray.h"
+
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MStatusDisplay.h"
+
+#include "MEnv.h"
+#include "MArgs.h"
+#include "MDirIter.h"
+
+#include "MJSimReflector.h"
+
+
+using namespace std;
+
+static void StartUpMessage()
+{
+    gLog << all << endl;
+
+    //                1         2         3         4         5
+    //       12345678901234567890123456789012345678901234567890
+    gLog << "====================================================" << endl;
+    gLog << "                MirrorSimulation - MARS V" << MARSVER           << endl;
+    gLog << " MARS - Camera Electronics and REflector Simulation" << endl;
+    gLog << "    Compiled with ROOT v" << ROOT_RELEASE << " on <" << __DATE__ << ">" << endl;
+    gLog << "====================================================" << endl;
+    gLog << endl;
+}
+
+static void Usage()
+{
+    gLog << all << endl;
+    gLog << "Sorry the no usage description at the moment:" << endl;
+}
+
+
+int main(int argc, char **argv)
+{
+    if (!MARS::CheckRootVer())
+        return 0xff;
+
+    MLog::RedirectErrorHandler(MLog::kColor);
+
+    //
+    // Evaluate arguments
+    //
+    MArgs arg(argc, argv);
+    gLog.Setup(arg);
+
+    StartUpMessage();
+
+    if (arg.HasOnly("-V") || arg.HasOnly("--version"))
+        return 0;
+
+    if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
+    {
+        Usage();
+        return 2;
+    }
+
+    const Bool_t  kForce      = arg.HasOnlyAndRemove("-ff");
+    const Bool_t  kOverwrite  = arg.HasOnlyAndRemove("-f");
+    const Bool_t  kBatch      = kTRUE;
+
+    const TString kConfig     = arg.GetStringAndRemove("--config=", "reflector.rc");
+    const TString kInpath     = arg.GetStringAndRemove("--ind=", "");
+    const TString kOutpath    = arg.GetStringAndRemove("--out=", ".");
+    const TString kOutfile    = arg.GetStringAndRemove("--outf=", "");
+
+    const Int_t   kRunNumber  = arg.GetIntAndRemove("--run-number=", -1);
+
+    const TString kOpMode     = arg.GetStringAndRemove("--mode=", "data");
+
+    Int_t opmode = -1;
+    if (TString("data").BeginsWith(kOpMode, TString::kIgnoreCase))
+        opmode = MJSimReflector::kModeData;
+    if (TString("pointrun").BeginsWith(kOpMode, TString::kIgnoreCase))
+        opmode = MJSimReflector::kModePointRun;
+    if (TString("pedestal").BeginsWith(kOpMode, TString::kIgnoreCase))
+        opmode = MJSimReflector::kModePed;
+    if (TString("calibration").BeginsWith(kOpMode, TString::kIgnoreCase))
+        opmode = MJSimReflector::kModeCal;
+
+    if (opmode<0)
+    {
+        gLog << err << "ERROR - Wrong mode specified..." << endl;
+        Usage();
+        return 2;
+    }
+
+    //
+    // check for the right usage of the program (number of arguments)
+    if (arg.GetNumArguments()<1 && opmode==MJSimReflector::kModeData)
+    {
+        gLog << warn << "WARNING - Wrong number of arguments..." << endl;
+        Usage();
+        return 2;
+    }
+
+    if (arg.GetNumArguments()>0 && opmode!=MJSimReflector::kModeData)
+    {
+        gLog << warn << "WARNING - No arguments allowed in this mode..." << endl;
+        Usage();
+        return 2;
+    }
+
+    //
+    // Now we access/read the resource file. This will remove all
+    // --rc= from the list of arguments.
+    //
+    MEnv env(kConfig, "ceres.rc");
+    if (!env.IsValid())
+    {
+        gLog << err << "ERROR - Reading resource file " << kConfig << "." << endl;
+        return 0xfe;
+    }
+
+    //
+    // check for the right usage of the program (number of options)
+    //
+    if (arg.GetNumOptions()>0)
+    {
+        gLog << warn << "WARNING - Unknown commandline options..." << endl;
+        arg.Print("options");
+        gLog << endl;
+        return 2;
+    }
+
+    //
+    // Setup sequence file and check for its existance
+    //
+    TString kSequence = arg.GetNumArguments()==1 ? arg.GetArgumentStr(0) : "";
+
+    //
+    // Check if the first argument (if any) is a sequence file or not
+    //
+    if (!kSequence.EndsWith(".txt"))
+        kSequence = "";
+
+    //
+    // Something special for datacenter access
+    //
+    if (!kSequence.IsNull() && !MSequence::InflateSeq(kSequence, kTRUE))
+        return 2;
+
+    //
+    // Setup sequence and check its validity
+    //
+    MSequence seq(kSequence, kInpath);
+    if (!kSequence.IsNull())
+    {
+//        if (kPrintSeq)
+//        {
+//            gLog << all;
+//            gLog.Separator(kSequence);
+//            seq.Print();
+//            gLog << endl;
+//        }
+        if (seq.IsValid() && !seq.IsMonteCarlo())
+        {
+            gLog << err << "Sequence is not a Monte Carlo Sequence." << endl << endl;
+            return 2;
+        }
+        if (!seq.IsValid())
+        {
+            gLog << err << "Sequence read but not valid!" << endl << endl;
+            return 2;
+        }
+
+        //
+        // Process print options
+        //
+//        if (kPrintFiles)
+//            PrintFiles(seq, kInpath, kFALSE);
+//        if (kPrintFound)
+//            PrintFiles(seq, kInpath, kTRUE);
+    }
+    else
+    {
+//        if (kPrintFiles)
+//            PrintFiles(arg, kFALSE);
+//        if (kPrintFound)
+//            PrintFiles(arg, kTRUE);
+    }
+
+    //
+    // Initialize root
+    //
+    TVector2::Class()->IgnoreTObjectStreamer();
+    MArray::Class()->IgnoreTObjectStreamer();
+    MParContainer::Class()->IgnoreTObjectStreamer();
+
+    TApplication app("reflector", &argc, argv);
+    if ((!gROOT->IsBatch() && !gClient) || (gROOT->IsBatch() && !kBatch))
+    {
+        gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
+        return 1;
+    }
+
+    {
+        MJSimReflector job("SimReflector");
+        //job.SetSequence(seq);
+        job.SetEnv(&env);
+        job.SetOverwrite(kOverwrite);
+        job.SetPathOut(kOutpath);
+        job.SetFileOut(kOutfile);
+        job.SetForceMode(kForce);
+        job.SetMode(opmode);
+        job.SetCommandLine(MArgs::GetCommandLine(argc, argv));
+        job.SetRunNumber(kRunNumber);
+
+        if (!job.Process(arg, seq))
+        {
+            gLog << err << "Calculation of reflector failed." << endl << endl;
+            return 2;
+        }
+
+        if (!job.GetDisplay())
+        {
+            gLog << warn << "Display closed by user... execution aborted." << endl << endl;
+            return 1;
+        }
+    }
+
+//    if (kBatch || kQuit)
+//        delete d;
+//    else
+//    {
+//        // From now on each 'Close' means: Terminate the application
+//        d->SetBit(MStatusDisplay::kExitLoopOnClose);
+
+//        // Wait until the user decides to exit the application
+//        app.Run(kFALSE);
+//    }
+
+    if (TObject::GetObjectStat())
+    {
+        TObject::SetObjectStat(kFALSE);
+        gObjectTable->Print();
+    }
+
+    return 0;
+}
Index: /trunk/Mars/mjobs/JobsLinkDef.h
===================================================================
--- /trunk/Mars/mjobs/JobsLinkDef.h	(revision 18450)
+++ /trunk/Mars/mjobs/JobsLinkDef.h	(revision 18451)
@@ -16,4 +16,5 @@
 
 #pragma link C++ class MJSimulation+;
+#pragma link C++ class MJSimReflector+;
 
 #pragma link C++ class MJPedestal+;
Index: /trunk/Mars/mjobs/MJSimReflector.cc
===================================================================
--- /trunk/Mars/mjobs/MJSimReflector.cc	(revision 18451)
+++ /trunk/Mars/mjobs/MJSimReflector.cc	(revision 18451)
@@ -0,0 +1,380 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+//  MJSimReflector
+//
+//
+// This process performs the simulation up to the resulting photons on the camera
+// window:
+//
+// - Simulating of Pointing
+// - Absorption in the atmosphere
+// - Absorption by mirror reflectivity and additional photon acceptance
+// - Simulation of the reflector
+// - Absorption by angular acceptance of winston cones
+// - Absorption by transmission acceptance of winston cones
+// - Absorption by pde of the SiPMs
+//
+// An ASCII output file with the information of all photons is written to disk.
+// The place in the simulation chain can be chosen by changing the fill point of the
+// writeCherPhotonFile into the tasklist
+//
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include "MJSimReflector.h"
+
+#include <TEnv.h>
+#include <TCanvas.h>
+#include <iostream>
+
+// Core
+#include "MLog.h"
+#include "MLogManip.h"
+
+#include "MArgs.h"
+#include "MDirIter.h"
+#include "MParList.h"
+#include "MTaskList.h"
+#include "MEvtLoop.h"
+
+#include "MStatusDisplay.h"
+
+#include "MWriteAsciiFile.h"
+
+// Tasks
+#include "MCorsikaRead.h"
+#include "MContinue.h"
+#include "MGeomApply.h"
+#include "MParameterCalc.h"
+
+#include "MSimMMCS.h"
+#include "MSimAbsorption.h"
+#include "MSimAtmosphere.h"
+#include "MSimReflector.h"
+#include "MSimPointingPos.h"
+#include "MSimPSF.h"
+#include "MSimGeomCam.h"
+#include "MSimRandomPhotons.h"
+#include "MSimBundlePhotons.h"
+
+// Container
+#include "MRawRunHeader.h"
+#include "MParameters.h"
+#include "MReflector.h"
+#include "MParEnv.h"
+#include "MSpline3.h"
+#include "MParSpline.h"
+#include "MGeomCam.h"
+#include "MMatrix.h"
+
+#include "MPedestalCam.h"
+#include "MPedestalPix.h"
+
+ClassImp(MJSimReflector);
+
+using namespace std;
+
+// --------------------------------------------------------------------------
+//
+// Default constructor.
+//
+// Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE
+//
+MJSimReflector::MJSimReflector(const char *name, const char *title)
+    : fForceMode(kFALSE), fOperationMode(kModeData), fRunNumber(-1)
+{
+    fName  = name  ? name  : "MJSimReflector";
+    fTitle = title ? title : "Standard analysis and reconstruction";
+}
+
+Bool_t MJSimReflector::CheckEnvLocal()
+{
+    fForceMode    = GetEnv("ForceMode",    fForceMode);
+
+    return kTRUE;
+}
+
+// Setup the header accordingly to the used operation mode
+void MJSimReflector::SetupHeaderOperationMode(MRawRunHeader &header) const
+{
+    switch (fOperationMode)
+    {
+    case kModeData:
+        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTData);
+        header.SetRunInfo(0, fRunNumber<0 ? 3 : fRunNumber);
+        break;
+
+    case kModePed:
+        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPedestal);
+        header.SetSourceInfo("Pedestal");
+        header.SetRunInfo(0, fRunNumber<0 ? 1 : fRunNumber);
+        break;
+
+    case kModeCal:
+        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTCalibration);
+        header.SetSourceInfo("Calibration");
+        header.SetRunInfo(0, fRunNumber<0 ? 2 : fRunNumber);
+        break;
+
+    case kModePointRun:
+        header.SetRunType(MRawRunHeader::kRTMonteCarlo|MRawRunHeader::kRTPointRun);
+        header.SetRunInfo(0, fRunNumber<0 ? 0 : fRunNumber);
+        break;
+    }
+}
+
+
+Bool_t MJSimReflector::Process(const MArgs &args, const MSequence &seq)
+{
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+    // Initialization
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+
+    // --------------------------------------------------------------------------------
+    // Logging output:
+    // --------------------------------------------------------------------------------
+    // - description of the job itself
+    // - list of the
+    *fLog << inf;
+    fLog->Separator(GetDescriptor());
+
+    if (!CheckEnv())
+        return kFALSE;
+
+    if (seq.IsValid())
+        *fLog << fSequence.GetFileName() << endl;
+    else
+        *fLog << "Input: " << args.GetNumArguments() << "-files" << endl;
+    *fLog << endl;
+
+    MDirIter iter;
+    if (seq.IsValid() && seq.GetRuns(iter, MSequence::kCorsika)<=0)
+    {
+        *fLog << err << "ERROR - Sequence valid but without files." << endl;
+        return kFALSE;
+    }
+    // --------------------------------------------------------------------------------
+    // Setup MParList and MTasklist
+    // --------------------------------------------------------------------------------
+    MParList plist;
+    plist.AddToList(this); // take care of fDisplay!
+    // setup TaskList
+    MTaskList tasks;
+    plist.AddToList(&tasks);
+
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+    // Parameter Container Setup
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+
+    // --------------------------------------------------------------------------------
+    // Setup container for the reflector, the cones and the camera geometry
+    // --------------------------------------------------------------------------------
+    MParEnv env0("Reflector");
+    MParEnv env1("GeomCones");
+    MParEnv env2("MGeomCam");
+    env0.SetClassName("MReflector");
+    env1.SetClassName("MGeomCam");
+    env2.SetClassName("MGeomCam");
+    plist.AddToList(&env0);
+    plist.AddToList(&env1);
+    plist.AddToList(&env2);
+    // --------------------------------------------------------------------------------
+    // Setup spline containers for:
+    // --------------------------------------------------------------------------------
+    // - the different photon acceptance splines
+    MParSpline splinepde("PhotonDetectionEfficiency");
+    MParSpline splinemirror("MirrorReflectivity");
+    MParSpline splinecones("ConesAngularAcceptance");
+    MParSpline splinecones2("ConesTransmission");
+    MParSpline splineAdditionalPhotonAcceptance("AdditionalPhotonAcceptance");
+    plist.AddToList(&splinepde);
+    plist.AddToList(&splinemirror);
+    plist.AddToList(&splinecones);
+    plist.AddToList(&splinecones2);
+    plist.AddToList(&splineAdditionalPhotonAcceptance);
+
+    // --------------------------------------------------------------------------------
+    // Setup container for the MC Run Header and the Raw Run Header
+    // --------------------------------------------------------------------------------
+    plist.FindCreateObj("MMcRunHeader");
+
+    MRawRunHeader header;
+    header.SetValidMagicNumber();
+    SetupHeaderOperationMode(header);
+    header.SetObservation("On", "MonteCarlo");
+    plist.AddToList(&header);
+
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+    // Tasks Setup
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+
+    // --------------------------------------------------------------------------------
+    // Corsika read setup
+    // --------------------------------------------------------------------------------
+    MCorsikaRead read;
+    read.SetForceMode(fForceMode);
+
+    if (!seq.IsValid())
+    {
+        for (int i=0; i<args.GetNumArguments(); i++)
+            read.AddFile(args.GetArgumentStr(i));
+    }
+    else
+        read.AddFiles(iter);
+
+    // --------------------------------------------------------------------------------
+    // Precut after reading
+    // --------------------------------------------------------------------------------
+    // I am not sure if here there is a default for numPhotons < 10
+    MContinue precut("", "PreCut");
+    precut.IsInverted();
+    precut.SetAllowEmpty();
+
+    // --------------------------------------------------------------------------------
+    // Simmmcs and calculation of the incident angle.
+    // --------------------------------------------------------------------------------
+    MSimMMCS simmmcs;
+
+    // The different strings defines the calculation of the incident angle
+    const TString sin2 = "sin(MCorsikaEvtHeader.fZd)*sin(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
+    const TString cos2 = "cos(MCorsikaEvtHeader.fZd)*cos(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
+    const TString cos  = "cos(MCorsikaEvtHeader.fAz-MCorsikaRunHeader.fAzMin*TMath::DegToRad())";
+    const TString form = "acos("+sin2+"*"+cos+"+"+cos2+")*TMath::RadToDeg()";
+
+    MParameterCalc calcangle(form, "CalcIncidentAngle");
+    calcangle.SetNameParameter("IncidentAngle");
+
+    // --------------------------------------------------------------------------------
+    // Setup of the different Absorptions
+    // --------------------------------------------------------------------------------
+    // - atmosphere
+    // - PDE of the SiPMs
+    // - mirror reflectivity
+    // - cones angular acceptance
+    // - cones transmission
+    // - additional photon acceptance
+    MSimAtmosphere simatm;
+    MSimAbsorption absapd("SimPhotonDetectionEfficiency");
+    MSimAbsorption absmir("SimMirrorReflectivity");
+    MSimAbsorption cones("SimConesAngularAcceptance");
+    MSimAbsorption cones2("SimConesTransmission");
+    MSimAbsorption additionalPhotonAcceptance("SimAdditionalPhotonAcceptance");
+    absapd.SetParName("PhotonDetectionEfficiency");
+    absmir.SetParName("MirrorReflectivity");
+    cones.SetParName("ConesAngularAcceptance");
+    cones.SetUseTheta();
+    cones2.SetParName("ConesTransmission");
+    additionalPhotonAcceptance.SetParName("AdditionalPhotonAcceptance");
+    // --------------------------------------------------------------------------------
+    // Pointing position and reflector simulation
+    // --------------------------------------------------------------------------------
+    MSimPointingPos pointing;
+    MSimReflector reflect;
+    reflect.SetNameGeomCam("GeomCones");
+    reflect.SetNameReflector("Reflector");
+    // --------------------------------------------------------------------------------
+    // Seupt of some continue conditions
+    // --------------------------------------------------------------------------------
+    MContinue cont1("MPhotonEvent.GetNumPhotons<1", "ContEmpty1");
+    MContinue cont2("MPhotonEvent.GetNumPhotons<1", "ContEmpty2");
+    MContinue cont3("MPhotonEvent.GetNumPhotons<2", "ContEmpty3");
+    cont1.SetAllowEmpty();
+    cont2.SetAllowEmpty();
+    cont3.SetAllowEmpty();
+
+    // --------------------------------------------------------------------------------
+    // Geom apply, Simulation psf, and simulation of the pixel geometry
+    // --------------------------------------------------------------------------------
+    // Be awere MGeomApply only resizes parameter container which heritates from
+    // MGeomCam to the actual size of the camera
+    MGeomApply apply;
+
+    // individual single mirror psf
+    MSimPSF simpsf;
+
+    // Simulate the geometry of the pixels (so which photon hit which pixel)
+    MSimGeomCam simgeom;
+    simgeom.SetNameGeomCam("GeomCones");
+
+    // --------------------------------------------------------------------------------
+    // Setup of the Write Task
+    // --------------------------------------------------------------------------------
+    // Setup of the outputpath
+    if (!fFileOut.IsNull())
+    {
+        const Ssiz_t dot   = fFileOut.Last('.');
+        const Ssiz_t slash = fFileOut.Last('/');
+        if (dot>slash)
+            fFileOut = fFileOut.Remove(dot);
+    }
+
+    const char *fmt = Form("%s/%08d%%s.csv", fPathOut.Data(), header.GetRunNumber());
+    TString outputFilePath(Form(fmt, Form("%s", "" )));
+
+    MWriteAsciiFile writePhotonFile(outputFilePath,"MPhotonEvent");
+
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+    // Filling of tasks in tasklist
+    // --------------------------------------------------------------------------------
+    // --------------------------------------------------------------------------------
+
+    if (header.IsDataRun())
+    {
+        tasks.AddToList(&read);
+        tasks.AddToList(&pointing);
+        tasks.AddToList(&simmmcs);
+        tasks.AddToList(&simatm);
+        tasks.AddToList(&calcangle);
+        if (!header.IsPointRun())
+        {
+            tasks.AddToList(&absmir);
+            tasks.AddToList(&additionalPhotonAcceptance);
+        }
+        tasks.AddToList(&reflect);
+    }
+    tasks.AddToList(&apply);
+    if (header.IsDataRun())
+    {
+//        tasks.AddToList(&simpsf);
+        tasks.AddToList(&simgeom);
+        tasks.AddToList(&writePhotonFile);
+        tasks.AddToList(&cones);
+        tasks.AddToList(&cones2);
+        if (!header.IsPointRun())
+        {
+            tasks.AddToList(&absapd);
+        }
+    }
+    tasks.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
+
+    // Create and setup the eventloop
+    MEvtLoop evtloop(fName);
+    evtloop.SetParList(&plist);
+    evtloop.SetDisplay(fDisplay);
+    evtloop.SetLogStream(&gLog);
+    if (!SetupEnv(evtloop))
+        return kFALSE;
+
+    header.Print();
+
+    // Execute first analysis
+    if (!evtloop.Eventloop(fMaxEvents))
+    {
+        gLog << err << GetDescriptor() << ": Failed." << endl;
+        return kFALSE;
+    }
+
+//    if (!WriteResult(plist, seq, header.GetRunNumber()))
+//        return kFALSE;
+
+    *fLog << all << GetDescriptor() << ": Done." << endl << endl << endl;;
+
+    return kTRUE;
+}
Index: /trunk/Mars/mjobs/MJSimReflector.h
===================================================================
--- /trunk/Mars/mjobs/MJSimReflector.h	(revision 18451)
+++ /trunk/Mars/mjobs/MJSimReflector.h	(revision 18451)
@@ -0,0 +1,47 @@
+#ifndef MARS_MJSimReflector
+#define MARS_MJSimReflector
+
+#ifndef MARS_MJob
+#include "MJob.h"
+#endif
+
+class MHn;
+class MArgs;
+class MParList;
+class MSequence;
+class MWriteRootFile;
+class MWriteFitsFile;
+class MRawRunHeader;
+
+class MJSimReflector : public MJob
+{
+public:
+    enum Mode_t { kModeData, kModePed, kModeCal, kModePointRun };
+
+private:
+    Bool_t fForceMode;      // Force execution even if RUNE-section was not foundm
+
+    Int_t  fOperationMode;  // Operation mode (data, ped, cal, pointrun)
+    Int_t  fRunNumber;      // 8 digits run number to be used for the file names
+
+    TString fFileOut;       // Output file name if all runs should be combines
+
+//    Bool_t WriteResult(const MParList &plist, const MSequence &seq, Int_t run);
+    Bool_t CheckEnvLocal();
+
+public:
+    MJSimReflector(const char *name=NULL, const char *title=NULL);
+
+    void SetFileOut(const char *file="") { fFileOut = file; }
+    void SetForceMode(Bool_t force=kTRUE) { fForceMode = force; }
+    void SetMode(Int_t mode) { fOperationMode = mode; }
+    void SetRunNumber(Int_t n=-1) { fRunNumber = n%100000000; }
+    void SetupHeaderOperationMode(MRawRunHeader &header) const;
+
+    // Process
+    Bool_t Process(const MArgs &args, const MSequence &seq);
+
+    ClassDef(MJSimReflector, 0) // Job to run the reflector simulation (reflector)
+};
+
+#endif
Index: /trunk/Mars/mjobs/Makefile
===================================================================
--- /trunk/Mars/mjobs/Makefile	(revision 18450)
+++ /trunk/Mars/mjobs/Makefile	(revision 18451)
@@ -33,4 +33,5 @@
            MJob.cc \
 	   MJSimulation.cc \
+           MJSimReflector.cc \
 	   MJPedestal.cc \
            MJCalib.cc \
