Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6038)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6047)
@@ -113,12 +113,13 @@
 // Default constructor. 
 //
-// Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE
+// Sets fRuns to 0, fExtractor to NULL, 
 //
 MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title)
-  : fIsDataCheck(kFALSE), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE),
-    fIsHiLoCalibration(kTRUE)
+  : fDataFlag(0), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), fIsHiLoCalibration(kFALSE)
 {
     fName  = name  ? name  : "MJCalibrateSignal";
     fTitle = title ? title : "Tool to calibrate data";
+
+    SetRootData();
 }
 
@@ -198,5 +199,5 @@
 //
 // MJCalibration allows to setup several option by a resource file:
-//   MJCalibrateSignal.DataCheck: yes,no
+//   MJCalibrateSignal.RawData: yes,no
 //
 // For more details see the class description and the corresponding Getters
@@ -205,8 +206,21 @@
 {
 
-    SetDataCheck(GetEnv("DataCheck", IsDataCheck()));
     SetInterlaced(GetEnv("Interlaced", fIsInterlaced));
     SetRelTimesUpdate(GetEnv("RelTimesUpdate", fIsRelTimesUpdate));
     SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));
+
+    SetRootData();
+
+    if (HasEnv("RawData"))
+    {
+      fDataFlag = 0;
+      SetRawData();
+    }
+
+    if (HasEnv("MC"))
+    {
+      fDataFlag = 0;
+      SetMC();
+    }
 
     return kTRUE;
@@ -238,5 +252,5 @@
 
     MDirIter iter;
-    const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsDataCheck());
+    const Int_t n0 = fSequence.SetupDatRuns(iter, fPathData, "D", IsRawData());
     const Int_t n1 = fSequence.GetNumDatRuns();
     if (n0==0)
@@ -345,6 +359,4 @@
     plist.AddToList(&tlist);
 
-    // FIXME: Move this to an intermediate class MJMagic
-    Byte_t filetype = 2;
     /*
     TString name = iter.Next();
@@ -357,7 +369,4 @@
         return kFALSE;
     } */
-    // 1 = raw-file
-    // 2 = raw-root file
-    // 3 = mc-raw file
 
     MReadReports readreal;
@@ -372,5 +381,5 @@
     //read.DisableAutoScheme();
     MRawFileRead rawread(NULL);
-    if (IsDataCheck())
+    if (IsRawData())
         rawread.AddFiles(iter);
     else
@@ -466,5 +475,11 @@
 
     MCalibrateData         calib;
