Ignore:
Timestamp:
04/21/04 15:38:08 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhbase
Files:
4 edited

Legend:

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

    r2735 r3788  
    6161
    6262    SetEdges(10, 0, 1);
    63 
    6463    fType = kIsDefault;
    6564}
    6665
     66MBinning::MBinning(Int_t nbins, Axis_t lo, Axis_t hi, const char *name, const char *opt="", const char *title=NULL)
     67{
     68    fName  = name  ? name  : gsDefName.Data();
     69    fTitle = title ? title : gsDefTitle.Data();
     70
     71    SetEdges(nbins, lo, hi, opt);
     72
     73}
    6774void MBinning::SetEdges(const TAxis &axe)
    6875{
     
    110117
    111118    fType = kIsLinear;
     119}
     120
     121// --------------------------------------------------------------------------
     122//
     123// Calls SetEdgesLog if opt contains "log"
     124// Calls SetEdgesCos if opt contains "cos"
     125// Calls SetEdges in all other cases
     126//
     127void MBinning::SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up, const char *opt)
     128{
     129    const TString o(opt);
     130    if (o.Contains("log", TString::kIgnoreCase))
     131    {
     132        SetEdgesLog(nbins, lo, up);
     133        return;
     134    }
     135    if (o.Contains("cos", TString::kIgnoreCase))
     136    {
     137        SetEdgesCos(nbins, lo, up);
     138        return;
     139    }
     140    SetEdges(nbins, lo, up);
    112141}
    113142
  • trunk/MagicSoft/Mars/mhbase/MBinning.h

    r2735 r3788  
    3232public:
    3333    MBinning(const char *name=NULL, const char *title=NULL);
     34    MBinning(Int_t nbins, Axis_t lo, Axis_t hi, const char *name, const char *opt="", const char *title=NULL);
    3435
    3536    void SetEdges(const TArrayD &arr)
     
    4243    void SetEdges(const TH1 &h, const Char_t axis='x');
    4344    void SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up);
     45    void SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up, const char *opt);
    4446    void SetEdgesLog(const Int_t nbins, const Axis_t lo, Axis_t up);
    4547    void SetEdgesCos(const Int_t nbins, const Axis_t lo, Axis_t up);
  • trunk/MagicSoft/Mars/mhbase/MFillH.cc

    r3500 r3788  
    340340// --------------------------------------------------------------------------
    341341//
     342// Use this to set a draw option used when drawing automatically to the
     343// status display.
     344//
     345void MFillH::SetDrawOption(Option_t *option="")
     346{
     347    fDrawOption = option;
     348}
     349
     350// --------------------------------------------------------------------------
     351//
    342352// Creates a new tab in a status display with the name of the MH class,
    343353// if fDisplay is set and the MH-class overwrites the Draw function
     
    357367
    358368    fCanvas = &fDisplay->AddTab(fNameTab.IsNull() ? fH->GetName() : fNameTab.Data());
    359     fH->Draw();
     369    fH->Draw(fDrawOption);
    360370
    361371    return kTRUE;
     
    549559    if (fDisplay && fDisplay->HasCanvas(fCanvas))
    550560    {
     561        const TString opt(Form("nonew %s", fDrawOption));
    551562        fCanvas->cd();
    552         fH->DrawClone("nonew");
     563        fH->DrawClone(opt);
    553564        fCanvas->Modified();
    554565        fCanvas->Update();
  • trunk/MagicSoft/Mars/mhbase/MFillH.h

    r3500 r3788  
    3838    TCanvas *fCanvas;             //! Canvas used to update a MStatusDisplay at the end of a loop
    3939
     40    TString fDrawOption;          // Draw option for status display
     41
    4042    TString ExtractName(const char *name) const;
    4143    TString ExtractClass(const char *name) const;
     
    6365    void SetWeight(const char *name) { fWeightName = name; }
    6466
     67    void      SetDrawOption(Option_t *option="");
     68    Option_t *GetDrawOption() const { return fDrawOption; }
     69
    6570    Int_t  PreProcess(MParList *pList);
    6671    Bool_t ReInit(MParList *pList);
Note: See TracChangeset for help on using the changeset viewer.