![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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 232 of file CaloSuperCellIDTool.cxx.
◆ initFCALIDMap()
void CaloSuperCellIDTool::initFCALIDMap |
( |
| ) |
|
|
private |
FCAL is a special case.
Definition at line 251 of file CaloSuperCellIDTool.cxx.
262 const int sc_phi = fcal_helper->
phi (cell_id);
263 const int sc_lay = fcal_helper->
module (cell_id);
264 const int cell_ieta = fcal_helper->
eta (cell_id);
265 int sc_pn = fcal_helper->
pos_neg( cell_id );
268 sc_ieta = cell_ieta / 4;
270 else if (sc_lay==2) {
271 sc_ieta = cell_ieta / 4;
273 else if (sc_lay==1) {
276 else if (cell_ieta < 24)
279 sc_ieta = 2 + (cell_ieta-24)/4;
290 msg(
MSG::DEBUG) <<
"\n LArFCAL ---------------------------\n";
296 (
" %5d %2d/%2d/%2d/%2d ... %2d cells\n") %
299 sfcal_helper->
module(sc_id) %
300 sfcal_helper->
eta(sc_id) %
301 sfcal_helper->
phi(sc_id) %
◆ 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) {
203 (
" %3d %d/%2d/%2d/%d %3d %d/%2d/%2d/%d %d %d %3d %3d %3d %3d %3d %3d\n") %
204 (
int)elt.m_cell_reg %
215 elt.m_etadiv % elt.m_phidiv %
216 elt.m_cell_ietamin % elt.m_cell_ietamax %
217 elt.m_sc_ietamin % elt.m_sc_ietamax %
218 elt.m_cell_ieta_adj % elt.m_sc_ieta_adj;
225 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 315 of file CaloSuperCellIDTool.cxx.
331 const IDMapElt& elt =
m_idmap[ndx];
332 if (elt.m_cell_ietamin <= ieta && elt.m_cell_ietamax >= ieta) {
336 int ieta_sc = ((ieta - elt.m_cell_ietamin + elt.m_cell_ieta_adj) /
338 elt.m_sc_ietamin - elt.m_sc_ieta_adj;
345 }
while (ndx < (
int)
m_idmap.size() &&
m_idmap[ndx].m_cell_reg == rhash);
389 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 514 of file CaloSuperCellIDTool.cxx.
516 std::vector<Identifier>
out;
524 m_idmap[ndx].m_cell_reg == rhash)
◆ superCellToOfflineID()
Given a supercell identifier, return the list of corresponding offline cell identifiers.
Definition at line 409 of file CaloSuperCellIDTool.cxx.
411 std::vector<Identifier>
out;
429 for (; ndx <
end; ++ndx) {
430 const IDMapElt& elt =
m_idmap[ndx];
431 if (elt.m_sc_reg == rhash &&
432 elt.m_sc_ietamin <= ieta &&
433 elt.m_sc_ietamax >= ieta)
438 int ieta0 = (ieta - elt.m_sc_ietamin + elt.m_sc_ieta_adj) * elt.m_etadiv +
439 elt.m_cell_ietamin - elt.m_cell_ieta_adj;
441 int ieta =
std::max (ieta0, elt.m_cell_ietamin);
442 int ietamax =
std::min (ieta0 + elt.m_etadiv - 1, elt.m_cell_ietamax);
446 for (; ieta <= ietamax; ++ieta) {
447 for (
int ip = 0;
ip < elt.m_phidiv;
ip++) {
476 out.push_back (cell_id);
482 out.push_back (cell_id);
485 out.push_back (cell_id);
492 out.push_back (cell_id);
496 out.push_back (cell_id);
498 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 542 of file CaloSuperCellIDTool.cxx.
544 std::vector<Identifier>
out;
551 for (; ndx <
end; ++ndx) {
552 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)
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)