source: huonglan/MYSIMULATION/mttggqq.C @ 15

Last change on this file since 15 was 15, checked in by huonglan, 13 years ago

fast simulation of t't'bar pair production from my stage

File size: 1.9 KB
Line 
1#include <iostream>
2#include <cstdio>
3#include <math.h>
4#include <TROOT.h>
5#include <TFile.h>
6#include <TTree.h>
7#include <TCanvas.h>
8
9void mtt()
10{
11  gROOT->SetStyle("Plain");
12  TCanvas *c1 = new TCanvas("mycanvas1","",900,450);
13  c1 -> Divide(2,1);
14
15  TFile *file1 = new TFile("./pyres400_15_6.root");
16  TString mttgg = "pymtt_gg";
17  TString mttqq = "pymtt_qq";
18  TH1F  *hmttgg = (TH1F*)file1-> Get(mttgg);
19  TH1F  *hmttqq = (TH1F*)file1-> Get(mttqq);
20  hmttgg->Scale(1./(hmttgg->Integral()));
21  hmttqq->Scale(1./(hmttqq->Integral()));
22
23  TFile *file2 = new TFile("./res400done_15_6.root");
24  TString mttggtr = "truth_sqrtshatGG";
25  TString mttqqtr = "truth_sqrtshatQQ";
26  TString mttggan = "ana_mttGG";
27  TString mttqqan = "ana_mttQQ";
28  TH1F  *hmttggtr = (TH1F*)file2-> Get(mttggtr);
29  TH1F  *hmttqqtr = (TH1F*)file2-> Get(mttqqtr);
30  TH1F  *hmttggan = (TH1F*)file2-> Get(mttggan);
31  TH1F  *hmttqqan = (TH1F*)file2-> Get(mttqqan);
32  hmttggtr->Scale(1./(hmttggtr->Integral()));
33  hmttqqtr->Scale(1./(hmttqqtr->Integral()));
34  hmttggan->Scale(1./(hmttggan->Integral()));
35  hmttqqan->Scale(1./(hmttqqan->Integral()));
36
37  TLegend *legend1 = new TLegend(0.85,0.6,0.5,0.75);
38  legend1 -> AddEntry(hmttgg,"Pythia");
39  legend1 -> AddEntry(hmttggtr,"My analysis - truth");
40  legend1 -> AddEntry(hmttggan,"My analysis - reco");
41
42  TLegend *legend2 = new TLegend(0.85,0.6,0.5,0.75);
43  legend2 -> AddEntry(hmttqq,"Pythia");
44  legend2 -> AddEntry(hmttqqtr,"My analysis - truth");
45  legend2 -> AddEntry(hmttqqan,"My analysis - reco");
46
47  c1 -> cd(1);
48  hmttgg->Draw();
49  hmttggtr->SetLineColor(kRed);
50  hmttggtr->Draw("same");
51  hmttggan->SetLineColor(kBlue);
52  hmttggan->Draw("same");
53  legend1 -> Draw("same");
54
55  c1 -> cd(2);
56  hmttqq->Draw();
57  hmttqqtr->SetLineColor(kRed);
58  hmttqqtr->Draw("same");
59  hmttqqan->SetLineColor(kBlue);
60  hmttqqan->Draw("same");
61  legend2 -> Draw("same");
62
63  c1 -> Print("mtt_ggqq.ps");
64}
Note: See TracBrowser for help on using the repository browser.