ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/claudioc/OSNote2010/plotTrgEff/plotTrgEff.C
Revision: 1.1
Committed: Tue Nov 9 04:39:45 2010 UTC (14 years, 5 months ago) by claudioc
Content type: text/plain
Branch: MAIN
Log Message:
code to plot trg eff

File Contents

# User Rev Content
1 claudioc 1.1 {
2     gROOT->LoadMacro("triggerSuperModel.cc+");
3     gStyle->SetOptStat(0);
4     gStyle->SetPaintTextFormat(".3f");
5    
6    
7     //----------------------
8     // plot mu mu first
9     //----------------------
10     TCanvas* cnv = new TCanvas();
11     cnv->Divide(1,2);
12     double mubin[5]={10.,11.,15.,20.,30.};
13     int nmubin = 4;
14     TH2F* mu21 = new TH2F("mu21","mumu - both with abs(eta)<2.1", nmubin, mubin, nmubin, mubin);
15     TH2F* mu24 = new TH2F("mu24","mumu - only one with abs(eta)<2.1", nmubin, mubin, nmubin, mubin);
16    
17     int id1=13;
18     int id2=13;
19     int hyp = 0;
20     float eta1=0.;
21     float eta2=0.;
22     for (int i=0; i<=nmubin; i++) {
23     float pt1 = mubin[i]+0.1;
24     for (int j=0; j<=nmubin; j++) {
25     float pt2 = mubin[j]+0.1;
26     if (TMath::Max(pt1,pt2) > 20.) {
27     float eff21 = triggerSuperModelEffic(hyp, pt1, eta1, id1, pt2, eta2, id2);
28     float eff24 = triggerSuperModelEffic(hyp, pt1, eta1, id1, pt2, 2.5, id2);
29     mu21->Fill(pt1,pt2,eff21);
30     mu24->Fill(pt1,pt2,eff24);
31     }
32     }
33     }
34     TLine * l1 = new TLine(11.,10.,11.,30.);
35     TLine * l2 = new TLine(15.,10.,15.,30.);
36     TLine * l3 = new TLine(20.,10.,20.,30.);
37     TLine * l4 = new TLine(10.,11.,30.,11.);
38     TLine * l5 = new TLine(10.,15.,30.,15.);
39     TLine * l6 = new TLine(10.,20.,30.,20.);
40     cnv->cd(1);
41     mu21->SetMarkerSize(2.5);
42     mu21->Draw("text");
43     mu21->GetYaxis()->SetTickLength(0);
44     mu21->GetXaxis()->SetTickLength(0);
45     mu21->GetXaxis()->SetTitle("Pt muon 1");
46     mu21->GetYaxis()->SetTitle("Pt muon 2");
47     mu21->GetXaxis()->SetTitleSize(0.05);
48     mu21->GetYaxis()->SetTitleSize(0.05);
49     l1->Draw();
50     l2->Draw();
51     l3->Draw();
52     l4->Draw();
53     l5->Draw();
54     l6->Draw();
55    
56     cnv->cd(2);
57     mu24->SetMarkerSize(2.5);
58     mu24->Draw("text");
59     mu24->GetYaxis()->SetTickLength(0);
60     mu24->GetXaxis()->SetTickLength(0);
61     mu24->GetXaxis()->SetTitle("Pt muon of abs(eta)<2.1");
62     mu24->GetYaxis()->SetTitle("Pt muon of abs(eta)>2.1");
63     mu24->GetXaxis()->SetTitleSize(0.05);
64     mu24->GetYaxis()->SetTitleSize(0.05);
65     mu24->Draw("text");
66     mu24->GetYaxis()->SetTickLength(0);
67     mu24->GetXaxis()->SetTickLength(0);
68     l1->Draw();
69     l2->Draw();
70     l3->Draw();
71     l4->Draw();
72     l5->Draw();
73     l6->Draw();
74    
75    
76     //---------------
77     // Now plot ee
78     //---------------
79     TCanvas* cnv2 = new TCanvas();
80     cnv2->Divide(1,2);
81     double ebin[8]={10.,15.,17.,20., 22.,27., 32., 40.};
82     int nebin = 7;
83     TH2F* e21 = new TH2F("e21","emu - muon with abs(eta)<2.1", nebin, ebin, nmubin, mubin);
84     TH2F* e24 = new TH2F("e24","emu - muon with abs(eta)>2.1", nebin, ebin, nmubin, mubin);
85    
86    
87     int id1=11;
88     int id2=13;
89     int hyp = 1;
90     float eta1=0.;
91     float eta2=0.;
92     for (int i=0; i<=nebin; i++) {
93     float pt1 = ebin[i]+0.1;
94     for (int j=0; j<=nmubin; j++) {
95     float pt2 = mubin[j]+0.1;
96     if (TMath::Max(pt1,pt2) > 20.) {
97     float eff21 = triggerSuperModelEffic(hyp, pt1, eta1, id1, pt2, eta2, id2);
98     float eff24 = triggerSuperModelEffic(hyp, pt1, eta1, id1, pt2, 2.5, id2);
99     e21->Fill(pt1,pt2,eff21);
100     e24->Fill(pt1,pt2,eff24);
101     }
102     }
103     }
104    
105    
106     TLine * s1 = new TLine(15.,10.,15.,30.);
107     TLine * s2 = new TLine(17.,10.,17.,30.);
108     TLine * s3 = new TLine(20.,10.,20.,30.);
109     TLine * s4 = new TLine(22.,10.,22.,30.);
110     TLine * s5 = new TLine(27.,10.,27.,30.);
111     TLine * s6 = new TLine(32.,10.,32.,30.);
112     TLine * t1 = new TLine(10.,11.,40.,11.);
113     TLine * t2 = new TLine(10.,15.,40.,15.);
114     TLine * t3 = new TLine(10.,20.,40.,20.);
115    
116     cnv2->cd(1);
117     e21->SetMarkerSize(2.5);
118     e21->Draw("text");
119     e21->GetYaxis()->SetTickLength(0);
120     e21->GetXaxis()->SetTickLength(0);
121     e21->GetXaxis()->SetTitle("Pt electron");
122     e21->GetYaxis()->SetTitle("Pt muon");
123     e21->GetXaxis()->SetTitleSize(0.05);
124     e21->GetYaxis()->SetTitleSize(0.05);
125     s1->Draw();
126     s2->Draw();
127     s3->Draw();
128     s4->Draw();
129     s5->Draw();
130     s6->Draw();
131     t1->Draw();
132     t2->Draw();
133     t3->Draw();
134    
135    
136     cnv2->cd(2);
137     e24->SetMarkerSize(2.5);
138     e24->Draw("text");
139     e24->GetYaxis()->SetTickLength(0);
140     e24->GetXaxis()->SetTickLength(0);
141     e24->GetXaxis()->SetTitle("Pt electron");
142     e24->GetYaxis()->SetTitle("Pt muon");
143     e24->GetXaxis()->SetTitleSize(0.05);
144     e24->GetYaxis()->SetTitleSize(0.05);
145     s1->Draw();
146     s2->Draw();
147     s3->Draw();
148     s4->Draw();
149     s5->Draw();
150     s6->Draw();
151     t1->Draw();
152     t2->Draw();
153     t3->Draw();
154    
155    
156     }
157