Changeset 1265 for trunk


Ignore:
Timestamp:
03/21/02 16:25:12 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1264 r1265  
    11                                                                  -*-*- END -*-*-
     2
     3 2002/03/21: Thomas Bretz
     4
     5   * mhists/MH.cc:
     6     - TAxis::Set resets the axis title so I implemented a workaround
     7       in SetBinning so that the axis title survives.
     8
     9   * mhists/MHEffOnTimeTheta.cc, MHEffOnTimeTime.cc:
     10     - replaced Get*axis()->SetTitle() by Set*Title()
     11     - corrected the Name in MakeDefCanvas
     12
     13
     14
    215 2002/03/20: Thomas Bretz
    316
  • trunk/MagicSoft/Mars/mhist/MH.cc

    r1215 r1265  
    117117{
    118118    //
     119    // Another strange behaviour: TAxis::Set deletes the axis title!
     120    //
     121    TAxis &x = *h->GetXaxis();
     122
     123    TString xtitle = x.GetTitle();
     124
     125    //
    119126    // This is a necessary workaround if one wants to set
    120127    // non-equidistant bins after the initialization
     
    127134    // in one of the two given histograms
    128135    //
    129     h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges());
     136    x.Set(binsx->GetNumBins(), binsx->GetEdges());
     137    x.SetTitle(xtitle);
    130138}
    131139
    132140void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy)
    133141{
     142    TAxis &x = *h->GetXaxis();
     143    TAxis &y = *h->GetYaxis();
     144
     145    //
     146    // Another strange behaviour: TAxis::Set deletes the axis title!
     147    //
     148    TString xtitle = x.GetTitle();
     149    TString ytitle = y.GetTitle();
     150
    134151    //
    135152    // This is a necessary workaround if one wants to set
     
    144161    // in one of the two given histograms
    145162    //
    146     h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges());
    147     h->GetYaxis()->Set(binsy->GetNumBins(), binsy->GetEdges());
     163    x.Set(binsx->GetNumBins(), binsx->GetEdges());
     164    y.Set(binsy->GetNumBins(), binsy->GetEdges());
     165    x.SetTitle(xtitle);
     166    y.SetTitle(ytitle);
    148167}
    149168
    150169void MH::SetBinning(TH1 *h, const MBinning *binsx, const MBinning *binsy, const MBinning *binsz)
    151170{
     171    //
     172    // Another strange behaviour: TAxis::Set deletes the axis title!
     173    //
     174    TAxis &x = *h->GetXaxis();
     175    TAxis &y = *h->GetYaxis();
     176    TAxis &z = *h->GetZaxis();
     177
     178    TString xtitle = x.GetTitle();
     179    TString ytitle = y.GetTitle();
     180    TString ztitle = z.GetTitle();
     181
    152182    //
    153183    // This is a necessary workaround if one wants to set
     
    163193    // in one of the two given histograms
    164194    //
    165     h->GetXaxis()->Set(binsx->GetNumBins(), binsx->GetEdges());
    166     h->GetYaxis()->Set(binsy->GetNumBins(), binsy->GetEdges());
    167     h->GetZaxis()->Set(binsz->GetNumBins(), binsz->GetEdges());
     195    x.Set(binsx->GetNumBins(), binsx->GetEdges());
     196    y.Set(binsy->GetNumBins(), binsy->GetEdges());
     197    z.Set(binsz->GetNumBins(), binsz->GetEdges());
     198    x.SetTitle(xtitle);
     199    y.SetTitle(ytitle);
     200    z.SetTitle(ztitle);
    168201}
    169202
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTheta.cc

    r1227 r1265  
    6767    fHist.SetDirectory(NULL);
    6868
    69     fHist.GetXaxis()->SetTitle("t_{eff} [s]");
    70     fHist.GetYaxis()->SetTitle("\\Theta [\\circ]");
     69    fHist.SetXTitle("t_{eff} [s]");
     70    fHist.SetYTitle("\\Theta [\\circ]");
    7171}
    7272
  • trunk/MagicSoft/Mars/mhist/MHEffOnTimeTime.cc

    r1227 r1265  
    6868    fHist.SetDirectory(NULL);
    6969
    70     fHist.GetXaxis()->SetTitle("t_{eff} [s]");
    71     fHist.GetYaxis()->SetTitle("t [s]");
     70    fHist.SetXTitle("t_{eff} [s]");
     71    fHist.SetYTitle("t [s]");
    7272}
    7373
    7474TObject *MHEffOnTimeTime::DrawClone(Option_t *opt) const
    7575{
    76     TCanvas *c = MakeDefCanvas("EffOnTimeTheta", "t_eff vs. t");
     76    TCanvas *c = MakeDefCanvas("EffOnTimeTime", "t_eff vs. t");
    7777
    7878    gROOT->SetSelectedPad(NULL);
     
    8989{
    9090    if (!gPad)
    91         MakeDefCanvas("EffOnTimeTheta", "t_eff vs. t");
     91        MakeDefCanvas("EffOnTimeTime", "t_eff vs. t");
    9292
    9393    fHist.Draw(opt);
  • trunk/MagicSoft/Mars/mhist/MHTimeDiffTime.cc

    r1263 r1265  
    9090TObject *MHTimeDiffTime::DrawClone(Option_t *opt) const
    9191{
    92     TCanvas *c = MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, t");
     92    TCanvas *c = MakeDefCanvas("DiffTimeTime", "Distrib of dt, t");
    9393    c->Divide(2, 2);
    9494
     
    123123{
    124124    if (!gPad)
    125         MakeDefCanvas("DiffTimeTime", "Distrib of \\Delta t, t");
     125        MakeDefCanvas("DiffTimeTime", "Distrib of dt, t");
    126126
    127127    gPad->Divide(2,2);
Note: See TracChangeset for help on using the changeset viewer.