28 return (
T(0) < val) - (val <
T(0));
32 const std::vector<float> bounds = {1.24, 1.14353, 1.09844, 1.05168, 1.00313, 0.952728, 0.90037, 0.8};
45 int etaVal2Bit(
float eta) {
return bounds.rend() -
std::lower_bound(bounds.rbegin(), bounds.rend(), fabs(eta)); }
47 int etaBit2Code(
unsigned int bit) {
94 int etaVal2Code(
double etaVal) {
96 int bit = etaVal2Bit(fabs(etaVal));
97 int code = etaBit2Code(bit);
101 int etaKeyWG2Code(
const CSCDetId &detId, uint16_t keyWG) {
102 signed int etaCode = 121;
106 else if (keyWG <= 57)
107 etaCode = etaBit2Code(0);
108 else if (keyWG <= 63)
109 etaCode = etaBit2Code(1);
110 }
else if (detId.
station() == 1 && detId.
ring() == 3) {
112 etaCode = etaBit2Code(2);
114 etaCode = etaBit2Code(3);
115 else if (keyWG <= 15)
116 etaCode = etaBit2Code(4);
117 else if (keyWG <= 23)
118 etaCode = etaBit2Code(5);
119 else if (keyWG <= 31)
120 etaCode = etaBit2Code(6);
124 else if (keyWG <= 29)
125 etaCode = etaBit2Code(0);
126 else if (keyWG <= 43)
127 etaCode = etaBit2Code(1);
128 else if (keyWG <= 49)
129 etaCode = etaBit2Code(2);
130 else if (keyWG <= 56)
131 etaCode = etaBit2Code(3);
132 else if (keyWG <= 63)
133 etaCode = etaBit2Code(4);
159 const int NBTI_theta = ((dTChamberId.
station() != 4) ? trig_geom.nCell(2) : trig_geom.nCell(3));
166 for (
unsigned int i = 0;
i < 7; ++
i)
167 if (theta_segm->
position(
i) && bti_group < 0)
169 else if (theta_segm->
position(
i) && bti_group > -1)
174 if (bti_group == 511)
176 else if (bti_group == -1 && dTChamberId.
station() == 1)
178 else if (bti_group == -1 && dTChamberId.
station() == 2)
180 else if (bti_group == -1 && dTChamberId.
station() == 3)
182 else if (dTChamberId.
station() != 4 && bti_group >= 0) {
183 unsigned bti_actual = bti_group * NBTI_theta / 7 + NBTI_theta / 14 + 1;
185 GlobalPoint theta_gp = trig_geom.CMSPosition(thetaBTI);
186 iEta = etaVal2Code(fabs(theta_gp.
eta()));
188 int signEta =
sgn(dTChamberId.
wheel());
207 auto chamb =
_geocsc->chamber(
id);
211 const uint16_t halfstrip = aDigi.
getStrip();
213 const uint16_t keyWG = aDigi.
getKeyWG();
222 const unsigned halfstrip_offs = unsigned(0.5 + halfstrip + offset);
223 const unsigned strip = halfstrip_offs / 2 + 1;
227 const LocalPoint coarse_lp = layer_geom->stripWireGroupIntersection(strip, keyWG);
232 const double hs_offset = layer_geom->stripPhiPitch() / 4.0;
237 const double phi_offset = ((halfstrip_offs % 2 ? 1 : -1) * (ccw ? -hs_offset : hs_offset));
249 return etaKeyWG2Code(
id, keyWG);
256 const LocalPoint lp = roll->centreOfStrip((
int)strip);
259 return etaVal2Code(gp.
eta());
edm::ESHandle< DTGeometry > _geodt
uint16_t *__restrict__ id
virtual int getGlobalEtaRpc(unsigned int rawid, const unsigned int &aDigi) const
Convert local eta coordinate to global digital microGMT scale.
edm::ESHandle< RPCGeometry > _georpc
Geom::Phi< T > phi() const
T1 value() const
Explicit access to value in case implicit conversion not OK.
constexpr std::array< uint8_t, layerIndexSize > layer
int position(const int i) const
Geom::Theta< T > theta() const
virtual bool isCSCCounterClockwise(const CSCLayer *layer) const
Check orientation of strips in given CSC chamber.
~OmtfAngleConverter() override
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
edm::ESHandle< CSCGeometry > _geocsc
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
int station() const
Return the station number.
int wheel() const
Return the wheel number.
virtual int getGlobalEta(const DTChamberId dTChamberId, const L1MuDTChambThContainer *dtThDigis, int bxNum) const