Logo ROOT  
Reference Guide
TBranchClones.cxx
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 11/02/96
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
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 #include "TBranchClones.h"
13 
14 #include "TBasket.h"
15 #include "TBuffer.h"
16 #include "TClass.h"
17 #include "TClonesArray.h"
18 #include "TDataMember.h"
19 #include "TDataType.h"
20 #include "TFile.h"
21 #include "TLeafI.h"
22 #include "TRealData.h"
23 #include "TTree.h"
24 
25 #include <cstring>
26 
28 
29 /** \class TBranchClones
30 \ingroup tree
31 
32 A Branch for the case of an array of clone objects.
33 
34 See TTree.
35 */
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Default and i/o constructor.
39 
41 : TBranch()
42 , fList(0)
43 , fRead(0)
44 , fN(0)
45 , fNdataMax(0)
46 , fBranchCount(0)
47 {
48 }
49 
50 ////////////////////////////////////////////////////////////////////////////////
51 /// Constructor.
52 
53 TBranchClones::TBranchClones(TTree *tree, const char* name, void* pointer, Int_t basketsize, Int_t compress, Int_t splitlevel)
54 : TBranch()
55 , fList(0)
56 , fRead(0)
57 , fN(0)
58 , fNdataMax(0)
59 , fBranchCount(0)
60 {
61  Init(tree,0,name,pointer,basketsize,compress,splitlevel);
62 }
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 /// Constructor.
66 
67 TBranchClones::TBranchClones(TBranch *parent, const char* name, void* pointer, Int_t basketsize, Int_t compress, Int_t splitlevel)
68 : TBranch()
69 , fList(0)
70 , fRead(0)
71 , fN(0)
72 , fNdataMax(0)
73 , fBranchCount(0)
74 {
75  Init(0,parent,name,pointer,basketsize,compress,splitlevel);
76 }
77 
78 ////////////////////////////////////////////////////////////////////////////////
79 /// Initialization (non-virtual, to be called from constructor).
80 
81 void TBranchClones::Init(TTree *tree, TBranch *parent, const char* name, void* pointer, Int_t basketsize, Int_t compress, Int_t splitlevel)
82 {
83  if (tree==0 && parent!=0) tree = parent->GetTree();
84  fTree = tree;
85  fMother = parent ? parent->GetMother() : this;
86  fParent = parent;
87 
88  TString leaflist;
89  TString branchname;
90  TString branchcount;
91  SetName(name);
92  if ((compress == -1) && tree->GetDirectory()) {
93  TFile* bfile = 0;
94  if (tree->GetDirectory()) {
95  bfile = tree->GetDirectory()->GetFile();
96  }
97  if (bfile) {
98  compress = bfile->GetCompressionSettings();
99  }
100  }
101  char* cpointer = (char*) pointer;
102  char** ppointer = (char**) pointer;
103  fList = (TClonesArray*) *ppointer;
104  fAddress = cpointer;
105  TClass* cl = fList->GetClass();
106  if (!cl) {
107  return;
108  }
109  tree->BuildStreamerInfo(cl);
110  fClassName = cl->GetName();
111  fSplitLevel = splitlevel;
112 
113  // Create a branch to store the array count.
114  if (basketsize < 100) {
115  basketsize = 100;
116  }
117  leaflist.Form("%s_/I", name);
118  branchcount.Form("%s_", name);
119  fBranchCount = new TBranch(this, branchcount, &fN, leaflist, basketsize);
121  TLeaf* leafcount = (TLeaf*) fBranchCount->GetListOfLeaves()->UncheckedAt(0);
123  fFileName = "";
124 
125  // Loop on all public data members of the class and its base classes.
126  const char* itype = 0;
127  TRealData* rd = 0;
128  TIter next(cl->GetListOfRealData());
129  while ((rd = (TRealData *) next())) {
130  if (rd->TestBit(TRealData::kTransient)) continue;
131 
132  if (rd->IsObject()) {
133  continue;
134  }
135  TDataMember* member = rd->GetDataMember();
136  if (!member->IsPersistent()) {
137  // -- Skip non-persistent members.
138  continue;
139  }
140  if (!member->IsBasic() || member->IsaPointer()) {
141  Warning("BranchClones", "Cannot process: %s::%s", cl->GetName(), member->GetName());
142  continue;
143  }
144  // Forget TObject part if splitlevel = 2.
145  if ((splitlevel > 1) || fList->TestBit(TClonesArray::kForgetBits) || cl->CanIgnoreTObjectStreamer()) {
146  if (!std::strcmp(member->GetName(), "fBits")) {
147  continue;
148  }
149  if (!std::strcmp(member->GetName(), "fUniqueID")) {
150  continue;
151  }
152  }
153  tree->BuildStreamerInfo(TClass::GetClass(member->GetFullTypeName()));
154  TDataType* membertype = member->GetDataType();
155  Int_t type = membertype->GetType();
156  if (!type) {
157  Warning("BranchClones", "Cannot process: %s::%s of type zero!", cl->GetName(), member->GetName());
158  continue;
159  }
160 
161  if (type == 1) {
162  itype = "B";
163  } else if (type == 2) {
164  itype = "S";
165  } else if (type == 3) {
166  itype = "I";
167  } else if (type == 5) {
168  itype = "F";
169  } else if (type == 8) {
170  itype = "D";
171  } else if (type == 9) {
172  itype = "D";
173  } else if (type == 11) {
174  itype = "b";
175  } else if (type == 12) {
176  itype = "s";
177  } else if (type == 13) {
178  itype = "i";
179  }
180 
181  leaflist.Form("%s[%s]/%s", member->GetName(), branchcount.Data(), itype);
182  Int_t comp = compress;
183  branchname.Form("%s.%s", name, rd->GetName());
184  TBranch* branch = new TBranch(this, branchname, this, leaflist, basketsize, comp);
185  branch->SetBit(kIsClone);
186  TObjArray* leaves = branch->GetListOfLeaves();
187  TLeaf* leaf = (TLeaf*) leaves->UncheckedAt(0);
188  leaf->SetOffset(rd->GetThisOffset());
189  leaf->SetLeafCount(leafcount);
190  Int_t arraydim = member->GetArrayDim();
191  if (arraydim) {
192  Int_t maxindex = 1;
193  while (arraydim) {
194  maxindex *= member->GetMaxIndex(--arraydim);
195  }
196  leaf->SetLen(maxindex);
197  }
198  fBranches.Add(branch);
199  }
200 }
201 
202 ////////////////////////////////////////////////////////////////////////////////
203 /// Destructor.
204 
206 {
207  delete fBranchCount;
208  fBranchCount = 0;
209  fBranches.Delete();
210  // FIXME: We might own this, possible memory leak.
211  fList = 0;
212 }
213 
214 ////////////////////////////////////////////////////////////////////////////////
215 /// Browse this branch.
216 
218 {
219  fBranches.Browse(b);
220 }
221 
222 ////////////////////////////////////////////////////////////////////////////////
223 /// Loop on all branches and fill Basket buffer.
224 
226 {
227  Int_t i = 0;
228  Int_t nbytes = 0;
229  Int_t nbranches = fBranches.GetEntriesFast();
230  char** ppointer = (char**) fAddress;
231  if (!ppointer) {
232  return 0;
233  }
234  fList = (TClonesArray*) *ppointer;
235  fN = fList->GetEntriesFast();
236  fEntries++;
237  if (fN > fNdataMax) {
238  fNdataMax = fList->GetSize();
239  TString branchcount;
240  branchcount.Form("%s_", GetName());
241  TLeafI* leafi = (TLeafI*) fBranchCount->GetLeaf(branchcount);
242  leafi->SetMaximum(fNdataMax);
243  for (i = 0; i < nbranches; i++) {
244  TBranch* branch = (TBranch*) fBranches.UncheckedAt(i);
245  TObjArray* leaves = branch->GetListOfLeaves();
246  TLeaf* leaf = (TLeaf*) leaves->UncheckedAt(0);
247  leaf->SetAddress();
248  }
249  }
250  nbytes += fBranchCount->FillImpl(imtHelper);
251  for (i = 0; i < nbranches; i++) {
252  TBranch* branch = (TBranch*) fBranches.UncheckedAt(i);
253  TObjArray* leaves = branch->GetListOfLeaves();
254  TLeaf* leaf = (TLeaf*) leaves->UncheckedAt(0);
255  leaf->Import(fList, fN);
256  nbytes += branch->FillImpl(imtHelper);
257  }
258  return nbytes;
259 }
260 
261 ////////////////////////////////////////////////////////////////////////////////
262 /// Read all branches and return total number of bytes read.
263 
265 {
266  if (TestBit(kDoNotProcess) && !getall) {
267  return 0;
268  }
269  Int_t nbytes = fBranchCount->GetEntry(entry, getall);
270  TLeaf* leafcount = (TLeaf*) fBranchCount->GetListOfLeaves()->UncheckedAt(0);
271  fN = Int_t(leafcount->GetValue());
272  if (fN <= 0) {
273  if (fList) {
274  fList->Clear();
275  }
276  return 0;
277  }
278  TBranch* branch = 0;
279  Int_t nbranches = fBranches.GetEntriesFast();
280  // If fList exists, create clones array objects.
281  if (fList) {
282  fList->Clear();
284  for (Int_t i = 0; i < nbranches; i++) {
285  branch = (TBranch*) fBranches.UncheckedAt(i);
286  if (((TLeaf*) branch->GetListOfLeaves()->UncheckedAt(0))->GetOffset() < 0) {
287  continue;
288  }
289  nbytes += branch->GetEntryExport(entry, getall, fList, fN);
290  }
291  } else {
292  for (Int_t i = 0; i < nbranches; i++) {
293  branch = (TBranch*) fBranches.UncheckedAt(i);
294  nbytes += branch->GetEntry(entry, getall);
295  }
296  }
297  return nbytes;
298 }
299 
300 ////////////////////////////////////////////////////////////////////////////////
301 /// Print branch parameters.
302 
303 void TBranchClones::Print(Option_t *option) const
304 {
305  fBranchCount->Print(option);
306  Int_t nbranches = fBranches.GetEntriesFast();
307  for (Int_t i = 0; i < nbranches; i++) {
308  TBranch* branch = (TBranch*) fBranches.At(i);
309  branch->Print(option);
310  }
311 }
312 
313 ////////////////////////////////////////////////////////////////////////////////
314 /// Reset branch.
315 ///
316 /// - Existing buffers are deleted
317 /// - Entries, max and min are reset
318 
320 {
321  fEntries = 0;
322  fTotBytes = 0;
323  fZipBytes = 0;
324  Int_t nbranches = fBranches.GetEntriesFast();
325  for (Int_t i = 0; i < nbranches; i++) {
326  TBranch* branch = (TBranch*) fBranches.At(i);
327  branch->Reset(option);
328  }
329  fBranchCount->Reset();
330 }
331 
332 ////////////////////////////////////////////////////////////////////////////////
333 /// Reset branch after a merge.
334 ///
335 /// - Existing buffers are deleted
336 /// - Entries, max and min are reset
337 
339 {
340  fEntries = 0;
341  fTotBytes = 0;
342  fZipBytes = 0;
343  Int_t nbranches = fBranches.GetEntriesFast();
344  for (Int_t i = 0; i < nbranches; i++) {
345  TBranch* branch = (TBranch*) fBranches.At(i);
346  branch->ResetAfterMerge(info);
347  }
349 }
350 
351 ////////////////////////////////////////////////////////////////////////////////
352 /// Set address of this branch.
353 
355 {
356  fReadEntry = -1;
357  fAddress = (char*) addr;
358  char** pp= (char**) fAddress;
359  if (pp && (*pp == 0)) {
360  // We've been asked to allocate an object for the user.
361  *pp= (char*) new TClonesArray(fClassName);
362  }
363  fList = 0;
364  if (pp) {
365  fList = (TClonesArray*) *pp;
366  }
368 }
369 
370 ////////////////////////////////////////////////////////////////////////////////
371 /// Reset basket size for all sub-branches.
372 
374 {
375  TBranch::SetBasketSize(buffsize);
376 
377  Int_t nbranches = fBranches.GetEntriesFast();
378  for (Int_t i = 0; i < nbranches; i++) {
379  TBranch* branch = (TBranch*) fBranches[i];
380  branch->SetBasketSize(fBasketSize);
381  }
382 }
383 
384 ////////////////////////////////////////////////////////////////////////////////
385 /// Serialize/Deserialize from a buffer.
386 
387 void TBranchClones::Streamer(TBuffer& b)
388 {
389  UInt_t R__s, R__c;
390  if (b.IsReading()) {
391  b.ReadVersion(&R__s, &R__c);
392  TNamed::Streamer(b);
393  b >> fCompress;
394  b >> fBasketSize;
395  b >> fEntryOffsetLen;
396  b >> fMaxBaskets;
397  b >> fWriteBasket;
398  b >> fEntryNumber;
399  b >> fEntries;
400  b >> fTotBytes;
401  b >> fZipBytes;
402  b >> fOffset;
403  b >> fBranchCount;
404  fClassName.Streamer(b);
405  fBranches.Streamer(b);
406  fTree = 0;
407  TBranch* branch = 0;
408  TLeaf* leaf = 0;
409  Int_t nbranches = fBranches.GetEntriesFast();
410  for (Int_t i = 0; i < nbranches; i++) {
411  branch = (TBranch*) fBranches[i];
412  branch->SetBit(kIsClone);
413  leaf = (TLeaf*) branch->GetListOfLeaves()->UncheckedAt(0);
414  leaf->SetOffset(-1);
415  }
416  fRead = 1;
417  TClass* cl = TClass::GetClass((const char*) fClassName);
418  if (!cl) {
419  Warning("Streamer", "Unknown class: %s. Cannot read BranchClones: %s", fClassName.Data(), GetName());
421  return;
422  }
423  if (!cl->GetListOfRealData()) {
424  cl->BuildRealData();
425  }
426  TString branchname;
427  TRealData* rd = 0;
428  TIter next(cl->GetListOfRealData());
429  while ((rd = (TRealData*) next())) {
430  if (rd->TestBit(TRealData::kTransient)) continue;
431 
432  TDataMember* member = rd->GetDataMember();
433  if (!member || !member->IsBasic() || !member->IsPersistent()) {
434  continue;
435  }
436  TDataType* membertype = member->GetDataType();
437  if (!membertype->GetType()) {
438  continue;
439  }
440  branchname.Form("%s.%s", GetName(), rd->GetName());
441  branch = (TBranch*) fBranches.FindObject(branchname);
442  if (!branch) {
443  continue;
444  }
445  TObjArray* leaves = branch->GetListOfLeaves();
446  leaf = (TLeaf*) leaves->UncheckedAt(0);
447  leaf->SetOffset(rd->GetThisOffset());
448  }
449  b.CheckByteCount(R__s, R__c, TBranchClones::IsA());
450  } else {
451  R__c = b.WriteVersion(TBranchClones::IsA(), kTRUE);
452  TNamed::Streamer(b);
453  b << fCompress;
454  b << fBasketSize;
455  b << fEntryOffsetLen;
456  b << fMaxBaskets;
457  b << fWriteBasket;
458  b << fEntryNumber;
459  b << fEntries;
460  b << fTotBytes;
461  b << fZipBytes;
462  b << fOffset;
463  b << fBranchCount;
464  fClassName.Streamer(b);
465  fBranches.Streamer(b);
466  b.SetByteCount(R__c, kTRUE);
467  }
468 }
469 
470 ////////////////////////////////////////////////////////////////////////////////
471 /// Refresh the value of fDirectory (i.e. where this branch writes/reads its buffers)
472 /// with the current value of fTree->GetCurrentFile unless this branch has been
473 /// redirected to a different file. Also update the sub-branches.
474 
476 {
479 }
TFileMergeInfo
Definition: TFileMergeInfo.h:42
TBranch::fBasketSize
Int_t fBasketSize
Initial Size of Basket Buffer.
Definition: TBranch.h:114
TBranch::fOffset
Int_t fOffset
Offset of this branch.
Definition: TBranch.h:120
TDataMember::GetFullTypeName
const char * GetFullTypeName() const
Get full type description of data member, e,g.: "class TDirectory*".
Definition: TDataMember.cxx:613
TBrowser
Definition: TBrowser.h:37
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TBranchClones::fN
Int_t fN
! Number of elements in ClonesArray
Definition: TBranchClones.h:34
TObjArray::Delete
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Definition: TObjArray.cxx:356
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TBranch::GetLeaf
virtual TLeaf * GetLeaf(const char *name) const
Return pointer to the 1st Leaf named name in thisBranch.
Definition: TBranch.cxx:1902
TObjArray
Definition: TObjArray.h:37
TBranchClones::FillImpl
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all branches and fill Basket buffer.
Definition: TBranchClones.cxx:225
TNamed::SetName
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
TBranch::GetEntryExport
virtual Int_t GetEntryExport(Long64_t entry, Int_t getall, TClonesArray *list, Int_t n)
Read all leaves of an entry and export buffers to real objects in a TClonesArray list.
Definition: TBranch.cxx:1638
TBranchClones::GetEntry
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches and return total number of bytes read.
Definition: TBranchClones.cxx:264
TString::Data
const char * Data() const
Definition: TString.h:369
tree
Definition: tree.py:1
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TBranch::fReadEntry
Long64_t fReadEntry
! Current entry number when reading
Definition: TBranch.h:126
TDataType::GetType
Int_t GetType() const
Definition: TDataType.h:68
TClass::CanIgnoreTObjectStreamer
Bool_t CanIgnoreTObjectStreamer()
Definition: TClass.h:351
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TLeafI::SetMaximum
virtual void SetMaximum(Int_t max)
Definition: TLeafI.h:63
TBranch::fZipBytes
Long64_t fZipBytes
Total number of bytes in all leaves after compression.
Definition: TBranch.h:133
TTree
Definition: TTree.h:79
TBranch::fBranches
TObjArray fBranches
-> List of Branches of this branch
Definition: TBranch.h:134
TLeaf::Import
virtual void Import(TClonesArray *, Int_t)
Definition: TLeaf.h:146
TDataMember.h
TBranch::fEntryOffsetLen
Int_t fEntryOffsetLen
Initial Length of fEntryOffset table in the basket buffers.
Definition: TBranch.h:115
Int_t
int Int_t
Definition: RtypesCore.h:45
TDataMember
Definition: TDataMember.h:31
TBranchClones::ResetAfterMerge
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset branch after a merge.
Definition: TBranchClones.cxx:338
TLeaf::SetLen
virtual void SetLen(Int_t len=1)
Definition: TLeaf.h:162
TLeaf::SetAddress
virtual void SetAddress(void *add=0)
Definition: TLeaf.h:184
TClass.h
TLeaf::GetValue
virtual Double_t GetValue(Int_t i=0) const
Definition: TLeaf.h:182
TRealData::GetThisOffset
Long_t GetThisOffset() const
Definition: TRealData.h:55
TObject::TClonesArray
friend class TClonesArray
Definition: TObject.h:213
TBranchClones::Browse
virtual void Browse(TBrowser *b)
Browse this branch.
Definition: TBranchClones.cxx:217
TBuffer
Definition: TBuffer.h:43
TLeafI
Definition: TLeafI.h:27
TObjArray::UncheckedAt
TObject * UncheckedAt(Int_t i) const
Definition: TObjArray.h:90
TBranch::kIsClone
@ kIsClone
Definition: TBranch.h:102
TObjArray::At
TObject * At(Int_t idx) const
Definition: TObjArray.h:166
TBranchClones::~TBranchClones
virtual ~TBranchClones()
Destructor.
Definition: TBranchClones.cxx:205
TTree.h
TString
Definition: TString.h:136
TBranchClones::fBranchCount
TBranch * fBranchCount
Branch with clones count.
Definition: TBranchClones.h:37
b
#define b(i)
Definition: RSha256.hxx:118
TFile.h
TRealData::kTransient
@ kTransient
Definition: TRealData.h:44
TBranch::fFileName
TString fFileName
Name of file where buffers are stored ("" if in same file as Tree header)
Definition: TBranch.h:145
TClonesArray.h
TBranch::fParent
TBranch * fParent
! Pointer to parent branch.
Definition: TBranch.h:142
TObjArray::Add
void Add(TObject *obj)
Definition: TObjArray.h:74
TDataMember::IsBasic
Bool_t IsBasic() const
Return true if data member is a basic type, e.g. char, int, long...
Definition: TDataMember.cxx:712
TBranchClones::SetAddress
virtual void SetAddress(void *add)
Set address of this branch.
Definition: TBranchClones.cxx:354
TBranch::fEntries
Long64_t fEntries
Number of entries.
Definition: TBranch.h:130
TBranch::fCompress
Int_t fCompress
Compression level and algorithm.
Definition: TBranch.h:113
TRealData::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TRealData.h:52
TBranch
Definition: TBranch.h:89
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
TDataType.h
TRealData::GetDataMember
TDataMember * GetDataMember() const
Definition: TRealData.h:53
TRealData::IsObject
Bool_t IsObject() const
Definition: TRealData.h:56
TBranchClones::UpdateFile
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Definition: TBranchClones.cxx:475
TDataMember::GetArrayDim
Int_t GetArrayDim() const
Return number of array dimensions.
Definition: TDataMember.cxx:545
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TBranchClones::TBranchClones
TBranchClones()
Default and i/o constructor.
Definition: TBranchClones.cxx:40
TBranch::fTotBytes
Long64_t fTotBytes
Total number of bytes in all leaves before compression.
Definition: TBranch.h:132
TBuffer.h
TBranch::fMaxBaskets
Int_t fMaxBaskets
Maximum number of Baskets so far.
Definition: TBranch.h:121
TBranch::fWriteBasket
Int_t fWriteBasket
Last basket number written.
Definition: TBranch.h:116
TBranchClones::fRead
Int_t fRead
! flag = 1 if clonesarray has been read
Definition: TBranchClones.h:33
TDataType
Definition: TDataType.h:44
TBranch::fTree
TTree * fTree
! Pointer to Tree header
Definition: TBranch.h:140
TLeafI.h
TLeaf
Definition: TLeaf.h:57
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
TBranchClones
Definition: TBranchClones.h:29
TClass::GetListOfRealData
TList * GetListOfRealData() const
Definition: TClass.h:404
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
Definition: TObjArray.h:64
TDataMember::GetMaxIndex
Int_t GetMaxIndex(Int_t dim) const
Return maximum index for array dimension "dim".
Definition: TDataMember.cxx:591
TBranchClones::SetBasketSize
virtual void SetBasketSize(Int_t buffsize)
Reset basket size for all sub-branches.
Definition: TBranchClones.cxx:373
TDataMember::GetDataType
TDataType * GetDataType() const
Definition: TDataMember.h:74
TBranch::GetEntry
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:1582
TClonesArray::GetClass
TClass * GetClass() const
Definition: TClonesArray.h:53
TBranchClones::fList
TClonesArray * fList
! Pointer to the clonesarray
Definition: TBranchClones.h:32
TLeaf::SetLeafCount
virtual void SetLeafCount(TLeaf *leaf)
Set the leaf count of this leaf.
Definition: TLeaf.cxx:442
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TCollection::Browse
void Browse(TBrowser *b)
Browse this collection (called by TBrowser).
Definition: TCollection.cxx:248
TBranch::fDirectory
TDirectory * fDirectory
! Pointer to directory where this branch buffers are stored
Definition: TBranch.h:144
TClass::GetClass
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:2925
TRealData.h
TBranch::FillImpl
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all leaves of this branch to fill Basket buffer.
Definition: TBranch.cxx:835
TBranch::ResetAfterMerge
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset a Branch.
Definition: TBranch.cxx:2430
TBranch::Print
virtual void Print(Option_t *option="") const
Print TBranch parameters.
Definition: TBranch.cxx:2173
TBranch::SetAddress
virtual void SetAddress(void *add)
Set address of this branch.
Definition: TBranch.cxx:2514
TLeaf::SetOffset
virtual void SetOffset(Int_t offset=0)
Definition: TLeaf.h:163
TBranchClones.h
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
TClass::BuildRealData
void BuildRealData(void *pointer=0, Bool_t isTransient=kFALSE)
Build a full list of persistent data members.
Definition: TClass.cxx:1980
TBranch::fAddress
char * fAddress
! Address of 1st leaf (variable or object)
Definition: TBranch.h:143
TFile
Definition: TFile.h:54
TClonesArray::kForgetBits
@ kForgetBits
Definition: TClonesArray.h:38
TBranchClones::Init
void Init(TTree *tree, TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000, Int_t compress=-1, Int_t splitlevel=1)
Initialization (non-virtual, to be called from constructor).
Definition: TBranchClones.cxx:81
TBranchClones::fNdataMax
Int_t fNdataMax
! Maximum value of fN
Definition: TBranchClones.h:35
TTree::GetDirectory
TDirectory * GetDirectory() const
Definition: TTree.h:457
TBranch::Reset
virtual void Reset(Option_t *option="")
Reset a Branch.
Definition: TBranch.cxx:2389
TBranch::UpdateFile
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Definition: TBranch.cxx:3132
TBranchClones::Reset
virtual void Reset(Option_t *option="")
Reset branch.
Definition: TBranchClones.cxx:319
TBranch::GetMother
TBranch * GetMother() const
Get our top-level parent branch in the tree.
Definition: TBranch.cxx:1974
TDataMember::IsPersistent
Bool_t IsPersistent() const
Definition: TDataMember.h:89
TObjArray::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Definition: TObjArray.cxx:415
TRealData
Definition: TRealData.h:30
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
TClass
Definition: TClass.h:80
TDataMember::IsaPointer
Bool_t IsaPointer() const
Return true if data member is a pointer.
Definition: TDataMember.cxx:730
ROOT::Internal::TBranchIMTHelper
Definition: TBranchIMTHelper.h:38
name
char name[80]
Definition: TGX11.cxx:110
TFile::GetCompressionSettings
Int_t GetCompressionSettings() const
Definition: TFile.h:399
TBranchClones::Print
virtual void Print(Option_t *option="") const
Print branch parameters.
Definition: TBranchClones.cxx:303
TIter
Definition: TCollection.h:233
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
type
int type
Definition: TGX11.cxx:121
TBranch::kDoNotProcess
@ kDoNotProcess
Definition: TBranch.h:101
TBranch::GetListOfLeaves
TObjArray * GetListOfLeaves()
Definition: TBranch.h:243
TBranch::GetTree
TTree * GetTree() const
Definition: TBranch.h:248
TBranchClones::fClassName
TString fClassName
name of the class of the objets in the ClonesArray
Definition: TBranchClones.h:36
TBranch::fMother
TBranch * fMother
! Pointer to top-level parent branch in the tree.
Definition: TBranch.h:141
TClonesArray
Definition: TClonesArray.h:29
TBranch::fSplitLevel
Int_t fSplitLevel
Branch split level.
Definition: TBranch.h:123
TBasket.h
TBranch::SetBasketSize
virtual void SetBasketSize(Int_t buffsize)
Set the basket size The function makes sure that the basket size is greater than fEntryOffsetlen.
Definition: TBranch.cxx:2561
TBranch::fEntryNumber
Long64_t fEntryNumber
Current entry number (last one filled in this branch)
Definition: TBranch.h:117
int
TClonesArray::ExpandCreateFast
virtual void ExpandCreateFast(Int_t n)
Expand or shrink the array to n elements and create the clone objects by calling their default ctor.
Definition: TClonesArray.cxx:546
TBranch::TBranch
TBranch()
Default constructor. Used for I/O by default.
Definition: TBranch.cxx:86
TClonesArray::Clear
virtual void Clear(Option_t *option="")
Clear the clones array.
Definition: TClonesArray.cxx:409