Typesetting math: 100%
ATLAS Offline Software
#include <CaloTopoEMLongWeights.h >
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
Virtual function for the correction-specific code. More...
CaloClusterCorrectionCommon (const std::string &type, const std::string &name , const IInterface *parent)
Inherit constructor. More...
virtual void makeCorrection (const Context &myctx, xAOD::CaloCluster *cluster) const override
Perform the correction. More...
virtual StatusCode initialize () override
Initialize method. More...
virtual void setsample (xAOD::CaloCluster *cluster, CaloSampling::CaloSample sampling, float em, float etam, float phim, float emax, float etamax, float phimax, float etas, float phis) const
virtual void setenergy (xAOD::CaloCluster *cluster, float energy) const
StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const override
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const =0
Execute on a single cluster. More...
virtual StatusCode execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const
Execute on an entire collection of clusters. More...
Context context (const EventContext &ctx) const
Create a Context
object. More...
virtual void writeConstants (std::ostream &stream, const std::string &name , const EventContext &ctx) const
Dump method (for debugging) More...
virtual StatusCode mergeConstants (CaloRec::ToolConstants &out, const EventContext &ctx) const override
Merge our constants into out
with the proper prefix. More...
virtual int toolVersion () const
Return the version number for this tool. More...
virtual const std::string & toolType () const
Return the name of the type of this tool. More...
Constant < CxxUtils::Array < 2 > > m_correction { this, "correction", "" }
Constant < float > m_eta_start_crack { this, "eta_start_crack", "" }
Constant < float > m_eta_end_crack { this, "eta_end_crack", "" }
Constant < float > m_etamax { this, "etamax", "" }
Constant < int > m_degree { this, "degree", "" }
Constant < bool > m_use_raw_eta { this, "use_raw_eta", "" }
Constant < int > m_region { this, "region", "Calorimeter region" }
Calibration constant: The calorimeter region for which this correction is intended. More...
CxxUtils::CachedUniquePtr < const CaloClusterCorr::DDHelper > m_ddhelper
Helper for detector description lookup. More...
SG::ReadCondHandleKey < CaloRec::ToolConstants > m_DBHandle
Handle to a ToolConstants conditions object. More...
StringProperty m_prefix
Prefix for finding our constants within the ToolConstants object. More...
ToolWithConstantsImpl m_impl
Internal implementation object. More...
Constant < int > m_order
Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag. More...
Constant < bool > m_isdummy
If true, then this is a dummy tool that should not be executed. More...
Definition at line 24 of file CaloTopoEMLongWeights.h .
◆ base_class
◆ Constant
◆ Context
◆ anonymous enum
Region codes for m_region
below.
This is used to decide how to report the position of the cluster. Note: This numbering is also used in the job options files.
Enumerator EMB1
EMB2
EME1
EME2
COMBINED2
CLUSTER
NREGIONS
Definition at line 100 of file CaloClusterCorrectionCommon.h .
◆ CaloClusterCorrectionCommon()
CaloClusterCorrectionCommon::CaloClusterCorrectionCommon
◆ context()
Create a Context
object.
This can then be passed to Constant::operator()
.
◆ ddhelper()
Retrieve the detector description helper, creating it if needed.
Definition at line 640 of file CaloClusterCorrectionCommon.cxx .
644 auto newhelper = std::make_unique<const CaloClusterCorr::DDHelper> (dd_man);
◆ energy_interpolation()
Many of the corrections use the same method for doing the final interpolation in energy.
Perform energy interpolation.
We factor out this common code here. builder
is used to construct the interpolation table; energy
is the energy value for the interpolation. energies
is the list of energies at which we have tabulated values, and energy_degree
is the degree of the polynomial interpolation in energy.
Parameters
energy The energy value for the interpolation.
builder Helper to construct the interpolation table.
energies The energy interpolation table.
energy_degree The polynomial interpolation degree for the energy interpolation.
Many of the corrections use the same method for doing the final interpolation in energy. We factor out this common code here.
Definition at line 575 of file CaloClusterCorrectionCommon.cxx .
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];
◆ execute() [1/3]
◆ execute() [2/3]
virtual StatusCode CaloClusterProcessor::execute
inherited
Execute on a single cluster.
Parameters
cluster The cluster to process.
ctx The event context.
◆ execute() [3/3]
StatusCode CaloClusterProcessor::execute
inherited
Execute on an entire collection of clusters.
Parameters
collection The container of clusters.
This will iterate over all the clusters in collection
and call execute
on each one individually.
Parameters
collection The container of clusters.
ctx The event context.
This will iterate over all the clusters in collection
and call execute
on each one individually.
Definition at line 65 of file CaloClusterProcessor.cxx .
51 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CaloClusterCorrection::initialize
(
)
override virtual inherited
◆ makeCorrection()
Perform the correction.
Called by the tool
Parameters
myctx ToolWithConstants context.
cluster The cluster to correct. It is updated in place.
Called by the tool.
Parameters
myctx ToolWithConstants context.
cluster The cluster to correct. It is updated in place.
Does the following:
Checks whether the cluster is present in the given calorimeter and sampling. If not, do nothing.
Computes quantities to pass to makeTheCorrection
.
Calls makeTheCorrection
.
Implements CaloClusterCorrection .
Definition at line 436 of file CaloClusterCorrectionCommon.cxx .
465 if (barrel_p (region)) {
466 if (!
cluster ->inBarrel())
return ;
469 if (!
cluster ->inEndcap())
return ;
506 if (std::abs (
phi ) > 900 || std::abs (
eta ) > 900)
◆ makeTheCorrection()
Virtual function for the correction-specific code.
Parameters
myctx ToolWithConstants context.
cluster The cluster to correct. It is updated in place.
elt The detector description element corresponding to the cluster location.
eta The coordinate of the cluster, in this sampling.
adj_eta The adjusted for any shift between the actual and nominal coordinates. (This is shifted back to the nominal coordinate system.)
phi The coordinate of the cluster, in this sampling.
adj_phi The adjusted for any shift between the actual and nominal coordinates. (This is shifted back to the nominal coordinate system.)
samp The calorimeter sampling we're examining. This is a sampling code as defined by CaloSampling::CaloSample
; i.e., it has both the calorimeter region and sampling encoded.
Implements CaloClusterCorrectionCommon .
Definition at line 44 of file CaloTopoEMLongWeights.cxx .
59 the_aeta = std::abs (adj_eta);
61 the_aeta = std::abs (
eta );
63 const float etamax =
m_etamax (myctx);
64 if (the_aeta >= etamax)
return ;
70 if (the_aeta < eta_start_crack)
72 else if (the_aeta > eta_end_crack)
81 unsigned int shape[] = {2};
83 interp_barriers[0] = eta_start_crack;
84 interp_barriers[1] = eta_end_crack;
87 int ibin =
static_cast< int > (the_aeta / etamax *
correction .size());
124 for (
int sampling=0; sampling<4; ++sampling)
125 total +=
cluster ->eSample (samps[si][sampling]);
◆ mergeConstants()
Merge our constants into out
with the proper prefix.
Parameters
[out] out Object to receive our constants.
ctx Event context.
◆ setenergy()
void CaloClusterCorrection::setenergy
(
xAOD::CaloCluster *
cluster ,
float
energy
)
const
virtual inherited
◆ setsample()
void CaloClusterCorrection::setsample
(
xAOD::CaloCluster *
cluster ,
CaloSampling::CaloSample
sampling ,
float
em ,
float
etam ,
float
phim ,
float
emax ,
float
etamax ,
float
phimax ,
float
etas ,
float
phis
)
const
virtual inherited
◆ toolType()
Return the name of the type of this tool.
A saved set of constants includes both the C++ class name and a version number. Normally, the class name is taken from the Gaudi type() method, but that may be changed by overriding this method. This can be used, for example, when there are tools with distinct C++ classes but which are yet similar enough to combine together.
◆ toolVersion()
Return the version number for this tool.
A saved set of constants includes both the C++ class name and a version number. The idea is that the version number can be bumped whenever there's a backwards-incompatible change; this gives some protection against trying to use an old version of a tool with an incompatible newer set of constants.
If you want a tool to have a version number, override this method. Otherwise, it will default to a version number of 0.
◆ writeConstants()
Dump method (for debugging)
Parameters
stream Ostream to which to write.
name Name to go in output
ctx Event context.
◆ m_caloMgrKey
◆ m_correction
◆ m_DBHandle
◆ m_ddhelper
◆ m_degree
Constant <int> CaloTopoEMLongWeights::m_degree { this, "degree", "" }
private
◆ m_eta_end_crack
Constant <float> CaloTopoEMLongWeights::m_eta_end_crack { this, "eta_end_crack", "" }
private
◆ m_eta_start_crack
Constant <float> CaloTopoEMLongWeights::m_eta_start_crack { this, "eta_start_crack", "" }
private
◆ m_etamax
Constant <float> CaloTopoEMLongWeights::m_etamax { this, "etamax", "" }
private
◆ m_impl
◆ m_isdummy
If true, then this is a dummy tool that should not be executed.
This is used for the case of reading from COOL using hierarchical tags: we need to have such tags associated with some object in each folder, regardless of whether or not the correction from that folder is actually used. [Every folder that IOVDbSvc knows about at configuration time needs to have a valid object for the configured tag, else IOVDbSvc will raise a fatal error. But we don't know at configuration time which folders we're actually going to need, so we gotta configure all of them.]
Definition at line 560 of file ToolWithConstants.h .
◆ m_order
Used to fix the ordering of tools when we're initializing from COOL based on a hierarchical tag.
Tools should be executed in order of increasing m_order.
Definition at line 547 of file ToolWithConstants.h .
◆ m_prefix
Prefix for finding our constants within the ToolConstants object.
Definition at line 538 of file ToolWithConstants.h .
◆ m_region
Calibration constant: The calorimeter region for which this correction is intended.
This should be one of the constants above. This affects the meaning of the eta
and phi
arguments passed to makeTheCorrection
, as well as the samp
argument.
Definition at line 161 of file CaloClusterCorrectionCommon.h .
◆ m_use_raw_eta
Constant <bool> CaloTopoEMLongWeights::m_use_raw_eta { this, "use_raw_eta", "" }
private
The documentation for this class was generated from the following files:
const CaloClusterCorr::DDHelper & ddhelper(const CaloDetDescrManager *dd_man) const
Retrieve the detector description helper, creating it if needed.
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.
Constant< CxxUtils::Array< 2 > > m_correction
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
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...
CxxUtils::CachedUniquePtr< const CaloClusterCorr::DDHelper > m_ddhelper
Helper for detector description lookup.
float eta_raw() const
cell eta_raw
Description of a calorimeter cluster.
Read-only multidimensional array.
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.
Constant< float > m_eta_end_crack
StatusCode initialize(bool used=true)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
#define REPORT_MESSAGE(LVL)
Report a message.
virtual void makeCorrection(const Context &myctx, xAOD::CaloCluster *) const =0
Constant< float > m_eta_start_crack
This class provides the client interface for accessing the detector description information common to...
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.
float eta() const
cell eta
float phi() const
cell phi
Constant< bool > m_use_raw_eta
Constant< float > m_etamax
StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override
float phi_raw() const
cell phi_raw
Constant< int > m_region
Calibration constant: The calorimeter region for which this correction is intended.