ATLAS Offline Software
Loading...
Searching...
No Matches
eflowEEtaBinBase Class Reference

Base class which sets up some of the infrastructure to store the e/p reference values. More...

#include <eflowEEtaBinBase.h>

Inheritance diagram for eflowEEtaBinBase:
Collaboration diagram for eflowEEtaBinBase:

Public Member Functions

 eflowEEtaBinBase ()=default
virtual ~eflowEEtaBinBase ()
bool binExists (double e, double eta) const

Static Public Member Functions

static double getErrorReturnValue ()

Protected Member Functions

int getNumEBins () const
int getNumEtaBins () const
int getEBinIndexLegacy (double e) const
int getEBinIndex (double e) const
int getEtaBinIndex (double eta) const

Static Protected Member Functions

static int getBinIndex (double x, const std::vector< double > &binBounds)

Protected Attributes

bool m_useAbsEta {true}
std::vector< double > m_eBinBounds
std::vector< double > m_etaBinBounds

Static Protected Attributes

static const double m_errorReturnValue = -999.0

Detailed Description

Base class which sets up some of the infrastructure to store the e/p reference values.

The base class has methods to return bin indices, and has a bool to toggle whether to use linear or log interpolation between bins (such that the e/p reference can smoothly vary as a function of kinematics).

Definition at line 26 of file eflowEEtaBinBase.h.

Constructor & Destructor Documentation

◆ eflowEEtaBinBase()

eflowEEtaBinBase::eflowEEtaBinBase ( )
default

◆ ~eflowEEtaBinBase()

eflowEEtaBinBase::~eflowEEtaBinBase ( )
virtualdefault

Member Function Documentation

◆ binExists()

bool eflowEEtaBinBase::binExists ( double e,
double eta ) const
inline

Definition at line 32 of file eflowEEtaBinBase.h.

32{ return (getEBinIndex(e) >= 0 && getEtaBinIndex(eta) >= 0); }
Scalar eta() const
pseudorapidity method
int getEtaBinIndex(double eta) const
int getEBinIndex(double e) const

◆ getBinIndex()

int eflowEEtaBinBase::getBinIndex ( double x,
const std::vector< double > & binBounds )
staticprotected

Definition at line 67 of file eflowEEtaBinBase.cxx.

67 {
68 int nBins = binBounds.size() - 1;
69 int bin = -1;
70 for (int i = 0; i < nBins; i++) {
71 if (x >= binBounds[i] && x < binBounds[i+1]) {
72 bin = i;
73 break;
74 }
75 }
76 return bin;
77}
#define x

◆ getEBinIndex()

int eflowEEtaBinBase::getEBinIndex ( double e) const
protected

Definition at line 28 of file eflowEEtaBinBase.cxx.

28 {
29 int nEBins = getNumEBins();
30 for (int i = 0; i < (nEBins-1); i++) {
31 if (e > m_eBinBounds[i] && e < m_eBinBounds[i + 1]) return i;
32 }
33 //for the final bin we simply check if the track energy is greater than the lower bound
34 if ( !m_eBinBounds.empty() && e > m_eBinBounds.back() ) return nEBins-1;
35 return 0;
36}
int getNumEBins() const
std::vector< double > m_eBinBounds

◆ getEBinIndexLegacy()

int eflowEEtaBinBase::getEBinIndexLegacy ( double e) const
protected

Definition at line 38 of file eflowEEtaBinBase.cxx.

38 {
39
40 int nEBins = getNumEBins();
41 int bin = 0;
42 for (int i = nEBins - 1; i > 0; i--) {
43 if (e > sqrt(m_eBinBounds[i - 1] * m_eBinBounds[i])) {
44 bin = i;
45 break;
46 }
47 }
48 return bin;
49
50}

◆ getErrorReturnValue()

double eflowEEtaBinBase::getErrorReturnValue ( )
inlinestatic

Definition at line 34 of file eflowEEtaBinBase.h.

34{return m_errorReturnValue;}
static const double m_errorReturnValue

◆ getEtaBinIndex()

int eflowEEtaBinBase::getEtaBinIndex ( double eta) const
protected

Definition at line 52 of file eflowEEtaBinBase.cxx.

52 {
53 if (m_useAbsEta) eta = fabs(eta);
54
55 /* If eta is outside bin range, return highest/lowest bin to avoid binning failures
56 * (in practice we always use absEta, so it can only be too high) */
57 if (eta > m_etaBinBounds.back()) {
58 return m_etaBinBounds.size()-2; // Yes, it's minus *two* --> we need to return the index of the *low* edge of the bin
59 }
60 if (eta < m_etaBinBounds[0]){
61 return 0;
62 }
63
65}
std::vector< double > m_etaBinBounds
static int getBinIndex(double x, const std::vector< double > &binBounds)

◆ getNumEBins()

int eflowEEtaBinBase::getNumEBins ( ) const
inlineprotected

Definition at line 38 of file eflowEEtaBinBase.h.

38{ return m_eBinBounds.size(); }

◆ getNumEtaBins()

int eflowEEtaBinBase::getNumEtaBins ( ) const
inlineprotected

Definition at line 39 of file eflowEEtaBinBase.h.

39{ return m_etaBinBounds.size(); }

Member Data Documentation

◆ m_eBinBounds

std::vector<double> eflowEEtaBinBase::m_eBinBounds
protected

Definition at line 49 of file eflowEEtaBinBase.h.

◆ m_errorReturnValue

const double eflowEEtaBinBase::m_errorReturnValue = -999.0
staticprotected

Definition at line 46 of file eflowEEtaBinBase.h.

◆ m_etaBinBounds

std::vector<double> eflowEEtaBinBase::m_etaBinBounds
protected

Definition at line 50 of file eflowEEtaBinBase.h.

◆ m_useAbsEta

bool eflowEEtaBinBase::m_useAbsEta {true}
protected

Definition at line 48 of file eflowEEtaBinBase.h.

48{true};

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