ATLAS Offline Software
eFEXtauBDT.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***************************************************************************
6 // eFEXtauBDT.h -
7 // -------------------
8 // begin : 15 09 2022
9 // email : david.reikher@cern.ch
10 // ***************************************************************************/
11 
12 #ifndef eFEXtauBDT_H
13 #define eFEXtauBDT_H
14 
16 #include "L1CaloFEXSim/eFEXBDT.h"
17 #include <vector>
18 
19 class AthAlgTool;
20 
21 namespace LVL1 {
22 // Doxygen class description below:
26 class eFEXtauBDT {
27 
28 public:
30  eFEXtauBDT(AthAlgTool *log, std::string config_path);
31 
33  virtual ~eFEXtauBDT();
34 
35  void next();
36 
37  void setPointerToSCell(int eta, int phi, int layer, unsigned int *sCellPtr);
39  unsigned int *fracMultipliers);
40  void setPointerToBDTThresholdsParam(int index, unsigned int *bdtThresholds);
41  void setPointerToETThresholdParam(unsigned int *etThreshold);
42  void setPointerToMaxETParam(unsigned int *maxEtThreshold);
43  void setPointerToBDTMinETParam(unsigned int *bdtMinEtThreshold);
44 
45  void buildBDTVariables();
46  void computeBDTScore();
47  void computeETEstimate();
48  void computeEMETEstimate();
49  void computeHADETEstimate();
50  void computeFracCondition();
51  void computeBDTCondition();
52  void computeTowers();
55  void debugPrintTowers();
56  void initBDTVars();
57  void initETPointers();
58  void initEMETPointers();
59  void initHADETPointers();
60  void initTowersPointers();
61  unsigned int getETEstimate() const { return m_eTEstimate; }
62  unsigned int getEMETEstimate() const { return m_EM_eTEstimate; }
63  unsigned int getEMETEstimateOverflow() const {
65  }
66  unsigned int getHADETEstimate() const { return m_HAD_eTEstimate; }
67  unsigned int getHADETEstimateOverflow() const {
69  }
70  std::vector<unsigned int> &getBDTVars() { return m_bdtVars; }
71  std::vector<unsigned int> &getTowers() { return m_towers; }
72  std::vector<unsigned int> &getEMMultipliedByFracParams() {
73  return m_emEtXMultiplier;
74  }
75  std::vector<unsigned int> &getEMMultipliedByFracParamsOverflow() {
77  }
78  unsigned int getBDTScoreShifted() const { return m_bdtScoreShifted; }
79 
80  // ======= These are the important getters ======
81  // These are the fields in the algorithm's output TOB structure in the
82  // VHDL implementation of eFEXFirmware (TriggerObjectCore_tau type in VHDL)
83  unsigned int getET() const;
84  unsigned int getTOBETOverflow() const { return m_eTEstimateOverflow; }
85  unsigned int getIsMax() const { return m_isSeeded; }
86  unsigned int getBDTCondition() const { return m_bdtCondition; }
87  unsigned int getFracCondition() const { return m_fracCondition; }
88  unsigned int getBDTScore() const { return m_bdtScore; }
89  // ================================================================================
90 
91  unsigned int multWithOverflow(unsigned int a, unsigned int b, bool &overflow,
92  int resultNBits);
93  inline bool isOverflow(unsigned int number, int nBits);
94  inline unsigned int BitLeftShift(unsigned int number, int by, int totalNBits);
95  inline int flatTowerIndex(int eta, int phi);
96 
97 private:
98  void initPointers(const std::vector<std::vector<int>> &scells,
99  std::vector<unsigned int *> &ptr_list);
100  unsigned int computeEstimate(std::vector<unsigned int *> &ptr_list,
101  bool &overflow, int resultNBits);
102 
103  unsigned int *superCellToPtr(int eta, int phi, int layer);
104 
105  unsigned int *m_em0cells[3][3]{};
106  unsigned int *m_em1cells[12][3]{};
107  unsigned int *m_em2cells[12][3]{};
108  unsigned int *m_em3cells[3][3]{};
109  unsigned int *m_hadcells[3][3]{};
110  unsigned int *m_fracMultipliers[3]{};
111  unsigned int *m_bdtThresholds[3]{};
112  unsigned int *m_etThreshold{};
113  unsigned int *m_maxEtThreshold{};
114  unsigned int *m_bdtMinEtThreshold{};
115  unsigned int m_bdtScore = 0;
116  unsigned int m_bdtScoreShifted = 0;
117  unsigned int m_eTEstimate = 0;
118  bool m_eTEstimateOverflow = false;
119  unsigned int m_EM_eTEstimate = 0;
121  unsigned int m_HAD_eTEstimate = 0;
123  unsigned int m_fracCondition = 0;
124  unsigned int m_bdtCondition = 0;
125  bool m_isSeeded = false;
126  unsigned int m_hadEstimateShifted = 0;
127  std::vector<unsigned int> m_emEtXMultiplier;
128  std::vector<unsigned int> m_emEtXMultiplierOverflow;
129  std::vector<unsigned int> m_towers;
130 
131  // Final computed BDT variables
132  std::vector<unsigned int> m_bdtVars;
133 
134  // BDT variables are sums of supercells. The pointers to the memory locations
135  // containing the supercell ET values for each variable are stored in the
136  // following vector. Index in the vector corresponds to index of the variable.
137  std::vector<std::vector<unsigned int *>> m_bdtVarComputeSCellPointers;
138 
139  // List of pointers to supercells that participate in the sum to estimate the
140  // ET
141  std::vector<unsigned int *> m_eTComputeSCellPointers;
142  std::vector<unsigned int *> m_EM_eTComputeSCellPointers;
143  std::vector<unsigned int *> m_HAD_eTComputeSCellPointers;
144  std::vector<std::vector<unsigned int *>> m_towersComputeSCellPointers;
145 
146  bool m_bdtVarsComputed = false;
149 };
150 
151 } // namespace LVL1
152 
153 #endif
LVL1::eFEXtauBDT::computeBDTCondition
void computeBDTCondition()
Definition: eFEXtauBDT.cxx:345
LVL1::eFEXtauBDT::m_towers
std::vector< unsigned int > m_towers
Definition: eFEXtauBDT.h:129
LVL1::eFEXtauBDT::getHADETEstimateOverflow
unsigned int getHADETEstimateOverflow() const
Definition: eFEXtauBDT.h:67
LVL1::eFEXtauBDT::m_bdt
eFEXBDT m_bdt
Definition: eFEXtauBDT.h:147
LVL1::eFEXtauBDT::flatTowerIndex
int flatTowerIndex(int eta, int phi)
Definition: eFEXtauBDT.cxx:250
LVL1::eFEXtauBDT::m_HAD_eTEstimate
unsigned int m_HAD_eTEstimate
Definition: eFEXtauBDT.h:121
LVL1::eFEXtauBDT::getTOBETOverflow
unsigned int getTOBETOverflow() const
Definition: eFEXtauBDT.h:84
LVL1::eFEXtauBDT::m_bdtVarComputeSCellPointers
std::vector< std::vector< unsigned int * > > m_bdtVarComputeSCellPointers
Definition: eFEXtauBDT.h:137
LVL1::eFEXtauBDT::setPointerToMaxETParam
void setPointerToMaxETParam(unsigned int *maxEtThreshold)
Definition: eFEXtauBDT.cxx:68
LVL1::eFEXtauBDT::getBDTScore
unsigned int getBDTScore() const
Definition: eFEXtauBDT.h:88
LVL1::eFEXtauBDT::initPointers
void initPointers(const std::vector< std::vector< int >> &scells, std::vector< unsigned int * > &ptr_list)
Definition: eFEXtauBDT.cxx:112
LVL1::eFEXtauBDT::initHADETPointers
void initHADETPointers()
Definition: eFEXtauBDT.cxx:108
LVL1::eFEXtauBDT::setPointerToBDTMinETParam
void setPointerToBDTMinETParam(unsigned int *bdtMinEtThreshold)
Definition: eFEXtauBDT.cxx:73
index
Definition: index.py:1
LVL1::eFEXtauBDT::m_eTComputeSCellPointers
std::vector< unsigned int * > m_eTComputeSCellPointers
Definition: eFEXtauBDT.h:141
LVL1::eFEXtauBDT::m_maxEtThreshold
unsigned int * m_maxEtThreshold
Definition: eFEXtauBDT.h:113
LVL1::eFEXtauBDT::getFracCondition
unsigned int getFracCondition() const
Definition: eFEXtauBDT.h:87
LVL1::eFEXtauBDT::getET
unsigned int getET() const
Definition: eFEXtauBDT.cxx:410
LVL1::eFEXtauBDT::debugPrintBDTVariables
void debugPrintBDTVariables()
Definition: eFEXtauBDT.cxx:186
eFEXBDT.h
LVL1::eFEXtauBDT::debugPrintTowers
void debugPrintTowers()
Definition: eFEXtauBDT.cxx:238
LVL1::eFEXtauBDT::isOverflow
bool isOverflow(unsigned int number, int nBits)
Definition: eFEXtauBDT.cxx:265
LVL1::eFEXtauBDT::getTowers
std::vector< unsigned int > & getTowers()
Definition: eFEXtauBDT.h:71
LVL1::eFEXtauBDT::m_eTEstimateOverflow
bool m_eTEstimateOverflow
Definition: eFEXtauBDT.h:118
LVL1::eFEXtauBDT::getBDTScoreShifted
unsigned int getBDTScoreShifted() const
Definition: eFEXtauBDT.h:78
LVL1::eFEXtauBDT::setPointerToBDTThresholdsParam
void setPointerToBDTThresholdsParam(int index, unsigned int *bdtThresholds)
Definition: eFEXtauBDT.cxx:59
LVL1::eFEXtauBDT::computeETEstimate
void computeETEstimate()
Definition: eFEXtauBDT.cxx:220
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::eFEXtauBDT::computeEMETEstimate
void computeEMETEstimate()
Definition: eFEXtauBDT.cxx:226
LVL1::eFEXtauBDT::m_bdtVarsComputed
bool m_bdtVarsComputed
Definition: eFEXtauBDT.h:146
LVL1::eFEXtauBDT::computeTowers
void computeTowers()
Definition: eFEXtauBDT.cxx:252
LVL1::eFEXtauBDT::m_bdtMinEtThreshold
unsigned int * m_bdtMinEtThreshold
Definition: eFEXtauBDT.h:114
LVL1::eFEXtauBDT::m_bdtScoreShifted
unsigned int m_bdtScoreShifted
Definition: eFEXtauBDT.h:116
LVL1::eFEXtauBDT::m_log
AthAlgTool * m_log
Definition: eFEXtauBDT.h:148
LVL1::eFEXtauBDT
The eFEXtauBDT class calculates the tau TOB variables.
Definition: eFEXtauBDT.h:26
LVL1::eFEXtauBDT::eFEXtauBDT
eFEXtauBDT(AthAlgTool *log, std::string config_path)
Constructors.
Definition: eFEXtauBDT.cxx:19
LVL1::eFEXtauBDT::m_hadcells
unsigned int * m_hadcells[3][3]
Definition: eFEXtauBDT.h:109
LVL1::eFEXtauBDT::m_EM_eTComputeSCellPointers
std::vector< unsigned int * > m_EM_eTComputeSCellPointers
Definition: eFEXtauBDT.h:142
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1::eFEXtauBDT::getHADETEstimate
unsigned int getHADETEstimate() const
Definition: eFEXtauBDT.h:66
LVL1::eFEXtauBDT::m_towersComputeSCellPointers
std::vector< std::vector< unsigned int * > > m_towersComputeSCellPointers
Definition: eFEXtauBDT.h:144
AthAlgTool.h
LVL1::eFEXtauBDT::setPointerToETThresholdParam
void setPointerToETThresholdParam(unsigned int *etThreshold)
Definition: eFEXtauBDT.cxx:64
LVL1::eFEXtauBDT::getBDTCondition
unsigned int getBDTCondition() const
Definition: eFEXtauBDT.h:86
LVL1::eFEXtauBDT::setPointerToSCell
void setPointerToSCell(int eta, int phi, int layer, unsigned int *sCellPtr)
Definition: eFEXtauBDT.cxx:33
LVL1::eFEXtauBDT::initETPointers
void initETPointers()
Definition: eFEXtauBDT.cxx:100
LVL1::eFEXtauBDT::m_em0cells
unsigned int * m_em0cells[3][3]
Definition: eFEXtauBDT.h:105
fitman.by
by
Definition: fitman.py:411
LVL1::eFEXtauBDT::m_EM_eTEstimate
unsigned int m_EM_eTEstimate
Definition: eFEXtauBDT.h:119
LVL1::eFEXtauBDT::initTowersPointers
void initTowersPointers()
Definition: eFEXtauBDT.cxx:136
eFEXBDT
Definition: eFEXBDT.h:27
LVL1::eFEXtauBDT::m_hadEstimateShifted
unsigned int m_hadEstimateShifted
Definition: eFEXtauBDT.h:126
LVL1::eFEXtauBDT::m_fracCondition
unsigned int m_fracCondition
Definition: eFEXtauBDT.h:123
LVL1::eFEXtauBDT::m_em3cells
unsigned int * m_em3cells[3][3]
Definition: eFEXtauBDT.h:108
LVL1::eFEXtauBDT::getETEstimate
unsigned int getETEstimate() const
Definition: eFEXtauBDT.h:61
LVL1::eFEXtauBDT::initBDTVars
void initBDTVars()
Definition: eFEXtauBDT.cxx:144
python.selection.number
number
Definition: selection.py:20
LVL1::eFEXtauBDT::m_HAD_eTComputeSCellPointers
std::vector< unsigned int * > m_HAD_eTComputeSCellPointers
Definition: eFEXtauBDT.h:143
LVL1::eFEXtauBDT::m_emEtXMultiplier
std::vector< unsigned int > m_emEtXMultiplier
Definition: eFEXtauBDT.h:127
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
LVL1::eFEXtauBDT::m_fracMultipliers
unsigned int * m_fracMultipliers[3]
Definition: eFEXtauBDT.h:110
LVL1::eFEXtauBDT::getIsMax
unsigned int getIsMax() const
Definition: eFEXtauBDT.h:85
LVL1::eFEXtauBDT::buildBDTVariables
void buildBDTVariables()
Definition: eFEXtauBDT.cxx:196
LVL1::eFEXtauBDT::setPointerToFracMultipliersParam
void setPointerToFracMultipliersParam(int index, unsigned int *fracMultipliers)
Definition: eFEXtauBDT.cxx:54
LVL1::eFEXtauBDT::getEMETEstimateOverflow
unsigned int getEMETEstimateOverflow() const
Definition: eFEXtauBDT.h:63
LVL1::eFEXtauBDT::m_em2cells
unsigned int * m_em2cells[12][3]
Definition: eFEXtauBDT.h:107
a
TList * a
Definition: liststreamerinfos.cxx:10
LVL1::eFEXtauBDT::getEMETEstimate
unsigned int getEMETEstimate() const
Definition: eFEXtauBDT.h:62
LVL1::eFEXtauBDT::computeBDTScore
void computeBDTScore()
Definition: eFEXtauBDT.cxx:209
LVL1::eFEXtauBDT::m_bdtScore
unsigned int m_bdtScore
Definition: eFEXtauBDT.h:115
LVL1::eFEXtauBDT::m_isSeeded
bool m_isSeeded
Definition: eFEXtauBDT.h:125
LVL1::eFEXtauBDT::computeFracCondition
void computeFracCondition()
Definition: eFEXtauBDT.cxx:313
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LVL1::eFEXtauBDT::getEMMultipliedByFracParamsOverflow
std::vector< unsigned int > & getEMMultipliedByFracParamsOverflow()
Definition: eFEXtauBDT.h:75
LVL1::eFEXtauBDT::getEMMultipliedByFracParams
std::vector< unsigned int > & getEMMultipliedByFracParams()
Definition: eFEXtauBDT.h:72
LVL1::eFEXtauBDT::superCellToPtr
unsigned int * superCellToPtr(int eta, int phi, int layer)
Definition: eFEXtauBDT.cxx:78
LVL1::eFEXtauBDT::m_bdtThresholds
unsigned int * m_bdtThresholds[3]
Definition: eFEXtauBDT.h:111
LVL1::eFEXtauBDT::m_emEtXMultiplierOverflow
std::vector< unsigned int > m_emEtXMultiplierOverflow
Definition: eFEXtauBDT.h:128
LVL1::eFEXtauBDT::~eFEXtauBDT
virtual ~eFEXtauBDT()
Destructor.
Definition: eFEXtauBDT.cxx:31
AthAlgTool
Definition: AthAlgTool.h:26
LVL1::eFEXtauBDT::BitLeftShift
unsigned int BitLeftShift(unsigned int number, int by, int totalNBits)
Definition: eFEXtauBDT.cxx:305
LVL1::eFEXtauBDT::m_etThreshold
unsigned int * m_etThreshold
Definition: eFEXtauBDT.h:112
LVL1::eFEXtauBDT::m_HAD_eTEstimateOverflow
bool m_HAD_eTEstimateOverflow
Definition: eFEXtauBDT.h:122
LVL1::eFEXtauBDT::getBDTVars
std::vector< unsigned int > & getBDTVars()
Definition: eFEXtauBDT.h:70
LVL1::eFEXtauBDT::m_bdtVars
std::vector< unsigned int > m_bdtVars
Definition: eFEXtauBDT.h:132
LVL1::eFEXtauBDT::m_eTEstimate
unsigned int m_eTEstimate
Definition: eFEXtauBDT.h:117
LVL1::eFEXtauBDT::m_bdtCondition
unsigned int m_bdtCondition
Definition: eFEXtauBDT.h:124
LVL1::eFEXtauBDT::m_em1cells
unsigned int * m_em1cells[12][3]
Definition: eFEXtauBDT.h:106
LVL1::eFEXtauBDT::initEMETPointers
void initEMETPointers()
Definition: eFEXtauBDT.cxx:104
LVL1::eFEXtauBDT::computeIsCentralTowerSeed
void computeIsCentralTowerSeed()
Definition: eFEXtauBDT.cxx:372
LVL1::eFEXtauBDT::computeEstimate
unsigned int computeEstimate(std::vector< unsigned int * > &ptr_list, bool &overflow, int resultNBits)
Definition: eFEXtauBDT.cxx:273
LVL1::eFEXtauBDT::computeHADETEstimate
void computeHADETEstimate()
Definition: eFEXtauBDT.cxx:232
LVL1::eFEXtauBDT::multWithOverflow
unsigned int multWithOverflow(unsigned int a, unsigned int b, bool &overflow, int resultNBits)
Definition: eFEXtauBDT.cxx:286
LVL1::eFEXtauBDT::next
void next()
Definition: eFEXtauBDT.cxx:175
LVL1::eFEXtauBDT::m_EM_eTEstimateOverflow
bool m_EM_eTEstimateOverflow
Definition: eFEXtauBDT.h:120