PPM crate/module/channel to eta/phi/layer mappings.
More...
#include <PpmCoolMappingTool.h>
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | finalize () override |
|
virtual void | handle (const Incident &) override |
|
virtual bool | mapping (int crate, int module, int channel, double &eta, double &phi, int &layer) const override |
| Return eta, phi and layer mapping for given crate/module/channel. More...
|
|
virtual bool | mapping (double eta, double phi, int layer, int &crate, int &module, int &channel) const override |
| Return crate, module and channel mapping for given eta/phi/layer. More...
|
|
PPM crate/module/channel to eta/phi/layer mappings.
Uses COOL channel mapping tools
- Author
- Peter Faulkner
Definition at line 33 of file PpmCoolMappingTool.h.
◆ finalize()
StatusCode LVL1::PpmCoolMappingTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ handle()
void LVL1::PpmCoolMappingTool::handle |
( |
const Incident & |
inc | ) |
|
|
overridevirtual |
Definition at line 87 of file PpmCoolMappingTool.cxx.
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) {
◆ initialize()
StatusCode LVL1::PpmCoolMappingTool::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 28 of file PpmCoolMappingTool.cxx.
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;
◆ mapping() [1/2]
bool LVL1::PpmCoolMappingTool::mapping |
( |
double |
eta, |
|
|
double |
phi, |
|
|
int |
layer, |
|
|
int & |
crate, |
|
|
int & |
module, |
|
|
int & |
channel |
|
) |
| const |
|
overridevirtual |
Return crate, module and channel mapping for given eta/phi/layer.
Definition at line 182 of file PpmCoolMappingTool.cxx.
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 "
◆ mapping() [2/2]
bool LVL1::PpmCoolMappingTool::mapping |
( |
int |
crate, |
|
|
int |
module, |
|
|
int |
channel, |
|
|
double & |
eta, |
|
|
double & |
phi, |
|
|
int & |
layer |
|
) |
| const |
|
overridevirtual |
Return eta, phi and layer mapping for given crate/module/channel.
Definition at line 144 of file PpmCoolMappingTool.cxx.
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 "
◆ m_idTable
std::vector<unsigned int> LVL1::PpmCoolMappingTool::m_idTable |
|
private |
◆ m_l1ttonlineHelper
◆ m_lvl1Helper
◆ m_ttSvc
◆ s_maxTableEntries
const int LVL1::PpmCoolMappingTool::s_maxTableEntries = 8192 |
|
staticprivate |
The documentation for this class was generated from the following files:
HWIdentifier channelId(int crate, int module, int submodule, int channel) const
(1) create towerId from fields