12 #ifndef ROOT_TBranchProxy 13 #define ROOT_TBranchProxy 53 if (left[0]&&right && fName[fName.
Length()-1]!=
'.') fName +=
".";
59 operator const char*() {
return fName.
Data(); };
124 if (fDirector==0)
return false;
127 if (!IsInitialized()) {
129 ::Error(
"TBranchProxy::Read",
"%s",
Form(
"Unable to initialize %s\n",fBranchName.
Data()));
135 result = fParent->
Read();
146 fCollection->
PushProxy( *(
void**)fWhere );
153 return IsInitialized();
158 if (fDirector==0)
return false;
161 if (!IsInitialized()) {
163 ::Error(
"TBranchProxy::ReadEntries",
"%s",
Form(
"Unable to initialize %s\n",fBranchName.
Data()));
170 fBranchCount->TBranch::GetEntry(fDirector->
GetReadEntry());
177 return IsInitialized();
181 if (fDirector==0)
return 0;
183 if (!IsInitialized()) {
202 fWhere = ((
unsigned char*)fParent->
GetStart()) + fMemberOffset;
205 if (fWhere)
return *(
void**)fWhere;
226 location = (
char*)tca->
At(i);
230 }
else if (fParent) {
244 location = (
char*)tca->
At(i);
247 if (location) location += fOffset;
251 return *(
void**)(location);
267 if (fCollection->
Size()<i)
return 0;
269 location = (
char*)fCollection->
At(i);
273 }
else if (fParent) {
291 if (location) location += fOffset;
295 return *(
void**)(location);
314 std::cout <<
"fWhere " << fWhere << std::endl;
315 if (fWhere) std::cout <<
"value? " << *(
unsigned char*)GetStart() << std::endl;
329 static unsigned char default_val;
330 if (!Read())
return default_val;
332 unsigned char* str = (
unsigned char*)GetStart();
336 unsigned char operator [](
Int_t i) {
344 operator const char*() {
345 if (!Read())
return "";
346 return (
const char*)GetStart();
350 if (!Read())
return "";
351 return (
const char*)GetStart();
355 if (!Read())
return "";
356 return (
const char*)GetStart();
359 operator std::string() {
360 if (!Read())
return "";
361 return std::string((
const char*)GetStart());
372 std::cout <<
"fWhere " << fWhere << std::endl;
375 std::cout <<
"location " << *(
TClonesArray**)fWhere << std::endl;
377 std::cout <<
"location " << fWhere << std::endl;
393 if (!Read())
return 0;
398 if (!ReadEntries())
return 0;
414 std::cout <<
"fWhere " << fWhere << std::endl;
417 std::cout <<
"location " << *(
TClonesArray**)fWhere << std::endl;
419 std::cout <<
"location " << fWhere << std::endl;
435 if (!Read())
return 0;
436 return GetCollection();
440 if (!ReadEntries())
return 0;
441 return GetPtr()->Size();
455 std::cout <<
"fWhere " << fWhere << std::endl;
456 if (fWhere) std::cout <<
"value? " << *(
T*)GetStart() << std::endl;
470 if (!Read())
return 0;
471 return *(
T*)GetStart();
477 #define private_was_replaced 483 #ifdef private_was_replaced 484 #define private public 494 typedef T array_t[d];
506 typedef typename T::array_t array_t[d];
524 typedef typename T::array_t
array_t;
529 std::cout <<
"fWhere " << GetWhere() << std::endl;
530 if (GetWhere()) std::cout <<
"value? " << *(type_t*)GetWhere() << std::endl;
534 static array_t default_val;
535 if (!Read())
return default_val;
538 arr = (array_t*)((type_t*)(GetStart()));
539 if (arr)
return arr[i];
540 else return default_val;
543 const array_t &operator [](
Int_t i) {
return At(i); }
544 const array_t &operator [](
UInt_t i) {
return At(i); }
555 std::cout <<
"fWhere " << fWhere << std::endl;
556 if (fWhere) std::cout <<
"value? " << *(
T*)GetStart() << std::endl;
570 static T default_val;
571 if (!Read())
return default_val;
572 if (fWhere==0)
return default_val;
574 T *temp = (
T*)GetClaStart(i);
576 if (temp)
return *temp;
577 else return default_val;
581 const T& operator [](
Int_t i) {
return At(i); }
582 const T& operator [](
UInt_t i) {
return At(i); }
587 #define private_was_replaced 593 #ifdef private_was_replaced 594 #define private public 607 std::cout <<
"fWhere " << fWhere << std::endl;
608 if (fWhere) std::cout <<
"value? " << *(
T*)GetStart() << std::endl;
622 static T default_val;
623 if (!Read())
return default_val;
624 if (fWhere==0)
return default_val;
626 T *temp = (
T*)GetStlStart(i);
628 if (temp)
return *temp;
629 else return default_val;
632 const T& operator [](
Int_t i) {
return At(i); }
633 const T& operator [](
UInt_t i) {
return At(i); }
638 #define private_was_replaced 644 #ifdef private_was_replaced 645 #define private public 660 std::cout <<
"fWhere " << fWhere << std::endl;
661 if (fWhere) std::cout <<
"value? " << *(type_t*)GetStart() << std::endl;
675 static array_t default_val;
676 if (!Read())
return &default_val;
677 if (fWhere==0)
return &default_val;
679 return (array_t*)GetClaStart(i);
682 array_t *operator [](
Int_t i) {
return At(i); }
683 array_t *operator [](
UInt_t i) {
return At(i); }
697 std::cout <<
"fWhere " << fWhere << std::endl;
698 if (fWhere) std::cout <<
"value? " << *(type_t*)GetStart() << std::endl;
712 static array_t default_val;
713 if (!Read())
return &default_val;
714 if (fWhere==0)
return &default_val;
716 return (array_t*)GetStlStart(i);
719 array_t *operator [](
Int_t i) {
return At(i); }
720 array_t *operator [](
UInt_t i) {
return At(i); }
TStlArrayProxy< TArrayType< Bool_t > > TStlArrayBoolProxy
TStlArrayProxy< TArrayType< Int_t > > TStlArrayIntProxy
TImpProxy< Double32_t > TDouble32Proxy
TStlArrayProxy< TArrayType< Double_t > > TStlArrayDoubleProxy
TArrayProxy< TArrayType< Double_t > > TArrayDoubleProxy
TClaImpProxy< Float_t > TClaFloatProxy
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayUShortProxy
TArrayCharProxy(TBranchProxyDirector *director, const char *name)
const TString fDataMember
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t mid
TStlArrayProxy< TArrayType< Long64_t > > TStlArrayLong64Proxy
Namespace for new ROOT classes and functions.
TStlImpProxy< Float16_t > TStlFloat16Proxy
TArrayProxy(TBranchProxyDirector *director, const char *top, const char *name)
TArrayProxy< TArrayType< Long64_t > > TArrayLong64Proxy
TStlImpProxy< ULong64_t > TStlULong64Proxy
TStlImpProxy(TBranchProxyDirector *director, const char *name)
TImpProxy< Double_t > TDoubleProxy
const TVirtualCollectionProxy * operator->()
TStlArrayProxy< TArrayType< UChar_t > > TStlArrayUCharProxy
TImpProxy< ULong64_t > TULong64Proxy
virtual void PushProxy(void *objectstart)=0
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayShortProxy
TArrayProxy< TArrayType< Long_t > > TArrayLongProxy
TClaImpProxy< UInt_t > TClaUIntProxy
TClaArrayProxy< TArrayType< Char_t > > TClaArrayCharProxy
TImpProxy< Char_t > TCharProxy
TStlImpProxy< Long64_t > TStlLong64Proxy
TClaArrayProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
const TClonesArray * operator->()
TArrayProxy< TArrayType< UShort_t > > TArrayUShortProxy
TStreamerElement * fElement
TArrayProxy< TArrayType< Double32_t > > TArrayDouble32Proxy
TClaImpProxy< Float16_t > TClaFloat16Proxy
TStlProxy(TBranchProxyDirector *director, const char *name)
virtual void * GetStart(UInt_t=0)
TImpProxy< Float_t > TFloatProxy
TStlArrayProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TClaArrayProxy(TBranchProxyDirector *director, const char *top, const char *name)
TClaImpProxy< Long_t > TClaLongProxy
TObject * At(Int_t idx) const
TImpProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TStlProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TClaImpProxy< UShort_t > TClaUShortProxy
TStlProxy(TBranchProxyDirector *director, const char *top, const char *name)
TArrayProxy< TArrayType< ULong_t > > TArrayULongProxy
TClaImpProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TClaArrayProxy< TArrayType< UInt_t > > TClaArrayUIntProxy
TStlArrayProxy< TArrayType< ULong_t > > TStlArrayULongProxy
TStlImpProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TImpProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TArrayProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TStlArrayProxy< TArrayType< Float16_t > > TStlArrayFloat16Proxy
TStlImpProxy< Short_t > TStlShortProxy
const TString fBranchName
TArrayProxy< TArrayType< UChar_t > > TArrayUCharProxy
TStlArrayProxy< TArrayType< ULong64_t > > TStlArrayULong64Proxy
TArrayProxy< TArrayType< Bool_t > > TArrayBoolProxy
TClaArrayProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TClaProxy(TBranchProxyDirector *director, const char *top, const char *name)
TClaArrayProxy< TArrayType< UChar_t > > TClaArrayUCharProxy
TStlImpProxy< Int_t > TStlIntProxy
TClaImpProxy< UChar_t > TClaUCharProxy
virtual Int_t GetTreeNumber() const
TImpProxy< Int_t > TIntProxy
TClaProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
Int_t GetLast() const
Return index of last object in array.
const char * GetBranchName() const
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayShortProxy
virtual void * GetClaStart(UInt_t i=0)
TStlImpProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TClaArrayProxy< TArrayType< Long_t > > TClaArrayLongProxy
TStlImpProxy< ULong_t > TStlULongProxy
TStlImpProxy< Char_t > TStlCharProxy
TArrayProxy< TArrayType< Float16_t > > TArrayFloat16Proxy
TImpProxy< UChar_t > TUCharProxy
TClaImpProxy< Short_t > TClaShortProxy
char * Form(const char *fmt,...)
TArrayProxy< TArrayType< Int_t > > TArrayIntProxy
TArrayCharProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TImpProxy(TBranchProxyDirector *director, const char *name)
TClaArrayProxy< TArrayType< Double_t > > TClaArrayDoubleProxy
TClaArrayProxy< TArrayType< Float16_t > > TClaArrayFloat16Proxy
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayUShortProxy
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
The ROOT global object gROOT contains a list of all defined classes.
TClaImpProxy< ULong_t > TClaULongProxy
TClaImpProxy< Double_t > TClaDoubleProxy
void Reset(Detail::TBranchProxy *x)
TImpProxy< Short_t > TShortProxy
TImpProxy< Long_t > TLongProxy
TClaImpProxy< ULong64_t > TClaULong64Proxy
TClaImpProxy< Long64_t > TClaLong64Proxy
TStlImpProxy< Double32_t > TStlDouble32Proxy
const TVirtualCollectionProxy * GetPtr()
TClaImpProxy< Bool_t > TClaBoolProxy
TArrayProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TArrayProxy< TArrayType< ULong64_t > > TArrayULong64Proxy
TStlImpProxy< Float_t > TStlFloatProxy
TArrayCharProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TClaArrayProxy< TArrayType< Int_t > > TClaArrayIntProxy
virtual void PopProxy()=0
TClaImpProxy< Double32_t > TClaDouble32Proxy
void Print(std::ostream &os, const OptionType &opt)
Long64_t GetReadEntry() const
TVirtualCollectionProxy * GetCollection()
TImpProxy< ULong_t > TULongProxy
TStlArrayProxy(TBranchProxyDirector *director, const char *name)
TStlImpProxy< UInt_t > TStlUIntProxy
TClaImpProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TClaArrayProxy< TArrayType< Long64_t > > TClaArrayLong64Proxy
virtual void * At(UInt_t idx)=0
TStlArrayProxy< TArrayType< Char_t > > TStlArrayCharProxy
TClaArrayProxy< TArrayType< Double32_t > > TClaArrayDouble32Proxy
TImpProxy< Bool_t > TBoolProxy
virtual void * GetStlStart(UInt_t i=0)
TClaImpProxy(TBranchProxyDirector *director, const char *top, const char *name)
TClaArrayProxy< TArrayType< Bool_t > > TClaArrayBoolProxy
TImpProxy< UShort_t > TUShortProxy
Internal::TBranchProxyDirector * fDirector
TClaArrayProxy(TBranchProxyDirector *director, const char *name)
TStlImpProxy< Long_t > TStlLongProxy
TArrayProxy< TArrayType< Float_t > > TArrayFloatProxy
TStlImpProxy< UChar_t > TStlUCharProxy
TArrayProxy< TArrayType< UShort_t > > TArrayShortProxy
Binding & operator=(OUT(*fun)(void))
TArrayProxy(TBranchProxyDirector *director, const char *name)
TStlProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TClaProxy(TBranchProxyDirector *director, const char *top, const char *name, const char *data)
TImpProxy< UInt_t > TUIntProxy
virtual UInt_t Size() const =0
const TClonesArray * GetPtr()
TArrayProxy< TArrayType< UInt_t > > TArrayUIntProxy
TStlArrayProxy< TArrayType< Float_t > > TStlArrayFloatProxy
TClaImpProxy< Int_t > TClaIntProxy
An array of clone (identical) objects.
TStlImpProxy< Double_t > TStlDoubleProxy
TImpProxy(TBranchProxyDirector *director, const char *top, const char *name)
TClaProxy(TBranchProxyDirector *director, const char *name)
#define R__unlikely(expr)
TBranchProxyHelper(const char *left, const char *right=0)
TStlArrayProxy< TArrayType< Long_t > > TStlArrayLongProxy
TImpProxy< Long64_t > TLong64Proxy
TArrayCharProxy(TBranchProxyDirector *director, const char *top, const char *name)
Int_t GetEntries() const
Return the number of objects in array (i.e.
TStlArrayProxy(TBranchProxyDirector *director, TBranchProxy *parent, const char *name, const char *top=0, const char *mid=0)
TBranchProxy * GetProxy()
TClaImpProxy< Char_t > TClaCharProxy
TStlArrayProxy< TArrayType< UInt_t > > TStlArrayUIntProxy
TStlArrayProxy< TArrayType< Double32_t > > TStlArrayDouble32Proxy
TClaImpProxy(TBranchProxyDirector *director, const char *name)
A TTree object has a header with a name and a title.
const array_t & At(UInt_t i)
TStlImpProxy< Bool_t > TStlBoolProxy
TImpProxy< Float16_t > TFloat16Proxy
TStlArrayProxy(TBranchProxyDirector *director, const char *top, const char *name)
TClaArrayProxy< TArrayType< Float_t > > TClaArrayFloatProxy
Base class for all the proxy object.
Bool_t IsaPointer() const
A TTree is a list of TBranches.
TClaArrayProxy< TArrayType< ULong64_t > > TClaArrayULong64Proxy
TVirtualCollectionProxy * fCollection
unsigned char At(UInt_t i)
TClaArrayProxy< TArrayType< ULong_t > > TClaArrayULongProxy
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
TStlImpProxy(TBranchProxyDirector *director, const char *top, const char *name)
const char * Data() const
TStlImpProxy< UShort_t > TStlUShortProxy