38 const int channel,
double&
eta,
double&
phi,
int& layer)
const
41 channel < 0 || channel >=
s_channels)
return false;
45 const double etaOffset = modInfo.first.first;
46 const double phiOffset = modInfo.first.second;
49 if (!currentMap)
return false;
56 relCoord.
setEta(relCoord.
eta() + etaOffset);
58 phi = relCoord.
phi() + phiOffset;
98 const int out[16] = { 19,51,35, 3,18,50,34, 2,17,49,33, 1,16,48,32, 0 };
116 const int in1[16] = { 16,15,12,11,13,14, 9,10, 4, 3, 8, 7, 1, 2, 5, 6 };
132 const int in2a[4] = { 16,13, 4, 1 };
133 const int in2b[4] = { 15,12, 3, 8 };
149 const int in3a[4] = { 16,12, 4, 8 };
150 const int in3b[4] = { 11,10, 7, 6 };
174 const int in4a[4] = { 16,12, 8, 4 };
175 const int in4b[4] = { 15,11, 7, 3 };
199 const int in5[16] = { 16,15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
224 const int in6a[8] = { 16,14,12,10, 8, 6, 4, 2 };
225 const int in6b[8] = { 15,13,11, 9, 7, 5, 3, 1 };
230 for (
int i = 0; i < 12; ++i)
m_coordMaps.push_back(std::make_unique<CoordinateMap>());
231 for (
int block = 0; block < 4; ++block) {
232 const int incr = block * 4;
387 for (
int cr = 0; cr <
s_crates; ++cr) {
388 for (
int mod = 0; mod <
s_modules; ++mod) {
389 for (
int chan = 0; chan <
s_channels; ++chan) {
390 double tmpEta, tmpPhi;
392 if (
mapping(cr, mod, chan, tmpEta, tmpPhi, tmpLayer)) {
393 const unsigned int key =
etaPhiKey(tmpEta, tmpPhi);
398 if (tmpLayer == 0) ids.first = chanId;
399 else ids.second = chanId;
403 if (tmpLayer == 0) ids.first = chanId;
404 else ids.second = chanId;
433 const int nrows,
const int ncols,
const double etaBase,
434 const double phiBase,
const double etaRange,
const double phiRange,
437 assert (crate <
static_cast<int>(
m_crateInfo.size()));
439 for (
int row = 0; row < nrows; ++row) {
440 for (
int col = 0; col < ncols; ++col) {
441 const int module = row*4 + col + modOffset;
442 const double etaOffset = etaRange * double(col) + etaBase;
443 const double phiOffset = phiRange * double(row) + phiBase;
444 Offsets off(etaOffset, phiOffset);
468 const double etaOffsets[5] = { 0., 2.5, 3.1, 3.2, 4.9 };
469 const double etaGrans[4] = { 0.1, 0.2, 0.1, 0.425 };
471 const int side = (
eta < 0.) ? 0 : 1;
475 const double absEta = fabs(
eta);
476 for (
int i = 0; i < 4; ++i) {
477 if (absEta < etaOffsets[i+1]) {
479 ieta = int((absEta - etaOffsets[i]) / etaGrans[i]);
480 iphi = int(
phi / phiGrans[i]);
484 unsigned int key = (side << 20) + (region << 16) + (ieta << 8) + iphi;