How to make variable basket size in a tree branch

Hi,

I have a tree with different branches having basket size 1. I want to create them with a basket size of 21. I donot know what is the command to do it.

Kindly help me to do this.

Cheers,
Nab

Post here the output of:
your_tree->Print();

I am running a script new_macro.cc it generates a .root ouput1_ajeeb_Veto.root. I want to make VetoMu/I having a basket number 21 while rest of all like VetoMu_pt[VetoMu]/F having a basket number 45.
I am printing the output below along with the script.

new_macro.cc (9.6 KB)

*Tree :AnaTree : an example tree *
*Entries : 701 : Total = 37819 bytes File Size = 2482 *

  •    :          : Tree compression factor =  21.84                       *
    

*Br 0 :VetoMu : VetoMu/I *
*Entries : 701 : Total Size= 3358 bytes File Size = 120 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 24.00 *

*Br 1 :VetoMu_py : VetoMu_py[VetoMu]/F *
*Entries : 701 : Total Size= 3476 bytes File Size = 132 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.90 *

*Br 2 :VetoMu_pz : VetoMu_pz[VetoMu]/F *
*Entries : 701 : Total Size= 3476 bytes File Size = 132 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.90 *

*Br 3 :VetoMu_en : VetoMu_en[VetoMu]/F *
*Entries : 701 : Total Size= 3476 bytes File Size = 132 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.90 *

*Br 4 :VetoMu_charge : VetoMu_charge[VetoMu]/I *
*Entries : 701 : Total Size= 3489 bytes File Size = 136 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.29 *

*Br 5 :VetoMu_pt : VetoMu_pt[VetoMu]/F *
*Entries : 701 : Total Size= 3476 bytes File Size = 132 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.90 *

*Br 6 :VetoMu_eta : VetoMu_eta[VetoMu]/F *
*Entries : 701 : Total Size= 3481 bytes File Size = 133 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.74 *

*Br 7 :VetoMu_phi : VetoMu_phi[VetoMu]/F *
*Entries : 701 : Total Size= 3481 bytes File Size = 133 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.74 *

*Br 8 :VetoMu_idTight : VetoMu_idTight[VetoMu]/I *
*Entries : 701 : Total Size= 3494 bytes File Size = 137 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.14 *

*Br 9 :VetoMu_ismuon : VetoMu_ismuon[VetoMu]/I *
*Entries : 701 : Total Size= 3489 bytes File Size = 136 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.29 *

*Br 10 :VetoMu_iso : VetoMu_iso[VetoMu]/F *
*Entries : 701 : Total Size= 3481 bytes File Size = 133 *
*Baskets : 1 : Basket Size= 32000 bytes Compression= 21.74 *

root [3]

I want this kind of results.

*Br 58 :VetoMu : VetoMu/I *
*Entries : 424280 : Total Size= 1699434 bytes File Size = 220955 *
*Baskets : 21 : Basket Size= 115200 bytes Compression= 7.69 *

*Br 59 :VetoMu_id : VetoMu_id[VetoMu]/I *
*Entries : 424280 : Total Size= 2677357 bytes File Size = 360356 *
*Baskets : 41 : Basket Size= 180736 bytes Compression= 7.43 *

*Br 60 :VetoMu_idTight : VetoMu_idTight[VetoMu]/I *
*Entries : 424280 : Total Size= 2677582 bytes File Size = 360083 *
*Baskets : 41 : Basket Size= 181248 bytes Compression= 7.43 *

*Br 61 :VetoMu_ismuon : VetoMu_ismuon[VetoMu]/I *
*Entries : 424280 : Total Size= 2677537 bytes File Size = 360359 *
*Baskets : 41 : Basket Size= 180736 bytes Compression= 7.43 *

*Br 62 :VetoMu_charge : VetoMu_charge[VetoMu]/I *
*Entries : 424280 : Total Size= 2677537 bytes File Size = 487544 *
*Baskets : 41 : Basket Size= 180736 bytes Compression= 5.49 *

*Br 63 :VetoMu_pt : VetoMu_pt[VetoMu]/F *
*Entries : 424280 : Total Size= 2677364 bytes File Size = 1252523 *
*Baskets : 41 : Basket Size= 180736 bytes Compression= 2.14 *

Thanks

I see no problems in your ROOT trees.
The tree from the first post has only 701 entries, so 1 basket is enough to store it in the ROOT file.
The tree from the second post has 424280 entries and so it needs many more baskets in the ROOT file.

Right. Thank you so much

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