Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:32:23

0001 #define theTree_cxx
0002 #include "theTree.h"
0003 #include <TH2.h>
0004 #include <TStyle.h>
0005 #include <TCanvas.h>
0006 
0007 void theTree::Loop()
0008 {
0009 //   In a ROOT session, you can do:
0010 //      Root > .L theTree.C
0011 //      Root > theTree t
0012 //      Root > t.GetEntry(12); // Fill t data members with entry number 12
0013 //      Root > t.Show();       // Show values of entry 12
0014 //      Root > t.Show(16);     // Read and show values of entry 16
0015 //      Root > t.Loop();       // Loop on all entries
0016 //
0017 
0018 //     This is the loop skeleton where:
0019 //    jentry is the global entry number in the chain
0020 //    ientry is the entry number in the current Tree
0021 //  Note that the argument to GetEntry must be:
0022 //    jentry for TChain::GetEntry
0023 //    ientry for TTree::GetEntry and TBranch::GetEntry
0024 //
0025 //       To read only selected branches, Insert statements like:
0026 // METHOD1:
0027 //    fChain->SetBranchStatus("*",0);  // disable all branches
0028 //    fChain->SetBranchStatus("branchname",1);  // activate branchname
0029 // METHOD2: replace line
0030 //    fChain->GetEntry(jentry);       //read all branches
0031 //by  b_branchname->GetEntry(ientry); //read only this branch
0032    if (fChain == 0) return;
0033 
0034    Long64_t nentries = fChain->GetEntriesFast();
0035 
0036    Int_t nbytes = 0, nb = 0;
0037    for (Long64_t jentry=0; jentry<nentries;jentry++) {
0038       Long64_t ientry = LoadTree(jentry);
0039       if (ientry < 0) break;
0040       nb = fChain->GetEntry(jentry);   nbytes += nb;
0041       // if (Cut(ientry) < 0) continue;
0042    }
0043 }