ATLAS Offline Software
Loading...
Searching...
No Matches
CaloSwPhimod_v2::Builder Class Reference

Helper class for calculating the energy interpolation table. More...

Inheritance diagram for CaloSwPhimod_v2::Builder:
Collaboration diagram for CaloSwPhimod_v2::Builder:

Public Member Functions

 Builder (const CxxUtils::Array< 3 > &correction, const CxxUtils::Array< 1 > &interp_barriers, int degree, float correction_coef, float aeta, float phi, int nabs)
 Constructor.
virtual float calculate (int energy_ndx, bool &good) const
 Calculate the correction for tabulated energy ENERGY_NDX.

Private Attributes

const CxxUtils::Array< 3 > m_correction
 The correction table.
const CxxUtils::Array< 1 > m_interp_barriers
 Allow breaking up the interpolation into independent regions.
int m_degree
 Interpolation degree.
float m_correction_coef
 Coefficient by which to scale the entire correction.
float m_aeta
 The abs(eta) at which the correction is being evaluated (in cal-local coordinates).
float m_phi
 The cluster phi.
int m_nabs
 Number of absorbers in \(2\pi\).

Detailed Description

Helper class for calculating the energy interpolation table.

Definition at line 130 of file CaloSwPhimod_v2.h.

Constructor & Destructor Documentation

◆ Builder()

CaloSwPhimod_v2::Builder::Builder ( const CxxUtils::Array< 3 > & correction,
const CxxUtils::Array< 1 > & interp_barriers,
int degree,
float correction_coef,
float aeta,
float phi,
int nabs )

Constructor.

Constructor for energy interpolation table helper class.

Gets the correction information, the abs(eta) and phi at which the correction is being evaluated (in cal-local coordinates), and the number of absorbers.

Parameters
correctionThe correction table.
interp_barriersAllow breaking up the interpolation into independent regions.
degreeInterpolation degree.
correction_coefCoefficient by which to scale the entire correction.
aetaThe absolute value of \(\eta\) at which the correction is being evaluated (in cal-local coordinates).
phiThe \(\phi\) at which the correction is being evaluated (in cal-local coordinates).
nabsNumber of absorbers in \(2\pi\).

Definition at line 138 of file CaloSwPhimod_v2.cxx.

145 : m_correction (correction),
146 m_interp_barriers (interp_barriers),
147 m_degree (degree),
148 m_correction_coef (correction_coef),
149 m_aeta (aeta),
150 m_phi (phi),
151 m_nabs (nabs)
152{
153}
Scalar phi() const
phi method
float m_aeta
The abs(eta) at which the correction is being evaluated (in cal-local coordinates).
const CxxUtils::Array< 1 > m_interp_barriers
Allow breaking up the interpolation into independent regions.
int m_nabs
Number of absorbers in .
int m_degree
Interpolation degree.
float m_correction_coef
Coefficient by which to scale the entire correction.
float m_phi
The cluster phi.
const CxxUtils::Array< 3 > m_correction
The correction table.

Member Function Documentation

◆ calculate()

float CaloSwPhimod_v2::Builder::calculate ( int energy_ndx,
bool & good ) const
virtual

Calculate the correction for tabulated energy ENERGY_NDX.

Calculate the correction for one tabulated energy index.

Parameters
energy_ndxThe tabulated energy index for which the correction should be calculated.
good[out]Set to true if the calculation succeeds.

Definition at line 162 of file CaloSwPhimod_v2.cxx.

163{
164 good = true;
165 float par[4];
166 for (int j=0; j<4; j++) {
167 par[j] = interpolate (m_correction[energy_ndx],
168 m_aeta,
169 m_degree,
170 j+1,
172 }
173 double a = atan (par[2])*(1./pi) + 0.5;
174 return 1 + m_correction_coef * abs (par[0]) *
175 (a*cos(m_nabs*m_phi + par[1]) +
176 (1-a)*cos (2*m_nabs*m_phi + par[3]));
177}
static Double_t a
#define pi
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > &regions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.

Member Data Documentation

◆ m_aeta

float CaloSwPhimod_v2::Builder::m_aeta
private

The abs(eta) at which the correction is being evaluated (in cal-local coordinates).

Definition at line 162 of file CaloSwPhimod_v2.h.

◆ m_correction

const CxxUtils::Array<3> CaloSwPhimod_v2::Builder::m_correction
private

The correction table.

Definition at line 149 of file CaloSwPhimod_v2.h.

◆ m_correction_coef

float CaloSwPhimod_v2::Builder::m_correction_coef
private

Coefficient by which to scale the entire correction.

Definition at line 158 of file CaloSwPhimod_v2.h.

◆ m_degree

int CaloSwPhimod_v2::Builder::m_degree
private

Interpolation degree.

Definition at line 155 of file CaloSwPhimod_v2.h.

◆ m_interp_barriers

const CxxUtils::Array<1> CaloSwPhimod_v2::Builder::m_interp_barriers
private

Allow breaking up the interpolation into independent regions.

Definition at line 152 of file CaloSwPhimod_v2.h.

◆ m_nabs

int CaloSwPhimod_v2::Builder::m_nabs
private

Number of absorbers in \(2\pi\).

Definition at line 168 of file CaloSwPhimod_v2.h.

◆ m_phi

float CaloSwPhimod_v2::Builder::m_phi
private

The cluster phi.

Definition at line 165 of file CaloSwPhimod_v2.h.


The documentation for this class was generated from the following files: