Opened 8 years ago
Last modified 8 years ago
#1059 new Bug
TrimmedP4 and pyroot
Reported by: | amonte | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Delphes code | Version: | Delphes 3 |
Keywords: | Cc: |
Description
Hello,
In pyroot, I am getting a segmentation violation when trying to access trimmed jet info using the TrimmedP4 variable (the same happens with PrunedP4).
The bug is present in Delphes 3.3.x and 3.4, and can be easily reproduced from Example1.py, by modifying the following near line 50
# Print jet transverse momentum print jet.PT print jet.TrimmedP4[0].Pt() # here len(jet.TrimmedP4[0]) also results in segmentation violation
With this modification, the error appears with any root file, e.g. here following the README in Delphes
curl -s http://cp3.irmp.ucl.ac.be/downloads/z_ee.hep.gz | gunzip | ./DelphesSTDHEP cards/delphes_card_CMS.tcl delphes_output.root python examples/Example1.py delphes_output.root
Note that TrimmedP4 is correctly listed in dir(jet), so it should know what to do with it.
Also note that the C++ implementation works as intended, e.g. jet->TrimmedP4[0].Pt() gives the correct numbers.
Attachments (1)
Change History (3)
by , 8 years ago
Attachment: | segfault.log added |
---|
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Thanks Pavel,
I reported the problem with ROOT's bug tracking system, but I haven't heard back from them yet.
I was able to work around this issue by modifying the source code in Delphes, by re-defining TrimmedP4 from an array of TLorentzVectors to a single TLorentzVector (therefore dropping the info about the four hardest sub-jets), in classes/DelphesClasses.cc, classes/DelphesClasses.h, modules/FastJetFinder.cc, modules/TreeWriter.cc. With that change, I am able to access the trimmed jets in pyROOT, e.g. jet.TrimmedP4.Pt() and so on. I did the same to access other jet grooming variables (PrunedP4 and SoftDroppedP4).
This is a relataively simple fix, I just wanted to point it out if anyone else runs into the same problem and lands on this page.
Thanks for the help!
I've just tried to reproduce this problem with ROOT 6.06.02 and with enabled debug information. Here is what I get:
Here is the code around line 2556 in TClass.cxx:
Since the problem is somewhere in the ROOT classes, I think that it's a question for the ROOT or PyROOT developers. Could you try to report this issue via the ROOT's bug tracking system (https://root.cern.ch/how/report-bug-jira)?