Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TBranchClones.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/tree
0002 // Author: Rene Brun   11/02/96
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TBranchClones
0013 #define ROOT_TBranchClones
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TBranchClones                                                        //
0019 //                                                                      //
0020 // A Branch for the case of an array of clone objects.                  //
0021 //////////////////////////////////////////////////////////////////////////
0022 
0023 
0024 #include "TBranch.h"
0025 
0026 class TClonesArray;
0027 class TTreeCloner;
0028 
0029 class TBranchClones : public TBranch {
0030 
0031 protected:
0032    TClonesArray     *fList;           ///<! Pointer to the clonesarray
0033    Int_t            fRead;            ///<! flag = 1 if clonesarray has been read
0034    Int_t            fN;               ///<! Number of elements in ClonesArray
0035    Int_t            fNdataMax;        ///<! Maximum value of fN
0036    TString          fClassName;       ///<  Name of the class of the objets in the ClonesArray
0037    TBranch          *fBranchCount;    ///<  Branch with clones count
0038 
0039    friend class TTreeCloner;
0040 
0041    void Init(TTree *tree, TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
0042    Int_t   FillImpl(ROOT::Internal::TBranchIMTHelper *) override;
0043 
0044 public:
0045    TBranchClones();
0046    TBranchClones(TTree *tree, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
0047    TBranchClones(TBranch *parent, const char *name, void *clonesaddress, Int_t basketsize=32000,Int_t compress=-1, Int_t splitlevel=1);
0048    ~TBranchClones() override;
0049 
0050    void    Browse(TBrowser *b) override;
0051    const char* GetClassName() const override { return fClassName; }
0052    Int_t   GetEntry(Long64_t entry=0, Int_t getall = 0) override;
0053    virtual Int_t   GetN() const {return fN;}
0054    TClonesArray    *GetList() const {return fList;}
0055    bool            IsFolder() const override {return true;}
0056    void    Print(Option_t *option="") const override;
0057    void    Reset(Option_t *option="") override;
0058    void    ResetAfterMerge(TFileMergeInfo *) override;
0059    void    SetAddress(void *add) override;
0060    void    SetBasketSize(Int_t buffsize) override;
0061    void    SetTree(TTree *tree) override { fTree = tree; fBranchCount->SetTree(tree); }
0062    void    UpdateFile() override;
0063 
0064 private:
0065 
0066    ClassDefOverride(TBranchClones,2);  //Branch in case of an array of clone objects
0067 };
0068 
0069 #endif