ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Jeng/scripts/MuonIPScut.C
(Generate patch)

Comparing UserCode/Jeng/scripts/MuonIPScut.C (file contents):
Revision 1.1 by jengbou, Tue May 18 04:36:56 2010 UTC vs.
Revision 1.2 by jengbou, Thu May 20 22:06:34 2010 UTC

# Line 11 | Line 11
11  
12   std::map<TString,TString> histName;
13   std::map<TString,TH1*> hs;
14 + std::map<TString,TCanvas*> ts;
15  
16   void MuonIPScut()
17   {
18    gROOT->SetStyle("CMS");
19    //gStyle->SetOptFit(1111);
20 <  TFile *fsig = TFile::Open("TTbarJets_madgraph_Spring10_2_all.root");
21 <  TFile *fbkg = TFile::Open("InclusiveMu15_Spring10_2_all.root");
20 >  TFile *fsig = TFile::Open("TTbarJets_madgraph_Spring10_5_all.root");
21 >  TFile *fbkg = TFile::Open("InclusiveMu15_Spring10_5_all.root");
22  
23    // LOAD HISTOGRAMS FROM FILES
24    const int nDim = 2;
# Line 138 | Line 139 | void MuonIPScut()
139          TString CommonTag = TString("IPS_" + dim[i] + "_" + ref[j] + "_" + sel[k]);
140          TString CommonTag1 = TString("IP_" + dim[i] + "_" + ref[j] + "_" + sel[k]);
141          //cout << "CommonTag = " << CommonTag << endl;
142 <        TCanvas *c0=new TCanvas;
143 <        c0->Divide(2,3);
142 >        TString fileName = TString("Summery_"+dim[i]+"_"+ref[j]+"_"+sel[k]);
143 >        ts[fileName] = new TCanvas(fileName,fileName,800,800);
144 >        ts[fileName]->Divide(2,3);
145  
146 <        c0->cd(1);
146 >        ts[fileName]->cd(1);
147          hs["SplusB_"+CommonTag]->SetLineColor(3);
148 <        hs["SplusB_"+CommonTag]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance"));
148 >        hs["SplusB_"+CommonTag]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance w.r.t. "+ref[j]+"-"+sel[k]));
149          hs["SplusB_"+CommonTag]->GetYaxis()->SetTitle("Normalized to 5/pb");
150          //       hs["SplusB_"+CommonTag]->GetYaxis()->SetTitle("Num of Events @ L_{int} = 5 pb^{-1}");
151          if (ref[j] == "pv") hs["SplusB_"+CommonTag]->GetXaxis()->SetRangeUser(0,6);
# Line 168 | Line 170 | void MuonIPScut()
170          l0->AddEntry(hs[CommonTag+"_bkg"],"QCD - others (B_{2})","l");
171          l0->Draw();
172  
173 <        c0->cd(2);
173 >        ts[fileName]->cd(2);
174          hs[CommonTag+"_incl_TT"]->SetLineColor(2);
175          hs[CommonTag+"_incl_TT"]->SetLineWidth(2);
176 <        hs[CommonTag+"_incl_TT"]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance"));
176 >        hs[CommonTag+"_incl_TT"]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance w.r.t. "+ref[j]+"-"+sel[k]));
177          hs[CommonTag+"_incl_TT"]->GetYaxis()->SetTitle("Arbitrary Units");
178          if (ref[j] == "pv") hs[CommonTag+"_incl_TT"]->GetXaxis()->SetRangeUser(0,6);
179  
# Line 203 | Line 205 | void MuonIPScut()
205          l1->AddEntry(hs[CommonTag+"_excl_QCDbc"],"QCD - b/c decays","l");
206          l1->Draw();
207  
208 <        c0->cd(3);
208 >        ts[fileName]->cd(3);
209          hs["SplusB_"+CommonTag1]->SetLineColor(3);
210 <        hs["SplusB_"+CommonTag1]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter"));
210 >        hs["SplusB_"+CommonTag1]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter w.r.t. "+ref[j]+"-"+sel[k]));
211          hs["SplusB_"+CommonTag1]->GetYaxis()->SetTitle("Normalized to 5/pb");
212          //       hs["SplusB"+CommonTag1]->GetYaxis()->SetTitle("Num of Events @ L_{int} = 5 pb^{-1}");
213          if (ref[j] == "pv") hs["SplusB_"+CommonTag1]->GetXaxis()->SetRangeUser(0,0.04);
# Line 228 | Line 230 | void MuonIPScut()
230          l01->AddEntry(hs[CommonTag1+"_bkg"],"QCD - others (B_{2})","l");
231          l01->Draw();
232  
233 <        c0->cd(4);
233 >        ts[fileName]->cd(4);
234          hs[CommonTag1+"_incl_TT"]->SetLineColor(2);
235          hs[CommonTag1+"_incl_TT"]->SetLineWidth(2);
236 <        hs[CommonTag1+"_incl_TT"]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter"));
236 >        hs[CommonTag1+"_incl_TT"]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter w.r.t. "+ref[j]+"-"+sel[k]));
237          hs[CommonTag1+"_incl_TT"]->GetYaxis()->SetTitle("Arbitrary Units");
238          if (ref[j] == "pv") hs[CommonTag1+"_incl_TT"]->GetXaxis()->SetRangeUser(0,0.04);
239  
# Line 263 | Line 265 | void MuonIPScut()
265          l11->AddEntry(hs[CommonTag1+"_excl_QCDbc"],"QCD - b/c decays","l");
266          l11->Draw();
267  
268 <        c0->cd(5);
268 >        ts[fileName]->cd(5);
269  
270          hs["SoverB_"+CommonTag]->SetLineColor(4);
271 <        hs["SoverB_"+CommonTag]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance"));
271 >        hs["SoverB_"+CommonTag]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance w.r.t. "+ref[j]+"-"+sel[k]));
272          hs["SoverB_"+CommonTag]->GetYaxis()->SetTitle("Arbitrary Units");
273          if (ref[j] == "pv") hs["SoverB_"+CommonTag]->GetXaxis()->SetRangeUser(0,6);
274          hs["SoverB_"+CommonTag]->Draw("hist");
# Line 276 | Line 278 | void MuonIPScut()
278          l2->AddEntry(hs["SoverB_IPS_"+CommonTag],"#frac{S}{B}","");
279          l2->Draw();
280  
281 <        c0->cd(6);
281 >        ts[fileName]->cd(6);
282          hs["SoverSqrtSplusB_"+CommonTag]->SetLineColor(4);
283 <        hs["SoverSqrtSplusB_"+CommonTag]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance"));
283 >        hs["SoverSqrtSplusB_"+CommonTag]->GetXaxis()->SetTitle(TString(dim[i]+" Impact Parameter Significance w.r.t. "+ref[j]+"-"+sel[k]));
284          hs["SoverSqrtSplusB_"+CommonTag]->GetYaxis()->SetTitle("Arbitrary Units");
285          if (ref[j] == "pv") hs["SoverSqrtSplusB_"+CommonTag]->GetXaxis()->SetRangeUser(0,6);
286          hs["SoverSqrtSplusB_"+CommonTag]->Draw("hist");
# Line 288 | Line 290 | void MuonIPScut()
290          l3->AddEntry(hs["SoverSqrtSplusB_"+CommonTag],"#frac{S}{#sqrt{S+B}}","");
291          l3->Draw();
292  
293 <        //c0->Print(TString("Summary_" + dim[i] + "_" + ref[j] + "_" + sel[k])+".pdf");
293 >        ts[fileName]->Print(TString("Summary_" + dim[i] + "_" + ref[j] + "_" + sel[k])+".png");
294          //hs.clear();
295        }
296      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines