ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
CaloClusterCorr::SamplingHelper_Cluster Class Reference

Version of helper class for cells taken from the cluster itself. More...

Inheritance diagram for CaloClusterCorr::SamplingHelper_Cluster:
Collaboration diagram for CaloClusterCorr::SamplingHelper_Cluster:

Public Member Functions

 SamplingHelper_Cluster (const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster)
 Constructor. More...
 
virtual void calculate (double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)
 Calculate layer variables. More...
 
virtual const CaloCellmax_et_cell () const
 Return the cell with the maximum energy. More...
 
virtual bool empty () const
 Test for empty candidate cell list. More...
 
void calculate_cluster (double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling)
 Calculate layer variables for cells in the cluster. More...
 
void calculate_and_set (double eta, double phi, int layer, int fallback_layer, const CaloSampling::CaloSample samplings[4], bool allow_badpos=false)
 Calculate layer variables and update cluster. More...
 
CaloClustercluster ()
 Return the cluster we're updating. More...
 
double etam () const
 Return the \(\eta\) position from the last calculation. More...
 
double phim () const
 Return the \(\phi\) position from the last calculation. More...
 
double etamax () const
 Return the \(\eta\) maximum position from the last calculation. More...
 
double phimax () const
 Return the \(\phi\) maximum position from the last calculation. More...
 
double etareal () const
 
double deta (int layer) const
 
double dphi (int layer) const
 

Protected Attributes

CaloLayerCalculator m_calc
 The calculator object. More...
 
const CaloClusterCorrectionm_parent
 The correction object using us. More...
 
CaloClusterm_cluster
 The cluster we're updating. More...
 
CaloFillRectangularCluster::WindowArray_t m_windows
 Window size, per layer. More...
 
double m_etam
 \(\eta\) position from last calculation. More...
 
double m_phim
 \(\phi\) position from last calculation. More...
 

Detailed Description

Version of helper class for cells taken from the cluster itself.

Definition at line 666 of file CaloFillRectangularCluster.cxx.

Constructor & Destructor Documentation

◆ SamplingHelper_Cluster()

CaloClusterCorr::SamplingHelper_Cluster::SamplingHelper_Cluster ( const CaloClusterCorrection parent,
const CaloFillRectangularCluster::WindowArray_t windows,
CaloCluster cluster 
)

Constructor.

Parameters
parentThe parent correction class.
windowsPer-layer array of window eta,phi sizes.
clusterThe cluster being operated on.

Definition at line 717 of file CaloFillRectangularCluster.cxx.

721 {
722 }

Member Function Documentation

◆ calculate()

void CaloClusterCorr::SamplingHelper_Cluster::calculate ( double  eta,
double  phi,
double  deta,
double  dphi,
CaloSampling::CaloSample  sampling,
bool  dofill = false 
)
virtual

Calculate layer variables.

Parameters
etaCenter of the cluster in \(\eta\).
phiCenter of the cluster in \(\phi\).
detaFull width of the cluster in \(\eta\).
dphiFull width of the cluster in \(\phi\).
samplingThe sampling for which to do the calculation.
dofill(Ignored for this implementation.)

This method selects the cells within the specified window in the specified sampling from the list of candidate cells and calculates the layer variables.

The result of the calculation will be held in internal variables.

Implements CaloClusterCorr::SamplingHelper.

Definition at line 741 of file CaloFillRectangularCluster.cxx.

748 {
749  calculate_cluster (eta, phi, deta, dphi, sampling);
750 }

◆ calculate_and_set()

void CaloClusterCorr::SamplingHelper::calculate_and_set ( double  eta,
double  phi,
int  layer,
int  fallback_layer,
const CaloSampling::CaloSample  samplings[4],
bool  allow_badpos = false 
)
inherited

Calculate layer variables and update cluster.

Parameters
etaCenter of the cluster in \(\eta\).
phiCenter of the cluster in \(\phi\).
layerCalorimeter layer being calculated (0-3).
fallback_layerLayer for fallback values (see below).
samplingsList of samplings for this region.
allow_badposShould error flags be allowed into the cluster?

This method selects the cells within the specified window for the sampling for the specified layer from the current list of cells in the cluster and calculates the layer variables.

The result of the calculation will be held in internal variables. In addition, the cluster variables for this sampling will be updated with the result.

In some cases, the calculation of the cluster position may yield an error (for example, if there are no selected cells). In this case, we use the cluster eta/phi from the layer given by fallback_layer instead of the calculated result. (If fallback_layer is < 0, then we use the eta, phi arguments instead.) If allow_badpos is true, then the error flags are used to update the cluster variables; otherwise, the fallback position is used when updating the cluster.

Definition at line 383 of file CaloFillRectangularCluster.cxx.

390 {
391  calculate (eta, phi, deta(layer), dphi(layer), samplings[layer], true);
392 
393  double seteta = m_calc.etam();
394  double setphi = m_calc.phim();
395 
396  double fallback_eta = eta;
397  double fallback_phi = phi;
398  if ((seteta == -999 || setphi == -999) && fallback_layer >= 0 && fallback_layer < 4) {
399  // In the calo frame
400  fallback_eta = m_cluster->etaSample (samplings[fallback_layer]);
401  fallback_phi = m_cluster->phiSample (samplings[fallback_layer]);
402  }
403 
404  if (!allow_badpos) {
405  //if (m_etam == -999) m_etam = fallback_eta;
406  //if (m_phim == -999) m_phim = fallback_phi;
407  if (seteta == -999) seteta = fallback_eta;
408  if (setphi == -999) setphi = fallback_phi;
409  }
410 
411  //FIXME: Sampling pattern not yet set!
413  samplings[layer],
414  m_calc.em(),
415  seteta,
416  setphi,
417  m_calc.emax(),
418  m_calc.etamax(),
419  m_calc.phimax(),
420  m_calc.etas(),
421  m_calc.phis());
422  if (allow_badpos) {
423  if (m_etam == -999) m_etam = fallback_eta;
424  if (m_phim == -999) m_phim = fallback_phi;
425  }
426 }

◆ calculate_cluster()

void CaloClusterCorr::SamplingHelper::calculate_cluster ( double  eta,
double  phi,
double  deta,
double  dphi,
CaloSampling::CaloSample  sampling 
)
inherited

Calculate layer variables for cells in the cluster.

Parameters
etaCenter of the cluster in \(\eta\).
phiCenter of the cluster in \(\phi\).
detaFull width of the cluster in \(\eta\).
dphiFull width of the cluster in \(\phi\).
samplingThe sampling for which to do the calculation.

This method selects the cells within the specified window in the specified sampling from the current list of cells in the cluster and calculates the layer variables.

The result of the calculation will be held in internal variables.

Definition at line 444 of file CaloFillRectangularCluster.cxx.

450 {
452  eta, phi, deta, dphi, sampling);
453  m_etam = m_calc.etamr();
454  m_phim = m_calc.phimr();
455 }

◆ cluster()

CaloCluster * CaloClusterCorr::SamplingHelper::cluster ( )
inlineinherited

Return the cluster we're updating.

Definition at line 460 of file CaloFillRectangularCluster.cxx.

461 {
462  return m_cluster;
463 }

◆ deta()

double CaloClusterCorr::SamplingHelper::deta ( int  layer) const
inlineinherited

Definition at line 313 of file CaloFillRectangularCluster.cxx.

313 { return m_windows[layer].first; }

◆ dphi()

double CaloClusterCorr::SamplingHelper::dphi ( int  layer) const
inlineinherited

Definition at line 314 of file CaloFillRectangularCluster.cxx.

314 { return m_windows[layer].second; }

◆ empty()

