#define LHEF_cxx #include "LHEF.h" #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); TH1D *h1= new TH1D("h1","",100,0,100); fChain->SetBranchStatus("Particle",1); TLorentzVector el1,el2; for (Long64_t jentry=0; jentry<4991948;jentry++) { Long64_t ientry = LoadTree(jentry); if (ientry < 0) break; fChain->GetEntry(jentry); for(int i=0;iFill(Particle_PT[i]); //el1.SetPtEtaPhiM(Particle_PT[i], Particle_Eta[i], Particle_Phi[i], 0.0); } } } h1->Draw(); } /* TH1F* Z_mm = new TH1F("Z_ee", "Di-muon invariant mass", 200, 0, 200); double el1mt = 0.0; double el1pt = 0.0; double el1eta = 0.0; for (Long64_t jentry=0; jentryGetEntry(jentry); nbytes += nb; // if (Cut(ientry) < 0) continue; TLorentzVector el1, el2; if(Particle_PID==13){ el1.SetPtEtaPhiM(Particle_PT, Particle_Eta, Particle_Phi, 0.0); } if(Particle_PID==-13){ el1.SetPtEtaPhiM(Particle_PT, Particle_Eta, Particle_Phi, 0.0); } TLorentzVector zmm = el1 + el2; Z_mm->Fill(zmm.M()); } Z_mm->Draw();*/ void run(){ LHEF m; m.Loop(); }