Logo ROOT   6.14/05
Reference Guide
TBranchProxy.h
Go to the documentation of this file.
1 // @(#)root/treeplayer:$Id$
2 // Author: Philippe Canal 01/06/2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and 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_TBranchProxy
13 #define ROOT_TBranchProxy
14 
15 #include "TBranchProxyDirector.h"
16 #include "TTree.h"
17 #include "TBranch.h"
18 #include "TLeaf.h"
19 #include "TClonesArray.h"
20 #include "TString.h"
21 #include "Riostream.h"
22 #include "TError.h"
24 
25 #include <list>
26 #include <algorithm>
27 
28 class TBranch;
29 class TStreamerElement;
30 
31 // Note we could protect the arrays more by introducing a class TArrayWrapper<class T> which somehow knows
32 // its internal dimensions and check for them ...
33 // template <class T> TArrayWrapper {
34 // public:
35 // TArrayWrapper(void *where, int dim1);
36 // const T operator[](int i) {
37 // if (i>=dim1) return 0;
38 // return where[i];
39 // };
40 // };
41 // 2D array would actually be a wrapper of a wrapper i.e. has a method TArrayWrapper<T> operator[](int i);
42 
43 namespace ROOT {
44 namespace Internal {
45  //_______________________________________________
46  // String builder to be used in the constructors.
48  public:
50  TBranchProxyHelper(const char *left,const char *right = 0) :
51  fName() {
52  if (left) {
53  fName = left;
54  if (left[0]&&right && fName[fName.Length()-1]!='.') fName += ".";
55  }
56  if (right) {
57  fName += right;
58  }
59  }
60  operator const char*() { return fName.Data(); };
61  };
62 } // namespace Internal
63 
64 
65 namespace Detail {
66  class TBranchProxy {
67  protected:
68  Internal::TBranchProxyDirector *fDirector; // contain pointer to TTree and entry to be read
69 
71  const Bool_t fIsMember : 1; // true if we proxy an unsplit data member
72  Bool_t fIsClone : 1; // true if we proxy the inside of a TClonesArray
73  Bool_t fIsaPointer : 1; // true if we proxy a data member of pointer type
74  Bool_t fHasLeafCount : 1;// true if we proxy a variable size leaf of a leaflist
75 
76  const TString fBranchName; // name of the branch to read
77  TBranchProxy *fParent; // Proxy to a parent object
78 
79  const TString fDataMember; // name of the (eventual) data member being proxied
80 
81 
82  TString fClassName; // class name of the object pointed to by the branch
83  TClass *fClass; // class name of the object pointed to by the branch
86  Int_t fOffset; // Offset inside the object
87  Int_t fArrayLength; // Number of element if the data is an array
88 
89  TBranch *fBranch; // branch to read
90  union {
91  TBranch *fBranchCount; // eventual auxiliary branch (for example holding the size)
92  TLeaf *fLeafCount; // eventual auxiliary leaf (for example holding the size)
93  };
94 
95  TTree *fLastTree; // TTree containing the last entry read
96  Long64_t fRead; // Last entry read
97 
98  void *fWhere; // memory location of the data
99  TVirtualCollectionProxy *fCollection; // Handle to the collection containing the data chunk.
100 
102 
103  public:
104  virtual void Print();
105 
106  TBranchProxy();
107  TBranchProxy(Internal::TBranchProxyDirector* boss, const char* top, const char* name = 0);
108  TBranchProxy(Internal::TBranchProxyDirector* boss, const char *top, const char *name, const char *membername);
109  TBranchProxy(Internal::TBranchProxyDirector* boss, TBranchProxy *parent, const char* membername, const char* top = 0, const char* name = 0);
110  TBranchProxy(Internal::TBranchProxyDirector* boss, TBranch* branch, const char* membername);
111  TBranchProxy(Internal::TBranchProxyDirector* boss, const char* branchname, TBranch* branch, const char* membername);
112  virtual ~TBranchProxy();
113 
114  TBranchProxy* GetProxy() { return this; }
115  const char* GetBranchName() const { return fBranchName; }
116 
117  void Reset();
118 
119  Bool_t Setup();
120 
122  return fLastTree && fCurrentTreeNumber == fDirector->GetTree()->GetTreeNumber() && fLastTree == fDirector->GetTree();
123  }
124 
125  Bool_t IsaPointer() const {
126  return fIsaPointer;
127  }
128 
130  if (fDirector==0) return false;
131 
132  if (fDirector->GetReadEntry()!=fRead) {
133  if (!IsInitialized()) {
134  if (!Setup()) {
135  ::Error("TBranchProxy::Read","%s",Form("Unable to initialize %s\n",fBranchName.Data()));
136  return kFALSE;
137  }
138  }
139  Bool_t result = kTRUE;
140  if (fParent) {
141  result = fParent->Read();
142  } else {
143  if (fBranchCount) {
144  result &= (-1 != fBranchCount->GetEntry(fDirector->GetReadEntry()));
145  }
146  result &= (-1 != fBranch->GetEntry(fDirector->GetReadEntry()));
147  }
148  fRead = fDirector->GetReadEntry();
149  if (R__unlikely(fCollection)) {
150  fCollection->PopProxy(); // works even if no proxy env object was set.
151  if (IsaPointer()) {
152  fCollection->PushProxy( *(void**)fWhere );
153  } else {
154  fCollection->PushProxy( fWhere );
155  }
156  }
157  return result;
158  } else {
159  return IsInitialized();
160  }
161  }
162 
164  if (fDirector==0) return false;
165 
166  if (fDirector->GetReadEntry()!=fRead) {
167  if (!IsInitialized()) {
168  if (!Setup()) {
169  ::Error("TBranchProxy::ReadEntries","%s",Form("Unable to initialize %s\n",fBranchName.Data()));
170  return false;
171  }
172  }
173  if (fParent) fParent->ReadEntries();
174  else {
175  if (fBranchCount) {
176  fBranchCount->TBranch::GetEntry(fDirector->GetReadEntry());
177  }
178  fBranch->TBranch::GetEntry(fDirector->GetReadEntry());
179  }
180  // NO - we only read the entries, not the contained objects!
181  // fRead = fDirector->GetReadEntry();
182  }
183  return IsInitialized();
184  }
185 
186  virtual Int_t GetEntries() {
187  if (!ReadEntries()) return 0;
188  if (!fHasLeafCount) {
189  return *(Int_t*)fLeafCount->GetValuePointer();
190  } else {
191  return 1;
192  }
193  }
194 
195  virtual Int_t GetArrayLength() {
196  return fArrayLength;
197  }
198 
200  if (fDirector==0) return 0;
201  if (fDirector->GetReadEntry()!=fRead) {
202  if (!IsInitialized()) {
203  if (!Setup()) {
204  return 0;
205  }
206  }
207  }
208  return fClass;
209  }
210 
211  void* GetWhere() const { return fWhere; } // intentionally non-virtual
212 
213  /// Return the address of the element number i. Returns `nullptr` for non-collections. It assumed that Setip() has
214  /// been called.
215  virtual void *GetAddressOfElement(UInt_t /*i*/) {
216  return nullptr;
217  }
218 
219  TVirtualCollectionProxy *GetCollection() { return fCollection; }
220 
221  // protected:
222  virtual void *GetStart(UInt_t /*i*/=0) {
223  // return the address of the start of the object being proxied. Assumes
224  // that Setup() has been called.
225 
226  if (fParent) {
227  fWhere = ((unsigned char*)fParent->GetStart()) + fMemberOffset;
228  }
229  if (IsaPointer()) {
230  if (fWhere) return *(void**)fWhere;
231  else return 0;
232  } else {
233  return fWhere;
234  }
235  }
236 
237  void *GetClaStart(UInt_t i=0) {
238  // return the address of the start of the object being proxied. Assumes
239  // that Setup() has been called. Assumes the object containing this data
240  // member is held in TClonesArray.
241 
242  char *location;
243 
244  if (fIsClone) {
245 
246  TClonesArray *tca;
247  tca = (TClonesArray*)GetStart();
248 
249  if (!tca || tca->GetLast()<(Int_t)i) return 0;
250 
251  location = (char*)tca->At(i);
252 
253  return location;
254 
255  } else if (fParent) {
256 
257  //tcaloc = ((unsigned char*)fParent->GetStart());
258  location = (char*)fParent->GetClaStart(i);
259 
260  } else {
261 
262  void *tcaloc;
263  tcaloc = fWhere;
264  TClonesArray *tca;
265  tca = (TClonesArray*)tcaloc;
266 
267  if (tca->GetLast()<(Int_t)i) return 0;
268 
269  location = (char*)tca->At(i);
270  }
271 
272  if (location) location += fOffset;
273  else return 0;
274 
275  if (IsaPointer()) {
276  return *(void**)(location);
277  } else {
278  return location;
279  }
280 
281  }
282 
283  void *GetStlStart(UInt_t i=0) {
284  // return the address of the start of the object being proxied. Assumes
285  // that Setup() has been called. Assumes the object containing this data
286  // member is held in STL Collection.
287 
288  char *location=0;
289 
290  if (fCollection) {
291 
292  if (fCollection->Size()<i) return 0;
293 
294  location = (char*)fCollection->At(i);
295 
296  // return location;
297 
298  } else if (fParent) {
299 
300  //tcaloc = ((unsigned char*)fParent->GetStart());
301  location = (char*)fParent->GetStlStart(i);
302 
303  } else {
304 
305  R__ASSERT(0);
306  //void *tcaloc;
307  //tcaloc = fWhere;
308  //TClonesArray *tca;
309  //tca = (TClonesArray*)tcaloc;
310 
311  //if (tca->GetLast()<i) return 0;
312 
313  //location = (char*)tca->At(i);
314  }
315 
316  if (location) location += fOffset;
317  else return 0;
318 
319  if (IsaPointer()) {
320  return *(void**)(location);
321  } else {
322  return location;
323  }
324 
325  }
326 
327  Int_t GetOffset() { return fOffset; }
328  };
329 } // namespace Detail
330 
331 namespace Internal {
332 
333  //____________________________________________________________________________________________
334  // Concrete Implementation of the branch proxy around the data members which are array of char
336  public:
337  void Print() override {
339  std::cout << "fWhere " << fWhere << std::endl;
340  if (fWhere) std::cout << "value? " << *(unsigned char*)GetStart() << std::endl;
341  }
342 
344  TArrayCharProxy() = default; // work around bug in GCC < 7
345  ~TArrayCharProxy() override = default;
346 
347  void *GetAddressOfElement(UInt_t i) final {
348  if (!Read()) return nullptr;
349  unsigned char* str = (unsigned char*)GetStart();
350  return str + i;
351  }
352 
353  unsigned char At(UInt_t i) {
354  static unsigned char default_val = {};
355  if (unsigned char* elAddr = (unsigned char*)GetAddressOfElement(i)) {
356  // should add out-of bound test
357  return *elAddr;
358  }
359  return default_val;
360  }
361 
362  unsigned char operator [](Int_t i) {
363  return At(i);
364  }
365 
366  unsigned char operator [](UInt_t i) {
367  return At(i);
368  }
369 
370  operator const char*() {
371  if (!Read()) return "";
372  return (const char*)GetStart();
373  }
374 
375  const char* Data() {
376  if (!Read()) return "";
377  return (const char*)GetStart();
378  }
379 
380  const char* c_str() {
381  if (!Read()) return "";
382  return (const char*)GetStart();
383  }
384 
385  operator std::string() {
386  if (!Read()) return "";
387  return std::string((const char*)GetStart());
388  }
389 
390  };
391 
392  //_______________________________________________________
393  // Base class for the proxy around object in TClonesArray.
395  public:
396  void Print() override {
398  std::cout << "fWhere " << fWhere << std::endl;
399  if (fWhere) {
400  if (IsaPointer()) {
401  std::cout << "location " << *(TClonesArray**)fWhere << std::endl;
402  } else {
403  std::cout << "location " << fWhere << std::endl;
404  }
405  }
406  }
407 
409  TClaProxy() = default; // work around bug in GCC < 7
410  ~TClaProxy() override = default;
411 
412  const TClonesArray* GetPtr() {
413  if (!Read()) return 0;
414  return (TClonesArray*)GetStart();
415  }
416 
417  Int_t GetEntries() override {
418  if (!ReadEntries()) return 0;
419  TClonesArray *arr = (TClonesArray*)GetStart();
420  if (arr) return arr->GetEntries();
421  return 0;
422  }
423 
424  void *GetAddressOfElement(UInt_t i) final {
425  if (!Read()) return nullptr;
426  if (fWhere==0) return nullptr;
427  return GetClaStart(i);
428  }
429 
430  const TClonesArray* operator->() { return GetPtr(); }
431 
432  };
433 
434  //_______________________________________________
435  // Base class for the proxy around STL containers.
437  public:
438  void Print() override {
440  std::cout << "fWhere " << fWhere << std::endl;
441  if (fWhere) {
442  if (IsaPointer()) {
443  std::cout << "location " << *(TClonesArray**)fWhere << std::endl;
444  } else {
445  std::cout << "location " << fWhere << std::endl;
446  }
447  }
448  }
449 
451  TStlProxy() = default; // work around bug in GCC < 7
452  ~TStlProxy() override = default;
453 
455  if (!Read()) return 0;
456  return GetCollection();
457  }
458 
459  Int_t GetEntries() override {
460  if (!ReadEntries()) return 0;
461  return GetPtr()->Size();
462  }
463 
464  void *GetAddressOfElement(UInt_t i) final {
465  if (!Read()) return nullptr;
466  if (fWhere==0) return nullptr;
467  return GetStlStart(i);
468  }
469 
470  const TVirtualCollectionProxy* operator->() { return GetPtr(); }
471 
472  };
473 
474  //______________________________________
475  // Template of the proxy around objects.
476  template <class T>
478  public:
479  void Print() override {
481  std::cout << "fWhere " << fWhere << std::endl;
482  if (fWhere) std::cout << "value? " << *(T*)GetStart() << std::endl;
483  }
484 
486  TImpProxy() = default; // work around bug in GCC < 7
487  ~TImpProxy() override = default;
488 
489  operator T() {
490  if (!Read()) return 0;
491  return *(T*)GetStart();
492  }
493 
494  // For now explicitly disable copying into the value (i.e. the proxy is read-only).
495  TImpProxy(T) = delete;
496  TImpProxy &operator=(T) = delete;
497 
498  };
499 
500  //____________________________________________
501  // Helper template to be able to determine and
502  // use array dimentsions.
503  template <class T, int d = 0> struct TArrayType {
504  typedef T type_t;
505  typedef T array_t[d];
506  static constexpr int gSize = d;
507  };
508  //____________________________________________
509  // Helper class for proxy around multi dimension array
510  template <class T> struct TArrayType<T,0> {
511  typedef T type_t;
512  typedef T array_t;
513  static constexpr int gSize = 0;
514  };
515  //____________________________________________
516  // Helper class for proxy around multi dimension array
517  template <class T, int d> struct TMultiArrayType {
518  typedef typename T::type_t type_t;
519  typedef typename T::array_t array_t[d];
520  static constexpr int gSize = d;
521  };
522 
523  //____________________________________________
524  // Template for concrete implementation of proxy around array of T
525  template <class T>
527  public:
529  TArrayProxy() = default; // work around bug in GCC < 7
530  ~TArrayProxy() override = default;
531 
532  typedef typename T::array_t array_t;
533  typedef typename T::type_t type_t;
534 
535  void Print() override {
537  std::cout << "fWhere " << GetWhere() << std::endl;
538  if (GetWhere()) std::cout << "value? " << *(type_t*)GetWhere() << std::endl;
539  }
540 
541  Int_t GetEntries() override {
542  return T::gSize;
543  }
544 
545  void *GetAddressOfElement(UInt_t i) final {
546  if (!Read()) return nullptr;
547  if (array_t *arr = (array_t*)((type_t*)(GetStart())))
548  return &arr[i];
549  return nullptr;
550  }
551 
552  const array_t &At(UInt_t i) {
553  static array_t default_val;
554  // should add out-of bound test
555  if (array_t *arr = (array_t*)GetAddressOfElement(i))
556  return *arr;
557  return default_val;
558  }
559 
560  const array_t &operator [](Int_t i) { return At(i); }
561  const array_t &operator [](UInt_t i) { return At(i); }
562  };
563 
564  //_____________________________________________________________________________________
565  // Template of the Concrete Implementation of the branch proxy around TClonesArray of T
566  template <class T>
567  class TClaImpProxy : public TClaProxy {
568  public:
569 
570  // void Print() override {
571  // TClaProxy::Print();
572  // }
573 
574  using TClaProxy::TClaProxy;
575  TClaImpProxy() = default; // work around bug in GCC < 7
576  ~TClaImpProxy() override = default;
577 
578  const T& At(UInt_t i) {
579  static T default_val;
580  if (void* addr = GetAddressOfElement(i))
581  return *(T*)addr;
582  return default_val;
583  }
584 
585  const T& operator [](Int_t i) { return At(i); }
586  const T& operator [](UInt_t i) { return At(i); }
587 
588  // For now explicitly disable copying into the value (i.e. the proxy is read-only).
589  TClaImpProxy(T) = delete;
590  TClaImpProxy &operator=(T) = delete;
591 
592  };
593 
594  //_________________________________________________________________________________________
595  // Template of the Concrete Implementation of the branch proxy around an stl container of T
596  template <class T>
597  class TStlImpProxy : public TStlProxy {
598  public:
599 
600  // void Print() override {
601  // TBranchProxy::Print();
602  // }
603 
604  using TStlProxy::TStlProxy;
605  TStlImpProxy() = default; // work around bug in GCC < 7
606  ~TStlImpProxy() override = default;
607 
608  const T& At(UInt_t i) {
609  static T default_val;
610  if (void* addr = GetAddressOfElement(i))
611  return *(T*)addr;
612  return default_val;
613  }
614 
615  const T& operator [](Int_t i) { return At(i); }
616  const T& operator [](UInt_t i) { return At(i); }
617 
618  // For now explicitly disable copying into the value (i.e. the proxy is read-only).
619  TStlImpProxy(T) = delete;
620  TStlImpProxy &operator=(T) = delete;
621 
622  };
623 
624  //_________________________________________________________________________________________________
625  // Template of the Concrete Implementation of the branch proxy around an TClonesArray of array of T
626  template <class T>
627  class TClaArrayProxy : public TClaProxy {
628  public:
629  typedef typename T::array_t array_t;
630  typedef typename T::type_t type_t;
631 
632  // void Print() override {
633  // TClaProxy::Print();
634  // }
635 
636  using TClaProxy::TClaProxy;
637  TClaArrayProxy() = default; // work around bug in GCC < 7
638  ~TClaArrayProxy() override = default;
639 
640  /* const */ array_t *At(UInt_t i) {
641  static array_t default_val;
642  if (array_t* ptr = (array_t*)GetAddressOfElement(i))
643  return ptr; // no de-ref!
644 
645  return &default_val;
646  }
647 
648  /* const */ array_t *operator [](Int_t i) { return At(i); }
649  /* const */ array_t *operator [](UInt_t i) { return At(i); }
650  };
651 
652 
653  //__________________________________________________________________________________________________
654  // Template of the Concrete Implementation of the branch proxy around an stl container of array of T
655  template <class T>
656  class TStlArrayProxy : public TStlProxy {
657  public:
658  typedef typename T::array_t array_t;
659  typedef typename T::type_t type_t;
660 
661  // void Print() override {
662  // TBranchProxy::Print();
663  // }
664 
665  using TStlProxy::TStlProxy;
666  TStlArrayProxy() = default; // work around bug in GCC < 7
667  ~TStlArrayProxy() override = default;
668 
669  /* const */ array_t *At(UInt_t i) {
670  static array_t default_val;
671  if (array_t* ptr = (array_t*)GetAddressOfElement(i))
672  return ptr; // no de-ref!
673  return &default_val;
674  }
675 
676  /* const */ array_t *operator [](Int_t i) { return At(i); }
677  /* const */ array_t *operator [](UInt_t i) { return At(i); }
678  };
679 
680  //TImpProxy<TObject> d;
681  typedef TImpProxy<Double_t> TDoubleProxy; // Concrete Implementation of the branch proxy around the data members which are double
682  typedef TImpProxy<Double32_t> TDouble32Proxy; // Concrete Implementation of the branch proxy around the data members which are double32
683  typedef TImpProxy<Float_t> TFloatProxy; // Concrete Implementation of the branch proxy around the data members which are float
684  typedef TImpProxy<Float16_t> TFloat16Proxy; // Concrete Implementation of the branch proxy around the data members which are float16
685  typedef TImpProxy<UInt_t> TUIntProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned int
686  typedef TImpProxy<ULong_t> TULongProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned long
687  typedef TImpProxy<ULong64_t> TULong64Proxy; // Concrete Implementation of the branch proxy around the data members which are unsigned long long
688  typedef TImpProxy<UShort_t> TUShortProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned short
689  typedef TImpProxy<UChar_t> TUCharProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned char
690  typedef TImpProxy<Int_t> TIntProxy; // Concrete Implementation of the branch proxy around the data members which are int
691  typedef TImpProxy<Long_t> TLongProxy; // Concrete Implementation of the branch proxy around the data members which are long
692  typedef TImpProxy<Long64_t> TLong64Proxy; // Concrete Implementation of the branch proxy around the data members which are long long
693  typedef TImpProxy<Short_t> TShortProxy; // Concrete Implementation of the branch proxy around the data members which are short
694  typedef TImpProxy<Char_t> TCharProxy; // Concrete Implementation of the branch proxy around the data members which are char
695  typedef TImpProxy<Bool_t> TBoolProxy; // Concrete Implementation of the branch proxy around the data members which are bool
696 
697  typedef TArrayProxy<TArrayType<Double_t> > TArrayDoubleProxy; // Concrete Implementation of the branch proxy around the data members which are array of double
698  typedef TArrayProxy<TArrayType<Double32_t> > TArrayDouble32Proxy; // Concrete Implementation of the branch proxy around the data members which are array of double32
699  typedef TArrayProxy<TArrayType<Float_t> > TArrayFloatProxy; // Concrete Implementation of the branch proxy around the data members which are array of float
700  typedef TArrayProxy<TArrayType<Float16_t> > TArrayFloat16Proxy; // Concrete Implementation of the branch proxy around the data members which are array of float16
701  typedef TArrayProxy<TArrayType<UInt_t> > TArrayUIntProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned int
702  typedef TArrayProxy<TArrayType<ULong_t> > TArrayULongProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned long
703  typedef TArrayProxy<TArrayType<ULong64_t> > TArrayULong64Proxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned long long
704  typedef TArrayProxy<TArrayType<UShort_t> > TArrayUShortProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned short
705  typedef TArrayProxy<TArrayType<UChar_t> > TArrayUCharProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned char
706  typedef TArrayProxy<TArrayType<Int_t> > TArrayIntProxy; // Concrete Implementation of the branch proxy around the data members which are array of int
707  typedef TArrayProxy<TArrayType<Long_t> > TArrayLongProxy; // Concrete Implementation of the branch proxy around the data members which are array of long
708  typedef TArrayProxy<TArrayType<Long64_t> > TArrayLong64Proxy; // Concrete Implementation of the branch proxy around the data members which are array of long long
709  typedef TArrayProxy<TArrayType<UShort_t> > TArrayShortProxy; // Concrete Implementation of the branch proxy around the data members which are array of short
710  //specialized ! typedef TArrayProxy<TArrayType<Char_t> > TArrayCharProxy; // Concrete Implementation of the branch proxy around the data members which are array of char
711  typedef TArrayProxy<TArrayType<Bool_t> > TArrayBoolProxy; // Concrete Implementation of the branch proxy around the data members which are array of bool
712 
713  typedef TClaImpProxy<Double_t> TClaDoubleProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are double
714  typedef TClaImpProxy<Double32_t> TClaDouble32Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are double32
715  typedef TClaImpProxy<Float_t> TClaFloatProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are float
716  typedef TClaImpProxy<Float16_t> TClaFloat16Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are float16
717  typedef TClaImpProxy<UInt_t> TClaUIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned int
718  typedef TClaImpProxy<ULong_t> TClaULongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned long
719  typedef TClaImpProxy<ULong64_t> TClaULong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned long long
720  typedef TClaImpProxy<UShort_t> TClaUShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned short
721  typedef TClaImpProxy<UChar_t> TClaUCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned char
722  typedef TClaImpProxy<Int_t> TClaIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are int
723  typedef TClaImpProxy<Long_t> TClaLongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are long
724  typedef TClaImpProxy<Long64_t> TClaLong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are long long
725  typedef TClaImpProxy<Short_t> TClaShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are short
726  typedef TClaImpProxy<Char_t> TClaCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are char
727  typedef TClaImpProxy<Bool_t> TClaBoolProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are bool
728 
729  typedef TClaArrayProxy<TArrayType<Double_t> > TClaArrayDoubleProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of double
730  typedef TClaArrayProxy<TArrayType<Double32_t> > TClaArrayDouble32Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of double32
731  typedef TClaArrayProxy<TArrayType<Float_t> > TClaArrayFloatProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of float
732  typedef TClaArrayProxy<TArrayType<Float16_t> > TClaArrayFloat16Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of float16
733  typedef TClaArrayProxy<TArrayType<UInt_t> > TClaArrayUIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned int
734  typedef TClaArrayProxy<TArrayType<ULong_t> > TClaArrayULongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned long
735  typedef TClaArrayProxy<TArrayType<ULong64_t> > TClaArrayULong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned long long
736  typedef TClaArrayProxy<TArrayType<UShort_t> > TClaArrayUShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned short
737  typedef TClaArrayProxy<TArrayType<UChar_t> > TClaArrayUCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of nsigned char
738  typedef TClaArrayProxy<TArrayType<Int_t> > TClaArrayIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of int
739  typedef TClaArrayProxy<TArrayType<Long_t> > TClaArrayLongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of long
740  typedef TClaArrayProxy<TArrayType<Long64_t> > TClaArrayLong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of long long
741  typedef TClaArrayProxy<TArrayType<UShort_t> > TClaArrayShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of short
742  typedef TClaArrayProxy<TArrayType<Char_t> > TClaArrayCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of char
743  typedef TClaArrayProxy<TArrayType<Bool_t> > TClaArrayBoolProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of bool
744  //specialized ! typedef TClaArrayProxy<TArrayType<Char_t> > TClaArrayCharProxy;
745 
746  typedef TStlImpProxy<Double_t> TStlDoubleProxy; // Concrete Implementation of the branch proxy around an stl container of double
747  typedef TStlImpProxy<Double32_t> TStlDouble32Proxy; // Concrete Implementation of the branch proxy around an stl container of double32
748  typedef TStlImpProxy<Float_t> TStlFloatProxy; // Concrete Implementation of the branch proxy around an stl container of float
749  typedef TStlImpProxy<Float16_t> TStlFloat16Proxy; // Concrete Implementation of the branch proxy around an stl container of float16_t
750  typedef TStlImpProxy<UInt_t> TStlUIntProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned int
751  typedef TStlImpProxy<ULong_t> TStlULongProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned long
752  typedef TStlImpProxy<ULong64_t> TStlULong64Proxy; // Concrete Implementation of the branch proxy around an stl container of unsigned long long
753  typedef TStlImpProxy<UShort_t> TStlUShortProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned short
754  typedef TStlImpProxy<UChar_t> TStlUCharProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned char
755  typedef TStlImpProxy<Int_t> TStlIntProxy; // Concrete Implementation of the branch proxy around an stl container of int
756  typedef TStlImpProxy<Long_t> TStlLongProxy; // Concrete Implementation of the branch proxy around an stl container of long
757  typedef TStlImpProxy<Long64_t> TStlLong64Proxy; // Concrete Implementation of the branch proxy around an stl container of long long
758  typedef TStlImpProxy<Short_t> TStlShortProxy; // Concrete Implementation of the branch proxy around an stl container of short
759  typedef TStlImpProxy<Char_t> TStlCharProxy; // Concrete Implementation of the branch proxy around an stl container of char
760  typedef TStlImpProxy<Bool_t> TStlBoolProxy; // Concrete Implementation of the branch proxy around an stl container of bool
761 
762  typedef TStlArrayProxy<TArrayType<Double_t> > TStlArrayDoubleProxy; // Concrete Implementation of the branch proxy around an stl container of double
763  typedef TStlArrayProxy<TArrayType<Double32_t> > TStlArrayDouble32Proxy; // Concrete Implementation of the branch proxy around an stl container of double32
764  typedef TStlArrayProxy<TArrayType<Float_t> > TStlArrayFloatProxy; // Concrete Implementation of the branch proxy around an stl container of float
765  typedef TStlArrayProxy<TArrayType<Float16_t> > TStlArrayFloat16Proxy; // Concrete Implementation of the branch proxy around an stl container of float16_t
766  typedef TStlArrayProxy<TArrayType<UInt_t> > TStlArrayUIntProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned int
767  typedef TStlArrayProxy<TArrayType<ULong_t> > TStlArrayULongProxy; // Concrete Implementation of the branch proxy around an stl container of usigned long
768  typedef TStlArrayProxy<TArrayType<ULong64_t> > TStlArrayULong64Proxy; // Concrete Implementation of the branch proxy around an stl contained of unsigned long long
769  typedef TStlArrayProxy<TArrayType<UShort_t> > TStlArrayUShortProxy; // Concrete Implementation of the branch proxy around an stl container of unisgned short
770  typedef TStlArrayProxy<TArrayType<UChar_t> > TStlArrayUCharProxy; // Concrete Implementation of the branch proxy around an stl container of unsingned char
771  typedef TStlArrayProxy<TArrayType<Int_t> > TStlArrayIntProxy; // Concrete Implementation of the branch proxy around an stl container of int
772  typedef TStlArrayProxy<TArrayType<Long_t> > TStlArrayLongProxy; // Concrete Implementation of the branch proxy around an stl container of long
773  typedef TStlArrayProxy<TArrayType<Long64_t> > TStlArrayLong64Proxy; // Concrete Implementation of the branch proxy around an stl container of long long
774  typedef TStlArrayProxy<TArrayType<UShort_t> > TStlArrayShortProxy; // Concrete Implementation of the branch proxy around an stl container of UShort_t
775  typedef TStlArrayProxy<TArrayType<Char_t> > TStlArrayCharProxy; // Concrete Implementation of the branch proxy around an stl container of char
776  typedef TStlArrayProxy<TArrayType<Bool_t> > TStlArrayBoolProxy; // Concrete Implementation of the branch proxy around an stl container of bool
777 
778 } // namespace Internal
779 
780 // Reasonably backward compatible.
782 
783 } // namespace ROOT
784 
785 #endif
786 
TStlArrayProxy< TArrayType< Bool_t > > TStlArrayBoolProxy
Definition: TBranchProxy.h:776
TStlArrayProxy< TArrayType< Int_t > > TStlArrayIntProxy
Definition: TBranchProxy.h:771
TImpProxy< Double32_t > TDouble32Proxy
Definition: TBranchProxy.h:682
TStlArrayProxy< TArrayType< Double_t > > TStlArrayDoubleProxy
Definition: TBranchProxy.h:762
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:32
Int_t GetEntries() override
Definition: TBranchProxy.h:459
TArrayProxy< TArrayType< Double_t > > TArrayDoubleProxy
Definition: TBranchProxy.h:697
TClaImpProxy< Float_t > TClaFloatProxy
Definition: TBranchProxy.h:715
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayUShortProxy
Definition: TBranchProxy.h:769
void * GetClaStart(UInt_t i=0)
Definition: TBranchProxy.h:237
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
Definition: TBranchProxy.h:464
long long Long64_t
Definition: RtypesCore.h:69
TStlArrayProxy< TArrayType< Long64_t > > TStlArrayLong64Proxy
Definition: TBranchProxy.h:773
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
TStlImpProxy< Float16_t > TStlFloat16Proxy
Definition: TBranchProxy.h:749
#define R__unlikely(expr)
Definition: RConfig.h:578
TArrayProxy< TArrayType< Long64_t > > TArrayLong64Proxy
Definition: TBranchProxy.h:708
const T & At(UInt_t i)
Definition: TBranchProxy.h:608
TStlImpProxy< ULong64_t > TStlULong64Proxy
Definition: TBranchProxy.h:752
TImpProxy< Double_t > TDoubleProxy
Definition: TBranchProxy.h:681
const TVirtualCollectionProxy * operator->()
Definition: TBranchProxy.h:470
TStlArrayProxy< TArrayType< UChar_t > > TStlArrayUCharProxy
Definition: TBranchProxy.h:770
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
Definition: TBranchProxy.h:347
double T(double x)
Definition: ChebyshevPol.h:34
TImpProxy< ULong64_t > TULong64Proxy
Definition: TBranchProxy.h:687
virtual void PushProxy(void *objectstart)=0
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayShortProxy
Definition: TBranchProxy.h:774
R__EXTERN PyObject * gSize
Definition: PyStrings.h:48
TArrayProxy< TArrayType< Long_t > > TArrayLongProxy
Definition: TBranchProxy.h:707
TClaImpProxy< UInt_t > TClaUIntProxy
Definition: TBranchProxy.h:717
TClaArrayProxy< TArrayType< Char_t > > TClaArrayCharProxy
Definition: TBranchProxy.h:742
TImpProxy< Char_t > TCharProxy
Definition: TBranchProxy.h:694
TStlImpProxy< Long64_t > TStlLong64Proxy
Definition: TBranchProxy.h:757
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
Definition: TBranchProxy.h:545
const TClonesArray * operator->()
Definition: TBranchProxy.h:430
TArrayProxy< TArrayType< UShort_t > > TArrayUShortProxy
Definition: TBranchProxy.h:704
#define R__ASSERT(e)
Definition: TError.h:96
TStreamerElement * fElement
Definition: TBranchProxy.h:84
TArrayProxy< TArrayType< Double32_t > > TArrayDouble32Proxy
Definition: TBranchProxy.h:698
TClaImpProxy< Float16_t > TClaFloat16Proxy
Definition: TBranchProxy.h:716
const T & At(UInt_t i)
Definition: TBranchProxy.h:578
Basic string class.
Definition: TString.h:131
virtual void * GetStart(UInt_t=0)
Definition: TBranchProxy.h:222
const char * Setup
Definition: TXMLSetup.cxx:47
TImpProxy< Float_t > TFloatProxy
Definition: TBranchProxy.h:683
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TClaImpProxy< Long_t > TClaLongProxy
Definition: TBranchProxy.h:723
TObject * At(Int_t idx) const
Definition: TObjArray.h:165
TClaImpProxy< UShort_t > TClaUShortProxy
Definition: TBranchProxy.h:720
TArrayProxy< TArrayType< ULong_t > > TArrayULongProxy
Definition: TBranchProxy.h:702
TClaArrayProxy< TArrayType< UInt_t > > TClaArrayUIntProxy
Definition: TBranchProxy.h:733
TStlArrayProxy< TArrayType< ULong_t > > TStlArrayULongProxy
Definition: TBranchProxy.h:767
Int_t GetEntries() override
Definition: TBranchProxy.h:417
TStlArrayProxy< TArrayType< Float16_t > > TStlArrayFloat16Proxy
Definition: TBranchProxy.h:765
TStlImpProxy< Short_t > TStlShortProxy
Definition: TBranchProxy.h:758
TArrayProxy< TArrayType< UChar_t > > TArrayUCharProxy
Definition: TBranchProxy.h:705
TStlArrayProxy< TArrayType< ULong64_t > > TStlArrayULong64Proxy
Definition: TBranchProxy.h:768
TArrayProxy< TArrayType< Bool_t > > TArrayBoolProxy
Definition: TBranchProxy.h:711
TClaArrayProxy< TArrayType< UChar_t > > TClaArrayUCharProxy
Definition: TBranchProxy.h:737
TStlImpProxy< Int_t > TStlIntProxy
Definition: TBranchProxy.h:755
TClaImpProxy< UChar_t > TClaUCharProxy
Definition: TBranchProxy.h:721
virtual Int_t GetTreeNumber() const
Definition: TTree.h:440
TImpProxy< Int_t > TIntProxy
Definition: TBranchProxy.h:690
Int_t GetLast() const
Return index of last object in array.
Definition: TObjArray.cxx:561
const char * GetBranchName() const
Definition: TBranchProxy.h:115
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayShortProxy
Definition: TBranchProxy.h:741
TClaArrayProxy< TArrayType< Long_t > > TClaArrayLongProxy
Definition: TBranchProxy.h:739
TStlImpProxy< ULong_t > TStlULongProxy
Definition: TBranchProxy.h:751
TStlImpProxy< Char_t > TStlCharProxy
Definition: TBranchProxy.h:759
TArrayProxy< TArrayType< Float16_t > > TArrayFloat16Proxy
Definition: TBranchProxy.h:700
virtual Int_t GetArrayLength()
Definition: TBranchProxy.h:195
unsigned int UInt_t
Definition: RtypesCore.h:42
TImpProxy< UChar_t > TUCharProxy
Definition: TBranchProxy.h:689
TClaImpProxy< Short_t > TClaShortProxy
Definition: TBranchProxy.h:725
char * Form(const char *fmt,...)
TArrayProxy< TArrayType< Int_t > > TArrayIntProxy
Definition: TBranchProxy.h:706
Ssiz_t Length() const
Definition: TString.h:405
TClaArrayProxy< TArrayType< Double_t > > TClaArrayDoubleProxy
Definition: TBranchProxy.h:729
TClaArrayProxy< TArrayType< Float16_t > > TClaArrayFloat16Proxy
Definition: TBranchProxy.h:732
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayUShortProxy
Definition: TBranchProxy.h:736
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
Definition: TBranch.cxx:1310
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:75
TClaImpProxy< ULong_t > TClaULongProxy
Definition: TBranchProxy.h:718
void * GetStlStart(UInt_t i=0)
Definition: TBranchProxy.h:283
TClaImpProxy< Double_t > TClaDoubleProxy
Definition: TBranchProxy.h:713
void Reset(Detail::TBranchProxy *x)
TImpProxy< Short_t > TShortProxy
Definition: TBranchProxy.h:693
TImpProxy< Long_t > TLongProxy
Definition: TBranchProxy.h:691
TClaImpProxy< ULong64_t > TClaULong64Proxy
Definition: TBranchProxy.h:719
TClaImpProxy< Long64_t > TClaLong64Proxy
Definition: TBranchProxy.h:724
TStlImpProxy< Double32_t > TStlDouble32Proxy
Definition: TBranchProxy.h:747
Int_t GetEntries() override
Definition: TBranchProxy.h:541
const TVirtualCollectionProxy * GetPtr()
Definition: TBranchProxy.h:454
const Bool_t kFALSE
Definition: RtypesCore.h:88
TClaImpProxy< Bool_t > TClaBoolProxy
Definition: TBranchProxy.h:727
TArrayProxy< TArrayType< ULong64_t > > TArrayULong64Proxy
Definition: TBranchProxy.h:703
TStlImpProxy< Float_t > TStlFloatProxy
Definition: TBranchProxy.h:748
#define d(i)
Definition: RSha256.hxx:102
virtual Int_t GetEntries()
Definition: TBranchProxy.h:186
TClaArrayProxy< TArrayType< Int_t > > TClaArrayIntProxy
Definition: TBranchProxy.h:738
virtual void PopProxy()=0
TClaImpProxy< Double32_t > TClaDouble32Proxy
Definition: TBranchProxy.h:714
void Print(std::ostream &os, const OptionType &opt)
TVirtualCollectionProxy * GetCollection()
Definition: TBranchProxy.h:219
TImpProxy< ULong_t > TULongProxy
Definition: TBranchProxy.h:686
TStlImpProxy< UInt_t > TStlUIntProxy
Definition: TBranchProxy.h:750
TClaArrayProxy< TArrayType< Long64_t > > TClaArrayLong64Proxy
Definition: TBranchProxy.h:740
virtual void * At(UInt_t idx)=0
TStlArrayProxy< TArrayType< Char_t > > TStlArrayCharProxy
Definition: TBranchProxy.h:775
TClaArrayProxy< TArrayType< Double32_t > > TClaArrayDouble32Proxy
Definition: TBranchProxy.h:730
TImpProxy< Bool_t > TBoolProxy
Definition: TBranchProxy.h:695
TClaArrayProxy< TArrayType< Bool_t > > TClaArrayBoolProxy
Definition: TBranchProxy.h:743
TImpProxy< UShort_t > TUShortProxy
Definition: TBranchProxy.h:688
Internal::TBranchProxyDirector * fDirector
Definition: TBranchProxy.h:68
TStlImpProxy< Long_t > TStlLongProxy
Definition: TBranchProxy.h:756
TArrayProxy< TArrayType< Float_t > > TArrayFloatProxy
Definition: TBranchProxy.h:699
TStlImpProxy< UChar_t > TStlUCharProxy
Definition: TBranchProxy.h:754
TArrayProxy< TArrayType< UShort_t > > TArrayShortProxy
Definition: TBranchProxy.h:709
Binding & operator=(OUT(*fun)(void))
TImpProxy< UInt_t > TUIntProxy
Definition: TBranchProxy.h:685
virtual UInt_t Size() const =0
const TClonesArray * GetPtr()
Definition: TBranchProxy.h:412
TArrayProxy< TArrayType< UInt_t > > TArrayUIntProxy
Definition: TBranchProxy.h:701
virtual void * GetAddressOfElement(UInt_t)
Return the address of the element number i.
Definition: TBranchProxy.h:215
TStlArrayProxy< TArrayType< Float_t > > TStlArrayFloatProxy
Definition: TBranchProxy.h:764
TClaImpProxy< Int_t > TClaIntProxy
Definition: TBranchProxy.h:722
An array of clone (identical) objects.
Definition: TClonesArray.h:32
TStlImpProxy< Double_t > TStlDoubleProxy
Definition: TBranchProxy.h:746
TBranchProxyHelper(const char *left, const char *right=0)
Definition: TBranchProxy.h:50
TStlArrayProxy< TArrayType< Long_t > > TStlArrayLongProxy
Definition: TBranchProxy.h:772
TImpProxy< Long64_t > TLong64Proxy
Definition: TBranchProxy.h:692
Int_t GetEntries() const
Return the number of objects in array (i.e.
Definition: TObjArray.cxx:522
TBranchProxy * GetProxy()
Definition: TBranchProxy.h:114
TClaImpProxy< Char_t > TClaCharProxy
Definition: TBranchProxy.h:726
TStlArrayProxy< TArrayType< UInt_t > > TStlArrayUIntProxy
Definition: TBranchProxy.h:766
TStlArrayProxy< TArrayType< Double32_t > > TStlArrayDouble32Proxy
Definition: TBranchProxy.h:763
A TTree object has a header with a name and a title.
Definition: TTree.h:70
const array_t & At(UInt_t i)
Definition: TBranchProxy.h:552
TStlImpProxy< Bool_t > TStlBoolProxy
Definition: TBranchProxy.h:760
TImpProxy< Float16_t > TFloat16Proxy
Definition: TBranchProxy.h:684
TClaArrayProxy< TArrayType< Float_t > > TClaArrayFloatProxy
Definition: TBranchProxy.h:731
Base class for all the proxy object.
Definition: TBranchProxy.h:66
A TTree is a list of TBranches.
Definition: TBranch.h:62
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
Definition: TBranchProxy.h:424
TClaArrayProxy< TArrayType< ULong64_t > > TClaArrayULong64Proxy
Definition: TBranchProxy.h:735
const Bool_t kTRUE
Definition: RtypesCore.h:87
TVirtualCollectionProxy * fCollection
Definition: TBranchProxy.h:99
unsigned char At(UInt_t i)
Definition: TBranchProxy.h:353
char name[80]
Definition: TGX11.cxx:109
TClaArrayProxy< TArrayType< ULong_t > > TClaArrayULongProxy
Definition: TBranchProxy.h:734
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
const char * Data() const
Definition: TString.h:364
TStlImpProxy< UShort_t > TStlUShortProxy
Definition: TBranchProxy.h:753