-
Notifications
You must be signed in to change notification settings - Fork 4.4k
[L1T] PR containing simulation and emulation related to jet mass reconstruction (Phase-2) #47792
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
Open
lrobertshaw
wants to merge
6
commits into
cms-sw:master
Choose a base branch
from
lrobertshaw:CMSSW_15_1_X
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ccc2b30
Contains all jet mass emulator commits and rebase to 151X
lrobertshaw f224be0
code format patch
lrobertshaw baba4d2
added previously removed phase-1 jets back in
lrobertshaw 9db1d48
removed non-default file path
lrobertshaw e2787da
Added a new HW encoding for new packed type
lrobertshaw 4903a04
code checks and format
lrobertshaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
#ifndef L1Trigger_Phase2L1ParticleFlow_L1SeedConePFJetEmulator_h | ||
#define L1Trigger_Phase2L1ParticleFlow_L1SeedConePFJetEmulator_h | ||
|
||
#define NCONSTITSFW 32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a comment here as to what this is please? (I assume it is the maximum number of constituents?) |
||
|
||
#include "DataFormats/L1TParticleFlow/interface/layer1_emulator.h" | ||
#include "DataFormats/L1TParticleFlow/interface/jets.h" | ||
|
||
|
@@ -21,6 +23,18 @@ class L1SCJetEmu { | |
typedef ap_int<13> detaphi_t; // Type for deta & dphi | ||
typedef ap_fixed<18, 23> detaphi2_t; // Type for deta^2 & dphi^2 | ||
typedef ap_fixed<22, 22> pt_etaphi_t; // Type for product of pt with deta & dphi | ||
|
||
typedef ap_ufixed<13, 1, AP_RND, AP_SAT> | ||
eventrig_t; // stores values between 0 and 2, - 0 bit for sign, - 1 bit for integer, leaves 12 for frac | ||
typedef ap_fixed<13, 1, AP_RND, AP_SAT> | ||
oddtrig_t; // stores values between -1 and 1, 13 - 1 bit for sign, - 0 bits for integer, leaves 12 for frac | ||
lrobertshaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// typedef l1ct::mass_t mass_t; // stores values up to ~1 TeV, 18 bits - 0 for sign, - 10 for integer, 14 total bits improves performance | ||
typedef l1ct::mass2_t mass2_t; | ||
|
||
typedef ap_ufixed<20, 12, AP_TRN, AP_SAT> ppt_t; // stores values between -1 and 1 | ||
typedef ap_fixed<22, 14, AP_TRN, AP_SAT> npt_t; // stores values between -1 and 1 JUST REDUCED BY 2 | ||
|
||
typedef l1ct::PuppiObjEmu Particle; | ||
|
||
class Jet : public l1ct::Jet { | ||
|
@@ -43,6 +57,7 @@ class L1SCJetEmu { | |
typedef ap_ufixed<18, -2> inv_pt_t; | ||
static constexpr int N_table_inv_pt = 1024; | ||
inv_pt_t inv_pt_table_[N_table_inv_pt]; | ||
static constexpr int hwEtaPhi_steps = 185; // corresponds to eta/phi range of 0 to 0.8 | ||
|
||
static constexpr int ceillog2(int x) { return (x <= 2) ? 1 : 1 + ceillog2((x + 1) / 2); } | ||
|
||
|
@@ -142,10 +157,20 @@ class L1SCJetEmu { | |
return out; | ||
} | ||
|
||
template <typename lut_T, int N> | ||
static std::array<lut_T, N> init_trig_lut(lut_T (*func)(float)) { | ||
std::array<lut_T, N> lut; | ||
for (int hwEtaPhi = 0; hwEtaPhi < N; hwEtaPhi++) { | ||
lut[hwEtaPhi] = func(hwEtaPhi * l1ct::Scales::ETAPHI_LSB); | ||
} | ||
return lut; | ||
} | ||
|
||
static detaphi_t deltaPhi(Particle a, Particle b); | ||
bool inCone(Particle seed, Particle part) const; | ||
Jet makeJet_HW(const std::vector<Particle>& parts) const; | ||
|
||
std::vector<Particle> sortConstituents(const std::vector<Particle>& parts, const Particle seed) const; | ||
mass2_t jetMass_HW(const std::vector<Particle>& parts) const; | ||
Jet makeJet_HW(const std::vector<Particle>& parts, const Particle seed) const; | ||
}; // class L1SCJetEmu | ||
|
||
#endif | ||
#endif | ||
Comment on lines
-151
to
+176
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to have a empty line at the end of file |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we really remove the btag score now from the jets? If so then you can remove the commented out lines here and throughout