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