Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
GENIE
src
FluxDrivers
GNuMINtuple
g4numi.C
Go to the documentation of this file.
1
#define g4numi_cxx
2
#include "
g4numi.h
"
3
#include <TH2.h>
4
#include <TStyle.h>
5
#include <TCanvas.h>
6
7
void
g4numi::Loop
()
8
{
9
// In a ROOT session, you can do:
10
// Root > .L g4numi.C
11
// Root > g4numi 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
}
g4numi::fChain
TTree * fChain
Definition:
g4numi.h:20
g4numi::LoadTree
virtual Long64_t LoadTree(Long64_t entry)
g4numi.h
genie::units::nb
static const double nb
Definition:
Units.h:89
g4numi::Loop
virtual void Loop()
Definition:
g4numi.C:7
Generated by
1.8.11