Ignore:
Timestamp:
08/15/07 18:06:11 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r8082 r8669  
    1818!   Author(s): Thomas Bretz  2002 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2007
    2121!
    2222!
     
    4141//   "MyHillas.fLength"
    4242//
     43// If you want to use a different unit for histogramming use SetScaleX,
     44// SetScaleY and SetScaleZ.
     45//
     46//
     47// Binning name
     48// ============
     49//
    4350// The axis binning is retrieved from the parameter list, too. Create a
    4451// MBinning with the name "Binning" plus the name of your MH3 container
    4552// plus the axis name ("X", "Y" or "Z") and add it to the parameter list.
    4653//
    47 // If you want to use a different unit for histogramming use SetScaleX,
    48 // SetScaleY and SetScaleZ.
     54// If the binning should have a different name than the histogram name
     55// the binning name can be added to the name, eg.:
     56//    SetName("MyHistName;MyBinning")
     57// Instead of BinningMyHistName[XYZ] the parameter list will be searched
     58// for BinningMyBinning[XYZ].
    4959//
    5060//
     
    5969//    the axis titles. For more information see TH1::SetTitle, eg.
    6070//       SetTitle("MyHist;x[mm];y[cm];Counts");
     71//
    6172//
    6273// For example:
     
    301312    fHist->Reset();
    302313
     314    const Int_t split = fName.First(';');
     315
     316    const TString name = split<0 ? fName : fName(0, split);
     317    const TString bins = split<0 ? fName : fName(split+1, fName.Length());
     318
    303319    TString bname("Binning");
    304     bname += fName;
     320    bname += bins;
    305321
    306322    MBinning *binsx = NULL;
     
    364380
    365381    TString title("Histogram for ");
    366     title += fName;
     382    title += name;
    367383    title += Form(" (%dD)", fDimension);
    368384
    369     fHist->SetName(fName);
     385    fHist->SetName(name);
    370386    fHist->SetTitle(fTitle==gsDefTitle ? title : fTitle);
    371387    fHist->SetDirectory(0);
     
    577593
    578594    const Bool_t only  = str.Contains("only")  && fDimension==2;
    579     const Bool_t same  = str.Contains("same")  && fDimension==2;
     595    const Bool_t same  = str.Contains("same")  && fDimension<3;
    580596    const Bool_t blue  = str.Contains("blue")  && fDimension==2;
    581597    const Bool_t profx = str.Contains("profx") && fDimension==2;
     
    587603    str.ReplaceAll("profy", "");
    588604    str.ReplaceAll(" ", "");
     605
     606    if (same && fDimension==1)
     607    {
     608        fHist->SetLineColor(kBlue);
     609        fHist->SetMarkerColor(kBlue);
     610    }
    589611
    590612    // FIXME: We may have to remove all our own options from str!
Note: See TracChangeset for help on using the changeset viewer.