Ignore:
Timestamp:
07/05/01 13:23:12 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHMcEnergy.cc

    r851 r855  
    2929#include <TH1.h>
    3030#include <TF1.h>
     31#include <TCanvas.h>
    3132#include <TPaveLabel.h>
    3233
     
    5859        sprintf(aux+10, ";%i", idx);
    5960    hLogEner = new TH1F(aux, "", 100, 0.5, 4.5);
     61    hLogEner->SetXTitle("log(E) [GeV]");
     62    hLogEner->SetYTitle("dN/dE");
    6063    //hLogEner->SetBins(60);
    6164}
     
    7578{
    7679    //
     80    // 0: don't draw the function (it is drawn together with the histogram)
     81    // +: add these function to the list of fits. Don't delete the last fit.
     82    //
    7783    // FIXME: R means: use the range specified in the function (xxmin, xxmax are ignored!)
    7884    //        Q means: quiet (why?)
    7985    //
    8086    //
    81     hLogEner->Fit(fLogEner->GetName(), "RQ", "", xxmin, xxmax);
     87    hLogEner->Fit(fLogEner->GetName(), "Q0+", "", xxmin, xxmax);
    8288}
    8389
     
    9298    const Float_t sum = min+max;
    9399
     100    TCanvas *c=new TCanvas("Energy Distribution","Energy distribution for triggered events");
     101
     102    hLogEner->Draw(option);
     103
    94104    TPaveLabel* label = new TPaveLabel(2.2, 0.75*sum, 4.4, 0.90*sum, text);
    95 
    96     hLogEner->SetYTitle("dN/dE") ;
    97     hLogEner->SetXTitle("log(E) [GeV]") ;
    98     hLogEner->Draw(option) ;
    99105    label->SetFillColor(10);
    100106    label->SetTextSize(0.3);
    101107    label->Draw();
     108
     109    c->Modified();
     110    c->Update();
    102111}
    103112
Note: See TracChangeset for help on using the changeset viewer.