36 return idhelper->
side (
id);
53 const std::string& name,
54 const IInterface* parent)
55 : base_class (
type, name, parent),
67 CHECK( base_class::initialize() );
73 return StatusCode::SUCCESS;
103 float cell_etasize =
m_cell_helper->etaGranularity(cell_reg);
104 float inv_cell_etasize = 1. / cell_etasize;
110 if (inv_cell_etasize < 0)
break;
111 float cell_phisize =
m_cell_helper->phiGranularity(cell_reg);
112 float inv_cell_phisize = 1. / cell_phisize;
114 float cell_etamax = cell_etamin +
115 cell_etasize*(cell_ietamax - cell_ietamin + 1);
128 float sc_etasize =
m_sc_helper->etaGranularity(sc_reg);
129 float sc_phisize =
m_sc_helper->phiGranularity(sc_reg);
131 float sc_etamax= sc_etamin + sc_etasize*(sc_ietamax - sc_ietamin + 1);
134 float etamin = std::max (cell_etamin, sc_etamin);
135 float etamax = std::min (cell_etamax, sc_etamax);
137 if (etamin < etamax - 1e-4) {
142 elt.
m_etadiv = int (sc_etasize * inv_cell_etasize + 0.1);
143 elt.
m_phidiv = int (sc_phisize * inv_cell_phisize + 0.1);
155 elt.
m_cell_ietamin = int ((etamin - cell_etamin) * inv_cell_etasize +
157 elt.
m_cell_ietamax = int ((etamax - cell_etamin) * inv_cell_etasize +
159 const float inv_sc_etasize = 1. / sc_etasize;
160 elt.
m_sc_ietamin = int ((etamin - sc_etamin) * inv_sc_etasize +
162 elt.
m_sc_ietamax = int ((etamax - sc_etamin) * inv_sc_etasize +
195 if (msgLvl (MSG::DEBUG)) {
196 msg(MSG::DEBUG) <<
"CaloSuperCellIDTool mapping table:\n";
197 msg(MSG::DEBUG) <<
"LArEM ----------------------------\n";
202 std::format(
" {:3d} {}/{:2d}/{:2d}/{} {:3d} {}/{:2d}/{:2d}/{} {} {} {:3d} {:3d} {:3d} {:3d} {:3d} {:3d}\n",
203 static_cast<int>(elt.m_cell_reg),
208 static_cast<int>(elt.m_sc_reg),
213 elt.m_etadiv, elt.m_phidiv,
214 elt.m_cell_ietamin, elt.m_cell_ietamax,
215 elt.m_sc_ietamin, elt.m_sc_ietamax,
216 elt.m_cell_ieta_adj, elt.m_sc_ieta_adj);
223 msg(MSG::INFO ) <<
"Done with initIDMap" <<
endmsg;
260 const int sc_phi = fcal_helper->
phi (cell_id);
261 const int sc_lay = fcal_helper->module (cell_id);
262 const int cell_ieta = fcal_helper->
eta (cell_id);
263 int sc_pn = fcal_helper->
pos_neg( cell_id );
266 sc_ieta = cell_ieta / 4;
268 else if (sc_lay==2) {
269 sc_ieta = cell_ieta / 4;
271 else if (sc_lay==1) {
274 else if (cell_ieta < 24)
277 sc_ieta = 2 + (cell_ieta-24)/4;
287 if (msgLvl (MSG::DEBUG)) {
288 msg(MSG::DEBUG) <<
"\n LArFCAL ---------------------------\n";
293 std::format(
" {:5d} {:2d}/{:2d}/{:2d}/{:2d} ... {:2d} cells\n",
294 static_cast<int>(sc_hash),
295 static_cast<int>(sfcal_helper->
pos_neg(sc_id)),
296 static_cast<int>(sfcal_helper->module(sc_id)),
297 static_cast<int>(sfcal_helper->
eta(sc_id)),
298 static_cast<int>(sfcal_helper->
phi(sc_id)),
299 static_cast<int>(cells.size()));
342 }
while (ndx < (
int)
m_idmap.size() &&
m_idmap[ndx].m_cell_reg == rhash);
386 int sample_sc = sample_offline;
405std::vector<Identifier>
408 std::vector<Identifier> out;
426 for (; ndx < end; ++ndx) {
443 for (; ieta <= ietamax; ++ieta) {
444 for (
int ip = 0; ip < elt.
m_phidiv; ip++) {
445 out.push_back(
m_cell_helper->cell_id (cell_reg_id, ieta, iphi0+ip));
472 if (tile_helper->
cell_id (reg_id, module, 9, sample, cell_id))
473 out.push_back (cell_id);
479 out.push_back (cell_id);
482 out.push_back (cell_id);
488 if (tile_helper->
cell_id (reg_id, module, tower, sample, cell_id))
489 out.push_back (cell_id);
493 out.push_back (cell_id);
495 out.push_back (cell_id);
510std::vector<Identifier>
513 std::vector<Identifier> out;
521 m_idmap[ndx].m_cell_reg == rhash)
538std::vector<Identifier>
541 std::vector<Identifier> out;
548 for (; ndx < end; ++ndx) {
549 if (
m_idmap[ndx].m_sc_reg == rhash)
Helper base class for offline cell identifiers.
Helper class for offline supercell identifiers.
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
Helper base class for offline cell identifiers.
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int section(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
int side(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
This is a "hash" representation of an Identifier.
id_range fcal_range() const
Range over full set of FCAL Identifiers.
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
int phi(const Identifier id) const
phi [0,15]
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
Helper class for LArFCAL offline identifiers.
This class factors out code common between TileID and Tile_SuperCell_ID.
Identifier cell_id(const Identifier &any_id) const
Identifier region_id(int index) const
build single region, module, tower, cell, pmt, adc identifiers