Ignore:
Timestamp:
04/13/05 17:30:51 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhbase/MBinning.cc

    r6932 r6938  
    9191// --------------------------------------------------------------------------
    9292//
     93// Initialize Binning from an axis of a TH1. If no title given,
     94// a title combined from the axis titles and the TH1 title is
     95// used.
     96//
     97MBinning::MBinning(const TH1 &h, const Char_t axis, const char *name, const char *title)
     98{
     99    fName  = name  ? name : gsDefName.Data();
     100    fTitle = title ? Form("%s;%s;%s;%s", h.GetTitle(),
     101                          h.GetXaxis()->GetTitle(),
     102                          h.GetYaxis()->GetTitle(),
     103                          h.GetZaxis()->GetTitle()) : gsDefTitle.Data();
     104
     105    SetEdges(h, axis);
     106}
     107
     108// --------------------------------------------------------------------------
     109//
     110// Initialize Binning from TAxis.
     111//
     112MBinning::MBinning(const TAxis &axis, const char *name, const char *title)
     113{
     114    fName  = name  ? name : gsDefName.Data();
     115    fTitle = title ? title : gsDefTitle.Data();
     116
     117    SetEdges(axis);
     118}
     119
     120// --------------------------------------------------------------------------
     121//
    93122// Search in the parameter list for the binning with name "name". If found,
    94123// set the edges and title accordingly. Default is name of object.
     
    412441    *fLog << all;
    413442    *fLog << GetDescriptor() << ": nbins=" << GetNumBins() << " [";
    414     *fLog << GetEdgeLo() << ", " << GetEdgeHi() << "] ";
     443    *fLog << GetEdgeLo() << ", " << GetEdgeHi() << "] <";
    415444    switch (fType)
    416445    {
    417     case kIsDefault:     *fLog << "deafult"; break;
     446    case kIsDefault:     *fLog << "default"; break;
    418447    case kIsLinear:      *fLog << "linear"; break;
    419448    case kIsLogarithmic: *fLog << "logarithmic"; break;
  • trunk/MagicSoft/Mars/mhbase/MBinning.h

    r5971 r6938  
    4141    MBinning(Int_t nbins, Axis_t lo, Axis_t hi, const char *name=0, const char *opt="", const char *title=NULL);
    4242    MBinning(const MBinning &bins) { SetEdges(bins); }
     43    MBinning(const TH1 &h, const Char_t axis='x', const char *name=0, const char *title=0);
     44    MBinning(const TAxis &a, const char *name=0, const char *title=0);
    4345
    4446    void Copy(TObject &named) const
Note: See TracChangeset for help on using the changeset viewer.