TTTT Analysis  0.1
example3.cpp
1 #include <iostream>
2 #include <vector>
3 #include <utility>
4 
5 #include "TFile.h"
6 #include "TTree.h"
7 #include "TCanvas.h"
8 
9 #include "filval/filval.hpp"
10 
11 #include "MiniTreeDataSet.hpp"
12 
13 void test3(){
14  TFile *f = TFile::Open("./data/TTTT_ext_treeProducerSusyMultilepton_tree.root");
15  TTree *tree = (TTree*) f->Get("tree");
16  MiniTreeDataSet mtds(tree);
17  mtds.process();
18  TCanvas can("c1");
19  can.Clear();
20  TH1* hist = ((ContainerTH1I*)mtds.get_container("nLepGood"))->get_container();
21  hist->Draw();
22  can.Draw();
23  can.SaveAs("outfile.png");
24 
25  can.Clear();
26  hist = ((ContainerTH1I*)mtds.get_container("nLepGood2"))->get_container();
27  hist->Draw();
28  can.Draw();
29  can.SaveAs("outfile2.png");
30 
31  can.Clear();
32  hist = ((ContainerTH1I*)mtds.get_container("nLepGood3"))->get_container();
33  hist->Draw();
34  can.Draw();
35  can.SaveAs("outfile3.png");
36 
37  can.Clear();
38  hist = ((ContainerTH1I*)mtds.get_container("avg_lepton_energy"))->get_container();
39  hist->Draw();
40  can.Draw();
41  can.SaveAs("lepton_energy.png");
42 
43  can.Clear();
44  TGraph* graph= ((ContainerTGraph*)mtds.get_container("nLepvsnJet"))->get_container();
45  graph->Draw("A*");
46  can.Draw();
47  can.SaveAs("outfileGraph.png");
48 
49  delete tree;
50  f->Close();
51  delete f;
52 }