コード例 #1
0
ファイル: make_up.C プロジェクト: ldcorpe/flashgg
void make_up(){
  //  gROOT->Reset();
  //  gStyle->SetOptStat(1111);
  gStyle->SetOptStat(0);
  gStyle->SetPalette(1);
  gStyle->SetPaintTextFormat("2.3f");
  
  TFile * theFile = new TFile("output_hlt.root");
  
  if(!theFile) return 0;

  system("mkdir -p plots");

  //cout<<"creating canvas"<<endl;

  Ca0->cd();

  //turnon curve
  //Interesting bits
  
  //string interesting_bits[]={"418","6","416","8","5","412","233","7","234","10","187","9","22","198","430","404","188","199","21","190","197","208","201","207","195","196","206","193","424","192","204","194","203","205","209","189","200","191"};
  
  //string in_bits[]={"418","6"}
  //for(int k=0;k<2;k++){
  
  TH2F * numerator;
  TH2F * denominator;

  cout<<"going for 2D 2/1"<<endl; 

  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_2"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_1"));
  binomialEfficiency2D(numerator,denominator,true,true);
  Ca0->SaveAs(("plots/eff21_wide_pt1pt2.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("pt1pt2_2"));
  denominator= (TH2F*) (theFile->Get("pt1pt2_1"));
  binomialEfficiency2D(numerator,denominator,false,true);
  Ca0->SaveAs(("plots/eff21_pt1pt2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Norm_2"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Norm_1"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff21_pt1pt2Norm.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Zoom_2"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Zoom_1"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,true,false);
  Ca0->SaveAs(("plots/eff21_pt1pt2Zoom.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("eta1eta2_2"));
  denominator= (TH2F*) (theFile->Get("eta1eta2_1"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff21_eta1eta2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("phi1phi2_2"));
  denominator= (TH2F*) (theFile->Get("phi1phi2_1"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff21_phi1phi2.png"));
  Ca0->Clear();

  cout<<"going for 2D 4/3"<<endl; 

  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_4"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_3"));
  binomialEfficiency2D(numerator,denominator,true,true);
  Ca0->SaveAs(("plots/eff43_wide_pt1pt2.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("pt1pt2_4"));
  denominator= (TH2F*) (theFile->Get("pt1pt2_3"));
  binomialEfficiency2D(numerator,denominator,false,true);
  Ca0->SaveAs(("plots/eff43_pt1pt2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Norm_4"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Norm_3"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff43_pt1pt2Norm.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Zoom_4"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Zoom_3"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,true,false);
  Ca0->SaveAs(("plots/eff43_pt1pt2Zoom.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("eta1eta2_4"));
  denominator= (TH2F*) (theFile->Get("eta1eta2_3"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff43_eta1eta2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("phi1phi2_4"));
  denominator= (TH2F*) (theFile->Get("phi1phi2_3"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff43_phi1phi2.png"));
  Ca0->Clear();

  cout<<"going for 2D 6/5"<<endl; 

  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_6"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_5"));
  binomialEfficiency2D(numerator,denominator,true,true);
  Ca0->SaveAs(("plots/eff65_wide_pt1pt2.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("pt1pt2_6"));
  denominator= (TH2F*) (theFile->Get("pt1pt2_5"));
  binomialEfficiency2D(numerator,denominator,false,true);
  Ca0->SaveAs(("plots/eff65_pt1pt2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Norm_6"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Norm_5"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff65_pt1pt2Norm.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Zoom_6"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Zoom_5"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,true,false);
  Ca0->SaveAs(("plots/eff65_pt1pt2Zoom.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("eta1eta2_6"));
  denominator= (TH2F*) (theFile->Get("eta1eta2_5"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff65_eta1eta2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("phi1phi2_6"));
  denominator= (TH2F*) (theFile->Get("phi1phi2_5"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff65_phi1phi2.png"));
  Ca0->Clear();

  cout<<"going for 2D 8/7"<<endl; 

  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_8"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_7"));
  binomialEfficiency2D(numerator,denominator,true,true);
  Ca0->SaveAs(("plots/eff87_wide_pt1pt2.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("pt1pt2_8"));
  denominator= (TH2F*) (theFile->Get("pt1pt2_7"));
  binomialEfficiency2D(numerator,denominator,false,true);
  Ca0->SaveAs(("plots/eff87_pt1pt2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Norm_8"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Norm_7"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff87_pt1pt2Norm.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Zoom_8"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Zoom_7"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,true,false);
  Ca0->SaveAs(("plots/eff87_pt1pt2Zoom.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("eta1eta2_8"));
  denominator= (TH2F*) (theFile->Get("eta1eta2_7"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff87_eta1eta2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("phi1phi2_8"));
  denominator= (TH2F*) (theFile->Get("phi1phi2_7"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff87_phi1phi2.png"));
  Ca0->Clear();

  cout<<"going for 2D 1/0"<<endl; 

  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_1"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_0"));
  binomialEfficiency2D(numerator,denominator,true,true);
  Ca0->SaveAs(("plots/eff10_wide_pt1pt2.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("pt1pt2_1"));
  denominator= (TH2F*) (theFile->Get("pt1pt2_0"));
  binomialEfficiency2D(numerator,denominator,false,true);
  Ca0->SaveAs(("plots/eff10_pt1pt2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Norm_1"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Norm_0"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff10_pt1pt2Norm.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("pt1pt2Zoom_1"));
  denominator= (TH2F*) (theFile->Get("pt1pt2Zoom_0"));
  denominator->GetXaxis()->SetTitle("p_{T} Lead / M_{#gamma #gamma}");
  denominator->GetYaxis()->SetTitle("p_{T} Trail / M_{#gamma #gamma}");
  binomialEfficiency2D(numerator,denominator,true,false);
  Ca0->SaveAs(("plots/eff10_pt1pt2Zoom.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("eta1eta2_1"));
  denominator= (TH2F*) (theFile->Get("eta1eta2_0"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff10_eta1eta2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("phi1phi2_1"));
  denominator= (TH2F*) (theFile->Get("phi1phi2_0"));
  binomialEfficiency2D(numerator,denominator,false,false);
  Ca0->SaveAs(("plots/eff10_phi1phi2.png"));
  Ca0->Clear();

  //Binomial Efficiency 1D

  TH1F * numerator1D;
  TH1F * denominator1D; 

  cout<<"going for 1D 2/1"<<endl; 

  numerator1D = (TH1F*) (theFile->Get("higgsEta_2"));
  denominator1D = (TH1F*) (theFile->Get("higgsEta_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"eta");
  Ca0->SaveAs(("plots/eff21_higgsEta.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPhi_2"));
  denominator1D = (TH1F*) (theFile->Get("higgsPhi_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"phi");
  Ca0->SaveAs(("plots/eff21_higgsPhi.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsP_2"));
  denominator1D = (TH1F*) (theFile->Get("higgsP_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff21_higgsP.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_2"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff21_diphoton_LeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_2"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff21_diphoton_SubLeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPt_2"));
  denominator1D = (TH1F*) (theFile->Get("higgsPt_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff21_higgsPt.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massDiphoton_2"));
  denominator1D = (TH1F*) (theFile->Get("massDiphoton_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff21_massDiphoton.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massHiggs_2"));
  denominator1D = (TH1F*) (theFile->Get("massHiggs_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff21_massHiggs.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLead_2"));
  denominator1D = (TH1F*) (theFile->Get("ptLead_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff21_ptLead.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrail_2"));
  denominator1D = (TH1F*) (theFile->Get("ptTrail_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff21_ptTrail.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLeadNorm_2"));
  denominator1D = (TH1F*) (theFile->Get("ptLeadNorm_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff21_ptLeadNorm.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrailNorm_2"));
  denominator1D = (TH1F*) (theFile->Get("ptTrailNorm_1"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff21_ptTrailNorm.png"));
  Ca0->Clear();

  cout<<"going for 1D 4/3"<<endl; 

  numerator1D = (TH1F*) (theFile->Get("higgsEta_4"));
  denominator1D = (TH1F*) (theFile->Get("higgsEta_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"eta");
  Ca0->SaveAs(("plots/eff43_higgsEta.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPhi_4"));
  denominator1D = (TH1F*) (theFile->Get("higgsPhi_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"phi");
  Ca0->SaveAs(("plots/eff43_higgsPhi.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsP_4"));
  denominator1D = (TH1F*) (theFile->Get("higgsP_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff43_higgsP.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_4"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff43_diphoton_LeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_4"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff43_diphoton_SubLeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPt_4"));
  denominator1D = (TH1F*) (theFile->Get("higgsPt_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff43_higgsPt.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massDiphoton_4"));
  denominator1D = (TH1F*) (theFile->Get("massDiphoton_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff43_massDiphoton.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massHiggs_4"));
  denominator1D = (TH1F*) (theFile->Get("massHiggs_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff43_massHiggs.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLead_4"));
  denominator1D = (TH1F*) (theFile->Get("ptLead_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff43_ptLead.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrail_4"));
  denominator1D = (TH1F*) (theFile->Get("ptTrail_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff43_ptTrail.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLeadNorm_4"));
  denominator1D = (TH1F*) (theFile->Get("ptLeadNorm_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff43_ptLeadNorm.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrailNorm_4"));
  denominator1D = (TH1F*) (theFile->Get("ptTrailNorm_3"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff43_ptTrailNorm.png"));


  cout<<"going for 1D 6/5"<<endl; 

  numerator1D = (TH1F*) (theFile->Get("higgsEta_6"));
  denominator1D = (TH1F*) (theFile->Get("higgsEta_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"eta");
  Ca0->SaveAs(("plots/eff65_higgsEta.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPhi_6"));
  denominator1D = (TH1F*) (theFile->Get("higgsPhi_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"phi");
  Ca0->SaveAs(("plots/eff65_higgsPhi.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsP_6"));
  denominator1D = (TH1F*) (theFile->Get("higgsP_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff65_higgsP.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_6"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff65_diphoton_LeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_6"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff65_diphoton_SubLeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPt_6"));
  denominator1D = (TH1F*) (theFile->Get("higgsPt_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff65_higgsPt.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massDiphoton_6"));
  denominator1D = (TH1F*) (theFile->Get("massDiphoton_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff65_massDiphoton.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massHiggs_6"));
  denominator1D = (TH1F*) (theFile->Get("massHiggs_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff65_massHiggs.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLead_6"));
  denominator1D = (TH1F*) (theFile->Get("ptLead_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff65_ptLead.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrail_6"));
  denominator1D = (TH1F*) (theFile->Get("ptTrail_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff65_ptTrail.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLeadNorm_6"));
  denominator1D = (TH1F*) (theFile->Get("ptLeadNorm_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff65_ptLeadNorm.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrailNorm_6"));
  denominator1D = (TH1F*) (theFile->Get("ptTrailNorm_5"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff65_ptTrailNorm.png"));

  cout<<"going for 1D 8/7"<<endl; 

  numerator1D = (TH1F*) (theFile->Get("higgsEta_8"));
  denominator1D = (TH1F*) (theFile->Get("higgsEta_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"eta");
  Ca0->SaveAs(("plots/eff87_higgsEta.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPhi_8"));
  denominator1D = (TH1F*) (theFile->Get("higgsPhi_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"phi");
  Ca0->SaveAs(("plots/eff87_higgsPhi.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsP_8"));
  denominator1D = (TH1F*) (theFile->Get("higgsP_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff87_higgsP.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_8"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff87_diphoton_LeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_8"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff87_diphoton_SubLeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPt_8"));
  denominator1D = (TH1F*) (theFile->Get("higgsPt_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff87_higgsPt.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massDiphoton_8"));
  denominator1D = (TH1F*) (theFile->Get("massDiphoton_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff87_massDiphoton.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massHiggs_8"));
  denominator1D = (TH1F*) (theFile->Get("massHiggs_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff87_massHiggs.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLead_8"));
  denominator1D = (TH1F*) (theFile->Get("ptLead_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff87_ptLead.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrail_8"));
  denominator1D = (TH1F*) (theFile->Get("ptTrail_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff87_ptTrail.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLeadNorm_8"));
  denominator1D = (TH1F*) (theFile->Get("ptLeadNorm_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff87_ptLeadNorm.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrailNorm_8"));
  denominator1D = (TH1F*) (theFile->Get("ptTrailNorm_7"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff87_ptTrailNorm.png"));


  cout<<"going for 1D 1/0"<<endl; 

  numerator1D = (TH1F*) (theFile->Get("higgsEta_1"));
  denominator1D = (TH1F*) (theFile->Get("higgsEta_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"eta");
  Ca0->SaveAs(("plots/eff10_higgsEta.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPhi_1"));
  denominator1D = (TH1F*) (theFile->Get("higgsPhi_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"phi");
  Ca0->SaveAs(("plots/eff10_higgsPhi.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsP_1"));
  denominator1D = (TH1F*) (theFile->Get("higgsP_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff10_higgsP.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_1"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_LeadR9_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff10_diphoton_LeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_1"));
  denominator1D = (TH1F*) (theFile->Get("diphoton_SubLeadR9_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff10_diphoton_SubLeadR9.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPt_1"));
  denominator1D = (TH1F*) (theFile->Get("higgsPt_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff10_higgsPt.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massDiphoton_1"));
  denominator1D = (TH1F*) (theFile->Get("massDiphoton_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff10_massDiphoton.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massHiggs_1"));
  denominator1D = (TH1F*) (theFile->Get("massHiggs_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"m");
  Ca0->SaveAs(("plots/eff10_massHiggs.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLead_1"));
  denominator1D = (TH1F*) (theFile->Get("ptLead_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff10_ptLead.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrail_1"));
  denominator1D = (TH1F*) (theFile->Get("ptTrail_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"p");
  Ca0->SaveAs(("plots/eff10_ptTrail.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLeadNorm_1"));
  denominator1D = (TH1F*) (theFile->Get("ptLeadNorm_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff10_ptLeadNorm.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrailNorm_1"));
  denominator1D = (TH1F*) (theFile->Get("ptTrailNorm_0"));
  binomialEfficiency1D(numerator1D,denominator1D,"pn");
  Ca0->SaveAs(("plots/eff10_ptTrailNorm.png"));

  cout<<"going for Draw2D"<<endl; 
  gStyle->SetPaintTextFormat("1.0f");
  TH1F * cutflow = (TH1F*)(theFile->Get("cutflow"));
  cutflow->Draw("");
  cutflow->Draw("htextsame");
  cutflow->SetFillColor(kYellow);
  cutflow->SetXTitle("cut[]");
  Ca0->SaveAs("plots/cutflow.png");
  Ca0->Clear();
  
  gStyle->SetPaintTextFormat("1.3f");
  Draw2D("wide_pt1pt2","p_{T} Lead (GeV)","p_{T} Trail (GeV)",theFile,true);
  Draw2D("phi1phi2","#phi_{Lead}","#phi_{Trail}",theFile,false);
  Draw2D("eta1eta2","#eta_{Lead}","#eta_{Trail}",theFile,false);
  Draw2D("pt1pt2","p_{T} Lead (GeV)","p_{T} Trail (GeV)",theFile,false);
  Draw2D("pt1pt2Norm","p_{T} Lead / M_{#gamma #gamma}","p_{T} Trail / M_{#gamma #gamma}",theFile,false);
  Draw2D("pt1pt2Zoom","p_{T} Lead / M_{#gamma #gamma}","p_{T} Trail / M_{#gamma #gamma}",theFile,false);

  
  cout<<"going for Draw1D"<<endl; 
  
  int cut1=0;
  int cut2=1;
  Draw1D("higgsEta","#eta_{H}",theFile,cut1,cut2);
  Draw1D("higgsPhi","#phi_{H}",theFile,cut1,cut2);
  Draw1D("higgsPt","p (GeV)",theFile,cut1,cut2);
  Draw1D("higgsP","p (GeV)",theFile,cut1,cut2); 
  Draw1D("diphoton_LeadR9","diphoton_LeadR9",theFile,cut1,cut2);
  Draw1D("diphoton_SubLeadR9","diphoton_SubLeadR9",theFile,cut1,cut2);
  
  for(cut1=1;cut1<=7;cut1=cut1+2){
    cut2=cut1+1;
    Draw1D("higgsEta","#eta_{H}",theFile,cut1,cut2);
    Draw1D("higgsPhi","#phi_{H}",theFile,cut1,cut2);
    Draw1D("higgsPt","p (GeV)",theFile,cut1,cut2);
    Draw1D("higgsP","p (GeV)",theFile,cut1,cut2); 
    Draw1D("diphoton_LeadR9","diphoton_LeadR9",theFile,cut1,cut2);
    Draw1D("diphoton_SubLeadR9","diphoton_SubLeadR9",theFile,cut1,cut2);
  }
  
  //Ca0->SetLogy();

  cut1=0;
  cut2=1;
  Draw1D("ptLead","p_{T} Lead (GeV)",theFile,cut1,cut2); 
  Draw1D("ptTrail","p_{T} Trail (GeV)",theFile,cut1,cut2);
  Draw1D("ptLeadNorm","p_{T} Lead / M_{#gamma #gamma} ",theFile,cut1,cut2); 
  Draw1D("ptTrailNorm","p_{T} Trail / M_{#gamma #gamma}",theFile,cut1,cut2);
  Draw1D("massDiphoton","mass_{#gamma #gamma} (GeV)",theFile,cut1,cut2);
  Draw1D("massHiggs","mass_{H} (GeV)",theFile,cut1,cut2);

  
  for(cut1=1;cut1<=7;cut1=cut1+2){
    cut2=cut1+1;
    Draw1D("ptLead","p_{T} Lead (GeV)",theFile,cut1,cut2); 
    Draw1D("ptTrail","p_{T} Trail (GeV)",theFile,cut1,cut2);
    Draw1D("ptLeadNorm","p_{T} Lead / M_{#gamma #gamma} ",theFile,cut1,cut2); 
    Draw1D("ptTrailNorm","p_{T} Trail / M_{#gamma #gamma}",theFile,cut1,cut2);
    Draw1D("massDiphoton","mass_{#gamma #gamma} (GeV)",theFile,cut1,cut2);
    Draw1D("massHiggs","mass_{H} (GeV)",theFile,cut1,cut2);
  }
  
  exit(0);
}
コード例 #2
0
void make_up(){
  gROOT->Reset();
  //  gStyle->SetOptStat(1111);
  gStyle->SetOptStat(0);
  gStyle->SetPalette(1);
  gStyle->SetPaintTextFormat("2.2f");
  
  //TFile * theFile = new TFile("/afs/cern.ch/user/c/carrillo/higgs/yy/hlt/CMSSW_5_3_2_patch4/src/genAnalyzer/GenAnalyzer/genAnalyzer.root");
  TFile * theFile = new TFile("genAnalyzer.root");
  //TFile * theFile = new TFile("HiggsGenHltRecoAnalyzer/test/genAnalyzer.root");

  system("mkdir gen");
  system("mkdir hlt");

  cout<<"creating canvas"<<endl;
  TCanvas * Ca0 = new TCanvas("Ca0","bit0",1200,800);
  Ca0->cd();

  Draw1D("ptLead","p_{T} (GeV)","gen/",theFile); 
  Draw1D("ptTrail","p_{T} (GeV)","gen/",theFile);
  Draw1D("massDiphoton","mass_{#gamma #gamma} (GeV)","gen/",theFile);
  Draw1D("massHiggs","mass_{H} (GeV)","gen/",theFile);
  Draw1D("higgsEta","#eta_{H} (GeV)","gen/",theFile);
  Draw1D("higgsPhi","#phi_{H} (GeV)","gen/",theFile);
  Draw1D("higgsPt","#p (GeV)","gen/",theFile);
  Draw1D("higgsP","#p (GeV)","gen/",theFile); 

  
  //turnon curve
  //Interesting bits
  
  //  string interesting_bits[]={"418","6","416","8","5","412","233","7","234","10","187","9","22","198","430","404","188","199","21","190","197","208","201","207","195","196","206","193","424","192","204","194","203","205","209","189","200","191"};
  
  //string in_bits[]={"418","6"}
  //for(int k=0;k<2;k++){
  
  //Definition for the interesting bits                                                                                                  
  //0 gen                                                                                                                                
  //1 acc                                                                                                                                
  //2 194*acc                                                                                                                                
  //3 195*acc                                                                                                                                
  //4 205*acc                                                                                                                                
  //5 OR*acc                                                                                                                                 
  //6 OR*acc                                                                                                                                 
  

  TH2F * numerator;
  TH2F * denominator;
  cout<<"going for 2D"<<endl;

  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_5"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator->GetEntries()/denominator->GetEntries()<<endl;
  binomialEfficiency2D(numerator,denominator,true);
  Ca0->SaveAs(("hlt/or_over_acc_efficiency.png"));
  Ca0->Clear();
  binomialEfficiency2D(numerator,denominator,false);
  Ca0->SaveAs(("hlt/eff_wide_pt1pt2.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_4"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_1"));
  cout<<"calling binomial efficiency 4/1 ="<<numerator->GetEntries()/denominator->GetEntries()<<endl;
  binomialEfficiency2D(numerator,denominator,true);
  Ca0->SaveAs(("hlt/205_over_acc_efficiency.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_3"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_1"));
  cout<<"calling binomial efficiency 3/1 ="<<numerator->GetEntries()/denominator->GetEntries()<<endl;
  binomialEfficiency2D(numerator,denominator,true);
  Ca0->SaveAs(("hlt/195_over_acc_efficiency.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("wide_pt1pt2_2"));
  denominator= (TH2F*) (theFile->Get("wide_pt1pt2_1"));
  cout<<"calling binomial efficiency 2/1 ="<<numerator->GetEntries()/denominator->GetEntries()<<endl;
  binomialEfficiency2D(numerator,denominator,true);
  Ca0->SaveAs(("hlt/194_over_acc_efficiency.png"));
  Ca0->Clear();
  
  numerator  = (TH2F*) (theFile->Get("pt1pt2_5"));
  denominator= (TH2F*) (theFile->Get("pt1pt2_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator->GetEntries()/denominator->GetEntries()<<endl;
  binomialEfficiency2D(numerator,denominator,false);
  Ca0->SaveAs(("hlt/eff_pt1pt2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("eta1eta2_5"));
  denominator= (TH2F*) (theFile->Get("eta1eta2_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator->GetEntries()/denominator->GetEntries()<<endl;
  binomialEfficiency2D(numerator,denominator,false);
  Ca0->SaveAs(("hlt/eff_eta1eta2.png"));
  Ca0->Clear();

  numerator  = (TH2F*) (theFile->Get("phi1phi2_5"));
  denominator= (TH2F*) (theFile->Get("phi1phi2_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator->GetEntries()/denominator->GetEntries()<<endl;
  binomialEfficiency2D(numerator,denominator,false);
  Ca0->SaveAs(("hlt/eff_phi1phi2.png"));
  Ca0->Clear();

  Draw2D("wide_pt1pt2","p_{T} Lead (GeV)","p_{T} Trail (GeV)","gen/",theFile);
  Draw2D("phi1phi2","#phi_{Lead}","#phi_{Trail}","gen/",theFile);
  Draw2D("eta1eta2","#eta_{Lead}","#eta_{Trail}","gen/",theFile);
  Draw2D("pt1pt2","p_{T} Lead (GeV)","p_{T} Trail (GeV)","gen/",theFile);

  //Binomial Efficiency 1D

  TH1F * numerator1D;
  TH1F * denominator1D; 

  numerator1D = (TH1F*) (theFile->Get("higgsEta_5"));
  denominator1D = (TH1F*) (theFile->Get("higgsEta_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_higgsEta.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPhi_5"));
  denominator1D = (TH1F*) (theFile->Get("higgsPhi_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_higgsPhi.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsP_5"));
  denominator1D = (TH1F*) (theFile->Get("higgsP_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_higgsP.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("higgsPt_5"));
  denominator1D = (TH1F*) (theFile->Get("higgsPt_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_higgsPt.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massDiphoton_5"));
  denominator1D = (TH1F*) (theFile->Get("massDiphoton_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_massDiphoton.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("massHiggs_5"));
  denominator1D = (TH1F*) (theFile->Get("massHiggs_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_massHiggs.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptLead_5"));
  denominator1D = (TH1F*) (theFile->Get("ptLead_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_ptLead.png"));
  Ca0->Clear();

  numerator1D = (TH1F*) (theFile->Get("ptTrail_5"));
  denominator1D = (TH1F*) (theFile->Get("ptTrail_1"));
  cout<<"calling binomial efficiency 5/1 ="<<numerator1D->GetEntries()/denominator1D->GetEntries()<<endl;
  binomialEfficiency1D(numerator1D,denominator1D);
  Ca0->SaveAs(("gen/eff_ptTrail.png"));
  Ca0->Clear();

  exit(0);
}