jpata / tthbb13

2 stars 5 forks source link

sparsinator rootpy tree model #93

Closed jpata closed 8 years ago

jpata commented 8 years ago

in case rootpy is used in sparsinator.py, it will sometimes change branch types depending on what is actually seen in the data.

For example, in BtagCSV data for one file nleps <= 1, so rootpy makes it a scalar instead of a 1-element vector, resulting in errors like

   Var(name="leps_pdgId", nominal=Func("leps_pdgId", func=lambda ev: [int(ev.leps_pdgId[i]) for i in range(ev.nleps)])),
TypeError: 'float' object has no attribute '__getitem__'

We need to remove the rootpy dependency from that particular code and take care of array accessors such as

ev.jets_pt[:ev.njets]
jpata commented 8 years ago

TreeCache will come later, at the moment not reporting to rootpy HEAD