-    if (filetype==3) // MC file
+    // 
+    // This is new calibration to eff. photo-electrons, hard-coded as decided 
+    // at the Wuerzburg software meeting 26.01.05
+    //
+    calib.SetSignalType(MCalibrateData::kPhe);
+
+    if (IsMC()) // MC file
     {
         calib.SetCalibrationMode(MCalibrateData::kFfactor);
@@ -533,11 +548,10 @@
     MHCamEvent evt1(2, "PedRmsFLG",   "Pedestal RMS from Lo Gain;;\\sigma_{p} [fadc/sl]");
     MHCamEvent evt2(0, "Extra'd",     "Extracted Signal;;S [fadc/sl]");
-    //    MHCamEvent evt3(4, "PedPhot",     "Calibrated Pedestal;;P [\\gamma]");
-    MHCamEvent evt4(5, "PedRMS",      "Calibrated Pedestal RMS;;\\sigma_{p} [\\gamma]");
-    MHCamEvent evt5(0, "Interp'd",    "Interpolated Signal;;S [\\gamma]");
+    //    MHCamEvent evt3(4, "PedPhot",     "Calibrated Pedestal;;P [phe]");
+    MHCamEvent evt4(5, "PedRMS",      "Calibrated Pedestal RMS;;\\sigma_{p} [phe]");
+    MHCamEvent evt5(0, "Interp'd",    "Interpolated Signal;;S [phe]");
     MHCamEvent evt6(2, "Unsuitable",  "Fraction of unsuitable events per Pixel;;[1]");
     MHCamEvent evt7(0, "Times",       "Arrival Time;;T [slice]");
-    //    MHCamEvent evt8(0, "HiLoConv",    "Ratio Hi-Lo Gain Signal;;Ratio [1]");
-    //    MHCamEvent evt9(5, "HiLoDiff",    "Time Diff. Hi-Lo Gain Signal;;\\Delta T [3.33ns]");
+    MHCamEvent evt8(0, "Conv",        "Calibration Conv. Factors;;[phe/fadc sl]");
 
     evt0.EnableVariance();
@@ -549,5 +563,4 @@
     evt7.EnableVariance();
     //    evt8.EnableVariance();
-    //    evt9.EnableVariance();
 
     MFillH fill0(&evt0, "MPedestalFundamental",   "FillPedFLG");
@@ -559,4 +572,5 @@
     MFillH fill6(&evt6, "MBadPixelsCam",          "FillUnsuitable");
     MFillH fill7(&evt7, "MArrivalTime",           "FillTimes");
+    MFillH fill8(&evt8, "MCalibrateData",         "FillConv");
 
     // The second rule is for the case reading raw-files!
@@ -612,5 +626,5 @@
     tlist2.AddToList(&apply);
     tlist2.AddToList(&merge);
-    if (filetype==3)
+    if (IsMC())
         tlist2.AddToList(&pcopy);
     else
@@ -670,5 +684,8 @@
     tlist2.AddToList(&fill5);
     if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge"))
-        tlist2.AddToList(&fill7);
+      tlist2.AddToList(&fill7);
+
+    //    if (fIsInterlaced)
+    tlist2.AddToList(&fill8);
 
     // Setup List for Drive-tree
@@ -676,13 +693,13 @@
 
     // Now setup main tasklist
-    tlist.AddToList(IsDataCheck() ? (MTask*)&rawread : (MTask*)&readreal);
-    if (!IsDataCheck())
+    tlist.AddToList(IsRawData() ? (MTask*)&rawread : (MTask*)&readreal);
+    if (IsRootData())
       tlist2.AddToList(&pextr);
-    tlist.AddToList(&tlist2, IsDataCheck()?"All":"Events");
+    tlist.AddToList(&tlist2, IsRootData() ? "Events" : "All");
 
     //
     // !!! Replaced by MInterpolatePointingPos !!!
     //
-    //    if (!IsDataCheck())
+    //    if (IsRootData())
     //        tlist.AddToList(&pcalc, "Drive");
 
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h	(revision 6038)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h	(revision 6047)
@@ -21,5 +21,11 @@
 private:
 
-    Bool_t fIsDataCheck;
+    enum DataType_t {
+      kIsRawData,
+      kIsRootData,
+      kIsMC
+    };
+
+    Byte_t fDataFlag;                   // Bit-field to store the data type
     Bool_t fIsInterlaced;               // Distinguish interlaced from other calibration
     Bool_t fIsRelTimesUpdate;           // Choose to update relative times from interlaced
@@ -34,6 +40,11 @@
                            MExtractor* &ext1, MExtractor* &ext2, TString &geom) const;
 
-    Bool_t IsDataCheck() const { return fIsDataCheck; }
-    void SetDataCheck(Bool_t b) { fIsDataCheck = b; }
+    Bool_t IsRawData()  const { return TESTBIT(fDataFlag,kIsRawData);  }
+    Bool_t IsRootData() const { return TESTBIT(fDataFlag,kIsRootData); }
+    Bool_t IsMC()       const { return TESTBIT(fDataFlag,kIsMC);       }
+
+    void   SetRawData ( const Bool_t b=kTRUE )  { b ? SETBIT(fDataFlag,kIsRawData)  : CLRBIT(fDataFlag,kIsRawData);  }
+    void   SetRootData( const Bool_t b=kTRUE )  { b ? SETBIT(fDataFlag,kIsRootData) : CLRBIT(fDataFlag,kIsRootData); }
+    void   SetMC      ( const Bool_t b=kTRUE )  { b ? SETBIT(fDataFlag,kIsMC)       : CLRBIT(fDataFlag,kIsMC);       }
 
 public:
