7#include "GaudiKernel/IIncidentSvc.h"
8#include "GaudiKernel/IInterface.h"
9#include "GaudiKernel/MsgStream.h"
10#include "GaudiKernel/StatusCode.h"
16#include "Identifier/Identifier.h"
35 ATH_CHECK( detStore()->retrieve(caloMgr) );
50 incSvc->addListener(
this,
"BeginRun");
52 return StatusCode::SUCCESS;
62 if (inc.type()==
"BeginRun") {
67 const int channel =
index & 0x3f;
68 const int module = (
index >> 6) & 0x0f;
69 const int crate =
index >> 10;
70 const int slot =
module + 5;
71 const int pin = channel % 16;
72 const int asic = channel / 16;
78 << module <<
"/" << channel
79 <<
" maps to crate/slot/pin/asic " << crate <<
"/"
80 << slot <<
"/" << pin <<
"/" << asic);
85 ttId =
m_ttSvc->cnvToIdentifier(
id,
true);
93 const int side = (
m_lvl1Helper->pos_neg_z(ttId) == 1) ? 1 : 2;
98 m_idTable[
index] = (side<<14)+(sample<<13)+(region<<11)+(ieta<<6)+iphi;
108 const int channel,
double&
eta,
double&
phi,
int& layer)
const
110 if (crate < 0 || crate >= 8 || module < 0 || module >= 16 ||
111 channel < 0 || channel >= 64)
return false;
113 int index = (crate<<10) + (module<<6) + channel;
120 const int side = ((entry>>14) == 1) ? 1 : -1;
121 const int region = (entry>>11)&0x3;
122 const int ieta = (entry>>6)&0x1f;
123 const int iphi = entry&0x3f;
124 const double etaOffsets[4] = { 0., 2.5, 3.1, 3.2 };
125 const double etaGrans[4] = { 0.1, 0.2, 0.1, 0.425 };
128 eta = side * (etaOffsets[region] + etaGrans[region] * (ieta + 0.5));
129 phi = phiGrans[region] * (iphi + 0.5);
130 layer = (entry>>13)&0x1;
133 <<
"/" << channel <<
" maps to eta/phi/layer "
134 <<
eta <<
"/" <<
phi <<
"/" << layer);
142 const int layer,
int& crate,
int& module,
int& channel)
const
146 const double etaOffsets[5] = { 0., 2.5, 3.1, 3.2, 4.9 };
147 const double etaGrans[4] = { 0.1, 0.2, 0.1, 0.425 };
149 const int side = (
eta < 0.) ? -1 : 1;
153 const double absEta = fabs(
eta);
154 for (
int i = 0; i < 4; ++i) {
155 if (absEta < etaOffsets[i+1]) {
157 ieta = int((absEta - etaOffsets[i]) / etaGrans[i]);
158 iphi = int(
phi / phiGrans[i]);
167 << layer <<
" maps to side/layer/region/ieta/iphi "
168 << side <<
"/" << layer <<
"/" << region <<
"/"
169 << ieta <<
"/" << iphi);
174 id =
m_ttSvc->createTTChannelID(ttId,
true);
188 channel = asic * 16 + pin;
191 <<
" maps to crate/module/channel "
192 << crate <<
"/" << module <<
"/" << channel);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Exception class for Calo Identifiers.
This class initializes the Calo (LAr and Tile) offline identifiers.
const TTOnlineID * getTTOnlineID(void) const
const CaloLVL1_ID * getLVL1_ID(void) const
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...