Public Member Functions | Public Attributes | List of all members
ancestor Class Reference

#include <ancestor.h>

Public Member Functions

 ancestor ()
 
virtual ~ancestor ()
 
virtual Int_t Cut (Long64_t entry)
 
virtual Int_t GetEntry (Long64_t entry)
 
virtual Long64_t LoadTree (Long64_t entry)
 
virtual void Init (TTree *tree)
 
virtual void Loop ()
 
virtual Bool_t Notify ()
 
virtual void Show (Long64_t entry=-1)
 
 ancestor ()
 
virtual ~ancestor ()
 
virtual Int_t Cut (Long64_t entry)
 
virtual Int_t GetEntry (Long64_t entry)
 
virtual Long64_t LoadTree (Long64_t entry)
 
virtual void Init (TTree *tree)
 
virtual void Loop ()
 
virtual Bool_t Notify ()
 
virtual void Show (Long64_t entry=-1)
 

Public Attributes

TChain * fChain
 
Int_t fCurrent
 pointer to the analyzed TTree or TChain More...
 
Double_t fTotalPOT
 current Tree number in a TChain More...
 
std::string ffilename
 
std::string detectorname
 
double detx
 
double dety
 
double detz
 
TRandom3 * rand3
 
bsim::Dk2Nu * dk2nu
 

Detailed Description

Definition at line 28 of file ancestor.h.

Constructor & Destructor Documentation

ancestor::ancestor ( )

Definition at line 63 of file studyAncestorsL.cc.

64 {
65 
66  /*
67  // Otherwise Set detector coordinates based on requested detector location
68  if(location=="LBNEND") {
69  detx = 0.0;
70  dety = 0.0;
71  detz = 57400.0;
72  }
73 
74  else if(location=="LBNEFD") {
75  detx = 0.0;
76  dety = 0.0;
77  detz = 129700000.0;
78  }
79  */
80 
81  std::vector<std::string> fFileVec;
82 
83  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00250.dk2nu.root");
84  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00249.dk2nu.root");
85  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00248.dk2nu.root");
86  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00247.dk2nu.root");
87  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00246.dk2nu.root");
88  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00245.dk2nu.root");
89  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00244.dk2nu.root");
90  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00243.dk2nu.root");
91  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00242.dk2nu.root");
92  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00241.dk2nu.root");
93  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_NoSnout_neutrino_00240.dk2nu.root");
94  fFileVec.push_back("/pnfs/dune/scratch/users/ljf26/fluxfiles/g4lbne/v3r5p4/QGSP_BERT/OptimizedEngineeredNov2017_NoSnout/neutrino/flux/g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_neutrino_00239.dk2nu.root");
95 
96 
97  std::string ntuple_name = "dk2nuTree";
98 
99 
100  fChain = new TChain(ntuple_name.c_str());
101  for(std::vector<std::string>::const_iterator sit = fFileVec.begin(); sit != fFileVec.end(); ++sit)
102  {
103  fChain -> Add(sit -> c_str());
104  }
105 
106  Init(fChain);
107 
108  // initialize random numbers used for oscillation calculations
109  rand3 = new TRandom3(0);
110 
111 }
virtual void Init(TTree *tree)
std::string string
Definition: nybbler.cc:12
intermediate_table::const_iterator const_iterator
TChain * fChain
Definition: ancestor.h:31
TRandom3 * rand3
Definition: ancestor.h:43
ancestor::~ancestor ( )
virtual

Definition at line 113 of file studyAncestorsL.cc.

114 {
115  if (!fChain) return;
116  delete fChain->GetCurrentFile();
117 }
TChain * fChain
Definition: ancestor.h:31
ancestor::ancestor ( )
virtual ancestor::~ancestor ( )
virtual

Member Function Documentation

virtual Int_t ancestor::Cut ( Long64_t  entry)
virtual
Int_t ancestor::Cut ( Long64_t  entry)
virtual

Definition at line 179 of file studyAncestorsL.cc.

180 {
181 // This function may be called from Loop.
182 // returns 1 if entry is accepted.
183 // returns -1 otherwise.
184  return 1;
185 }
virtual Int_t ancestor::GetEntry ( Long64_t  entry)
virtual
Int_t ancestor::GetEntry ( Long64_t  entry)
virtual

Definition at line 119 of file studyAncestorsL.cc.

120 {
121 // Read contents of entry.
122  if (!fChain) return 0;
123  return fChain->GetEntry(entry);
124 }
QList< Entry > entry
TChain * fChain
Definition: ancestor.h:31
virtual void ancestor::Init ( TTree *  tree)
virtual
void ancestor::Init ( TTree *  tree)
virtual

Definition at line 140 of file studyAncestorsL.cc.

