ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterCorr::SamplingHelper Class Referenceabstract

Sampling calculator helper class. More...

Inheritance diagram for CaloClusterCorr::SamplingHelper:
Collaboration diagram for CaloClusterCorr::SamplingHelper:

Public Member Functions

 SamplingHelper (const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster)
 Constructor.
virtual ~SamplingHelper ()=default
 Destructor — just to get a vtable.
virtual void calculate (double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)=0
 Calculate layer variables — abstract method.
virtual const CaloCellmax_et_cell () const =0
 Return the cell with the maximum energy — abstract method.
virtual bool empty () const =0
 Test for empty candidate cell list — abstract method.
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

Sampling calculator helper class.

This helper class is used to decouple the layer calculations from the decision of the origin of the cells (a StoreGate container or the existing cluster cells).

This is an abstract base class; there are concrete implementations of this for the two cases of cells coming from StoreGate and cells coming from the clusters.

Definition at line 185 of file CaloFillRectangularCluster.cxx.

Constructor & Destructor Documentation

◆ SamplingHelper()

CaloClusterCorr::SamplingHelper::SamplingHelper ( 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 344 of file CaloFillRectangularCluster.cxx.

347 : m_parent (parent),
350 m_etam(0),
351 m_phim(0)
352{
353}
const CaloClusterCorrection & m_parent
The correction object using us.
double m_phim
position from last calculation.
CaloCluster * m_cluster
The cluster we're updating.
CaloCluster * cluster()
Return the cluster we're updating.
double m_etam
position from last calculation.
CaloFillRectangularCluster::WindowArray_t m_windows
Window size, per layer.
int windows(float distance, float eta_pivot, int thr, int sector)
Definition windows.cxx:14

◆ ~SamplingHelper()

virtual CaloClusterCorr::SamplingHelper::~SamplingHelper ( )
virtualdefault

Destructor — just to get a vtable.

Member Function Documentation

◆ calculate()

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

Calculate layer variables — abstract method.

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.
dofillIf true, add selected cells to the cluster (if possible).

This virtual method should select the cells within the specified window in the specified sampling from the list of candidate cells and calculate the layer variables. If dofill is true, then the selected cells will also be added to the cluster, provided that this makes sense (it will not be done if the cluster is the source of the cells).

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

Implemented in CaloClusterCorr::SamplingHelper_CaloCellList, and CaloClusterCorr::SamplingHelper_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 )

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!
412 m_parent.setsample (m_cluster,
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}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
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.

◆ calculate_cluster()

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

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

◆ cluster()

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

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
inline

Definition at line 313 of file CaloFillRectangularCluster.cxx.

313{ return m_windows[layer].first; }
@ layer
Definition HitInfo.h:79

◆ dphi()

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

Definition at line 314 of file CaloFillRectangularCluster.cxx.

314{ return m_windows[layer].second; }

◆ empty()

virtual bool CaloClusterCorr::SamplingHelper::empty ( ) const
pure virtual

Test for empty candidate cell list — abstract method.

Implemented in CaloClusterCorr::SamplingHelper_CaloCellList, and CaloClusterCorr::SamplingHelper_Cluster.

◆ etam()

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

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
inline

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
inline

Definition at line 310 of file CaloFillRectangularCluster.cxx.

310{ return m_calc.etam(); }

◆ max_et_cell()

virtual const CaloCell * CaloClusterCorr::SamplingHelper::max_et_cell ( ) const
pure virtual

Return the cell with the maximum energy — abstract method.

Implemented in CaloClusterCorr::SamplingHelper_CaloCellList, and CaloClusterCorr::SamplingHelper_Cluster.

◆ phim()

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

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
inline

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
protected

The calculator object.

Definition at line 319 of file CaloFillRectangularCluster.cxx.

◆ m_cluster

CaloCluster* CaloClusterCorr::SamplingHelper::m_cluster
protected

The cluster we're updating.

Definition at line 325 of file CaloFillRectangularCluster.cxx.

◆ m_etam

double CaloClusterCorr::SamplingHelper::m_etam
protected

\(\eta\) position from last calculation.

Definition at line 331 of file CaloFillRectangularCluster.cxx.

◆ m_parent

const CaloClusterCorrection& CaloClusterCorr::SamplingHelper::m_parent
protected

The correction object using us.

Definition at line 322 of file CaloFillRectangularCluster.cxx.

◆ m_phim

double CaloClusterCorr::SamplingHelper::m_phim
protected

\(\phi\) position from last calculation.

Definition at line 334 of file CaloFillRectangularCluster.cxx.

◆ m_windows

CaloFillRectangularCluster::WindowArray_t CaloClusterCorr::SamplingHelper::m_windows
protected

Window size, per layer.

Definition at line 328 of file CaloFillRectangularCluster.cxx.


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