#define LHEF_cxx #include "LHEF.h" #include #include #include #include void LHEF::Loop() { // In a ROOT session, you can do: // Root > .L LHEF.C // Root > LHEF t // Root > t.GetEntry(12); // Fill t data members with entry number 12 // Root > t.Show(); // Show values of entry 12 // Root > t.Show(16); // Read and show values of entry 16 // Root > t.Loop(); // Loop on all entries // // This is the loop skeleton where: // jentry is the global entry number in the chain // ientry is the entry number in the current Tree // Note that the argument to GetEntry must be: // jentry for TChain::GetEntry // ientry for TTree::GetEntry and TBranch::GetEntry // // To read only selected branches, Insert statements like: // METHOD1: // fChain->SetBranchStatus("*",0); // disable all branches // fChain->SetBranchStatus("branchname",1); // activate branchname // METHOD2: replace line // fChain->GetEntry(jentry); //read all branches //by b_branchname->GetEntry(ientry); //read only this branch if (fChain == 0) return; fChain->SetBranchStatus("*", 0); // disable all branches fChain->SetBranchStatus("Particle", 1); // activate "Particle_" fChain->SetBranchStatus("Particle.M", 1); // activate "Particle_M" TH1D *invm = new TH1D("H_invmass", "GeV", 150, 0, 150); Long64_t nentries = fChain->GetEntriesFast(); Long64_t nbytes = 0, nb = 0; for (Long64_t jentry=0; jentryGetEntry(ientry); nbytes += nb; // first things first nb = b_Particle_M->GetEntry(ientry);nbytes += nb; // if (Cut(ientry) < 0) continue; std::cout << jentry << " : " << Particle_ << " :"; for (Int_t j = 0; j < Particle_; j++) { std::cout << " " << Particle_M[j]; // if (!(Particle_M[j] > 0.0)) continue; // skip zeros invm->Fill(Particle_M[j]); } std::cout << std::endl; } invm->Draw(); if (gPad) gPad->SetLogy(1); }