FlatDisplayTree.cxx
Go to the documentation of this file.
1 /*
2  * FlatDisplayTree.cxx
3  *
4  * Created on: Feb 9, 2021
5  * Author: chilgenb
6  */
7 
9 
10 using namespace garana;
11 
13 {
14  SetupRead(tree);
15 }
16 
18 {
19  CheckOpt(opt);//sets TreeReader::fOpt
20 
21  if(fOpt=='r'){
22  std::cout << "constructed FlatDisplayTree object in read-only mode" << std::endl;
23  SetupRead(tree);
24  }
25  else {
26  std::cout << "constructed FlatDisplayTree object in write mode" << std::endl;
27  fTreeIn = tree;
29  }
30 
31 }
32 
33 /*void FlatDisplayTree::GetEntry(UInt_t entry) {
34  this->fDisplayToFSLimits.clear();
35  fTreeIn->GetEntry(entry);
36  this->FindFSLimits();
37 }*/
38 
40 
41 std::cout << "FlatDisplayTree SetBranchAddresses()" << std::endl;
42 
43  if(fOpt=='r'){
44  fTreeIn->SetBranchAddress("Event", &fEvent, &b_Event );
45 
46  }
47 
48 
49  if(fOpt=='w'){
50 
51  fTreeIn->Branch("Event", &fEvent, "Event/I");
52 
53  }
54 
55  return true;
56 }
57 
58 //implement accessors inherited from DisplayTree
59 
61 
62 
63  }
64 
66 
67 
68 
69  }
opt
Definition: train.py:196
TTree * fTreeIn
pointer to the analyzed TTree or TChain
Definition: TreeReader.h:51
void CheckOpt(char opt)
Definition: TreeReader.cxx:67
TBranch * b_Event
Definition: TreeReader.h:54
void SetupRead(TTree *tree)
Definition: TreeReader.cxx:6
Int_t fEvent
event number for tree entry
Definition: TreeReader.h:55
bool SetBranchAddresses() override
QTextStream & endl(QTextStream &s)