-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Gtt jet finding geometry readout #50908
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| parameter eta_bin_0 = 14'b11010001001010; | ||
| parameter eta_bin_1 = 14'b11010101001110; | ||
| parameter eta_bin_2 = 14'b11011001010011; | ||
| parameter eta_bin_3 = 14'b11011101011000; | ||
| parameter eta_bin_4 = 14'b11100001011100; | ||
| parameter eta_bin_5 = 14'b11100101100001; | ||
| parameter eta_bin_6 = 14'b11101001100110; | ||
| parameter eta_bin_7 = 14'b11101101101011; | ||
| parameter eta_bin_8 = 14'b11110001101111; | ||
| parameter eta_bin_9 = 14'b11110101110100; | ||
| parameter eta_bin_10 = 14'b11111001111001; | ||
| parameter eta_bin_11 = 14'b11111101111101; | ||
| parameter eta_bin_12 = 14'b00000010000001; | ||
| parameter eta_bin_13 = 14'b00000110000110; | ||
| parameter eta_bin_14 = 14'b00001010001010; | ||
| parameter eta_bin_15 = 14'b00001110001111; | ||
| parameter eta_bin_16 = 14'b00010010010100; | ||
| parameter eta_bin_17 = 14'b00010110011001; | ||
| parameter eta_bin_18 = 14'b00011010011101; | ||
| parameter eta_bin_19 = 14'b00011110100010; | ||
| parameter eta_bin_20 = 14'b00100010100111; | ||
| parameter eta_bin_21 = 14'b00100110101011; | ||
| parameter eta_bin_22 = 14'b00101010110000; | ||
| parameter eta_bin_23 = 14'b00101110110101; | ||
| parameter LowJetTracks_FakeReduction = 4'b0010; | ||
| parameter LowJetpT_FakeReduction = 16'b0000011001000000; | ||
| parameter HighJetTracks_FakeReduction = 4'b0011; | ||
| parameter HighJetpT_FakeReduction = 16'b0000110010000000; | ||
| parameter MinJetTracks = 4'b0001; | ||
| parameter MinJetpT = 16'b0000000101000000; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,6 +200,60 @@ namespace l1ttrackjet { | |
| return phi_bin_; | ||
| } | ||
|
|
||
| //Geometry writeout for firmware | ||
| inline void FirmwareGeometryWriteOut(std::vector<glbeta_intern> eta_bin_centers, | ||
| std::vector<glbphi_intern> phi_bin_centers, | ||
| int etaBins_, | ||
| int lowpTJetMinTrackMultiplicity_, | ||
| float lowpTJetThreshold_, | ||
| int highpTJetMinTrackMultiplicity_, | ||
| float highpTJetThreshold_, | ||
| int minTrkJetTrackMultiplicity_, | ||
| float minTrkJetpT_) { | ||
| ofstream FirmwareGeometryFile; | ||
| FirmwareGeometryFile.open("./FirmwareGeometryFile.vh"); | ||
|
Contributor
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. May be useful add a check here to make sure the file is open |
||
|
|
||
| //This loop converts eta bin centers of type glbeta_intern into unsigned ints that can be read | ||
| //out as bit words to the geometry file | ||
| for (int i = 0; i < etaBins_; i++) { | ||
| unsigned int EtaBitInt = DoubleToBit( | ||
| eta_bin_centers[i], l1t::TkJetWord::TkJetBitWidths::kGlbEtaSize, l1t::TkJetWord::MAX_ETA * pow(2, -13)); | ||
|
Contributor
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. Should
Contributor
Author
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. Yes, I will change it. |
||
| std::bitset<l1t::TkJetWord::TkJetBitWidths::kGlbEtaSize> EtaBitWord(EtaBitInt); | ||
| FirmwareGeometryFile << "parameter eta_bin_" << i << " = 14'b" << EtaBitWord << ";" << std::endl; | ||
| } | ||
|
|
||
| //This code converts the int type track multiplicity values into bitset type to read out | ||
| std::bitset<4> lowpTJetMinTrackMultiplicity_bit(lowpTJetMinTrackMultiplicity_); | ||
| std::bitset<4> highpTJetMinTrackMultiplicity_bit(highpTJetMinTrackMultiplicity_); | ||
| std::bitset<4> minTrkJetTrackMultiplicity_bit(minTrkJetTrackMultiplicity_); | ||
|
|
||
| //Here we convert the float type pT cuts into pt_intern type for conversion into bitset type | ||
| pt_intern lowpTJetThreshold_converted(lowpTJetThreshold_); | ||
| pt_intern highpTJetThreshold_converted(highpTJetThreshold_); | ||
| pt_intern minTrkJetpT_converted(minTrkJetpT_); | ||
|
|
||
| //Here we turn the converted pT cut values into bitset type | ||
| std::bitset<l1t::TkJetWord::TkJetBitWidths::kPtSize> lowpTJetThreshold_bit( | ||
| lowpTJetThreshold_converted.range().to_uint()); | ||
| std::bitset<l1t::TkJetWord::TkJetBitWidths::kPtSize> highpTJetThreshold_bit( | ||
| highpTJetThreshold_converted.range().to_uint()); | ||
| std::bitset<l1t::TkJetWord::TkJetBitWidths::kPtSize> minTrkJetpT_bit(minTrkJetpT_converted.range().to_uint()); | ||
|
|
||
| //Export the bit words to the geometry file | ||
| FirmwareGeometryFile << "parameter LowJetTracks_FakeReduction = 4'b" << lowpTJetMinTrackMultiplicity_bit << ";" | ||
| << std::endl; | ||
| FirmwareGeometryFile << "parameter LowJetpT_FakeReduction = 16'b" << lowpTJetThreshold_bit << ";" << std::endl; | ||
|
|
||
| FirmwareGeometryFile << "parameter HighJetTracks_FakeReduction = 4'b" << highpTJetMinTrackMultiplicity_bit << ";" | ||
| << std::endl; | ||
| FirmwareGeometryFile << "parameter HighJetpT_FakeReduction = 16'b" << highpTJetThreshold_bit << ";" << std::endl; | ||
|
|
||
| FirmwareGeometryFile << "parameter MinJetTracks = 4'b" << minTrkJetTrackMultiplicity_bit << ";" << std::endl; | ||
| FirmwareGeometryFile << "parameter MinJetpT = 16'b" << minTrkJetpT_bit << ";" << std::endl; | ||
|
|
||
| FirmwareGeometryFile.close(); | ||
| } | ||
|
|
||
| // L1 clustering (in eta) | ||
| template <typename T, typename Pt, typename Eta, typename Phi> | ||
| inline std::vector<T> L1_clustering(T *phislice, int etaBins_, Eta etaStep_) { | ||
|
|
||
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.
Why is max eta 2pi?
Uh oh!
There was an error while loading. Please reload this page.
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.
This comes from the GTT interface document specifying that the max eta for the prompt jet word is 2*pi (see attached screenshot)