ATLAS Offline Software
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CaloLayerCalculator Class Reference

#include <CaloLayerCalculator.h>

Collaboration diagram for CaloLayerCalculator:

Classes

struct  Helper
 Helper class for layer variable calculation. More...
 

Public Member Functions

 CaloLayerCalculator ()
 Initialization. More...
 
template<typename Iterator >
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. More...
 
StatusCode fill (const CaloDetDescrManager &mgr, const CaloCellContainer *cell_container, double eta, double phi, double deta, double dphi, CaloSampling::CaloSample sampling, xAOD::CaloCluster *tofill=0)
 Calculate layer variables from a cell container. More...
 
double etam () const
 Data access. More...
 
double phim () const
 Get the mean layer \(\phi\) value. More...
 
double etas () const
 Get the RMS \(\eta\) size. More...
 
double phis () const
 Get the RMS \(\phi\) size. More...
 
double em () const
 Get the total energy. More...
 
double etamax () const
 Get maximum \(\eta\) value. More...
 
double phimax () const
 Get maximum \(\phi\) value. More...
 
double emax () const
 Get the maximum energy. More...
 
double phimr () const
 Similar as phim, etam, phimax, etamax, but with raw quantities. More...
 
double etamr () const
 
double phirmax () const
 
double etarmax () const
 

Private Member Functions

void reset ()
 Internals. More...
 
void resetOnNegativeEnergy ()
 Reset output variables, but not m_em, allowing samplings to be negative. More...
 
void resetOnNegativeEnergy (double eta, double phi)
 Reset output variables, but not m_em, allowing samplings to be negative, fill layer position with original eta,phi seed position. More...
 
double get_weight (CaloClusterCellLink::const_iterator it)
 Get the weight from a cell iterator. More...
 
double get_weight (CaloClusterCellLink::iterator it)
 Get the weight from a cell iterator. More...
 
template<typename CONT , typename RPAR , typename COLL >
double get_weight (NavigableIterator< CONT, RPAR, COLL > it)
 Get the weight from a cell iterator. More...
 

Static Private Member Functions

template<typename Iterator >
static double get_weight (Iterator it)
 Get the weight from a cell iterator. More...
 

Private Attributes

double m_etam = 0.0
 Layer variables. More...
 
double m_phim = 0.0
 
double m_etas = 0.0
 
double m_phis = 0.0
 
double m_em = 0.0
 
double m_etamax = 0.0
 
double m_phimax = 0.0
 
double m_emax = 0.0
 
double m_etamr = 0.0
 
double m_phimr = 0.0
 
double m_etarmax = 0.0
 
double m_phirmax = 0.0
 

Friends

struct Helper
 

Detailed Description

Definition at line 81 of file CaloLayerCalculator.h.

Constructor & Destructor Documentation

◆ CaloLayerCalculator()

CaloLayerCalculator::CaloLayerCalculator ( )

Initialization.

Default constructor.

Default constructor.

Sets the variables to invalid values.

Sets the variables to invalid values.

Definition at line 23 of file CaloLayerCalculator.cxx.

24 {
25  reset();
26 }

Member Function Documentation

◆ em()

double CaloLayerCalculator::em ( ) const
inline

Get the total energy.

Returns
The total energy of the selected cells.

Definition at line 445 of file CaloLayerCalculator.h.

446 {
447  return m_em;
448 }

◆ emax()

double CaloLayerCalculator::emax ( ) const
inline

Get the maximum energy.

Returns
The energy of the selected cell with the most energy.

Definition at line 480 of file CaloLayerCalculator.h.

481 {
482  return m_emax;
483 }

◆ etam()

double CaloLayerCalculator::etam ( ) const
inline

Data access.

Get the mean layer \(\eta\) value.

Get the mean layer \(\eta\) value.

Returns
The mean \(\eta\) of the selected cells, or -999.
The mean \(\eta\) of the selected cells, or -999.

Definition at line 401 of file CaloLayerCalculator.h.

402 {
403  return m_etam;
404 }

◆ etamax()

double CaloLayerCalculator::etamax ( ) const
inline

Get maximum \(\eta\) value.

Returns
The \(\eta\) center of the selected cell with the most energy, or -999.

Definition at line 457 of file CaloLayerCalculator.h.

458 {
459  return m_etamax;
460 }

◆ etamr()

double CaloLayerCalculator::etamr ( ) const
inline

Definition at line 219 of file CaloLayerCalculator.h.

219 { return m_etamr; }

◆ etarmax()

double CaloLayerCalculator::etarmax ( ) const
inline

