|
ATLAS Offline Software
|
#include <CaloTopoEMphioff.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 (xAOD::CaloCluster *cluster) final |
| 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< 1 > > | m_EdepA { this, "EdepA", "" } |
|
Constant< CxxUtils::Array< 1 > > | m_EdepB { this, "EdepB", "" } |
|
Constant< CxxUtils::Array< 1 > > | m_EtaFrontier { this, "EtaFrontier", "" } |
|
Constant< float > | m_Granularity { this, "Granularity", "" } |
|
Constant< int > | m_FlipPhi { this, "FlipPhi", "" } |
|
Constant< float > | m_EndcapOffset { this, "EndcapOffset", "" } |
|
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 26 of file CaloTopoEMphioff.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/4]
◆ execute() [2/4]
virtual StatusCode CaloClusterProcessor::execute |
|
inherited |
Execute on a single cluster.
- Parameters
-
cluster | The cluster to process. |
ctx | The event context. |
◆ execute() [3/4]
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 73 of file CaloClusterProcessor.cxx.
65 return StatusCode::SUCCESS;
◆ execute() [4/4]
StatusCode CaloClusterProcessor::execute |
|
finalinherited |
Execute on a single cluster.
- Parameters
-
cluster | The cluster to process. (deprecated) |
Definition at line 63 of file CaloClusterProcessor.cxx.
45 return execute (Gaudi::Hive::currentContext(), cluster);
◆ initialize()
StatusCode CaloClusterCorrection::initialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ 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)) {
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 \(\eta\) coordinate of the cluster. |
adj_eta | The \(\eta\) adjusted for any shift between the actual and nominal coordinates. (This is shifted back to the nominal coordinate system.) |
phi | The \(\phi\) coordinate of the cluster. |
adj_phi | The \(\phi\) adjusted for any shift between the actual and nominal coordinates. (This is shifted back to the nominal coordinate system.) |
samp | If we're looking at a particular sampling, this is the calorimeter sampling we're examining. It is a sampling code as defined by CaloSampling::CaloSample ; i.e., it has both the calorimeter region and sampling encoded. Otherwise, this is Unknown. |
Implements CaloClusterCorrectionCommon.
Definition at line 30 of file CaloTopoEMphioff.cxx.
40 float aeta = fabs(adj_eta);
41 float eclus = cluster->
e() * (1./
GeV);
50 ATH_MSG_DEBUG(
" ... e, eta, phi " << cluster->
e() <<
" " << cluster->
eta() <<
" " << cluster->
phi() <<
" " << samp <<
endmsg);
55 if (aeta < EtaFrontier[0])
57 qphioff =
m_EdepA(myctx)[iEtaBin]/sqrt(eclus) +
m_EdepB(myctx)[iEtaBin];
59 else if (aeta < EtaFrontier[2])
65 else if (aeta < EtaFrontier[3])
80 ATH_MSG_DEBUG(
" ... Phi off " << qphioff <<
" " << adj_eta <<
" " << eclus <<
" " << iEtaBin <<
endmsg);
87 ATH_MSG_DEBUG(
" ... e, eta, phi " << cluster->
e() <<
" " << cluster->
eta() <<
" " << cluster->
phi() <<
" " << samp <<
endmsg);
◆ 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 |
|
virtualinherited |
◆ 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 |
|
virtualinherited |
◆ 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. |
◆ CaloTopoEMphioff_versions
list CaloTopoEMphioff.CaloTopoEMphioff_versions |
Initial value:= [
['v1', cls, ['CaloTopoEMphioff.CaloTopoEMphioff_v1_parms',
'calotopoemcorr_pool', CALOCORR_COOL], keys],
['v2', cls, ['CaloTopoEMphioff.CaloTopoEMphioff_v2_parms',
'calotopoemcorr_pool', CALOCORR_COOL
], keys],
]
Definition at line 22 of file CaloTopoEMphioff.py.
◆ cls
CaloTopoEMphioff.cls = CompFactory.CaloTopoEMphioff |
◆ EndcapOffset
CaloTopoEMphioff.EndcapOffset |
◆ m_caloMgrKey
◆ m_DBHandle
◆ m_ddhelper
◆ m_EdepA
◆ m_EdepB
◆ m_EndcapOffset
Constant<float> CaloTopoEMphioff::m_EndcapOffset { this, "EndcapOffset", "" } |
|
private |
◆ m_EtaFrontier
◆ m_FlipPhi
Constant<int> CaloTopoEMphioff::m_FlipPhi { this, "FlipPhi", "" } |
|
private |
◆ m_Granularity
Constant<float> CaloTopoEMphioff::m_Granularity { this, "Granularity", "" } |
|
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 553 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 540 of file ToolWithConstants.h.
◆ m_prefix
Prefix for finding our constants within the ToolConstants object.
Definition at line 531 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.
The documentation for this class was generated from the following files:
virtual double phi() const
The azimuthal angle ( ) of the particle.
const CaloClusterCorr::DDHelper & ddhelper(const CaloDetDescrManager *dd_man) const
Retrieve the detector description helper, creating it if needed.
bool setPhisize(const CaloSample sampling, const float phiSize)
Set the cluster size in for 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.
Scalar phi() const
phi method
Scalar eta() const
pseudorapidity method
Constant< float > m_Granularity
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.
Constant< CxxUtils::Array< 1 > > m_EtaFrontier
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Constant< int > m_FlipPhi
bool setEnergy(const CaloSample sampling, const float e)
Set energy for a given sampling. Returns false if the sample isn't part of the cluster.
bool setEmax(const CaloSample sampling, const float eMax)
Set the Energy of the cell with the highest energy in a particular sampling.
float eta_raw() const
cell eta_raw
Constant< CxxUtils::Array< 1 > > m_EdepB
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
bool setPhimax(const CaloSample sampling, const float phiMax)
Set the phi of the cell with the highest energy in a particular sampling.
Description of a calorimeter cluster.
bool inEndcap() const
Returns true if at least one clustered cell in the endcap.
(Non-const) Iterator class for DataVector/DataList.
virtual double eta() const
The pseudorapidity ( ) of the particle.
Read-only multidimensional array.
bool inBarrel() const
Returns true if at least one clustered cell in the barrel.
Constant< CxxUtils::Array< 1 > > m_EdepA
#define CHECK(...)
Evaluate an expression and check for errors.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
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.
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
float eSample(const CaloSample sampling) const
This class provides the client interface for accessing the detector description information common to...
CaloCell_ID::CaloSample getSampling() const
cell sampling
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.
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool setEtamax(const CaloSample sampling, const float etaMax)
Set the eta of the cell with the highest energy in a particular sampling.
float eta() const
cell eta
float phi() const
cell phi
bool setEtasize(const CaloSample sampling, const float etaSize)
Set the cluster size in for a given sampling.
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override
virtual double e() const
The total energy of the particle.
Constant< float > m_EndcapOffset
float phi_raw() const
cell phi_raw
Constant< int > m_region
Calibration constant: The calorimeter region for which this correction is intended.