Logo ROOT  
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 #include "TBranch.h"
25 
26 class TClonesArray;
27 class TTreeCloner;
28 
29 class TBranchClones : public TBranch {
30 
31 protected:
32  TClonesArray *fList; ///<! Pointer to the clonesarray
33  Int_t fRead; ///<! flag = 1 if clonesarray has been read
34  Int_t fN; ///<! Number of elements in ClonesArray
35  Int_t fNdataMax; ///<! Maximum value of fN
36  TString fClassName; ///< name of the class of the objets in the ClonesArray
37  TBranch *fBranchCount; ///< Branch with clones count
38 
39  friend class TTreeCloner;
40 
41  void Init(TTree *tree, TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
43 
44 public:
45  TBranchClones();
46  TBranchClones(TTree *tree, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
47  TBranchClones(TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
48  virtual ~TBranchClones();
49 
50  virtual void Browse(TBrowser *b);
51  virtual const char* GetClassName() const { return fClassName; }
52  virtual Int_t GetEntry(Long64_t entry=0, Int_t getall = 0);
53  virtual Int_t GetN() const {return fN;}
54  TClonesArray *GetList() const {return fList;}
55  Bool_t IsFolder() const {return kTRUE;}
56  virtual void Print(Option_t *option="") const;
57  virtual void Reset(Option_t *option="");
58  virtual void ResetAfterMerge(TFileMergeInfo *);
59  virtual void SetAddress(void *add);
60  virtual void SetBasketSize(Int_t buffsize);
61  virtual void SetTree(TTree *tree) { fTree = tree; fBranchCount->SetTree(tree); }
62  virtual void UpdateFile();
63 
64 private:
65 
66  ClassDef(TBranchClones,2); //Branch in case of an array of clone objects
67 };
68 
69 #endif
TFileMergeInfo
Definition: TFileMergeInfo.h:42
TBranchClones::GetN
virtual Int_t GetN() const
Definition: TBranchClones.h:53
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
TBranchClones::FillImpl
virtual Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *)
Loop on all branches and fill Basket buffer.
Definition: TBranchClones.cxx:225
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
tree
Definition: tree.py:1
TBranch.h
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TTree
Definition: TTree.h:79
Int_t
int Int_t
Definition: RtypesCore.h:45
TBranchClones::ResetAfterMerge
virtual void ResetAfterMerge(TFileMergeInfo *)
Reset branch after a merge.
Definition: TBranchClones.cxx:338
TBranchClones::Browse
virtual void Browse(TBrowser *b)
Browse this branch.
Definition: TBranchClones.cxx:217
TBranchClones::~TBranchClones
virtual ~TBranchClones()
Destructor.
Definition: TBranchClones.cxx:205
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
bool
TBranchClones::IsFolder
Bool_t IsFolder() const
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
Definition: TBranchClones.h:55
TBranchClones::SetTree
virtual void SetTree(TTree *tree)
Definition: TBranchClones.h:61
TBranchClones::SetAddress
virtual void SetAddress(void *add)
Set address of this branch.
Definition: TBranchClones.cxx:354
TBranch
Definition: TBranch.h:89
TBranchClones::UpdateFile
virtual void UpdateFile()
Refresh the value of fDirectory (i.e.
Definition: TBranchClones.cxx:475
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TBranchClones::TBranchClones
TBranchClones()
Default and i/o constructor.
Definition: TBranchClones.cxx:40
TBranchClones::GetClassName
virtual const char * GetClassName() const
Return the name of the user class whose content is stored in this branch, if any.
Definition: TBranchClones.h:51
TBranchClones::fRead
Int_t fRead
! flag = 1 if clonesarray has been read
Definition: TBranchClones.h:33
TBranch::fTree
TTree * fTree
! Pointer to Tree header
Definition: TBranch.h:140
TBranchClones
Definition: TBranchClones.h:29
TTreeCloner
Definition: TTreeCloner.h:29
TBranchClones::SetBasketSize
virtual void SetBasketSize(Int_t buffsize)
Reset basket size for all sub-branches.
Definition: TBranchClones.cxx:373
TBranch::SetTree
virtual void SetTree(TTree *tree)
Definition: TBranch.h:283
TBranchClones::fList
TClonesArray * fList
! Pointer to the clonesarray
Definition: TBranchClones.h:32
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
TBranchClones::Reset
virtual void Reset(Option_t *option="")
Reset branch.
Definition: TBranchClones.cxx:319
ROOT::Internal::TBranchIMTHelper
Definition: TBranchIMTHelper.h:38
TBranchClones::GetList
TClonesArray * GetList() const
Definition: TBranchClones.h:54
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TBranchClones::Print
virtual void Print(Option_t *option="") const
Print branch parameters.
Definition: TBranchClones.cxx:303
TBranchClones::fClassName
TString fClassName
name of the class of the objets in the ClonesArray
Definition: TBranchClones.h:36
TClonesArray
Definition: TClonesArray.h:29
int