#include #include #include #include //#include "UserCode/TopAnalysis/interface/MiniEvent.h" //#include "UserCode/TopAnalysis/interface/ReadTree.h" #include #include #include #include #include #include "TMath.h" #include #include #include #include #include void lorentz32() //void stupid_TLV(TString filename, TString outname) { TFile *f = new TFile("May26_2.root"); TTree *t = (TTree*)f->Get("demo/AnaTree"); TH1F *h1 = new TH1F("h1","Z1_mass",100,0,300); TH1F *h2 = new TH1F("h2","Z2_mass",100,0,300); TH1F *h3 = new TH1F("h3","Z3_mass",100,0,300); using namespace std; float SelMu_px, SelMu_py, SelMu_pz, SelMu_en, SelMu_pt, SelMu_eta, SelMu_phi; int SelMu, SelMu_charge; t->SetBranchAddress("SelMu_px",&SelMu_px); t->SetBranchAddress("SelMu_py",&SelMu_py); t->SetBranchAddress("SelMu_pz",&SelMu_pz); t->SetBranchAddress("SelMu_en",&SelMu_en); t->SetBranchAddress("SelMu",&SelMu); t->SetBranchAddress("SelMu_charge",&SelMu_charge); TLorentzVector tmp(0,0,0,0), tmp1(0,0,0,0), tmp2(0,0,0,0), tmp3(0,0,0,0); for (int i=0;i<10000;i++) { TLorentzVector tmp, tmp1, tmp2, tmp3, tmp4; tmp.SetPxPyPzE(SelMu_px,SelMu_py,SelMu_pz,SelMu_en); t->GetEntry(i); cout<< " i : "<0.) continue; //if (SelMu_charge[m3]*SelMu_charge[m1]<0.); continue; if(m<1 )continue; if (SelMu_charge[1]*SelMu_charge[2]>0.); continue; // double z_mass = (tmp1 + tmp2).Pt(); // double z_mass = (tmp2 + tmp3).Pt(); double z1_mass = (tmp1 + tmp2).M(); double z2_mass = (tmp2 + tmp3).M(); double z3_mass = (tmp1 + tmp3).M(); cout<< z1_mass<Fill(); h1->Fill(z1_mass); h2->Fill(z2_mass); h3->Fill(SelMu_en[m]); } } TCanvas *c1 = new TCanvas("c1","c1",800,600) ; c1->Divide(2,2); c1->cd(1); h1->Draw(); h1->GetXaxis()->SetTitle("Z_12_mass"); c1->cd(2); h2->Draw(); h2->GetXaxis()->SetTitle("Z_23_mass"); c1->cd(3); h3->Draw(); h3->GetXaxis()->SetTitle("Z_31_mass"); // f->Write(); }