7 #include "GaudiKernel/IInterface.h"
8 #include "GaudiKernel/MsgStream.h"
9 #include "GaudiKernel/StatusCode.h"
27 return StatusCode::SUCCESS;
32 return StatusCode::SUCCESS;
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;
73 msg(MSG::WARNING) <<
"Invalid eta/phi: " << eta
78 const unsigned int chanId = (
layer == 0) ?
ids.first :
ids.second;
79 if (chanId == invalidChanId) {
80 msg(MSG::WARNING) <<
"Invalid ChanId - shouldn't happen" <<
endmsg;
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;
315 std::vector<std::unique_ptr<CoordinateMap> >::const_iterator
pos =
m_coordMaps.begin();
387 for (
int cr = 0; cr <
s_crates; ++cr) {
390 double 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;
415 const double etaGran,
const double phiGran,
const double etaOffset,
416 const double phiOffset,
const int* in,
const int*
out,
const int incr,
420 const double phi = (
double(
row) + 0.5) * phiGran + phiOffset;
422 const double eta = (
double(
col) + 0.5) * etaGran + etaOffset;
433 const int nrows,
const int ncols,
const double etaBase,
437 assert (crate <
static_cast<int>(
m_crateInfo.size()));
444 Offsets off(etaOffset, phiOffset);
454 double eta =
coord.eta();
457 const double etaCorrection =
coord.etaGranularity()/4.;
459 else eta += etaCorrection;
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;