#include "Riostream.h" #include "make_tree.cc" using namespace std; void make_hist() { //Enumerate the data files string files[] = {"test"}; //ddx", "dxd","uux", "uxu"}; int n_files = (sizeof(files)/sizeof(*files)); string infile, outfile; // // process the text files by converting them to TTrees // cout << "Processing " << n_files << " files..." << endl; // for (int i=0;iGetYaxis()->SetTitle("a. u."); h1->SetMarkerColor(kBlack + 1); h1->SetLineColor(kBlack); h1->SetFillColor(kBlack); h1->SetLineWidth(2); h1->GetYaxis()->SetTitleSize(23); h1->GetYaxis()->SetTitleFont(43); h1->GetYaxis()->SetTitleOffset(1.1); h1->GetYaxis()->SetLabelFont(43); // Absolute font size in pixel (precision 3) h1->GetYaxis()->SetLabelSize(21); //Loop through each of the TTrees and add it's data to the histogram TFile *f; TTree *T_p4Hmumu; TTree *T_weight0; TLorentzVector *p4Hmumul; Double_t weight0; cout << "Finished building TTrees. Getting 4vectors..." << endl; for (int j=0;jGetObject("T",T_p4Hmumu); p4Hmumu = new TLorentzVector(); T_p4Hmumu->SetBranchAddress("p4Hmumu", &p4Hmumu); f->GetObject("T",T_weight0); weight0 = 0; T_weight0->SetBranchAddress("events", &weight0); Int_t nevent = T_p4Hmumu->GetEntries(); cout<GetEvent(i); T_weight0->GetEvent(i); // cout << "Mass was: " << p4Hmumu.M() << " and weight was: " << weight0 << endl; h1->Fill(p4Hmumu.M(), weight0); } cout << "Still in file loop..." << endl; } cout << "No problem yet..." << endl; // h1->Draw("hist"); cout << "Still no problem..." << endl; }