141 {
142  // The Init() function is called when the selector needs to initialize
143  // a new tree or chain. Typically here the branch addresses and branch
144  // pointers of the tree will be set.
145  // It is normally not necessary to make changes to the generated
146  // code, but the routine can be extended by the user if needed.
147  // Init() will be called many times when running on PROOF
148  // (once per file to be processed).
149 
150  // Set branch addresses and branch pointers
151 
152  fCurrent = -1;
153 
154  dk2nu = new bsim::Dk2Nu;
155  fChain->SetBranchAddress("dk2nu",&dk2nu);
156  fChain->GetEntry(0);
157 
158  Notify();
159 }
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: ancestor.h:33
virtual Bool_t Notify()
TChain * fChain
Definition: ancestor.h:31
bsim::Dk2Nu * dk2nu
Definition: ancestor.h:46
virtual Long64_t ancestor::LoadTree ( Long64_t  entry)
virtual
Long64_t ancestor::LoadTree ( Long64_t  entry)
virtual

Definition at line 125 of file studyAncestorsL.cc.

126 {
127 // Set the environment to read one entry
128  if (!fChain) return -5;
129  Long64_t centry = fChain->LoadTree(entry);
130  if (centry < 0) return centry;
131  if (!fChain->InheritsFrom(TChain::Class())) return centry;
132  TChain *chain = (TChain*)fChain;
133  if (chain->GetTreeNumber() != fCurrent) {
134  fCurrent = chain->GetTreeNumber();
135  Notify();
136  }
137  return centry;
138 }
QList< Entry > entry
Int_t fCurrent
pointer to the analyzed TTree or TChain
Definition: ancestor.h:33
virtual Bool_t Notify()
TChain * fChain
Definition: ancestor.h:31
virtual void ancestor::Loop ( )
virtual
void ancestor::Loop ( )
virtual

Definition at line 28 of file ancestorL.cc.

29 {
30 
31 
32  dk2nu = new bsim::Dk2Nu;
33  fChain->SetBranchAddress("dk2nu",&dk2nu);
34 
35 
36  Long64_t nentries = fChain->GetEntries();
37  std::cout << "Total number of Entries = " << nentries << std::endl;
38 
39  for (Long64_t jentry=0; jentry<nentries;jentry++)
40  {
41  fChain->GetEntry(jentry);
42  ++iread;
43 
44  if(iread % 10000 == 0)
45  {
46  std::cout << "Reading Entry " << iread << std::endl;
47  }
48 
49 
50  Nimpwt = dk2nu->decay.nimpwt;
51  Ntype = dk2nu->decay.ntype;
52 
53  }//end loop over entries
54 
55 }
int iread
Definition: ancestorL.cc:26
TChain * fChain
Definition: ancestor.h:31
bsim::Dk2Nu * dk2nu
Definition: ancestor.h:46
QTextStream & endl(QTextStream &s)
virtual Bool_t ancestor::Notify ( )
virtual
Bool_t ancestor::Notify ( )
virtual

Definition at line 161 of file studyAncestorsL.cc.

162 {
163  // The Notify() function is called when a new file is opened. This
164  // can be either for a new TTree in a TChain or when when a new TTree
165  // is started when using PROOF. It is normally not necessary to make changes
166  // to the generated code, but the routine can be extended by the
167  // user if needed. The return value is currently not used.
168 
169  return kTRUE;
170 }
virtual void ancestor::Show ( Long64_t  entry = -1)
virtual
void ancestor::Show ( Long64_t  entry = -1)
virtual

Definition at line 172 of file studyAncestorsL.cc.

173 {
174 // Print contents of entry.
175 // If entry is not specified, print current entry
176  if (!fChain) return;
177  fChain->Show(entry);
178 }
QList< Entry > entry
TChain * fChain
Definition: ancestor.h:31

Member Data Documentation

std::string ancestor::detectorname

Definition at line 38 of file ancestor.h.

double ancestor::detx

Definition at line 39 of file ancestor.h.

double ancestor::dety

Definition at line 40 of file ancestor.h.

double ancestor::detz

Definition at line 41 of file ancestor.h.

bsim::Dk2Nu * ancestor::dk2nu

Definition at line 46 of file ancestor.h.

TChain * ancestor::fChain

Definition at line 31 of file ancestor.h.

Int_t ancestor::fCurrent

pointer to the analyzed TTree or TChain

Definition at line 33 of file ancestor.h.

std::string ancestor::ffilename

Definition at line 36 of file ancestor.h.

Double_t ancestor::fTotalPOT

current Tree number in a TChain

Definition at line 35 of file ancestor.h.

TRandom3 * ancestor::rand3

Definition at line 43 of file ancestor.h.


The documentation for this class was generated from the following files: