ROOT  6.06/09
Reference Guide
TBranchClones.h
Go to the documentation of this file.
1 // @(#)root/tree
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 #ifndef ROOT_TBranchClones
13 #define ROOT_TBranchClones
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TBranchClones //
19 // //
20 // A Branch for the case of an array of clone objects. //
21 //////////////////////////////////////////////////////////////////////////
22 
23 
24 #ifndef ROOT_TBranch
25 #include "TBranch.h"
26 #endif
27 
28 class TClonesArray;
29 class TTreeCloner;
30 
31 class TBranchClones : public TBranch {
32 
33 protected:
34  TClonesArray *fList; //!Pointer to the clonesarray
35  Int_t fRead; //!flag = 1 if clonesarray has been read
36  Int_t fN; //!Number of elements in ClonesArray
37  Int_t fNdataMax; //!Maximum value of fN
38  TString fClassName; //name of the class of the objets in the ClonesArray
39  TBranch *fBranchCount; //Branch with clones count
40 
41  friend class TTreeCloner;
42 
43  void Init(TTree *tree, TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
44 
45 public:
46  TBranchClones();
47  TBranchClones(TTree *tree, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
48  TBranchClones(TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
49  virtual ~TBranchClones();
50 
51  virtual void Browse(TBrowser *b);
52  virtual Int_t Fill();
53  virtual const char* GetClassName() const { return fClassName; }
54  virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
55  virtual Int_t GetN() const {return fN;}
56  TClonesArray *GetList() const {return fList;}
57  Bool_t IsFolder() const {return kTRUE;}
58  virtual void Print(Option_t *option="") const;
59  virtual void Reset(Option_t *option="");
60  virtual void ResetAfterMerge(TFileMergeInfo *);
61  virtual void SetAddress(void *add);
62  virtual void SetBasketSize(Int_t buffsize);
63  virtual void SetTree(TTree *tree) { fTree = tree; fBranchCount->SetTree(tree); }
64  virtual void UpdateFile();
65 
66  ClassDef(TBranchClones,2); //Branch in case of an array of clone objects
67 };
68 
69 #endif
virtual Int_t Fill()
Loop on all branches and fill Basket buffer.
virtual void SetAddress(void *add)
Set address of this branch.
long long Long64_t
Definition: RtypesCore.h:69
TString fClassName
Maximum value of fN.
Definition: TBranchClones.h:38
const char Option_t
Definition: RtypesCore.h:62
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all branches and return total number of bytes read.
virtual Int_t GetN() const
Definition: TBranchClones.h:55
Int_t fRead
Pointer to the clonesarray.
Definition: TBranchClones.h:35
Basic string class.
Definition: TString.h:137
TBranch * fBranchCount
Definition: TBranchClones.h:39
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~TBranchClones()
Destructor.
ClassDef(TBranchClones, 2)
virtual void SetTree(TTree *tree)
Definition: TBranch.h:215
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
TClonesArray * GetList() const
Definition: TBranchClones.h:56
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:41
virtual void SetBasketSize(Int_t buffsize)
Reset basket size for all sub-branches.
virtual void Print(Option_t *option="") const
Print branch parameters.
Long64_t entry
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).
virtual void SetTree(TTree *tree)
Definition: TBranchClones.h:63
TTree * fTree
Definition: TBranch.h:94
virtual void Reset(Option_t *option="")
Reset branch.
#define name(a, b)
Definition: linkTestLib0.cpp:5
An array of clone (identical) objects.
Definition: TClonesArray.h:32
Class implementing or helping the various TTree cloning method.
Definition: TTreeCloner.h:40
A Branch for the case of an array of clone objects.
Definition: TBranchClones.h:31
TClonesArray * fList
Definition: TBranchClones.h:34
virtual void Browse(TBrowser *b)
Browse this branch.
A TTree object has a header with a name and a title.
Definition: TTree.h:94
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
Definition: TBranchClones.h:57
Int_t fN
flag = 1 if clonesarray has been read
Definition: TBranchClones.h:36
A TTree is a list of TBranches.
Definition: TBranch.h:58
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset branch after a merge.
Int_t fNdataMax
Number of elements in ClonesArray.
Definition: TBranchClones.h:37
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any. ...
Definition: TBranchClones.h:53