Definition at line 221 of file CaloLayerCalculator.h.

221 { return m_etarmax; }

◆ etas()

double CaloLayerCalculator::etas ( ) const
inline

Get the RMS \(\eta\) size.

Returns
The RMS \(\eta\) of the selected cells.

Definition at line 423 of file CaloLayerCalculator.h.

424 {
425  return m_etas;
426 }

◆ fill() [1/2]

StatusCode CaloLayerCalculator::fill ( const CaloDetDescrManager mgr,
const CaloCellContainer cell_container,
double  eta,
double  phi,
double  deta,
double  dphi,
CaloSampling::CaloSample  sampling,
xAOD::CaloCluster tofill = 0 
)

Calculate layer variables from a cell container.

Parameters
mgrCaloDetDescrManager
cell_containerThe cell container.
etaThe \(\eta\) center of the cluster, for cell selection.
phiThe \(\phi\) center of the cluster, for cell selection.
detaThe \(\eta\) full width for cell selection.
dphiThe \(\phi\) full width for cell selection.
samplingThe sampling for cell selection.
tofillIf non-null, then selected cells will be added to this cluster.

This takes a list of cells from a cell container, selects those within a deta by dphi window around eta, phi in layer sampling, and fills the layer variables from them. If tofill is non-null, then selected cells will also be added to the cluster tofill.

Parameters
cell_containerThe cell container.
etaThe \(\eta\) center of the cluster, for cell selection.
phiThe \(\phi\) center of the cluster, for cell selection.
detaThe \(\eta\) full width for cell selection.
dphiThe \(\phi\) full width for cell selection.
samplingThe sampling for cell selection.
tofillIf non-null, then selected cells will be added to this cluster.

This takes a list of cells from a cell container, selects those within a deta by dphi window around eta, phi in layer sampling, and fills the layer variables from them. If tofill is non-null, then selected cells will also be added to the cluster tofill.

Definition at line 47 of file CaloLayerCalculator.cxx.

55 {
56 
57  //Check if cell_container and cluster matches
58  if (tofill) {
59  if (tofill->getCellLinks()->getCellContainer()!=cell_container) {
60  std::cout << "ERROR attempt to fill a cluster from different cell containers\n";
61  return StatusCode::FAILURE;
62  }
63  }
64 
65  CaloCellList cell_list(&mgr,cell_container);
66  cell_list.select(eta,phi,deta,dphi,sampling);
67 
68  fill (cell_list.begin(),
69  cell_list.end(),
70  eta, phi, deta, dphi, sampling, tofill);
71 
72  return StatusCode::SUCCESS;
73 }

◆ fill() [2/2]

template<typename Iterator >
void CaloLayerCalculator::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.

Parameters
begThe starting iterator for the cell list.
endThe ending iterator for the cell list.
etaThe \(\eta\) center of the cluster, for cell selection.
phiThe \(\phi\) center of the cluster, for cell selection.
detaThe \(\eta\) full width for cell selection.
dphiThe \(\phi\) full width for cell selection.
samplingThe sampling for cell selection.
tofillIf non-null, then selected cells will be added to this cluster.

This takes a list of cells specified by beg and end, selects those within a deta by dphi window around eta, phi in layer sampling, and fills the layer variables from them. If the iterators come from a Navigable, then cell weights will be used in the calculation. If tofill and cell_container are non-null, then selected cells will also be added to the cluster tofill.

Parameters
begThe starting iterator for the cell list.
endThe ending iterator for the cell list.
etaThe \(\eta\) center of the cluster, for cell selection.
phiThe \(\phi\) center of the cluster, for cell selection.
detaThe \(\eta\) full width for cell selection.
dphiThe \(\phi\) full width for cell selection.
samplingThe sampling for cell selection.
tofillIf non-null, then selected cells will be added to this cluster.
cell_containerIf tofill is non-null, then this is this container from which the cells came.

This takes a list of cells specified by beg and end, selects those within a deta by dphi window around eta, phi in layer sampling, and fills the layer variables from them. If the iterators come from a Navigable, then cell weights will be used in the calculation. If tofill and cell_container are non-null, then selected cells will also be added to the cluster tofill; in this case, cell_container should be the container in storegate holding the cells.

Definition at line 376 of file CaloLayerCalculator.h.

384 {
385  reset();
386  const CaloCellContainer* cell_container=0;
387  if (tofill) cell_container=tofill->getCellLinks()->getCellContainer();
388  if (beg != end) {
389  Helper h (*this, eta, phi, deta, dphi, sampling, tofill, cell_container);
390  for (; beg != end; ++beg)
391  h.cell (*beg, get_weight (beg));
392  }
393 }

