Index: trunk/MagicSoft/Mars/callisto.cc
===================================================================
--- trunk/MagicSoft/Mars/callisto.cc	(revision 6751)
+++ trunk/MagicSoft/Mars/callisto.cc	(revision 6752)
@@ -508,6 +508,5 @@
         job2.SetDataType(kDataType);
         job2.SetPulsePosCheck();
-        // job1.SetPathOut(kOutpathC); // not yet needed
-        // job1.SetPathIn(kInpathC);   // not yet needed
+        job2.SetPathOut(kOutpathY); // for updating the extractor
 
         job2.SetUseData();
Index: trunk/MagicSoft/Mars/callisto.rc
===================================================================
--- trunk/MagicSoft/Mars/callisto.rc	(revision 6751)
+++ trunk/MagicSoft/Mars/callisto.rc	(revision 6752)
@@ -298,4 +298,16 @@
 MJPedestalY3.MaxEvents: 500
 
+# -------------------------------------------------------------------------
+# Use Pulse Position check to define the extraction ranges for the data?
+# -------------------------------------------------------------------------
+#MJPedestalY2.PulsePosCheck: yes
+#MJCalibrateSignal.ModifiedExtractWin: yes
+# -------------------------------------------------------------------------
+# Define the Pulse Position check parameters:
+# -------------------------------------------------------------------------
+#MJPedestalY2.MHCalibrationPulseTimeCam.SaturationLimit:  255
+#MJPedestalY2.MHCalibrationPulseTimeCam.LowerSignalLimit: 100
+#MJPedestalY2.MHCalibrationPulseTimeCam.NumPixelsRequired: 2
+
 #MJPedestalY.ExtractPedestal: MPedCalcFromLoGain
 #MJPedestalY.ExtractPedestal.PedestalUpdate:   no
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6751)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc	(revision 6752)
@@ -122,8 +122,10 @@
 // - fIsRelTimesUpdate to kFALSE
 // - fIsHiLoCalibration to kFALSE
+// - fIsModifiedExtractWin to kTRUE
 // - fPulsePosCheck to kTRUE
 //
 MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title)
-    : fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), fIsHiLoCalibration(kFALSE)
+    : fIsInterlaced(kTRUE), fIsRelTimesUpdate(kFALSE), 
+      fIsHiLoCalibration(kFALSE), fIsModifiedExtractWin(kTRUE)
 {
     fName  = name  ? name  : "MJCalibrateSignal";
@@ -207,4 +209,36 @@
     cont.Add(&cam);
     return ReadContainer(cont);
+}
+
+Bool_t MJCalibrateSignal::ReadExtractorCosmics(MExtractor* &ext1) const
+{
+
+  const TString fname = Form("pedy%08d.root",fSequence.GetSequence());
+
+  *fLog << inf << "Reading from file: " << fname << endl;
+
+  TFile file(fname, "READ");
+  if (!file.IsOpen())
+    {
+      *fLog << warn << "Could not find or open file " << fname << endl;
+      return kFALSE;
+    }
+
+  TObject *o = file.Get("ExtractSignal");
+  if (o && !o->InheritsFrom(MExtractor::Class()))
+    {
+      *fLog << err << dbginf << "ERROR - ExtractSignal read from " << fname << " doesn't inherit from MExtractor!" << endl;
+      return kFALSE;
+    }
+  if (o)
+    {
+      delete ext1;
+      ext1 = (MExtractor*)o->Clone();
+    }
+  else
+    *fLog << warn << "No signal extractor found in " << fname << endl;
+
+  file.Close();
+  return kTRUE;
 }
 
@@ -222,4 +256,5 @@
     SetRelTimesUpdate(GetEnv("RelTimesUpdate", fIsRelTimesUpdate));
     SetHiLoCalibration(GetEnv("HiLoCalibration", fIsHiLoCalibration));
+    SetModifiedExtractWin(GetEnv("ModifiedExtractWin", fIsModifiedExtractWin));
 
     return MJCalib::CheckEnvLocal();
@@ -339,4 +374,5 @@
         *fLog << endl;
 	extractor3 = (MExtractor*)extractor1->Clone();
+        
     }
     else
@@ -356,4 +392,8 @@
     else
         *fLog << inf << "No Camera geometry found using default <MGeomCamMagic>" << endl;
+
+    if (fIsModifiedExtractWin)
+      if (!ReadExtractorCosmics(extractor1))
+        *fLog << warn << "No extraction window update for signal extractor found" << endl;
 
     // This is necessary for the case in which it is not in the files
Index: trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h
===================================================================
--- trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h	(revision 6751)
+++ trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.h	(revision 6752)
@@ -26,4 +26,5 @@
     Bool_t fIsRelTimesUpdate;           // Choose to update relative times from interlaced
     Bool_t fIsHiLoCalibration;          // Choose to calibrate the high-gain vs. low-gains
+    Bool_t fIsModifiedExtractWin;       // Choose to use the modified extraction window from pulse position
     
     Bool_t CheckEnvLocal();
@@ -34,4 +35,5 @@
     Bool_t ReadCalibration(TObjArray &o, MBadPixelsCam &bpix,
                            MExtractor* &ext1, MExtractor* &ext2, TString &geom) const;
+    Bool_t ReadExtractorCosmics(MExtractor* &ext1) const;
 
     const char*  GetInputFileName() const;
@@ -47,4 +49,5 @@
     void SetRelTimesUpdate ( const Bool_t b=kTRUE )  { fIsRelTimesUpdate  = b; }
     void SetHiLoCalibration( const Bool_t b=kTRUE )  { fIsHiLoCalibration = b; }
+    void SetModifiedExtractWin( const Bool_t b=kTRUE )  { fIsModifiedExtractWin = b; }
 
     //    void SetInputCal    ( MRunIter *iter       )  { fCruns = iter; }
