Access Data from TBranch of the same name

Dear Rooters,

Hope you could be helpful for the following issue we have in extracting data from a root file produce by a specific acquisition card.

We are trying to access the data by apply the standard : tree->MakeClass(“MyClass”), which returns the following error
Output of Make Class:

root -l 002_152eu_strong_0001.root
root [0]
Attaching file 002_152eu_strong_0001.root as _file0…
Warning in TClass::Init: no dictionary for class F_ADC is available
Warning in TClass::Init: no dictionary for class F_Data is available
Warning in TClass::Init: no dictionary for class F_ADC_Cnt is available
(TFile *) 0x7fb3504ae490
root [1] AutoRoot->MakeClass(“MyClass”)
Error in TTreePlayer::MakeClass: The branch named fUniqueID (full path name: ADC_2.fUniqueID) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fBits (full path name: ADC_2.fBits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fName (full path name: ADC_2.fName) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fTitle (full path name: ADC_2.fTitle) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named hits (full path name: ADC_2.hits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named t_ps (full path name: ADC_2.t_ps) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named group (full path name: ADC_2.group) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named label (full path name: ADC_2.label) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named measure (full path name: ADC_2.measure) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named saturated (full path name: ADC_2.saturated) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named pileup (full path name: ADC_2.pileup) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named delta_ns (full path name: ADC_2.delta_ns) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fUniqueID (full path name: ADC_COUNTER_1001.fUniqueID) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fBits (full path name: ADC_COUNTER_1001.fBits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fName (full path name: ADC_COUNTER_1001.fName) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fTitle (full path name: ADC_COUNTER_1001.fTitle) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named hits (full path name: ADC_COUNTER_1001.hits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named t_ps (full path name: ADC_COUNTER_1001.t_ps) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named group (full path name: ADC_COUNTER_1001.group) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named label (full path name: ADC_COUNTER_1001.label) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fUniqueID (full path name: ADC_COUNTER_1002.fUniqueID) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fBits (full path name: ADC_COUNTER_1002.fBits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fName (full path name: ADC_COUNTER_1002.fName) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fTitle (full path name: ADC_COUNTER_1002.fTitle) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named hits (full path name: ADC_COUNTER_1002.hits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named t_ps (full path name: ADC_COUNTER_1002.t_ps) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named group (full path name: ADC_COUNTER_1002.group) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named label (full path name: ADC_COUNTER_1002.label) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named calc (full path name: ADC_COUNTER_1002.calc) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named sent (full path name: ADC_COUNTER_1002.sent) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named trig (full path name: ADC_COUNTER_1002.trig) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fUniqueID (full path name: ADC_COUNTER_1003.fUniqueID) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fBits (full path name: ADC_COUNTER_1003.fBits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fName (full path name: ADC_COUNTER_1003.fName) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named fTitle (full path name: ADC_COUNTER_1003.fTitle) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named hits (full path name: ADC_COUNTER_1003.hits) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named t_ps (full path name: ADC_COUNTER_1003.t_ps) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named group (full path name: ADC_COUNTER_1003.group) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named label (full path name: ADC_COUNTER_1003.label) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named calc (full path name: ADC_COUNTER_1003.calc) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named sent (full path name: ADC_COUNTER_1003.sent) is hidden by another branch of the same name and its data will not be loaded.
Error in TTreePlayer::MakeClass: The branch named trig (full path name: ADC_COUNTER_1003.trig) is hidden by another branch of the same name and its data will not be loaded.
Info in TTreePlayer::MakeClass: Files: MyClass.h and MyClass.C generated from TTree: AutoRoot
(int) 0

Despite this warning, one tried to modify the files MyClass.C and MyClass.h (in our case called TChris.C TChris.C (1.6 KB) and TChris.hTChris.h (14.1 KB) ).

fChain->SetBranchAddress(“ADC_1.measure”, &ADC1_measure, &b_ADC_1_measure);

But while creating a MyClass variable it returns the following error:

root [0] .L TChris.C
root [1] TChris t
Warning in TClass::Init: no dictionary for class F_ADC is available
Warning in TClass::Init: no dictionary for class F_Data is available
Warning in TClass::Init: no dictionary for class F_ADC_Cnt is available
Error in TTree::SetBranchAddress: unknown branch → ADC_1.measure
Error in TTree::SetBranchAddress: unknown branch → ADC_2.measure
(TChris &) @0x104025eb0

Original Tree structure:
(1)

(2)

root [2] AutoRoot->Print()


*Tree :AutoRoot : AutoRoot from 002_152eu_strong_0001.fast *
*Entries : 20494084 : Total = 7993463782 bytes File Size = 733244531 *

  •    :          : Tree compression factor =  10.90                       *
    

*Branch :ADC_1 *
*Entries : 20494084 : BranchElement (see below) *

*Br 0 :fUniqueID : UInt_t *
*Entries : 20494084 : Total Size= 81984261 bytes File Size = 366001 *
*Baskets : 76 : Basket Size= 3248640 bytes Compression= 224.00 *

*Br 1 :fBits : UInt_t *
*Entries : 20494084 : Total Size= 163973885 bytes File Size = 24874735 *
*Baskets : 201 : Basket Size= 6501888 bytes Compression= 6.59 *

*Br 2 :fName : TString *
*Entries : 20494084 : Total Size= 204964653 bytes File Size = 27995677 *
*Baskets : 226 : Basket Size= 8125952 bytes Compression= 7.32 *

*Br 3 :fTitle : TString *
*Entries : 20494084 : Total Size= 204964883 bytes File Size = 28047796 *
*Baskets : 226 : Basket Size= 8126464 bytes Compression= 7.31 *

*Br 4 :hits : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 8754687 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 9.36 *

*Br 5 :t_ps : Long64_t *
*Entries : 20494084 : Total Size= 163965042 bytes File Size = 64082445 *
*Baskets : 127 : Basket Size= 6496768 bytes Compression= 2.56 *

*Br 6 :group : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 365696 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.18 *

*Br 7 :label : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 405696 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 202.08 *

*Br 8 :measure : Int_t *
*Entries : 20494084 : Total Size= 81984101 bytes File Size = 33531785 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 2.44 *

*Br 9 :saturated : Bool_t *
*Entries : 20494084 : Total Size= 20498209 bytes File Size = 116433 *
*Baskets : 38 : Basket Size= 812032 bytes Compression= 176.04 *

*Br 10 :pileup : Bool_t *
*Entries : 20494084 : Total Size= 20498083 bytes File Size = 2578165 *
*Baskets : 38 : Basket Size= 812032 bytes Compression= 7.95 *

*Br 11 :delta_ns : Double_t *
*Entries : 20494084 : Total Size= 163965566 bytes File Size = 29634350 *
*Baskets : 127 : Basket Size= 6497280 bytes Compression= 5.53 *

*Branch :ADC_2 *
*Entries : 20494084 : BranchElement (see below) *

*Br 12 :fUniqueID : UInt_t *
*Entries : 20494084 : Total Size= 81984261 bytes File Size = 366001 *
*Baskets : 76 : Basket Size= 3248640 bytes Compression= 224.00 *

*Br 13 :fBits : UInt_t *
*Entries : 20494084 : Total Size= 163973885 bytes File Size = 24874735 *
*Baskets : 201 : Basket Size= 6501888 bytes Compression= 6.59 *

*Br 14 :fName : TString *
*Entries : 20494084 : Total Size= 204964653 bytes File Size = 27995476 *
*Baskets : 226 : Basket Size= 8125952 bytes Compression= 7.32 *

*Br 15 :fTitle : TString *
*Entries : 20494084 : Total Size= 204964883 bytes File Size = 28048044 *
*Baskets : 226 : Basket Size= 8126464 bytes Compression= 7.31 *

*Br 16 :hits : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 8761743 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 9.36 *

*Br 17 :t_ps : Long64_t *
*Entries : 20494084 : Total Size= 163965042 bytes File Size = 64561776 *
*Baskets : 127 : Basket Size= 6496768 bytes Compression= 2.54 *

*Br 18 :group : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 365696 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.18 *

*Br 19 :label : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 405720 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 202.07 *

*Br 20 :measure : Int_t *
*Entries : 20494084 : Total Size= 81984101 bytes File Size = 33293832 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 2.46 *

*Br 21 :saturated : Bool_t *
*Entries : 20494084 : Total Size= 20498209 bytes File Size = 93616 *
*Baskets : 38 : Basket Size= 812032 bytes Compression= 218.95 *

*Br 22 :pileup : Bool_t *
*Entries : 20494084 : Total Size= 20498083 bytes File Size = 2256487 *
*Baskets : 38 : Basket Size= 812032 bytes Compression= 9.08 *

*Br 23 :delta_ns : Double_t *
*Entries : 20494084 : Total Size= 163965566 bytes File Size = 30844173 *
*Baskets : 127 : Basket Size= 6497280 bytes Compression= 5.32 *

*Branch :ADC_COUNTER_1001 *
*Entries : 20494084 : BranchElement (see below) *

*Br 24 :fUniqueID : UInt_t *
*Entries : 20494084 : Total Size= 81984261 bytes File Size = 366001 *
*Baskets : 76 : Basket Size= 3248640 bytes Compression= 224.00 *

*Br 25 :fBits : UInt_t *
*Entries : 20494084 : Total Size= 163973885 bytes File Size = 24874735 *
*Baskets : 201 : Basket Size= 6501888 bytes Compression= 6.59 *

*Br 26 :fName : TString *
*Entries : 20494084 : Total Size= 430411537 bytes File Size = 34272508 *
*Baskets : 341 : Basket Size= 20439616 bytes Compression= 12.56 *

*Br 27 :fTitle : TString *
*Entries : 20494084 : Total Size= 430411882 bytes File Size = 34273516 *
*Baskets : 341 : Basket Size= 20439616 bytes Compression= 12.56 *

*Br 28 :hits : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 381189 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 215.07 *

*Br 29 :t_ps : Long64_t *
*Entries : 20494084 : Total Size= 163965042 bytes File Size = 768999 *
*Baskets : 127 : Basket Size= 6496768 bytes Compression= 213.22 *

*Br 30 :group : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 365696 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.18 *

*Br 31 :label : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 405872 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 201.99 *

*Br 32 :calc : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 390202 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 210.10 *

*Br 33 :sent : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 390183 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 210.11 *

*Br 34 :trig : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 390237 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 210.08 *

*Branch :ADC_COUNTER_1002 *
*Entries : 20494084 : BranchElement (see below) *

*Br 35 :fUniqueID : UInt_t *
*Entries : 20494084 : Total Size= 81984261 bytes File Size = 366001 *
*Baskets : 76 : Basket Size= 3248640 bytes Compression= 224.00 *

*Br 36 :fBits : UInt_t *
*Entries : 20494084 : Total Size= 163973885 bytes File Size = 24874735 *
*Baskets : 201 : Basket Size= 6501888 bytes Compression= 6.59 *

*Br 37 :fName : TString *
*Entries : 20494084 : Total Size= 430411537 bytes File Size = 34272508 *
*Baskets : 341 : Basket Size= 20439616 bytes Compression= 12.56 *

*Br 38 :fTitle : TString *
*Entries : 20494084 : Total Size= 430411882 bytes File Size = 34273516 *
*Baskets : 341 : Basket Size= 20439616 bytes Compression= 12.56 *

*Br 39 :hits : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 381202 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 215.06 *

*Br 40 :t_ps : Long64_t *
*Entries : 20494084 : Total Size= 163965042 bytes File Size = 768962 *
*Baskets : 127 : Basket Size= 6496768 bytes Compression= 213.23 *

*Br 41 :group : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 365696 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.18 *

*Br 42 :label : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 405872 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 201.99 *

*Br 43 :calc : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 390132 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 210.14 *

*Br 44 :sent : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 390129 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 210.14 *

*Br 45 :trig : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 390238 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 210.08 *

*Branch :ADC_COUNTER_1003 *
*Entries : 20494084 : BranchElement (see below) *

*Br 46 :fUniqueID : UInt_t *
*Entries : 20494084 : Total Size= 81984261 bytes File Size = 366001 *
*Baskets : 76 : Basket Size= 3248640 bytes Compression= 224.00 *

*Br 47 :fBits : UInt_t *
*Entries : 20494084 : Total Size= 163973885 bytes File Size = 24874735 *
*Baskets : 201 : Basket Size= 6501888 bytes Compression= 6.59 *

*Br 48 :fName : TString *
*Entries : 20494084 : Total Size= 430411537 bytes File Size = 34272508 *
*Baskets : 341 : Basket Size= 20439616 bytes Compression= 12.56 *

*Br 49 :fTitle : TString *
*Entries : 20494084 : Total Size= 430411882 bytes File Size = 34273516 *
*Baskets : 341 : Basket Size= 20439616 bytes Compression= 12.56 *

*Br 50 :hits : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 381181 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 215.07 *

*Br 51 :t_ps : Long64_t *
*Entries : 20494084 : Total Size= 163965042 bytes File Size = 768947 *
*Baskets : 127 : Basket Size= 6496768 bytes Compression= 213.23 *

*Br 52 :group : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 365696 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.18 *

*Br 53 :label : Int_t *
*Entries : 20494084 : Total Size= 81983941 bytes File Size = 405872 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 201.99 *

*Br 54 :calc : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 365617 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.23 *

*Br 55 :sent : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 365617 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.23 *

*Br 56 :trig : Int_t *
*Entries : 20494084 : Total Size= 81983861 bytes File Size = 365617 *
*Baskets : 76 : Basket Size= 3248128 bytes Compression= 224.23 *

We are quite clueless on how to access the data, even if the Draw function works as :

AutoRoot->Draw(“ADC_1.measure”)

Here you can find the original root file CERNBox

Thank you in advances :slight_smile:


ROOT Version: root6.16.0
_Platform:_Macosx
_Compiler:_gcc/clang


I think the best idea would be to modify the procedure which creates this tree.
Actually, it would be sufficient to slightly modify the way its branches are defined … something like this:

// note the trailing "." character in all (top-level) branch names
AutoRoot->Branch("ADC_1.", ...);
AutoRoot->Branch("ADC_2.", ...);
AutoRoot->Branch("ADC_COUNTER_1001.", ...);
AutoRoot->Branch("ADC_COUNTER_1002.", ...);
AutoRoot->Branch("ADC_COUNTER_1003.", ...);

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.