◆ get_weight() [1/4]

double CaloLayerCalculator::get_weight ( CaloClusterCellLink::const_iterator  it)
inlineprivate

Get the weight from a cell iterator.

This is the version specialized for CaloClusterCellLink::const_iterator

Definition at line 506 of file CaloLayerCalculator.h.

507 {
508  return it.weight();
509 }

◆ get_weight() [2/4]

double CaloLayerCalculator::get_weight ( CaloClusterCellLink::iterator  it)
inlineprivate

Get the weight from a cell iterator.

This is the version specialized for CaloClusterCellLink::iterator

Definition at line 513 of file CaloLayerCalculator.h.

514 {
515  return it.weight();
516 }

◆ get_weight() [3/4]

template<typename Iterator >
double CaloLayerCalculator::get_weight ( Iterator  it)
inlinestaticprivate

Get the weight from a cell iterator.

This is the generic version, that always returns 1.

Definition at line 490 of file CaloLayerCalculator.h.

491 {
492  return 1;
493 }

◆ get_weight() [4/4]

template<typename CONT , typename RPAR , typename COLL >
double CaloLayerCalculator::get_weight ( NavigableIterator< CONT, RPAR, COLL >  it)
inlineprivate

Get the weight from a cell iterator.

This is the version specialized for a Navigable, which returns the Navigable parameter.

Definition at line 500 of file CaloLayerCalculator.h.

501 {
502  return it.getParameter();
503 }

◆ phim()

double CaloLayerCalculator::phim ( ) const
inline

Get the mean layer \(\phi\) value.

Returns
The mean \(\phi\) of the selected cells, or -999.

Definition at line 412 of file CaloLayerCalculator.h.

413 {
414  return m_phim;
415 }

◆ phimax()

double CaloLayerCalculator::phimax ( ) const
inline

Get maximum \(\phi\) value.

Returns
The \(\phi\) center of the selected cell with the most energy, or -999.

Definition at line 469 of file CaloLayerCalculator.h.

470 {
471  return m_phimax;
472 }

◆ phimr()

double CaloLayerCalculator::phimr ( ) const
inline

Similar as phim, etam, phimax, etamax, but with raw quantities.

Definition at line 218 of file CaloLayerCalculator.h.

218 { return m_phimr; }

◆ phirmax()

double CaloLayerCalculator::phirmax ( ) const
inline

Definition at line 220 of file CaloLayerCalculator.h.

220 { return m_phirmax; }

◆ phis()

double CaloLayerCalculator::phis ( ) const
inline

Get the RMS \(\phi\) size.

Returns
The RMS \(\phi\) of the selected cells.

Definition at line 434 of file CaloLayerCalculator.h.

435 {
436  return m_phis;
437 }

◆ reset()

void CaloLayerCalculator::reset ( )
private

Internals.

Reset output variables to invalid values.

Reset all variables to invalid values.

Definition at line 76 of file CaloLayerCalculator.cxx.

77 {
78  m_etam = -999;
79  m_phim = -999;
80  m_etamax = -999;
81  m_phimax = -999;
82  m_etarmax= -999;
83  m_phirmax= -999;
84 
85  m_etas = 0;
86  m_phis = 0;
87  m_em = 0;
88  m_emax = 0;
89 
90  // Added to cluster in the calorimeter frame
91  m_etamr = -999;
92  m_phimr = -999;
93 
94 }

◆ resetOnNegativeEnergy() [1/2]

void CaloLayerCalculator::resetOnNegativeEnergy ( )
private

Reset output variables, but not m_em, allowing samplings to be negative.

Definition at line 98 of file CaloLayerCalculator.cxx.

99 {
100  m_etam = -999;
101  m_phim = -999;
102  m_etamax = -999;
103  m_phimax = -999;
104  // Don't reset these --- that could prevent us from being able
105  // to calculate the e2* variables in egammaMiddleShape if there
106  // are negative energy cells just outside the cluster.
107  //m_etarmax= -999;
108  //m_phirmax= -999;
109 
110  m_etas = 0;
111  m_phis = 0;
112  //m_em = 0;
113  m_emax = 0;
114 
115  // Added to cluster in the calorimeter frame
116  m_etamr = -999;
117  m_phimr = -999;
118 }

◆ resetOnNegativeEnergy() [2/2]

void CaloLayerCalculator::resetOnNegativeEnergy ( double  eta,
double  phi 
)
private

Reset output variables, but not m_em, allowing samplings to be negative, fill layer position with original eta,phi seed position.

