/* Simple macro showing how to access branches from the delphes output root file, loop over events, and plot simple quantities such as the jet pt and the di-electron invariant mass. root -l examples/Example1.C'("delphes_output.root")' */ //------------------------------------------------------------------------------ void Example1(const char *inputFile) { gSystem->Load("libDelphes"); // Create chain of root trees TChain chain("Delphes"); chain.Add(inputFile); // Create object of class ExRootTreeReader ExRootTreeReader *treeReader = new ExRootTreeReader(&chain); Long64_t numberOfEntries = treeReader->GetEntries(); // numberOfEntries is the num of events // Get pointers to branches used in this analysis TClonesArray *branchJet = treeReader->UseBranch("Jet"); // treeReader reads the tree TClonesArray *branchElectron = treeReader->UseBranch("Electron"); Jet *jet[2]; MissingET *met; Electron *electron; // Loop over 100 events for(Int_t entry = 0; entry < 100; ++entry) { // Load selected branches with data from specified event treeReader->ReadEntry(entry); // If event contains at least 1 jet if(branchJet->GetEntries() > 0) { // Take first jet jet[1] = (Jet*) branchJet->At(1); //jet[1] = (Jet*) branchJet->At(1); // Plot jet transverse momentum //histJetPT->Fill(jet[0]->PT); // Print jet transverse momentum cout << "hardest Jet pt: "<PT << endl; cout << "2nd Jet pt: "<PT << endl; } } }