ATLAS Offline Software
Loading...
Searching...
No Matches
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.
virtual void calculate (double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)
 Calculate layer variables.
virtual const CaloCellmax_et_cell () const
 Return the cell with the maximum energy.
virtual bool empty () const
 Test for empty candidate cell list.
void calculate_cluster (double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling)
 Calculate layer variables for cells in the cluster.
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.
CaloClustercluster ()
 Return the cluster we're updating.
double etam () const
 Return the \(\eta\) position from the last calculation.
double phim () const
 Return the \(\phi\) position from the last calculation.
double etamax () const
 Return the \(\eta\) maximum position from the last calculation.
double phimax () const
 Return the \(\phi\) maximum position from the last calculation.
double etareal () const
double deta (int layer) const
double dphi (int layer) const

Protected Attributes

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

Detailed Description

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

Definition at line 667 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 718 of file CaloFillRectangularCluster.cxx.

721 : SamplingHelper (parent, windows, cluster)
722{
723}
SamplingHelper(const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster)
Constructor.
CaloCluster * cluster()
Return the cluster we're updating.
int windows(float distance, float eta_pivot, int thr, int sector)
Definition windows.cxx:14

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 742 of file CaloFillRectangularCluster.cxx.

749{
750 calculate_cluster (eta, phi, deta, dphi, sampling);
751}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
void calculate_cluster(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling)
Calculate layer variables for cells in the cluster.

◆ 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 384 of file CaloFillRectangularCluster.cxx.

391{
392 calculate (eta, phi, deta(layer), dphi(layer), samplings[layer], true);
393
394 double seteta = m_calc.etam();
395 double setphi = m_calc.phim();
396
397 double fallback_eta = eta;
398 double fallback_phi = phi;
399 if ((seteta == -999 || setphi == -999) && fallback_layer >= 0 && fallback_layer < 4) {
400 // In the calo frame
401 fallback_eta = m_cluster->etaSample (samplings[fallback_layer]);
402 fallback_phi = m_cluster->phiSample (samplings[fallback_layer]);
403 }
404
405 if (!allow_badpos) {
406 //if (m_etam == -999) m_etam = fallback_eta;
407 //if (m_phim == -999) m_phim = fallback_phi;
408 if (seteta == -999) seteta = fallback_eta;
409 if (setphi == -999) setphi = fallback_phi;
410 }
411
412 //FIXME: Sampling pattern not yet set!
413 m_parent.setsample (m_cluster,
414 samplings[layer],
415 m_calc.em(),
416 seteta,
417 setphi,
418 m_calc.emax(),
419 m_calc.etamax(),
420 m_calc.phimax(),
421 m_calc.etas(),
422 m_calc.phis());
423 if (allow_badpos) {
424 if (m_etam == -999) m_etam = fallback_eta;
425 if (m_phim == -999) m_phim = fallback_phi;
426 }
427}
CaloLayerCalculator m_calc
The calculator object.
virtual void calculate(double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)=0
Calculate layer variables — abstract method.
const CaloClusterCorrection & m_parent
The correction object using us.
double m_phim
position from last calculation.
CaloCluster * m_cluster
The cluster we're updating.
double m_etam
position from last calculation.

◆ 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 445 of file CaloFillRectangularCluster.cxx.

451{
452 m_calc.fill (m_cluster->cell_begin(), m_cluster->cell_end(),
453 eta, phi, deta, dphi, sampling);
454 m_etam = m_calc.etamr();
455 m_phim = m_calc.phimr();
456}

◆ cluster()

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

Return the cluster we're updating.

Definition at line 461 of file CaloFillRectangularCluster.cxx.

462{
463 return m_cluster;
464}

◆ deta()

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

Definition at line 314 of file CaloFillRectangularCluster.cxx.

314{ return m_windows[layer].first; }
CaloFillRectangularCluster::WindowArray_t m_windows
Window size, per layer.
@ layer
Definition HitInfo.h:79

◆ dphi()

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

Definition at line 315 of file CaloFillRectangularCluster.cxx.

315{ 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 764 of file CaloFillRectangularCluster.cxx.

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

◆ etam()

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

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

Definition at line 469 of file CaloFillRectangularCluster.cxx.

470{
471 return m_etam;
472}

◆ etamax()

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

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

Definition at line 485 of file CaloFillRectangularCluster.cxx.

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

◆ etareal()

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

Definition at line 311 of file CaloFillRectangularCluster.cxx.

311{ 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 755 of file CaloFillRectangularCluster.cxx.

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

◆ phim()

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

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

Definition at line 477 of file CaloFillRectangularCluster.cxx.

478{
479 return m_phim;
480}

◆ phimax()

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

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

Definition at line 493 of file CaloFillRectangularCluster.cxx.

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

Member Data Documentation

◆ m_calc

CaloLayerCalculator CaloClusterCorr::SamplingHelper::m_calc
protectedinherited

The calculator object.

Definition at line 320 of file CaloFillRectangularCluster.cxx.

◆ m_cluster

CaloCluster* CaloClusterCorr::SamplingHelper::m_cluster
protectedinherited

The cluster we're updating.

Definition at line 326 of file CaloFillRectangularCluster.cxx.

◆ m_etam

double CaloClusterCorr::SamplingHelper::m_etam
protectedinherited

\(\eta\) position from last calculation.

Definition at line 332 of file CaloFillRectangularCluster.cxx.

◆ m_parent

const CaloClusterCorrection& CaloClusterCorr::SamplingHelper::m_parent
protectedinherited

The correction object using us.

Definition at line 323 of file CaloFillRectangularCluster.cxx.

◆ m_phim

double CaloClusterCorr::SamplingHelper::m_phim
protectedinherited

\(\phi\) position from last calculation.

Definition at line 335 of file CaloFillRectangularCluster.cxx.

◆ m_windows

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

Window size, per layer.

Definition at line 329 of file CaloFillRectangularCluster.cxx.


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