Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 2118)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 2119)
@@ -1,3 +1,8 @@
                                                  -*-*- END OF LINE -*-*-
+
+ 2003/05/16: Abelardo Moralejo
+
+   * mmontecarlo/MMcEnergyEst.[h,cc]
+     - Added SetCoeff
 
  2003/05/16: Thomas Bretz
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc	(revision 2118)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.cc	(revision 2119)
@@ -96,4 +96,43 @@
     SetHillasName("MHillas");
     SetHillasSrcName("MHillasSrc");
+
+    //
+    // Set initial values of the parameters (close enough to the final 
+    // ones, taken from previous runs of the procedure). Parameter 
+    // fA[4] is not used in the default energy estimation model (from 
+    // D. Kranich).
+    //
+    fA.Set(5);
+    fB.Set(7);
+
+    fA[0] =  21006.2;
+    fA[1] = -43.2648;
+    fA[2] = -690.403;
+    fA[3] = -0.0428544;
+    fA[4] =  1.;
+    fB[0] = -3391.05;
+    fB[1] =  136.58;
+    fB[2] =  0.253807;
+    fB[3] =  254.363;
+    fB[4] =  61.0386;
+    fB[5] = -0.0190984;
+    fB[6] = -421695;
+}
+
+Bool_t MMcEnergyEst::SetCoeff(TArrayD &coeff)
+{
+  if (coeff.GetSize() != fA.GetSize()+fB.GetSize())
+    {
+      *fLog << err << dbginf << "Wrong number of parameters!" << endl;
+      return(kFALSE);
+    }
+
+  for (Int_t i = 0; i < fA.GetSize(); i++)
+    fA[i] = coeff[i];
+  for (Int_t i = 0; i < fB.GetSize(); i++)
+    fB[i] = coeff[i+fA.GetSize()];
+
+  return(kTRUE);
+
 }
 
@@ -196,25 +235,4 @@
 
   //
-  // Set initial values of the parameters (close enough to the final ones, taken
-  // from previous runs of the procedure). Parameter fA[4] is not used in the default
-  // energy estimation model (from D. Kranich).
-  //
-  fA.Set(5);
-  fB.Set(7);
-
-  fA[0] =  21006.2;
-  fA[1] = -43.2648;
-  fA[2] = -690.403;
-  fA[3] = -0.0428544;
-  fA[4] =  1.;
-  fB[0] = -3391.05;
-  fB[1] =  136.58;
-  fB[2] =  0.253807;
-  fB[3] =  254.363;
-  fB[4] =  61.0386;
-  fB[5] = -0.0190984;
-  fB[6] = -421695;
-
-  //
   // Set starting values and step sizes for parameters
   //
Index: /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.h
===================================================================
--- /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.h	(revision 2118)
+++ /trunk/MagicSoft/Mars/mmontecarlo/MMcEnergyEst.h	(revision 2119)
@@ -44,4 +44,6 @@
   Double_t GetCoeff(Int_t i) { return i<fA.GetSize()? fA[i] : fB[i-fA.GetSize()]; }
 
+  Bool_t SetCoeff(TArrayD &coeff);
+
   void FindParams();
   void Print(Option_t *o="");
