Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 6837)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 6838)
@@ -25,4 +25,5 @@
    * callisto.cc:
      - set changed extractor in MJCalibrateSignal from MJPedestal
+      - don't process 'range finding' for MonteCarlo data
 
    * callisto.rc:
@@ -31,4 +32,7 @@
    * mjobs/MJCalibrateSignal.[h,cc]:
      - removed obsolete flag for ModifiedExtractWin
+     - allow also NULL for SetExtractor
+     - rearanged the too MWriteRootFile instantiations otherwise
+       callisto crashes in MWriteRootFile::ChangeFile
 
    * mdata/MDataChain.cc:
Index: /trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- /trunk/MagicSoft/Mars/callisto.cc	(revision 6837)
+++ /trunk/MagicSoft/Mars/callisto.cc	(revision 6838)
@@ -507,5 +507,5 @@
         job2.SetPathIn(kInpathY);
         job2.SetDataType(kDataType);
-        job2.SetPulsePosCheck();
+        job2.SetPulsePosCheck(kDataType!=MJCalib::kIsUseMC);
         job2.SetPathOut(kOutpathY); // for updating the extractor
 
@@ -576,5 +576,6 @@
         job4.SetPathData(kInpathD);
         job4.SetDataType(kDataType);
-        job4.SetExtractor(*job2.GetExtractor());
+        if (kDataType!=MJCalib::kIsUseMC)
+            job4.SetExtractor(job2.GetExtractor());
 
         // Where to search for calibration files
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6837)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6838)
@@ -140,10 +140,10 @@
 }
 
-void MJCalibrateSignal::SetExtractor(const MExtractor &ext)
+void MJCalibrateSignal::SetExtractor(const MExtractor *ext)
 {
     if (fExtractor)
         delete fExtractor;
 
-    fExtractor = (MExtractor*)ext.Clone();
+    fExtractor = ext ? (MExtractor*)ext->Clone() : NULL;
 }
 
@@ -647,4 +647,9 @@
     MTaskEnv fillflorian("FinalFantasy");
     fillflorian.SetDefault();
+
+    // Write the special MC tree
+    MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW");
+    writemc.SetName("WriteMC");
+    writemc.AddContainer("MMcEvtBasic", "OriginalMC");
 
     // The second rule is for the case reading raw-files!
@@ -695,9 +700,4 @@
     write.AddContainer("MTimeCC",                   "CC",         kFALSE);
 
-    // Write the special MC tree
-    MWriteRootFile writemc(2, fname, fOverwrite?"RECREATE":"NEW");
-    writemc.SetName("WriteMC");
-    writemc.AddContainer("MMcEvtBasic", "OriginalMC");
-
     // Now setup tasklist for events
     MTaskList tlist2;
Index: /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h	(revision 6837)
+++ /trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h	(revision 6838)
@@ -47,5 +47,5 @@
     void SetRelTimesUpdate ( const Bool_t b=kTRUE )  { fIsRelTimesUpdate  = b; }
 
-    void SetExtractor(const MExtractor &ext);
+    void SetExtractor(const MExtractor *ext=NULL);
 
     ClassDef(MJCalibrateSignal, 0) // Tool to create a pedestal file (MPedestalCam)
Index: /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
===================================================================
--- /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 6837)
+++ /trunk/MagicSoft/Mars/mjobs/MJPedestal.cc	(revision 6838)
@@ -1273,11 +1273,11 @@
             if (newlast+wshigain > data->GetNumHiGainSamples()+data->GetNumLoGainSamples()-1)
               {
-                *fLog << err << "Pulse is too much to the right, cannot go beyond limits! " 
-                      << " Cannot extract at all! ... " << endl;
+                *fLog << err << "Pulse is too much to the right, cannot go beyond limits! " << endl;
+                *fLog << " Cannot extract at all! ... " << endl;
                 return kFALSE;
               }
             if (newlast+wslogain > data->GetNumLoGainSamples())
               {
-                *fLog << err << "Pulse is too much to the right, cannot go beyond logaie limits! " << endl;
+                *fLog << err << "Pulse is too much to the right, cannot go beyond logain limits! " << endl;
                 *fLog << endl;
                 *fLog << "Try to use a different extractor (e.g. with a window size of only 4 sl.) or:" << endl;
