#include #include #include #include #include #include #include #include #include #include #include #include #include #include "TROOT.h" #include "TSystem.h" #include "TApplication.h" #include "TGClient.h" #include "TString.h" #include "TClonesArray.h" #include "TCanvas.h" #include "TFile.h" #include "TTree.h" #include "TH1F.h" #include "TH1I.h" #include "TH1D.h" #include "TH2F.h" #include "TH2I.h" #include "TH2D.h" #include "THStack.h" #include "TLorentzVector.h" #include "/home/sayan/HEPTOOLS/Delphes-3.4.1/external/ExRootAnalysis/ExRootTreeReader.h" #include "/home/sayan/HEPTOOLS/Delphes-3.4.1/external/ExRootAnalysis/ExRootTreeWriter.h" #include "/home/sayan/HEPTOOLS/Delphes-3.4.1/external/ExRootAnalysis/ExRootTreeBranch.h" #include "/home/sayan/HEPTOOLS/Delphes-3.4.1/external/ExRootAnalysis/ExRootResult.h" #include "/home/sayan/HEPTOOLS/Delphes-3.4.1/external/ExRootAnalysis/ExRootUtilities.h" #include "/home/sayan/HEPTOOLS/Delphes-3.4.1/classes/DelphesClasses.h" using namespace std; //----------------------------------------------------------------------------- int main(int argc, char *argv[]) { char commandcheck[50], filecheck[50]; TString in_root, n_events; if ( argc < 2 ){ cout<<"usage: "<< argv[0] <<" \n" ; exit(1); } else{ in_root = (TString) argv[1] ; } gSystem->Load("/home/sayan/HEPTOOLS/Delphes-3.4.1/libDelphes"); //Create chain of root trees TChain chain("Delphes"); chain.Add(in_root); //Create object of class ExrootTreeReader ExRootTreeReader *treeReader = new ExRootTreeReader(&chain); Long64_t numberOfEntries = treeReader->GetEntries(); //Get pointers to branches used in thsi analysis TClonesArray *branchJet = treeReader->UseBranch("Jet"); //Book histograms TH1 *histJetPT = new TH1F("jet_pt", "Haredest jetP_{T}", 450, 0.0, 300.0); //Print number of events cout<<"Number of events:"<ReadEntry(entry); //check if there is at least one jet if(branchJet->GetEntries() > 0){ //Loop over all Jets float xy = 0.0; int itop = 0; for(int i = 0; i < branchJet->GetEntriesFast(); ++i) { Jet *jet = (Jet*)branchJet->At(i); if(jet->PT >= xy) { itop=i; xy = jet->PT;} } //Take jet at itop Jet *jet = (Jet*) branchJet->At(itop); //Plot transverse momentum of that jet histJetPT->Fill(jet->PT); //Print Hardest jet transverse momentum cout << "Hardest Jet pt:"<PT << endl; } } // Show resulting histograms histJetPT->Draw(); gPad->Update(); return 0; }