#include <string>
#include <iostream>
#include <vector>
#include "TFile.h"
#include "TH1.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 10 of file Workflow.cc.
References f, and h.
12 if ( argc <= 1 )
return -1;
14 const char * rootfile = argv[1];
16 TFile
f(rootfile,
"old");
18 TH1F *
h = (TH1F*)
f.Get(
"workflow");
21 printf(
"+%s+\n", std::string(170,
'-').c_str());
22 printf(
"| %-108s | %10s | %16s | %16s |\n",h->GetTitle(),
"n events",
"ratio wrt first",
"ratio wrt previous");
23 printf(
"+%s+\n", std::string(170,
'-').c_str());
25 for (
int i = 1; i <= h ->GetNbinsX(); ++i )
27 std::string label = std::string(h->GetXaxis()->GetBinLabel(i));
28 if ( label ==
"" )
continue;
30 float n = h->GetBinContent(i);
31 float rn1 = h->GetBinContent(i)/h->GetBinContent(firstbin);
35 printf(
"| %2d - %-103s | %10.1f | %16s | %19s |\n",i-1,label.c_str(),n,
"-",
"-");
39 printf(
"| %2d - %-103s | %10.1f | %16.6f | %19s |\n",i-1,label.c_str(),n,rn1,
"-");
43 rni = h-> GetBinContent(i)/h->GetBinContent(i-1);
44 printf(
"| %2d - %-103s | %10.1f | %16.6f | %16.6f |\n",i-1,label.c_str(),n,rn1,rni);
48 printf(
"+%s+\n", std::string(170,
'-').c_str());