Ignore:
Timestamp:
11/21/05 11:09:12 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhbase
Files:
5 edited

Legend:

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

    r7151 r7413  
    242242// lowest <lo> and highest <up> Edge (of your histogram)
    243243//
    244 void MBinning::SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up)
    245 {
     244void MBinning::SetEdgesLin(Int_t nbins, Axis_t lo, Axis_t up)
     245{
     246    if (nbins<=0)
     247    {
     248        *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl;
     249        nbins = 1;
     250    }
     251
     252    if (up<lo)
     253    {
     254        *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl;
     255
     256        const Axis_t dummy(lo);
     257        lo = up;
     258        up = dummy;
     259    }
     260
    246261    const Double_t binsize = nbins<=0 ? 0 : (up-lo)/nbins;
    247262    fEdges.Set(nbins+1);
     
    402417// lowest <lo> and highest <up> Edge (of your histogram)
    403418//
    404 void MBinning::SetEdgesLog(const Int_t nbins, const Axis_t lo, Axis_t up)
     419void MBinning::SetEdgesLog(Int_t nbins, Axis_t lo, Axis_t up)
    405420{
    406421    // if (lo==0) ...
     422    if (nbins<=0)
     423    {
     424        *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl;
     425        nbins = 1;
     426    }
     427
     428    if (up<lo)
     429    {
     430        *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl;
     431
     432        const Axis_t dummy(lo);
     433        lo = up;
     434        up = dummy;
     435    }
    407436
    408437    const Double_t binsize = log10(up/lo)/nbins;
     
    419448// lowest [deg] <lo> and highest [deg] <up> Edge (of your histogram)
    420449//
    421 void MBinning::SetEdgesCos(const Int_t nbins, const Axis_t lo, Axis_t up)
    422 {
     450void MBinning::SetEdgesCos(Int_t nbins, Axis_t lo, Axis_t up)
     451{
     452    if (nbins<=0)
     453    {
     454        *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl;
     455        nbins = 1;
     456    }
     457
     458    if (up<lo)
     459    {
     460        *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl;
     461
     462        const Axis_t dummy(lo);
     463        lo = up;
     464        up = dummy;
     465    }
     466
    423467    // if (lo==0) ...
    424468    const Axis_t ld = lo/kRad2Deg;
     
    436480// lowest [deg] <lo> and highest [deg] <up> Edge (of your histogram)
    437481//
    438 void MBinning::SetEdgesASin(const Int_t nbins, Axis_t lo, Axis_t up)
    439 {
     482void MBinning::SetEdgesASin(Int_t nbins, Axis_t lo, Axis_t up)
     483{
     484    if (nbins<=0)
     485    {
     486        *fLog << warn << "WARNING - Number of bins cannot be <= 0... reset to 1." << endl;
     487        nbins = 1;
     488    }
     489
     490    if (up<lo)
     491    {
     492        *fLog << warn << "WARNING - Upper edge must be greater than lower edge... exchanging." << endl;
     493
     494        const Axis_t dummy(lo);
     495        lo = up;
     496        up = dummy;
     497    }
     498
    440499    const Double_t binsize = nbins<=0 ? 0 : (up-lo)/nbins;
    441500    fEdges.Set(nbins+1);
  • trunk/MagicSoft/Mars/mhbase/MBinning.h

    r7142 r7413  
    6262    void SetEdges(const MBinning &bins) { SetEdges(bins.fEdges); fType = bins.fType; fTitle = bins.fTitle; }
    6363    void SetEdges(const TH1 &h, const Char_t axis='x');
    64     void SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up);
     64    void SetEdges(Int_t nbins, const Axis_t lo, const Axis_t up) { SetEdgesLin(nbins, lo, up); }
    6565    void SetEdges(const Int_t nbins, const Axis_t lo, Axis_t up, const char *opt);
    66     void SetEdgesLog(const Int_t nbins, const Axis_t lo, Axis_t up);
    67     void SetEdgesCos(const Int_t nbins, const Axis_t lo, Axis_t up);
    68     void SetEdgesASin(const Int_t nbins, Axis_t lo, Axis_t up);
     66    void SetEdgesLin(Int_t nbins, Axis_t lo, Axis_t up);
     67    void SetEdgesLog(Int_t nbins, Axis_t lo, Axis_t up);
     68    void SetEdgesCos(Int_t nbins, Axis_t lo, Axis_t up);
     69    void SetEdgesASin(Int_t nbins, Axis_t lo, Axis_t up);
    6970
    7071    Int_t FindLoEdge(Double_t val) const
  • trunk/MagicSoft/Mars/mhbase/MH3.cc

    r6917 r7413  
    561561    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
    562562    pad->SetBorderMode(0);
     563    pad->SetGridx();
     564    pad->SetGridy();
    563565
    564566    fHist->SetFillStyle(4000);
  • trunk/MagicSoft/Mars/mhbase/MHMatrix.cc

    r7399 r7413  
    209209}
    210210
     211void MHMatrix::AddColumns(const TCollection &list)
     212{
     213    TIter Next(&list);
     214    TObject *obj = 0;
     215    while ((obj=Next()))
     216        AddColumn(obj->GetName());
     217}
     218
     219
    211220// --------------------------------------------------------------------------
    212221//
  • trunk/MagicSoft/Mars/mhbase/MHMatrix.h

    r7399 r7413  
    7373    Int_t AddColumn(const char *name);
    7474    void AddColumns(MDataArray *mat);
     75    void AddColumns(const TCollection &list);
    7576
    7677    //MDataArray *GetColumns() { return fData; }
Note: See TracChangeset for help on using the changeset viewer.