Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBranchSTL.cxx
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// Author Lukasz Janyst <ljanyst@cern.ch> 23/01/2008
3
4/** \class TBranchSTL
5\ingroup tree
6
7A Branch handling STL collection of pointers (vectors, lists, queues,
8sets and multisets) while storing them in split mode.
9*/
10
11#include "TBranchSTL.h"
12#include "TBuffer.h"
13#include "TList.h"
14#include "TBranchElement.h"
15#include "TBasket.h"
16#include "TStreamerInfo.h"
17#include "TStreamerElement.h"
18#include <string>
19#include <utility>
20
21#include "TError.h"
22
23
24////////////////////////////////////////////////////////////////////////////////
25/// Default constructor.
26
28 fCollProxy( nullptr ),
29 fParent( nullptr ),
30 fIndArrayCl( nullptr ),
31 fClassVersion( 0 ),
32 fClCheckSum( 0 ),
33 fInfo( nullptr ),
34 fObject( nullptr ),
35 fID( -2 )
36{
37 fIndArrayCl = TClass::GetClass( "TIndArray" );
38 fBranchVector.reserve( 25 );
39 fNleaves = 0;
42}
43
44////////////////////////////////////////////////////////////////////////////////
45/// Normal constructor, called from TTree.
46
50{
51 fTree = tree;
55 fContName = collProxy->GetCollectionClass()->GetName();
56 fClCheckSum = 0;
57 fClassVersion = 1;
58 fID = -2;
59 fInfo = nullptr;
60 fMother = this;
61 fParent = nullptr;
63 fFileName = "";
64 SetName( name );
65 fIndArrayCl = TClass::GetClass( "TIndArray" );
66 fBranchVector.reserve( 25 );
67 fNleaves = 0;
70
71 //---------------------------------------------------------------------------
72 // Allocate and initialize the basket control arrays
73 //---------------------------------------------------------------------------
77
78 for (Int_t i = 0; i < fMaxBaskets; ++i) {
79 fBasketBytes[i] = 0;
80 fBasketEntry[i] = 0;
81 fBasketSeek[i] = 0;
82 }
83
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Normal constructor, called from another branch.
88
89TBranchSTL::TBranchSTL(TBranch* parent, const char* name,
93{
94 fTree = parent->GetTree();
98 fContName = collProxy->GetCollectionClass()->GetName();
99 fClassName = info->GetClass()->GetName();
100 fClassVersion = info->GetClassVersion();
101 fClCheckSum = info->GetClass()->GetCheckSum();
102 fInfo = info;
103 fID = id;
104 fMother = parent->GetMother();
105 fParent = parent;
107 fFileName = "";
108 fNleaves = 0;
111
112 SetName( name );
113 fIndArrayCl = TClass::GetClass( "TIndArray" );
114 fBranchVector.reserve( 25 );
115
116 //---------------------------------------------------------------------------
117 // Allocate and initialize the basket control arrays
118 //---------------------------------------------------------------------------
122
123 for (Int_t i = 0; i < fMaxBaskets; ++i) {
124 fBasketBytes[i] = 0;
125 fBasketEntry[i] = 0;
126 fBasketSeek[i] = 0;
127 }
128
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// Destructor.
133
135{
136 BranchMap_t::iterator brIter;
137 for( brIter = fBranchMap.begin(); brIter != fBranchMap.end(); ++brIter ) {
138 (*brIter).second.fPointers->clear();
139 delete (*brIter).second.fPointers;
140 }
141}
142
143////////////////////////////////////////////////////////////////////////////////
144/// Browse an STL branch.
145
147{
149 if (nbranches > 0) {
151 TBranch* branch=nullptr;
153 while( (branch = (TBranch*)iB()) )
155 persistentBranches.Browse( b );
156 }
157}
158
159////////////////////////////////////////////////////////////////////////////////
160/// Fill an STL branch.
161
163{
164 //---------------------------------------------------------------------------
165 // Cleanup after previous fill
166 //---------------------------------------------------------------------------
167 BranchMap_t::iterator brIter;
168 for( brIter = fBranchMap.begin(); brIter != fBranchMap.end(); ++brIter )
169 (*brIter).second.fPointers->clear();
170
171 //---------------------------------------------------------------------------
172 // Check if we're dealing with the null pointer here
173 //---------------------------------------------------------------------------
174 if( fAddress != fObject ) {
175 //------------------------------------------------------------------------
176 // We have received a zero pointer - treat it as an empty collection
177 //------------------------------------------------------------------------
178 if( fObject == nullptr ) {
179 Int_t bytes = 0;
180 Int_t totalBytes = 0;
181
182 //---------------------------------------------------------------------
183 // Store the indices
184 //---------------------------------------------------------------------
185 fInd.SetNumItems( 0 );
187
188 if( bytes < 0 ) {
189 Error( "Fill", "The IO error while writing the indices!");
190 return -1;
191 }
192 totalBytes += bytes;
193
194 //---------------------------------------------------------------------
195 // Store the branches
196 //---------------------------------------------------------------------
197 for( Int_t i = 0; i < fBranches.GetEntriesFast(); ++i ) {
199 bytes = br->FillImpl(imtHelper);
200 if( bytes < 0 ) {
201 Error( "Fill", "The IO error while writing the branch %s!", br->GetName() );
202 return -1;
203 }
204 totalBytes += bytes;
205 }
206 return totalBytes;
207 }
208 }
209
210 //---------------------------------------------------------------------------
211 // Set upt the collection proxy
212 //---------------------------------------------------------------------------
215
216 //---------------------------------------------------------------------------
217 // Set up the container of indices
218 //---------------------------------------------------------------------------
219 if( fInd.GetCapacity() < size )
221
223
224 //---------------------------------------------------------------------------
225 // Loop over the elements and create branches as needed
226 //---------------------------------------------------------------------------
228 TClass* actClass = nullptr;
229 TClass* vectClass = nullptr;
230 char* element = nullptr;
231 std::vector<void*>* elPointers = nullptr;
232 TBranchElement* elBranch = nullptr;
233 UInt_t elOffset = 0;
237 Int_t totalBytes = 0;
238 Int_t bytes = 0;
240
241 for( UInt_t i = 0; i < size; ++i ) {
242 //------------------------------------------------------------------------
243 // Determine the actual class of current element
244 //------------------------------------------------------------------------
245 element = *(char**)fCollProxy->At( i );
246 if( !element ) {
247 fInd.At(i) = 0;
248 continue;
249 }
250
251 // coverity[dereference] since this is a TBranchSTL by definition the collection contains pointers to objects.
253 brIter = fBranchMap.find( actClass );
254
255 //------------------------------------------------------------------------
256 // The branch was not found - create a new one
257 //------------------------------------------------------------------------
258 if( brIter == fBranchMap.end() ) {
259 //---------------------------------------------------------------------
260 // Find the dictionary for vector of pointers to this class
261 //---------------------------------------------------------------------
262 std::string vectClName("vector<");
263 vectClName += actClass->GetName() + std::string("*>");
265 if( !vectClass ) {
266 Warning( "Fill", "Unable to find dictionary for class %s", vectClName.c_str() );
267 continue;
268 }
269
270 //---------------------------------------------------------------------
271 // Create the vector of pointers to objects of this type and new branch
272 // for it
273 //---------------------------------------------------------------------
274 elPointers = new std::vector<void*>();//vectClass->GetCollectionProxy()->New();
275 if (fName.Length() && fName[fName.Length()-1]=='.') {
276 // The top level branch already has a trailing dot.
277 brName.Form( "%s%s", GetName(), actClass->GetName() );
278 } else {
279 brName.Form( "%s.%s", GetName(), actClass->GetName() );
280 }
281 elBranch = new TBranchElement( this, brName,
282 vectClass->GetCollectionProxy(),
284 elID = maxID++;
285 elBranch->SetFirstEntry( fEntryNumber );
286
288
289 bHelper.fId = elID;
290 bHelper.fBranch = elBranch;
291 bHelper.fPointers = elPointers;
292 bHelper.fBaseOffset = actClass->GetBaseClassOffset( cl );
293
294 // This copies the value of fPointes into the vector and transfers
295 // its ownership to the vector. It will be deleted in ~TBranch.
296 brIter = fBranchMap.insert(std::make_pair(actClass, bHelper ) ).first;
297 elBranch->SetAddress( &((*brIter).second.fPointers) );
298 }
299 //------------------------------------------------------------------------
300 // The branch for this type already exists - set up the pointers
301 //------------------------------------------------------------------------
302 else {
303 elPointers = (*brIter).second.fPointers;
304 elBranch = (*brIter).second.fBranch;
305 elID = (*brIter).second.fId;
306 elOffset = (*brIter).second.fBaseOffset;
307 }
308
309 //-------------------------------------------------------------------------
310 // Add the element to the appropriate vector
311 //-------------------------------------------------------------------------
312 elPointers->push_back( element + elOffset );
313 fInd.At(i) = elID;
314 }
315
316 //----------------------------------------------------------------------------
317 // Store the indices
318 //----------------------------------------------------------------------------
319 bytes = TBranch::FillImpl(nullptr);
320 if( bytes < 0 ) {
321 Error( "Fill", "The IO error while writing the indices!");
322 return -1;
323 }
324 totalBytes += bytes;
325
326 //----------------------------------------------------------------------------
327 // Fill the branches
328 //----------------------------------------------------------------------------
329 for( Int_t i = 0; i < fBranches.GetEntriesFast(); ++i ) {
331 bytes = br->Fill();
332 if( bytes < 0 ) {
333 Error( "Fill", "The IO error while writing the branch %s!", br->GetName() );
334 return -1;
335 }
336 totalBytes += bytes;
337 }
338
339 return totalBytes;
340}
341
342////////////////////////////////////////////////////////////////////////////////
343/// Get entry.
344
346{
347 //---------------------------------------------------------------------------
348 // Check if we should be doing this at all
349 //---------------------------------------------------------------------------
350 if( TestBit( kDoNotProcess ) && !getall )
351 return 0;
352
353 if ( (entry < fFirstEntry) || (entry >= fEntryNumber) )
354 return 0;
355
356 if( !fAddress )
357 return 0;
358
359 //---------------------------------------------------------------------------
360 // Set up the collection proxy
361 //---------------------------------------------------------------------------
362 if( !fCollProxy ) {
364
365 if( !cl ) {
366 Error( "GetEntry", "Dictionary class not found for: %s", fContName.Data() );
367 return -1;
368 }
369
371 if( !fCollProxy ) {
372 Error( "GetEntry", "No collection proxy!" );
373 return -1;
374 }
375 }
376
377 //---------------------------------------------------------------------------
378 // Get the indices
379 //---------------------------------------------------------------------------
380 Int_t totalBytes = 0;
382 totalBytes += bytes;
383
384 if( bytes == 0 )
385 return 0;
386
387 if( bytes < 0 ) {
388 Error( "GetEntry", "IO error! Unable to get the indices!" );
389 return -1;
390 }
391
393
394 //---------------------------------------------------------------------------
395 // Set up vector pointers
396 //---------------------------------------------------------------------------
399 TClass* tmpClass = nullptr;
400
401 if( fBranchVector.size() < nBranches )
402 fBranchVector.resize( nBranches );
403
404 //---------------------------------------------------------------------------
405 // Create the object
406 //---------------------------------------------------------------------------
407 if( fAddress != fObject ) {
408 *((void **)fAddress) = fCollProxy->New();
409 fObject = *(char**)fAddress;
410 }
412 void* env = fCollProxy->Allocate( size, true );
413
414 //---------------------------------------------------------------------------
415 // Process entries
416 //---------------------------------------------------------------------------
417 UChar_t index = 0;
418 void** element = nullptr;
419 std::vector<void*>* elemVect = nullptr;
420 TBranchElement* elemBranch = nullptr;
421
422 for( Int_t i = 0; i < size; ++i ) {
423 element = (void**)fCollProxy->At(i);
424 index = fInd.At(i);
425
426 //------------------------------------------------------------------------
427 // The case of zero pointers
428 //------------------------------------------------------------------------
429 if( index == 0 ) {
430 *element = nullptr;
431 continue;
432 }
433
434 //-------------------------------------------------------------------------
435 // Index out of range!
436 //-------------------------------------------------------------------------
437 if( index > nBranches ) {
438 Error( "GetEntry", "Index %d out of range, unable to find the branch, setting pointer to 0",
439 index );
440 *element = nullptr;
441 continue;
442 }
443
444 //------------------------------------------------------------------------
445 // Load unloaded branch
446 //------------------------------------------------------------------------
447 index--;
448 elemVect = fBranchVector[index].fPointers;
449 if( !elemVect ) {
451 elemBranch->SetAddress( &(fBranchVector[index].fPointers) );
452
453 bytes = elemBranch->GetEntry( entry, getall );
454
455 if( bytes == 0 ) {
456 Error( "GetEntry", "No entry for index %d, setting pointer to 0", index );
457 *element = nullptr;
458 fBranchVector[index].fPosition++;
459 continue;
460 }
461
462 if( bytes <= 0 ) {
463 Error( "GetEntry", "I/O error while getting entry for index %d, setting pointer to 0", index );
464 *element = nullptr;
465 fBranchVector[index].fPosition++;
466 continue;
467 }
468 totalBytes += bytes;
469 elemVect = fBranchVector[index].fPointers;
470
471 //---------------------------------------------------------------------
472 // Calculate the base class offset
473 //---------------------------------------------------------------------
474 TVirtualCollectionProxy *proxy = elemBranch->GetCollectionProxy();
475 if (!proxy) {
476 proxy = TClass::GetClass(elemBranch->GetClassName())->GetCollectionProxy();
477 }
478 if (proxy) {
479 tmpClass = proxy->GetValueClass();
480 if (tmpClass && elClass) {
481 fBranchVector[index].fBaseOffset = tmpClass->GetBaseClassOffset( elClass );
482 fBranchVector[index].fPosition = 0;
483 } else {
484 Error("GetEntry","Missing TClass for %s (%s)",elemBranch->GetName(),elemBranch->GetClassName());
485 }
486 } else {
487 Error("GetEntry","Missing CollectionProxy for %s (%s)",elemBranch->GetName(),elemBranch->GetClassName());
488 }
489 }
490
491 //------------------------------------------------------------------------
492 // Set up the element
493 //------------------------------------------------------------------------
494 *element = ((char*)(*elemVect)[fBranchVector[index].fPosition++])
495 - fBranchVector[index].fBaseOffset;
496
497 }
498
500
501 //---------------------------------------------------------------------------
502 // Cleanup
503 //---------------------------------------------------------------------------
504 for( UInt_t i = 0; i < fBranchVector.size(); ++i ) {
505 delete fBranchVector[i].fPointers;
506 fBranchVector[i].fPointers = nullptr;
507 }
508
509 return totalBytes;
510}
511
512////////////////////////////////////////////////////////////////////////////////
513/// Fill expectedClass and expectedType with information on the data type of the
514/// object/values contained in this branch (and thus the type of pointers
515/// expected to be passed to Set[Branch]Address
516/// return 0 in case of success and > 0 in case of failure.
517
519{
520 expectedClass = nullptr;
522
523 if (fID < 0) {
525 } else {
526 // Case of an object data member. Here we allow for the
527 // variable name to be omitted. Eg, for Event.root with split
528 // level 1 or above Draw("GetXaxis") is the same as Draw("fH.GetXaxis()")
529 TStreamerElement* element = GetInfo()->GetElement(fID);
530 if (element) {
531 expectedClass = element->GetClassPointer();
532 if (!expectedClass) {
533 Error("GetExpectedType", "TBranchSTL did not find the TClass for %s", element->GetTypeNameBasic());
534 return 1;
535 }
536 } else {
537 Error("GetExpectedType", "Did not find the type for %s",GetName());
538 return 2;
539 }
540 }
541 return 0;
542}
543
544////////////////////////////////////////////////////////////////////////////////
545/// Get streamer info.
546
548{
549 //---------------------------------------------------------------------------
550 // Check if we don't have the streamer info
551 //---------------------------------------------------------------------------
552 if( !fInfo ) {
553 //------------------------------------------------------------------------
554 // Get the class info
555 //------------------------------------------------------------------------
557
558 //------------------------------------------------------------------------
559 // Get unoptimized streamer info
560 //------------------------------------------------------------------------
562
563 //------------------------------------------------------------------------
564 // If the checksum is there and we're dealing with the foreign class
565 //------------------------------------------------------------------------
566 if( fClCheckSum && !cl->IsVersioned() ) {
567 //---------------------------------------------------------------------
568 // Loop over the infos
569 //---------------------------------------------------------------------
570 Int_t ninfos = cl->GetStreamerInfos()->GetEntriesFast() - 1;
571 for( Int_t i = -1; i < ninfos; ++i ) {
573 if( !info )
574 continue;
575
576 //------------------------------------------------------------------
577 // If the checksum matches then retrieve the info
578 //------------------------------------------------------------------
579 if( info->GetCheckSum() == fClCheckSum ) {
580 fClassVersion = i;
582 }
583 }
584 }
585 }
586 return fInfo;
587}
588
589////////////////////////////////////////////////////////////////////////////////
590/// Branch declared folder if at least one entry.
591
593{
594 if( fBranches.GetEntriesFast() >= 1 )
595 return true;
596 return false;
597}
598
599////////////////////////////////////////////////////////////////////////////////
600/// Print the branch parameters.
601
602void TBranchSTL::Print(const char *option) const
603{
604 constexpr auto length = std::char_traits<char>::length;
605 if (strncmp(option,"debugAddress",length("debugAddress"))==0) {
606 if (length(GetName())>24) Printf("%-24s\n%-24s ", GetName(),"");
607 else Printf("%-24s ", GetName());
608
609 TBranchElement *parent = dynamic_cast<TBranchElement*>(GetMother()->GetSubBranch(this));
610 Int_t ind = parent ? parent->GetListOfBranches()->IndexOf(this) : -1;
612 Int_t *branchOffset = parent ? parent->GetBranchOffset() : nullptr;
613
614 Printf("%-16s %2d SplitCollPtr %-16s %-16s %8x %-16s n/a\n",
615 info ? info->GetName() : "StreamerInfo unavailable", fID,
616 GetClassName(), fParent ? fParent->GetName() : "n/a",
617 (branchOffset && parent && ind>=0) ? branchOffset[ind] : 0,
618 fObject);
619 for( Int_t i = 0; i < fBranches.GetEntriesFast(); ++i ) {
621 br->Print("debugAddressSub");
622 }
623 } else if (strncmp(option,"debugInfo",length("debugInfo"))==0) {
624 Printf("Branch %s uses:\n",GetName());
625 if (fID>=0) {
626 GetInfo()->GetElement(fID)->ls();
627 }
628 for (Int_t i = 0; i < fBranches.GetEntriesFast(); ++i) {
630 subbranch->Print("debugInfoSub");
631 }
632 return;
633 } else {
635 for( Int_t i = 0; i < fBranches.GetEntriesFast(); ++i ) {
637 br->Print(option);
638 }
639 }
640}
641
642////////////////////////////////////////////////////////////////////////////////
643/// Read leaves.
644
646{
647 b.ReadClassBuffer( fIndArrayCl, &fInd );
648}
649
650////////////////////////////////////////////////////////////////////////////////
651/// Fill leaves.
652
654{
655 b.WriteClassBuffer( fIndArrayCl, &fInd );
656}
657
658////////////////////////////////////////////////////////////////////////////////
659/// Set Address.
660
662{
663 //---------------------------------------------------------------------------
664 // We are the top level branch
665 //---------------------------------------------------------------------------
666 if( fID < 0 ) {
667 fAddress = (char*)addr;
668 fObject = *(char**)addr;
669 }
670 //---------------------------------------------------------------------------
671 // We are a data member of some other class
672 //---------------------------------------------------------------------------
673 else {
674 //------------------------------------------------------------------------
675 // Get the appropriate streamer element
676 //------------------------------------------------------------------------
677 GetInfo();
679
680 //------------------------------------------------------------------------
681 // Set up the addresses
682 //------------------------------------------------------------------------
683 if( el->IsaPointer() ) {
684 fAddress = (char*)addr+el->GetOffset();
685 fObject = *(char**)fAddress;
686 } else {
687 fAddress = (char*)addr+el->GetOffset();
688 fObject = (char*)addr+el->GetOffset();
689 }
690 }
691}
#define b(i)
Definition RSha256.hxx:100
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
long long Long64_t
Portable signed long integer 8 bytes.
Definition RtypesCore.h:83
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
EDataType
Definition TDataType.h:28
@ kOther_t
Definition TDataType.h:32
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t bytes
char name[80]
Definition TGX11.cxx:110
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Definition TString.cxx:2509
A helper class for managing IMT work during TTree:Fill operations.
A Branch for the case of an object.
Int_t * GetBranchOffset() const
Int_t GetExpectedType(TClass *&clptr, EDataType &type) override
Fill expectedClass and expectedType with information on the data type of the object/values contained ...
void Browse(TBrowser *b) override
Browse an STL branch.
~TBranchSTL() override
Destructor.
Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *) override
Fill an STL branch.
void ReadLeavesImpl(TBuffer &b)
Read leaves.
TClass * fIndArrayCl
! Class of the ind array
Definition TBranchSTL.h:69
TBranchSTL()
Default constructor.
void FillLeavesImpl(TBuffer &b)
Fill leaves.
void Print(Option_t *="") const override
Print the branch parameters.
bool IsFolder() const override
Branch declared folder if at least one entry.
Int_t fClassVersion
Version number of the class.
Definition TBranchSTL.h:73
TString fClassName
Name of the parent class, if we're the data member.
Definition TBranchSTL.h:72
char * fObject
! Pointer to object at address or the
Definition TBranchSTL.h:76
TBranch * fParent
! Parent of this branch
Definition TBranchSTL.h:68
TString fContName
Class name of referenced object.
Definition TBranchSTL.h:71
virtual TStreamerInfo * GetInfo() const
Get streamer info.
TStreamerInfo * fInfo
! The streamer info
Definition TBranchSTL.h:75
TIndArray fInd
! Indices
Definition TBranchSTL.h:70
Int_t fID
Element serial number in the streamer info.
Definition TBranchSTL.h:77
UInt_t fClCheckSum
Class checksum.
Definition TBranchSTL.h:74
TVirtualCollectionProxy * fCollProxy
! Collection proxy
Definition TBranchSTL.h:67
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
Get entry.
void SetAddress(void *addr) override
Set Address.
BranchMap_t fBranchMap
! Branch map
Definition TBranchSTL.h:64
std::vector< ElementBranchHelper_t > fBranchVector
! Branch vector
Definition TBranchSTL.h:65
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
Definition TBranchSTL.h:35
A TTree is a list of TBranches.
Definition TBranch.h:93
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
Definition TBranch.h:149
Int_t fMaxBaskets
Maximum number of Baskets so far.
Definition TBranch.h:125
TTree * GetTree() const
Definition TBranch.h:252
FillLeaves_t fFillLeaves
! Pointer to the FillLeaves implementation to use.
Definition TBranch.h:163
void(TBranch::* ReadLeaves_t)(TBuffer &b)
Definition TBranch.h:160
@ kDoNotProcess
Active bit for branches.
Definition TBranch.h:105
char * fAddress
! Address of 1st leaf (variable or object)
Definition TBranch.h:147
TObjArray * GetListOfBranches()
Definition TBranch.h:246
Long64_t * fBasketEntry
[fMaxBaskets] Table of first entry in each basket
Definition TBranch.h:142
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:1705
void Print(Option_t *option="") const override
Print TBranch parameters.
Definition TBranch.cxx:2340
TBranch * GetSubBranch(const TBranch *br) const
Find the parent branch of child.
Definition TBranch.cxx:2163
ReadLeaves_t fReadLeaves
! Pointer to the ReadLeaves implementation to use.
Definition TBranch.h:161
void(TBranch::* FillLeaves_t)(TBuffer &b)
Definition TBranch.h:162
Int_t fNleaves
! Number of leaves
Definition TBranch.h:128
Int_t fSplitLevel
Branch split level.
Definition TBranch.h:127
Int_t * fBasketBytes
[fMaxBaskets] Length of baskets on file
Definition TBranch.h:141
friend class TBranchElement
Definition TBranch.h:100
TObjArray fBranches
-> List of Branches of this branch
Definition TBranch.h:138
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
Definition TBranch.h:148
TBranch * fMother
! Pointer to top-level parent branch in the tree.
Definition TBranch.h:145
Long64_t * fBasketSeek
[fMaxBaskets] Addresses of baskets on file
Definition TBranch.h:143
Long64_t fFirstEntry
Number of the first entry in this branch.
Definition TBranch.h:135
Int_t fBasketSize
Initial Size of Basket Buffer.
Definition TBranch.h:118
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
Definition TBranch.h:121
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition TBranch.cxx:2126
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Definition TBranch.cxx:855
TTree * fTree
! Pointer to Tree header
Definition TBranch.h:144
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Buffer base class used for serializing objects.
Definition TBuffer.h:43
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
const TObjArray * GetStreamerInfos() const
Definition TClass.h:505
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0, Bool_t isTransient=kFALSE) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist,...
Definition TClass.cxx:4626
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Definition TClass.cxx:2902
Bool_t IsVersioned() const
Definition TClass.h:535
TClass * GetActualClass(const void *object) const
Return a pointer to the real class of the object.
Definition TClass.cxx:2612
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition TClass.cxx:2973
UInt_t GetNumItems()
Definition TIndArray.h:34
void SetNumItems(UInt_t items)
Definition TIndArray.h:35
UInt_t GetCapacity()
Definition TIndArray.h:33
void ClearAndResize(UInt_t size)
Definition TIndArray.h:25
UChar_t & At(Int_t ind)
Definition TIndArray.h:36
A doubly linked list.
Definition TList.h:38
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
TString fName
Definition TNamed.h:32
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition TNamed.cxx:149
Int_t GetEntriesFast() const
Definition TObjArray.h:58
Int_t IndexOf(const TObject *obj) const override
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
TObject * UncheckedAt(Int_t i) const
Definition TObjArray.h:84
void Add(TObject *obj) override
Definition TObjArray.h:68
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:202
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1057
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1071
Describe one element (data member) to be Streamed.
Describes a persistent version of a class.
TObjArray * GetElements() const override
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:425
const char * Data() const
Definition TString.h:384
A TTree represents a columnar dataset.
Definition TTree.h:89
TDirectory * GetDirectory() const
Definition TTree.h:501
RAII helper class that ensures that PushProxy() / PopProxy() are called when entering / leaving a C++...
Defines a common interface to inspect/change the contents of an object that represents a collection.
virtual void * New() const
Construct a new container object and return its address.
virtual TClass * GetValueClass() const =0
If the value type is a user-defined class, return a pointer to the TClass representing the value type...
virtual void Commit(void *)=0
Commits pending elements in a staging area (see Allocate() for more information).
virtual void * At(UInt_t idx)=0
Return the address of the value at index idx
virtual UInt_t Size() const =0
Return the current number of elements in the container.
virtual void * Allocate(UInt_t n, Bool_t forceDelete)=0
Allocates space for storing at least n elements.
Abstract Interface class describing Streamer information for one class.