Ignore:
Timestamp:
12/17/04 13:27:08 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhbase
Files:
2 edited

Legend:

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

    r5603 r5620  
    103103//
    104104MH3::MH3(const unsigned int dim)
    105     : fDimension(dim>3?3:dim), fHist(NULL),
     105    : fDimension(dim>3?3:dim), fHist(NULL)/*,
    106106    fNameProfX(Form("ProfX_%p", this)),
    107     fNameProfY(Form("ProfY_%p", this))
     107    fNameProfY(Form("ProfY_%p", this))*/
    108108
    109109    switch (fDimension)
     
    205205//
    206206MH3::MH3(const char *memberx, const char *membery)
    207     : fDimension(2), fNameProfX(Form("ProjX_%p", this)), fNameProfY(Form("ProjY_%p", this))
     207    : fDimension(2)/*, fNameProfX(Form("ProjX_%p", this)), fNameProfY(Form("ProjY_%p", this))*/
    208208{
    209209    fHist = new TH2F;
     
    507507void MH3::Paint(Option_t *o)
    508508{
     509    /*
     510     *fLog << all << fHist << " " << gPad->GetName() << " ----> Paint " << o << endl;
     511     TListIter Next(gPad->GetListOfPrimitives()); TObject *obj;
     512     while ((obj=Next())) *fLog << obj << " " << obj->GetName() << " " << obj->ClassName() << " " << Next.GetOption() << " " << (int)obj->TestBit(kCanDelete) << endl;
     513     */
     514    /*
    509515    TString str(o);
    510 
    511     // FIXME: Do it in Paint()
    512     /*
    513      if (str.Contains("COL", TString::kIgnoreCase))
    514     {
    515         SetColors();
    516         return;
    517     }
    518     */
    519516
    520517    if (str.Contains("log", TString::kIgnoreCase))
     
    536533        if ((h0 = (TProfile*)gPad->FindObject(fNameProfY)))
    537534            ((TH2*)fHist)->ProfileY(fNameProfY, -1, 9999, "s");
    538     }
     535            }
     536            */
     537
     538    fHist->SetFillStyle(4000);
     539
     540    TString str(o);
     541    str = str.Strip(TString::kBoth);
     542
     543    Bool_t only = str.Contains("ONLY", TString::kIgnoreCase) && fDimension==2;
     544    Bool_t same = str.Contains("SAME", TString::kIgnoreCase) && fDimension==2;
     545    Bool_t blue = str.Contains("BLUE", TString::kIgnoreCase) && fDimension==2;
     546
     547    // FIXME: We may have to remove all our own options from str!
     548    if (!only && !gPad->GetListOfPrimitives()->FindObject(fHist))
     549        fHist->Draw(str);
     550
     551    if (str.Contains("PROFX", TString::kIgnoreCase) && fDimension==2)
     552    {
     553        TProfile *p = ((TH2*)fHist)->ProfileX("ProfX", -1, 9999, "s");
     554        if (!gPad->GetListOfPrimitives()->FindObject(p))
     555        {
     556            p->UseCurrentStyle();
     557            p->SetLineColor(blue ? kBlue : fHist->GetLineColor());
     558            p->SetBit(kCanDelete);
     559            p->SetDirectory(NULL);
     560            p->SetXTitle(fHist->GetXaxis()->GetTitle());
     561            p->SetYTitle(fHist->GetYaxis()->GetTitle());
     562            p->Draw(only&&!same?"":"same");
     563        }
     564    }
     565    if (str.Contains("PROFY", TString::kIgnoreCase) && fDimension==2)
     566    {
     567        TProfile *p = ((TH2*)fHist)->ProfileY("ProfY", -1, 9999, "s");
     568        if (!gPad->GetListOfPrimitives()->FindObject(p))
     569        {
     570            p->UseCurrentStyle();
     571            p->SetLineColor(blue ? kBlue : fHist->GetLineColor());
     572            p->SetBit(kCanDelete);
     573            p->SetDirectory(NULL);
     574            p->SetYTitle(fHist->GetXaxis()->GetTitle());
     575            p->SetXTitle(fHist->GetYaxis()->GetTitle());
     576            p->Draw(only&&!same?"":"same");
     577        }
     578    }
     579
     580    if (fHist->TestBit(kIsLogx) && fHist->GetEntries()>0) gPad->SetLogx();
     581    if (fHist->TestBit(kIsLogy) && fHist->GetEntries()>0) gPad->SetLogy();
     582    if (fHist->TestBit(kIsLogz) && fHist->GetEntries()>0) gPad->SetLogz();
    539583}
    540584
     
    559603    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(fHist);
    560604    pad->SetBorderMode(0);
    561 
     605    AppendPad(opt);
     606
     607    return;
     608/*
    562609    fHist->SetFillStyle(4000);
    563610
     
    597644    }
    598645
    599     AppendPad("log");
     646    AppendPad("log");*/
    600647}
    601648
  • trunk/MagicSoft/Mars/mhbase/MH3.h

    r5429 r5620  
    2626    Double_t    fScale[3];       // Scale for the three axis (eg unit)
    2727
    28     TString     fNameProfX;      //! This should make sure, that gROOT doen't confuse the profile with something else
    29     TString     fNameProfY;      //! This should make sure, that gROOT doen't confuse the profile with something else
     28    // TString     fNameProfX;      //! This should make sure, that gROOT doen't confuse the profile with something else
     29    // TString     fNameProfY;      //! This should make sure, that gROOT doen't confuse the profile with something else
    3030
    3131    void StreamPrimitive(ofstream &out) const;
     
    3636        kIsLogz = BIT(19)
    3737    };
     38
     39//    Int_t DistancetoPrimitive(Int_t px, Int_t py);
     40//    void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
    3841
    3942public:
Note: See TracChangeset for help on using the changeset viewer.