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

Hold binned EM fraction data. More...

#include <CaloEMFrac.h>

Collaboration diagram for CaloEMFrac:

Classes

struct  EMFracData
 Per-bin data. More...
 

Public Member Functions

 CaloEMFrac ()
 Default Constructor. More...
 
 CaloEMFrac (int nBinEta, float MinEta, float MaxEta, int nBinLogEClus, float MinLogEClus, float MaxLogEClus, int nBinLogEDens, float MinLogEDens, float MaxLogEDens, int nBinLogDepth, float MinLogDepth, float MaxLogDepth)
 Constructor. More...
 
int getNbinsEta () const
 Return the number of bins in eta. More...
 
float getEtaMin () const
 Return the minimum eta for the first bin. More...
 
float getEtaMax () const
 Return the maximum eta for the last bin. More...
 
int getNbinsLogEClus () const
 Return the number of bins in log10(cluster energy). More...
 
float getLogEClusMin () const
 Return the minimum log10(cluster energy) for the first bin. More...
 
float getLogEClusMax () const
 Return the maximum log10(cluster energy) for the last bin. More...
 
int getNbinsLogEDens () const
 Return the number of bins in log10(cluster energy density). More...
 
float getLogEDensMin () const
 Return the minimum log10(cluster energy density) for the first bin. More...
 
float getLogEDensMax () const
 Return the maximum log10(cluster energy density) for the last bin. More...
 
int getNbinsLogDepth () const
 Return the number of bins in log10(cluster depth). More...
 
float getLogDepthMin () const
 Return the minimum log10(cluster depth) for the first bin. More...
 
float getLogDepthMax () const
 Return the maximum log10(cluster depth) for the last bin. More...
 
const struct EMFracDatagetEMFracData (float eta, float logEClus, float logEDens, float logDepth) const
 Return EM fraction data for one bin. More...
 
void setEMFracData (float eta, float logEClus, float logEDens, float logDepth, const struct EMFracData &theData)
 Set EM fraction data for one bin. More...
 

Private Member Functions

int getEtaLogEClusBin (float eta, float logEClus) const
 Find the eta/logEClus bin number. More...
 
int getBin (float eta, float logEClus, float logEDens, float logDepth) const
 Find a bin number. More...
 

Private Attributes

int m_nBinEta
 Number of eta bins. More...
 
int m_nBinLogEClus
 Number of log10(cluster energy) bins. More...
 
int m_nBinLogEDens
 Number of log10(cluster energy density) bins. More...
 
int m_nBinLogDepth
 Number of log10(cluster depth) bins. More...
 
float m_MinEta
 Minimum eta for the first bin. More...
 
float m_MinLogEClus
 Minimum log10(cluster energy) for the first bin. More...
 
float m_MinLogEDens
 Minimum log10(cluster energy density) for the first bin. More...
 
float m_MinLogDepth
 Minimum log10(cluster depth) for the first bin. More...
 
float m_MaxEta
 Maximum eta for the last bin. More...
 
float m_MaxLogEClus
 Maximum log10(cluster energy) for the last bin. More...
 
float m_MaxLogEDens
 Maximum log10(cluster energy density) for the last bin. More...
 
float m_MaxLogDepth
 Maximum log10(cluster depth) for the last bin. More...
 
std::vector< struct EMFracDatam_data
 The table. More...
 

Detailed Description

Hold binned EM fraction data.

This class holds data on the average EM fraction of EM clusters. These data are binned along four axes:

In each bin, we store the mean EM fraction in the bin, plus information about distribution width and number of entries.

Definition at line 35 of file CaloEMFrac.h.

Constructor & Destructor Documentation

◆ CaloEMFrac() [1/2]

CaloEMFrac::CaloEMFrac ( )

Default Constructor.

(Only intended for use by persistency.)

Definition at line 18 of file CaloEMFrac.cxx.

19  : m_nBinEta(0),
20  m_nBinLogEClus(0),
21  m_nBinLogEDens(0),
22  m_nBinLogDepth(0),
23  m_MinEta(0),
24  m_MinLogEClus(0),
25  m_MinLogEDens(0),
26  m_MinLogDepth(0),
27  m_MaxEta(0),
28  m_MaxLogEClus(0),
29  m_MaxLogEDens(0),
30  m_MaxLogDepth(0)
31 {
32 }

◆ CaloEMFrac() [2/2]

CaloEMFrac::CaloEMFrac ( int  nBinEta,
float  MinEta,
float  MaxEta,
int  nBinLogEClus,
float  MinLogEClus,
float  MaxLogEClus,
int  nBinLogEDens,
float  MinLogEDens,
float  MaxLogEDens,
int  nBinLogDepth,
float  MinLogDepth,
float  MaxLogDepth 
)

Constructor.

Parameters
nBinEtaNumber of bins in eta.
MinEtaMinimum eta for the first bin.
MaxEtaMaximum eta for the last bin.
nBinLogEClusNumber of bins in log10(cluster energy).
MinLogEClusMinimum log10(cluster energy) for the first bin.
MaxLogEClusMaximum log10(cluster energy) for the last bin.
nBinLogEDensNumber of bins in log10(cluster energy density).
MinLogEDensMinimum log10(cluster energy density) for the first bin.
MaxLogEDensMaximum log10(cluster energy density) for the last bin.
nBinLogDepthNumber of bins in log10(cluster depth).
MinLogDepthMinimum log10(cluster depth) for the first bin.
MaxLogDepthMaximum log10(cluster depth) for the last bin.

Definition at line 50 of file CaloEMFrac.cxx.

63  : m_nBinEta (nBinEta),
64  m_nBinLogEClus (nBinLogEClus),
65  m_nBinLogEDens (nBinLogEDens),
66  m_nBinLogDepth (nBinLogDepth),
67  m_MinEta (MinEta),
68  m_MinLogEClus (MinLogEClus),
69  m_MinLogEDens (MinLogEDens),
70  m_MinLogDepth (MinLogDepth),
71  m_MaxEta (MaxEta),
72  m_MaxLogEClus (MaxLogEClus),
73  m_MaxLogEDens (MaxLogEDens),
74  m_MaxLogDepth (MaxLogDepth)
75 {
76 }

Member Function Documentation

◆ getBin()

int CaloEMFrac::getBin ( float  eta,
float  logEClus,
float  logEDens,
float  logDepth 
) const
private

Find a bin number.

Parameters
etaCluster eta.
logECluslog10(cluster energy)
logEDenslog10(cluster energy density) (possibly normalized)
logDepthlog10(cluster depth)
Returns
The bin number, or -1 if out of range.

Definition at line 164 of file CaloEMFrac.cxx.

168 {
169  int iLogEDens,iLogDepth;
170 
171  const int iEtaLogEClus = getEtaLogEClusBin(eta, logEClus);
172  if ( iEtaLogEClus > -1 ) {
173  iLogEDens = (int)((logEDens-m_MinLogEDens)/(m_MaxLogEDens-m_MinLogEDens)*m_nBinLogEDens);
174  if ( iLogEDens >= 0 && iLogEDens < m_nBinLogEDens ) {
175  iLogDepth = (int)((logDepth-m_MinLogDepth)/(m_MaxLogDepth-m_MinLogDepth)*m_nBinLogDepth);
176  if ( iLogDepth >= 0 && iLogDepth < m_nBinLogDepth ) {
177  return (iLogDepth + m_nBinLogDepth *
178  (iLogEDens + m_nBinLogEDens *
179  iEtaLogEClus));
180  }
181  }
182  }
183  return -1;
184 }

◆ getEMFracData()

const struct CaloEMFrac::EMFracData * CaloEMFrac::getEMFracData ( float  eta,
float  logEClus,
float  logEDens,
float  logDepth 
) const

Return EM fraction data for one bin.

Parameters
etaCluster eta.
logECluslog10(cluster energy)
logEDenslog10(cluster energy density) (possibly normalized)
logDepthlog10(cluster depth)
Returns
Pointer to the bin data, or 0 if out of range.

The pointer may be invalidated by a subsequent setEMFracData call.

Definition at line 90 of file CaloEMFrac.cxx.

94 {
95  int iBin = getBin(eta,logEClus,logEDens,logDepth);
96  if ( iBin > -1 && iBin < (int)m_data.size() )
97  return (& m_data[iBin]);
98  else
99  return nullptr;
100 }

◆ getEtaLogEClusBin()

int CaloEMFrac::getEtaLogEClusBin ( float  eta,
float  logEClus 
) const
private

Find the eta/logEClus bin number.

Parameters
etaCluster eta.
logECluslog10(cluster energy)
Returns
Bin number in the eta/logEClus subspace, or -1 if out of range.

Definition at line 140 of file CaloEMFrac.cxx.

141 {
142  int iEta,iLogEClus;
143 
145  if ( iEta >= 0 && iEta < m_nBinEta ) {
146  iLogEClus = (int)((logEClus-m_MinLogEClus)/(m_MaxLogEClus-m_MinLogEClus)*m_nBinLogEClus);
147  if ( iLogEClus >= 0 && iLogEClus < m_nBinLogEClus ) {
148  return (iEta*m_nBinLogEClus+iLogEClus);
149  }
150  }
151  return (-1);
152 
153 }

