23 const auto& tp_hit_id = tp_info.
hit_id;
24 const auto& tp_segment_id = tp_info.
segment_id;
28 const auto& tp_data =
tp.getCSCData();
33 const int tp_raw_id = tp_det_id.rawId();
35 const int tp_endcap_pm = tp_info.
endcap_pm;
36 const int tp_subsector = tp_info.
subsector;
37 const int tp_chamber = tp_info.
chamber;
38 const int tp_station = tp_info.
station;
39 const int tp_ring = tp_info.
ring;
40 const int tp_layer = tp_info.
layer;
42 const int tp_csc_id = tp_info.
csc_id;
46 const int tp_strip = tp_data.strip;
47 const int tp_strip_quart_bit = tp_data.strip_quart_bit;
48 const int tp_strip_eighth_bit = tp_data.strip_eighth_bit;
49 const int tp_strip_quart = tp_data.strip_quart;
50 const int tp_strip_eighth = tp_data.strip_eighth;
56 const int tp_slope = tp_data.slope;
58 const int tp_bx = tp_info.
bx;
59 const int tp_subbx = 0;
60 const float tp_time = 0;
62 const auto tp_selection = tp_info.
selection;
64 const int tp_pattern = tp_data.pattern;
65 const int tp_quality = 6;
70 constexpr int tp_bend_lut[tp_bend_lut_size] = {-5, 5, -4, 4, -3, 3, -2, 2, -1, 1, 0};
72 tp_bend = tp_bend_lut[tp_pattern];
73 tp_bend *= tp_endcap_pm;
76 const int tp_ilink = tp_info.
ilink;
82 const double glob_rho_w1 = gp_w1.
perp();
83 const double glob_z_w1 = gp_w1.
z();
87 const int emtf_bend_w1 = std::clamp(tp_bend * 4, -16, 15);
89 const int emtf_qual_w1 = std::clamp(tp_quality, 0, 15);
95 int emtf_theta_w2 = 0;
96 int emtf_qual_w2 = tp_pattern;
101 tp_w2.accessCSCData().keywire = tp_wire2;
109 emtf_assert((0 <= emtf_phi_w1) and (emtf_phi_w1 < 5040));
110 emtf_assert((1 <= emtf_theta_w1) and (emtf_theta_w1 < 128));
111 emtf_assert((0 <= emtf_theta_w2) and (emtf_theta_w2 < 128));
116 const bool tp_flag_valid = tp_data.valid;
119 hit.setId(tp_hit_id);
121 hit.setRawDetId(tp_raw_id);
123 hit.setEndcap(tp_endcap_pm);
125 hit.setSubsector(tp_subsector);
126 hit.setStation(tp_station);
127 hit.setRing(tp_ring);
128 hit.setLayer(tp_layer);
129 hit.setChamber(tp_chamber);
131 hit.setCscId(tp_csc_id);
134 hit.setStrip(tp_strip);
135 hit.setStripLo(tp_strip);
136 hit.setStripHi(tp_strip);
137 hit.setStripQuart(tp_strip_quart);
138 hit.setStripEighth(tp_strip_eighth);
139 hit.setStripQuartBit(tp_strip_quart_bit);
140 hit.setStripEighthBit(tp_strip_eighth_bit);
142 hit.setWire1(tp_wire1);
143 hit.setWire2(tp_wire2);
145 hit.setBend(tp_bend);
146 hit.setSlope(tp_slope);
149 hit.setSubbx(tp_subbx);
151 hit.setQuality(tp_quality);
152 hit.setPattern(tp_pattern);
154 hit.setGlobPhi(glob_phi_w1);
155 hit.setGlobTheta(glob_theta_w1);
156 hit.setGlobPerp(glob_rho_w1);
157 hit.setGlobZ(glob_z_w1);
158 hit.setGlobTime(tp_time);
160 hit.setEmtfChamber(tp_ilink);
161 hit.setEmtfSegment(tp_segment_id);
162 hit.setEmtfPhi(emtf_phi_w1);
163 hit.setEmtfBend(emtf_bend_w1);
164 hit.setEmtfTheta1(emtf_theta_w1);
165 hit.setEmtfTheta2(emtf_theta_w2);
166 hit.setEmtfQual1(emtf_qual_w1);
167 hit.setEmtfQual2(emtf_qual_w2);
168 hit.setEmtfSite(emtf_site_w1);
169 hit.setEmtfHost(emtf_host_w1);
170 hit.setEmtfZones(emtf_zones_w1);
172 hit.setFlagNeighbor(tp_flag_neighbor);
173 hit.setFlagSubstitute(tp_flag_substitute);
174 hit.setFlagValid(tp_flag_valid);
GlobalPoint getGlobalPoint(const TriggerPrimitive &) const
Geom::Phi< T > phi() const
const int & lookup(const std::tuple< int, int, int > &) const
int calcThetaInt(int, float)
int calcPhiInt(int, float)
const EMTFContext & context_
int getZones(const int &, const int &) const
float radToDeg(float rad)
const int & lookup(const std::tuple< int, int, int > &) const
GeometryTranslator geometry_translator_
T1 value() const
Explicit access to value in case implicit conversion not OK.
Geom::Theta< T > theta() const