|
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"
43 msg(MSG::ERROR) <<
"Unable to retrieve CaloIdManager from DetectorStore"
52 msg(MSG::ERROR) <<
"Could not access CaloLVL1_ID helper" <<
endmsg;
53 return StatusCode::FAILURE;
60 msg(MSG::ERROR) <<
"Could not access TTOnlineID helper" <<
endmsg;
61 return StatusCode::FAILURE;
65 IIncidentSvc* incSvc = 0;
66 sc = service(
"IncidentSvc", incSvc);
68 msg(MSG::ERROR) <<
"Unable to retrieve pointer to IncidentSvc " <<
endmsg;
69 return StatusCode::FAILURE;
73 if (incSvc) incSvc->addListener(
this,
"BeginRun");
76 return StatusCode::SUCCESS;
82 return StatusCode::SUCCESS;
91 if (inc.type()==
"BeginRun") {
101 const int crate =
index >> 10;
102 const int slot =
module + 5;
112 <<
" maps to crate/slot/pin/asic " << crate <<
"/"
113 << slot <<
"/" << pin <<
"/" << asic <<
endmsg;
120 ttId =
m_ttSvc->cnvToIdentifier(
id,
true);
126 if (ttId == invalidId) {
147 if (crate < 0 || crate >= 8 || module < 0 || module >= 16 ||
148 channel < 0 || channel >= 64)
return false;
159 const int side = ((
entry>>14) == 1) ? 1 : -1;
160 const int region = (
entry>>11)&0x3;
161 const int ieta = (
entry>>6)&0x1f;
162 const int iphi =
entry&0x3f;
163 const double etaOffsets[4] = { 0., 2.5, 3.1, 3.2 };
164 const double etaGrans[4] = { 0.1, 0.2, 0.1, 0.425 };
167 eta =
side * (etaOffsets[region] + etaGrans[region] * (ieta + 0.5));
168 phi = phiGrans[region] * (iphi + 0.5);
173 <<
"/" <<
channel <<
" maps to eta/phi/layer "
185 if (eta <= -4.9 || eta >= 4.9 || phi <= 0. || phi >= 2.*
M_PI)
return false;
187 const double etaOffsets[5] = { 0., 2.5, 3.1, 3.2, 4.9 };
188 const double etaGrans[4] = { 0.1, 0.2, 0.1, 0.425 };
190 const int side = (
eta < 0.) ? -1 : 1;
195 for (
int i = 0;
i < 4; ++
i) {
196 if (
absEta < etaOffsets[
i+1]) {
198 ieta =
int((
absEta - etaOffsets[
i]) / etaGrans[
i]);
211 <<
layer <<
" maps to side/layer/region/ieta/iphi "
212 <<
side <<
"/" <<
layer <<
"/" << region <<
"/"
213 << ieta <<
"/" << iphi <<
endmsg;
220 id =
m_ttSvc->createTTChannelID(ttId,
true);
226 if (
id == invalidId)
return false;
238 <<
" maps to crate/module/channel "
int channel(const HWIdentifier id) const
Scalar phi() const
phi method
Exception class for Calo Identifiers.
Scalar eta() const
pseudorapidity method
int region(const Identifier id) const
return region according to :
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