User Tools

Site Tools


computing:tbrowse

This is an old revision of the document!


Macro that opens a TBrowser and defines some functions.

myMacro.C
TBrowser a;

void myMacro(){
    std::cout << "Hello World!" << std::endl;
}

void range(TH1* hist, double xmin, double xmax)
{
    hist->GetXaxis()->SetRangeUser(xmin,xmax);
    hist->Draw();
}

double meanRange(TH1* hist, double xmin, double xmax)
{
    hist->GetXaxis()->SetRangeUser(xmin,xmax);
    return hist->GetMean(1);
}

double integrate(TH1* hist, double xmin, double xmax)
{
    hist->GetXaxis()->SetRangeUser(xmin,xmax);
    return hist->Integral();
}

void norm(TH1* hist)
{
    hist->Scale(1./hist->Integral());
    hist->Draw();
}
computing/tbrowse.1488209342.txt.gz · Last modified: 2017/02/27 16:29 by iwn