-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Change Jet and FatJet Vector behaviour to be compatible with other lepton classes #1166
Conversation
@@ -506,6 +506,10 @@ class Jet(vector.PtEtaPhiMLorentzVector, base.NanoCollection, base.Systematic): | |||
TIGHTLEPVETO = 2 | |||
"jetId bit position" | |||
|
|||
@property | |||
def charge(self): | |||
return 0.0 * self.pt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you try using ak.zeros_like(self.pt)
, it will read less data. There are a few other places in the file that could use this optimization as well, please fix them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the dtype matter btw? Is there a reason it's 0.0 * self.pt
to return a float specifically. If yes, it should be set in zeros_like
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zeros_like respects the dtype of the input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the relevant changes to the nanoaod.py. I notice that 0.0 * self.pt
code is also present in delphs.py. Is there I way I could add delphs.py to this pull request? If not, I can always just make a new pull request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok NVM, the pull request automatically does it for you once you commit to the same branch
@green-cabbage please also replace the other
|
…MLorentzVector to candidate.PtEtaPhiMCandidate with introduction of charge property to match operations with lepton classes (ie Muon and Electron)
for more information, see https://pre-commit.ci
…ggested by Lindsey This impacts Jet, FatJet and Photon class
for more information, see https://pre-commit.ci
…lphes.py as suggested by Lindsey
changing Jet and FatJet's base vector class from vector.PtEtaPhiMLorentzVector to candidate.PtEtaPhiMCandidate with introduction of charge property to match operations with lepton classes (ie Muon and Electron)