|
ATLAS Offline Software
|
Go to the documentation of this file.
21 #include "GaudiKernel/MsgStream.h"
22 #include "GaudiKernel/ThreadLocalContext.h"
39 bool barrel_p (
int region)
62 int sampling (
int region)
184 elt =
dd_try_gap (dd_man,region, cluster, eta, phi);
198 float deta = elt->
deta();
199 float dphi = elt->
dphi();
203 if (eta > elt->
eta() + deta/2)
205 else if (eta < elt->eta() - deta/2)
211 if (phi > elt->
phi() + dphi/2)
213 else if (phi < elt->phi() - dphi/2)
218 if (
good != 2 &&
n == 1) {
270 if (elt_b ==
nullptr)
272 else if (elt_e ==
nullptr)
316 if (!
descr)
return nullptr;
317 int ieta =
descr->eta_channel (eta);
320 int iphi =
descr->phi_channel (phi);
321 if (iphi < 0)
return nullptr;
322 unsigned int index = iphi;
344 if (!elt1)
return nullptr;
347 if (!elt2)
return nullptr;
362 int nphi =
descr->n_phi();
364 for (
int etasgn = 1; etasgn >= -1; etasgn -= 2) {
365 for (
int iphi = 0; iphi < nphi; iphi++) {
374 if (cellid_mgr->
cell_id (cellIdHash2) != cellId2)
379 auto elt = std::make_unique<DummyDetDescrElement>
380 (
descr->subcalo_hash(),
386 elt->set_cylindric_size (elt2->
deta(),
389 elt->set_cylindric (elt2->
eta() - etasgn * elt2->
deta(),
392 elt->set_cylindric_raw (elt2->
eta_raw() - etasgn * elt2->
deta(),
397 if (etasgn < 0)
index += nphi;
409 const std::string&
name,
465 if (barrel_p (region)) {
506 if (std::abs (
phi) > 900 || std::abs (
eta) > 900)
551 corrtab[n_good][0] = energies[
i];
583 unsigned int n_energies = energies.
size();
584 unsigned int shape[] = {n_energies, 2};
590 unsigned int beg = 0;
591 unsigned int end = n_energies;
592 if (
energy <= energies[0])
594 else if (
energy >= energies[n_energies-1])
600 docalc (
i,
builder, energies, corrtab, n_good);
604 while (n_good == 0 &&
beg > 0) {
606 docalc (
beg,
builder, energies, corrtab, n_good);
608 while (n_good == 0 &&
end < n_energies) {
609 docalc (
end,
builder, energies, corrtab, n_good);
620 else if (n_good == 1) {
622 return corrtab[0][1];
624 else if (
energy <= corrtab[0][0]) {
626 return corrtab[0][1];
628 else if (
energy >= corrtab[n_good-1][0]) {
630 return corrtab[n_good-1][1];
644 auto newhelper = std::make_unique<const CaloClusterCorr::DDHelper> (dd_man);
float deta() const
cell deta
const CaloDetDescrElement * dd_inner_strip_fixup(const CaloDetDescrManager *dd_man, int region, float eta, float phi) const
Work around innermost strip problem.
const CaloClusterCorr::DDHelper & ddhelper(const CaloDetDescrManager *dd_man) const
Retrieve the detector description helper, creating it if needed.
double eSample(sampling_type sampling) const
Retrieve energy in a given sampling.
const CaloDetDescrElement * find_dd_elt(const CaloDetDescrManager *dd_mgr, int region, const xAOD::CaloCluster *cluster, float eta, float phi) const
Find the detector descriptor element for a given position, correcting for DD edge bugs.
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
double phiSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
Scalar phi() const
phi method
Read-write multidimensional array.
double phiBE(int sampling) const
EMB/EMEC combined barycenter .
Scalar eta() const
pseudorapidity method
const EventContext & ctx() const
bool inBarrel() const
Returns true if at least one clustered cell in EMB.
unsigned int size(unsigned int dim=0) const
Return the size of the array along one dimension.
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *cluster) const override
Perform the correction.
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
CxxUtils::CachedUniquePtr< const CaloClusterCorr::DDHelper > m_ddhelper
Helper for detector description lookup.
static const CaloDetDescrElement * dd_try_gap(const CaloDetDescrManager *dd_man, int region, const CaloCluster *cluster, float eta, float phi)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition of CaloDetDescrManager.
float eta_raw() const
cell eta_raw
bool inEndcap() const
Returns true if at least one clustered cell in EMEC.
Helper, used to calculate the values of the energy interpolation table.
Definition of CaloDetDescriptor.
Description of a calorimeter cluster.
double etaSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
CaloClusterCorrectionCommon(const std::string &type, const std::string &name, const IInterface *parent)
Inherit constructor.
Read-only multidimensional array.
static const CaloDetDescrElement * find_dd_elt1(const CaloDetDescrManager *dd_mgr, int region, const CaloCluster *cluster, float eta, float phi)
Find the detector descriptor element for a given position.
void make_dummy_elts(const CaloDetDescrManager *dd_man)
Construct dummy DDEs used to work around innermost strip problem.
Principal data class for CaloCell clusters.
CaloPhiRange class declaration.
Helper class for offline cell identifiers.
double etaBE(int sampling) const
EMB/EMEC combined barycenter .
static double fix(double phi)
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 =0
Virtual function for the correction-specific code.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
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,...
std::vector< std::unique_ptr< const CaloDetDescrElement > > m_dummy_elts
Collection of dummy elements.
float r_raw() const
cell r_raw
float dphi() const
cell dphi
static float energy_interpolation(float energy, const TableBuilder &builder, const CaloRec::Array< 1 > &energies, int energy_degree)
Many of the corrections use the same method for doing the final interpolation in energy.
This class provides the client interface for accessing the detector description information common to...
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
virtual double eta() const
Retrieve eta independent of signal state.
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.
Context object for retrieving ToolConstant values.
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
float eta() const
cell eta
float phi() const
cell phi
virtual ~CaloClusterCorrectionCommon()
Destructor.
Polynomial interpolation in a table.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Calo Subsystem specific Detector Elements + Dummy element for testing.
DDHelper()=delete
delte default Constructor
float phi_raw() const
cell phi_raw
Constant< int > m_region
Calibration constant: The calorimeter region for which this correction is intended.
virtual double phi() const
Retrieve phi independent of signal state.
const CaloDetDescriptor * get_descriptor(const Identifier ®ionId) const
get descriptor by region identifier