ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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. More...
 
virtual float calculate (int energy_ndx, bool &good) const
 Calculate the correction for tabulated energy ENERGY_NDX. More...
 

Private Attributes

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

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.

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 }

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.

Implements CaloClusterCorrectionCommon::TableBuilder.

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 }

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:
CaloSwPhimod_v2::Builder::m_aeta
float m_aeta
The abs(eta) at which the correction is being evaluated (in cal-local coordinates).
Definition: CaloSwPhimod_v2.h:162
CaloSwPhimod_v2::Builder::m_correction
const CxxUtils::Array< 3 > m_correction
The correction table.
Definition: CaloSwPhimod_v2.h:149
CaloSwPhimod_v2::Builder::m_interp_barriers
const CxxUtils::Array< 1 > m_interp_barriers
Allow breaking up the interpolation into independent regions.
Definition: CaloSwPhimod_v2.h:152
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
pi
#define pi
Definition: TileMuonFitter.cxx:65
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
CaloSwPhimod_v2::Builder::m_phi
float m_phi
The cluster phi.
Definition: CaloSwPhimod_v2.h:165
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
CaloSwPhimod_v2::Builder::m_nabs
int m_nabs
Number of absorbers in .
Definition: CaloSwPhimod_v2.h:168
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
ReadBchFromCool.good
good
Definition: ReadBchFromCool.py:433
a
TList * a
Definition: liststreamerinfos.cxx:10
CaloSwPhimod_v2::Builder::m_correction_coef
float m_correction_coef
Coefficient by which to scale the entire correction.
Definition: CaloSwPhimod_v2.h:158
CaloClusterCorr::interpolate
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.
Definition: interpolate.cxx:75
CaloSwPhimod_v2::Builder::m_degree
int m_degree
Interpolation degree.
Definition: CaloSwPhimod_v2.h:155
python.SystemOfUnits.degree
tuple degree
Definition: SystemOfUnits.py:106