◆ getEtaMax()

float CaloEMFrac::getEtaMax ( ) const
inline

Return the maximum eta for the last bin.

Definition at line 100 of file CaloEMFrac.h.

100 {return m_MaxEta;}

◆ getEtaMin()

float CaloEMFrac::getEtaMin ( ) const
inline

Return the minimum eta for the first bin.

Definition at line 98 of file CaloEMFrac.h.

98 {return m_MinEta;}

◆ getLogDepthMax()

float CaloEMFrac::getLogDepthMax ( ) const
inline

Return the maximum log10(cluster depth) for the last bin.

Definition at line 121 of file CaloEMFrac.h.

121 {return m_MaxLogDepth;}

◆ getLogDepthMin()

float CaloEMFrac::getLogDepthMin ( ) const
inline

Return the minimum log10(cluster depth) for the first bin.

Definition at line 119 of file CaloEMFrac.h.

119 {return m_MinLogDepth;}

◆ getLogEClusMax()

float CaloEMFrac::getLogEClusMax ( ) const
inline

Return the maximum log10(cluster energy) for the last bin.

Definition at line 107 of file CaloEMFrac.h.

107 {return m_MaxLogEClus;}

◆ getLogEClusMin()

float CaloEMFrac::getLogEClusMin ( ) const
inline

Return the minimum log10(cluster energy) for the first bin.

Definition at line 105 of file CaloEMFrac.h.

105 {return m_MinLogEClus;}

◆ getLogEDensMax()

float CaloEMFrac::getLogEDensMax ( ) const
inline

Return the maximum log10(cluster energy density) for the last bin.

Definition at line 114 of file CaloEMFrac.h.

114 {return m_MaxLogEDens;}

◆ getLogEDensMin()

float CaloEMFrac::getLogEDensMin ( ) const
inline

Return the minimum log10(cluster energy density) for the first bin.

Definition at line 112 of file CaloEMFrac.h.

112 {return m_MinLogEDens;}

◆ getNbinsEta()

int CaloEMFrac::getNbinsEta ( ) const
inline

Return the number of bins in eta.

Definition at line 96 of file CaloEMFrac.h.

96 {return m_nBinEta;}

◆ getNbinsLogDepth()

int CaloEMFrac::getNbinsLogDepth ( ) const
inline

Return the number of bins in log10(cluster depth).

Definition at line 117 of file CaloEMFrac.h.

117 {return m_nBinLogDepth;}

◆ getNbinsLogEClus()

int CaloEMFrac::getNbinsLogEClus ( ) const
inline

Return the number of bins in log10(cluster energy).

Definition at line 103 of file CaloEMFrac.h.

103 {return m_nBinLogEClus;}

◆ getNbinsLogEDens()

int CaloEMFrac::getNbinsLogEDens ( ) const
inline

Return the number of bins in log10(cluster energy density).

Definition at line 110 of file CaloEMFrac.h.

110 {return m_nBinLogEDens;}

◆ setEMFracData()

void CaloEMFrac::setEMFracData ( float  eta,
float  logEClus,
float  logEDens,
float  logDepth,
const struct EMFracData theData 
)

Set EM fraction data for one bin.

Parameters
etaCluster eta.
logECluslog10(cluster energy)
logEDenslog10(cluster energy density) (possibly normalized)
logDepthlog10(cluster depth)
theDataThe bin data.

This will overwrite any earlier data for the same bin. If the coordinates are out of range, this is a no-op.

Definition at line 115 of file CaloEMFrac.cxx.

120 {
121  const int iEtaLogEClus = getEtaLogEClusBin(eta, logEClus);
122  if ( iEtaLogEClus > -1 ) {
123  const int iFilledEntries = m_data.size()/(m_nBinLogEDens*m_nBinLogDepth);
124  if ( iEtaLogEClus >= iFilledEntries )
125  m_data.resize((iFilledEntries+1)*(m_nBinLogEDens*m_nBinLogDepth));
126  const int iBin = getBin(eta,logEClus,logEDens,logDepth);
127  if ( iBin > -1 ) {
128  m_data[iBin] = theData;
129  }
130  }
131 }

Member Data Documentation

◆ m_data

std::vector<struct EMFracData> CaloEMFrac::m_data
private

The table.

Binned in the following order, least-rapidly varying first: eta, logEClus, logEDens, logDepth.

Definition at line 190 of file CaloEMFrac.h.

◆ m_MaxEta

float CaloEMFrac::m_MaxEta
private

Maximum eta for the last bin.

