Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <CaloSuperCellIDTool.h>
Definition at line 29 of file CaloSuperCellIDTool.h.
◆ CaloSuperCellIDTool()
CaloSuperCellIDTool::CaloSuperCellIDTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Standard Gaudi tool constructor.
- Parameters
-
type | The name of the tool type. |
name | The tool name. |
parent | The tool's Gaudi parent. |
Definition at line 52 of file CaloSuperCellIDTool.cxx.
◆ addMapEntry()
Add an entry to the region mapping table.
Helper to add an entry to the region mapping table.
Definition at line 230 of file CaloSuperCellIDTool.cxx.
◆ initFCALIDMap()
void CaloSuperCellIDTool::initFCALIDMap |
( |
| ) |
|
|
private |
FCAL is a special case.
Definition at line 249 of file CaloSuperCellIDTool.cxx.
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;
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()));
◆ initialize()
StatusCode CaloSuperCellIDTool::initialize |
( |
| ) |
|
|
virtual |
◆ initIDMap()
void CaloSuperCellIDTool::initIDMap |
( |
| ) |
|
|
private |
Initialize the mapping table.
Definition at line 80 of file CaloSuperCellIDTool.cxx.
104 float inv_cell_etasize = 1. / cell_etasize;
110 if (inv_cell_etasize < 0)
break;
112 float inv_cell_phisize = 1. / cell_phisize;
114 float cell_etamax = cell_etamin +
115 cell_etasize*(cell_ietamax - cell_ietamin + 1);
131 float sc_etamax= sc_etamin + sc_etasize*(sc_ietamax - sc_ietamin + 1);
135 float etamax =
std::min (cell_etamax, sc_etamax);
142 elt.m_etadiv =
int (sc_etasize * inv_cell_etasize + 0.1);
143 elt.m_phidiv =
int (sc_phisize * inv_cell_phisize + 0.1);
147 elt.m_cell_ieta_adj = 0;
148 elt.m_sc_ieta_adj = 0;
151 elt.m_cell_ieta_adj = cell_ietamin;
152 elt.m_sc_ieta_adj = sc_ietamin;
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 +
183 elt.m_cell_ieta_adj = 0;
184 elt.m_sc_ieta_adj = 0;
198 for (
const IDMapElt& elt :
m_idmap) {
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;
◆ offlineToSuperCellID()
Given an offline cell identifier, return the corresponding supercell identifier.
If none exists, an invalid identifier is returned.
Definition at line 312 of file CaloSuperCellIDTool.cxx.
328 const IDMapElt& elt =
m_idmap[ndx];
329 if (elt.m_cell_ietamin <= ieta && elt.m_cell_ietamax >= ieta) {
333 int ieta_sc = ((ieta - elt.m_cell_ietamin + elt.m_cell_ieta_adj) /
335 elt.m_sc_ietamin - elt.m_sc_ieta_adj;
342 }
while (ndx < (
int)
m_idmap.size() &&
m_idmap[ndx].m_cell_reg == rhash);
386 int sample_sc = sample_offline;
◆ offlineToSuperCellRegion()
Given an offline region identifier, return the corresponding supercell region identifier(s).
There will normally be only one, but it's possible for there to be multiple matches. If none exists, an invalid identifier is returned.
Definition at line 511 of file CaloSuperCellIDTool.cxx.
513 std::vector<Identifier>
out;
521 m_idmap[ndx].m_cell_reg == rhash)
◆ superCellToOfflineID()
Given a supercell identifier, return the list of corresponding offline cell identifiers.
Definition at line 406 of file CaloSuperCellIDTool.cxx.
408 std::vector<Identifier>
out;
426 for (; ndx <
end; ++ndx) {
427 const IDMapElt& elt =
m_idmap[ndx];
428 if (elt.m_sc_reg == rhash &&
429 elt.m_sc_ietamin <= ieta &&
430 elt.m_sc_ietamax >= ieta)
435 int ieta0 = (ieta - elt.m_sc_ietamin + elt.m_sc_ieta_adj) * elt.m_etadiv +
436 elt.m_cell_ietamin - elt.m_cell_ieta_adj;
438 int ieta =
std::max (ieta0, elt.m_cell_ietamin);
439 int ietamax =
std::min (ieta0 + elt.m_etadiv - 1, elt.m_cell_ietamax);
443 for (; ieta <= ietamax; ++ieta) {
444 for (
int ip = 0;
ip < elt.m_phidiv;
ip++) {
473 out.push_back (cell_id);
479 out.push_back (cell_id);
482 out.push_back (cell_id);
489 out.push_back (cell_id);
493 out.push_back (cell_id);
495 out.push_back (cell_id);
◆ superCellToOfflineRegion()
Given a supercell region identifier, return the corresponding offline region identifier(s).
There will normally be only one, but it's possible for there to be multiple matches. If none exists, an invalid identifier is returned.
Definition at line 539 of file CaloSuperCellIDTool.cxx.
541 std::vector<Identifier>
out;
548 for (; ndx <
end; ++ndx) {
549 if (
m_idmap[ndx].m_sc_reg == rhash)
◆ m_cell_helper
◆ m_fcal_fromCell
std::vector<Identifier> CaloSuperCellIDTool::m_fcal_fromCell |
|
private |
◆ m_fcal_fromSuperCell
std::vector< std::vector<Identifier> > CaloSuperCellIDTool::m_fcal_fromSuperCell |
|
private |
◆ m_idmap
std::vector<IDMapElt> CaloSuperCellIDTool::m_idmap |
|
private |
◆ m_offlineIndex
std::vector<int> CaloSuperCellIDTool::m_offlineIndex |
|
private |
Entry I contains the index in the mapping table of the first entry for the offline region with hash I, or -1 if there is no mapping entry.
Definition at line 142 of file CaloSuperCellIDTool.h.
◆ m_sc_helper
◆ m_superCellIndex
std::vector<int> CaloSuperCellIDTool::m_superCellIndex |
|
private |
Entry I contains the index in the mapping table of the first entry for the supercell region with hash I, or -1 if there is no mapping entry.
Definition at line 146 of file CaloSuperCellIDTool.h.
◆ m_superCellIndexEnd
std::vector<int> CaloSuperCellIDTool::m_superCellIndexEnd |
|
private |
Entry I contains one past the index in the mapping table of the last entry for the supercell region with hash I, or -1 if there is no mapping entry.
Definition at line 151 of file CaloSuperCellIDTool.h.
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int tower(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
int pos_neg(const Identifier id) const
pos_neg : +/- 2 (A/C side)
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
int pos_neg(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
Identifier region_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy) const
Make a region ID from constituting fields and subCalo index; for (Mini)FCAL and Tiles,...
int module(const Identifier id) const
module [1,3]
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
bool is_tile(const Identifier id) const
test if the id belongs to the Tiles
int module(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
bool is_hec(const Identifier id) const
test if the id belongs to the HEC
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
const LArFCAL_SuperCell_ID * fcal_idHelper() const
access to FCAL idHelper
id_range fcal_range() const
Range over full set of FCAL Identifiers.
id_range reg_range(void) const
Range over set of region Identifiers (LAr + Tiles)
IdentifierHash calo_region_hash(const Identifier regionId) const
create hash id from 'global' region id
int phi(const Identifier id) const
phi [0,15]
Identifier region_id(int index) const
build single region, module, tower, cell, pmt, adc identifiers
bool is_em(const Identifier id) const
test if the id belongs to LArEM
float eta0(const Identifier regId) const
minimum LAr eta for this region
int sample(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
bool is_fcal(const Identifier id) const
test if the id belongs to the FCAL - true also for MiniFCAL
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
Identifier channel_id(const ExpandedIdentifier &exp_id) const
cell identifier for a channel from ExpandedIdentifier
This class factors out code common between TileID and Tile_SuperCell_ID.
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
#define CHECK(...)
Evaluate an expression and check for errors.
float phiGranularity(const Identifier regId) const
LAr phi granularity (NOT_VALID == failure)
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
int phi(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
int side(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Identifier cell_id(const Identifier &any_id) const
Helper class for LArFCAL offline identifiers.
size_type calo_region_hash_max(void) const
cell 'global' region table max size
const TileID * tile_idHelper() const
access to Tile idHelper
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
int section(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
float etaGranularity(const Identifier regId) const
LAr eta granularity (NOT_VALID == failure)