|
ATLAS Offline Software
|
Go to the documentation of this file.
4 namespace { constexpr
auto pi = 3.14159265358979323846; }
44 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
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;
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;
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;
243 return StatusCode::SUCCESS;
251 return StatusCode::SUCCESS;
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
Scalar eta() const
pseudorapidity method
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)
StatusCode 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.
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.
value_type get_compact() const
Get the compact id.
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 .
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.
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.
CaloTowerGeometry()=delete
Identifier identify() const override final
cell identifier
double m_towerPhiMin
Lower boundary .
IdentifierHash calo_hash() const
cell calo hash
index_t phiIndex(IdentifierHash cellHash) const
Get tower bin index for a calorimeter cell referenced by its hash identifier.
::StatusCode StatusCode
StatusCode definition for legacy code.
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.
std::size_t uint_t
Type for unsigned integer.
bool is_lar_fcal() const
cell belongs to FCAL
static double fix(double phi)
int32_t index_t
The index type of the node in the vector.
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
This class provides the client interface for accessing the detector description information common to...
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 )
StatusCode initialize(MsgStream &msg)
Initialize object.
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...
double m_towerPhiWidth
Width of tower bin in azimuth.
static const index_t m_invalidIndex
Invalid index indicator.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
float y_raw() const
cell y_raw
double m_fcal3Yslice
Number of y slices for cells in FCal3.
double cellWeight(const element_t &elm) const
Retrieve cell signal weight from lookup table entry.
std::array< double, 3 > m_wgtFCal
Stores geometrical weights.
elementvector_t getTowers(IdentifierHash cellHash) const
Retrieve the list of towers associated with a calorimeter cell referenced by its hash identifier.
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.