Index: trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc
===================================================================
--- trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 7392)
+++ trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc	(revision 7408)
@@ -61,4 +61,10 @@
 //
 //
+//  If using SetFormula you can specify formulas accepted by TF1, eg:
+//      pow(X, -2.6)
+//  (Rem: all capital (!) 'X' are replaced by the corresponding %s.fEnergy
+//        automatically)
+//
+//
 //  Input Containers:
 //    MMcEvt
@@ -218,5 +224,9 @@
 TString MMcSpectrumWeight::GetFormulaSpecNew() const
 {
-    return fFormula.IsNull() ? Form("pow(%s.fEnergy, %.3f)", fNameMcEvt.Data(), fNewSlope) : fFormula;
+    TString str = fFormula.IsNull() ? Form("pow(%s.fEnergy, %.3f)", fNameMcEvt.Data(), fNewSlope) : fFormula;
+    if (!fFormula.IsNull())
+        str.ReplaceAll("X", Form("(%s.fEnergy)", fNameMcEvt.Data()));
+
+    return str;
 }
 
