File indexing completed on 2025-01-18 10:11:32
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TBranchProxyDirector
0013 #define ROOT_TBranchProxyDirector
0014
0015 #include "RtypesCore.h"
0016 #include <vector>
0017 #include <list>
0018 #include <algorithm>
0019
0020 class TH1F;
0021 class TTree;
0022
0023 namespace ROOT {
0024 namespace Detail {
0025 class TBranchProxy;
0026 class TFriendProxy;
0027 }
0028
0029 namespace Internal{
0030 class TFriendProxy;
0031
0032
0033 void ResetReadEntry(TFriendProxy *fp);
0034
0035 class TBranchProxyDirector {
0036
0037
0038 TTree *fTree;
0039 Long64_t fEntry;
0040
0041 std::list<Detail::TBranchProxy*> fDirected;
0042 std::vector<TFriendProxy*> fFriends;
0043
0044 TBranchProxyDirector(const TBranchProxyDirector &) : fTree(nullptr), fEntry(-1) {}
0045 TBranchProxyDirector& operator=(const TBranchProxyDirector&) {return *this;}
0046
0047 public:
0048
0049 TBranchProxyDirector(TTree* tree, Long64_t i);
0050 TBranchProxyDirector(TTree* tree, Int_t i);
0051
0052 void Attach(Detail::TBranchProxy* p);
0053 void Attach(TFriendProxy* f);
0054 TH1F* CreateHistogram(const char *options);
0055
0056
0057
0058 Long64_t GetReadEntry() const { return fEntry; }
0059
0060 TTree* GetTree() const { return fTree; };
0061
0062
0063
0064
0065
0066 void SetReadEntry(Long64_t entry) {
0067 fEntry = entry;
0068 if (!fFriends.empty()) {
0069 std::for_each(fFriends.begin(), fFriends.end(), ResetReadEntry);
0070 }
0071 }
0072 TTree* SetTree(TTree *newtree);
0073 bool Notify();
0074
0075 };
0076
0077 }
0078 }
0079
0080 #endif