9 bool readPtLUTFile,
bool fixMode15HighPt,
10 bool bug9BitDPhi,
bool bugMode7CLCT,
bool bugNegPt,
11 bool bugGMTPhi,
bool promoteMode7,
int modeQualVer
13 if (not(pt_assign_engine !=
nullptr))
14 {
edm::LogError(
"L1T") <<
"pt_assign_engine == nullptr ";
return; }
25 readPtLUTFile, fixMode15HighPt,
26 bug9BitDPhi, bugMode7CLCT, bugNegPt
39 EMTFTrackCollection::iterator best_tracks_it = best_tracks.begin();
40 EMTFTrackCollection::iterator best_tracks_end = best_tracks.end();
42 for (; best_tracks_it != best_tracks_end; ++best_tracks_it) {
61 bool use_ones_complem_gmt_eta =
true;
62 if (use_ones_complem_gmt_eta) {
63 gmt_eta = (gmt_eta < 0) ? ~(-gmt_eta) : gmt_eta;
67 address_t address = 0;
71 if (track.
Mode() != 1) {
78 {
edm::LogWarning(
"L1T") <<
"EMTF pT assignment mismatch: xmlpt = " << xmlpt
79 <<
", pt_assign_engine_->calculate_pt(track)) = " 82 pt = (xmlpt < 0.) ? 1. : xmlpt;
88 gmt_pt = 10 - (
abs(gmt_eta) / 32);
91 pt = (gmt_pt <= 0) ? 0 : (gmt_pt-1) * 0.5;
94 if (track.
Mode() != 1) {
98 gmt_quality = track.
Hits().front().Pattern() / 4;
101 std::pair<int, int> gmt_charge = std::make_pair(0, 0);
102 if (track.
Mode() != 1) {
103 std::vector<int> phidiffs;
106 phidiffs.push_back(phidiff);
111 int CLCT = track.
Hits().front().Pattern();
114 gmt_charge = std::make_pair( (CLCT % 2) == 0 ? 0 : 1, 1);
116 gmt_charge = std::make_pair( (CLCT % 2) == 0 ? 1 : 0, 1);
129 track.
set_charge ( (gmt_charge.second == 1) ? ((gmt_charge.first == 1) ? -1 : +1) : 0 );
140 bool disable_worst_track_in_same_bank =
true;
141 if (disable_worst_track_in_same_bank) {
148 unsigned rhs_addr = rhs.PtLUT().address;
149 unsigned lhs_addr_1 = (lhs_addr >> 26) & 0xF;
150 unsigned rhs_addr_1 = (rhs_addr >> 26) & 0xF;
151 unsigned lhs_addr_2 = (lhs_addr >> 2) & 0xF;
152 unsigned rhs_addr_2 = (rhs_addr >> 2) & 0xF;
153 return (lhs_addr_1 == rhs_addr_1) && (lhs_addr_2 == rhs_addr_2);
156 assert(best_tracks.size() <= 3);
157 if (best_tracks.size() == 3) {
158 bool same_bank = is_in_same_bank(best_tracks.at(0), best_tracks.at(2)) || is_in_same_bank(best_tracks.at(1), best_tracks.at(2));
161 best_tracks.at(2).set_pt(0);
162 best_tracks.at(2).set_gmt_pt(0);
168 for (
const auto&
track: best_tracks) {
170 <<
" GMT pt: " <<
track.GMT_pt() <<
" pt: " <<
track.Pt() <<
" mode: " <<
track.Mode()
171 <<
" GMT charge: " <<
track.GMT_charge() <<
" quality: " <<
track.GMT_quality()
172 <<
" eta: " <<
track.GMT_eta() <<
" phi: " <<
track.GMT_phi()
virtual address_t calculate_address(const EMTFTrack &track) const
void set_gmt_eta(int bits)
virtual float calculate_pt(const address_t &address) const
const PtAssignmentEngineAux & aux() const
int getGMTPhiV2(int phi) const
void configure(int verbose, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt)
void set_charge(int bits)
int getGMTEta(int theta, int endcap) const
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
void set_PtLUT(EMTFPtLUT bits)
const PtAssignmentEngineAux & aux() const
l1t::EMTFTrackCollection EMTFTrackCollection
void set_gmt_phi(int bits)
void set_gmt_quality(int bits)
Abs< T >::type abs(const T &t)
PtAssignmentEngine * pt_assign_engine_
std::pair< int, int > getGMTCharge(int mode, const std::vector< int > &phidiffs) const
virtual float scale_pt(const float pt, const int mode=15) const =0
void configure(PtAssignmentEngine *pt_assign_engine, int verbose, int endcap, int sector, int bx, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt, bool bugGMTPhi, bool promoteMode7, int modeQualVer)
void set_gmt_charge(int bits)
EMTFHitCollection Hits() const
int get_pt_lut_version() const
void process(EMTFTrackCollection &best_tracks)
void set_pt_XML(float val)
int getGMTPhi(int phi) const
void set_gmt_charge_valid(int bits)
int getGMTPt(float pt) const
void set_gmt_pt(int bits)
int getGMTQuality(int mode, int theta, bool promoteMode7, int version) const