void readClassTree(TString inputFile){ TCanvas *c1 = new TCanvas("c1","Electron flux",200,10,600,400); c1->SetGrid(); c1->SetTicks(); c1->Draw(); TCanvas *c2 = new TCanvas("c2","Energy momentum match",200,10,600,400); c2->SetGrid(); c2->SetTicks(); c2->Draw(); // Create some histograms. TH1D *eflux = new TH1D("eflux","Electron simulated flux;GeV;counts",100,0.,20.); TH2D *qnstrip = new TH2D("qnstrip","qtot/nstrip;GeV;qtot/nstrip",1000,-20.,20.,1000,0.,35.); // Open the file TFile *file = TFile::Open(inputFile); TTree *tree = (TTree*)file->Get("pamcalotree"); PamCalo *pc = new PamCalo(); tree->SetBranchAddress("PamCalo",&pc); for ( Int_t i=0; iGetEntries(); i++) { tree->GetEntry(i); if ( pc->energy > -20. && pc->energy < 0. ) eflux->Fill(fabs(pc->energy)); qnstrip->Fill(pc->energy,pc->qtot/(float)pc->nstrip); } c1->cd(); eflux->Draw(); c2->cd(); c2->SetLogz(); qnstrip->Draw("colz"); }