Definition at line 179 of file CaloEMFrac.h.

◆ m_MaxLogDepth

float CaloEMFrac::m_MaxLogDepth
private

Maximum log10(cluster depth) for the last bin.

Definition at line 185 of file CaloEMFrac.h.

◆ m_MaxLogEClus

float CaloEMFrac::m_MaxLogEClus
private

Maximum log10(cluster energy) for the last bin.

Definition at line 181 of file CaloEMFrac.h.

◆ m_MaxLogEDens

float CaloEMFrac::m_MaxLogEDens
private

Maximum log10(cluster energy density) for the last bin.

Definition at line 183 of file CaloEMFrac.h.

◆ m_MinEta

float CaloEMFrac::m_MinEta
private

Minimum eta for the first bin.

Definition at line 170 of file CaloEMFrac.h.

◆ m_MinLogDepth

float CaloEMFrac::m_MinLogDepth
private

Minimum log10(cluster depth) for the first bin.

Definition at line 176 of file CaloEMFrac.h.

◆ m_MinLogEClus

float CaloEMFrac::m_MinLogEClus
private

Minimum log10(cluster energy) for the first bin.

Definition at line 172 of file CaloEMFrac.h.

◆ m_MinLogEDens

float CaloEMFrac::m_MinLogEDens
private

Minimum log10(cluster energy density) for the first bin.

Definition at line 174 of file CaloEMFrac.h.

◆ m_nBinEta

int CaloEMFrac::m_nBinEta
private

Number of eta bins.

Definition at line 161 of file CaloEMFrac.h.

◆ m_nBinLogDepth

int CaloEMFrac::m_nBinLogDepth
private

Number of log10(cluster depth) bins.

Definition at line 167 of file CaloEMFrac.h.

◆ m_nBinLogEClus

int CaloEMFrac::m_nBinLogEClus
private

Number of log10(cluster energy) bins.

Definition at line 163 of file CaloEMFrac.h.

◆ m_nBinLogEDens

int CaloEMFrac::m_nBinLogEDens
private

Number of log10(cluster energy density) bins.

Definition at line 165 of file CaloEMFrac.h.


The documentation for this class was generated from the following files:
CaloEMFrac::m_MinLogEClus
float m_MinLogEClus
Minimum log10(cluster energy) for the first bin.
Definition: CaloEMFrac.h:172
CaloEMFrac::m_MaxLogEClus
float m_MaxLogEClus
Maximum log10(cluster energy) for the last bin.
Definition: CaloEMFrac.h:181
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloEMFrac::m_nBinLogEClus
int m_nBinLogEClus
Number of log10(cluster energy) bins.
Definition: CaloEMFrac.h:163
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
CaloEMFrac::m_MaxLogEDens
float m_MaxLogEDens
Maximum log10(cluster energy density) for the last bin.
Definition: CaloEMFrac.h:183
CaloEMFrac::m_MinEta
float m_MinEta
Minimum eta for the first bin.
Definition: CaloEMFrac.h:170
CaloEMFrac::getEtaLogEClusBin
int getEtaLogEClusBin(float eta, float logEClus) const
Find the eta/logEClus bin number.
Definition: CaloEMFrac.cxx:140
CaloEMFrac::m_nBinLogEDens
int m_nBinLogEDens
Number of log10(cluster energy density) bins.
Definition: CaloEMFrac.h:165
CaloEMFrac::m_MinLogEDens
float m_MinLogEDens
Minimum log10(cluster energy density) for the first bin.
Definition: CaloEMFrac.h:174
CaloEMFrac::m_MaxEta
float m_MaxEta
Maximum eta for the last bin.
Definition: CaloEMFrac.h:179
CaloEMFrac::m_MaxLogDepth
float m_MaxLogDepth
Maximum log10(cluster depth) for the last bin.
Definition: CaloEMFrac.h:185
CaloEMFrac::m_nBinLogDepth
int m_nBinLogDepth
Number of log10(cluster depth) bins.
Definition: CaloEMFrac.h:167
CaloEMFrac::getBin
int getBin(float eta, float logEClus, float logEDens, float logDepth) const
Find a bin number.
Definition: CaloEMFrac.cxx:164
CaloEMFrac::m_nBinEta
int m_nBinEta
Number of eta bins.
Definition: CaloEMFrac.h:161
CaloEMFrac::m_data
std::vector< struct EMFracData > m_data
The table.
Definition: CaloEMFrac.h:190
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
CaloEMFrac::m_MinLogDepth
float m_MinLogDepth
Minimum log10(cluster depth) for the first bin.
Definition: CaloEMFrac.h:176