|
ATLAS Offline Software
|
#include <CaloSwDeadOTX_back.h>
|
virtual void | makeTheCorrection (const Context &muctx, 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. More...
|
|
virtual StatusCode | initialize () override |
| Initialize method. 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 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...
|
|
|
SG::ReadCondHandleKey< CaloAffectedRegionInfoVec > | m_affKey |
|
ToolHandle< ICaloAffectedTool > | m_affectedTool {this, "AffectedTool", "CaloAffectedTool", "affected tool instance"} |
|
Constant< CxxUtils::Array< 3 > > | m_correction { this, "correction", "" } |
|
Constant< CxxUtils::Array< 2 > > | m_sampling_depth { this, "sampling_depth", ""} |
|
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< 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 20 of file CaloSwDeadOTX_back.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 CaloSwDeadOTX_back::initialize |
( |
| ) |
|
|
overridevirtual |
Initialize method.
Derived classes must call this.
Reimplemented from CaloClusterCorrection.
Definition at line 29 of file CaloSwDeadOTX_back.cxx.
39 ATH_MSG_DEBUG(
" --------------->>>>> CaloSwDeadOTX_back :: retrieving affectedTool" <<
endmsg);
42 ATH_MSG_DEBUG(
" --------------->>>>> CaloSwDeadOTX_back :: failure retrieving affectedTool !! " <<
endmsg);
43 return StatusCode::FAILURE;
46 ATH_MSG_DEBUG(
" --------------->>>>> CaloSwDeadOTX_back :: affectedTool successfully retrieved" <<
endmsg);
48 return StatusCode::SUCCESS;
◆ 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, in this sampling. |
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, in this sampling. |
adj_phi | The \(\phi\) 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 51 of file CaloSwDeadOTX_back.cxx.
69 ATH_MSG_WARNING(
"Do not have affected regions info, is this expected ?");
74 the_aeta = std::abs (adj_eta);
76 the_aeta = std::abs (eta);
78 const float etamax =
m_etamax (myctx);
79 if (the_aeta >= etamax)
return;
93 ATH_MSG_DEBUG(
"************************************************************************************************" <<
endmsg);
94 ATH_MSG_DEBUG(
" USING CALIBHITS CALIBRATION : apply correction for dead OTX in the back" <<
endmsg);
96 ATH_MSG_DEBUG(
"************************************************************************************************" <<
endmsg);
115 float eneBackold = cluster->
eSample (samps[si][3]) ;
121 int layer = si * 4 + 3 ;
140 int ibin = (
static_cast<int> (the_aeta / etamax * 100)) ;
150 double raw_energy =0;
151 double shower_lbary_raw =0;
152 for (
int nl = 0 ; nl< 4 ; nl++){
153 raw_energy += cluster->
eSample (samps[si][nl]);
157 if (raw_energy == 0)
return;
158 double shower_lbary = shower_lbary_raw / raw_energy;
162 double depth_max = 20. + raw_energy*(3./
TeV) ;
164 if ( shower_lbary > depth_max || shower_lbary < 0.) {
171 raw_energy = raw_energy * 1
e-3;
178 double e_acc_reco = 0;
179 for (
int nl = 1 ; nl< 4 ; nl++){
180 e_acc_reco += cluster->
eSample (samps[si][nl]);
184 <<
" " << lleak[2] <<
" " << lleak[3] <<
endmsg);
186 double e_leak_perc = lleak[3] + lleak[1] * shower_lbary + lleak[2] *
exp(shower_lbary);
190 if (e_leak_perc < 0 ) e_leak_perc = 0.;
191 if (e_leak_perc > 100.) e_leak_perc = 100.;
193 double e_leak_reco = e_leak_perc * (e_acc_reco)*0.01;
196 if (e_leak_reco<0.) e_leak_reco= eneBackold;
203 cluster->
setEnergy (samps[si][3], e_leak_reco );
207 ATH_MSG_DEBUG(
"CaloSwDeadOTX_back:: cluster energy before correction --> " << cluster->
e() <<
endmsg);
211 float e_temp = cluster->
e() - eneBackold + e_leak_reco ;
214 cluster->
setE (e_temp);
◆ 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. |
◆ CaloSwDeadOTX_back_versions
list CaloSwDeadOTX_back.CaloSwDeadOTX_back_versions |
Initial value:= [
['v1', cls, ['CaloSwDeadOTX_back_v1.' +
'CaloSwDeadOTX_back_v1_parms',
'caloswcorr_pool', CALOCORR_COOL,
],
['ele55', 'ele35', 'ele37',
'gam55_conv', 'gam35_conv', 'gam37_conv',
'gam55_unconv', 'gam35_unconv', 'gam37_unconv',
'ele33', 'ele57', 'ele77',
'gam33_conv', 'gam57_conv', 'gam77_conv',
'gam33_unconv', 'gam57_unconv', 'gam77_unconv'] ]
]
Definition at line 19 of file CaloSwDeadOTX_back.py.
◆ cls
CaloSwDeadOTX_back.cls = CompFactory.CaloSwDeadOTX_back |
◆ m_affectedTool
◆ m_affKey
Initial value:{this,
"LArAffectedRegionKey", "LArAffectedRegionInfo", "SG key for affected regions cond object"}
Definition at line 65 of file CaloSwDeadOTX_back.h.
◆ m_caloMgrKey
◆ m_correction
◆ m_DBHandle
◆ m_ddhelper
◆ m_eta_end_crack
Constant<float> CaloSwDeadOTX_back::m_eta_end_crack { this, "eta_end_crack", "" } |
|
private |
◆ m_eta_start_crack
Constant<float> CaloSwDeadOTX_back::m_eta_start_crack { this, "eta_start_crack",""} |
|
private |
◆ m_etamax
Constant<float> CaloSwDeadOTX_back::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 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.
◆ m_sampling_depth
◆ m_use_raw_eta
Constant<bool> CaloSwDeadOTX_back::m_use_raw_eta { this, "use_raw_eta", "" } |
|
private |
The documentation for this class was generated from the following files:
virtual double phi() const
The azimuthal angle ( ) of the particle.
std::vector< CaloAffectedRegionInfo > CaloAffectedRegionInfoVec
const CaloClusterCorr::DDHelper & ddhelper(const CaloDetDescrManager *dd_man) const
Retrieve the detector description helper, creating it if needed.
Constant< float > m_eta_start_crack
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
Constant< CxxUtils::Array< 2 > > m_sampling_depth
ToolHandle< ICaloAffectedTool > m_affectedTool
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...
Constant< float > m_etamax
CxxUtils::CachedUniquePtr< const CaloClusterCorr::DDHelper > m_ddhelper
Helper for detector description lookup.
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
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.
virtual StatusCode initialize() override
Initialize method.
float eta_raw() const
cell eta_raw
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.
#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)
Constant< bool > m_use_raw_eta
Constant< float > m_eta_end_crack
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...
#define ATH_MSG_WARNING(x)
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.
Constant< CxxUtils::Array< 3 > > m_correction
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
SG::ReadCondHandleKey< CaloAffectedRegionInfoVec > m_affKey
virtual double e() const
The total energy of the particle.
float phi_raw() const
cell phi_raw
Constant< int > m_region
Calibration constant: The calorimeter region for which this correction is intended.