1 #ifndef L1_TRACK_TRIGGER_TRACK_WORD_H 2 #define L1_TRACK_TRIGGER_TRACK_WORD_H 32 const unsigned int,
const double,
const double,
const unsigned int,
const double,
const unsigned int);
101 {0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 10.0, 15.0, 20.0, 35.0, 60.0, 200.0}};
103 {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 8.0, 10.0, 20.0, 50.0}};
105 {0.0, 0.75, 1.0, 1.5, 2.25, 3.5, 5.0, 20.0}};
109 {0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.750, 0.875}};
116 typedef ap_uint<TrackBitWidths::kValidSize>
valid_t;
119 typedef ap_uint<TrackBitWidths::kRinvSize>
rinv_t;
120 typedef ap_uint<TrackBitWidths::kPhiSize>
phi_t;
121 typedef ap_uint<TrackBitWidths::kTanlSize>
tanl_t;
122 typedef ap_uint<TrackBitWidths::kZ0Size>
z0_t;
123 typedef ap_uint<TrackBitWidths::kD0Size>
d0_t;
127 typedef ap_uint<TrackBitWidths::kChi2RZSize>
chi2rz_t;
129 typedef ap_uint<TrackBitWidths::kHitPatternSize>
hit_t;
147 unsigned int hitPattern,
157 unsigned int chi2RPhi,
159 unsigned int bendChi2,
160 unsigned int hitPattern,
161 unsigned int mvaQuality,
162 unsigned int mvaOther);
183 return getTrackWord()(TrackBitLocations::kChi2RPhiMSB, TrackBitLocations::kChi2RPhiLSB);
186 return getTrackWord()(TrackBitLocations::kChi2RZMSB, TrackBitLocations::kChi2RZLSB);
189 return getTrackWord()(TrackBitLocations::kBendChi2MSB, TrackBitLocations::kBendChi2LSB);
192 return getTrackWord()(TrackBitLocations::kHitPatternMSB, TrackBitLocations::kHitPatternLSB);
195 return getTrackWord()(TrackBitLocations::kMVAQualityMSB, TrackBitLocations::kMVAQualityLSB);
198 return getTrackWord()(TrackBitLocations::kMVAOtherMSB, TrackBitLocations::kMVAOtherLSB);
242 unsigned int hitPattern,
253 unsigned int chi2RPhi,
255 unsigned int bendChi2,
256 unsigned int hitPattern,
257 unsigned int mvaQuality,
258 unsigned int mvaOther);
261 ap_uint<TrackBitWidths::kRinvSize> rInv,
262 ap_uint<TrackBitWidths::kPhiSize> phi0,
263 ap_uint<TrackBitWidths::kTanlSize> tanl,
264 ap_uint<TrackBitWidths::kZ0Size>
z0,
265 ap_uint<TrackBitWidths::kD0Size>
d0,
266 ap_uint<TrackBitWidths::kChi2RPhiSize> chi2RPhi,
267 ap_uint<TrackBitWidths::kChi2RZSize> chi2RZ,
268 ap_uint<TrackBitWidths::kBendChi2Size> bendChi2,
269 ap_uint<TrackBitWidths::kHitPatternSize> hitPattern,
270 ap_uint<TrackBitWidths::kMVAQualitySize> mvaQuality,
271 ap_uint<TrackBitWidths::kMVAOtherSize> mvaOther);
287 unsigned int count = 0;
297 int digitizedValue = std::floor(
value /
lsb);
300 int digitizedMaximum = (1 << (nBits - 1)) - 1;
301 int digitizedMinimum = -1. * (digitizedMaximum + 1);
304 digitizedValue = std::clamp(digitizedValue, digitizedMinimum, digitizedMaximum);
307 unsigned int twosValue = digitizedValue;
308 if (digitizedValue < 0) {
309 twosValue += (1 << nBits);
315 template <
typename T>
318 return (
up -
bins.begin() - 1);
325 assert((twosValue >> nBits) == 0);
328 int digitizedValue = twosValue;
329 if (twosValue & (1 << (nBits - 1))) {
330 digitizedValue -= (1 << nBits);
334 return (
double(digitizedValue) +
offset) *
lsb;
constexpr double deltaPhi(double phi1, double phi2)
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RPhiSize > chi2RPhiBins
ap_uint< TrackBitWidths::kMVAQualitySize > qualityMVA_t
chi2rphi_t getChi2RPhiWord() const
unsigned int countSetBits(unsigned int n) const
otherMVA_t getMVAOtherWord() const
unsigned int getChi2RZBits() const
static constexpr double sectorWidth
static constexpr double minZ0
unsigned int getMVAQualityBits() const
unsigned int getChi2RPhiBits() const
static constexpr double minD0
valid_t getValidWord() const
ap_uint< kTrackWordSize > tkword_t
static constexpr double stepD0
void infoTestDigitizationScheme(const unsigned int, const double, const double, const unsigned int, const double, const unsigned int)
static constexpr std::array< double, 1<< TrackBitWidths::kBendChi2Size > bendChi2Bins
unsigned int getHitPatternBits() const
static constexpr double minTanl
static constexpr double minRinv
void testDigitizationScheme() const
double getChi2RPhi() const
unsigned int getValidBits() const
unsigned int getMVAOtherBits() const
ap_uint< TrackBitWidths::kZ0Size > z0_t
void setTrackWord(unsigned int valid, const GlobalVector &momentum, const GlobalPoint &POCA, double rInv, double chi2RPhi, double chi2RZ, double bendChi2, unsigned int hitPattern, double mvaQuality, double mvaOther, unsigned int sector)
std::bitset< kTrackWordSize > tkword_bs_t
double undigitizeSignedValue(unsigned int twosValue, unsigned int nBits, double lsb, double offset=0.5) const
static constexpr double stepRinv
const unsigned int kValidSize
ap_uint< TrackBitWidths::kMVAOtherSize > otherMVA_t
static constexpr std::array< double, 1<< TrackBitWidths::kMVAQualitySize > tqMVABins
TTTrack_TrackWord(const TTTrack_TrackWord &word)
ap_uint< TrackBitWidths::kValidSize > valid_t
ap_uint< TrackBitWidths::kRinvSize > rinv_t
Abs< T >::type abs(const T &t)
static constexpr double stepTanL
unsigned int getZ0Bits() const
rinv_t getRinvWord() const
tkword_t getTrackWord() const
ap_uint< TrackBitWidths::kHitPatternSize > hit_t
ap_uint< TrackBitWidths::kChi2RZSize > chi2rz_t
constexpr unsigned int getBin(double value, const T &bins) const
static constexpr double minPhi0
bendChi2_t getBendChi2Word() const
qualityMVA_t getMVAQualityWord() const
static constexpr float d0
unsigned int getTanlBits() const
static constexpr int kTrackWordSize
double getMVAQuality() const
static constexpr double stepPhi0
unsigned int getHitPattern() const
unsigned int digitizeSignedValue(double value, unsigned int nBits, double lsb) const
static constexpr unsigned int nSectors
ap_uint< TrackBitWidths::kTanlSize > tanl_t
static constexpr std::array< double, 1<< TrackBitWidths::kChi2RZSize > chi2RZBins
unsigned int getBendChi2Bits() const
unsigned int getNStubs() const
chi2rz_t getChi2RZWord() const
unsigned int getPhiBits() const
hit_t getHitPatternWord() const
ap_uint< TrackBitWidths::kD0Size > d0_t
TTTrack_TrackWord & operator=(const TTTrack_TrackWord &word)
static constexpr double stepZ0
bool singleDigitizationSchemeTest(const double floatingPointValue, const unsigned int nBits, const double lsb) const
ap_uint< TrackBitWidths::kChi2RPhiSize > chi2rphi_t
tanl_t getTanlWord() const
double getBendChi2() const
unsigned int getRinvBits() const
double getMVAOther() const
ap_uint< TrackBitWidths::kBendChi2Size > bendChi2_t
float localPhi(float globalPhi, unsigned int sector) const
ap_uint< TrackBitWidths::kPhiSize > phi_t
unsigned int getD0Bits() const