Changeset 10056 for trunk/Mars/mhbase


Ignore:
Timestamp:
11/22/10 16:11:05 (14 years ago)
Author:
tbretz
Message:
Added scale factor for time axis in MH3.
Location:
trunk/Mars/mhbase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mhbase/MH3.cc

    r9858 r10056  
    214214    fScale[1] = 1;
    215215    fScale[2] = 1;
     216    fScale[3] = 1;
    216217
    217218    fConversion = NULL;
     
    789790    {
    790791    case -3:
    791         t = fData[3]->GetValue();
     792        t = fData[3]->GetValue()*fScale[3];
    792793    case -2:
    793794    case  3:
     
    800801    }
    801802
    802     if (fData[4])
    803         w *= fData[4]->GetValue();
     803    if (fWeight)
     804        w *= fWeight->GetValue();
    804805
    805806    // If label option is set, convert value to label
     
    12661267    switch (fDimension)
    12671268    {
     1269    case -3:
     1270        h->SetScaleZ(fScale[3]);
    12681271    case -2:
    12691272    case 3:
     
    12761279    }
    12771280
    1278     if (fData[4])
    1279         h->SetWeight(fData[4]->GetRule());
     1281    if (fWeight)
     1282        h->SetWeight(fWeight->GetRule());
    12801283
    12811284    return h;
  • trunk/Mars/mhbase/MH3.h

    r9858 r10056  
    7171    MData      *fWeight;         // Additional weight
    7272    MBinning   *fBins[3];        // Binning set omitting the parlist access
    73     Double_t    fScale[3];       // Scale for the three axis (eg unit)
     73    Double_t    fScale[4];       // Scale for the three axis (eg unit)
    7474    Byte_t      fStyleBits;      // Set the range of a histogram automatically in Finalize
    7575
     
    100100    void SetScaleY(Double_t scale) { fScale[1] = scale; }
    101101    void SetScaleZ(Double_t scale) { fScale[2] = scale; }
    102     void SetScale(Double_t x, Double_t y=1, Double_t z=2) { SetScaleX(x); SetScaleY(y); SetScaleZ(z); }
     102    void SetScaleT(Double_t scale) { fScale[3] = scale; }
     103    void SetScale(Double_t x, Double_t y=1, Double_t z=1, Double_t t=1) { SetScaleX(x); SetScaleY(y); SetScaleZ(z); SetScaleT(t); }
    103104
    104105    void SetLogx(Bool_t b=kTRUE) { b ? fHist->SetBit(kIsLogx) : fHist->ResetBit(kIsLogx); }
Note: See TracChangeset for help on using the changeset viewer.