15#define ENERGY_WIDTH 16
21 m_log->msg(MSG::DEBUG) <<
"Configured BDT with this file: " << config_path
34 unsigned int *sCellPtr) {
55 int index,
unsigned int *fracMultiplierPtr) {
60 int index,
unsigned int *bdtThresholdPtr) {
69 unsigned int *maxEtThreshold) {
74 unsigned int *maxEtThreshold) {
79 unsigned int *bdtMinEtThreshold) {
84 unsigned int *ptr = 0;
118 std::vector<unsigned int *> &ptr_list) {
119 m_log->msg(MSG::DEBUG) <<
"Will use sum of supercells: " <<
endmsg;
120 for (
const auto& scell : scells) {
123 int layer = scell[2];
124 m_log->msg(MSG::DEBUG) <<
"\teta=" <<
eta <<
"\tphi=" <<
phi
125 <<
"\tlayer=" << layer <<
endmsg;
128 m_log->msg(MSG::DEBUG)
129 <<
"Could not convert eta=" <<
eta <<
" phi=" <<
phi
130 <<
" layer=" << layer
131 <<
" to a pointer to supercell. Are they within range?" <<
endmsg;
132 throw std::domain_error(
133 std::string(
"Could not convert eta=") + std::to_string(
eta) +
134 " phi=" + std::to_string(
phi) +
" layer=" + std::to_string(layer) +
135 " to a pointer to supercell. Are they within range?");
137 ptr_list.push_back(ptr);
143 for (
size_t i = 0; i <
m_towers.size(); i++) {
150 for (
size_t i = 0; i <
m_bdt.getVariables().size(); i++) {
153 m_log->msg(MSG::DEBUG) << i <<
" is " << var.m_name <<
", sum of supercells"
155 std::vector<unsigned int *> pointersToSCells;
156 for (
size_t j = 0; j < var.m_scells.size(); j++) {
157 int eta = var.m_scells[j][0];
158 int phi = var.m_scells[j][1];
159 int layer = var.m_scells[j][2];
160 m_log->msg(MSG::DEBUG) <<
"\teta=" <<
eta <<
"\tphi=" <<
phi
161 <<
"\tlayer=" << layer <<
endmsg;
164 m_log->msg(MSG::DEBUG)
165 <<
"Could not convert eta=" <<
eta <<
" phi=" <<
phi
166 <<
" layer=" << layer
167 <<
" to a pointer to supercell. Are they within range?" <<
endmsg;
168 throw std::domain_error(
169 std::string(
"Could not convert eta=") + std::to_string(
eta) +
170 " phi=" + std::to_string(
phi) +
" layer=" + std::to_string(layer) +
171 " to a pointer to supercell. Are they within range?");
173 pointersToSCells.push_back(ptr);
192 std::string bdtVariables =
"";
193 for (
size_t i = 0; i <
m_bdtVars.size(); i++) {
194 bdtVariables += std::to_string(
m_bdtVars[i]) +
" ";
197 m_log->msg(MSG::DEBUG) <<
"BDT Variables: " << bdtVariables <<
endmsg;
217 m_log->msg(MSG::DEBUG)
218 <<
"BDT Variables not computed. BDT score will be garbage." <<
endmsg;
244 m_log->msg(MSG::DEBUG) <<
"Towers Estimate: " <<
endmsg;
248 m_log->msg(MSG::DEBUG)
249 <<
"Tower " << flatIndex <<
" ET (eta=" <<
eta <<
", phi=" <<
phi
258 for (
size_t i = 0; i <
m_towers.size(); i++) {
271 if ((
number >> nBits) != 0) {
279 bool &overflow,
int resultNBits) {
280 unsigned int estimate = 0;
282 for (
unsigned int *it : ptr_list) {
312 if ((
number >> (totalNBits - by)) != 0) {
313 return (1 << totalNBits) - 1;
335 for (; i < n_multipliers; i++) {
367 for (; i < n_thresholds; i++) {
381 unsigned int centralET =
m_towers[4];
384 for (
unsigned int beta = 0; beta < 3; beta++) {
385 for (
unsigned int bphi = 0; bphi < 3; bphi++) {
388 if ((beta == 1) && (bphi == 1)) {
393 if (beta == 2 || (beta == 1 && bphi == 2)) {
394 if (centralET <=
m_towers[flatIndex]) {
400 else if (beta == 0 || (beta == 1 && bphi == 0)) {
401 if (centralET <
m_towers[flatIndex]) {
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
unsigned int * m_em3cells[3][3]
int flatTowerIndex(int eta, int phi)
unsigned int * m_maxEtThreshold
std::vector< unsigned int * > m_HAD_eTComputeSCellPointers
void initPointers(const std::vector< std::vector< int > > &scells, std::vector< unsigned int * > &ptr_list)
unsigned int BitLeftShift(unsigned int number, int by, int totalNBits)
void setPointerToSCell(int eta, int phi, int layer, unsigned int *sCellPtr)
void computeHADETEstimate()
unsigned int m_hadEstimateShifted
unsigned int m_eTEstimate
void setPointerToBDTMinETParam(unsigned int *bdtMinEtThreshold)
unsigned int m_bdtCondition
std::vector< unsigned int > m_emEtXMultiplierOverflow
std::vector< unsigned int * > m_eTComputeSCellPointers
bool m_eTEstimateOverflow
unsigned int * m_etThreshold
unsigned int computeEstimate(std::vector< unsigned int * > &ptr_list, bool &overflow, int resultNBits)
unsigned int * m_em1cells[12][3]
unsigned int multWithOverflow(unsigned int a, unsigned int b, bool &overflow, int resultNBits)
unsigned int m_fracCondition
unsigned int * m_fracMultipliers[3]
unsigned int * superCellToPtr(int eta, int phi, int layer)
unsigned int * m_maxEtThresholdFrac
void setPointerToBDTThresholdsParam(int index, unsigned int *bdtThresholds)
void setPointerToMaxETParam(unsigned int *maxEtThreshold)
std::vector< unsigned int > m_towers
void computeBDTCondition()
std::vector< std::vector< unsigned int * > > m_towersComputeSCellPointers
virtual ~eFEXtauBDT()
Destructor.
unsigned int getET() const
std::vector< unsigned int > m_emEtXMultiplier
void computeIsCentralTowerSeed()
void initTowersPointers()
unsigned int * m_hadcells[3][3]
unsigned int * m_em2cells[12][3]
bool m_EM_eTEstimateOverflow
unsigned int * m_bdtMinEtThreshold
unsigned int * m_em0cells[3][3]
void setPointerToETThresholdParam(unsigned int *etThreshold)
void computeFracCondition()
std::vector< unsigned int * > m_EM_eTComputeSCellPointers
bool isOverflow(unsigned int number, int nBits)
void setPointerToFracMultipliersParam(int index, unsigned int *fracMultipliers)
void debugPrintBDTVariables()
eFEXtauBDT(AthAlgTool *log, std::string config_path)
Constructors.
void setPointerToMaxETParamFrac(unsigned int *maxEtThreshold)
unsigned int m_HAD_eTEstimate
std::vector< unsigned int > m_bdtVars
void computeEMETEstimate()
unsigned int * m_bdtThresholds[3]
unsigned int m_EM_eTEstimate
std::vector< std::vector< unsigned int * > > m_bdtVarComputeSCellPointers
bool m_HAD_eTEstimateOverflow
unsigned int m_bdtScoreShifted
std::string number(const double &d, const std::string &s)