I am trying to use TDataFrame to make my life easy and reduce a datasample into a signal and background region. For this I use:
using namespace ROOT::Experimental;
TDataFrame df("Drell-Yan", "dy_tuple_12_md.root");
auto sig = df.Filter("Z0_ENDVERTEX_CHI2 < 5.");
auto bkg = df.Filter("Z0_ENDVERTEX_CHI2 > 15.");
sig.Snapshot("Drell-Yan", "dy_tuple_12_md_signal.root");
bkg.Snapshot("Drell-Yan", "dy_tuple_12_md_hf.root");
While this runs and produces the output files, these are not complete. The original tree contains some branches which are float arrays (of different lengths between events, but all of the same length within each event). In the output files these arrays are reduced to single float values (presumably the first values in each array).
Here is the relevant part of the tree structure (in the original file):
root [0] auto f = TFile::Open("dy_tuple_12_md.root");
root [1] auto t = (TTree*) f->Get("Drell-Yan");
root [2] t->Print()
******************************************************************************
*Tree :Drell-Yan : candidates *
*Entries : 6050086 : Total = 8148881413 bytes File Size = 5789740455 *
* : : Tree compression factor = 1.41 *
******************************************************************************
*Br 35 :nTrack : nTrack/I *
*Entries : 6050086 : Total Size= 24295310 bytes File Size = 8119769 *
*Baskets : 966 : Basket Size= 32000 bytes Compression= 2.99 *
*............................................................................*
*Br 36 :tracks_PX : tracks_PX[nTrack]/F *
*Entries : 6050086 : Total Size= 802795979 bytes File Size = 729794020 *
*Baskets : 26094 : Basket Size= 32000 bytes Compression= 1.10 *
*............................................................................*
*Br 37 :tracks_PY : tracks_PY[nTrack]/F *
*Entries : 6050086 : Total Size= 802795979 bytes File Size = 730225204 *
*Baskets : 26094 : Basket Size= 32000 bytes Compression= 1.10 *
*............................................................................*
*Br 38 :tracks_PZ : tracks_PZ[nTrack]/F *
*Entries : 6050086 : Total Size= 802795979 bytes File Size = 703887339 *
*Baskets : 26094 : Basket Size= 32000 bytes Compression= 1.14 *
*............................................................................*
*Br 39 :tracks_IP : tracks_IP[nTrack]/F *
*Entries : 6050086 : Total Size= 802795979 bytes File Size = 718673130 *
*Baskets : 26094 : Basket Size= 32000 bytes Compression= 1.12 *
*............................................................................*
*Br 40 :tracks_IPCHI2 : tracks_IPCHI2[nTrack]/F *
*Entries : 6050086 : Total Size= 802900823 bytes File Size = 729673037 *
*Baskets : 26098 : Basket Size= 32000 bytes Compression= 1.10 *
*............................................................................*
*Br 41 :tracks_eta : tracks_eta[nTrack]/F *
*Entries : 6050086 : Total Size= 802822077 bytes File Size = 670883430 *
*Baskets : 26094 : Basket Size= 32000 bytes Compression= 1.20 *
*............................................................................*
*Br 42 :tracks_phi : tracks_phi[nTrack]/F *
*Entries : 6050086 : Total Size= 802822077 bytes File Size = 720329161 *
*Baskets : 26094 : Basket Size= 32000 bytes Compression= 1.11 *
*............................................................................*
*Br 43 :tracks_charge : tracks_charge[nTrack]/F *
*Entries : 6050086 : Total Size= 802900823 bytes File Size = 112326444 *
*Baskets : 26098 : Basket Size= 32000 bytes Compression= 7.14 *
*............................................................................*
*Br 44 :tracks_isMuon : tracks_isMuon[nTrack]/F *
*Entries : 6050086 : Total Size= 802900823 bytes File Size = 55801458 *
*Baskets : 26098 : Basket Size= 32000 bytes Compression= 14.38 *
*............................................................................*
And here the tree structure in one of the snapshot files:
root [3] auto f2 = TFile::Open("dy_tuple_12_md_signal.root");
root [4] auto t2 = (TTree*) f2->Get("Drell-Yan");
root [5] t2->Print()
******************************************************************************
*Tree :Drell-Yan : Drell-Yan *
*Entries : 2950024 : Total = 554821580 bytes File Size = 374513586 *
* : : Tree compression factor = 1.48 *
******************************************************************************
*Br 35 :nTrack : nTrack/I *
*Entries : 2950024 : Total Size= 11804510 bytes File Size = 3879113 *
*Baskets : 42 : Basket Size= 2874880 bytes Compression= 3.04 *
*............................................................................*
*Br 36 :tracks_PX : tracks_PX/F *
*Entries : 2950024 : Total Size= 11804648 bytes File Size = 10888985 *
*Baskets : 42 : Basket Size= 2875392 bytes Compression= 1.08 *
*............................................................................*
*Br 37 :tracks_PY : tracks_PY/F *
*Entries : 2950024 : Total Size= 11804648 bytes File Size = 10922629 *
*Baskets : 42 : Basket Size= 2875392 bytes Compression= 1.08 *
*............................................................................*
*Br 38 :tracks_PZ : tracks_PZ/F *
*Entries : 2950024 : Total Size= 11804648 bytes File Size = 10555967 *
*Baskets : 42 : Basket Size= 2875392 bytes Compression= 1.12 *
*............................................................................*
*Br 39 :tracks_IP : tracks_IP/F *
*Entries : 2950024 : Total Size= 11804648 bytes File Size = 10696010 *
*Baskets : 42 : Basket Size= 2875392 bytes Compression= 1.10 *
*............................................................................*
*Br 40 :tracks_IPCHI2 : tracks_IPCHI2/F *
*Entries : 2950024 : Total Size= 11804937 bytes File Size = 10859592 *
*Baskets : 43 : Basket Size= 2875392 bytes Compression= 1.09 *
*............................................................................*
*Br 41 :tracks_eta : tracks_eta/F *
*Entries : 2950024 : Total Size= 11804694 bytes File Size = 9876309 *
*Baskets : 42 : Basket Size= 2875392 bytes Compression= 1.20 *
*............................................................................*
*Br 42 :tracks_phi : tracks_phi/F *
*Entries : 2950024 : Total Size= 11804694 bytes File Size = 10813645 *
*Baskets : 42 : Basket Size= 2875392 bytes Compression= 1.09 *
*............................................................................*
*Br 43 :tracks_charge : tracks_charge/F *
*Entries : 2950024 : Total Size= 11804937 bytes File Size = 1313121 *
*Baskets : 43 : Basket Size= 2875392 bytes Compression= 8.99 *
*............................................................................*
*Br 44 :tracks_isMuon : tracks_isMuon/F *
*Entries : 2950024 : Total Size= 11804937 bytes File Size = 506731 *
*Baskets : 43 : Basket Size= 2875392 bytes Compression= 23.29 *
*............................................................................*
Is this just not supported yet? If so, a mention of this in the documentation would be nice…
I am currently using ROOT 6.10/02.


.
.