-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrawEta.cxx
More file actions
39 lines (30 loc) · 899 Bytes
/
drawEta.cxx
File metadata and controls
39 lines (30 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
TH1F* h = new TH1F ("h","",100,0,3.5);
tree->Draw("abs(eta1) >> h","","goff");
double integral_scale = h->Integral();
std::cout << " integral_scale = " << integral_scale << std::endl;
h->Scale (1. / integral_scale);
h->GetXaxis()->SetTitle ("#eta electron");
h->SetLineWidth(2);
h->SetLineColor(kRed);
TCanvas* c1 = new TCanvas ("c1","c1");
h->Draw();
c1->SetGrid();
c1->SaveAs("eta.png");
Double_t *integral = h->GetIntegral();
TH1* h_int = (TH1*) h->Clone();
h_int->SetContent(integral);
h_int->Scale (1);
TCanvas* c2 = new TCanvas ("c2","c2");
h_int->Draw();
TH1* h_int = (TH1*) h->Clone();
h_int->SetContent(integral);
h_int->Scale (1);
h_int->GetYaxis()->SetTitle ("Efficiency (#eta < threshold)");
h_int->GetXaxis()->SetTitle ("#eta electron");
h_int->SetLineWidth(2);
h_int->SetLineColor(kBlue);
h_int->Draw();
c2->SetGrid();
c2->SaveAs("etaInt.png");
}