#include #include #include #include #include #include #include #include #include #include "TMath.h" #include #include #include #include #include void third_new() { TFile *f = new TFile("May26_2.root"); TTree *t = (TTree*)f->Get("demo/AnaTree"); TH1F *h1 = new TH1F("h1","Z1_mass",100,0,200); TH1F *h2 = new TH1F("h2","Z2_mass",100,0,200); TH1F *h3 = new TH1F("h3","Z3_mass",100,0,200); double bins_x[] = {10, 20, 40, 70, 100}; double bins_y[] = {0, 1, 1.5, 2.5}; TH2F *tight_mu = new TH2F("tight_mu", "tight muons;tight_Pt_{T}^{} [GeV/c];#eta",(sizeof(bins_x) / sizeof(double) - 1), bins_x, (sizeof(bins_y) / sizeof(double) - 1), bins_y); tight_mu->Sumw2(kTRUE); TH2F *loose_mu = new TH2F("loose_mu", "loose muons;loose_Pt_{T}^{} [GeV/c];#eta",(sizeof(bins_x) / sizeof(double) - 1), bins_x, (sizeof(bins_y) / sizeof(double) - 1), bins_y); loose_mu->Sumw2(kTRUE); using namespace std; Float_t VetoMu_px[1000], VetoMu_py[1000], VetoMu_pz[1000], VetoMu_en[1000], VetoMu_pt[1000], VetoMu_eta[1000], VetoMu_phi[1000], VetoMu_iso[1000]; Int_t VetoMu, VetoMu_charge[1000], VetoMu_ismuon[1000], VetoMu_idTight[1000]; t->SetBranchAddress("VetoMu_px",VetoMu_px); t->SetBranchAddress("VetoMu_py",VetoMu_py); t->SetBranchAddress("VetoMu_pz",VetoMu_pz); t->SetBranchAddress("VetoMu_en",VetoMu_en); t->SetBranchAddress("VetoMu",&VetoMu); t->SetBranchAddress("VetoMu_charge",&VetoMu_charge); t->SetBranchAddress("VetoMu_pt",VetoMu_pt); t->SetBranchAddress("VetoMu_eta",VetoMu_eta); t->SetBranchAddress("VetoMu_phi",VetoMu_phi); t->SetBranchAddress("VetoMu_idTight",VetoMu_idTight); t->SetBranchAddress("VetoMu_ismuon",VetoMu_ismuon); t->SetBranchAddress("VetoMu_iso",VetoMu_iso); 1,11 Top //TLorentzVector tmp(0,0,0,0), tmp1(0,0,0,0), tmp2(0,0,0,0), tmp3(0,0,0,0); // TLorentzVector tmp1, tmp2, tmp3; for (int i=0; i<10000;i++) { int i; TLorentzVector tmp1, tmp2, tmp3; t->GetEntry(i); for(int m=0; mFill(); h1->Fill(z1_mass); // h2->Fill(z2_mass); // h3->Fill(z3_mass); // Cuts for the third muon for(int m3=2; m3 20 && VetoMu_eta[m3] < 2.5 && VetoMu_idTight[m3] && VetoMu_ismuon[me3==1 && VetoMu_iso[m3] < 0.12"); // or whatever your cuts really are TCut loose = TCut("loose", "1"); // or whatever your cuts really are t->Draw("VetoMu_eta:VetoMu_pt >> tight_mu",tight,"goff"); t->Draw("VetoMu_eta:VetoMu_pt >> loose_mu",loose,"goff"); } } } TCanvas *c1 = new TCanvas("c1","c1",800,600) ; c1->Divide(2,2); c1->cd(1); loose_mu->Draw("colz text e"); c1->cd(2); tight_mu->Draw("colz text e"); c1->cd(3); TH2F * h_ratio = (TH2F*) tight_mu->Clone(); h_ratio->Divide(loose_mu); h_ratio->SetTitle("Ratio"); h_ratio->Draw("colz text e"); c1->cd(4); h1->Draw(); // c1->SaveAs("ratio1.pdf"); }