# Duplicate Trees With Different Number of Entries

**URL:** <https://root-forum.cern.ch/t/duplicate-trees-with-different-number-of-entries/15687>\
**Category:** ROOT\
**Created:** [February 21, 2013, 4:31pm UTC](https://root-forum.cern.ch/t/duplicate-trees-with-different-number-of-entries/15687 "2013-02-21T16:31:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwright](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/e47c2d/32.png) [@mwright](https://root-forum.cern.ch/u/mwright)\
**Post date:** [February 21, 2013, 4:31pm UTC](https://root-forum.cern.ch/t/duplicate-trees-with-different-number-of-entries/15687/1 "2013-02-21T16:31:03Z")

</div>

Hi,

I have noticed that I have duplicate trees in my root file with different number of entries.

TFile\*\* PARTI\_Package/PARTI\_Package/trunk/Analysis/OutputFiles/MC12\_8TeV\_ZH120\_llbb\_161826\_NONE\_FlatTuple\_AtlasHbbTuple.root   
TFile\* PARTI\_Package/PARTI\_Package/trunk/Analysis/OutputFiles/MC12\_8TeV\_ZH120\_llbb\_161826\_NONE\_FlatTuple\_AtlasHbbTuple.root   
OBJ: TTree physics physics : 0 at: 0xa17f860  
KEY: TTree GlobalTree;2 GlobalTree  
KEY: TTree GlobalTree;1 GlobalTree  
KEY: TTree globalCutflow;5 globalCutflow  
KEY: TTree globalCutflow;4 globalCutflow  
KEY: TTree physics;4 physics  
KEY: TTree physics;3 physics

The larger of the two numbers being the expected number of entries. How does this happen and is it a problem when I use TChain, the hadd macro, etc? Basically are there any pit falls and how do I avoid duplicate trees?

I should add I am using root version 5.30.05 and when writing the TFile I only call the Write method associated with TFile and not the TTree class, as I know this can cause the tree to be copied.

Cheers,

Mike

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [February 21, 2013, 5:29pm UTC](https://root-forum.cern.ch/t/duplicate-trees-with-different-number-of-entries/15687/2 "2013-02-21T17:29:30Z")

</div>

[url][Aux;1 aux;2 aux3;](https://root-forum.cern.ch/t/aux-1-aux-2-aux3/13345/1)