Reset output variables using seed position to fill eta,phi layer variables but not m_em, allowing samplings to be negative.

Definition at line 121 of file CaloLayerCalculator.cxx.

122 {
123  m_etam = eta;
124  m_phim = phi;
125  m_etamax = eta;
126  m_phimax = phi;
127  m_etarmax= eta;
128  m_phirmax= phi;
129 
130  m_etas = 0;
131  m_phis = 0;
132  //m_em = 0;
133  m_emax = 0;
134 
135  // Added to cluster in the calorimeter frame
136  m_etamr = eta;
137  m_phimr = phi;
138 }

Friends And Related Function Documentation

◆ Helper

friend struct Helper
friend

Definition at line 347 of file CaloLayerCalculator.h.

Member Data Documentation

◆ m_em

double CaloLayerCalculator::m_em = 0.0
private

Definition at line 262 of file CaloLayerCalculator.h.

◆ m_emax

double CaloLayerCalculator::m_emax = 0.0
private

Definition at line 265 of file CaloLayerCalculator.h.

◆ m_etam

double CaloLayerCalculator::m_etam = 0.0
private

Layer variables.

Definition at line 258 of file CaloLayerCalculator.h.

◆ m_etamax

double CaloLayerCalculator::m_etamax = 0.0
private

Definition at line 263 of file CaloLayerCalculator.h.

◆ m_etamr

double CaloLayerCalculator::m_etamr = 0.0
private

Definition at line 268 of file CaloLayerCalculator.h.

◆ m_etarmax

double CaloLayerCalculator::m_etarmax = 0.0
private

Definition at line 270 of file CaloLayerCalculator.h.

◆ m_etas

double CaloLayerCalculator::m_etas = 0.0
private

Definition at line 260 of file CaloLayerCalculator.h.

◆ m_phim

double CaloLayerCalculator::m_phim = 0.0
private

Definition at line 259 of file CaloLayerCalculator.h.

◆ m_phimax

double CaloLayerCalculator::m_phimax = 0.0
private

Definition at line 264 of file CaloLayerCalculator.h.

◆ m_phimr

double CaloLayerCalculator::m_phimr = 0.0
private

Definition at line 269 of file CaloLayerCalculator.h.

◆ m_phirmax

double CaloLayerCalculator::m_phirmax = 0.0
private

Definition at line 271 of file CaloLayerCalculator.h.

◆ m_phis

double CaloLayerCalculator::m_phis = 0.0
private

Definition at line 261 of file CaloLayerCalculator.h.


The documentation for this class was generated from the following files:
CaloLayerCalculator::m_phim
double m_phim
Definition: CaloLayerCalculator.h:259
CaloLayerCalculator::reset
void reset()
Internals.
Definition: CaloLayerCalculator.cxx:76
CaloCellList
Definition: CaloCellList.h:40
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
skel.it
it
Definition: skel.GENtoEVGEN.py:423
CaloLayerCalculator::m_etas
double m_etas
Definition: CaloLayerCalculator.h:260
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
extractSporadic.h
list h
Definition: extractSporadic.py:97
CaloLayerCalculator::get_weight
static double get_weight(Iterator it)
Get the weight from a cell iterator.
Definition: CaloLayerCalculator.h:490
CaloLayerCalculator::m_etamax
double m_etamax
Definition: CaloLayerCalculator.h:263
CaloLayerCalculator::m_phis
double m_phis
Definition: CaloLayerCalculator.h:261
CaloLayerCalculator::m_etamr
double m_etamr
Definition: CaloLayerCalculator.h:268
CaloLayerCalculator::m_phimax
double m_phimax
Definition: CaloLayerCalculator.h:264
CaloLayerCalculator::m_em
double m_em
Definition: CaloLayerCalculator.h:262
CaloLayerCalculator::m_etarmax
double m_etarmax
Definition: CaloLayerCalculator.h:270
xAOD::CaloCluster_v1::getCellLinks
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
Definition: CaloCluster_v1.cxx:905
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
CaloLayerCalculator::Helper
friend struct Helper
Definition: CaloLayerCalculator.h:347
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
CaloLayerCalculator::m_phirmax
double m_phirmax
Definition: CaloLayerCalculator.h:271
CaloLayerCalculator::m_etam
double m_etam
Layer variables.
Definition: CaloLayerCalculator.h:258
CaloLayerCalculator::m_emax
double m_emax
Definition: CaloLayerCalculator.h:265
h
CaloLayerCalculator::m_phimr
double m_phimr
Definition: CaloLayerCalculator.h:269
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