Index: trunk/MagicSoft/Mars/mhist/MFillH.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1993)
+++ trunk/MagicSoft/Mars/mhist/MFillH.cc	(revision 1994)
@@ -36,5 +36,5 @@
 //     which has to be filled. This can be done by either specifing the     //
 //     name of the objects in the parameter list or by specifiing a pointer //
-//     to the object. (s. Constructor)                                      //                  //
+//     to the object. (s. Constructor)                                      //
 //                                                                          //
 //  2) You specify the name and/or type of the histogram to become filled.  //
@@ -49,4 +49,9 @@
 //           a NULL pointer or a pointer to the corresponding container     //
 //           as an argument.                                                //
+//                                                                          //
+// To use a weight for each event filled in a histogram call                //
+// SetWeight(). You can eithe use the name of a MWeight container stored    //
+// in the parameter list or a pointer to it as an argument.                 //
+//                                                                          //
 //                                                                          //
 //  WARNING:                                                                //
@@ -505,4 +510,7 @@
         fParContainer->SavePrimitive(out);
 
+    if (fWeight)
+        fWeight->SavePrimitive(out);
+
     out << "   MFillH " << GetUniqueName() << "(";
 
@@ -520,8 +528,18 @@
     out << ");" << endl;
 
-    if (!fIndex)
-        return;
-
-    out << "   " << GetUniqueName() << ".SetRuleForIdx(\"";
-    out << fIndex->GetRule() << "\");" << endl;
-}
+    if (fWeight || !fWeightName.IsNull())
+    {
+        out << "   " << GetUniqueName() << ".SetWeight(";
+        if (fWeight)
+            out << "&" << fWeight->GetUniqueName() << ");" << endl;
+        else
+            if (!fWeightName.IsNull())
+                out << "\"" << fWeightName << "\");" << endl;
+    }
+
+    if (fIndex)
+    {
+        out << "   " << GetUniqueName() << ".SetRuleForIdx(\"";
+        out << fIndex->GetRule() << "\");" << endl;
+    }
+}
Index: trunk/MagicSoft/Mars/mhist/MFillH.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MFillH.h	(revision 1993)
+++ trunk/MagicSoft/Mars/mhist/MFillH.h	(revision 1994)
@@ -17,17 +17,17 @@
 {
 private:
-    MParContainer *fParContainer;
-    TString fParContainerName;
+    MParContainer *fParContainer; // Pointer to the data container storing
+    TString fParContainerName;    // Name to a data container
 
-    MH* fH;
-    TString fHName;
+    MH* fH;                       // Pointer to the MH container to get filled
+    TString fHName;               // Name to a MH container to get filled
 
-    MWeight *fWeight;
-    TString fWeightName;
+    MWeight *fWeight;             // Pointer to the container storing a weight
+    TString fWeightName;          // Name of a container storing a weight
 
-    MData *fIndex;    // MData object describing the 'key' to an automatic index for an MHArray
-    MMap  *fMapIdx;   //! Map to map key-index-pair for an MHArray (MMap see MFillH.cc)
+    MData *fIndex;                // MData object describing the 'key' to an automatic index for an MHArray
+    MMap  *fMapIdx;               //! Map to map key-index-pair for an MHArray (MMap see MFillH.cc)
 
-    TCanvas *fCanvas;
+    TCanvas *fCanvas;             //! Canvas used to update a MStatusDisplay at the end of a loop
 
     TString ExtractName(const char *name) const;
@@ -58,5 +58,5 @@
     Bool_t PostProcess();
 
-    ClassDef(MFillH, 1) // Task to fill a histogram with data from a parameter container
+    ClassDef(MFillH, 2) // Task to fill a histogram with data from a parameter container
 };
     
