Dear Rooters,
again first of all thanks for support I have received so far via this list.
I have a maybe stupid questions to the functionality of the method Fill() in class TBranch and
its relation to TTree objects.
In my analysis code I have the following lines
event1 = new myEvent();
event2 = new myEvent();
t_tree->Branch("TBecal02_ecalSD.", "myEvent", event1, 8000,3);
t_tree->Branch("TBhcal02_hcalSD.", "myEvent", event1, 8000,3);
… and later on
t_tree->GetBranch(" TBecal02_ecalSD." )->Fill();
t_tree->GetBranch(" TBhcal02_hcalSD." )->Fill();
i.e. I fill the branches of the tree which seems to work fine.
When I print the resulting TTree I get the following:
*Tree :T : ROOT *
*Entries : 0 : Total = 403904 bytes File Size = 14567 *
-
: : Tree compression factor = 49.95 *
*Branch :TBecal02_ecalSD. *
*Entries : 6 : BranchElement (see below) *
…
*Br 0 :TBecal02_ecalSD.TObject.fUniqueID : *
*Entries : 6 : Total Size= 12596 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 1 :TBecal02_ecalSD.TObject.fBits : *
*Entries : 6 : Total Size= 12572 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 2 :TBecal02_ecalSD.fNCells : *
*Entries : 6 : Total Size= 12536 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 3 :TBecal02_ecalSD.fEvtHdr : *
*Entries : 6 : Total Size= 50277 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 4 :TBecal02_ecalSD.fEvtHdr.fEvtNum : *
*Entries : 6 : Total Size= 12584 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 5 :TBecal02_ecalSD.fEvtHdr.fRun : *
*Entries : 6 : Total Size= 12566 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 6 :TBecal02_ecalSD.fEvtHdr.fDate : *
*Entries : 6 : Total Size= 12572 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 7 :TBecal02_ecalSD.fCells : TBecal02_ecalSD.fCells_ *
*Entries : 6 : Total Size= 91055 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 8 :TBecal02_ecalSD.fCells.fUniqueID : *
-
| fUniqueID[TBecal02_ecalSD.fCells_] *
*Entries : 6 : Total Size= 17888 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 9 :TBecal02_ecalSD.fCells.fBits : fBits[TBecal02_ecalSD.fCells_] *
*Entries : 6 : Total Size= 20548 bytes File Size = 158 *
*Baskets : 1 : Basket Size= 8000 bytes Compression= 49.95 *
…
*Br 10 :TBecal02_ecalSD.fCells.CellId : CellId[TBecal02_ecalSD.fCells_] *
*Entries : 6 : Total Size= 17870 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 11 :TBecal02_ecalSD.fCells.fEnergy : fEnergy[TBecal02_ecalSD.fCells_] *
*Entries : 6 : Total Size= 17876 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 12 :TBecal02_ecalSD.fLastCell : *
*Entries : 6 : Total Size= 12624 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Branch :TBhcal02_hcalSD. *
*Entries : 6 : BranchElement (see below)
…
*Br 13 :TBhcal02_hcalSD.TObject.fUniqueID : *
*Entries : 6 : Total Size= 12596 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 14 :TBhcal02_hcalSD.TObject.fBits : *
*Entries : 6 : Total Size= 12572 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 15 :TBhcal02_hcalSD.fNCells : *
*Entries : 6 : Total Size= 12536 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 16 :TBhcal02_hcalSD.fEvtHdr : *
*Entries : 6 : Total Size= 50277 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 17 :TBhcal02_hcalSD.fEvtHdr.fEvtNum : *
*Entries : 6 : Total Size= 12584 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 18 :TBhcal02_hcalSD.fEvtHdr.fRun : *
*Entries : 6 : Total Size= 12566 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 19 :TBhcal02_hcalSD.fEvtHdr.fDate : *
*Entries : 6 : Total Size= 12572 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 20 :TBhcal02_hcalSD.fCells : TBhcal02_hcalSD.fCells_ *
*Entries : 6 : Total Size= 77741 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 21 :TBhcal02_hcalSD.fCells.fUniqueID : *
-
| fUniqueID[TBhcal02_hcalSD.fCells_] *
*Entries : 6 : Total Size= 13196 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 22 :TBhcal02_hcalSD.fCells.fBits : fBits[TBhcal02_hcalSD.fCells_] *
*Entries : 6 : Total Size= 13418 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 23 :TBhcal02_hcalSD.fCells.CellId : CellId[TBhcal02_hcalSD.fCells_] *
*Entries : 6 : Total Size= 13178 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 24 :TBhcal02_hcalSD.fCells.fEnergy : fEnergy[TBhcal02_hcalSD.fCells_] *
*Entries : 6 : Total Size= 13184 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
*Br 25 :TBhcal02_hcalSD.fLastCell : *
*Entries : 6 : Total Size= 12624 bytes One basket in memory *
*Baskets : 0 : Basket Size= 8000 bytes Compression= 1.00 *
…
You see that the branches of the tree have well 6 entries (as foreseen) whiile the number
of entries in the tree is 0. Why does this happen. I would have expected that the number
of entries in the tree is somehow composed by the number of entries in the various branches.
I would be grateful for an answer.
Cheers,
Roman
P.S.: Of course I can fill the tree with a simple t_tree->Fill() but I am curious why my
attempt does not work.