34#include "CLHEP/Units/PhysicalConstants.h"
38#include "GaudiKernel/MsgStream.h"
39#include "GaudiKernel/StatusCode.h"
53const double deta = 0.2;
54const double dphi =
twopi / 64. ;
67 return StatusCode::SUCCESS;
105 the_aeta = std::abs (adj_eta);
107 the_aeta = std::abs (
eta);
123 for ( ; f_cell!=l_cell; ++f_cell)
127 if (CaloCell_ID::TileGap3 == cell->caloDDE()->getSampling()) {
128 double phic = cell->phi();
129 double etac = cell->eta();
132 if (etac >=
eta-deta && etac <=
eta+deta) {
133 if (phic >=
phi-dphi && phic <=
phi+dphi) {
134 eh_scint += cell->e();
141 const int degree =
m_degree (myctx);
145 float a = interpolate (correction, the_aeta, degree, 1);
146 float alpha = interpolate (correction, the_aeta, degree, 2);
147 float offset = interpolate (correction, the_aeta, degree, 3);
150 float ec = cluster->
e();
154 cluster->
setE (
a*(ec + alpha*eh_scint + offset));
164 (
const std::string& name)
166 return this->
setProperty (StringProperty (
"cells_name", name));
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
EM calorimeter gap corrections.
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
Data object for each calorimeter readout cell.
virtual void setenergy(xAOD::CaloCluster *cluster, float energy) const
virtual StatusCode initialize() override
Initialize method.
Principal data class for CaloCell clusters.
virtual double e() const
Retrieve energy independent of signal state.
virtual void setE(double e)
Set energy.
This class groups all DetDescr information related to a CaloCell.
virtual StatusCode initialize() override
Standard Gaudi initialize method.
Constant< float > m_etamax_crack
Constant< int > m_degree
Calibration constant: The interpolation degree.
virtual void makeTheCorrection(const Context &myctx, xAOD::CaloCluster *cluster, const CaloDetDescrElement *elt, float eta, float adj_eta, float phi, float adj_phi, CaloSampling::CaloSample samp) const override
Virtual function for the correction-specific code.
Constant< float > m_etamin_crack
Calibration constants: The range over which this correction is defined.
Constant< bool > m_use_raw_eta
Calibration constant: If true, tabulated values are in terms of raw (local) eta.
SG::ReadHandleKey< CaloCellContainer > m_cells_name
Property: The name of the container in which to look to find tile cells.
virtual StatusCode setCaloCellContainerName(const std::string &name) override
Change the name of the CaloCellContainer used by this tool.
Constant< CxxUtils::Array< 2 > > m_correction
Calibration constant: The tabulated array of correction weights, A and alpha.
Read-only multidimensional array.
DataModel_detail::const_iterator< DataVector > const_iterator
Polynomial interpolation in a table.
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > ®ions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
const EventContext & ctx() const