-
Notifications
You must be signed in to change notification settings - Fork 26
Tau L1 2023 #1087
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
Tau L1 2023 #1087
Changes from all commits
9fc02fa
f301913
509ce67
ac63ddd
7d1408d
23e7756
dd376b2
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 | ||
|---|---|---|---|---|
|
|
@@ -35,6 +35,8 @@ namespace l1gt { | |||
|
|
||||
| // tau fields | ||||
| typedef ap_ufixed<10, 8> tauseed_pt_t; | ||||
| typedef ap_uint<10> tau_rawid_t; | ||||
| typedef std::array<uint64_t, 2> PackedTau; | ||||
|
|
||||
| namespace Scales { | ||||
| const int INTPHI_PI = 1 << (phi_t::width - 1); | ||||
|
|
@@ -185,12 +187,12 @@ namespace l1gt { | |||
| z0_t seed_z0; | ||||
| ap_uint<1> charge; | ||||
| ap_uint<2> type; | ||||
| iso_t isolation; | ||||
| tau_rawid_t isolation; | ||||
|
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. Just confirming this is a fix, which synchronises the Tau object definition to what's in the interface document? 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. Hi @Duchstf ,@EmyrClement, Elias from the GT here, we were just gazing over these "tau_rawid_t". We were wondering if this parameter has any unit, and how it is intended to be "cut" on? We found this line:
and were wondering if these two are related and if the conversion is correct? Thanks in advance! All the best Elias 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. I would like to add, that the in the menu we would want to select all taus with "passLooseNN()". Can you clarify this point too? Thank you @EmyrClement and @Duchstf 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. @Duchstf this is my understanding, and you should confirm if it's correct:
So to apply 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. @Duchstf From your thumbs up, I think you agree with my suggestion. Can you also confirm that the |
||||
| ap_uint<2> id0; | ||||
| ap_uint<2> id1; | ||||
|
|
||||
| static const int BITWIDTH = 128; | ||||
| inline ap_uint<BITWIDTH> pack() const { | ||||
| inline ap_uint<BITWIDTH> pack_ap() const { | ||||
| ap_uint<BITWIDTH> ret; | ||||
| unsigned int start = 0; | ||||
| pack_into_bits(ret, start, valid); | ||||
|
|
@@ -204,6 +206,44 @@ namespace l1gt { | |||
| pack_into_bits(ret, start, id1); | ||||
| return ret; | ||||
| } | ||||
|
|
||||
| inline PackedTau pack() const { | ||||
| PackedTau packed; | ||||
| ap_uint<BITWIDTH> bits = this->pack_ap(); | ||||
| packed[0] = bits(63, 0); | ||||
| packed[1] = bits(127, 64); | ||||
| return packed; | ||||
| } | ||||
|
|
||||
| inline static Tau unpack_ap(const ap_uint<BITWIDTH> &src) { | ||||
| Tau ret; | ||||
| ret.initFromBits(src); | ||||
| return ret; | ||||
| } | ||||
|
|
||||
| inline static Tau unpack(const PackedTau &src) { | ||||
| ap_uint<BITWIDTH> bits; | ||||
| bits(63, 0) = src[0]; | ||||
| bits(127, 64) = src[1]; | ||||
|
|
||||
| return unpack_ap(bits); | ||||
| } | ||||
|
|
||||
| inline void initFromBits(const ap_uint<BITWIDTH> &src) { | ||||
| unsigned int start = 0; | ||||
| unpack_from_bits(src, start, valid); | ||||
| unpack_from_bits(src, start, v3.pt); | ||||
| unpack_from_bits(src, start, v3.phi); | ||||
| unpack_from_bits(src, start, v3.eta); | ||||
| unpack_from_bits(src, start, seed_pt); | ||||
| unpack_from_bits(src, start, seed_z0); | ||||
| unpack_from_bits(src, start, charge); | ||||
| unpack_from_bits(src, start, type); | ||||
| unpack_from_bits(src, start, isolation); | ||||
| unpack_from_bits(src, start, id0); | ||||
| unpack_from_bits(src, start, id1); | ||||
| } | ||||
|
|
||||
| }; // struct Tau | ||||
|
|
||||
| struct Electron { | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,8 @@ | ||
| #include "DataFormats/L1TParticleFlow/interface/PFTau.h" | ||
|
|
||
| l1t::PFTau::PFTau(const PolarLorentzVector& p, float iso, float fulliso, int id, int hwpt, int hweta, int hwphi) | ||
| : L1Candidate(p, hwpt, hweta, hwphi, /*hwQuality=*/int(0)), iso_(iso), fullIso_(fulliso), id_(id) {} | ||
| l1t::PFTau::PFTau( | ||
| const PolarLorentzVector& p, float NNValues[80], float iso, float fulliso, int id, int hwpt, int hweta, int hwphi) | ||
| : L1Candidate(p, hwpt, hweta, hwphi, /*hwQuality=*/int(0)), iso_(iso), fullIso_(fulliso), id_(id) { | ||
| for (int i0 = 0; i0 < 80; i0++) | ||
| NNValues_[i0] = NNValues[i0]; // copy the array of NN inputs | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,14 @@ | ||
| //Numpy array shape [25] | ||
| //Min -1.101188778877 | ||
| //Max 1.014160394669 | ||
| //Number of zeros 2 | ||
| //Min -0.734825849533 | ||
| //Max 1.288661003113 | ||
| //Number of zeros 0 | ||
|
|
||
| #ifndef B1_H_ | ||
| #define B1_H_ | ||
|
|
||
| weight_default_t b1[25] = {0.8776568174, -0.0888396949, -0.1198173761, -0.0066847582, -0.0117284302, | ||
| -0.0283335019, 0.0000000000, -1.1011887789, -0.0135271018, -0.0323914811, | ||
| 0.5437909961, -0.0175916012, 0.5357875228, -0.3656347692, 0.2423969060, | ||
| 1.0141603947, 0.0000000000, -0.7741876245, 0.9614976048, 0.5918464661, | ||
| -0.3908625543, -0.2043008506, -0.3004969060, -0.1039064825, 0.5963121057}; | ||
| weight_default_t b1[25] = {-0.12057505, -0.05409636, 0.27422485, 0.49775919, -0.73482585, 0.44995615, 0.52624124, | ||
| -0.71328187, -0.43596983, 0.10772870, -0.68372047, 0.22197038, -0.53673136, -0.00771000, | ||
| 0.06140821, 1.28866100, -0.12453079, 0.16897179, 0.18858922, -0.17255782, -0.24242370, | ||
| -0.21922758, 0.40799412, 0.46138164, 0.85911417}; | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| //Numpy array shape [10] | ||
| //Min -0.819882214069 | ||
| //Max 0.973487198353 | ||
| //Min -0.380347400904 | ||
| //Max 0.551839828491 | ||
| //Number of zeros 0 | ||
|
|
||
| #ifndef B2_H_ | ||
| #define B2_H_ | ||
|
|
||
| weight_default_t b2[10] = {-0.8198822141, | ||
| 0.7516837120, | ||
| 0.6504452229, | ||
| -0.0292063691, | ||
| -0.0308178961, | ||
| 0.9734871984, | ||
| 0.1587447226, | ||
| -0.3352679014, | ||
| -0.0403082110, | ||
| 0.9563522935}; | ||
| weight_default_t b2[10] = {0.55183983, | ||
| 0.36323273, | ||
| -0.13108490, | ||
| -0.38034740, | ||
| 0.08559006, | ||
| 0.01700789, | ||
| 0.13562575, | ||
| -0.32752651, | ||
| 0.48282012, | ||
| -0.15096320}; | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| //Numpy array shape [10] | ||
| //Min -0.128828719258 | ||
| //Max 1.138555169106 | ||
| //Min -0.936354994774 | ||
| //Max 0.407682240009 | ||
| //Number of zeros 0 | ||
|
|
||
| #ifndef B3_H_ | ||
| #define B3_H_ | ||
|
|
||
| weight_default_t b3[10] = {1.0009469986, | ||
| -0.0118703200, | ||
| 0.5378767252, | ||
| 0.6056469083, | ||
| -0.0177963823, | ||
| 0.3281430006, | ||
| -0.0163392760, | ||
| 1.1385551691, | ||
| -0.1288287193, | ||
| 0.5457931757}; | ||
| weight_default_t b3[10] = {-0.58549309, | ||
| -0.06117089, | ||
| -0.24173595, | ||
| 0.17925857, | ||
| -0.93635499, | ||
| 0.18813914, | ||
| 0.13134949, | ||
| 0.04132507, | ||
| 0.40768224, | ||
| 0.29987794}; | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| //Numpy array shape [1] | ||
| //Min -0.572278082371 | ||
| //Max -0.572278082371 | ||
| //Min 0.023343238980 | ||
| //Max 0.023343238980 | ||
| //Number of zeros 0 | ||
|
|
||
| #ifndef B4_H_ | ||
| #define B4_H_ | ||
|
|
||
| weight_default_t b4[1] = {-0.5722780824}; | ||
| weight_default_t b4[1] = {0.02334324}; | ||
|
|
||
| #endif |
Uh oh!
There was an error while loading. Please reload this page.