#define Analysis_cxx #include "Analysis.h" #include #include #include void Analysis::Loop() { if (fChain == 0) return; Long64_t nentries = fChain->GetEntriesFast(); cout<<"Number of entries to analyse =\t"<GetEntry(jentry); nbytes += nb; if(jentry%50000==0)cout<<"Number of events analysed =\t"<Fill(njets); // Loop Over Jets for (Int_t j = 0; j< jet_E->size(); j++) { histo_jetpt->Fill(jet_pt->at(j)); } //For leading & subleading jets if (jet_pt->size()<2)continue;//crosscheck histo_leadingjetpt->Fill(jet_pt->at(0)); histo_subleadingjetpt->Fill(jet_pt->at(1)); //To calculate all the kinematics of leading/subleading jets: We use Lorentz Factor TLorentzVector LeadJet; TLorentzVector SubLeadJet; TLorentzVector JetSum; LeadJet->SetPtEtaPhiE(jet_pt->at(0), jet_eta->at(0), jet_phi->at(0), jet_E->at(0)); SubLeadJet->SetPtEtaPhiE(jet_pt->at(1), jet_eta->at(1), jet_phi->at(1), jet_E->at(1)); JetSum=LeadJet+SubLeadJet;//Dijet //Calculate Dijet Kinematics here hist_mjj->Fill(JetSum.M()); }//event loop //Plotting/Saving outside event loop TFile Outfile("Output.root","RECREATE"); histo_njet->Write(); histo_jetpt->Write(); histo_leadingjetpt->Write(); histo_subleadingjetpt->Write(); hist_mjj->Write(); Outfile.Close(); // select postscript output type // type = 111 portrait ps // type = 112 landscape ps // type = 113 eps TCanvas c1("c1","canvas",800,600); TPostScript ps("myfile.ps",112); ps.Range(16,24); //Picture 1 on Page 1 // ps->NewPage(); histo_njet->Draw(); c1.Update(); //Picture 2 on Page 2 // ps->NewPage(); histo_jetpt->Draw(); c1.Update(); //Picture 3 on Page 3 //ps->NewPage(); histo_leadingjetpt->Draw(); c1.Update(); //Picture 4 on Page 4 //ps->NewPage(); histo_subleadingjetpt->Draw(); c1.Update(); //Picture 5 on Page 5 //ps->NewPage(); hist_mjj->Draw(); c1.Update(); ps.Close(); }