27 constexpr std::array<float, 8>
bounds = {{1.24, 1.14353, 1.09844, 1.05168, 1.00313, 0.952728, 0.90037, 0.8}};
42 int etaBit2Code(
unsigned int bit) {
89 int etaVal2Code(
double etaVal) {
91 int bit = etaVal2Bit(fabs(etaVal));
92 int code = etaBit2Code(bit);
96 int etaKeyWG2Code(
const CSCDetId &detId, uint16_t keyWG) {
97 signed int etaCode = 121;
101 else if (keyWG <= 57)
102 etaCode = etaBit2Code(0);
103 else if (keyWG <= 63)
104 etaCode = etaBit2Code(1);
105 }
else if (detId.
station() == 1 && detId.
ring() == 3) {
107 etaCode = etaBit2Code(2);
109 etaCode = etaBit2Code(3);
110 else if (keyWG <= 15)
111 etaCode = etaBit2Code(4);
112 else if (keyWG <= 23)
113 etaCode = etaBit2Code(5);
114 else if (keyWG <= 31)
115 etaCode = etaBit2Code(6);
119 else if (keyWG <= 29)
120 etaCode = etaBit2Code(0);
121 else if (keyWG <= 43)
122 etaCode = etaBit2Code(1);
123 else if (keyWG <= 49)
124 etaCode = etaBit2Code(2);
125 else if (keyWG <= 56)
126 etaCode = etaBit2Code(3);
127 else if (keyWG <= 63)
128 etaCode = etaBit2Code(4);
136 int fixCscOffsetGeom(
int offsetLoc) {
140 const std::vector<int> offCSC = {-154, -133, -17, -4, 4, 17, 133, 146, 154, 167, 283, 296, 304, 317,
141 433, 446, 454, 467, 583, 596, 604, 617, 733, 746, 754, 767, 883, 904};
143 int fixOff = (gep != offCSC.end()) ? *gep : *(gep - 1);
144 if (gep != offCSC.begin() &&
std::abs(*(gep - 1) - offsetLoc) <
std::abs(fixOff - offsetLoc))
152 if (getDuringEvent) {
169 unsigned long long geomid =
geom.cacheIdentifier();
184 int processor = iProcessor + 1;
191 int phiDT = digi.
phi();
193 if (posneg * 2 !=
wheel)
199 if (processor != 6 && !(sector >= processor * 2 - 1 && sector <= processor * 2 + 1))
201 if (processor == 6 && !(sector >= 11 || sector == 1))
205 int ichamber = sector - 1 - 2 * (processor - 1);
209 int offsetLoc = lround(((ichamber - 1) *
M_PI / 6 +
M_PI / 12.) / hsPhiPitch);
210 double scale = 1. / 4096 / hsPhiPitch;
211 int scale_coeff = lround(
scale *
pow(2, 11));
213 int phi = floor(phiDT * scale_coeff /
pow(2, 11)) + offsetLoc;
225 int processor = iProcessor + 1;
230 if (posneg !=
csc.zendcap())
232 if (
csc.ring() != 3 && !(
csc.ring() == 2 && (
csc.station() == 2 ||
csc.station() == 3 ||
csc.station() == 1)))
234 if (processor != 6) {
235 if (
csc.chamber() < (processor - 1) * 6 + 2)
237 if (
csc.chamber() > (processor - 1) * 6 + 8)
240 if (
csc.chamber() > 2 &&
csc.chamber() < 32)
257 int order = (
layer->centerOfStrip(2).phi() -
layer->centerOfStrip(1).phi() > 0) ? 1 : -1;
259 double scale = fabs(stripPhiPitch / hsPhiPitch / 2.);
260 if (fabs(
scale - 1.) < 0.0002)
262 double phi15deg =
M_PI / 3. * (processor - 1) +
M_PI / 12.;
263 double phiHalfStrip0 =
layer->centerOfStrip(10).phi() -
order * 9 * stripPhiPitch -
order * stripPhiPitch / 4.;
264 if (processor == 6 || phiHalfStrip0 < 0)
265 phiHalfStrip0 += 2 *
M_PI;
266 int offsetLoc = lround((phiHalfStrip0 - phi15deg) / hsPhiPitch);
273 int fixOff = fixCscOffsetGeom(offsetLoc);
288 const unsigned int &digi1,
289 const unsigned int &digi2)
const {
292 int processor = iProcessor + 1;
298 M_PI / 3. * (processor - 1) +
M_PI / 12.;
309 phi15deg -= 2 *
M_PI;
314 stripPhi1 += 2 *
M_PI;
316 stripPhi2 += 2 *
M_PI;
322 int halfStrip = lround(((stripPhi1 + stripPhi2) / 2. - phi15deg) / hsPhiPitch);
330 const unsigned int &digi)
const {
333 int processor = iProcessor + 1;
339 M_PI / 3. * (processor - 1) +
M_PI / 12.;
347 phi15deg -= 2 *
M_PI;
352 stripPhi += 2 *
M_PI;
358 int halfStrip = lround((stripPhi - phi15deg) / hsPhiPitch);
370 std::unique_ptr<DTChamber> chamb(const_cast<DTChamber *>(
_geodt->
chamber(baseid)));
372 std::unique_ptr<DTTrigGeom> trig_geom(
new DTTrigGeom(chamb.get(),
false));
380 const int NBTI_theta = ((baseid.station() != 4) ? trig_geom->nCell(2) : trig_geom->nCell(3));
400 for (
unsigned int i = 0;
i < 7; ++
i)
401 if (theta_segm->
position(
i) && bti_group < 0)
403 else if (theta_segm->
position(
i) && bti_group > -1)
408 if (bti_group == 511)
410 else if (bti_group == -1 && aDigi.
stNum() == 1)
412 else if (bti_group == -1 && aDigi.
stNum() == 2)
414 else if (bti_group == -1 && aDigi.
stNum() == 3)
416 else if (baseid.station() != 4 && bti_group >= 0) {
418 unsigned bti_actual = bti_group * NBTI_theta / 7 + NBTI_theta / 14 + 1;
420 GlobalPoint theta_gp = trig_geom->CMSPosition(thetaBTI);
421 iEta = etaVal2Code(fabs(theta_gp.
eta()));
446 const uint16_t halfstrip = aDigi.
getStrip();
448 const uint16_t keyWG = aDigi.
getKeyWG();
458 const unsigned halfstrip_offs = unsigned(0.5 + halfstrip +
offset);
459 const unsigned strip = halfstrip_offs / 2 + 1;
463 const LocalPoint coarse_lp = layer_geom->stripWireGroupIntersection(
strip, keyWG);
468 const double hs_offset = layer_geom->stripPhiPitch() / 4.0;
473 const double phi_offset = ((halfstrip_offs % 2 ? 1 : -1) * (ccw ? -hs_offset : hs_offset));
481 layer_geom.release();
489 return etaKeyWG2Code(
id, keyWG);
499 std::unique_ptr<const RPCRoll> roll(
_georpc->
roll(
id));
504 return etaVal2Code(
gp.eta());
511 const int nStrips =
layer->geometry()->numberOfStrips();
512 const double phi1 =
layer->centerOfStrip(1).phi();
513 const double phiN =
layer->centerOfStrip(
nStrips).phi();
526 for (
unsigned int i = 0;
i < 7; ++
i) {
527 if (theta_segm->
position(
i) && bti_group < 0)
532 else if (theta_segm->
position(
i) && bti_group > -1)
L1MuDTChambThDigi const * chThetaSegm(int wheel, int stat, int sect, int bx) const
AngleConverter(edm::ConsumesCollector &, bool getDuringEvent=true)
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
Geom::Phi< T > phi() const
CSCGeometry const * _geocsc
int position(const int i) const
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > rpcGeometryToken_
int getGlobalEta(unsigned int rawid, const L1MuDTChambPhDigi &aDigi, const L1MuDTChambThContainer *dtThDigis)
Convert local eta coordinate to global digital microGMT scale.
unsigned long long _geom_cache_id
const RPCRoll * roll(RPCDetId id) const
Return a roll given its id.
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
constexpr std::array< uint8_t, layerIndexSize > layer
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeometryToken_
DTGeometry const * _geodt
int getProcessorPhi(unsigned int iProcessor, l1t::tftype part, const L1MuDTChambPhDigi &digi) const
Abs< T >::type abs(const T &t)
const int findBTIgroup(const L1MuDTChambPhDigi &aDigi, const L1MuDTChambThContainer *dtThDigis)
Find BTI group.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
RPCGeometry const * _georpc
unsigned int nPhiBins
Number of phi bins along 2Pi.
float stripPhiPitch() const
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeometryToken_
static double getLegacyPosition(int pattern)
void checkAndUpdateGeometry(const edm::EventSetup &, unsigned int)
Update the Geometry with current Event Setup.
bool isCSCCounterClockwise(const std::unique_ptr< const CSCLayer > &layer) const
Check orientation of strips in given CSC chamber.
T1 value() const
Explicit access to value in case implicit conversion not OK.
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Power< A, B >::type pow(const A &a, const B &b)
Geom::Theta< T > theta() const
LocalPoint centreOfStrip(int strip) const