ATLAS Offline Software
|
Sampling calculator helper class. More...
Public Member Functions | |
SamplingHelper (const CaloClusterCorrection &parent, const CaloFillRectangularCluster::WindowArray_t &windows, CaloCluster *cluster) | |
Constructor. More... | |
virtual | ~SamplingHelper ()=default |
Destructor — just to get a vtable. More... | |
virtual void | calculate (double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, bool dofill=false)=0 |
Calculate layer variables — abstract method. More... | |
virtual const CaloCell * | max_et_cell () const =0 |
Return the cell with the maximum energy — abstract method. More... | |
virtual bool | empty () const =0 |
Test for empty candidate cell list — abstract method. 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... | |
CaloCluster * | cluster () |
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 CaloClusterCorrection & | m_parent |
The correction object using us. More... | |
CaloCluster * | m_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... | |
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.
CaloClusterCorr::SamplingHelper::SamplingHelper | ( | const CaloClusterCorrection & | parent, |
const CaloFillRectangularCluster::WindowArray_t & | windows, | ||
CaloCluster * | cluster | ||
) |
Constructor.
parent | The parent correction class. |
windows | Per-layer array of window eta,phi sizes. |
cluster | The cluster being operated on. |
Definition at line 344 of file CaloFillRectangularCluster.cxx.
|
virtualdefault |
Destructor — just to get a vtable.
|
pure virtual |
Calculate layer variables — abstract method.
eta | Center of the cluster in \(\eta\). |
phi | Center of the cluster in \(\phi\). |
deta | Full width of the cluster in \(\eta\). |
dphi | Full width of the cluster in \(\phi\). |
sampling | The sampling for which to do the calculation. |
dofill | If 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_Cluster, and CaloClusterCorr::SamplingHelper_CaloCellList.
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.
eta | Center of the cluster in \(\eta\). |
phi | Center of the cluster in \(\phi\). |
layer | Calorimeter layer being calculated (0-3). |
fallback_layer | Layer for fallback values (see below). |
samplings | List of samplings for this region. |
allow_badpos | Should 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.
void CaloClusterCorr::SamplingHelper::calculate_cluster | ( | double | eta, |
double | phi, | ||
double | deta, | ||
double | dphi, | ||
CaloSampling::CaloSample | sampling | ||
) |
Calculate layer variables for cells in the cluster.
eta | Center of the cluster in \(\eta\). |
phi | Center of the cluster in \(\phi\). |
deta | Full width of the cluster in \(\eta\). |
dphi | Full width of the cluster in \(\phi\). |
sampling | The 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.
|
inline |
Return the cluster we're updating.
Definition at line 460 of file CaloFillRectangularCluster.cxx.
|
inline |
Definition at line 313 of file CaloFillRectangularCluster.cxx.
|
inline |
Definition at line 314 of file CaloFillRectangularCluster.cxx.
|
pure virtual |
Test for empty candidate cell list — abstract method.
Implemented in CaloClusterCorr::SamplingHelper_Cluster, and CaloClusterCorr::SamplingHelper_CaloCellList.
|
inline |
Return the \(\eta\) position from the last calculation.
Definition at line 468 of file CaloFillRectangularCluster.cxx.
|
inline |
Return the \(\eta\) maximum position from the last calculation.
Definition at line 484 of file CaloFillRectangularCluster.cxx.
|
inline |
Definition at line 310 of file CaloFillRectangularCluster.cxx.
Return the cell with the maximum energy — abstract method.
Implemented in CaloClusterCorr::SamplingHelper_Cluster, and CaloClusterCorr::SamplingHelper_CaloCellList.
|
inline |
Return the \(\phi\) position from the last calculation.
Definition at line 476 of file CaloFillRectangularCluster.cxx.
|
inline |
Return the \(\phi\) maximum position from the last calculation.
Definition at line 492 of file CaloFillRectangularCluster.cxx.
|
protected |
The calculator object.
Definition at line 319 of file CaloFillRectangularCluster.cxx.
|
protected |
The cluster we're updating.
Definition at line 325 of file CaloFillRectangularCluster.cxx.
|
protected |
\(\eta\) position from last calculation.
Definition at line 331 of file CaloFillRectangularCluster.cxx.
|
protected |
The correction object using us.
Definition at line 322 of file CaloFillRectangularCluster.cxx.
|
protected |
\(\phi\) position from last calculation.
Definition at line 334 of file CaloFillRectangularCluster.cxx.
|
protected |
Window size, per layer.
Definition at line 328 of file CaloFillRectangularCluster.cxx.