bool CaloClusterCorr::SamplingHelper_Cluster::empty ( ) const
virtual

Test for empty candidate cell list.

Implements CaloClusterCorr::SamplingHelper.

Definition at line 763 of file CaloFillRectangularCluster.cxx.

764 {
765  return m_cluster->size()==0;
766 }

◆ etam()

double CaloClusterCorr::SamplingHelper::etam ( ) const
inlineinherited

Return the \(\eta\) position from the last calculation.

Definition at line 468 of file CaloFillRectangularCluster.cxx.

469 {
470  return m_etam;
471 }

◆ etamax()

double CaloClusterCorr::SamplingHelper::etamax ( ) const
inlineinherited

Return the \(\eta\) maximum position from the last calculation.

Definition at line 484 of file CaloFillRectangularCluster.cxx.

485 {
486  return m_calc.etarmax();
487 }

◆ etareal()

double CaloClusterCorr::SamplingHelper::etareal ( ) const
inlineinherited

Definition at line 310 of file CaloFillRectangularCluster.cxx.

310 { return m_calc.etam(); }

◆ max_et_cell()

const CaloCell * CaloClusterCorr::SamplingHelper_Cluster::max_et_cell ( ) const
virtual

Return the cell with the maximum energy.

Implements CaloClusterCorr::SamplingHelper.

Definition at line 754 of file CaloFillRectangularCluster.cxx.

755 {
756  return *std::max_element(std::as_const(*m_cluster).cell_begin(),
757  std::as_const(*m_cluster).cell_end(),
758  et_compare_larem_only());
759 }

◆ phim()

double CaloClusterCorr::SamplingHelper::phim ( ) const
inlineinherited

Return the \(\phi\) position from the last calculation.

Definition at line 476 of file CaloFillRectangularCluster.cxx.

477 {
478  return m_phim;
479 }

◆ phimax()

double CaloClusterCorr::SamplingHelper::phimax ( ) const
inlineinherited

Return the \(\phi\) maximum position from the last calculation.

Definition at line 492 of file CaloFillRectangularCluster.cxx.

493 {
494  return m_calc.phirmax();
495 }

Member Data Documentation

◆ m_calc

CaloLayerCalculator CaloClusterCorr::SamplingHelper::m_calc
protectedinherited

The calculator object.

Definition at line 319 of file CaloFillRectangularCluster.cxx.

◆ m_cluster

CaloCluster* CaloClusterCorr::SamplingHelper::m_cluster
protectedinherited

The cluster we're updating.

Definition at line 325 of file CaloFillRectangularCluster.cxx.

◆ m_etam

double CaloClusterCorr::SamplingHelper::m_etam
protectedinherited

\(\eta\) position from last calculation.

Definition at line 331 of file CaloFillRectangularCluster.cxx.

◆ m_parent

const CaloClusterCorrection& CaloClusterCorr::SamplingHelper::m_parent
protectedinherited

The correction object using us.

Definition at line 322 of file CaloFillRectangularCluster.cxx.

◆ m_phim

double CaloClusterCorr::SamplingHelper::m_phim
protectedinherited

\(\phi\) position from last calculation.

Definition at line 334 of file CaloFillRectangularCluster.cxx.

◆ m_windows

CaloFillRectangularCluster::WindowArray_t CaloClusterCorr::SamplingHelper::m_windows
protectedinherited

Window size, per layer.

Definition at line 328 of file CaloFillRectangularCluster.cxx.


