Logo ROOT  
Reference Guide
TBranchProxyDirector.h
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Philippe Canal 13/05/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun, Fons Rademakers and al. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TBranchProxyDirector
13 #define ROOT_TBranchProxyDirector
14 
15 #include "RtypesCore.h"
16 #include <vector>
17 #include <list>
18 #include <algorithm>
19 
20 class TH1F;
21 class TTree;
22 
23 namespace ROOT {
24 namespace Detail {
25  class TBranchProxy;
26  class TFriendProxy;
27 }
28 
29 namespace Internal{
30  class TFriendProxy;
31 
32  // Helper function to call SetReadEntry on all TFriendProxy
33  void ResetReadEntry(TFriendProxy *fp);
34 
36 
37  //This class could actually be the selector itself.
38  TTree *fTree; // TTree we are currently looking at.
39  Long64_t fEntry; // Entry currently being read (in the local TTree rather than the TChain)
40 
41  std::list<Detail::TBranchProxy*> fDirected;
42  std::vector<TFriendProxy*> fFriends;
43 
46 
47  public:
48 
50  TBranchProxyDirector(TTree* tree, Int_t i); // cint has (had?) a problem casting int to long long
51 
53  void Attach(TFriendProxy* f);
54  TH1F* CreateHistogram(const char *options);
55 
56  /// Return the current 'local' entry number; i.e. in the 'local' TTree rather than the TChain.
57  /// This value will be passed directly to TBranch::GetEntry.
58  Long64_t GetReadEntry() const { return fEntry; }
59 
60  TTree* GetTree() const { return fTree; };
61  // void Print();
62 
63  /// Move to a new entry to read
64  /// entry is the 'local' entry number; i.e. in the 'local' TTree rather than the TChain.
65  /// This value will be passed directly to TBranch::GetEntry.
66  void SetReadEntry(Long64_t entry) {
67  fEntry = entry;
68  if (!fFriends.empty()) {
69  std::for_each(fFriends.begin(), fFriends.end(), ResetReadEntry);
70  }
71  }
72  TTree* SetTree(TTree *newtree);
73  Bool_t Notify();
74 
75  };
76 
77 } // namespace Internal
78 } // namespace ROOT
79 
80 #endif
ROOT::Internal::TBranchProxyDirector::SetReadEntry
void SetReadEntry(Long64_t entry)
Move to a new entry to read entry is the 'local' entry number; i.e.
Definition: TBranchProxyDirector.h:66
ROOT::Internal::TBranchProxyDirector::Notify
Bool_t Notify()
Definition: TBranchProxyDirector.cxx:141
ROOT::Internal::TBranchProxyDirector
Definition: TBranchProxyDirector.h:35
f
#define f(i)
Definition: RSha256.hxx:104
tree
Definition: tree.py:1
ROOT::Internal::TBranchProxyDirector::TBranchProxyDirector
TBranchProxyDirector(const TBranchProxyDirector &)
Definition: TBranchProxyDirector.h:44
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TTree
A TTree represents a columnar dataset.
Definition: TTree.h:79
Int_t
int Int_t
Definition: RtypesCore.h:45
ROOT::Internal::TBranchProxyDirector::GetTree
TTree * GetTree() const
Definition: TBranchProxyDirector.h:60
ROOT::Internal::TBranchProxyDirector::GetReadEntry
Long64_t GetReadEntry() const
Return the current 'local' entry number; i.e.
Definition: TBranchProxyDirector.h:58
ROOT::Internal::TBranchProxyDirector::fTree
TTree * fTree
Definition: TBranchProxyDirector.h:38
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
ROOT::Internal::TBranchProxyDirector::SetTree
TTree * SetTree(TTree *newtree)
Definition: TBranchProxyDirector.cxx:129
ROOT::Internal::TBranchProxyDirector::fEntry
Long64_t fEntry
Definition: TBranchProxyDirector.h:39
ROOT::Internal::TFriendProxy
Definition: TFriendProxy.h:22
ROOT::Internal::TBranchProxyDirector::operator=
TBranchProxyDirector & operator=(const TBranchProxyDirector &)
Definition: TBranchProxyDirector.h:45
ROOT::Internal::TBranchProxyDirector::Attach
void Attach(Detail::TBranchProxy *p)
Definition: TBranchProxyDirector.cxx:64
ROOT::Detail::TBranchProxy
Base class for all the proxy object.
Definition: TBranchProxy.h:69
ROOT::Internal::TBranchProxyDirector::CreateHistogram
TH1F * CreateHistogram(const char *options)
Definition: TBranchProxyDirector.cxx:80
RtypesCore.h
ROOT::Internal::ResetReadEntry
void ResetReadEntry(TFriendProxy *fp)
Definition: TBranchProxyDirector.cxx:39
TH1F
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
ROOT::Internal::TBranchProxyDirector::fDirected
std::list< Detail::TBranchProxy * > fDirected
Definition: TBranchProxyDirector.h:41
ROOT::Internal::TBranchProxyDirector::fFriends
std::vector< TFriendProxy * > fFriends
Definition: TBranchProxyDirector.h:42
ROOT
VSD Structures.
Definition: StringConv.hxx:21