|
ATLAS Offline Software
|
Tower geometry store and description provider.
More...
#include <CaloTowerGeometry.h>
Tower geometry store and description provider.
This service sets up a lookup table storing the geometrical area overlap fraction of a calorimeter cell with towers in a given grid. This lookup table is set up at instantiation of the service. It can only be defined at that time. The default setup is a \( \Delta\eta\times\Delta\phi = 0.1 \times \pi/32 \) grid. Any regular grid can be constructed. The grid definition can be provided as property.
The cell-to-tower information is stored internally as a (random access) lookup table. For a given cell, the hash index is used to retrieve a list of towers this cell overlaps with, and the overlap paramater (area fraction used as a geometrical weight). This indices and geometrical weights are represented by a list of pairs of int
and double
numbers. Each cell can potential overlap with more than one tower. A more detailed description of towers and the geometrical overlap is available on the calorimeter tower project page.
The lookup table is implemented for random access and using the cell hash identifier to retrieve the requested list of twoer indices and weights. Several retrieval mechanisms are supported (see documentation of the corresponding methods).
To map the azimuth of a cell to a tower, \( -\pi < \phi < \pi \) is used (ATLAS standard). For consistency, all \( \phi \) values are mapped into this range.
The service inherits from AthService
and thus from the Service
base class in Gaudi. The managed tower grid is defined by service properties, with the following naming convention:
- pseudorapidity range
- number of bins
TowerEtaBins
(default 100)
- lower boundary of pseudorapidity range
TowerEtaMin
(default -5.0)
- upper boundary of pseudorapidity range
TowerEtaMax
(default 5.0)
- azimuth range
- number of bins
TowerPhiBins
(default 64)
- lower boundary of azimuthal range
TowerPhiMin
(default -π)
- upper boundary of azimuthal range
TowerPhiMax
(default π)
Addtional properties of this service define the granularity of the cell splitting in the ATLAS FCal. This is used to map the FCal readout cells (rectangular slabs) onto the tower grid and calculate the geometrical (area) overlap fraction, which is used to distribute the cell energy to the towers.
- horizontal FCal cell splitting (along x axis)
- number of x slices in FCal1
FCal1NSlicesX
(default 4)
- number of x slices in FCal2
FCal2NSlicesX
(default 4)
- number of x slices in FCal3
FCal3NSlicesX
(default 6)
- vertical FCal cell splitting (along y axis)
- number of y slices in FCal1
FCal1NSlicesY
(default 4)
- number of y slices in FCal2
FCal2NSlicesY
(default 6)
- number of y slices in FCal3
FCal3NSlicesY
(default 6)
- Warning
- It is recommended to not change the parameters for the FCal cell slicing. This configuration option is provided for expert use for R & D purposes only.
- Todo:
- Allow regional grids (varying segmentation as function of \( \eta \) . This requires additional interfaces (or interface changes) and and modifications of the index construction.
- Author
- Peter Loch loch@.nosp@m.phys.nosp@m.ics.a.nosp@m.rizo.nosp@m.na.ed.nosp@m.u
Definition at line 23 of file CaloTowerGeometry.h.
◆ element_t
◆ elementmap_t
Type for lists of lists of elements (lookup table type)
Definition at line 30 of file CaloTowerGeometry.h.
◆ elementvector_t
Type for list of elements holding tower index and list of weights.
Definition at line 29 of file CaloTowerGeometry.h.
◆ index_t
Type for scalar (pseudorapidity,azimuth) index (is an unsigned int type)
Definition at line 27 of file CaloTowerGeometry.h.
◆ uint_t
◆ CaloTowerGeometry() [1/2]
◆ CaloTowerGeometry() [2/2]
CaloTowerGeometry::CaloTowerGeometry |
( |
| ) |
|
|
delete |
◆ access()
StatusCode CaloTowerGeometry::access |
( |
IdentifierHash |
cellHash, |
|
|
std::vector< index_t > & |
towerIdx, |
|
|
std::vector< double > & |
towerWghts |
|
) |
| const |
Retrieve the list of towers associated with a calorimeter cell referenced its hash identifier.
The tower indices and weights are returned in two index-parallel vectors. Previous content of these two vectors is removed if this method finds towers for the cell.
- Returns
- Returns
StatusCode::SUCCESS
if list of towers found, else @s StatusCode::FAILURE.
- Parameters
-
[in] | cellHash | hash identifier referencing a calorimeter cell. |
[in] | towerIdx | reference to modifiable vector of indices (payload type index_t ); vector is filled if cell is successfully mapped. |
[in] | towerWghts | reference to modifiable vector of weights (payload type double ); vector is filled if cell is successfully mapped. |
Definition at line 234 of file CaloTowerGeometry.cxx.
243 return StatusCode::SUCCESS;
251 return StatusCode::SUCCESS;
◆ begin()
CaloTowerGeometry::elementmap_t::const_iterator CaloTowerGeometry::begin |
( |
| ) |
const |
|
inline |
Iterator points to first entry in internal look-up table (only const
access!)
Definition at line 329 of file CaloTowerGeometry.h.
◆ cellWeight() [1/2]
Retrieve cell signal weight from lookup table entry.
Definition at line 337 of file CaloTowerGeometry.h.
337 {
return std::get<1>(elm); }
◆ cellWeight() [2/2]
◆ empty()
bool CaloTowerGeometry::empty |
( |
| ) |
const |
|
inline |
◆ end()
CaloTowerGeometry::elementmap_t::const_iterator CaloTowerGeometry::end |
( |
| ) |
const |
|
inline |
Iterator marks end of internal look-up table (only const
access)
Definition at line 330 of file CaloTowerGeometry.h.
◆ etaBins()
◆ etaIndex() [1/2]
◆ etaIndex() [2/2]
Get tower \( \eta \) bin index for a calorimeter cell referenced by its hash identifier.
Definition at line 287 of file CaloTowerGeometry.cxx.
◆ etaIndexFromTowerIndex()
Get tower \( \eta \) bin index for a given global tower index.
Definition at line 315 of file CaloTowerGeometry.h.
◆ etaMax()
double CaloTowerGeometry::etaMax |
( |
| ) |
const |
|
inline |
◆ etaMin()
double CaloTowerGeometry::etaMin |
( |
| ) |
const |
|
inline |
◆ etaWidth()
double CaloTowerGeometry::etaWidth |
( |
| ) |
const |
|
inline |
◆ f_assign()
Internally used function assigning tower to cell with update of weight if same tower is already assigned.
Definition at line 218 of file CaloTowerGeometry.cxx.
◆ f_caloDDE()
Retrieve calorimeter detector description element for a given cell hash identifier.
Definition at line 344 of file CaloTowerGeometry.h.
◆ f_caloDDM()
◆ f_cellEta()
Retrieve calorimeter cell pseudorapidity for a given cell hash identifier.
Definition at line 346 of file CaloTowerGeometry.h.
◆ f_cellPhi()
Retrieve calorimeter cell azimuth for a given cell hash identifier.
Definition at line 347 of file CaloTowerGeometry.h.
◆ f_setupTowerGrid()
StatusCode CaloTowerGeometry::f_setupTowerGrid |
( |
MsgStream & |
msg | ) |
|
|
private |
Internally used function setting up the lookup store.
Definition at line 61 of file CaloTowerGeometry.cxx.
66 return StatusCode::FAILURE;
83 msg << MSG::WARNING <<
"Cell hash identifier out of range " << cidx <<
"/" <<
m_towerLookup.size() <<
", ignore cell" <<
endmsg;
93 return StatusCode::SUCCESS;
◆ f_setupTowerGridFCal()
Internally used function mapping an FCal cell onto the tower grid.
Definition at line 96 of file CaloTowerGeometry.cxx.
106 double cXpos(pCaloDDE->
x_raw());
107 double cYpos(pCaloDDE->
y_raw());
108 double cZpos(pCaloDDE->
z_raw());
109 double cZpos2(cZpos*cZpos);
111 double cXwid(pCaloDDE->
dx());
112 double cYwid(pCaloDDE->
dy());
120 double cXstp(cXwid/((
double)nXslice));
121 double cYstp(cYwid/((
double)nYslice));
125 double x(cXpos-(cXwid-cXstp)/2.);
126 double xlim(cXpos+cXwid/2.);
double ylim(cYpos+cYwid/2.);
133 double y(cYpos-(cYwid-cYstp)/2.);
135 double r(std::sqrt(
x*
x+
y*
y+cZpos2));
137 bool etaAdjusted(
false);
153 msg << MSG::WARNING <<
"Found invalid tower index for FCal cell (eta,phi) = (" <<
eta <<
"," <<
phi <<
") at (x,y,z) = ("
154 <<
x <<
"," <<
y <<
"," << cZpos <<
") [cell ignored]" <<
endmsg;
158 msg << MSG::WARNING <<
"FCal cell direction (eta,phi) = (" << etaOrig <<
"," <<
phi <<
") for cell at (x,y,z) = ("
159 <<
x <<
"," <<
y <<
"," << cZpos <<
") adjusted to (eta,phi) = (" <<
eta <<
"," <<
phi <<
") [cell adjusted]" <<
endmsg;
167 return StatusCode::SUCCESS;
◆ f_setupTowerGridProj()
Internally used function mapping a projective cell onto the tower grid.
Definition at line 170 of file CaloTowerGeometry.cxx.
173 double cEtaPos(pCaloDDE->
eta_raw());
174 double cEtaWid(pCaloDDE->
deta());
175 double cPhiPos(pCaloDDE->
phi_raw());
176 double cPhiWid(pCaloDDE->
dphi());
183 if ( kEta > 1 || kPhi > 1 ) {
185 << std::dec <<
"] spawning several towers."
186 <<
" Neta = " << kEta <<
", Nphi = " << kPhi <<
endmsg;
190 double cWght(1./((
double)kEta*kPhi));
191 double sEta(cEtaWid/((
double)kEta));
192 double sPhi(cPhiWid/((
double)kPhi));
193 double oEta(cEtaPos-sEta/2.);
194 double oPhi(cPhiPos-sPhi/2.);
198 double ceta(oEta+((
double)
ie-0.5)*sEta);
200 double cphi(oPhi+((
double)
ip-0.5)*sPhi);
204 msg << MSG::ERROR <<
"Found invalid tower index for non-FCal cell (id,eta,phi) = (" << pCaloDDE->
calo_hash()
205 <<
"," << ceta <<
"," << cphi <<
")" <<
endmsg;
206 return StatusCode::FAILURE;
211 return StatusCode::SUCCESS;
◆ getTowers()
Retrieve the list of towers associated with a calorimeter cell referenced by its hash identifier.
- Returns
- Returns a vector of (index,weight) pairs as a
elementvector_t
container. The container is empty if the cell does not have any overlap with a tower.
- Parameters
-
[in] | cellHash | hash identifier referencing a calorimeter cell. |
Definition at line 254 of file CaloTowerGeometry.cxx.
◆ initialize()
StatusCode CaloTowerGeometry::initialize |
( |
MsgStream & |
msg | ) |
|
Initialize object.
Definition at line 32 of file CaloTowerGeometry.cxx.
44 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
◆ invalidIndex()
◆ invalidValue()
double CaloTowerGeometry::invalidValue |
( |
| ) |
const |
|
inline |
◆ isInvalidEtaIndex()
bool CaloTowerGeometry::isInvalidEtaIndex |
( |
index_t |
idx | ) |
const |
|
inline |
Returns true
if argument is not a valid pseudorapidity index.
Definition at line 301 of file CaloTowerGeometry.h.
◆ isInvalidIndex() [1/2]
bool CaloTowerGeometry::isInvalidIndex |
( |
index_t |
idx | ) |
const |
|
inline |
◆ isInvalidIndex() [2/2]
bool CaloTowerGeometry::isInvalidIndex |
( |
index_t |
idx, |
|
|
index_t |
maxIdx |
|
) |
| const |
|
inline |
Returns true
if first argument is equal to the value provided by invalidIndex()
or if first argument is not smaller than second argument.
Definition at line 300 of file CaloTowerGeometry.h.
◆ isInvalidPhiIndex()
bool CaloTowerGeometry::isInvalidPhiIndex |
( |
index_t |
idx | ) |
const |
|
inline |
◆ isInvalidTowerIndex()
bool CaloTowerGeometry::isInvalidTowerIndex |
( |
index_t |
idx | ) |
const |
|
inline |
◆ isInvalidValue()
bool CaloTowerGeometry::isInvalidValue |
( |
double |
val | ) |
const |
|
inline |
◆ maxCellHash()
◆ phiBins()
◆ phiIndex() [1/2]
◆ phiIndex() [2/2]
Get tower \( \phi \) bin index for a calorimeter cell referenced by its hash identifier.
Definition at line 300 of file CaloTowerGeometry.cxx.
◆ phiIndexFromTowerIndex()
Get tower \( \phi \) bin index for a given global tower index.
Definition at line 316 of file CaloTowerGeometry.h.
◆ phiMax()
double CaloTowerGeometry::phiMax |
( |
| ) |
const |
|
inline |
◆ phiMin()
double CaloTowerGeometry::phiMin |
( |
| ) |
const |
|
inline |
◆ phiWidth()
double CaloTowerGeometry::phiWidth |
( |
| ) |
const |
|
inline |
◆ size()
size_t CaloTowerGeometry::size |
( |
| ) |
const |
|
inline |
◆ totalNumberCells()
◆ towerArea()
double CaloTowerGeometry::towerArea |
( |
| ) |
const |
|
inline |
◆ towerBins()
◆ towerEta()
double CaloTowerGeometry::towerEta |
( |
index_t |
towerIndex | ) |
const |
|
inline |
Return pseudorapidity from global tower index (bin center)
Definition at line 326 of file CaloTowerGeometry.h.
◆ towerEtaLocal()
double CaloTowerGeometry::towerEtaLocal |
( |
index_t |
etaIndex | ) |
const |
|
inline |
◆ towerIndex() [1/4]
Get global tower index from payload data.
Definition at line 313 of file CaloTowerGeometry.h.
313 {
return std::get<0>(elm); }
◆ towerIndex() [2/4]
Get global tower index for a pair of \( (\eta,\phi) \) values.
Definition at line 310 of file CaloTowerGeometry.h.
◆ towerIndex() [3/4]
Get global tower index for a calorimeter cell referenced by its hash identifier.
Definition at line 309 of file CaloTowerGeometry.h.
◆ towerIndex() [4/4]
Get global tower index for a pair of \( (\eta,\phi) \) indices.
Definition at line 311 of file CaloTowerGeometry.h.
◆ towerPhi()
double CaloTowerGeometry::towerPhi |
( |
index_t |
towerIndex | ) |
const |
|
inline |
◆ towerPhiLocal()
double CaloTowerGeometry::towerPhiLocal |
( |
index_t |
phiIndex | ) |
const |
|
inline |
◆ CaloTowerGeometryCondAlg
◆ m_adjustEta
bool CaloTowerGeometry::m_adjustEta |
|
protected |
◆ m_caloDDM
◆ m_fcal1Xslice
double CaloTowerGeometry::m_fcal1Xslice |
|
protected |
◆ m_fcal1Yslice
double CaloTowerGeometry::m_fcal1Yslice |
|
protected |
◆ m_fcal2Xslice
double CaloTowerGeometry::m_fcal2Xslice |
|
protected |
◆ m_fcal2Yslice
double CaloTowerGeometry::m_fcal2Yslice |
|
protected |
◆ m_fcal3Xslice
double CaloTowerGeometry::m_fcal3Xslice |
|
protected |
◆ m_fcal3Yslice
double CaloTowerGeometry::m_fcal3Yslice |
|
protected |
◆ m_invalidIndex
◆ m_invalidValue
const double CaloTowerGeometry::m_invalidValue = -999. |
|
staticprotected |
Return value for out-of-range indices andother invalid conversions to a physical quantity.
Definition at line 157 of file CaloTowerGeometry.h.
◆ m_maxCellHash
uint_t CaloTowerGeometry::m_maxCellHash |
|
protected |
◆ m_ndxFCal
std::array<double,3> CaloTowerGeometry::m_ndxFCal {} |
|
protected |
◆ m_ndyFCal
std::array<double,3> CaloTowerGeometry::m_ndyFCal {} |
|
protected |
◆ m_numberOfCells
uint_t CaloTowerGeometry::m_numberOfCells {} |
|
protected |
◆ m_towerArea
double CaloTowerGeometry::m_towerArea |
|
protected |
◆ m_towerBins
uint_t CaloTowerGeometry::m_towerBins |
|
protected |
◆ m_towerEtaBins
uint_t CaloTowerGeometry::m_towerEtaBins |
|
protected |
◆ m_towerEtaMax
double CaloTowerGeometry::m_towerEtaMax |
|
protected |
◆ m_towerEtaMin
double CaloTowerGeometry::m_towerEtaMin |
|
protected |
◆ m_towerEtaWidth
double CaloTowerGeometry::m_towerEtaWidth |
|
protected |
◆ m_towerLookup
◆ m_towerPhiBins
uint_t CaloTowerGeometry::m_towerPhiBins |
|
protected |
◆ m_towerPhiMax
double CaloTowerGeometry::m_towerPhiMax |
|
protected |
◆ m_towerPhiMin
double CaloTowerGeometry::m_towerPhiMin |
|
protected |
◆ m_towerPhiWidth
double CaloTowerGeometry::m_towerPhiWidth |
|
protected |
◆ m_wgtFCal
std::array<double,3> CaloTowerGeometry::m_wgtFCal {} |
|
protected |
The documentation for this class was generated from the following files:
float deta() const
cell deta
double m_fcal2Yslice
Number of y slices for cells in FCal2.
Scalar phi() const
phi method
calo_element_const_iterator element_end() const
end of element vector
double towerPhiLocal(index_t phiIndex) const
Return azimuth from local index (bin center)
bool isInvalidEtaIndex(index_t idx) const
Returns true if argument is not a valid pseudorapidity index.
Scalar eta() const
pseudorapidity method
double etaWidth() const
Width of pseudorapidity bin
double m_towerEtaWidth
Width of tower bin in pseudorapidity.
IdentifierHash::value_type index_t
Type for scalar (pseudorapidity,azimuth) index (is an unsigned int type)
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
double m_fcal1Yslice
Number of y slices for cells in FCal1.
std::vector< element_t > elementvector_t
Type for list of elements holding tower index and list of weights.
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
uint_t phiBins() const
Number of azimuth bins.
value_type get_compact() const
Get the compact id.
bool isInvalidPhiIndex(index_t idx) const
Returns true if argumant is not a valid azimuth index.
StatusCode f_setupTowerGridProj(const CaloDetDescrElement *pCaloDDE, MsgStream &msg)
Internally used function mapping a projective cell onto the tower grid.
const CaloDetDescrManager * m_caloDDM
Pointer to calorimeter detector description.
double m_towerEtaMax
Upper boundary .
double phiMin() const
Lower boundary of azimuth.
const CaloDetDescrElement * f_caloDDE(IdentifierHash cellHash) const
Retrieve calorimeter detector description element for a given cell hash identifier.
uint_t m_towerBins
Maximum number of towers.
double etaMin() const
Lower boundary of pseudorapidity range.
float eta_raw() const
cell eta_raw
std::array< double, 3 > m_ndyFCal
Stores number of fragments along y for each FCal module.
uint_t m_maxCellHash
Maximum cell hash value.
Identifier identify() const override final
cell identifier
double m_towerPhiMin
Lower boundary .
IdentifierHash calo_hash() const
cell calo hash
index_t etaIndexFromTowerIndex(index_t towerIdx) const
Get tower bin index for a given global tower index.
index_t phiIndex(IdentifierHash cellHash) const
Get tower bin index for a calorimeter cell referenced by its hash identifier.
index_t etaIndex(IdentifierHash cellHash) const
Get tower bin index for a calorimeter cell referenced by its hash identifier.
double m_towerPhiMax
Upper boundary .
double m_fcal3Xslice
Number of x slices for cells in FCal3.
double phiWidth() const
Width of azimuth bin.
double towerEtaLocal(index_t etaIndex) const
Return pseudorapdity from local index (bin center)
std::size_t uint_t
Type for unsigned integer.
const CaloDetDescrManager * f_caloDDM() const
Pointer to calorimeter detector description manager.
bool is_lar_fcal() const
cell belongs to FCAL
static double fix(double phi)
uint_t m_numberOfCells
Total number of cells.
elementmap_t m_towerLookup
Cell-to-tower mapping lookup store.
float x_raw() const
cell x_raw
float z_raw() const
cell z_raw
calo_element_const_iterator element_begin() const
first element
StatusCode f_setupTowerGridFCal(const CaloDetDescrElement *pCaloDDE, MsgStream &msg)
Internally used function mapping an FCal cell onto the tower grid.
StatusCode f_setupTowerGrid(MsgStream &msg)
Internally used function setting up the lookup store.
uint_t m_towerEtaBins
Number of bins.
std::tuple< index_t, double > element_t
Type storing tower index and geometrical weight.
double m_fcal1Xslice
Number of x slices for cells in FCal1.
index_t towerIndex(IdentifierHash cellHash) const
Get global tower index for a calorimeter cell referenced by its hash identifier.
float dphi() const
cell dphi
virtual int getLayer() const
cell layer
calo_element_vec_size element_size() const
total number of elements
double m_fcal2Xslice
Number of x slices for cells in FCal2.
bool m_adjustEta
Adjust FCal cells to eta boundary (default true )
double m_towerEtaMin
Lower boundary .
double f_assign(IdentifierHash cellHash, index_t towerIdx, double wgt)
Internally used function assigning tower to cell with update of weight if same tower is already assig...
float eta() const
cell eta
double m_towerPhiWidth
Width of tower bin in azimuth.
static const index_t m_invalidIndex
Invalid index indicator.
float y_raw() const
cell y_raw
double m_fcal3Yslice
Number of y slices for cells in FCal3.
index_t phiIndexFromTowerIndex(index_t towerIdx) const
Get tower bin index for a given global tower index.
double cellWeight(const element_t &elm) const
Retrieve cell signal weight from lookup table entry.
double invalidValue() const
Return invalid value.
std::array< double, 3 > m_wgtFCal
Stores geometrical weights.
index_t invalidIndex() const
Returns value of invalid index.
static const double m_invalidValue
Return value for out-of-range indices andother invalid conversions to a physical quantity.
bool isInvalidIndex(index_t idx) const
Returns true if argument is equal to the value provided by invalidIndex()
double m_towerArea
Area of individual tower.
float phi_raw() const
cell phi_raw
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
std::array< double, 3 > m_ndxFCal
Stores number of fragments along x for each FCal module.
uint_t m_towerPhiBins
Number of bins.