Open jpata opened 8 years ago
Need to get rid of deepcopy: https://github.com/jpata/tthbb13/blob/meanalysis-80x-V24/MEAnalysis/python/vhbb_utils.py#L55 https://github.com/jpata/tthbb13/blob/meanalysis-80x-V24/MEAnalysis/python/JetAnalyzer.py#L38 but causes ntuplization crash with
AttributeError: 'Event' object has no attribute 'mem_tth_SL_0w2h2t_nominal'
Need to disentangle why this collection does not get produced in MEMAnalyzer
in case of shallow copy.
Hi Joosep, What were the timing of these modules in 76x? What would have caused them to go slower?
I don't think it's 76X vs 80X, it's just that we've not been paying close attention to runtime speed (preferring ease of development), and now it's rather slow as a result. When running with MEM, it's not so relevant, because the MEM itself is quite a bit slower. I think now it's time to step back for a moment and re-optimize these slower parts, like the treatment of the systematics. For example, we don't need to copy the whole event (or whole jet), just a few branches.
Another thing is that we keep adding new branches to objects (like Jet
), each of which brings the speed of de-ntuplization in VHbbTree.py
down faster than linear due to not caching the TTree accessors (like I do in #98).
the tthbb13 code has gotten really slow, processing only around 1.5 ev/s even without the MEM.
I ran the profiles, here are some of the worst offenders.
VHbbTree.py
could be sped up with using a buffer (like rootpyTreeBuffer
) that doesn't reread the branch every time you dotree.leps_pt[n]
.JetAnalyzer.py
is slow because there we copy the jets, we could perhaps instead make a shallow copy and change only the p4. Additionally, it's slow because there we deepcopy the Event to a FakeEvent, which is variated.