20 #include "GaudiKernel/SystemOfUnits.h"
34 m_useAbsEta = useAbsEta;
35 m_eBinBounds = eBinBounds;
36 m_etaBinBounds = etaBinBounds;
39 int nEBins = getNumEBins();
41 m_bins.reserve(nEBins);
42 for (
int iEBin = 0; iEBin < nEBins; iEBin++) {
43 std::vector<std::unique_ptr<eflowParameters> > tempVector;
45 for (
int iEtaBin = 0; iEtaBin <
nEtaBins; iEtaBin++) {
46 tempVector.push_back(std::make_unique<eflowParameters>());
48 m_bins.push_back(std::move(tempVector));
54 double e,
double eta,
bool useLegacyEnergyBinIndexing)
const {
57 if (useLegacyEnergyBinIndexing) {
58 eBin = getEBinIndexLegacy(
e);
60 eBin = getEBinIndex(
e);
65 if (eBin < 0 ||
etaBin < 0) {
72 if ((0 == eBin &&
e <= m_eBinBounds[eBin]) ||
73 (eBin == getNumEBins() - 1 &&
e >= m_eBinBounds[getNumEBins() - 1])) {
83 if (
e >= m_eBinBounds[eBin]) {
88 auto outOfRange = [
this](
int bin)->
bool{
89 return (
bin<0) or (
bin>=std::ssize(m_bins));
92 if (outOfRange(lowEBin) or outOfRange(highEBin)){
93 throw std::out_of_range(
"Attempt to access element out of range in eflowEEtaBinnedParameters::getInterpolation");
98 double higherEBound = m_eBinBounds[highEBin];
99 double lowerEBound = m_eBinBounds[lowEBin];
101 if (lowerEBound < FLT_MIN) lowerEBound = FLT_MIN;
103 weight =
log(higherEBound /
e) /
log(higherEBound / lowerEBound);
114 if (useLegacyEnergyBinIndexing) {
115 eBinIndex = getEBinIndexLegacy(
e);
117 eBinIndex = getEBinIndex(
e);
122 if (0 <= eBinIndex && eBinIndex <= 5) {
123 if (fabs(
eta) < 1.5) {
129 if (fabs(
eta) >= 1.6) {
138 if (0 == eBinIndex || 1 == eBinIndex) {
139 if (fabs(
eta) >= 1.0 && fabs(
eta) < 1.1) {
142 else if (fabs(
eta) >= 1.2 && fabs(
eta) < 1.3) {
145 else if (fabs(
eta) >= 1.5 && fabs(
eta) < 1.6) {
149 }
else if (2 == eBinIndex) {
150 if (fabs(
eta) >= 1.5 && fabs(
eta) < 1.6) {
154 }
else if (3 == eBinIndex) {
155 if (fabs(
eta) >= 1.5 && fabs(
eta) < 1.6) {
160 }
else if (4 == eBinIndex || 5 == eBinIndex) {
161 if (fabs(
eta) >= 1.5 && fabs(
eta) < 1.6) {