Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7098)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.cc	(revision 7099)
@@ -635,5 +635,4 @@
     {
         SetNameWeightsFile(GetEnvValue(env, prefix, "WeightsFile", ""));
-        *fLog << all << "**********> " << fNameWeightsFile << endl;
         rc = kTRUE;
     }
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h	(revision 7098)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeDigitalFilter.h	(revision 7099)
@@ -17,8 +17,9 @@
 class TH2F;
 class MPedestalPix;
+class MCalibrationPattern;
+
 class MExtractTimeAndChargeDigitalFilter : public MExtractTimeAndCharge
 {
 private:
-
   static const Byte_t fgHiGainFirst;             //! Default for fHiGainFirst       (now set to: 0)
   static const Byte_t fgHiGainLast;              //! Default for fHiGainLast        (now set to:14)
@@ -34,4 +35,6 @@
   static const Float_t fgOffsetLoGain;           //! Default for fOffsetLoGain (now set to 1.7)
   static const Float_t fgLoGainStartShift;       //! Default for fLoGainStartShift (now set to -1.8)
+
+  MCalibrationPattern  *fCalibPattern;          //! Calibration DM pattern
   
   MArrayF fHiGainSignal;                        //! Need fast access to the signals in a float way
@@ -59,20 +62,28 @@
   MArrayF fTimeWeightsLoGain;                   //! Time weights Low-Gain (from weights file)
 
-  TString fNameWeightsFile;                     //  Name of the weights file
-  Bool_t  fWeightsSet;                          //! Flag if weights have alreayd been set
+  TString fNameWeightsFile;                     // Name of the weights file
+  Bool_t  fAutomaticWeights;                    // Flag whether weight should be determined automatically
+  TString fNameWeightsFileSet;                  //! Flag if weights have alreayd been set
   Int_t   fRandomIter;                          //! Counter used to randomize weights for noise calculation
 
-  Bool_t  InitArrays();
+  // MExtractTimeAndChargeDigitalFilter
+  void    CalcBinningResArrays();
+  Bool_t  ReadAutomaticWeightsFile();
 
-  void CalcBinningResArrays();
+  // MExtractTimeAndCharge
+  Bool_t InitArrays();
+
+  // MTask
+  Int_t PreProcess(MParList *pList);
 
 protected:
-  
-  Int_t   ReadEnv(const TEnv &env, TString prefix, Bool_t print);
+  // MParContainer
+  Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
 
 public:
+  MExtractTimeAndChargeDigitalFilter(const char *name=NULL, const char *title=NULL);
+  ~MExtractTimeAndChargeDigitalFilter() { }
 
-  MExtractTimeAndChargeDigitalFilter(const char *name=NULL, const char *title=NULL);  
-  ~MExtractTimeAndChargeDigitalFilter() { }
+  Bool_t ReadWeightsFile(TString filename);
   
   Bool_t WriteWeightsFile(TString filename,
@@ -80,7 +91,7 @@
                           TH1F *shapelo=NULL, TH2F *autocorrlo=NULL );
 
-  Bool_t ReadWeightsFile(TString filename);
 
-  void SetNameWeightsFile( TString s = fgNameWeightsFile )   { fNameWeightsFile = s; }
+  void SetNameWeightsFile(TString s="") { fNameWeightsFile = s; fNameWeightsFileSet=""; }
+  void EnableAutomaticWeights(Bool_t b=kTRUE) { fAutomaticWeights = b; }
 
   void SetBinningResolution(const Int_t rh=fgBinningResolutionHiGain, const Int_t rl=fgBinningResolutionLoGain)  {
@@ -100,7 +111,5 @@
   const char* GetNameWeightsFile() const  { return fNameWeightsFile.Data(); }
 
-  void Print(Option_t *o="") const;
-
-  Bool_t IsWeightsSet() const  { return fWeightsSet;  }
+  void Print(Option_t *o="") const; //*MENU*
 
   void FindTimeAndChargeHiGain(Byte_t *firstused, Byte_t *logain, Float_t &sum, Float_t &dsum,
Index: trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc	(revision 7098)
+++ trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc	(revision 7099)
@@ -157,5 +157,5 @@
 const Float_t MExtractTimeAndChargeSpline::fgResolution       = 0.05;
 const Float_t MExtractTimeAndChargeSpline::fgRiseTimeHiGain   = 0.5;
-const Float_t MExtractTimeAndChargeSpline::fgFallTimeHiGain   = 1.5;
+const Float_t MExtractTimeAndChargeSpline::fgFallTimeHiGain   = 0.5;
 const Float_t MExtractTimeAndChargeSpline::fgLoGainStretch    = 1.5;
 const Float_t MExtractTimeAndChargeSpline::fgOffsetLoGain     = 1.7;  // 5 ns
Index: trunk/MagicSoft/Mars/msignal/Makefile
===================================================================
--- trunk/MagicSoft/Mars/msignal/Makefile	(revision 7098)
+++ trunk/MagicSoft/Mars/msignal/Makefile	(revision 7099)
@@ -20,5 +20,6 @@
 #
 INCLUDES =  -I. -I../mbase -I../mgui -I../mraw -I../manalysis \
-            -I../mgeom -I../mtools -I../mpedestal -I../mbadpixels
+            -I../mgeom -I../mtools -I../mpedestal -I../mbadpixels \
+            -I../mcalib
 
 # mgui (MCamEvent):         MExtractSignalCam
