Changeset 8669 for trunk


Ignore:
Timestamp:
08/15/07 18:06:11 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8668 r8669  
    3232     - fixed a bug in the quality cuts (all showers with saturating
    3333       hi-gains were removed)
     34
     35   * mhbase/MH3.cc:
     36     - allow to split the histogram name and the binning name
     37     - set a different line color in case of the "same" option
    3438
    3539
  • 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!
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r8662 r8669  
    760760    MSrcPosRndm srcrndm;
    761761
     762    MH3 hvs("MPointingPos.fZd");
     763    hvs.SetName("ThetaOff;Theta");
     764    hvs.SetTitle("Effective On-Time vs. Zenith Angle;\\Theta [\\circ];T_{on} [s]");
     765
     766    MFillH fillvs(&hvs, "", "FillOnTime");
     767    if (!set.IsMonteCarlo())
     768        fillvs.SetWeight("MEffectiveOnTime");
     769    fillvs.SetNameTab("OnTime");
     770
     771    // It is not really necessary to re-calculate the image parameters
     772    // for the the on-source for MCs, but it is done for symmetry reasons
     773    if (set.IsMonteCarlo())
     774        tlist2.AddToList(&fillvs);
     775
    762776    tlist2.AddToList(&scalc);
    763777    tlist2.AddToList(&scor);
     
    808822
    809823    tlist.AddToList(&readoff);
     824    if (!set.IsMonteCarlo())
     825        tlist.AddToList(&fillvs, "EffectiveOnTime");
    810826    if (gLog.GetDebugLevel()>4)
    811827        tlist.AddToList(&print2, "EffectiveOnTime");
     
    917933     fillvs.SetNameTab("OnTime");
    918934     */
    919     MH3 hvs("MPointingPos.fZd");
    920     hvs.SetName("Theta");
    921     hvs.SetTitle("Effective On-Time vs. Zenith Angle;\\Theta [\\circ];T_{on} [s]");
    922     MFillH fillvs(&hvs, "", "FillOnTime");
    923     if (!set.IsMonteCarlo())
    924         fillvs.SetWeight("MEffectiveOnTime");
    925     fillvs.SetNameTab("OnTime");
    926935
    927936    /*
     
    962971    if (set.IsWobbleMode() && !set.IsMonteCarlo())
    963972        tlist2.AddToListBefore(&fillsrc, &hcalc);
     973
     974    MH3 hvs2("MPointingPos.fZd");
     975    hvs2.SetName("Theta");
     976    hvs2.SetTitle("Effective On-Time vs. Zenith Angle;\\Theta [\\circ];T_{on} [s]");
     977
     978    MFillH fillvs2(&hvs2, "", "FillOnTime");
     979    if (!set.IsMonteCarlo())
     980        fillvs2.SetWeight("MEffectiveOnTime");
     981    fillvs2.SetNameTab("OnTime");
     982    fillvs2.SetDrawOption(set.HasOffSequences()||set.IsWobbleMode()?"same":"");
    964983
    965984    if (!fWriteOnly)
     
    9951014
    9961015        if (!set.IsMonteCarlo())
    997             tlist.AddToList(&fillvs, "EffectiveOnTime");
     1016            tlist.Replace(&fillvs2);
    9981017        else
    999             // It is not really necessary to re-calculate the image parameters
    1000             // for the the on-source for MCs, but it is done for symmetry reasons
    1001             tlist2.AddToListBefore(&fillvs, &scalc);
     1018            tlist2.Replace(&fillvs2);
    10021019    }
    10031020
Note: See TracChangeset for help on using the changeset viewer.