void pl1() { gROOT->SetStyle("Plain"); gStyle->SetTitle(0); char buf[256]; TFile* f1 = new TFile("/data0/asircar/Slims/ZtautauNp0.root"); TTree *t1=(TTree*)f1->Get("physics"); TFile* f2 = new TFile("/data0/asircar/Slims/ZtautauNp1.root"); TTree *t2=(TTree*)f2->Get("physics"); TFile* f3 = new TFile("/data0/asircar/Slims/ZtautauNp2.root"); TTree *t3=(TTree*)f3->Get("physics"); TFile* f4 = new TFile("/data0/asircar/Slims/ZtautauNp3.root"); TTree *t4=(TTree*)f4->Get("physics"); TFile* f5 = new TFile("/data0/asircar/Slims/ZtautauNp4.root"); TTree *t5=(TTree*)f5->Get("physics"); TFile* f6 = new TFile("/data0/asircar/Slims/ZtautauNp5.root"); TTree *t6=(TTree*)f6->Get("physics"); cout<<"test"<Close(); const int nvar = 9; //const char*chvar[nvar]={"tau_seedCalo_EMRadius","tau_seedCalo_centFrac","tau_seedCalo_isolFrac","tau_seedCalo_trkAvgDist","tau_etOverPtLeadTrk","tau_massTrkSys","$ //char str[]="tau_seedCalo_EMRadius"; //string mac = chvar[ivar]; //for (int ivar = 0; ivarGetBranch("tau_seedCalo_EMRadius")->TBranchClone(); // strcpy(buf,str); //TH1F* h2 =(TH1F*)t2->GetBranch("tau_seedCalo_EMRadius")->TBranchClone(); //strcpy(buf,str); // TH1F* h3 =(TH1F*)t3->GetBranch("tau_seedCalo_EMRadius")->TBranchClone(); //strcpy(buf,str); // TH1F* h4 =(TH1F*)t4->GetBranch("tau_seedCalo_EMRadius")->TBranchClone(); // strcpy(buf,str); // TH1F* h5 =(TH1F*)t5->GetBranch("tau_seedCalo_EMRadius")->TBranchClone(); //strcpy(buf,str); // TH1F* h6 =(TH1F*)t6->GetBranch("tau_seedCalo_EMRadius")->TBranchClone(); for (int ivar = 0; ivarGetBranch(chvar[ivar])->Clone(buf); strcpy(buf,chvar[ivar]); strcat(buf,""); TH1F* h2 = (TH1F*)t2->GetBranch(chvar[ivar])->Clone(buf); strcpy(buf,chvar[ivar]); strcat(buf,""); TH1F* h3 = (TH1F*)t3->GetBranch(chvar[ivar])->Clone(buf); strcpy(buf,chvar[ivar]); strcat(buf,""); TH1F* h4 = (TH1F*)t4->GetBranch(chvar[ivar])->Clone(buf); strcpy(buf,chvar[ivar]); strcat(buf,""); TH1F* h5 = (TH1F*)t5->GetBranch(chvar[ivar])->Clone(buf); strcpy(buf,chvar[ivar]); strcat(buf,""); TH1F* h6 = (TH1F*)t6->GetBranch(chvar[ivar])->Clone(buf); cout<<"test2"<Add(h1, h2,0.173553,0.497252); // h1->Add(h3, h1,0.9333333,1); // h1->Add(h1, h4,1,0.930676); // h1->Add(h1, h2,0.116071429,0.578125); // h1->Add(h1, h3,1,0.568888889); // h1->Add(h1, h4,1,0.566724437); h1->Add(h1, h2,1,1); h1->Add(h1, h3,1,1); h1->Add(h1, h4,1,1); h1->Add(h1, h5,1,1); h1->Add(h1, h6,1,1); cout<<"test3"<Add(h1, h7,1,1); // h1->Add(h1, h8,1,1); // h1->Add(h1, h9,1,1); h1->SetLineColor(3); cout<<"test4"<Draw(); // h1->Write(); // f3->Close(); // c1->Update(); TFile *f9 = new TFile("background.root" , "UPDATE"); // h2->Draw("e"); //h1->Draw(); h1->Write(); // h2->Draw("same"); c1->Update(); //c1->Modified(); f9->Close();