|
ATLAS Offline Software
|
Go to the documentation of this file.
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"
50 incSvc->addListener(
this,
"BeginRun");
52 return StatusCode::SUCCESS;
62 if (inc.type()==
"BeginRun") {
69 const int crate =
index >> 10;
70 const int slot =
module + 5;
79 <<
" maps to crate/slot/pin/asic " << crate <<
"/"
80 << slot <<
"/" << pin <<
"/" << asic);
85 ttId =
m_ttSvc->cnvToIdentifier(
id,
true);
89 if (ttId == invalidId) {
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;
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);
133 <<
"/" <<
channel <<
" maps to eta/phi/layer "
134 << eta <<
"/" << phi <<
"/" <<
layer);
144 if (eta <= -4.9 || eta >= 4.9 || phi <= 0. || phi >= 2.*
M_PI)
return false;
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);
180 if (
id == invalidId)
return false;
191 <<
" maps to crate/module/channel "
def retrieve(aClass, aKey=None)
int channel(const HWIdentifier id) const
Exception class for Calo Identifiers.
int region(const Identifier id) const
return region according to :
#define ATH_MSG_VERBOSE(x)
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
int phi(const Identifier id) const
return phi according to :
int module(const HWIdentifier id) const
This class initializes the Calo (LAr and Tile) offline identifiers.
::StatusCode StatusCode
StatusCode definition for legacy code.
const CaloLVL1_ID * getLVL1_ID(void) const
int eta(const Identifier id) const
return eta according to :
int pos_neg_z(const Identifier id) const
return pos_neg_z according to :
int submodule(const HWIdentifier id) const
int sampling(const Identifier id) const
return sampling according to :
bool absEta(const xAOD::TauJet &tau, double &out)
HWIdentifier channelId(int crate, int module, int submodule, int channel) const
(1) create towerId from fields
const TTOnlineID * getTTOnlineID(void) const
int crate(const HWIdentifier id) const
Identifier tower_id(int pos_neg_z, int sampling, int region, int eta, int phi) const
build a tower identifier