StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
tof.cxx
1 #define tof_cxx
2 #include "tof.h"
3 #include <TH2.h>
4 #include <TStyle.h>
5 #include <TCanvas.h>
6 
7 void tof::Loop()
8 {
9 // In a ROOT session, you can do:
10 // Root > .L tof.C
11 // Root > tof t
12 // Root > t.GetEntry(12); // Fill t data members with entry number 12
13 // Root > t.Show(); // Show values of entry 12
14 // Root > t.Show(16); // Read and show values of entry 16
15 // Root > t.Loop(); // Loop on all entries
16 //
17 
18 // This is the loop skeleton where:
19 // jentry is the global entry number in the chain
20 // ientry is the entry number in the current Tree
21 // Note that the argument to GetEntry must be:
22 // jentry for TChain::GetEntry
23 // ientry for TTree::GetEntry and TBranch::GetEntry
24 //
25 // To read only selected branches, Insert statements like:
26 // METHOD1:
27 // fChain->SetBranchStatus("*",0); // disable all branches
28 // fChain->SetBranchStatus("branchname",1); // activate branchname
29 // METHOD2: replace line
30 // fChain->GetEntry(jentry); //read all branches
31 //by b_branchname->GetEntry(ientry); //read only this branch
32  if (fChain == 0) return;
33 
34  Long64_t nentries = fChain->GetEntriesFast();
35 
36  Long64_t nbytes = 0, nb = 0;
37  for (Long64_t jentry=0; jentry<nentries;jentry++) {
38  Long64_t ientry = LoadTree(jentry);
39  if (ientry < 0) break;
40  nb = fChain->GetEntry(jentry); nbytes += nb;
41  // if (Cut(ientry) < 0) continue;
42  }
43 }