ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/CmsHi/JetAnalysis/macros/plotSignalMultiplicity.C
Revision: 1.1
Committed: Tue Jan 29 00:37:02 2013 UTC (12 years, 3 months ago) by yilmaz
Content type: text/plain
Branch: MAIN
CVS Tags: HiForest_V02_75, HiForest_V02_74, HiForest_V02_71, HiForest_V02_70, HiForest_V02_69, HiForest_V02_68, HiForest_V02_67, HiForest_V02_66, HiForest_V02_65, HiForest_V02_64
Log Message:
plotting macros

File Contents

# User Rev Content
1 yilmaz 1.1 #include "weightMix.C"
2    
3    
4     TProfile* getMult(int isample = 2, string var = "pt2/pt1"){
5    
6     TH1::SetDefaultSumw2();
7    
8     TChain* ntdijet;
9    
10     if(var == "pt2/pt1"){
11     ntdijet = new TChain("ntmatch");
12     }else{
13     ntdijet = new TChain("ntdijet");
14     }
15    
16     TChain* ntevt = new TChain("ntevt");
17     TChain* ntw;
18    
19     if(isample == 0){
20     ntdijet->Add("/d101/yetkin/analysis/d0128/data_pPb.root");
21     ntevt->Add("/d101/yetkin/analysis/d0128/data_pPb.root");
22     }
23    
24     if(isample == 1){
25     ntdijet->Add("/d101/yetkin/analysis/d0128/data_PbPb.root");
26     ntevt->Add("/d101/yetkin/analysis/d0128/data_PbPb.root");
27     }
28    
29     if(isample == 2){
30     ntw = new TChain("ntw");
31    
32     ntdijet->Add("/d101/yetkin/analysis/d0128/mix_hijing.root");
33     ntevt->Add("/d101/yetkin/analysis/d0128/mix_hijing.root");
34     ntw->Add("/d101/yetkin/analysis/d0128/mix_hijing.root");
35     }
36    
37     if(isample == 3){
38     ntw = new TChain("ntw");
39    
40     ntdijet->Add("/d101/yetkin/analysis/d0128/mix_hydjet.root");
41     ntevt->Add("/d101/yetkin/analysis/d0128/mix_hydjet.root");
42     ntw->Add("/d101/yetkin/analysis/d0128/mix_hydjet.root");
43     }
44    
45     string varName = "NNNNN";
46     if(var == "ngen30") varName = "N_{GenJet}(p_{T}>30)";
47     if(var == "njet30") varName = "N_{RecoJet}(p_{T}>30)";
48     if(var == "jtpt2/jtpt1") varName = "p_{T,2}/p_{T,1}";
49     if(var == "pt2/pt1"){
50     varName = "True (GenJet) p_{T,2}/p_{T,1}";
51     }
52    
53     ntdijet->AddFriend(ntevt);
54     if(isample > 1) ntdijet->AddFriend(ntw);
55    
56     TH2D* h[20];
57     TProfile* p[20];
58    
59     int nmax = 200;
60     if(isample == 2) nmax = 500;
61    
62     for(int i = 0; i < 5; ++i){
63     h[i] = new TH2D(Form("h%d",i),"",nmax/10,0,nmax,10,0,10);
64     }
65    
66     TH2D* hn = new TH2D(Form("hn%d",isample),"",nmax/10,0,nmax,100,0,2.);
67    
68     TCut dijet("jtpt1 > 120 && jtpt2 > 30 && acos(cos(jtphi1-jtphi2))> 2.0944");
69     TCut weight("weight");
70     if(isample < 2) weight = "jtpt1 > -999";
71    
72    
73     ntdijet->SetAlias("var",var.data());
74    
75    
76     TCanvas* c2 = new TCanvas("c2","",600,600);
77     ntdijet->Draw(Form("var:ntrk>>h%d",0),weight*dijet,"colz");
78    
79     if(isample > 1){
80    
81     TCanvas* c1 = new TCanvas("c1","",600,600);
82     ntdijet->Draw(Form("nps/npb:ntrk>>hn%d",isample),weight*dijet,"colz");
83     hn->ProfileX(Form("phn_%d",isample))->Draw("same");
84    
85     TCanvas* c3 = new TCanvas("c3","",600,600);
86     ntdijet->Draw(Form("var:npb+nps>>h%d",1),weight*dijet,"colz");
87    
88     TCanvas* c4 = new TCanvas("c4","",600,600);
89     ntdijet->Draw(Form("var:nps>>h%d",2),weight*dijet,"colz");
90    
91     TCanvas* c5 = new TCanvas("c5","",600,600);
92     ntdijet->Draw(Form("var:npb>>h%d",3),weight*dijet,"colz");
93    
94     }
95    
96     TCanvas* cc1 = new TCanvas("cc1","",600,600);
97     for(int i = 0; i < 4; ++i){
98     p[i] = h[i]->ProfileX(Form("p%d_%d",i,isample));
99     }
100    
101     p[2]->SetMarkerColor(2);
102     p[2]->SetLineColor(2);
103    
104     p[3]->SetMarkerColor(4);
105     p[3]->SetLineColor(4);
106    
107     p[1]->SetMaximum(5);
108     p[1]->SetMinimum(0);
109    
110     p[1]->Draw("hist");
111     p[0]->Draw("same");
112    
113     p[2]->Draw("same");
114     p[3]->Draw("same");
115    
116     p[0]->GetXaxis()->SetTitle("N_{trk}^{offline}");
117     p[0]->GetYaxis()->SetTitle(varName.data());
118     p[0]->GetXaxis()->CenterTitle();
119     p[0]->GetYaxis()->CenterTitle();
120    
121     return p[0];
122    
123     }
124    
125    
126     void plotSignalMultiplicity(string var = "njet30"){
127    
128     // getSignalBias(2,var);
129     // return;
130    
131     TProfile* p[4];
132    
133     for(int i = 0; i < 4; ++i){
134     p[i] = getMult(i,var);
135     p[i]->SetName(Form("pp%d",i));
136     p[i]->SetDirectory(0);
137     }
138    
139    
140     p[1]->SetMarkerStyle(25);
141     p[1]->SetMarkerColor(4);
142     p[1]->SetLineColor(4);
143    
144     p[3]->SetLineColor(4);
145    
146     p[1]->Draw("");
147     p[0]->Draw("same");
148     p[2]->Draw("hist same");
149     p[3]->Draw("hist same");
150    
151     TLegend *t3=new TLegend(0.26,0.6,0.53,0.85);
152     t3->SetFillColor(0);
153     t3->SetBorderSize(0);
154     t3->SetFillStyle(0);
155     t3->SetTextFont(63);
156     t3->SetTextSize(20);
157     t3->AddEntry(p[0],"pPb data","p");
158     t3->AddEntry(p[1],"PbPb data","p");
159     t3->AddEntry(p[2],"pPb Hijing + Pythia","l");
160     t3->AddEntry(p[3],"PbPb Hydjet + Pythia","l");
161    
162     t3->Draw();
163    
164    
165     }
166    
167    
168    
169    
170