45 EMTFTrackCollection::iterator best_tracks_it = best_tracks.begin();
46 EMTFTrackCollection::iterator best_tracks_end = best_tracks.end();
48 for (; best_tracks_it != best_tracks_end; ++best_tracks_it) {
67 bool use_ones_complem_gmt_eta =
true;
68 if (use_ones_complem_gmt_eta) {
69 gmt_eta = (gmt_eta < 0) ? ~(-gmt_eta) : gmt_eta;
73 address_t address = 0;
83 if (
track.Mode() != 1) {
90 edm::LogError(
"L1T") <<
"EMTF pT assignment mismatch: xmlpt = " << xmlpt
91 <<
", pt_assign_engine_->calculate_pt(track)) = " 95 pt = (xmlpt < 0.) ? 1. : xmlpt;
102 gmt_pt = 10 - (
abs(gmt_eta) / 32);
105 pt = (gmt_pt <= 0) ? 0 : (gmt_pt - 1) * 0.5;
116 pt_dxy =
std::abs(prediction.at(0));
117 dxy = prediction.at(1);
125 if (
track.Mode() != 1) {
128 gmt_quality =
track.Hits().front().Pattern() / 4;
131 std::pair<int, int> gmt_charge = std::make_pair(0, 0);
132 if (
track.Mode() != 1) {
133 std::vector<int> phidiffs;
140 int CLCT =
track.Hits().front().Pattern();
143 gmt_charge = std::make_pair((CLCT % 2) == 0 ? 0 : 1, 1);
145 gmt_charge = std::make_pair((CLCT % 2) == 0 ? 1 : 0, 1);
155 track.set_PtLUT(tmp_LUT);
156 track.set_pt_XML(xmlpt);
158 track.set_pt_dxy(pt_dxy);
160 track.set_charge((gmt_charge.second == 1) ? ((gmt_charge.first == 1) ? -1 : +1) : 0);
162 track.set_gmt_pt(gmt_pt);
163 track.set_gmt_pt_dxy(gmt_pt_dxy);
164 track.set_gmt_dxy(gmt_dxy);
165 track.set_gmt_phi(gmt_phi);
166 track.set_gmt_eta(gmt_eta);
167 track.set_gmt_quality(gmt_quality);
168 track.set_gmt_charge(gmt_charge.first);
169 track.set_gmt_charge_valid(gmt_charge.second);
173 bool disable_worst_track_in_same_bank =
true;
174 if (disable_worst_track_in_same_bank) {
181 unsigned rhs_addr = rhs.PtLUT().address;
182 unsigned lhs_addr_1 = (lhs_addr >> 26) & 0xF;
183 unsigned rhs_addr_1 = (rhs_addr >> 26) & 0xF;
184 unsigned lhs_addr_2 = (lhs_addr >> 2) & 0xF;
185 unsigned rhs_addr_2 = (rhs_addr >> 2) & 0xF;
186 return (lhs_addr_1 == rhs_addr_1) && (lhs_addr_2 == rhs_addr_2);
190 if (best_tracks.size() == 3) {
191 bool same_bank = is_in_same_bank(best_tracks.at(0), best_tracks.at(2)) ||
192 is_in_same_bank(best_tracks.at(1), best_tracks.at(2));
195 best_tracks.at(2).set_pt(0);
196 best_tracks.at(2).set_gmt_pt(0);
202 for (
const auto&
track : best_tracks) {
204 <<
" GMT pt: " <<
track.GMT_pt() <<
" pt: " <<
track.Pt() <<
" mode: " <<
track.Mode()
205 <<
" GMT charge: " <<
track.GMT_charge() <<
" quality: " <<
track.GMT_quality()
206 <<
" eta: " <<
track.GMT_eta() <<
" phi: " <<
track.GMT_phi() << std::endl;
l1t::EMTFTrackCollection EMTFTrackCollection
constexpr int NUM_STATION_PAIRS
int getGMTPtDxy(float pt) const
void configure(int verbose, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt)
int getGMTQuality(int mode, int theta, bool promoteMode7, int version) const
virtual void calculate_pt_dxy(const EMTFTrack &track, emtf::Feature &feature, emtf::Prediction &prediction) const
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
virtual float calculate_pt(const address_t &address) const
Log< level::Error, false > LogError
void configure(int verbose, const std::string pbFileNameDxy)
std::array< float, NUM_PREDICTIONS > Prediction
virtual float scale_pt(const float pt, const int mode=15) const =0
PtAssignmentEngineDxy * pt_assign_engine_dxy_
Abs< T >::type abs(const T &t)
PtAssignmentEngine * pt_assign_engine_
int get_pt_lut_version() const
int getGMTPt(float pt) const
virtual address_t calculate_address(const EMTFTrack &track) const
const PtAssignmentEngineAux & aux() const
std::pair< int, int > getGMTCharge(int mode, const std::vector< int > &phidiffs) const
int getGMTEta(int theta, int endcap) const
void process(EMTFTrackCollection &best_tracks)
int getGMTPhi(int phi) const
int getGMTPhiV2(int phi) const
void configure(PtAssignmentEngine *pt_assign_engine, PtAssignmentEngineDxy *pt_assign_engine_dxy, int verbose, int endcap, int sector, int bx, bool readPtLUTFile, bool fixMode15HighPt, bool bug9BitDPhi, bool bugMode7CLCT, bool bugNegPt, bool bugGMTPhi, bool promoteMode7, int modeQualVer, std::string pbFileName)
const PtAssignmentEngineAux & aux() const
std::array< float, NUM_FEATURES > Feature
int getGMTDxy(float dxy) const
float getPtFromGMTPtDxy(int gmt_pt_dxy) const