Changeset 1994


Ignore:
Timestamp:
04/23/03 16:58:05 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r1992 r1994  
    3636//     which has to be filled. This can be done by either specifing the     //
    3737//     name of the objects in the parameter list or by specifiing a pointer //
    38 //     to the object. (s. Constructor)                                      //                  //
     38//     to the object. (s. Constructor)                                      //
    3939//                                                                          //
    4040//  2) You specify the name and/or type of the histogram to become filled.  //
     
    4949//           a NULL pointer or a pointer to the corresponding container     //
    5050//           as an argument.                                                //
     51//                                                                          //
     52// To use a weight for each event filled in a histogram call                //
     53// SetWeight(). You can eithe use the name of a MWeight container stored    //
     54// in the parameter list or a pointer to it as an argument.                 //
     55//                                                                          //
    5156//                                                                          //
    5257//  WARNING:                                                                //
     
    505510        fParContainer->SavePrimitive(out);
    506511
     512    if (fWeight)
     513        fWeight->SavePrimitive(out);
     514
    507515    out << "   MFillH " << GetUniqueName() << "(";
    508516
     
    520528    out << ");" << endl;
    521529
    522     if (!fIndex)
    523         return;
    524 
    525     out << "   " << GetUniqueName() << ".SetRuleForIdx(\"";
    526     out << fIndex->GetRule() << "\");" << endl;
    527 }
     530    if (fWeight || !fWeightName.IsNull())
     531    {
     532        out << "   " << GetUniqueName() << ".SetWeight(";
     533        if (fWeight)
     534            out << "&" << fWeight->GetUniqueName() << ");" << endl;
     535        else
     536            if (!fWeightName.IsNull())
     537                out << "\"" << fWeightName << "\");" << endl;
     538    }
     539
     540    if (fIndex)
     541    {
     542        out << "   " << GetUniqueName() << ".SetRuleForIdx(\"";
     543        out << fIndex->GetRule() << "\");" << endl;
     544    }
     545}
  • trunk/MagicSoft/Mars/mhist/MFillH.h

    r1992 r1994  
    1717{
    1818private:
    19     MParContainer *fParContainer;
    20     TString fParContainerName;
     19    MParContainer *fParContainer; // Pointer to the data container storing
     20    TString fParContainerName;    // Name to a data container
    2121
    22     MH* fH;
    23     TString fHName;
     22    MH* fH;                       // Pointer to the MH container to get filled
     23    TString fHName;               // Name to a MH container to get filled
    2424
    25     MWeight *fWeight;
    26     TString fWeightName;
     25    MWeight *fWeight;             // Pointer to the container storing a weight
     26    TString fWeightName;          // Name of a container storing a weight
    2727
    28     MData *fIndex;    // MData object describing the 'key' to an automatic index for an MHArray
    29     MMap  *fMapIdx;   //! Map to map key-index-pair for an MHArray (MMap see MFillH.cc)
     28    MData *fIndex;                // MData object describing the 'key' to an automatic index for an MHArray
     29    MMap  *fMapIdx;               //! Map to map key-index-pair for an MHArray (MMap see MFillH.cc)
    3030
    31     TCanvas *fCanvas;
     31    TCanvas *fCanvas;             //! Canvas used to update a MStatusDisplay at the end of a loop
    3232
    3333    TString ExtractName(const char *name) const;
     
    5858    Bool_t PostProcess();
    5959
    60     ClassDef(MFillH, 1) // Task to fill a histogram with data from a parameter container
     60    ClassDef(MFillH, 2) // Task to fill a histogram with data from a parameter container
    6161};
    6262   
Note: See TracChangeset for help on using the changeset viewer.