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();
54  void debugPrintSCellValues();
56  void debugPrintTowers();
57  void initBDTVars();
58  void initETPointers();
59  void initEMETPointers();
60  void initHADETPointers();
61  void initTowersPointers();
62  unsigned int getETEstimate() const { return m_eTEstimate; }
63  unsigned int getEMETEstimate() const { return m_EM_eTEstimate; }
64  unsigned int getEMETEstimateOverflow() const {
66  }
67  unsigned int getHADETEstimate() const { return m_HAD_eTEstimate; }
68  unsigned int getHADETEstimateOverflow() const {
70  }
71  std::vector<unsigned int> &getBDTVars() { return m_bdtVars; }
72  std::vector<unsigned int> &getTowers() { return m_towers; }
73  std::vector<unsigned int> &getEMMultipliedByFracParams() {
74  return m_emEtXMultiplier;
75  }
76  std::vector<unsigned int> &getEMMultipliedByFracParamsOverflow() {
78  }
79  unsigned int getBDTScoreShifted() const { return m_bdtScoreShifted; }
80 
81  // ======= These are the important getters ======
82  // These are the fields in the algorithm's output TOB structure in the
83  // VHDL implementation of eFEXFirmware (TriggerObjectCore_tau type in VHDL)
84  unsigned int getET() const;
85  unsigned int getTOBETOverflow() const { return m_eTEstimateOverflow; }
86  unsigned int getIsMax() const { return m_isSeeded; }
87  unsigned int getBDTCondition() const { return m_bdtCondition; }
88  unsigned int getFracCondition() const { return m_fracCondition; }
89  unsigned int getBDTScore() const { return m_bdtScore; }
90  // ================================================================================
91 
92  unsigned int multWithOverflow(unsigned int a, unsigned int b, bool &overflow,
93  int resultNBits);
94  inline bool isOverflow(unsigned int number, int nBits);
95  inline unsigned int BitLeftShift(unsigned int number, int by, int totalNBits);
96  inline int flatTowerIndex(int eta, int phi);
97 
98 private:
99  void initPointers(const std::vector<std::vector<int>> &scells,
100  std::vector<unsigned int *> &ptr_list);
101  unsigned int computeEstimate(std::vector<unsigned int *> &ptr_list,
102  bool &overflow, int resultNBits);
103 
104  unsigned int *superCellToPtr(int eta, int phi, int layer);
105 
106  unsigned int *m_em0cells[3][3]{};
107  unsigned int *m_em1cells[12][3]{};
108  unsigned int *m_em2cells[12][3]{};
109  unsigned int *m_em3cells[3][3]{};
110  unsigned int *m_hadcells[3][3]{};
111  unsigned int *m_fracMultipliers[3]{};
112  unsigned int *m_bdtThresholds[3]{};
113  unsigned int *m_etThreshold{};
114  unsigned int *m_maxEtThreshold{};
115  unsigned int *m_bdtMinEtThreshold{};
116  unsigned int m_bdtScore = 0;
117  unsigned int m_bdtScoreShifted = 0;
118  unsigned int m_eTEstimate = 0;
119  bool m_eTEstimateOverflow = false;
120  unsigned int m_EM_eTEstimate = 0;
122  unsigned int m_HAD_eTEstimate = 0;
124  unsigned int m_fracCondition = 0;
125  unsigned int m_bdtCondition = 0;
126  bool m_isSeeded = false;
127  unsigned int m_hadEstimateShifted = 0;
128  std::vector<unsigned int> m_emEtXMultiplier;
129  std::vector<unsigned int> m_emEtXMultiplierOverflow;
130  std::vector<unsigned int> m_towers;
131 
132  // Final computed BDT variables
133  std::vector<unsigned int> m_bdtVars;
134 
135  // BDT variables are sums of supercells. The pointers to the memory locations
136  // containing the supercell ET values for each variable are stored in the
137  // following vector. Index in the vector corresponds to index of the variable.
138  std::vector<std::vector<unsigned int *>> m_bdtVarComputeSCellPointers;
139 
140  // List of pointers to supercells that participate in the sum to estimate the
141  // ET
142  std::vector<unsigned int *> m_eTComputeSCellPointers;
143  std::vector<unsigned int *> m_EM_eTComputeSCellPointers;
144  std::vector<unsigned int *> m_HAD_eTComputeSCellPointers;
145  std::vector<std::vector<unsigned int *>> m_towersComputeSCellPointers;
146 
147  bool m_bdtVarsComputed = false;
150 };
151 
152 } // namespace LVL1
153 
154 #endif
LVL1::eFEXtauBDT::computeBDTCondition
void computeBDTCondition()
Definition: eFEXtauBDT.cxx:387
LVL1::eFEXtauBDT::m_towers
std::vector< unsigned int > m_towers
Definition: eFEXtauBDT.h:130
LVL1::eFEXtauBDT::getHADETEstimateOverflow
unsigned int getHADETEstimateOverflow() const
Definition: eFEXtauBDT.h:68
LVL1::eFEXtauBDT::m_bdt
eFEXBDT m_bdt
Definition: eFEXtauBDT.h:148
LVL1::eFEXtauBDT::flatTowerIndex
int flatTowerIndex(int eta, int phi)
Definition: eFEXtauBDT.cxx:292
LVL1::eFEXtauBDT::m_HAD_eTEstimate
unsigned int m_HAD_eTEstimate
Definition: eFEXtauBDT.h:122
LVL1::eFEXtauBDT::getTOBETOverflow
unsigned int getTOBETOverflow() const
Definition: eFEXtauBDT.h:85
LVL1::eFEXtauBDT::m_bdtVarComputeSCellPointers
std::vector< std::vector< unsigned int * > > m_bdtVarComputeSCellPointers
Definition: eFEXtauBDT.h:138
LVL1::eFEXtauBDT::setPointerToMaxETParam
void setPointerToMaxETParam(unsigned int *maxEtThreshold)
Definition: eFEXtauBDT.cxx:69
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
LVL1::eFEXtauBDT::getBDTScore
unsigned int getBDTScore() const
Definition: eFEXtauBDT.h:89
LVL1::eFEXtauBDT::initPointers
void initPointers(const std::vector< std::vector< int >> &scells, std::vector< unsigned int * > &ptr_list)
Definition: eFEXtauBDT.cxx:113
LVL1::eFEXtauBDT::initHADETPointers
void initHADETPointers()
Definition: eFEXtauBDT.cxx:109
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
LVL1::eFEXtauBDT::setPointerToBDTMinETParam
void setPointerToBDTMinETParam(unsigned int *bdtMinEtThreshold)
Definition: eFEXtauBDT.cxx:74
index
Definition: index.py:1
LVL1::eFEXtauBDT::m_eTComputeSCellPointers
std::vector< unsigned int * > m_eTComputeSCellPointers
Definition: eFEXtauBDT.h:142
LVL1::eFEXtauBDT::m_maxEtThreshold
unsigned int * m_maxEtThreshold
Definition: eFEXtauBDT.h:114
LVL1::eFEXtauBDT::getFracCondition
unsigned int getFracCondition() const
Definition: eFEXtauBDT.h:88
LVL1::eFEXtauBDT::getET
unsigned int getET() const
Definition: eFEXtauBDT.cxx:452
LVL1::eFEXtauBDT::debugPrintBDTVariables
void debugPrintBDTVariables()
Definition: eFEXtauBDT.cxx:227
eFEXBDT.h
LVL1::eFEXtauBDT::debugPrintTowers
void debugPrintTowers()
Definition: eFEXtauBDT.cxx:280
LVL1::eFEXtauBDT::isOverflow
bool isOverflow(unsigned int number, int nBits)
Definition: eFEXtauBDT.cxx:307
LVL1::eFEXtauBDT::getTowers
std::vector< unsigned int > & getTowers()
Definition: eFEXtauBDT.h:72
LVL1::eFEXtauBDT::m_eTEstimateOverflow
bool m_eTEstimateOverflow
Definition: eFEXtauBDT.h:119
LVL1::eFEXtauBDT::getBDTScoreShifted
unsigned int getBDTScoreShifted() const
Definition: eFEXtauBDT.h:79
LVL1::eFEXtauBDT::setPointerToBDTThresholdsParam
void setPointerToBDTThresholdsParam(int index, unsigned int *bdtThresholds)
Definition: eFEXtauBDT.cxx:60
LVL1::eFEXtauBDT::computeETEstimate
void computeETEstimate()
Definition: eFEXtauBDT.cxx:262
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
LVL1::eFEXtauBDT::computeEMETEstimate
void computeEMETEstimate()
Definition: eFEXtauBDT.cxx:268
LVL1::eFEXtauBDT::m_bdtVarsComputed
bool m_bdtVarsComputed
Definition: eFEXtauBDT.h:147
LVL1::eFEXtauBDT::computeTowers
void computeTowers()
Definition: eFEXtauBDT.cxx:294
LVL1::eFEXtauBDT::m_bdtMinEtThreshold
unsigned int * m_bdtMinEtThreshold
Definition: eFEXtauBDT.h:115
LVL1::eFEXtauBDT::m_bdtScoreShifted
unsigned int m_bdtScoreShifted
Definition: eFEXtauBDT.h:117
LVL1::eFEXtauBDT::m_log
AthAlgTool * m_log
Definition: eFEXtauBDT.h:149
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:20
LVL1::eFEXtauBDT::m_hadcells
unsigned int * m_hadcells[3][3]
Definition: eFEXtauBDT.h:110
LVL1::eFEXtauBDT::m_EM_eTComputeSCellPointers
std::vector< unsigned int * > m_EM_eTComputeSCellPointers
Definition: eFEXtauBDT.h:143
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
LVL1::eFEXtauBDT::getHADETEstimate
unsigned int getHADETEstimate() const
Definition: eFEXtauBDT.h:67
LVL1::eFEXtauBDT::m_towersComputeSCellPointers
std::vector< std::vector< unsigned int * > > m_towersComputeSCellPointers
Definition: eFEXtauBDT.h:145
AthAlgTool.h
LVL1::eFEXtauBDT::setPointerToETThresholdParam
void setPointerToETThresholdParam(unsigned int *etThreshold)
Definition: eFEXtauBDT.cxx:65
LVL1::eFEXtauBDT::getBDTCondition
unsigned int getBDTCondition() const
Definition: eFEXtauBDT.h:87
LVL1::eFEXtauBDT::setPointerToSCell
void setPointerToSCell(int eta, int phi, int layer, unsigned int *sCellPtr)
Definition: eFEXtauBDT.cxx:34
LVL1::eFEXtauBDT::initETPointers
void initETPointers()
Definition: eFEXtauBDT.cxx:101
LVL1::eFEXtauBDT::m_em0cells
unsigned int * m_em0cells[3][3]
Definition: eFEXtauBDT.h:106
fitman.by
by
Definition: fitman.py:411
LVL1::eFEXtauBDT::m_EM_eTEstimate
unsigned int m_EM_eTEstimate
Definition: eFEXtauBDT.h:120
LVL1::eFEXtauBDT::initTowersPointers
void initTowersPointers()
Definition: eFEXtauBDT.cxx:137
eFEXBDT
Definition: eFEXBDT.h:27
LVL1::eFEXtauBDT::m_hadEstimateShifted
unsigned int m_hadEstimateShifted
Definition: eFEXtauBDT.h:127
LVL1::eFEXtauBDT::m_fracCondition
unsigned int m_fracCondition
Definition: eFEXtauBDT.h:124
LVL1::eFEXtauBDT::m_em3cells
unsigned int * m_em3cells[3][3]
Definition: eFEXtauBDT.h:109
LVL1::eFEXtauBDT::getETEstimate
unsigned int getETEstimate() const
Definition: eFEXtauBDT.h:62
LVL1::eFEXtauBDT::initBDTVars
void initBDTVars()
Definition: eFEXtauBDT.cxx:145
python.selection.number
number
Definition: selection.py:20
LVL1::eFEXtauBDT::m_HAD_eTComputeSCellPointers
std::vector< unsigned int * > m_HAD_eTComputeSCellPointers
Definition: eFEXtauBDT.h:144
LVL1::eFEXtauBDT::m_emEtXMultiplier
std::vector< unsigned int > m_emEtXMultiplier
Definition: eFEXtauBDT.h:128
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
LVL1::eFEXtauBDT::m_fracMultipliers
unsigned int * m_fracMultipliers[3]
Definition: eFEXtauBDT.h:111
LVL1::eFEXtauBDT::getIsMax
unsigned int getIsMax() const
Definition: eFEXtauBDT.h:86
LVL1::eFEXtauBDT::buildBDTVariables
void buildBDTVariables()
Definition: eFEXtauBDT.cxx:237
LVL1::eFEXtauBDT::setPointerToFracMultipliersParam
void setPointerToFracMultipliersParam(int index, unsigned int *fracMultipliers)
Definition: eFEXtauBDT.cxx:55
LVL1::eFEXtauBDT::getEMETEstimateOverflow
unsigned int getEMETEstimateOverflow() const
Definition: eFEXtauBDT.h:64
LVL1::eFEXtauBDT::m_em2cells
unsigned int * m_em2cells[12][3]
Definition: eFEXtauBDT.h:108
a
TList * a
Definition: liststreamerinfos.cxx:10
LVL1::eFEXtauBDT::getEMETEstimate
unsigned int getEMETEstimate() const
Definition: eFEXtauBDT.h:63
LVL1::eFEXtauBDT::computeBDTScore
void computeBDTScore()
Definition: eFEXtauBDT.cxx:251
LVL1::eFEXtauBDT::m_bdtScore
unsigned int m_bdtScore
Definition: eFEXtauBDT.h:116
LVL1::eFEXtauBDT::debugPrintSCellValues
void debugPrintSCellValues()
Definition: eFEXtauBDT.cxx:187
LVL1::eFEXtauBDT::m_isSeeded
bool m_isSeeded
Definition: eFEXtauBDT.h:126
LVL1::eFEXtauBDT::computeFracCondition
void computeFracCondition()
Definition: eFEXtauBDT.cxx:355
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
LVL1::eFEXtauBDT::getEMMultipliedByFracParamsOverflow
std::vector< unsigned int > & getEMMultipliedByFracParamsOverflow()
Definition: eFEXtauBDT.h:76
LVL1::eFEXtauBDT::getEMMultipliedByFracParams
std::vector< unsigned int > & getEMMultipliedByFracParams()
Definition: eFEXtauBDT.h:73
LVL1::eFEXtauBDT::superCellToPtr
unsigned int * superCellToPtr(int eta, int phi, int layer)
Definition: eFEXtauBDT.cxx:79
LVL1::eFEXtauBDT::m_bdtThresholds
unsigned int * m_bdtThresholds[3]
Definition: eFEXtauBDT.h:112
LVL1::eFEXtauBDT::m_emEtXMultiplierOverflow
std::vector< unsigned int > m_emEtXMultiplierOverflow
Definition: eFEXtauBDT.h:129
LVL1::eFEXtauBDT::~eFEXtauBDT
virtual ~eFEXtauBDT()
Destructor.
Definition: eFEXtauBDT.cxx:32
AthAlgTool
Definition: AthAlgTool.h:26
LVL1::eFEXtauBDT::BitLeftShift
unsigned int BitLeftShift(unsigned int number, int by, int totalNBits)
Definition: eFEXtauBDT.cxx:347
LVL1::eFEXtauBDT::m_etThreshold
unsigned int * m_etThreshold
Definition: eFEXtauBDT.h:113
LVL1::eFEXtauBDT::m_HAD_eTEstimateOverflow
bool m_HAD_eTEstimateOverflow
Definition: eFEXtauBDT.h:123
LVL1::eFEXtauBDT::getBDTVars
std::vector< unsigned int > & getBDTVars()
Definition: eFEXtauBDT.h:71
LVL1::eFEXtauBDT::m_bdtVars
std::vector< unsigned int > m_bdtVars
Definition: eFEXtauBDT.h:133
LVL1::eFEXtauBDT::m_eTEstimate
unsigned int m_eTEstimate
Definition: eFEXtauBDT.h:118
LVL1::eFEXtauBDT::m_bdtCondition
unsigned int m_bdtCondition
Definition: eFEXtauBDT.h:125
LVL1::eFEXtauBDT::m_em1cells
unsigned int * m_em1cells[12][3]
Definition: eFEXtauBDT.h:107
LVL1::eFEXtauBDT::initEMETPointers
void initEMETPointers()
Definition: eFEXtauBDT.cxx:105
LVL1::eFEXtauBDT::computeIsCentralTowerSeed
void computeIsCentralTowerSeed()
Definition: eFEXtauBDT.cxx:414
LVL1::eFEXtauBDT::computeEstimate
unsigned int computeEstimate(std::vector< unsigned int * > &ptr_list, bool &overflow, int resultNBits)
Definition: eFEXtauBDT.cxx:315
LVL1::eFEXtauBDT::computeHADETEstimate
void computeHADETEstimate()
Definition: eFEXtauBDT.cxx:274
LVL1::eFEXtauBDT::multWithOverflow
unsigned int multWithOverflow(unsigned int a, unsigned int b, bool &overflow, int resultNBits)
Definition: eFEXtauBDT.cxx:328
LVL1::eFEXtauBDT::next
void next()
Definition: eFEXtauBDT.cxx:176
LVL1::eFEXtauBDT::m_EM_eTEstimateOverflow
bool m_EM_eTEstimateOverflow
Definition: eFEXtauBDT.h:121