The documentation for this class was generated from the following file:
CaloClusterCorr::SamplingHelper::m_phim
double m_phim
position from last calculation.
Definition: CaloFillRectangularCluster.cxx:334
CaloLayerCalculator::phimr
double phimr() const
Similar as phim, etam, phimax, etamax, but with raw quantities.
Definition: CaloLayerCalculator.h:218
CaloClusterCorrection::setsample
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
Definition: CaloClusterCorrection.cxx:74
CaloClusterCorr::SamplingHelper::m_etam
double m_etam
position from last calculation.
Definition: CaloFillRectangularCluster.cxx:331
CaloClusterCorr::SamplingHelper::SamplingHelper
SamplingHelper(const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster)
Constructor.
Definition: CaloFillRectangularCluster.cxx:344
CaloCluster::phiSample
double phiSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:1006
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloLayerCalculator::phimax
double phimax() const
Get maximum value.
Definition: CaloLayerCalculator.h:469
CaloClusterCorr::SamplingHelper::calculate
virtual void calculate(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)=0
Calculate layer variables — abstract method.
CaloLayerCalculator::phis
double phis() const
Get the RMS size.
Definition: CaloLayerCalculator.h:434
CaloCompositeCellBase::cell_end
cell_iterator cell_end() const
Retrieve a STL-type end() iterator for the cell store.
CaloClusterCorr::SamplingHelper::dphi
double dphi(int layer) const
Definition: CaloFillRectangularCluster.cxx:314
CaloClusterCorr::SamplingHelper::m_cluster
CaloCluster * m_cluster
The cluster we're updating.
Definition: CaloFillRectangularCluster.cxx:325
CaloClusterCorr::SamplingHelper::calculate_cluster
void calculate_cluster(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling)
Calculate layer variables for cells in the cluster.
Definition: CaloFillRectangularCluster.cxx:445
CaloClusterCorr::SamplingHelper::m_parent
const CaloClusterCorrection & m_parent
The correction object using us.
Definition: CaloFillRectangularCluster.cxx:322
CaloLayerCalculator::etarmax
double etarmax() const
Definition: CaloLayerCalculator.h:221
CaloLayerCalculator::phirmax
double phirmax() const
Definition: CaloLayerCalculator.h:220
CaloLayerCalculator::etam
double etam() const
Data access.
Definition: CaloLayerCalculator.h:401
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
CaloCluster::etaSample
double etaSample(sampling_type sampling) const
Retrieve barycenter in a given sample.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:991
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloLayerCalculator::etas
double etas() const
Get the RMS size.
Definition: CaloLayerCalculator.h:423
CaloClusterCorr::SamplingHelper::cluster
CaloCluster * cluster()
Return the cluster we're updating.
Definition: CaloFillRectangularCluster.cxx:460
CaloLayerCalculator::etamr
double etamr() const
Definition: CaloLayerCalculator.h:219
CaloLayerCalculator::etamax
double etamax() const
Get maximum value.
Definition: CaloLayerCalculator.h:457
CaloCompositeCellBase::cell_begin
cell_iterator cell_begin() const
Retrieve a STL-type begin() iterator for the cell store.
CaloClusterCorr::SamplingHelper::deta
double deta(int layer) const
Definition: CaloFillRectangularCluster.cxx:313
CaloLayerCalculator::emax
double emax() const
Get the maximum energy.
Definition: CaloLayerCalculator.h:480
CaloClusterCorr::SamplingHelper::m_calc
CaloLayerCalculator m_calc
The calculator object.
Definition: CaloFillRectangularCluster.cxx:319
CaloClusterCorr::SamplingHelper::m_windows
CaloFillRectangularCluster::WindowArray_t m_windows
Window size, per layer.
Definition: CaloFillRectangularCluster.cxx:328
CaloLayerCalculator::phim
double phim() const
Get the mean layer value.
Definition: CaloLayerCalculator.h:412
CaloLayerCalculator::fill
void fill(Iterator beg, Iterator end, double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, xAOD::CaloCluster *tofill=0)
Calculate layer variables from cells in a list.
Definition: CaloLayerCalculator.h:376
CaloLayerCalculator::em
double em() const
Get the total energy.
Definition: CaloLayerCalculator.h:445
windows
int windows(float distance, float eta_pivot, int thr, int sector)
Definition: windows.cxx:14