Hi,
I have a small python code that essentially opens a file, take the TTree and write it into another file (flattening of a structure cluttered with directories). This part works perfectly, the second file contains a perfect copy of the first one.
But today I noticed that when I do:
tree = infile.Get(treepath)
tree.Print("toponly")
I only see a subset of the TTree branches. The above code returns:
******************************************************************************
*Tree :oneelectron_mt40_tree: tree *
*Entries : 613 : Total = 39516 bytes File Size = 23403 *
* : : Tree compression factor = 1.48 *
******************************************************************************
branch: nbj 446
branch: nj 364
branch: FS 444
branch: met 2291
branch: mct 2331
branch: DRBB 2314
branch: mt 2310
branch: mbb 2302
branch: j0pt 2295
branch: j1pt 2291
branch: lpt 2306
branch: charge 385
branch: weight 2220
But the actual tree got a lot more branches (that I can see when opening input and output files with ROOT interpreter).
[code]******************************************************************************
*Tree :oneelectron_mt40_tree: tree *
*Entries : 613 : Total = 85341 bytes File Size = 57771 *
-
: : Tree compression factor = 1.28 *
branch: nbj 446
branch: nj 364
branch: FS 444
branch: met 2290
branch: mct 2331
branch: DRBB 2314
branch: mt 2310
branch: mbb 2302
branch: j0pt 2295
branch: j1pt 2291
branch: lpt 2306
branch: charge 385
branch: weight 2220
branch: weightPileup 2273
branch: weightBUp 2231
branch: weightBDown 2242
branch: weightCUp 2222
branch: weightCDown 2224
branch: weightLUp 2228
branch: weightLDown 2226
branch: weightEeffUp 2228
branch: weightEeffDown 2234
branch: weightEtrigUp 2229
branch: weightEtrigDown 2234
branch: weightMeffUp 2226
branch: weightMeffDown 2228
branch: weightMtrigUp 2227
branch: weightMtrigDown 2229
[/code]
Is there anything I missed on TTree with PyROOT? I suspect that it may have something with memory management, but I’m not quite sure of what to do so I prefer to come here and ask for an expert look.
Thanks in advance, and if needed I’ll provide a minimal working code,
Michaël