Changeset 7971


Ignore:
Timestamp:
09/26/06 11:45:32 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7970 r7971  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2006/09/26 Thomas Bretz
     22
     23   * mbase/MMath.h:
     24     - added new function ModF
     25
     26   * mhist/MHRate.cc, mhist/MHWeather.cc, mhvstime/MHPixVsTime.cc,
     27     mhvstime/MHSectorVsTime.cc, mhvstime/MHVsTime.cc,
     28     mpointing/MHPointing.cc:
     29     - made the update of the axis ranges work again
     30
     31
     32
    2033 2006/09/26 Daniela Dorner
    2134
  • trunk/MagicSoft/Mars/mbase/MMath.h

    r7899 r7971  
    5252    TArrayD LeastSqFitPowerLaw(Int_t n, Double_t *x, Double_t *y);
    5353
     54    inline Int_t ModF(Double_t dbl, Double_t &frac) { Double_t rc; frac = modf(dbl, &rc); return TMath::Nint(rc); }
     55
    5456    inline Double_t Sgn(Double_t d) { return d<0 ? -1 : 1; }
    5557}
  • trunk/MagicSoft/Mars/mhist/MHRate.cc

    r7841 r7971  
    182182void MHRate::DrawGraph(TGraph &g, const char *y) const
    183183{
     184    // If this is set to early the plot remains empty in root 5.12/00
     185    if (g.GetN()>0)
     186        g.SetMinimum(0);
     187
     188    // This is not done automatically anymore since root 5.12/00
     189    // and it is necessary to force a proper update of the axis.
    184190    TH1 *h = g.GetHistogram();
    185191    if (h)
    186192    {
     193        delete h;
     194        g.SetHistogram(0);
     195        h = g.GetHistogram();
     196    }
     197
     198    if (h)
     199    {
     200        cout << "Y";
    187201        TAxis *axe = h->GetXaxis();
    188202        axe->SetLabelSize(0.033);
     
    287301void MHRate::Paint(Option_t *o)
    288302{
    289     // If this is set to early the plot remains empty in root 5.12/00
    290     if (fRateTime.GetN()>0)
    291         fRateTime.SetMinimum(0);
    292 
    293303    DrawGraph(fRateTime, "f [Hz]");
    294304    /*
  • trunk/MagicSoft/Mars/mhist/MHWeather.cc

    r7841 r7971  
    160160    if (h)
    161161    {
     162        delete h;
     163        g.SetHistogram(0);
     164        h = g.GetHistogram();
     165    }
     166    if (h)
     167    {
    162168        TAxis *axe = h->GetXaxis();
    163169        axe->SetLabelSize(0.033);
  • trunk/MagicSoft/Mars/mhvstime/MHPixVsTime.cc

    r7091 r7971  
    224224    TString str(opt);
    225225
     226    // This is not done automatically anymore since root 5.12/00
     227    // and it is necessary to force a proper update of the axis.
    226228    TH1 *h = fGraph->GetHistogram();
     229    if (h)
     230    {
     231        delete h;
     232        fGraph->SetHistogram(0);
     233        h = fGraph->GetHistogram();
     234    }
    227235
    228236    h->SetXTitle("Time");
  • trunk/MagicSoft/Mars/mhvstime/MHSectorVsTime.cc

    r7841 r7971  
    291291    }
    292292
     293    // This is not done automatically anymore since root 5.12/00
     294    // and it is necessary to force a proper update of the axis.
    293295    TH1 *h = fGraph->GetHistogram();
     296    if (h)
     297    {
     298        delete h;
     299        fGraph->SetHistogram(0);
     300        h = fGraph->GetHistogram();
     301    }
    294302
    295303    h->SetXTitle("Time");
  • trunk/MagicSoft/Mars/mhvstime/MHVsTime.cc

    r7842 r7971  
    264264     while ((obj=Next())) *fLog << obj << " " << obj->GetName() << " " << obj->ClassName() << " " << Next.GetOption() << endl;
    265265     */
    266 
    267266    if (!fGraph)
    268267        return;
     
    284283    }
    285284
    286     // SetPoint deletes the histogram!
    287     if (fUseEventNumber)
    288         fGraph->GetHistogram()->SetXTitle("Event Number");
    289     else
    290     {
    291         fGraph->GetHistogram()->SetXTitle("Time");
    292         fGraph->GetHistogram()->GetXaxis()->SetLabelSize(0.033);
    293         fGraph->GetHistogram()->GetXaxis()->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT");
    294         fGraph->GetHistogram()->GetXaxis()->SetTimeDisplay(1);
     285    // This is not done automatically anymore since root 5.12/00
     286    // and it is necessary to force a proper update of the axis.
     287    TH1 *h = fGraph->GetHistogram();
     288    if (h)
     289    {
     290        delete h;
     291        fGraph->SetHistogram(0);
     292        h = fGraph->GetHistogram();
     293    }
     294    if (h)
     295    {
     296        TAxis *axe = h->GetXaxis();
     297        // SetPoint deletes the histogram!
     298        if (fUseEventNumber)
     299            axe->SetTitle("Event Number");
     300        else
     301        {
     302            axe->SetTitle("Time");
     303            axe->SetLabelSize(0.033);
     304            axe->SetTimeFormat("%H:%M %F1995-01-01 00:00:00 GMT");
     305            axe->SetTimeDisplay(1);
     306        }
    295307    }
    296308
     
    300312    // This is a workaround if the TGraph has only one point.
    301313    // Otherwise MStatusDisplay::Update hangs.
    302     gPad->GetListOfPrimitives()->Remove(fGraph);
    303     fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data());
     314//    gPad->GetListOfPrimitives()->Remove(fGraph);
     315//    fGraph->Draw(fGraph->GetN()<2 ? "A" : str.Data());
    304316    //gPad->GetListOfPrimitives()->Add(fGraph, fGraph->GetN()<2 ? "A" : opt);
    305317    //    AppendPad(str);
     
    319331    pad->SetBorderMode(0);
    320332    AppendPad(opt);
     333
     334    fGraph->Draw("A");
    321335}
    322336
  • trunk/MagicSoft/Mars/mpointing/MHPointing.cc

    r7842 r7971  
    214214void MHPointing::DrawGraph(TGraph &g, const char *y) const
    215215{
     216    // This is not done automatically anymore since root 5.12/00
     217    // and it is necessary to force a proper update of the axis.
    216218    TH1 *h = g.GetHistogram();
     219    if (h)
     220    {
     221        delete h;
     222        g.SetHistogram(0);
     223        h = g.GetHistogram();
     224    }
    217225    if (h)
    218226    {
Note: See TracChangeset for help on using the changeset viewer.