Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/tree
2// Author: Rene Brun 11/02/96
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 *************************************************************************/
12#ifndef ROOT_TBranchClones
13#define ROOT_TBranchClones
17// //
18// TBranchClones //
19// //
20// A Branch for the case of an array of clone objects. //
24#include "TBranch.h"
26class TClonesArray;
27class TTreeCloner;
29class TBranchClones : public TBranch {
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
39 friend class TTreeCloner;
41 void Init(TTree *tree, TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
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 ~TBranchClones() override;
50 void Browse(TBrowser *b) override;
51 const char* GetClassName() const override { return fClassName; }
52 Int_t GetEntry(Long64_t entry=0, Int_t getall = 0) override;
53 virtual Int_t GetN() const {return fN;}
54 TClonesArray *GetList() const {return fList;}
55 Bool_t IsFolder() const override {return kTRUE;}
56 void Print(Option_t *option="") const override;
57 void Reset(Option_t *option="") override;
58 void ResetAfterMerge(TFileMergeInfo *) override;
59 void SetAddress(void *add) override;
60 void SetBasketSize(Int_t buffsize) override;
61 void SetTree(TTree *tree) override { fTree = tree; fBranchCount->SetTree(tree); }
62 void UpdateFile() override;
66 ClassDefOverride(TBranchClones,2); //Branch in case of an array of clone objects
#define b(i)
Definition RSha256.hxx:100
int Int_t
Definition RtypesCore.h:45
long long Long64_t
Definition RtypesCore.h:80
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
char name[80]
Definition TGX11.cxx:110
A helper class for managing IMT work during TTree:Fill operations.
A Branch for the case of an array of clone objects.
TClonesArray * fList
! Pointer to the clonesarray
void UpdateFile() override
Refresh the value of fDirectory (i.e.
TBranch * fBranchCount
Branch with clones count.
Int_t FillImpl(ROOT::Internal::TBranchIMTHelper *) override
Loop on all branches and fill Basket buffer.
void SetAddress(void *add) override
Set address of this branch.
void Browse(TBrowser *b) override
Browse this branch.
Int_t fN
! Number of elements in ClonesArray
void Reset(Option_t *option="") override
Reset branch.
const char * GetClassName() const override
Return the name of the user class whose content is stored in this branch, if any.
Bool_t IsFolder() const override
Return kTRUE if more than one leaf or browsables, kFALSE otherwise.
void Print(Option_t *option="") const override
Print branch parameters.
Int_t fRead
! flag = 1 if clonesarray has been read
TString fClassName
Name of the class of the objets in the ClonesArray.
void SetBasketSize(Int_t buffsize) override
Reset basket size for all sub-branches.
virtual Int_t GetN() const
Default and i/o constructor.
void ResetAfterMerge(TFileMergeInfo *) override
Reset branch after a merge.
~TBranchClones() override
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
Read all branches and return total number of bytes read.
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).
TClonesArray * GetList() const
Int_t fNdataMax
! Maximum value of fN
void SetTree(TTree *tree) override
A TTree is a list of TBranches.
Definition TBranch.h:93
virtual void SetTree(TTree *tree)
Definition TBranch.h:287
TTree * fTree
! Pointer to Tree header
Definition TBranch.h:144
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
An array of clone (identical) objects.
Basic string class.
Definition TString.h:139
Class implementing or helping the various TTree cloning method.
Definition TTreeCloner.h:31
A TTree represents a columnar dataset.
Definition TTree.h:79
Definition tree.py:1