Hi,
I’m not sure if this topic is an old one, however I did not find a similar one.
My problem is that I have a root file containing two TTree-objects with the same key-name. To be clear I only created one TTree and the file somehow wrote two into my root-file. (My foregoing algorithm opens the TFile with the option ‘recreate’, so it should not include the TTree from a previous run…)
root [1] _file0->ls()
TFile** DATA_Xib2LK_12aLL_MagDown.root
TFile* DATA_Xib2LK_12aLL_MagDown.root
KEY: TTree DATA_Xib2LK_12aLL_MagDown;4 DATA_Xib2LK_12aLL_MagDown
KEY: TTree DATA_Xib2LK_12aLL_MagDown;3 DATA_Xib2LK_12aLL_MagDown
root [2] TTree* tree = (TTree*)_file0->Get("DATA_Xib2LK_12aLL_MagDown")
(TTree *) 0x34961f0
root [3] tree->GetEntries()
(Long64_t) 933494
In the TBrowser I can access and draw the key;4 and key;3. They have a different amount of entries:
Entries key;4 -> 933494
Entries key;3 -> 717840
So my question is, if the TTree is corrupted and has not been created incorrectly in the fist place, if accessing only the TTree with key;4 already includes the key;3 or if I have to access this in another way.
Cheers
Harald